twt před 1 rokem
rodič
revize
23ffea297e

+ 153 - 0
components/authoriz/authoriz.vue

@@ -0,0 +1,153 @@
+<template>
+	<view class="" >
+		
+	<view class="authorizBox"  @click="authorizHide()" v-if="authorizShow">
+		<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>
+
+<script>
+export default {
+	data() {
+		return {
+			wxOpenData: '',
+			plateNumber:'',
+			ext:'',
+			userInfo: '',
+			code:'',
+			authorizShow:false
+		}
+	},
+	onLoad(opt) {
+      
+	},
+	onShow() {
+		
+	},
+	methods: {
+		init(){
+			this.userInfo=this.$store.state.userInfo;
+			this.ext=this.$common.getExtStoreId();
+			if(this.userInfo){
+				
+			}else{
+				this.$common.automaticlogin().then(val => {
+					this.userInfo=this.$store.state.userInfo;
+					this.wxOpenData=this.$store.state.wxOpenData;
+					
+					if(!this.userInfo){
+						this.authorizShow=true
+					}else{
+						//this.authorizShow=false
+						 this.$emit('child-event');
+					}
+				})
+			}
+		},
+		authorizHide(){
+			this.authorizShow=false
+		},
+		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()
+					    this.myPower()
+					    this.showPower()
+					    this.getplateNumber() */
+						 this.$emit('child-event');
+					}	
+				  })
+		},
+	}
+}
+</script>
+
+<style scoped>
+	.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;
+		}
+	
+</style>

+ 8 - 4
pages/index/discountCard.vue

@@ -97,16 +97,17 @@
 				
 			</view>
 		</view>
-		
+		<authoriz ref="authoriz" @child-event="parentMethod"></authoriz>
 	</view>
 </template>
 
 <script>
 	import nodata from '@/components/nodata/nodata.vue'
 	import tkiQrcode from "@/components/tki-qrcode/tki-qrcode.vue"
