浏览代码

优惠券领取

twt 2 年之前
父节点
当前提交
05511bc9ad

+ 9 - 6
pages/index/discountCardDetail.vue

@@ -81,15 +81,18 @@
 					title: '加载中'
 				});
                 if(this.type==2){
-					var url='opencoupon/detailsCouponDetails'
+					var url='opencoupon/detailsCouponDetails';
+					var params={
+						id: this.id,
+						custId:this.$store.state.wxOpenData.loginInfo.customerInfo.id
+					}
 				}else{
 					var url='opencoupon/detailsCoupon'
+					var params={
+						id: this.id,
+					}
 				}
-				this.$http(url, {
-					// lat: this.location.lat,
-					// lng: this.location.lng,
-					id: this.id,
-				}, 'GET').then(res => {
+				this.$http(url, params, 'GET').then(res => {
 					uni.hideLoading();
 					this.detail = res.data;
 

+ 1 - 1
pages/index/discountDlq.vue

@@ -6,7 +6,7 @@
 		 <view class="lineTopleft">
 		 	<view class="lineTop1">
 				<view class="linemoney">¥ <span style="font-size: 40rpx;">{{item.actMoney}}</span> </view>
-				<view class="lineTopName">新人优惠券</view>
+				<view class="lineTopName">{{item.actName}}</view>
 			</view>
 			<view class="linetop2">
 				<view class="mdsky">{{item.whereMoney!==0?'满'+item.whereMoney+'可用':'无限制'}}</view>

+ 72 - 17
pages/index/index.vue

@@ -259,6 +259,8 @@
 				shareID:'',
 				discount:'',
 				bizUserId:'',
+				coCouponsMsg:'',
+				coNoNewCustMsg:'',
 			}
 		},
 		onLoad(opt) {
@@ -278,8 +280,8 @@
 				this.shareID = shareID
 				//this.$store.commit('mutationsshareID', shareID)
 			}
-			//this.shareID='5788B15EAEE94EE78D3AA3FCE079B68D'
-			this.shareID='1BF04FAEC8844ECE9C40E880C3B13721'
+			//this.shareID='C01DF9DA51A341888754DE0C4ADB29D9'
+			//this.shareID='1BF04FAEC8844ECE9C40E880C3B13721'
 			
 			//this.unionId="26A1039A-DB10-4D0E-BBA2-541C06274EED";
 			//this.ext.appId="wxffd2502e67d37908"
@@ -354,13 +356,13 @@
 				})
 			},
 			changeCar(){
-				uni.scanCode({
-					success: function (res) {
-						console.log('条码类型:' + res.scanType);
-						console.log( res);
-					}
-				});
-				return false;
+				// uni.scanCode({
+				// 	success: function (res) {
+				// 		console.log('条码类型:' + res.scanType);
+				// 		console.log( res);
+				// 	}
+				// });
+				// return false;
 				uni.navigateTo({
 					url:'../user/addCar/cailist'
 				})
@@ -666,6 +668,15 @@
 							that.getCouponList()
 						}
 					}
+					if(res.data.loginInfo.coNoNewCustMsg){ //车主合伙人二维码提示
+						uni.showModal({
+							title: '提示',
+							content:res.data.loginInfo.coNoNewCustMsg,
+							success: function(resTKk) {
+								
+							}
+						});
+					}
 					 
 					//console.log("优惠券")
 					
@@ -698,15 +709,30 @@
 							     that.getCarList()
 							     that.queryHomeCardList()
 								 that.queryManagerInfo();
-								 if(data.loginInfo.discount){
-								 	that.discount=data.loginInfo.discount;
-								 	if(that.discount==2){
-								 		that.bizUserId=data.loginInfo.bizUserId;
-								 	}
-								 	if(that.shareID&&that.discount==2){
-								 		that.getCouponList()
-								 	}
+								 if(data.loginInfo.coCouponsMsg){
+								 	uni.hideLoading()
+								 	that.coCouponsMsg =data.loginInfo.coCouponsMsg;
+								 	that.ownerCoupon()
 								 }
+								  if(data.loginInfo.coNoNewCustMsg){
+								 	//console.log(data.loginInfo.coNoNewCustMsg)
+								 	uni.hideLoading()
+								 	that.coNoNewCustMsg =data.loginInfo.coNoNewCustMsg;
+								 	that.coNoNewCust()
+								 }
+								 if(data.loginInfo.discount){
+							            that.discount=data.loginInfo.discount;
+									
+										if(that.discount==2){
+											that.bizUserId=data.loginInfo.bizUserId;
+										}
+										if(that.shareID&&that.discount==2){
+											that.getCouponList()
+										}
+									}
+								 	
+								 	
+								 
 							 }
 						}); 
 						
@@ -714,7 +740,36 @@
 				 		
 				  })
 			 },
