فهرست منبع

智享大屏迭代接口对接

zhangdan 4 سال پیش
والد
کامیت
8193d9cebe
4فایلهای تغییر یافته به همراه44 افزوده شده و 9 حذف شده
  1. 7 0
      pages/checkOut/checkOut.vue
  2. 21 6
      pages/login/login.vue
  3. 10 2
      pages/login/phoneLogin.vue
  4. 6 1
      pages/userCenter/index.vue

+ 7 - 0
pages/checkOut/checkOut.vue

@@ -135,6 +135,13 @@
 						})
 						return false
 					}
+					if(this.number<=0){
+						uni.showToast({
+							title: '输入的支付数量不能小于或等于0!',
+							icon: 'none'
+						})
+						return false
+					}
 					existPayPwd().then(res => {
 						console.log(res,'rrrrrr')
 						if(res.status == 200) {

+ 21 - 6
pages/login/login.vue

@@ -36,6 +36,7 @@
 				path: '/pages/index/index',
 				lanuch: false,
 				code: '',
+				url:'', // 二维码参数
 				wxButton: {
 					background: '#07c160'
 				},
@@ -46,6 +47,9 @@
 		},
 		mounted() {},
 		onLoad(option) {
+			if(option.q !=undefined){
+				this.url=decodeURIComponent(option.q)
+			}
 			// 开启分享
 			uni.showShareMenu({
 				withShareTicket: true,
@@ -86,11 +90,15 @@
 				console.log(this.code, e)
 				if (e.target.errMsg === 'getPhoneNumber:ok') {
 					setTimeout(()=>{
-						login({
+						const params={
 							code: _this.code,
 							encryptedData: e.target.encryptedData,
-							iv: e.target.iv
-						}).then(res => {
+							iv: e.target.iv,
+						}
+						if(_this.url){
+							params.encode=_this.url
+						}
+						login(params).then(res => {
 							uni.hideLoading();
 							_this.code = ''
 							console.log(res,_this.path, 'login data')
@@ -137,9 +145,16 @@
 			},
 			// 手机号登录
 			phoneLogin () {
-			  wx.navigateTo({
-			    url: '/pages/login/phoneLogin?path='+this.path+'&lanuch='+this.lanuch
-			  })
+				if(this.url){
+					wx.navigateTo({
+						url: '/pages/login/phoneLogin?path='+this.path+'&lanuch='+this.lanuch+'&encode='+this.url 
+					})
+				}else{
+					wx.navigateTo({
+						url: '/pages/login/phoneLogin?path='+this.path+'&lanuch='+this.lanuch
+					})
+				}
+			  
 			}
 		}
 	}

+ 10 - 2
pages/login/phoneLogin.vue

@@ -50,9 +50,13 @@
 				wxcode: '',
 				path: '/pages/index/index',
 				lanuch: false,
+				encode:'' // 二维码地址
 			}
 		},
 		onLoad(opts) {
+			console.log(opts,'----参数')
+			this.encode=opts.encode
+			console.log(opts,this.encode,'----参数')
 			// 开启分享
 			uni.showShareMenu({
 				withShareTicket: true,
@@ -60,8 +64,10 @@
 			})
 			const {
 				path,
-				lanuch
+				lanuch,
+				encode
 			} = option;
+			// console.log(option,'----参数')
 			this.lanuch = (lanuch + '') === 'true';
 		},
 		onUnload() {
@@ -89,7 +95,9 @@
 				obj.phone = _this.form.phone
 				obj.random = _this.randomCode  // 当前随机码
 				obj.verifiCode = _this.form.verifyCode
-				
+				if(this.encode){
+					obj.encode=this.encode
+				}
 				uni.login({
 					provider: 'weixin',
 					success(res) {

+ 6 - 1
pages/userCenter/index.vue

@@ -7,7 +7,8 @@
 				<u-image v-show="!hasLogin" src="/static/logo.png" width="100" height="100"></u-image>
 			</view>
 			<view class="user-info">
-				<text v-if="hasLogin">{{user.mobile||'--'}}</text>
+				<view v-if="hasLogin" class="user-info-item">{{user.mobile||'--'}}</view>
+				<view v-if="hasLogin" class="user-info-item">注册时间:{{user.registerTime||'--'}}</view>
 				<u-button v-else="!hasLogin" plain size="mini" shape="circle" @click="toLoginPage">立即登录</u-button>
 			</view>
 			<view v-if="hasLogin">
@@ -80,6 +81,7 @@
 					if(res.status == 200){
 						this.$u.vuex("vuex_userData",res.data)
 						this.userData = res.data
+						console.log(this.userData,'-----用户信息')
 					}
 				})
 			},
@@ -146,6 +148,9 @@
 				flex-grow: 1;
 				padding: 0 20rpx;
 				color: #FFFFFF;
+				.user-info-item{
+					margin: 10rpx 0;
+				}
 			}
 			.user-photo{
 				width: 100rpx;