lhl 2 лет назад
Родитель
Сommit
53d80e5f2e

+ 2 - 2
manifest.json

@@ -183,8 +183,8 @@
         "devServer" : {
         "devServer" : {
             "proxy" : {
             "proxy" : {
                 "/api" : {
                 "/api" : {
-                    // "target" : "https://wx.linkaa.cn/api",
-					"target" : "http://ltzd.frp.liuniu946.com/api",
+                    "target" : "https://wx.linkaa.cn/api",
+                    // "target" : "http://ltzd.frp.liuniu946.com/api",
                     // "changeOrigin": true,
                     // "changeOrigin": true,
                     "pathRewrite" : {
                     "pathRewrite" : {
                         "/api" : "" // rewrite path
                         "/api" : "" // rewrite path

+ 24 - 6
pages/index/index.vue

@@ -208,12 +208,30 @@
 						interceptor();
 						interceptor();
 					} else {
 					} else {
 						if (this.userInfo.is_real == 1) {
 						if (this.userInfo.is_real == 1) {
-							uni.navigateTo({
-								url,
-								fail(e) {
-									console.log(e);
-								}
-							});
+							if(this.userInfo.payRules) {
+								uni.showModal({
+									title: '温馨提醒',
+									content:'您已支付相同金额订单,请确认是否重新下单?',
+									complete(res) {
+										if(res.confirm) {
+											uni.navigateTo({
+												url,
+												fail(e) {
+													console.log(e);
+												}
+											});
+										}
+									}
+								})
+							}else {
+								uni.navigateTo({
+									url,
+									fail(e) {
+										console.log(e);
+									}
+								});
+							}
+							
 
 
 						} else {
 						} else {
 							uni.showModal({
 							uni.showModal({

+ 2 - 2
pages/public/wxLogin.vue

@@ -5,8 +5,8 @@
 			<view class="logo-img-box">
 			<view class="logo-img-box">
 				<image class="logo-img" src="../../static/image/logo.png" mode="scaleToFill"></image>
 				<image class="logo-img" src="../../static/image/logo.png" mode="scaleToFill"></image>
 				<button class="userInfo flex-center" type="warn" @tap="loding?'':userInfoData()">
 				<button class="userInfo flex-center" type="warn" @tap="loding?'':userInfoData()">
-					<image class="icon margin-r-10" src="../../static/icon/weichat.png" mode="scaleToFill"></image>
-					<text>微信授权登录</text>
+					<!-- <image class="icon margin-r-10" src="../../static/icon/weichat.png" mode="scaleToFill"></image> -->
+					<text>授权登录</text>
 				</button>
 				</button>
 				<agreement @checkedChange='changeChecked'></agreement>
 				<agreement @checkedChange='changeChecked'></agreement>
 			</view>
 			</view>

+ 6 - 6
pages/shop/action.vue

@@ -1,7 +1,11 @@
 <template>
 <template>
     <view class="content">
     <view class="content">
 		<image :src="actionImg" mode="widthFix" class="action-img"></image>
 		<image :src="actionImg" mode="widthFix" class="action-img"></image>
-		
+		<view class="notice-item">
+			<view class="" v-html="content">
+				
+			</view>
+		</view>
 		<view class="action-wrap">
 		<view class="action-wrap">
 			<image src="../../static/image/action-top.png" mode="" class="action-top"></image>
 			<image src="../../static/image/action-top.png" mode="" class="action-top"></image>
 			<view class="">
 			<view class="">
@@ -13,11 +17,7 @@
 				上传照片
 				上传照片
 			</view>
 			</view>
 		</view>
 		</view>
-		<view class="notice-item">
-			<view class="" v-html="content">
-				
-			</view>
-		</view>
+		
 		
 		
     </view>
     </view>
 </template>
 </template>

+ 162 - 71
pages/shop/rent.vue

@@ -86,9 +86,22 @@
 					选择套餐
 					选择套餐
 				</view>
 				</view>
 			</view>
 			</view>
-			<view class="contet-list flex">
+			<view class="contet-list flex" style="position: relative;" :style="{'height': isShowAll? 'auto': '275rpx'}">
+				<view class="flex" v-if="isShowAll == false"
+					style="width: 100%; position: absolute;bottom: 0;background-color: #fff;height: 50rpx;left: 0;text-align: center;border-radius: 0 0 20rpx 20rpx;padding: 0 30px;"
+					@click="isShowAll = true">
+					<view class="">
+
+					</view>
+					<view class="">
+						查看更多套餐 <image src="../../static/icon/down1.png" mode="widthFix"
+							style="width: 30rpx;margin-left: 10rpx;"></image>
+					</view>
+					<view class="">
+					</view>
+				</view>
 				<view class="tc flex" v-for="(item,index) in tcList" :class="{'action': selectTcIndex == index}"
 				<view class="tc flex" v-for="(item,index) in tcList" :class="{'action': selectTcIndex == index}"
-					@click="choosTc(index,item)">
+					@click="choosTc(index,item)" v-if="item.day == 30 || !userinfo.payRules">
 
 
 					<view class="tc-price">
 					<view class="tc-price">
 						{{item.price}}
 						{{item.price}}
@@ -113,6 +126,18 @@
 				</view> -->
 				</view> -->
 			</view>
 			</view>
 			<view class="contet-list flex">
 			<view class="contet-list flex">
+				<view class="tc flex dy" :class="{'action': ismy}" @click="ljmy()">
+					<view class="tc-time">
+						<!-- <image src="../../static/icon/orderAli.png" mode="heightFix"></image> -->
+						信用免押金
+					</view>
+					<!-- <view class="tc-time-price">
+					微信信用≥550分
+					</view>
+					<view class="tc-price">
+						77<text>¥88</text>
+					</view> -->
+				</view>
 				<view class="tc flex dy " :class="{'action': !ismy}" @click="qxmy()">
 				<view class="tc flex dy " :class="{'action': !ismy}" @click="qxmy()">
 					<view class="tc-time">
 					<view class="tc-time">
 						支付押金
 						支付押金
@@ -124,17 +149,7 @@
 						{{selectTc.deposit}}
 						{{selectTc.deposit}}
 					</view>
 					</view>
 				</view>
 				</view>
-				<view class="tc flex dy" :class="{'action': ismy}" @click="ljmy()">
-					<view class="tc-time">
-						<image src="../../static/icon/orderAli.png" mode="heightFix"></image>信用免押金
-					</view>
-					<!-- <view class="tc-time-price">
-					微信信用≥550分
-					</view>
-					<view class="tc-price">
-						77<text>¥88</text>
-					</view> -->
-				</view>
+
 
 
 			</view>
 			</view>
 		</view>
 		</view>
@@ -144,7 +159,7 @@
 					class="hb"></canvas> -->
 					class="hb"></canvas> -->
 				<image :src="shareQrcodeUrl" mode="" :style="{ width:cw + 'rpx', height: ch+'rpx',}"></image>
 				<image :src="shareQrcodeUrl" mode="" :style="{ width:cw + 'rpx', height: ch+'rpx',}"></image>
 			</view>
 			</view>
-			<view class="bcewm" @click="saveShareQrcode">
+			<view class="bcewm" @click="saveShareQrcode('shareQrcodeUrl')">
 				保存二维码
 				保存二维码
 			</view>
 			</view>
 		</view>
 		</view>
@@ -159,20 +174,11 @@
 				</view> -->
 				</view> -->
 			</view>
 			</view>
 			<view class="contet-list flex">
 			<view class="contet-list flex">
-				<view class="tc flex dy " :class="{'action': !isdk}" @click="qxdk()">
-					<view class="tc-time">
-						不使用代扣
-					</view>
-					<!-- <view class="tc-time-price">
-					元/天
-					</view> -->
-					<!-- <view class="tc-price">
-						{{selectTc.deposit}}
-					</view> -->
-				</view>
+
 				<view class="tc flex dy" :class="{'action': isdk}" @click="ktdk()">
 				<view class="tc flex dy" :class="{'action': isdk}" @click="ktdk()">
 					<view class="tc-time">
 					<view class="tc-time">
-						<image src="../../static/icon/orderAli.png" mode="heightFix"></image>开通代扣
+						<!-- <image src="../../static/icon/orderAli.png" mode="heightFix"></image> -->
+						周期代扣
 					</view>
 					</view>
 					<!-- <view class="tc-time-price">
 					<!-- <view class="tc-time-price">
 					微信信用≥550分
 					微信信用≥550分
@@ -181,7 +187,17 @@
 						77<text>¥88</text>
 						77<text>¥88</text>
 					</view> -->
 					</view> -->
 				</view>
 				</view>
-
+				<view class="tc flex dy " :class="{'action': !isdk}" @click="qxdk()">
+					<view class="tc-time">
+						卡券/微信
+					</view>
+					<!-- <view class="tc-time-price">
+					元/天
+					</view> -->
+					<!-- <view class="tc-price">
+						{{selectTc.deposit}}
+					</view> -->
+				</view>
 			</view>
 			</view>
 		</view>
 		</view>
 		<view class="myj-wrap" v-if="showDkEwm">
 		<view class="myj-wrap" v-if="showDkEwm">
@@ -190,7 +206,7 @@
 					class="hb"></canvas> -->
 					class="hb"></canvas> -->
 				<image :src="dkQrcodeUrl" mode="" :style="{ width:cw + 'rpx', height: ch+'rpx',}"></image>
 				<image :src="dkQrcodeUrl" mode="" :style="{ width:cw + 'rpx', height: ch+'rpx',}"></image>
 			</view>
 			</view>
-			<view class="bcewm" @click="saveShareQrcode">
+			<view class="bcewm" @click="saveShareQrcode('dkQrcodeUrl')">
 				保存二维码
 				保存二维码
 			</view>
 			</view>
 		</view>
 		</view>
@@ -234,17 +250,27 @@
 				</image>
 				</image>
 				<view v-else class="noChecked"></view>
 				<view v-else class="noChecked"></view>
 			</view>
 			</view>
+			<view class="yt-list-cell b-b" @click="isqxdk= !isqxdk">
+				<view class="cell-tit flex">
+					<!-- <image class="orderIcon" src="../../static/icon/ye.png" mode="widthFix"></image> -->
+					<text class="margin-l-10">使用骑行券抵扣(可用骑行券{{userInfo.certificate}})</text>
+				</view>
+				<image class="checked" v-if="isqxdk" src="../../static/icon/addressIconXz.png" mode="widthFix">
+				</image>
+				<view v-else class="noChecked"></view>
+			</view>
 		</view>
 		</view>
+
 		<view class="ts" v-if="!isdk">
 		<view class="ts" v-if="!isdk">
 
 
 		</view>
 		</view>
 		<view class="btm-btn flex" v-if="!isdk">
 		<view class="btm-btn flex" v-if="!isdk">
-			
-			<view class="pay-price" v-if="!ismy && userInfo.battery_deposit  != 1">
+
+			<!-- <view class="pay-price" v-if="!ismy && userInfo.battery_deposit  != 1">
 				总计费用:<text>{{(selectTc.price*1 + selectTc.deposit*1).toFixed(2) || ''}}</text>
 				总计费用:<text>{{(selectTc.price*1 + selectTc.deposit*1).toFixed(2) || ''}}</text>
-			</view>
-			<view class="pay-price" v-else>
-				总计费用:<text>{{(selectTc.price*1).toFixed(2) || ''}}</text>
+			</view> -->
+			<view class="pay-price">
+				总计费用:<text>{{showPrice}}</text>
 			</view>
 			</view>
 			<view class="pay-btn" @click="toBuy" :class="{'zfz': loading}">
 			<view class="pay-btn" @click="toBuy" :class="{'zfz': loading}">
 				{{loading?'支付中':'立即支付'}}
 				{{loading?'支付中':'立即支付'}}
@@ -286,7 +312,10 @@
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
-				
+				isShowDk:true,
+				isShowAll: false,
+				showTc: [],
+				isqxdk: false,
 				isdk: false, //是否代扣
 				isdk: false, //是否代扣
 				ismy: false, //是否免押
 				ismy: false, //是否免押
 				showbtn: false,
 				showbtn: false,
@@ -331,31 +360,77 @@
 				payType: 'yue',
 				payType: 'yue',
 				sm: '', //使用说明
 				sm: '', //使用说明
 				loading: false, //是否支付中
 				loading: false, //是否支付中
-				renew: 0,//是否续费
+				renew: 0, //是否续费
+			}
+		},
+		watch: {
+			selctStore(n, o) {
+				if (n) {
+					if(this.userInfo.battery_deposit  != 1) {
+						this.ljmy()
+					}
+					if (this.selectTc.day*1 == 30 && !this.userInfo.payRules) {
+						this.ktdk()
+					}else {
+						
+							this.qxdk()
+							this.isShowDk = false
+						
+					}
+				}
+			},
+			selectTc(n,o) {
+				if(n) {
+					if(n.day*1 != 30) {
+						this.qxdk()
+						this.isShowDk = false
+					}
+				}
 			}
 			}
 		},
 		},
 		computed: {
 		computed: {
 			...mapState('user', ['address', 'userInfo']),
 			...mapState('user', ['address', 'userInfo']),
 			//展示免押二维码
 			//展示免押二维码
 			showMyEwm() {
 			showMyEwm() {
-				return  this.ismy && this.shareQrcodeUrl
+				return this.ismy && this.shareQrcodeUrl
 			},
 			},
 			//展示代扣二维码
 			//展示代扣二维码
 			showDkEwm() {
 			showDkEwm() {
-				return  this.isdk && this.dkQrcodeUrl
+				return this.isdk && this.dkQrcodeUrl
 			},
 			},
+			showPrice() {
+				let price = this.selectTc.price * 1 + this.selectTc.deposit * 1
+				if (!this.ismy && this.userInfo.battery_deposit != 1) {
+					if (this.isqxdk) {
+						let all = (price - this.userInfo.certificate * 1).toFixed(2)
+						return all > 0 ? all : 0
+					} else {
+						return price
+					}
+				} else {
+					if (this.isqxdk) {
+						let all = (this.selectTc.price * 1 - this.userInfo.certificate * 1).toFixed(2)
+						return all > 0 ? all : 0
+					} else {
+						return this.selectTc.price * 1
+					}
+				}
+			}
 		},
 		},
 		onLoad(opt) {
 		onLoad(opt) {
-			if(opt.renew) {
+			if (opt.renew) {
 				this.renew = opt.renew
 				this.renew = opt.renew
 			}
 			}
 			this.getRents()
 			this.getRents()
+
 			this.getSm()
 			this.getSm()
 		},
 		},
 		onShow() {
 		onShow() {
 			this.userinfo()
 			this.userinfo()
 			if (this.address.latitude == '') {
 			if (this.address.latitude == '') {
 				this.getlocation()
 				this.getlocation()
+			}else {
+				this.storeList()
 			}
 			}
 		},
 		},
 		onReachBottom() {
 		onReachBottom() {
@@ -375,11 +450,16 @@
 			},
 			},
 			ktdk() {
 			ktdk() {
 				let that = this
 				let that = this
+				that.dkQrcodeUrl = ''
 				if (!that.is_tj && that.selctStore.id == '') {
 				if (!that.is_tj && that.selctStore.id == '') {
 					return that.$api.msg('请选择门店')
 					return that.$api.msg('请选择门店')
 				}
 				}
+				if(!that.isShowDk) {
+					return
+				}
 				this.isdk = true
 				this.isdk = true
 				// this.contractCreate()
 				// this.contractCreate()
+
 				this.toBuy()
 				this.toBuy()
 			},
 			},
 			contractCreate() {
 			contractCreate() {
@@ -419,10 +499,9 @@
 				})
 				})
 			},
 			},
 			//保存图片
 			//保存图片
-			saveShareQrcode() {
-				console.log(this.shareQrcodeUrl)
+			saveShareQrcode(img) {
 				uni.saveImageToPhotosAlbum({
 				uni.saveImageToPhotosAlbum({
-					filePath: this.shareQrcodeUrl,
+					filePath: this[img],
 					success: (res) => {
 					success: (res) => {
 						uni.showToast({
 						uni.showToast({
 							icon: 'none',
 							icon: 'none',
@@ -539,7 +618,7 @@
 									that[imgname] = res.tempFilePath
 									that[imgname] = res.tempFilePath
 									that.$forceUpdate()
 									that.$forceUpdate()
 									uni.hideLoading()
 									uni.hideLoading()
-									
+
 									// setTimeout(function() {
 									// setTimeout(function() {
 									// 	console.log(that.shareQrcodeUrl, that
 									// 	console.log(that.shareQrcodeUrl, that
 									// 		.canvasShow)
 									// 		.canvasShow)
@@ -575,9 +654,10 @@
 						// console.log(data, '结果');
 						// console.log(data, '结果');
 						if (data && data.list && data.list.length > 0) {
 						if (data && data.list && data.list.length > 0) {
 							that.selctStore = data.list[0]
 							that.selctStore = data.list[0]
-							if (data.list[0].distance * 1 <= 100) {
+							// if (data.list[0].distance * 1 <= 100) {
 								that.isFj = true
 								that.isFj = true
-							}
+								
+							// }
 						}
 						}
 					})
 					})
 					.catch(e => {
 					.catch(e => {
@@ -671,6 +751,9 @@
 			choosTc(index, item) {
 			choosTc(index, item) {
 				this.selectTcIndex = index
 				this.selectTcIndex = index
 				this.selectTc = item
 				this.selectTc = item
+				if (this.isdk) {
+					this.ktdk()
+				}
 			},
 			},
 			getRents() {
 			getRents() {
 				let that = this
 				let that = this
@@ -699,7 +782,7 @@
 				// uni.showLoading({
 				// uni.showLoading({
 				// 	title:'二维码生成中...'
 				// 	title:'二维码生成中...'
 				// })
 				// })
-				if(!this.isdk) {
+				if (!this.isdk) {
 					that.loading = true
 					that.loading = true
 				}
 				}
 				rentCreate({
 				rentCreate({
@@ -715,7 +798,8 @@
 					from: 'app', //来源
 					from: 'app', //来源
 					// #endif
 					// #endif
 					pay_type: that.isdk ? 'pxz' : that.payType, //支付方式
 					pay_type: that.isdk ? 'pxz' : that.payType, //支付方式
-					renew: that.renew
+					renew: that.renew,
+					is_certificate: that.isdk ? 0 : (that.isqxdk ? 1 : 0)
 				}).then(({
 				}).then(({
 					data,
 					data,
 					status,
 					status,
@@ -723,8 +807,8 @@
 				}) => {
 				}) => {
 					if (that.isdk) {
 					if (that.isdk) {
 						this.createSignFLow()
 						this.createSignFLow()
-					}else {
-						
+					} else {
+
 						if (data.status == 'ORDER_EXIST') {
 						if (data.status == 'ORDER_EXIST') {
 							uni.showModal({
 							uni.showModal({
 								title: '提示',
 								title: '提示',
@@ -749,34 +833,39 @@
 						} else {
 						} else {
 							// 立即支付
 							// 立即支付
 							// obj.orderMoneyPay();
 							// obj.orderMoneyPay();
-							let da = data.result.jsConfig;
-							let paydata = {
-								nonceStr: da.nonceStr,
-								package: da.package,
-								signType: da.signType,
-								paySign: da.paySign,
-								success: function(res) {
-									that.paySuccessTo();
-								},
-								fail: () => {
-									that.loading = false;
-								}
-							};
-							// #ifdef H5
-							paydata.timestamp = da.timestamp;
-							weixinObj.chooseWXPay(paydata);
-							// #endif
-							// #ifdef MP-WEIXIN
-							paydata.timeStamp = da.timestamp;
-							wx.requestPayment(paydata);
-							// #endif
+							if (data.status == 'SUCCESS' && that.payType == 'weixin') {
+								that.paySuccessTo();
+							} else {
+								let da = data.result.jsConfig;
+								let paydata = {
+									nonceStr: da.nonceStr,
+									package: da.package,
+									signType: da.signType,
+									paySign: da.paySign,
+									success: function(res) {
+										that.paySuccessTo();
+									},
+									fail: () => {
+										that.loading = false;
+									}
+								};
+								// #ifdef H5
+								paydata.timestamp = da.timestamp;
+								weixinObj.chooseWXPay(paydata);
+								// #endif
+								// #ifdef MP-WEIXIN
+								paydata.timeStamp = da.timestamp;
+								wx.requestPayment(paydata);
+								// #endif
+							}
+
 						}
 						}
-						
+
 					}
 					}
 					// that.val = data.result.link
 					// that.val = data.result.link
 					// uni.hideLoading()
 					// uni.hideLoading()
 					// that.$refs.mypopup.open()
 					// that.$refs.mypopup.open()
-					
+
 				})
 				})
 			},
 			},
 			orderMoneyPay() {
 			orderMoneyPay() {
@@ -889,6 +978,8 @@
 		flex-wrap: wrap;
 		flex-wrap: wrap;
 		justify-content: space-between;
 		justify-content: space-between;
 		padding: 0 25rpx 45rpx;
 		padding: 0 25rpx 45rpx;
+		height: 275rpx;
+		overflow: hidden;
 
 
 		.tc {
 		.tc {
 			width: 315rpx;
 			width: 315rpx;

+ 30 - 9
pages/user_home/myAction.vue

@@ -1,10 +1,19 @@
 <template>
 <template>
 	<view class="content">
 	<view class="content">
 		<empty v-if="loaded && list.length == 0"></empty>
 		<empty v-if="loaded && list.length == 0"></empty>
-		<view class="action" v-for="item in list" @click="goAction(item)">
-			<image :src="item.image_input[0]" mode="" class="action-img"></image>
+		<view class="action" v-for="item in list" >
+			<image :src="item.article.image_input[0]" mode="" class="action-img"></image>
 			<view class="action-tit">
 			<view class="action-tit">
-				{{item.title}}
+				<!-- {{item.status == 1 ? '已通过': (item.status == -1 ? '未通过': '待审核')}} -->
+				{{item.article.title}}
+			</view>
+			<view class=" time">
+				<view class="">
+					赠送:{{item.article.give_certificate}}骑行券
+				</view>
+				<view class="">
+					审核结果:{{item.status == 1 ? '已通过': (item.status == -1 ? '未通过': '待审核')}}
+				</view>
 			</view>
 			</view>
 		</view>
 		</view>
 		<uni-load-more :status="loadingType"></uni-load-more>
 		<uni-load-more :status="loadingType"></uni-load-more>
@@ -35,7 +44,7 @@
 			this.getActionList()
 			this.getActionList()
 		},
 		},
 		onReachBottom() {
 		onReachBottom() {
-
+			this.getActionList()
 		},
 		},
 		methods: {
 		methods: {
 			goAction(item) {
 			goAction(item) {
@@ -50,18 +59,25 @@
 				if (this.loadingType == 'loading' || this.loadingType == 'noMore') {
 				if (this.loadingType == 'loading' || this.loadingType == 'noMore') {
 					return
 					return
 				}
 				}
-				this.loadingType = 'more'
+				this.loadingType = 'loading'
 				record({
 				record({
 					page: this.page,
 					page: this.page,
 					limit: this.limit
 					limit: this.limit
 				}).then(res => {
 				}).then(res => {
 					this.list = this.list.concat(res.data.data)
 					this.list = this.list.concat(res.data.data)
+					console.log(res.data.data);
 					this.page++
 					this.page++
-					if (res.data.data.lengt == this.limit) {
-						this.loadingType = 'more'
-					} else {
-						this.loadingType = 'noMore'
+					try{
+						if (res.data.data.length == this.limit) {
+							this.loadingType = 'more'
+						} else {
+							this.loadingType = 'noMore'
+						}
+					}catch(e){
+						console.log(e);
+						//TODO handle the exception
 					}
 					}
+					
 					this.loaded = true
 					this.loaded = true
 				})
 				})
 			}
 			}
@@ -99,4 +115,9 @@
 			padding-left: 30rpx;
 			padding-left: 30rpx;
 		}
 		}
 	}
 	}
+	.time {
+		font-size: 12rpx;
+		padding: 20rpx;
+		padding-top: 0;
+	}
 </style>
 </style>

+ 1 - 1
pages/user_home/myRent.vue

@@ -80,7 +80,7 @@
 			xf() {
 			xf() {
 				// console.log(item);
 				// console.log(item);
 				uni.navigateTo({
 				uni.navigateTo({
-					url: '/pages/shop/rent?renow=1'
+					url: '/pages/shop/rent?renew=1'
 				})
 				})
 			},
 			},
 			navTo(url) {
 			navTo(url) {

BIN
static/icon/down1.png