浏览代码

1.调试用户登录接口
2.调试经销商登录接口
3.其他问题沟通

zizhong.wang 5 年之前
父节点
当前提交
1941e26baf
共有 5 个文件被更改,包括 111 次插入119 次删除
  1. 5 2
      App.vue
  2. 52 54
      pages/index/customPage/index.vue
  3. 44 6
      pages/index/dealerPage/index.vue
  4. 4 53
      pages/index/index.vue
  5. 6 4
      pages/index/successPage/index.vue

+ 5 - 2
App.vue

@@ -6,12 +6,15 @@
 			//shareUrl: 'https://fenxiao.xazhima.com/api/api.php', //开发环境全局接口域名 线上:https://f.xazhima.com/api/api.php
 			globalTimestamp: (Date.now()).toString(),
 			user_id: '',
-			open_id:'',
+			openId:'',
 			isAuth:true,
 			session_key: '',
 			isAndroid:Boolean,
 			isIos:false,
-			userPhone:''
+			userPhone:'',
+			userCodeNumber:'',
+			managerName:'',
+			managerPhone:''
 		},
 		onLaunch: function() {
 			uni.hideTabBar({})

+ 52 - 54
pages/index/customPage/index.vue

@@ -27,8 +27,8 @@
 			</view>
 			<view class="info-gender-box">
 				<radio-group @change="radioCheck" class="padding-left-2">
-					<label class="radio margin-right-10"><radio value="0" :checked="userSex==='0'" color="#00A1B4" class="form-radio"/>男</label>
-					<label class="radio"><radio value="1" :checked="userSex==='1'"  color="#00A1B4" class="form-radio"/>女</label>
+					<label class="radio margin-right-10"><radio value="1" :checked="userSex==='1'" color="#00A1B4" class="form-radio"/>男</label>
+					<label class="radio"><radio value="0" :checked="userSex==='0'"  color="#00A1B4" class="form-radio"/>女</label>
 				</radio-group>
 			</view>		
 		</view>
@@ -58,7 +58,7 @@
 							</picker> -->
 						</view>
 					<view class="textarea-box">
-					     <textarea  auto-height placeholder="请输入详细地址" />
+					     <textarea  auto-height placeholder="请输入详细地址" v-model="addressDetail" />
 					 </view>
 			</view>		
 		</view>
@@ -103,7 +103,7 @@
 				<text>您目前从事的家具品牌</text>
 			</view>
 			<view class="info-value-box">
-				<input type="text" placeholder="请输入您目前从事的家具品牌">
+				<input type="text" placeholder="请输入您目前从事的家具品牌" v-model="userBrand">
 			</view>		
 		</view>
 		
@@ -144,7 +144,11 @@
 					province: '',
 					city: '',
 				},
