|
|
@@ -86,9 +86,22 @@
|
|
|
选择套餐
|
|
|
</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}"
|
|
|
- @click="choosTc(index,item)">
|
|
|
+ @click="choosTc(index,item)" v-if="item.day == 30 || !userinfo.payRules">
|
|
|
|
|
|
<view class="tc-price">
|
|
|
{{item.price}}
|
|
|
@@ -113,6 +126,18 @@
|
|
|
</view> -->
|
|
|
</view>
|
|
|
<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-time">
|
|
|
支付押金
|
|
|
@@ -124,17 +149,7 @@
|
|
|
{{selectTc.deposit}}
|
|
|
</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>
|
|
|
@@ -144,7 +159,7 @@
|
|
|
class="hb"></canvas> -->
|
|
|
<image :src="shareQrcodeUrl" mode="" :style="{ width:cw + 'rpx', height: ch+'rpx',}"></image>
|
|
|
</view>
|
|
|
- <view class="bcewm" @click="saveShareQrcode">
|
|
|
+ <view class="bcewm" @click="saveShareQrcode('shareQrcodeUrl')">
|
|
|
保存二维码
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -159,20 +174,11 @@
|
|
|
</view> -->
|
|
|
</view>
|
|
|
<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-time">
|
|
|
- <image src="../../static/icon/orderAli.png" mode="heightFix"></image>开通代扣
|
|
|
+ <!-- <image src="../../static/icon/orderAli.png" mode="heightFix"></image> -->
|
|
|
+ 周期代扣
|
|
|
</view>
|
|
|
<!-- <view class="tc-time-price">
|
|
|
微信信用≥550分
|
|
|
@@ -181,7 +187,17 @@
|
|
|
77<text>¥88</text>
|
|
|
</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 class="myj-wrap" v-if="showDkEwm">
|
|
|
@@ -190,7 +206,7 @@
|
|
|
class="hb"></canvas> -->
|
|
|
<image :src="dkQrcodeUrl" mode="" :style="{ width:cw + 'rpx', height: ch+'rpx',}"></image>
|
|
|
</view>
|
|
|
- <view class="bcewm" @click="saveShareQrcode">
|
|
|
+ <view class="bcewm" @click="saveShareQrcode('dkQrcodeUrl')">
|
|
|
保存二维码
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -234,17 +250,27 @@
|
|
|
</image>
|
|
|
<view v-else class="noChecked"></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 class="ts" v-if="!isdk">
|
|
|
|
|
|
</view>
|
|
|
<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>
|
|
|
- </view>
|
|
|
- <view class="pay-price" v-else>
|
|
|
- 总计费用:<text>{{(selectTc.price*1).toFixed(2) || ''}}</text>
|
|
|
+ </view> -->
|
|
|
+ <view class="pay-price">
|
|
|
+ 总计费用:<text>{{showPrice}}</text>
|
|
|
</view>
|
|
|
<view class="pay-btn" @click="toBuy" :class="{'zfz': loading}">
|
|
|
{{loading?'支付中':'立即支付'}}
|
|
|
@@ -286,7 +312,10 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
-
|
|
|
+ isShowDk:true,
|
|
|
+ isShowAll: false,
|
|
|
+ showTc: [],
|
|
|
+ isqxdk: false,
|
|
|
isdk: false, //是否代扣
|
|
|
ismy: false, //是否免押
|
|
|
showbtn: false,
|
|
|
@@ -331,31 +360,77 @@
|
|
|
payType: 'yue',
|
|
|
sm: '', //使用说明
|
|
|
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: {
|
|
|
...mapState('user', ['address', 'userInfo']),
|
|
|
//展示免押二维码
|
|
|
showMyEwm() {
|
|
|
- return this.ismy && this.shareQrcodeUrl
|
|
|
+ return this.ismy && this.shareQrcodeUrl
|
|
|
},
|
|
|
//展示代扣二维码
|
|
|
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) {
|
|
|
- if(opt.renew) {
|
|
|
+ if (opt.renew) {
|
|
|
this.renew = opt.renew
|
|
|
}
|
|
|
this.getRents()
|
|
|
+
|
|
|
this.getSm()
|
|
|
},
|
|
|
onShow() {
|
|
|
this.userinfo()
|
|
|
if (this.address.latitude == '') {
|
|
|
this.getlocation()
|
|
|
+ }else {
|
|
|
+ this.storeList()
|
|
|
}
|
|
|
},
|
|
|
onReachBottom() {
|
|
|
@@ -375,11 +450,16 @@
|
|
|
},
|
|
|
ktdk() {
|
|
|
let that = this
|
|
|
+ that.dkQrcodeUrl = ''
|
|
|
if (!that.is_tj && that.selctStore.id == '') {
|
|
|
return that.$api.msg('请选择门店')
|
|
|
}
|
|
|
+ if(!that.isShowDk) {
|
|
|
+ return
|
|
|
+ }
|
|
|
this.isdk = true
|
|
|
// this.contractCreate()
|
|
|
+
|
|
|
this.toBuy()
|
|
|
},
|
|
|
contractCreate() {
|
|
|
@@ -419,10 +499,9 @@
|
|
|
})
|
|
|
},
|
|
|
//保存图片
|
|
|
- saveShareQrcode() {
|
|
|
- console.log(this.shareQrcodeUrl)
|
|
|
+ saveShareQrcode(img) {
|
|
|
uni.saveImageToPhotosAlbum({
|
|
|
- filePath: this.shareQrcodeUrl,
|
|
|
+ filePath: this[img],
|
|
|
success: (res) => {
|
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
|
@@ -539,7 +618,7 @@
|
|
|
that[imgname] = res.tempFilePath
|
|
|
that.$forceUpdate()
|
|
|
uni.hideLoading()
|
|
|
-
|
|
|
+
|
|
|
// setTimeout(function() {
|
|
|
// console.log(that.shareQrcodeUrl, that
|
|
|
// .canvasShow)
|
|
|
@@ -575,9 +654,10 @@
|
|
|
// console.log(data, '结果');
|
|
|
if (data && data.list && data.list.length > 0) {
|
|
|
that.selctStore = data.list[0]
|
|
|
- if (data.list[0].distance * 1 <= 100) {
|
|
|
+ // if (data.list[0].distance * 1 <= 100) {
|
|
|
that.isFj = true
|
|
|
- }
|
|
|
+
|
|
|
+ // }
|
|
|
}
|
|
|
})
|
|
|
.catch(e => {
|
|
|
@@ -671,6 +751,9 @@
|
|
|
choosTc(index, item) {
|
|
|
this.selectTcIndex = index
|
|
|
this.selectTc = item
|
|
|
+ if (this.isdk) {
|
|
|
+ this.ktdk()
|
|
|
+ }
|
|
|
},
|
|
|
getRents() {
|
|
|
let that = this
|
|
|
@@ -699,7 +782,7 @@
|
|
|
// uni.showLoading({
|
|
|
// title:'二维码生成中...'
|
|
|
// })
|
|
|
- if(!this.isdk) {
|
|
|
+ if (!this.isdk) {
|
|
|
that.loading = true
|
|
|
}
|
|
|
rentCreate({
|
|
|
@@ -715,7 +798,8 @@
|
|
|
from: 'app', //来源
|
|
|
// #endif
|
|
|
pay_type: that.isdk ? 'pxz' : that.payType, //支付方式
|
|
|
- renew: that.renew
|
|
|
+ renew: that.renew,
|
|
|
+ is_certificate: that.isdk ? 0 : (that.isqxdk ? 1 : 0)
|
|
|
}).then(({
|
|
|
data,
|
|
|
status,
|
|
|
@@ -723,8 +807,8 @@
|
|
|
}) => {
|
|
|
if (that.isdk) {
|
|
|
this.createSignFLow()
|
|
|
- }else {
|
|
|
-
|
|
|
+ } else {
|
|
|
+
|
|
|
if (data.status == 'ORDER_EXIST') {
|
|
|
uni.showModal({
|
|
|
title: '提示',
|
|
|
@@ -749,34 +833,39 @@
|
|
|
} else {
|
|
|
// 立即支付
|
|
|
// 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
|
|
|
// uni.hideLoading()
|
|
|
// that.$refs.mypopup.open()
|
|
|
-
|
|
|
+
|
|
|
})
|
|
|
},
|
|
|
orderMoneyPay() {
|
|
|
@@ -889,6 +978,8 @@
|
|
|
flex-wrap: wrap;
|
|
|
justify-content: space-between;
|
|
|
padding: 0 25rpx 45rpx;
|
|
|
+ height: 275rpx;
|
|
|
+ overflow: hidden;
|
|
|
|
|
|
.tc {
|
|
|
width: 315rpx;
|