Browse Source

优惠券

twt 2 years ago
parent
commit
d91d59da02

+ 8 - 2
pages/index/discountCardDetail.vue

@@ -66,11 +66,13 @@
 				id: '',
 				detail: {},
 				themeColor:'',
+				type:'',
 			}
 		},
 		onLoad(opt) {
 			this.themeColor = uni.getStorageSync("themeColor");
 			this.id = opt.id;
+			this.type=opt.type
 			this.getData();
 		},
 		methods: {
@@ -78,8 +80,12 @@
 				uni.showLoading({
 					title: '加载中'
 				});
-
-				this.$http('opencoupon/detailsCoupon', {
+                if(this.type==2){
+					var url='opencoupon/detailsCouponDetails'
+				}else{
+					var url='opencoupon/detailsCoupon'
+				}
+				this.$http(url, {
 					// lat: this.location.lat,
 					// lng: this.location.lng,
 					id: this.id,

+ 23 - 4
pages/index/discountDlq.vue

@@ -20,7 +20,7 @@
 	 </view>
 	 <view class="lineBottom">
 		 <view>可用次数:{{item.avaQty}}</view>
-		 <view>查看详情></view>
+		 <view @click="goDetail(item.id)">查看详情></view>
 	 </view>
  </view>
  <nodata v-if="list.length==0"></nodata>
@@ -40,17 +40,28 @@
 				themeColor:'',
 				userInfo:'',
 				stateMap: ['待审核', '审核通过', '审核拒绝'],
+				bizUserId:'',
+				discount:'',
 			}
 		},
 		onLoad(opt) {
 			this.themeColor = uni.getStorageSync("themeColor");
 			this.userInfo = uni.getStorageSync("userInfo");
+			
+			this.bizUserId=opt.bizUserId;
+			this.discount=opt.discount;
 			this.getList()
 		},
 		onShow() {
 			
 		},
 		methods: {
+			
+			goDetail(id) {
+				uni.navigateTo({
+					url: 'discountCardDetail?id=' + id+'&type=2'
+				})
+			},
 			receive(id){
 				uni.showLoading({
 					title: '领取中'
@@ -75,9 +86,17 @@
 				uni.showLoading({
 					title: '加载中'
 				})
-				this.$http('opencoupon/getCouponList', {
-				    discount:1
-				}, 'GET').then(res => {
+				if(this.discount!=2){
+					var params={
+						discount:this.discount
+					}
+				}else{
+					var params={
+						discount:this.discount,
+						bizId:this.bizUserId
+					}
+				}
+				this.$http('opencoupon/getCouponList', params, 'GET').then(res => {
 					uni.hideLoading();
 					this.list = res.data;
 					//var data=res.data.Items;

+ 92 - 31
pages/index/index.vue

@@ -258,6 +258,7 @@
 				getwxLoing:false,
 				shareID:'',
 				discount:'',
+				bizUserId:'',
 			}
 		},
 		onLoad(opt) {
@@ -277,7 +278,9 @@
 				this.shareID = shareID
 				//this.$store.commit('mutationsshareID', shareID)
 			}
-			this.shareID='5788B15EAEE94EE78D3AA3FCE079B68D'
+			//this.shareID='5788B15EAEE94EE78D3AA3FCE079B68D'
+			this.shareID='1BF04FAEC8844ECE9C40E880C3B13721'
+			
 			//this.unionId="26A1039A-DB10-4D0E-BBA2-541C06274EED";
 			//this.ext.appId="wxffd2502e67d37908"
 			// uni.setStorage({
@@ -351,13 +354,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'
 				})
@@ -566,13 +569,32 @@
 				   unionId:this.unionId,
 				   shareId:this.shareID
 				  },'GET').then(res => {
+					console.log(res.code);
+					console.log("授权信息")
+					console.log(res)
+					 uni.hideLoading();
 					if(res.code!=0){
-						 uni.hideLoading();
-						 uni.showToast({
-						 	title: res.msg,
-						 	icon: 'none',
-						 	duration: 3000
-						 });
+						 //uni.hideLoading();
+						 var msg=res.msg
+						 if(!msg){
+							 msg='授权失败'
+						 }
+						 console.log(msg);
+						 // uni.showModal({
+						 // 	title: '提示',
+						 // 	content: msg,
+						 // 	success: function(resTK) {
+						 // 		if (resTK.confirm) {
+						 			
+						 // 		}
+						 // 	}
+						 // });
+						 // uni.showToast({
+						 // 	title:msg,
+						 // 	icon: 'none',
+						 // 	duration: 3000
+						 // });
+						//return false
 					}
 				 	this.wxOpenData=res.data;
 					this.themeColor=res.data.themeColor
@@ -635,24 +657,18 @@
 					}else{
 						this.authorizShow=true;
 					}
-					 uni.hideLoading();
+					if(res.data.loginInfo.discount){
+						that.discount=res.data.loginInfo.discount;
+						if(that.discount==2){
+							that.bizUserId=res.data.loginInfo.bizUserId;
+						}
+						if(that.shareID){
+							that.getCouponList()
+						}
+					}
 					 
 					//console.log("优惠券")
-					uni.showModal({
-						title: '提示',
-						content: '您有优惠券待领取',
-						cancelText:'回到首页',
-						confirmText:'查看',
-						success: function(resTK) {
-							if (resTK.confirm) {
-								uni.navigateTo({
-									url:'discountDlq'
-								})
-							}
-						}
-					
 					
-					});
 					
 					
 					
@@ -671,21 +687,66 @@
 				 	var data = res.data;
 					if(data.loginInfo){
 						this.userInfo=data.loginInfo.openUser;
+						
 						this.$store.commit('mutationsuserInfo', this.userInfo);
-						this.$store.commit('mutationswxOpenData', data.loginInfo)
+						this.$store.commit('mutationswxOpenData', data);
+						
 						uni.setStorage({
 							key: 'userInfo',
 							data: data.loginInfo.openUser,
 							 success: function () {
 							     that.getCarList()
 							     that.queryHomeCardList()
-								 that.queryManagerInfo()
+								 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()
+								 	}
+								 }
 							 }
 						}); 
+						
 					}
 				 		
 				  })
 			 },
+			 getCouponList(){
+			 	if(this.discount!=2){
+					var params={
+						discount:this.discount
+					}
+				}else{
+					var params={
+						discount:this.discount,
+						bizId:this.bizUserId
+					}
+				}
+				var that=this;
+			 	this.$http('opencoupon/getCouponList', params, 'GET').then(res => {
+			 		var list = res.data;
+					if(list.length>0){
+						uni.showModal({
+							title: '提示',
+							content: '您有优惠券待领取',
+							cancelText:'回到首页',
+							confirmText:'查看',
+							success: function(resTK) {
+								if (resTK.confirm) {
+									uni.navigateTo({
+										url:'discountDlq?bizUserId='+that.bizUserId+'&discount='+that.discount
+									})
+								}
+							}
+						});
+					}
+			 		
+			 	
+			 	})
+			 },
 			 getCarList(){
 				 this.$http('opencarOwnerHome/queryCarInfoList', {
 				   

+ 2 - 2
pages/partner/bonus.vue

@@ -35,7 +35,7 @@
 		
 		data() {
 			return {
-				list:'',
+				list:[],
 				themeColor:'',
 				userInfo:'',
 				page:1,
@@ -126,6 +126,6 @@
 	color: #3C3C3C;
 }
 .amount{
-	color: #FF0000;
+	color: #FF0000;font-weight: 500;
 }
 </style>

+ 1 - 1
pages/partner/myQr.vue

@@ -131,7 +131,7 @@
 	height: 200rpx;
 }
 .ewmRight1{
-	color: #999999;font-size: 24rpx;padding-top: 30rpx;padding-left: 24rpx;
+	color: #999999;font-size: 24rpx;padding-top: 50rpx;padding-left: 24rpx;
 }
 .ewmRight2{
 	color: #999999;font-size: 24rpx;padding-top: 16rpx;padding-left: 24rpx;

+ 2 - 0
pages/partner/partner.vue

@@ -174,11 +174,13 @@
 }
 .lineBox{
 	background: #FFFFFF;width: 702rpx;margin-top: 20rpx;margin-left: 24rpx;
+	border-radius: 10rpx;
 }
 .line{
 	display: flex;
 	justify-content: space-between;
 	padding: 38rpx 32rpx;
+	
 }
 .lineLeft{
 		display: flex;

+ 5 - 4
pages/partner/people.vue

@@ -6,7 +6,7 @@
 		 <view class="name">{{item.CustomerName}}</view>
 		 <view class="nickNameBox">
 			 <image src="../../static/timg/icon_wechat.png" mode="" class="nickNameImg"></image>
-			 <view class="nickName">{{item.WxNickName}}</view>
+			 <view class="nickName">{{item.WxNickName?item.WxNickName:''}}</view>
 		 </view>
 	 </view>
 	 <view class="lineCOnt">
@@ -33,7 +33,7 @@
 		
 		data() {
 			return {
-				list:'',
+				list:[],
 				themeColor:'',
 				userInfo:'',
 				page:1,
@@ -53,10 +53,11 @@
 				uni.showLoading({
 					title: '加载中'
 				})
-				this.$http('opencarInfoOwner/listBonusPage', {
+				this.$http('opencarInfoOwner/listPJBonusPage', {
 				    page:this.page,limit:this.limit,
 				}, 'GET').then(res => {
 					uni.hideLoading();
+					console.log(res.data)
 					var data=res.data.Items;
 					this.list=this.list.concat(data);
 					//this.list = res.data.Items
@@ -90,7 +91,7 @@
 }
 .nickNameBox{
 	display: flex;
-	
+	padding-top: 6rpx;
 }
 .nickName{
 	font-weight: 400;

+ 6 - 5
pages/referral/extract.vue

@@ -12,12 +12,12 @@
 					placeholder="请输入提现金额" v-model="money" @input="inputValue" />
 				<view class="allBtn" @click="allBtn">全部提现</view>
 			</view>
-			<view class="zongMoney">可提现金额: <span style="color: #FF0000;">¥{{detail.canMoney}}</span>  (冻结金额:{{detail.freezeMoney}}) </view>
+			<view class="zongMoney">可提现金额: <span style="color: #FF0000;padding-right: 10rpx;">¥{{detail.canMoney}}  </span>  (冻结金额:{{detail.freezeMoney}}) </view>
 
 			
 		</view>
 
-		<view class="tishi" style="padding: 20rpx 44rpx;">
+		<view class="tishi" style="padding:20rpx 20rpx 100rpx 20rpx ; ">
 			<view class="tishiLine">
 				<view class="tishiY"></view>
 				<view class="tishiTxt">提现冻结天数:{{detail.explain&&detail.explain.freezeDay}}天</view>
@@ -160,13 +160,14 @@
 		padding-top: 20rpx;
 	}
 	.tishiLine{
-		display: flex;
+		display: flex;padding-top: 20rpx;
 	}
 	.tishiY{
 		width: 10rpx;
 		height: 10rpx;
 		background: #DDDDDD;
 		margin-top: 16rpx;
+		border-radius: 50%;
 	}
 	.tishiTxt{
 		padding-left: 18rpx;
@@ -196,7 +197,7 @@
 	.title {
 		font-size: 28rpx;
 		color: #3C3C3C;
-		font-weight: bold;
+		
 	}
 
 	.moneyView {
@@ -209,7 +210,7 @@
 	.icon {
 		font-size: 50rpx;
 		color: #222222;
-		font-weight: bold;
+		
 	}
 
 	.moneyInput {

+ 1 - 1
pages/referral/rebateList.vue

@@ -79,7 +79,7 @@
 				   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);

+ 14 - 13
pages/referral/referral.vue

@@ -8,43 +8,43 @@
 		</view>
 		<view class="topRight" @click="goRouter('extract')">提现</view>
 	</view>
-	<view class="xffl" @click="goRouter('myConnections')">
+	<view class="xffl">
 		<view class="xfflTitle">消费返利</view>
 		<view class="xfflLine">
 			<view class="xfflLineLeft">
 				<view class="xfflyq"></view>
 				<view class="xfflLineLeftTxt">一级人脉/返利</view>
 			</view>
-			<view class="xfflLineM">{{detail.oneNum}} 人</view>
-			<view class="xfflLineR">¥ {{detail.oneMoney}}</view>
+			<view class="xfflLineM"  @click="goRouter('myConnections')">{{detail.oneNum}} 人</view>
+			<view class="xfflLineR"  @click="goRouter('rebateList')">¥ {{detail.oneMoney}}</view>
 		</view>
 		<view class="xfflLine">
 			<view class="xfflLineLeft">
 				<view class="xfflyq2"></view>
 				<view class="xfflLineLeftTxt">二级人脉/返利</view>
 			</view>
-			<view class="xfflLineM">{{detail.twoNum}} 人</view>
-			<view class="xfflLineR">¥ {{detail.twoMoney}}</view>
+			<view class="xfflLineM"  @click="goRouter('myConnections')">{{detail.twoNum}} 人</view>
+			<view class="xfflLineR" @click="goRouter('rebateList')">¥ {{detail.twoMoney}}</view>
 		</view>
 		<view class="xfflLine">
 			<view class="xfflLineLeft">
 				<view class="xfflyq3"></view>
 				<view class="xfflLineLeftTxt">三级人脉/返利</view>
 			</view>
-			<view class="xfflLineM">{{detail.threeNum}} 人</view>
-			<view class="xfflLineR">¥ {{detail.threeMoney}}</view>
+			<view class="xfflLineM"  @click="goRouter('myConnections')">{{detail.threeNum}} 人</view>
+			<view class="xfflLineR"  @click="goRouter('rebateList')">¥ {{detail.threeMoney}}</view>
 		</view>
-		<!-- <view class="xfflLine">
+		 <view class="xfflLine">
 			<view class="xfflLineLeft">
 				<view class="xfflyq4"></view>
-				<view class="xfflLineLeftTxt">四级人脉/返利</view>
+				<view class="xfflLineLeftTxt">累计人脉/返利</view>
 			</view>
-			<view class="xfflLineM">{{detail.oneNum}}人</view>
-			<view class="xfflLineR">¥ {{detail.oneNum}}</view>
-		</view> -->
+			<view class="xfflLineM"  @click="goRouter('myConnections')">{{detail.totalNum}}人</view>
+			<view class="xfflLineR" @click="goRouter('rebateList')">¥ {{detail.totalMoney}}</view>
+		</view> 
 	</view>
 	
-	<view class="xffl" @click="goRouter('rebateList')">
+	<view class="xffl" >
 		<view class="xfflTitle">扫码注册返利</view>
 		<view class="xfflLine">
 			<view class="xfflLineLeft">
@@ -229,6 +229,7 @@
 }
 .xfflLineLeft{
 	display: flex;
+	width: 200rpx;
 }
 .xfflLineM{
 	width: 200rpx;

+ 3 - 0
pages/user/user.vue

@@ -266,6 +266,9 @@
 				frontColor: "#ffffff",
 				backgroundColor:'#'+ this.themeColor
 			})
+			// const accountInfo = wx.getAccountInfoSync();
+			// var version_number = accountInfo.miniProgram.version;
+			// console.log(version_number)
 		},
 		onShow() {
 			const wxOpenData = this.$store.state.wxOpenData;

+ 2 - 1
utils/request.js

@@ -18,7 +18,8 @@ const http = (url = '', date = {}, type = 'POST', header = {
 }) => {
     return new Promise((resolve, reject) => {
 		header={};
-		console.log(baseUrl)
+		//console.log(baseUrl)
+		console.log($store.state.wxOpenData)
 		//const wxOpenData = uni.getStorageSync("wxOpenData");
 		var wxOpenData=$store.state.wxOpenData
 		if(wxOpenData.loginInfo){