-				address: ''
+				address: '',
+				addressObj:{},
+				userBrand:'',
+				addressDetail:'',
+				loginObj:{}
 			}
 		},
 		onLoad() {
@@ -164,6 +168,7 @@
 		methods: {
 			addresspick(obj) {
 				console.log(obj)
+				this.addressObj = obj;
 				this.txt = obj.province.name + obj.city.name;
 			},
 			getProvinceRequest(){
@@ -247,52 +252,6 @@
 				 this.txt = data.data.join('')
 				 console.log(data.data.join(''))
 			  },
-			 bindMultiPickerColumnChange: function(e) {
-			 	console.log('修改的列为:' + e.detail.column + ',值为:' + e.detail.value)
-			 	this.multiIndex[e.detail.column] = e.detail.value
-			 	switch (e.detail.column) {
-			 		case 0: //拖动第1列
-			 			switch (this.multiIndex[0]) {
-			 				case 0:
-			 					this.multiArray[1] = ['中国', '日本']
-			 					this.multiArray[2] = ['北京', '上海', '广州']
-			 					break
-			 				case 1:
-			 					this.multiArray[1] = ['英国', '法国']
-			 					this.multiArray[2] = ['伦敦', '曼彻斯特']
-			 					break
-			 			}
-			 			this.multiIndex.splice(1, 1, 0)
-			 			this.multiIndex.splice(2, 1, 0)
-			 			break
-			 		case 1: //拖动第2列
-			 			switch (this.multiIndex[0]) { //判断第一列是什么
-			 				case 0:
-			 					switch (this.multiIndex[1]) {
-			 						case 0:
-			 							this.multiArray[2] = ['北京', '上海', '广州']
-			 							break
-			 						case 1:
-			 							this.multiArray[2] = ['东京','北海道']
-			 							break
-			 					}
-			 					break
-			 				case 1:
-			 					switch (this.multiIndex[1]) {
-			 						case 0:
-			 							this.multiArray[2] = ['伦敦', '曼彻斯特']
-			 							break
-			 						case 1:
-			 							this.multiArray[2] = ['巴黎', '马赛']
-			 							break
-			 					}
-			 					break
-			 			}
-			 			this.multiIndex.splice(2, 1, 0)
-			 			break
-			 	}
-			 	this.$forceUpdate()
-			 }, 
 			 bindPickerChange(e,type) {
 						 let that = this;
 						  switch (type){
@@ -352,11 +311,50 @@
 			  	}
 			  },
 			submitRequest(params){
-				 console.log(params)
-				//this.goCustomCardPage('0')
+				   console.log(params)
+				 	 let that = this;
+				 	 uni.request({
+				 		url:getApp().globalData.shareUrl, //需要设置为全局
+				 		method: 'POST',
+				 		header: {
+				 			'content-type': 'application/x-www-form-urlencoded'
+				 		},
+				 		data: {
+				 			method: 'common_guest_login',
+				 			timestamp: getApp().globalData.globalTimestamp, //Date.now()
+				 			sign: md5('common_guest_login' + getApp().globalData.globalTimestamp),
+							phone:getApp().globalData.userPhone,
+							wxopenid:getApp().globalData.openId,
+							name:params.selfName,
+							sex:that.userSex,//0-女 1-男
+							province:that.addressObj.province.id,//省份id
+							city:that.addressObj.city.id,//城市id
+							detailaddress:that.addressDetail,
+							hangye:params.trade,
+							zhiye:params.profession,
+							purpose:params.ends,
+							brand:that.userBrand,
+				 		},
+				 		success: res => {
+				 			console.log(res)
+							if(res.data.code === 200){
+								that.loginObj = res.data.msg;
+								getApp().globalData.userCodeNumber = that.loginObj.code;
+								getApp().globalData.managerPhone = that.loginObj.qyjl_phone;
+								getApp().globalData.managerName = that.loginObj.qyjl_name;
+								this.goCustomCardPage(that.loginObj.pass)
+							}
+						    else {
+								uni.showToast({
+									title: res.data.msg,
+									icon: 'none'
+								});
+							}
+				 		} 
+				 	 });
 			},  
 			goCustomCardPage(type){
-				type === '1' ? 
+				type === 1 ? 
 				uni.redirectTo({
 					url: '/pages/index/successPage/index?types='+'custom', //游客成功页面
 					success: res => {},

+ 44 - 6
pages/index/dealerPage/index.vue

@@ -27,8 +27,8 @@
 			</view>
 			<view class="info-gender-box">
 				<radio-group @change="radioCheck" class="padding-left-2">
-					<label class="radio margin-right-10"><radio value="0" :checked="userSex==='0'" color="#00A1B4" class="form-radio"/>男</label>
-					<label class="radio"><radio value="1" :checked="userSex==='1'"  color="#00A1B4" class="form-radio"/>女</label>
+					<label class="radio margin-right-10"><radio value="1" :checked="userSex==='1'" color="#00A1B4" class="form-radio"/>男</label>
+					<label class="radio"><radio value="0" :checked="userSex==='0'"  color="#00A1B4" class="form-radio"/>女</label>
 				</radio-group>
 			</view>		
 		</view>
@@ -109,7 +109,9 @@
 					province: '',
 					city: '',
 				},
-				address: ''
+				address: '',
+				addressObj:{},
+				loginObj:{},
 			}
 		},
 		onLoad(option) {
@@ -126,6 +128,7 @@
 		methods: {
 			addresspick(obj) {
 				console.log(obj)
+				this.addressObj = obj;
 				this.txt = obj.province.name + obj.city.name;
 			},
 			 radioCheck(e){
@@ -169,11 +172,46 @@
 			  		});
 			  	}
 			  },
-			  submitRequest(){
-			  	this.goCustomCardPage('1')
+			  submitRequest(params){
+				  let that = this;
+				  uni.request({
+					url:getApp().globalData.shareUrl, //需要设置为全局
+					method: 'POST',
+					header: {
+						'content-type': 'application/x-www-form-urlencoded'
+					},
+					data: {
+						method: 'jxs_guest_login',
+						timestamp: getApp().globalData.globalTimestamp, //Date.now()
+						sign: md5('jxs_guest_login' + getApp().globalData.globalTimestamp),
+						phone:getApp().globalData.userPhone,
+						wxopenid:getApp().globalData.openId,
+						name:params.selfName,
+						sex:that.userSex,//0-女 1-男
+						province:that.addressObj.province.id,//省份id
+						city:that.addressObj.city.id,//城市id
+						jxs_name:params.dealerName,
+					},
+					success: res => {
+						console.log(res)
+						if(res.data.code === 200){
+							that.loginObj = res.data.msg;
+							getApp().globalData.userCodeNumber = that.loginObj.code;
+							getApp().globalData.managerPhone = that.loginObj.qyjl_phone;
+							getApp().globalData.managerName = that.loginObj.qyjl_name;
+							this.goCustomCardPage(that.loginObj.pass)
+						}
+						else {
+							uni.showToast({
+								title: res.data.msg,
+								icon: 'none'
+							});
+						}
+					} 
+				  });
 			  },  
 			  goCustomCardPage(type){
-			  	type === '1' ? 
+			  	type === 1 ? 
 			  	uni.redirectTo({
 			  		url: '/pages/index/successPage/index?types='+'dealer', //经销商成功页面
 			  		success: res => {},

+ 4 - 53
pages/index/index.vue

@@ -157,9 +157,12 @@
 				 					// 通过openid发起会员登录
 									//type  1-普通客户  2-经销商客户  3-不存在需授权登录
 									//pass  0-未知   1-允许入场  -1 - 禁止入场   ,
-									console.log(res.data)
 									if(res.data.code === 200){
 										that.userInfoObj = res.data.msg;
+										getApp().globalData.openId = that.userInfoObj.openid;
+										getApp().globalData.userCodeNumber = that.userInfoObj.code;
+										getApp().globalData.managerPhone = that.userInfoObj.qyjl_phone;
+										getApp().globalData.managerName = that.userInfoObj.qyjl_name;
 										that.judgeUserType(that.userInfoObj.type,that.userInfoObj.pass)
 									}else {
 										uni.showToast({
@@ -173,58 +176,6 @@
 				 	}
 				 });
 			 },
-			 getPageInfo(uId){ //获取首页面基本信息接口
-			     uni.showLoading({
-			     	title: '加载中',
-			     });
-				 let that = this;
-				uni.request({
-					url: getApp().globalData.shareUrl, //需要设置为全局
-					method: 'POST',
-					header: {
-						'content-type': 'application/x-www-form-urlencoded'
-					},
-					data: {
-						method: 'getHomePageInfo',
-						timestamp: getApp().globalData.globalTimestamp, //Date.now()
-						id: 1,
-						sign: md5('getHomePageInfo' + getApp().globalData.globalTimestamp)
-					},
-					success: res => {
-						if (res.data.code === 200) {
-							uni.hideLoading();
-							that.pageInfo = res.data.msg;
-							getApp().globalData.shareImg = res.data.msg.picture;
-							getApp().globalData.shareContent = res.data.msg.sharecontent;
-							getApp().globalData.shareTaobaoCode = res.data.msg.copycontent;
-							getApp().globalData.shareStoreImg = res.data.msg.heading;
-						}
-					}
-				});
-			},
-			 showShareModal(){
-			         // 需要在 popup 组件,指定 ref 为 popup
-			 		if(this.isAuthPhone){
-						this.$refs.popup.open();
-			 		}else {
-			 			uni.navigateTo({
-			 				url: '../auth/index',
-			 				success: res => {},
-			 				fail: () => {},
-			 				complete: () => {}
-			 			});
-			 		}
-			       },
-			 cancelModal(){
-			 	          // 需要在 popup 组件,指定 ref 为 popup
-			 	     this.$refs.popup.close();
-			 },
-			 goPostShare() {
-						this.$refs.popup.close()
-						uni.navigateTo({
-							url: '/pages/index/postShare/index'
-						})
-					},
 		}
 	}
 </script>

+ 6 - 4
pages/index/successPage/index.vue

@@ -3,7 +3,7 @@
 	<view class="content">
 		 <view class="success-bg-box">
 			 <view class="title-font">科尔卡诺展会入场登记</view>
-			 <view class="number-box">编号:1523</view>
+			 <view class="number-box">编号:{{userCodeNumber}}</view>
 			 <view v-show="pageTypes==='custom'">
 				 <view class="show-tips-box">请将此编码,展示给工作人员,</view>
 				 <view class="show-tips-box">方可入内,截图无效。</view>
@@ -14,7 +14,7 @@
 		     </view> 
 		 </view>
 		 <view class="phone-box">
-			 <view class="phone-value-box">您的专属顾问:{{salePhone}} (张经理)</view>
+			 <view class="phone-value-box">您的专属顾问:{{salePhone}} ({{saleName}})</view>
 			 <view class="phone-tips">请保存此电话,展馆内有问题均可咨询!</view>
 			 <button type="primary" @tap="callPhone">拨打</button>
 		 </view>
@@ -32,8 +32,10 @@
 		data() {
 			return {
 				pageTypes:'custom',
-				salePhone:'13652320120',
-				registerDate:'2020-07-06 12:12'
+				salePhone:getApp().globalData.managerPhone || '18968063152',
+				saleName:getApp().globalData.managerName || '王亚楠',
+				registerDate:'2020-07-06 12:12',
+				userCodeNumber:getApp().globalData.userCodeNumber
 			}
 		},
 		onLoad(option) {