twt 7 months ago
parent
commit
5f7c6a1c30
5 changed files with 579 additions and 8 deletions
  1. 145 1
      pages/subPack/rescueOrder.vue
  2. 144 0
      pages/user/addCar/cailist.vue
  3. 145 3
      pages/user/myBespeak.vue
  4. 144 3
      pages/user/myOrder/myOrder.vue
  5. 1 1
      utils/request.js

+ 145 - 1
pages/subPack/rescueOrder.vue

@@ -47,6 +47,17 @@
 
 			<nodata v-show="items==''&&isload"></nodata>
 		</view>
+		<!-- 手机号授权 -->
+			<view class="authorizBox" v-if="authorizShow" @click="authorizShow=false">
+				<view class="authorizCont" @click.stop="">
+					<view class="authorizName">{{wxOpenData.miniAppName}}</view>
+					<view class="authorizMs">您好,欢迎访问本店,授权手机号登录能获取我们最新的促销活动哦~</view>
+					<button class="authorizContbutton" type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">授权</button>
+				</view>
+				<view style="text-align: center;padding-top: 56rpx;">
+					<image src="../../../static/timg/icon_guanbi@2x.png" mode="" class="authorizCloseImg"></image>
+				</view>
+			</view>
 	</view>
 </template>
 
@@ -64,18 +75,65 @@
 				items: [],
 				isload: false,
                 iStatusBarHeight:'',
