|
|
|
@ -25,6 +25,24 @@ |
|
|
|
|
¥{{orderPrice}} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<!-- #ifdef MP --> |
|
|
|
|
<view class="width94 line1 mart5 marb5"></view> |
|
|
|
|
<view class="height50 width100 backcorfff" @click="showPopup()"> |
|
|
|
|
<view class="width50 flleft fcor333 fontwig6 font16" style="padding-left: 4%;"> |
|
|
|
|
优惠抵扣<text class="yhqky">{{OrderPreList.length}}张可用</text> |
|
|
|
|
</view> |
|
|
|
|
<view class="width40 flright fotrt paddtright10 font15 fontwig6 fcor666 alijun" |
|
|
|
|
style="align-items: center;" v-if="deductionPrice == 0"> |
|
|
|
|
未使用 |
|
|
|
|
<image style="width: 40rpx;height: 40rpx;" src="../../static/img/jt.png"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="width40 flright fotrt paddtright10 font15 fontwig6 fcoreb5 alijun" |
|
|
|
|
style="align-items: center;" v-else> |
|
|
|
|
-¥{{deductionPrice}} |
|
|
|
|
<image style="width: 40rpx;height: 40rpx;" src="../../static/img/jt.png"></image> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<!-- #endif --> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<view class="width94 comorder mart10"> |
|
|
|
@ -85,6 +103,21 @@ |
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<wybPopup ref="popup" type="bottom" width="500" scrollY="true" radius="6" :showCloseIcon="true"> |
|
|
|
|
<view class="fotct font18 fontwig6 fcor333 mart10 height30">优惠券选择</view> |
|
|
|
|
<view class="width92 height110 tccs mart10" v-for="(items, index) in OrderPreList" :key="items" |
|
|
|
|
@click="radioChanges(items)"> |
|
|
|
|
<image mode="widthFix" class="flleft" :src="imageUrl+items.discountImg"></image> |
|
|
|
|
<view class="tcrig"> |
|
|
|
|
<view class="yhprice"> |
|
|
|
|
<radio color="#0083f5" :checked="items.id == memDiscountId" /> |
|
|
|
|
</view> |
|
|
|
|
<view class="font16 fontwig6 fcor333 text1">{{items.discountName}}</view> |
|
|
|
|
<view class="font13 fcor999 mart5">有效期至:{{items.useEndTime | timeFormat('yyyy-mm-dd')}}</view> |
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</wybPopup> |
|
|
|
|
<ssPaymentPassword ref="paymentPassword" :mode="1" @submit="submitHandle" /> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
@ -98,8 +131,10 @@ |
|
|
|
|
orderToGoldPayunion, |
|
|
|
|
hltUnionCardPayUnion, |
|
|
|
|
getHuiLianTongCardBalance, |
|
|
|
|
loginByPhone |
|
|
|
|
loginByPhone, |
|
|
|
|
getUserOrderPreList |
|
|
|
|
} from '../../Utils/Api.js'; |
|
|
|
|
import wybPopup from '../../components/wyb-popup/wyb-popup.vue'; |
|
|
|
|
import ssPaymentPassword from '../../components/sanshui-payment-password'; |
|
|
|
|
let app = getApp(); |
|
|
|
|
// #ifdef H5 |
|
|
|
@ -107,6 +142,7 @@ |
|
|
|
|
// #endif |
|
|
|
|
export default { |
|
|
|
|
components: { |
|
|
|
|
wybPopup, |
|
|
|
|
ssPaymentPassword |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
@ -127,25 +163,28 @@ |
|
|
|
|
radioStatus: true, |
|
|
|
|
memDiscountId: '', |
|
|
|
|
user: '', |
|
|
|
|
paytype: '', |
|
|
|
|
paytype: 'weixin', |
|
|
|
|
PaymentPassword: '', |
|
|
|
|
orderId: '', |
|
|
|
|
jumpType: '', |
|
|
|
|
tongCardPrice: 0, |
|
|
|
|
|
|
|
|
|
//话费充值 |
|
|
|
|
orderPrice: 0, |
|
|
|
|
payPrice: 0, |
|
|
|
|
//保存价格 |
|
|
|
|
saveprice:0, |
|
|
|
|
rechargeContent: '', |
|
|
|
|
rechargeModel: '', |
|
|
|
|
agentKey: '', |
|
|
|
|
objectId: '' |
|
|
|
|
objectId: '', |
|
|
|
|
OrderPreList: [] |
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
onLoad(options) { |
|
|
|
|
this.orderPrice = options.orderPrice; |
|
|
|
|
this.payPrice = options.payPrice; |
|
|
|
|
this.saveprice = options.payPrice; |
|
|
|
|
this.rechargeContent = options.rechargeContent; |
|
|
|
|
this.rechargeModel = options.rechargeModel; |
|
|
|
|
this.agentKey = options.agentKey; |
|
|
|
@ -153,9 +192,12 @@ |
|
|
|
|
}, |
|
|
|
|
onShow() { |
|
|
|
|
let that = this; |
|
|
|
|
that.paytype = ''; |
|
|
|
|
that.paytype = 'weixin'; |
|
|
|
|
that.user = app.globalData.userInfo; |
|
|
|
|
that.findUser(); |
|
|
|
|
// #ifdef MP |
|
|
|
|
that.getUserOrderPreList(); |
|
|
|
|
// #endif |
|
|
|
|
}, |
|
|
|
|
onHide() { |
|
|
|
|
|
|
|
|
@ -176,6 +218,17 @@ |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
//查询优惠券 |
|
|
|
|
getUserOrderPreList() { |
|
|
|
|
let params = { |
|
|
|
|
usingAttribution: 1 |
|
|
|
|
} |
|
|
|
|
getUserOrderPreList(params).then(res => { |
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
this.OrderPreList = res.return_data; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
//显示弹出 |
|
|
|
|
showPopup() { |
|
|
|
|
this.$refs.popup.show(); |
|
|
|
@ -199,6 +252,40 @@ |
|
|
|
|
url: '/pages/login/register' |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
radioChanges(item) { |
|
|
|
|
this.paytheprice = this.saveprice; |
|
|
|
|
if (this.memDiscountId == item.id) { // 如果已经选中,则取消选中 |
|
|
|
|
this.memDiscountId = ''; |
|
|
|
|
this.payPrice = this.saveprice; |
|
|
|
|
this.deductionPrice = '0.00'; |
|
|
|
|
} else { // 否则进行选中赋值 |
|
|
|
|
this.memDiscountId = item.id; |
|
|
|
|
if (item.discountType == 1) { |
|
|
|
|
if (this.paytheprice > item.discountPrice) { |
|
|
|
|
//满减价格 |
|
|
|
|
this.deductionPrice = item.discountPrice; |
|
|
|
|
this.payPrice = (((this.paytheprice * 100) - (this.deductionPrice * 100)) / |
|
|
|
|
100); |
|
|
|
|
} else { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '未满足满减条件', |
|
|
|
|
icon: 'none', |
|
|
|
|
duration: 2000 |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} else if (item.discountType == 2) { |
|
|
|
|
//抵扣价格 |
|
|
|
|
this.deductionPrice = item.discountPrice; |
|
|
|
|
this.payPrice = (((this.paytheprice * 100) - (this.deductionPrice * 100)) / 100); |
|
|
|
|
} else if (item.discountType == 3) { |
|
|
|
|
// 打折 |
|
|
|
|
this.deductionPrice = this.paytheprice - this.paytheprice * ( |
|
|
|
|
item.discountPrice / 10); |
|
|
|
|
this.payPrice = this.paytheprice * (item.discountPrice / 10); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.$refs.popup.hide(); |
|
|
|
|
}, |
|
|
|
|
// 微信获取手机号 |
|
|
|
|
loginByPhone(PhoneNumber) { |
|
|
|
|
if (PhoneNumber.detail.iv == undefined) { |
|
|
|
@ -292,6 +379,10 @@ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
//弹出优惠券 |
|
|
|
|
showPopup() { |
|
|
|
|
this.$refs.popup.show(); |
|
|
|
|
}, |
|
|
|
|
//获取订单数据 |
|
|
|
|
orderToUNionPay(item) { |
|
|
|
|
let that = this; |
|
|
|
@ -520,7 +611,7 @@ |
|
|
|
|
border-radius: 8px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.jtcs { |
|
|
|
|
.j { |
|
|
|
|
width: 40rpx; |
|
|
|
|
height: 40rpx; |
|
|
|
|
margin-top: 30rpx; |
|
|
|
@ -540,7 +631,8 @@ |
|
|
|
|
width: 100%; |
|
|
|
|
height: 25px; |
|
|
|
|
text-align: right; |
|
|
|
|
margin-top: -20px; |
|
|
|
|
margin-top: -30px; |
|
|
|
|
margin-left: 50px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.price-number { |
|
|
|
@ -627,6 +719,7 @@ |
|
|
|
|
image { |
|
|
|
|
width: 170rpx; |
|
|
|
|
max-height: 170rpx; |
|
|
|
|
margin-left: 10px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|