+			 coNoNewCust(){
+				 console.log(111111)
+				 var that=this;
+				 uni.showModal({
+				 	title: '提示',
+				 	content: that.coNoNewCustMsg,
+				 	success: function(resTK) {
+				 		
+				 	}
+				 });
+			 },
+			 ownerCoupon(){
+				  console.log(22222)
+				 var that=this;
+				 uni.showModal({
+				 	title: '提示',
+				 	content: that.coCouponsMsg,
+				 	cancelText:'回到首页',
+				 	confirmText:'查看',
+				 	success: function(resTK) {
+				 		if (resTK.confirm) {
+				 			uni.navigateTo({
+				 				url:'discountCard'
+				 			})
+				 		}
+				 	}
+				 });
+			 },
 			 getCouponList(){
+				 
 			 	if(this.discount!=2){
 					var params={
 						discount:this.discount

+ 112 - 2
pages/partner/bonus.vue

@@ -23,6 +23,17 @@
 	 </view>
  </view>
  <nodata v-if="list.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>
 
@@ -40,12 +51,27 @@
 				userInfo:'',
 				page:1,
 				limit:20,
+				authorizShow:false,
+				userInfo:'',
+				ext:'',
+				wxOpenData:'',
 			}
 		},
 		onLoad(opt) {
 			this.themeColor = uni.getStorageSync("themeColor");
 			this.userInfo = uni.getStorageSync("userInfo");
-			this.getList()
+			this.userInfo=this.$store.state.userInfo;
+			this.ext=this.$common.getExtStoreId();
+			if(this.userInfo){
+				this.getList()
+			}else{
+				this.$common.automaticlogin().then(val => {
+					this.userInfo=this.$store.state.userInfo;
+					this.wxOpenData=this.$store.state.wxOpenData;
+					this.themeColor = uni.getStorageSync("themeColor");
+					this.getList()
+				})
+			}
 		},
 		onShow() {
 			
@@ -65,7 +91,32 @@
 					//console.log('list+=', this.queryShopList);
 				
 				})
-			}
+			},
+			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.loginInfo)
+							this.$store.commit('mutationsuserInfo', this.userInfo)
+							this.list=[]
+						    this.getList()
+						}	
+					  })
+			},
 			
 		},
 		onReachBottom(){
@@ -128,4 +179,63 @@
 .amount{
 	color: #FF0000;font-weight: 500;
 }
+.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>

+ 2 - 2
pages/partner/myQr.vue

@@ -10,7 +10,7 @@
 		<view class="headImgBox">
 			<image :src="userInfo.headImg" mode="" class="headImg"></image>
 		</view>
-		<view class="nickName">{{userInfo.nickName}}</view>
+		<view class="nickName">{{userInfo.nickName?userInfo.nickName:'微信昵称'}}</view>
 		<view class="ms">很不错的店铺 值得推荐!</view>
 		<view class="wqmBox">
 			<view class="ewmLeft">
@@ -87,7 +87,7 @@
 }
 .cont{
 	width: 650rpx;
-	height: 651rpx;
+	height: 660rpx;
 	background: #FFFFFF;
 	border-radius: 20rpx;
 	border: 10rpx solid #FFCE11;

+ 113 - 3
pages/partner/people.vue

@@ -21,6 +21,17 @@
 	 </view>
  </view>
  <nodata v-if="list.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>
 
@@ -38,12 +49,27 @@
 				userInfo:'',
 				page:1,
 				limit:20,
+				authorizShow:false,
+				userInfo:'',
+				ext:'',
+				wxOpenData:'',
 			}
 		},
 		onLoad(opt) {
 			this.themeColor = uni.getStorageSync("themeColor");
-			this.userInfo = uni.getStorageSync("userInfo");
-			this.getList()
+			this.userInfo=this.$store.state.userInfo;
+			this.ext=this.$common.getExtStoreId();
+			if(this.userInfo){
+				this.getList()
+			}else{
+				this.$common.automaticlogin().then(val => {
+					this.userInfo=this.$store.state.userInfo;
+					this.wxOpenData=this.$store.state.wxOpenData;
+					this.themeColor = uni.getStorageSync("themeColor");
+					this.getList()
+				})
+			}
+			//this.getList()
 		},
 		onShow() {
 			
@@ -64,7 +90,32 @@
 					//console.log('list+=', this.queryShopList);
 				
 				})
-			}
+			},
+			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.loginInfo)
+							this.$store.commit('mutationsuserInfo', this.userInfo)
+							this.list=[]
+						    this.getList()
+						}	
+					  })
+			},
 			
 		},
 		onReachBottom(){
@@ -142,4 +193,63 @@
 	width: 30rpx;
 	height: 30rpx;
 }
+.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>

+ 4 - 4
pages/referral/extract.vue