+	import authoriz from '../../components/authoriz/authoriz.vue'
 	export default {
 		components: {
-			nodata,tkiQrcode
+			nodata,tkiQrcode,authoriz
 		},
 		computed: {
 		  currentList () {
@@ -139,10 +140,11 @@
 			}
 		},
 		onLoad(opt) {
-
+   
 			this.tabIndex = opt.num;
 
 			this.myOrderCoupon()
+			this.$refs.authoriz.init();
 		},
 		onShow() {
 			console.log(this.tabIndex)
@@ -151,7 +153,9 @@
 
 		},
 		methods: {
-
+            parentMethod(){
+            	this.myOrderCoupon()
+            },
 			goDetail(id) {
 				uni.navigateTo({
 					url: 'discountCardDetail?id=' + id

+ 9 - 2
pages/user/checkReport.vue

@@ -26,16 +26,17 @@
 		<view class="noMore" v-if="noMoreShow && (itemData.length!=0)">没有更多数据</view>
 		<!-- 无数据空白页 -->
 		<nodata v-if="itemData.length==0"></nodata>
-
+         <authoriz ref="authoriz" @child-event="parentMethod"></authoriz>
 	</view>
 </template>
 
 <script>
 	import homenav from "../../components/homenav/nav.vue"
 	import nodata from '../../components/nodata/nodata.vue'
+	import authoriz from '../../components/authoriz/authoriz.vue'
 	export default {
 		components: {
-			nodata,homenav
+			nodata,homenav,authoriz
 		},
 
 		data() {
@@ -55,6 +56,7 @@
 			/* uni.navigateTo({
 				url: 'reportUni?id=6C977C54-575E-4F67-9101-7A6D74DDD8BA'
 			}) */
+			this.$refs.authoriz.init();
 			this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
 			this.page = 1;
 			this.myOrderCoupon();
@@ -62,6 +64,11 @@
 			//this.urlStr = this.$request.webUrl+'#/carOwner/index'
 		},
 		methods: {
+			parentMethod(){
+				this.page = 1;
+				this.myOrderCoupon();
+				this.getplateNumber()
+			},
 			bindPickerChange: function(e) {
 					console.log('picker发送选择改变,携带值为', e.detail)
 					this.index = e.detail.value

+ 27 - 15
pages/user/historyDetail.vue

@@ -47,11 +47,12 @@
 
 			</view>
             <view class="shopBox2">
-            	<view class="newboxTop">
+                <view class="newboxTop">
             		<view class="newline1">{{orderData.billsheet.CustomerName}}</view>
 					<view class="newline1" style="padding-left: 20rpx;">{{orderData.billsheet.PlateNumber}}</view>
             	</view>
-				<view class="CarModel">{{orderData.billsheet.CarModel}}</view>
+				
+				<view class="CarModel" v-if="orderData.billsheet.CarModel">{{orderData.billsheet.CarModel}}</view>
 				<view class="informationLine" >
 					<view class="informationTxt">进店里程:</view>
 					<view class="informationNum" v-if="orderData.billsheet.CurrentMileage>0">
@@ -67,7 +68,7 @@
 				<view class="informationLine" v-if="orderData.billsheet.SheetType==1">
 					<view class="informationTxt">建议下次保养时间:</view>
 					<view class="informationNum" v-if="orderData.billsheet.NextCareDate">
-						{{orderData.billsheet.NextCareDate}}
+						{{orderData.billsheet.NextCareDate.slice(0,10)}}
 					</view>
 				</view>
 				<view class="baoyangtis">建议下次保养,里程或日期,先到为准</view>
@@ -157,17 +158,20 @@
 				<view class="detailedTitle">项目</view>
 				<view class="detailedLineBox">
 					<view class="detailedLine" v-for="(item,index) in orderData.listItems">
-
-						<view class="detailedName"><span v-if="item.CardDetailID" class="kaColor">卡</span>{{item.ItemName}}
-						</view>
-						<view class="secondBox" :class="{noLine:index == orderData.listItems.length-1}">
-							<view class="comment" v-if="ItemComment">{{item.Comment}}</view>
+                      <view style="display: flex;justify-content: space-between;">
+						  <view class="detailedName"><span v-if="item.CardDetailID" class="kaColor">卡</span>{{item.ItemName}}
+						  </view>
+						  <view class="price" v-if="ItemMoney">
+						  	<span>¥</span>
+						  	{{item.AmountMoney?item.AmountMoney:0}}
+						  </view>
+					  </view>
+						
+						<view class="secondBox" v-if="ItemComment" :class="{noLine:index == orderData.listItems.length-1}">
+							<view class="comment" >{{item.Comment}}</view>
 							<view class="secondRight">
 								<!-- <view class="grayPrice">¥{{item.CheckOutTaxRate}}</view> -->
-								<view class="price" v-if="ItemMoney">
-									<span>¥</span>
-									{{item.AmountMoney?item.AmountMoney:0}}
-								</view>
+								
 							</view>
 						</view>
 
@@ -230,7 +234,7 @@
 				</view>
 				<view class="goodscostLine" >
 					<view class="goodscostTxt">结算方式</view>
-					<view class="goodsCostNum" style="color: #333333;">{{orderData.billsheet.lastPayMethod?orderData.billsheet.lastPayMethod:''}}</view>
+					<view class="goodsCostNumJsfs" style="color: #333333;">{{orderData.billsheet.lastPayMethod?orderData.billsheet.lastPayMethod:''}}</view>
 				</view>
 			</view>
 
@@ -564,6 +568,9 @@
 		display: flex;
 		padding-left: 20rpx;
 		font-size: 30rpx;
+		border-bottom: 1rpx solid #EEEEEE;
+		font-weight: bold;
+		padding-bottom: 15rpx;
 	}
 	.baoyangtis{
 		font-size: 26rpx;
@@ -571,7 +578,10 @@
 	}
 	.CarModel{
 		font-size: 26rpx;
-		padding-left: 20rpx;
+		padding: 15rpx 20rpx;
+	}
+	.baoyangtis{
+		padding: 15rpx 20rpx 0 15rpx;
 	}
 	.box {
 		min-height: 100vh;
@@ -905,7 +915,9 @@
 		color: #FF0000;
 		font-weight: bold;
 	}
-
+    .goodsCostNumJsfs{
+		color: #333333;
+	}
 	.information {
 		width: 702rpx;
 		background: #FFFFFF;

+ 122 - 6
pages/user/historySpend.vue

@@ -120,7 +120,17 @@
 		<view class="noMore" v-if="noMoreShow && (itemData.length!=0)">没有更多数据</view>
 		<!-- 无数据空白页 -->
 		<nodata v-if="itemData.length==0&&oldlist.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>
 
@@ -145,17 +155,64 @@
 				index: 0,
 				wxOpenData: '',
 				plateNumber:'',
+				ext:'',
+				authorizShow:false,
+				userInfo: '',
+				code:'',
 			}
 		},
 		onLoad() {
 			this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
 			this.page = 1
-			this.myOrderCoupon()
-			this.myPower()
-			this.showPower()
-			this.getplateNumber()
+			this.userInfo=this.$store.state.userInfo;
+			this.ext=this.$common.getExtStoreId();
+			if(this.userInfo){
+				
+			}else{
+				this.$common.automaticlogin().then(val => {
+					this.userInfo=this.$store.state.userInfo;
+					this.wxOpenData=this.$store.state.wxOpenData;
+					
+					if(!this.userInfo){
+						this.authorizShow=true
+					}else{
+						this.myOrderCoupon()
+						this.myPower()
+						this.showPower()
+						this.getplateNumber()
+					}
+				})
+			}
+			
 		},
 		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()
+						    this.myPower()
+						    this.showPower()
+						    this.getplateNumber()
+						}	
+					  })
+			},
 			bindPickerChange: function(e) {
 					console.log('picker发送选择改变,携带值为', e.detail)
 					this.index = e.detail.value
@@ -349,7 +406,7 @@
 	}
 </script>
 
-<style>
+<style scoped>
 	.box {
 		min-height: 100vh;
 		background-color: #F4F5F7;
@@ -495,4 +552,63 @@
 		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;
+		}
 </style>