+				userInfo:'',
+				ext:'',
+				wxOpenData:'',
+				themeColor:'',
+				authorizShow:false,
+				code:'',
 			}
 		},
 		onLoad(opt) {
             this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
 			this.tabIndex = opt.num;
-			this.getData()
+			this.userInfo=this.$store.state.userInfo;
+			this.ext=this.$common.getExtStoreId();
+			this.themeColor = uni.getStorageSync("themeColor");
+			if(this.userInfo){
+				this.getData()
+			}else{
+				this.$common.automaticlogin().then(val => {
+					this.userInfo=this.$store.state.userInfo;
+					this.wxOpenData=this.$store.state.wxOpenData;
+					this.themeColor = uni.getStorageSync("themeColor");
+					this.getData();
+					if(!this.userInfo){
+						this.authorizShow=true
+					}
+				})
+			}
+			//this.getData()
 		},
 		onShow() {
 			console.log(this.tabIndex)
 			this.getData()
 		},
 		methods: {
+			decryptPhoneNumber: function(e) {
+			  console.log(e);
+			  this.code=e.detail.code
+			  this.wxPhoneLogin()
+			  this.authorizShow=false;
+			},
+			wxPhoneLogin(){
+					 var that=this;
+					 this.$http('miniApp2/sys/wxPhoneLogin', {
+					   appId:this.ext.appId,
+					   unionId:this.ext.unionId,
+					   code:this.code,
+					   openId:this.wxOpenData.openid
+					  },'POST').then(res => {
+						var data = res.data;
+						if(data.loginInfo){
+							this.userInfo=data.loginInfo.openUser;
+							this.wxOpenData=data.loginInfo;
+							this.$store.commit('mutationswxOpenData', data)
+							this.$store.commit('mutationsuserInfo', this.userInfo)
+						    this.getData()
+						}	
+					  })
+			},
+			
 			tabClick(num) {
 				this.tabIndex = num;
 				this.page = 1;
@@ -296,4 +354,90 @@
 		font-size: 24rpx;
 		padding-left: 20rpx;
 	}
+	.authorizBox{
+			width: 100vw;
+			height: 100vh;
+			background: rgba(0, 0, 0, 0.5);
+			position: fixed;
+			top: 0;
+			left: 0;
+		}
+		.authorizCont{
+			margin-top: 30vh;
+			width: 564rpx;
+			height: 408rpx;
+			background: #FFFFFF;
+			border-radius: 24rpx;
+			margin-left: 93rpx;
+			position: relative;
+		}
+		.authorizCloseImg{
+			width: 62rpx;
+			height: 62rpx;
+		}
+		.sqLogoBox{
+			width: 180rpx;
+			height: 180rpx;
+			background: #FFFFFF;
+			border-radius: 90rpx;
+			text-align: center;
+			position: absolute;
+			top: -50rpx;
+			left: 192rpx;
+		}
+		.authorizName{
+			color: #333333;
+			line-height: 42rpx;
+			font-size: 30rpx;
+			text-align: center;
+			padding-top: 58rpx;
+		}
+		.authorizMs{
+			color: #999999;
+			line-height: 36rpx;
+			font-size: 26rpx;
+			width: 452rpx;
+			padding-top: 24rpx;
+			text-align: center;
+			margin-left: 56rpx;
+		}
+		.authorizContbutton{
+			width: 422rpx;
+			height: 88rpx;
+			background: #D53533;
+			border-radius: 44rpx;
+			line-height: 88rpx;
+			text-align: center;
+			font-size:30rpx;
+			color: #FFFFFF;
+			margin-top: 62rpx;
+			margin-left:71rpx;
+		}
+		.shopBoxpt{
+			margin-top: 20rpx;
+		}
+		button::after{
+		 	border: none;
+		}
+		button{
+			position: relative;
+			display: block;
+			margin-left: 0;
+			margin-right: 0;
+			padding-left: 0px;
+			padding-right: 0px;
+			box-sizing: border-box;
+			// font-size: 18px;
+			text-align: center;
+			text-decoration: none;
+			// line-height: 1;
+			line-height: 1.35;
+			// border-radius: 5px;
+			-webkit-tap-highlight-color: transparent;
+			overflow: hidden;
+			color: #000000;
+			background-color: #fff;
+			
+			height: 100%;
+			}
 </style>

+ 144 - 0
pages/user/addCar/cailist.vue

@@ -73,6 +73,18 @@
 				<view>添加爱车</view>
 			</view>
 		</view> 
+		
+		<!-- 手机号授权 -->
+			<view class="authorizBox" v-if="authorizShow" @click="authorizShow=false">
+				<view class="authorizCont" @click.stop="">
+					<view class="authorizName">{{wxOpenData.miniAppName}}</view>
+					<view class="authorizMs">您好,欢迎访问本店,授权手机号登录能获取我们最新的促销活动哦~</view>
+					<button class="authorizContbutton" type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">授权</button>
+				</view>
+				<view style="text-align: center;padding-top: 56rpx;">
+					<image src="../../../static/timg/icon_guanbi@2x.png" mode="" class="authorizCloseImg"></image>
+				</view>
+			</view>
 
 	</view>
 </template>
@@ -93,6 +105,11 @@
 				themeColor:'',
 				iStatusBarHeight:'',
 				openMCar:'',
+				userInfo:'',
+				ext:'',
+				wxOpenData:'',
+				authorizShow:false,
+				code:'',
 			}
 		},
 		onLoad(opt) {
@@ -103,12 +120,52 @@
 			this.fromMe = opt.fromMe
 			 this.themeColor = uni.getStorageSync("themeColor");
             this.openMCar=uni.getStorageSync("openMCar");
+			this.userInfo=this.$store.state.userInfo;
+			this.ext=this.$common.getExtStoreId();
+			if(this.userInfo){
+				this.getqueryMyBMemberCar()
+			}else{
+				this.$common.automaticlogin().then(val => {
+					this.userInfo=this.$store.state.userInfo;
+					this.wxOpenData=this.$store.state.wxOpenData;
+					this.themeColor = uni.getStorageSync("themeColor");
+					this.getqueryMyBMemberCar();
+					if(!this.userInfo){
+						this.authorizShow=true
+					}
+				})
+			}
 		},
 		onShow() {
 			this.getqueryMyBMemberCar();
 			this.carId = uni.getStorageSync("maintainCarData").id
 		},
 		methods: {
+			decryptPhoneNumber: function(e) {
+			  console.log(e);
+			  this.code=e.detail.code
+			  this.wxPhoneLogin()
+			  this.authorizShow=false;
+			},
+			wxPhoneLogin(){
+					 var that=this;
+					 this.$http('miniApp2/sys/wxPhoneLogin', {
+					   appId:this.ext.appId,
+					   unionId:this.ext.unionId,
+					   code:this.code,
+					   openId:this.wxOpenData.openid
+					  },'POST').then(res => {
+						var data = res.data;
+						if(data.loginInfo){
+							this.userInfo=data.loginInfo.openUser;
+							this.wxOpenData=data.loginInfo;
+							this.$store.commit('mutationswxOpenData', data)
+							this.$store.commit('mutationsuserInfo', this.userInfo)
+						    this.getqueryMyBMemberCar()
+						}	
+					  })
+			},
+			
 			maintain(item){
 				uni.navigateTo({
 					
@@ -373,4 +430,91 @@
 		color: #FFFFFF;
 		font-size: 22rpx;
 	}
+	
+	.authorizBox{
+			width: 100vw;
+			height: 100vh;
+			background: rgba(0, 0, 0, 0.5);
+			position: fixed;
+			top: 0;
+			left: 0;
+		}
+		.authorizCont{
+			margin-top: 30vh;
+			width: 564rpx;
+			height: 408rpx;
+			background: #FFFFFF;
+			border-radius: 24rpx;
+			margin-left: 93rpx;
+			position: relative;
+		}
+		.authorizCloseImg{
+			width: 62rpx;
+			height: 62rpx;
+		}
+		.sqLogoBox{
+			width: 180rpx;
+			height: 180rpx;
+			background: #FFFFFF;
+			border-radius: 90rpx;
+			text-align: center;
+			position: absolute;
+			top: -50rpx;
+			left: 192rpx;
+		}
+		.authorizName{
+			color: #333333;
+			line-height: 42rpx;
+			font-size: 30rpx;
+			text-align: center;
+			padding-top: 58rpx;
+		}
+		.authorizMs{
+			color: #999999;
+			line-height: 36rpx;
+			font-size: 26rpx;
+			width: 452rpx;
+			padding-top: 24rpx;
+			text-align: center;
+			margin-left: 56rpx;
+		}
+		.authorizContbutton{
+			width: 422rpx;
+			height: 88rpx;
+			background: #D53533;
+			border-radius: 44rpx;
+			line-height: 88rpx;
+			text-align: center;
+			font-size:30rpx;
+			color: #FFFFFF;
+			margin-top: 62rpx;
+			margin-left:71rpx;
+		}
+		.shopBoxpt{
+			margin-top: 20rpx;
+		}
+		button::after{
+		 	border: none;
+		}
+		button{
+			position: relative;
+			display: block;
+			margin-left: 0;
+			margin-right: 0;
+			padding-left: 0px;
+			padding-right: 0px;
+			box-sizing: border-box;
+			// font-size: 18px;
+			text-align: center;
+			text-decoration: none;
+			// line-height: 1;
+			line-height: 1.35;
+			// border-radius: 5px;
+			-webkit-tap-highlight-color: transparent;
+			overflow: hidden;
+			color: #000000;
+			background-color: #fff;
+			
+			height: 100%;
+			}
 </style>

+ 145 - 3
pages/user/myBespeak.vue

@@ -26,7 +26,17 @@
 		<view class="noMore" v-if="noMoreShow && (itemData.length!=0)">没有更多数据</view>
 		<!-- 无数据空白页 -->
 		<nodata v-if="itemData.length==0"></nodata>
-
+        <!-- 手机号授权 -->
+        	<view class="authorizBox" v-if="authorizShow" @click="authorizShow=false">
+        		<view class="authorizCont" @click.stop="">
+        			<view class="authorizName">{{wxOpenData.miniAppName}}</view>
+        			<view class="authorizMs">您好,欢迎访问本店,授权手机号登录能获取我们最新的促销活动哦~</view>
+        			<button class="authorizContbutton" type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">授权</button>
+        		</view>
+        		<view style="text-align: center;padding-top: 56rpx;">
+        			<image src="../../../static/timg/icon_guanbi@2x.png" mode="" class="authorizCloseImg"></image>
+        		</view>
+        	</view>
 	</view>
 </template>
 
@@ -44,18 +54,64 @@
 				itemData: [],
 				noMoreShow: false,
 				iStatusBarHeight:'',
+				userInfo:'',
+				ext:'',
+				wxOpenData:'',
+				themeColor:'',
+				authorizShow:false,
+				code:'',
 			}
 		},
 		onLoad() {
 			this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
 			this.page = 1
-			this.myOrderCoupon()
+			//this.myOrderCoupon()
+			this.userInfo=this.$store.state.userInfo;
+			this.ext=this.$common.getExtStoreId();
+			this.themeColor = uni.getStorageSync("themeColor");
+			if(this.userInfo){
+				this.myOrderCoupon()
+			}else{
+				this.$common.automaticlogin().then(val => {
+					this.userInfo=this.$store.state.userInfo;
+					this.wxOpenData=this.$store.state.wxOpenData;
+					this.themeColor = uni.getStorageSync("themeColor");
+					this.myOrderCoupon();
+					if(!this.userInfo){
+						this.authorizShow=true
+					}
+				})
+			}
 		},
 		onShow() {
 			this.page = 1
 			this.myOrderCoupon()
 		},
 		methods: {
+			decryptPhoneNumber: function(e) {
+			  console.log(e);
+			  this.code=e.detail.code
+			  this.wxPhoneLogin()
+			  this.authorizShow=false;
+			},
+			wxPhoneLogin(){
+					 var that=this;
+					 this.$http('miniApp2/sys/wxPhoneLogin', {
+					   appId:this.ext.appId,
+					   unionId:this.ext.unionId,
+					   code:this.code,
+					   openId:this.wxOpenData.openid
+					  },'POST').then(res => {
+						var data = res.data;
+						if(data.loginInfo){
+							this.userInfo=data.loginInfo.openUser;
+							this.wxOpenData=data.loginInfo;
+							this.$store.commit('mutationswxOpenData', data)
+							this.$store.commit('mutationsuserInfo', this.userInfo)
+						    this.myOrderCoupon()
+						}	
+					  })
+			},
 			goDetail(id) {
 				uni.navigateTo({
 					url: 'bespeakDetail?id=' + id
@@ -120,7 +176,7 @@
 	}
 </script>
 
-<style>
+<style scoped lang="scss">
 	.box {
 		min-height: 100vh;
 		background-color: #F4F5F7;
@@ -191,4 +247,90 @@
 		color: #999999;
 		font-size: 28rpx;
 	}
+	.authorizBox{
+			width: 100vw;
+			height: 100vh;
+			background: rgba(0, 0, 0, 0.5);
+			position: fixed;
+			top: 0;
+			left: 0;
+		}
+		.authorizCont{
+			margin-top: 30vh;
+			width: 564rpx;
+			height: 408rpx;
+			background: #FFFFFF;
+			border-radius: 24rpx;
+			margin-left: 93rpx;
+			position: relative;
+		}
+		.authorizCloseImg{
+			width: 62rpx;
+			height: 62rpx;
+		}
+		.sqLogoBox{
+			width: 180rpx;
+			height: 180rpx;
+			background: #FFFFFF;
+			border-radius: 90rpx;
+			text-align: center;
+			position: absolute;
+			top: -50rpx;
+			left: 192rpx;
+		}
+		.authorizName{
+			color: #333333;
+			line-height: 42rpx;
+			font-size: 30rpx;
+			text-align: center;
+			padding-top: 58rpx;
+		}
+		.authorizMs{
+			color: #999999;
+			line-height: 36rpx;
+			font-size: 26rpx;
+			width: 452rpx;
+			padding-top: 24rpx;
+			text-align: center;
+			margin-left: 56rpx;
+		}
+		.authorizContbutton{
+			width: 422rpx;
+			height: 88rpx;
+			background: #D53533;
+			border-radius: 44rpx;
+			line-height: 88rpx;
+			text-align: center;
+			font-size:30rpx;
+			color: #FFFFFF;
+			margin-top: 62rpx;
+			margin-left:71rpx;
+		}
+		.shopBoxpt{
+			margin-top: 20rpx;
+		}
+		button::after{
+		 	border: none;
+		}
+		button{
+			position: relative;
+			display: block;
+			margin-left: 0;
+			margin-right: 0;
+			padding-left: 0px;
+			padding-right: 0px;
+			box-sizing: border-box;
+			// font-size: 18px;
+			text-align: center;
+			text-decoration: none;
+			// line-height: 1;
+			line-height: 1.35;
+			// border-radius: 5px;
+			-webkit-tap-highlight-color: transparent;
+			overflow: hidden;
+			color: #000000;
+			background-color: #fff;
+			
+			height: 100%;
+			}
 </style>

+ 144 - 3
pages/user/myOrder/myOrder.vue

@@ -41,6 +41,17 @@
 
 			<nodata v-show="items==''&&isload"></nodata>
 		</view>
+		<!-- 手机号授权 -->
+			<view class="authorizBox" v-if="authorizShow" @click="authorizShow=false">
+				<view class="authorizCont" @click.stop="">
+					<view class="authorizName">{{wxOpenData.miniAppName}}</view>
+					<view class="authorizMs">您好,欢迎访问本店,授权手机号登录能获取我们最新的促销活动哦~</view>
+					<button class="authorizContbutton" type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">授权</button>
+				</view>
+				<view style="text-align: center;padding-top: 56rpx;">
+					<image src="../../../static/timg/icon_guanbi@2x.png" mode="" class="authorizCloseImg"></image>
+				</view>
+			</view>
 	</view>
 </template>
 
@@ -58,13 +69,34 @@
 				items: [],
 				isload: false,
                 iStatusBarHeight:'',
+				userInfo:'',
+				ext:'',
+				wxOpenData:'',
+				themeColor:'',
+				authorizShow:false,
+				code:'',
 			}
 		},
 		onLoad(opt) {
             this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
 			this.tabIndex = opt.num;
-
-			this.getData()
+            this.userInfo=this.$store.state.userInfo;
+            this.ext=this.$common.getExtStoreId();
+			this.themeColor = uni.getStorageSync("themeColor");
+            if(this.userInfo){
+            	this.getData()
+            }else{
+            	this.$common.automaticlogin().then(val => {
+            		this.userInfo=this.$store.state.userInfo;
+            		this.wxOpenData=this.$store.state.wxOpenData;
+					this.themeColor = uni.getStorageSync("themeColor");
+            		this.getData();
+            		if(!this.userInfo){
+            			this.authorizShow=true
+            		}
+            	})
+            }
+			
 		},
 		onShow() {
 			console.log(this.tabIndex)
@@ -73,7 +105,30 @@
 
 		},
 		methods: {
-
+           decryptPhoneNumber: function(e) {
+             console.log(e);
+             this.code=e.detail.code
+             this.wxPhoneLogin()
+             this.authorizShow=false;
+           },
+           wxPhoneLogin(){
+           		 var that=this;
+           		 this.$http('miniApp2/sys/wxPhoneLogin', {
+           		   appId:this.ext.appId,
+           		   unionId:this.ext.unionId,
+           		   code:this.code,
+           		   openId:this.wxOpenData.openid
+           		  },'POST').then(res => {
+           			var data = res.data;
+           			if(data.loginInfo){
+           				this.userInfo=data.loginInfo.openUser;
+           				this.wxOpenData=data.loginInfo;
+           				this.$store.commit('mutationswxOpenData', data)
+           				this.$store.commit('mutationsuserInfo', this.userInfo)
+           			    this.getData()
+           			}	
+           		  })
+           },
 
 
 			tabClick(num) {
@@ -314,4 +369,90 @@
 		font-size: 24rpx;
 		padding-left: 20rpx;
 	}
+	.authorizBox{
+			width: 100vw;
+			height: 100vh;
+			background: rgba(0, 0, 0, 0.5);
+			position: fixed;
+			top: 0;
+			left: 0;
+		}
+		.authorizCont{
+			margin-top: 30vh;
+			width: 564rpx;
+			height: 408rpx;
+			background: #FFFFFF;
+			border-radius: 24rpx;
+			margin-left: 93rpx;
+			position: relative;
+		}
+		.authorizCloseImg{
+			width: 62rpx;
+			height: 62rpx;
+		}
+		.sqLogoBox{
+			width: 180rpx;
+			height: 180rpx;
+			background: #FFFFFF;
+			border-radius: 90rpx;
+			text-align: center;
+			position: absolute;
+			top: -50rpx;
+			left: 192rpx;
+		}
+		.authorizName{
+			color: #333333;
+			line-height: 42rpx;
+			font-size: 30rpx;
+			text-align: center;
+			padding-top: 58rpx;
+		}
+		.authorizMs{
+			color: #999999;
+			line-height: 36rpx;
+			font-size: 26rpx;
+			width: 452rpx;
+			padding-top: 24rpx;
+			text-align: center;
+			margin-left: 56rpx;
+		}
+		.authorizContbutton{
+			width: 422rpx;
+			height: 88rpx;
+			background: #D53533;
+			border-radius: 44rpx;
+			line-height: 88rpx;
+			text-align: center;
+			font-size:30rpx;
+			color: #FFFFFF;
+			margin-top: 62rpx;
+			margin-left:71rpx;
+		}
+		.shopBoxpt{
+			margin-top: 20rpx;
+		}
+		button::after{
+		 	border: none;
+		}
+		button{
+			position: relative;
+			display: block;
+			margin-left: 0;
+			margin-right: 0;
+			padding-left: 0px;
+			padding-right: 0px;
+			box-sizing: border-box;
+			// font-size: 18px;
+			text-align: center;
+			text-decoration: none;
+			// line-height: 1;
+			line-height: 1.35;
+			// border-radius: 5px;
+			-webkit-tap-highlight-color: transparent;
+			overflow: hidden;
+			color: #000000;
+			background-color: #fff;
+			
+			height: 100%;
+			}
 </style>

+ 1 - 1
utils/request.js

@@ -11,7 +11,7 @@ console.log(extConfig)
 const baseUrl=extConfig.url+'/'
 
 //const baseUrl='http://dms.66km.com.cn/'
-//const baseUrl='http://192.168.0.174:20187/'
+/* const baseUrl='http://192.168.0.8:20187/' */
 //const baseUrl='https://store-api.qdbtl.cn/'
 //const baseUrl='https://apidms.66km.com/'