@@ -113,16 +113,16 @@
 				this.postData();
 			},
 			postData() {
-				uni.showLoading({
-					title: '提现中'
-				})
+				// uni.showLoading({
+				// 	title: '提现中'
+				// })
 				let url = 'openMCustomer/applyWithdrawal',
 					params = {
 						money: this.money,
 						
 					}
 				this.$http(url, params, 'POST').then(res => {
-					uni.hideLoading();
+					//uni.hideLoading();
 					if(res.code==0){
 						uni.showModal({
 							title: '提交成功',

+ 1 - 1
pages/referral/extractList.vue

@@ -50,7 +50,7 @@
 				uni.showLoading({
 					title: '加载中'
 				})
-				this.$http('opencarInfoOwner/getWithdrawalDetail', {
+				this.$http('openMCustomer/getWithdrawalDetail', {
 				    
 				}, 'GET').then(res => {
 					uni.hideLoading();

+ 2 - 2
pages/referral/myConnections.vue

@@ -70,11 +70,11 @@
 				uni.showLoading({
 					title: '加载中'
 				})
-				this.$http('opencarInfoOwner/listBonusPage', {
+				this.$http('openMCustomer/getContactsList', {
 				   type:this.tabindex
 				}, 'GET').then(res => {
 					uni.hideLoading();
-					this.list = res.data.Items
+					this.list = res.data;
 					//var data=res.data.Items;
 					//this.list=this.list.concat(data);
 					//console.log('list+=', this.queryShopList);

+ 4 - 3
pages/referral/referral.vue

@@ -39,7 +39,7 @@
 				<view class="xfflyq4"></view>
 				<view class="xfflLineLeftTxt">累计人脉/返利</view>
 			</view>
-			<view class="xfflLineM"  @click="goRouter('myConnections')">{{detail.totalNum}}人</view>
+			<view class="xfflLineM"  @click="goRouter('myConnections')">{{detail.totalNum}} 人</view>
 			<view class="xfflLineR" @click="goRouter('rebateList')">¥ {{detail.totalMoney}}</view>
 		</view> 
 	</view>
@@ -51,7 +51,7 @@
 				<view class="xfflyq"></view>
 				<view class="xfflLineLeftTxt">人数/返利</view>
 			</view>
-			<view class="xfflLineM">{{detail.scanNum}}人</view>
+			<view class="xfflLineM">{{detail.scanNum}} 人</view>
 			<view class="xfflLineR">¥{{detail.scanMoney}}</view>
 		</view>
 		
@@ -178,6 +178,7 @@
 	background: #FFFFFF;
 	margin-top: 20rpx;
 	padding: 20rpx;
+	border-radius: 10rpx;
 }
 .xfflTitle{
 	font-size: 30rpx;
@@ -233,7 +234,7 @@
 }
 .xfflLineM{
 	width: 200rpx;
-	text-align: center;
+	text-align: right;
 }
 .xfflLineR{
 	width: 200rpx;

+ 3 - 2
pages/user/addCar/cailist.vue

@@ -9,8 +9,9 @@
 					</view>
 					<view style="padding-left: 29rpx;">
 						<view class="carName">
-							<span>{{item.brand?item.brand:''}} {{item.series?item.series:''}}</span>
-							<view class="plateNumber">{{item.plateNumber}}</view>
+						<!-- 	<span>{{item.brand?item.brand:''}} {{item.series?item.series:''}}</span> -->
+						    <span>{{item.plateNumber}}</span>
+							<view class="plateNumber" v-if="item.milage">{{item.milage}}km</view>
 						</view>
 						<view class="carMS">{{item.carModel?item.carModel:''}}</view>
 					</view>

+ 2 - 2
pages/user/user.vue

@@ -167,14 +167,14 @@
 				</view>
 				<image src="../../static/img/big_rightArrow.png" mode="" class="big_rightArrow"></image>
 			</view>
-			<view class="rowBox" @click="gonavigateTo('../partner/partner')">
+			<view class="rowBox" @click="gonavigateTo('../partner/partner')" v-if="numList.customerInfo.pState==1&&numList.shopSettings.partnerDisabled">
 				<view class="leftView">
 					<image src="../../static/img/icon_hehuoren.png" mode="" class="liftIcon"></image>
 					<view class="rowTitle">车主合伙人</view>
 				</view>
 				<image src="../../static/img/big_rightArrow.png" mode="" class="big_rightArrow"></image>
 			</view>
-			<view class="rowBox" @click="gonavigateTo('../referral/referral')">
+			<view class="rowBox" @click="gonavigateTo('../referral/referral')" v-if="numList.customerInfo.rebateState==1&&numList.shopSettings.introductionDisabled">
 				<view class="leftView">
 					<image src="../../static/img/icon_kehuzhuanjieshao.png" mode="" class="liftIcon"></image>
 					<view class="rowTitle">客户转介绍</view>