增加积分兑换支付方式

youmengting-dev
游梦婷 1 year ago
parent 0d64307665
commit 0f0699aea4
  1. 7
      pages/goods/goods.vue
  2. 127
      pages/order/confirmation.vue
  3. 21
      pages/tabBar/category/category.vue
  4. 21
      pages/user/deposit/deposit.vue
  5. 2
      subPages/coupon-packge-details/coupon-packge-details.vue

@ -78,11 +78,12 @@
@click="perImage(codes)"> @click="perImage(codes)">
</image> </image>
</view> </view>
<view style="height: 48px;"> <view style="height: 99upx;">
</view> </view>
</view> </view>
<wybPopup ref="popup" type="bottom" width="500" :scrollY="true" radius="6" :showCloseIcon="true"> <wybPopup ref="popup" type="bottom" width="500" :scrollY="true" radius="6" :showCloseIcon="true">
<view class="fotct font18 fontwig6 fcor333 mart10 height30">赠送卡券</view> <view class="fotct font18 fontwig6 fcor333 mart10 height30">赠送卡券</view>
<template v-if="goodsData.length>0">
<view class="width92 height110 tccs mart10" v-for="product in goodsData[0].handselCouponList" <view class="width92 height110 tccs mart10" v-for="product in goodsData[0].handselCouponList"
:key="product.id"> :key="product.id">
<!-- mode="widthFix" :src="imageUrl+product.highCouponModel.couponImg" --> <!-- mode="widthFix" :src="imageUrl+product.highCouponModel.couponImg" -->
@ -110,6 +111,8 @@
</view> </view>
</view> </view>
</view> </view>
</template>
</wybPopup> </wybPopup>
<!-- <authorize></authorize> --> <!-- <authorize></authorize> -->
</view> </view>
@ -144,7 +147,7 @@
currentSwiper: 0, currentSwiper: 0,
anchorlist: [], // anchorlist: [], //
// //
goodsData: "", goodsData: [],
//html //html
desid: '', desid: '',
imageUrl: app.globalData.imgUrl, imageUrl: app.globalData.imgUrl,

@ -3,7 +3,7 @@
<view class="width94 comorder mart10"> <view class="width94 comorder mart10">
<view class="height100p width94 goodsimg"> <view class="height100p width94 goodsimg">
<image class="flleft" mode="widthFix" :src="imageUrl+couponList.couponImg"></image> <image class="flleft" mode="widthFix" v-if="couponList.couponImg" :src="imageUrl+couponList.couponImg"></image>
<view class="tcrig"> <view class="tcrig">
<view class="font18 fontwig6 fcor333 text1">{{couponList.couponName}}</view> <view class="font18 fontwig6 fcor333 text1">{{couponList.couponName}}</view>
<view class="font13 fcor666 mart10">规格: 默认</view> <view class="font13 fcor666 mart10">规格: 默认</view>
@ -127,7 +127,7 @@
</view> --> </view> -->
</view> </view>
<view class=" width100 backcorfff alijusstart paddbotm10" style="padding-left: 2%;"> <view class=" width100 backcorfff alijusstart paddbotm10" style="padding-left: 2%;">
<image src="../../static/img/sigh.png" mode="widthFix" class="icon20"></image> <image src="../../static/img/sigh.png" mode="widthFix" style="width:20px;height:20px"></image>
<text class="fcor999 font13">积分抵扣与优惠券抵扣不同享</text> <text class="fcor999 font13">积分抵扣与优惠券抵扣不同享</text>
</view> </view>
@ -141,7 +141,33 @@
</view> </view>
</view> </view>
<view class="width100" v-for="(item,index) in paytypeList" :key="index"> <view class="width100" v-for="(item,index) in paytypeList" :key="index">
<view class="width94 line1 mart5 marb5" v-if="item == 2"></view> <view class="width94 line1 mart5 marb5"></view>
<view class="height50 width100 backcorfff" @tap="paytype=item.payTypeId" >
<view class="width70 flleft fcor333 font16 text1" style="padding-left: 4%;">
<view class="dis-flex">
<image mode="aspectFit" v-if="item.payTypeLogo" :src="imageUrl+item.payTypeLogo" style="width:30px;height:30px;"></image>
<text class="margle">{{item.payTypeName}}</text>
<text class="font14 fcor666 margle" v-if="item.payTypeId == 3">可用余额: {{tongCardPrice}}</text>
<text class="font14 fcor666 margle" v-if="item.payTypeId == 6">可用余额: {{oilPirce}}</text>
<text class="font14 fcor666 margle" v-if="item.payTypeId == 7">可用余额: {{oilUserNoPrice}}</text>
</view>
</view>
<view class="width20 flright fotrt paddtright10 font15 fontwig6 fcor666 alijun"
style="align-items: center;" v-if="isUse">
<template v-if="item.payTypeId == 3">
<radio :checked="paytype==item.payTypeId" @click="changeRiado()" color="#0083f5" />
</template>
<template v-else>
<radio :checked="paytype==item.payTypeId" color="#0083f5" />
</template>
</view>
</view>
<!-- <view class="width94 line1 mart5 marb5" v-if="item == 2"></view>
<view class="height50 width100 backcorfff" @tap="paytype='2'" v-if="item == 2"> <view class="height50 width100 backcorfff" @tap="paytype='2'" v-if="item == 2">
<view class="width50 flleft fcor333 font16" style="padding-left: 4%;"> <view class="width50 flleft fcor333 font16" style="padding-left: 4%;">
微信支付 微信支付
@ -180,7 +206,8 @@
style="align-items: center;" v-if="isUse"> style="align-items: center;" v-if="isUse">
<radio :checked="paytype=='7'" color="#0083f5" /> <radio :checked="paytype=='7'" color="#0083f5" />
</view> </view>
</view> </view> -->
</view> </view>
<view v-if="paytype=='7'" class="backcorfff"> <view v-if="paytype=='7'" class="backcorfff">
@ -218,18 +245,18 @@
<view class="sum">实付:<view class="money">{{paytheprice}}</view> <view class="sum">实付:<view class="money">{{paytheprice}}</view>
</view> </view>
<!-- #ifdef MP --> <!-- #ifdef MP -->
<button class="btn" open-type="getPhoneNumber" v-if="user == null" <button class="btn" open-type="getPhoneNumber" v-if="user == null || !user"
@getphonenumber="loginByPhone">立即支付</button> @getphonenumber="loginByPhone">立即支付</button>
<button class="btn" v-else @tap="toPay">立即支付</button> <button class="btn" v-else @tap="toPay">立即支付</button>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef H5 --> <!-- #ifdef H5 -->
<button class="btn" v-if="user.phone == null" @click="jumpH5Bding">立即支付</button> <button class="btn" v-if="user.phone == null || !user.phone" @click="jumpH5Bding">立即支付</button>
<button class="btn" v-else @tap="toPay">立即支付</button> <button class="btn" v-else @tap="toPay">立即支付</button>
<!-- #endif --> <!-- #endif -->
</view> </view>
</view> </view>
<wybPopup ref="popup" type="bottom" width="500" scrollY="true" radius="6" :showCloseIcon="true"> <wybPopup ref="popup" type="bottom" width="500" :scrollY="true" radius="6" :showCloseIcon="true">
<view class="fotct font18 fontwig6 fcor333 mart10 height30">优惠券选择</view> <view class="fotct font18 fontwig6 fcor333 mart10 height30">优惠券选择</view>
<view class="width92 height110 tccs mart10" v-for="(items, index) in UserNormalDiscountList" :key="items" <view class="width92 height110 tccs mart10" v-for="(items, index) in UserNormalDiscountList" :key="items"
@click="radioChanges(items)"> @click="radioChanges(items)">
@ -288,7 +315,7 @@
radioStatus: true, radioStatus: true,
memDiscountId: '', memDiscountId: '',
user: '', user: '',
paytype: '2', paytype: '',
PaymentPassword: '', PaymentPassword: '',
orderId: '', orderId: '',
jumpType: '', jumpType: '',
@ -316,7 +343,7 @@
oilPirce: 0, // oilPirce: 0, //
oilUserno: '', // oilUserno: '', //
contactName: '', // contactName: '', //
oilUserNoPrice: '', // oilUserNoPrice: 0, //
UserCard: '', // UserCard: '', //
cardNoNumber: '', // cardNoNumber: '', //
}; };
@ -337,9 +364,12 @@
onShow() { onShow() {
let that = this; let that = this;
// that.paytype = ''; // that.paytype = '';
that.user = app.globalData.userInfo; /* */
// that.user = app.globalData.userInfo;
/* */
that.findUser(); that.findUser();
this.getUserCardList(); this.getUserCardList();
}, },
onHide() { onHide() {
@ -387,8 +417,12 @@
getThirdPartyByDetail(datas).then(res => { getThirdPartyByDetail(datas).then(res => {
if (res.return_code == '000000') { if (res.return_code == '000000') {
this.rechargeDes = res.return_data; this.rechargeDes = res.return_data;
this.paytypeList = res.return_data.productPayType.split(',');
this.paytypeList = this.paytypeList.slice(0, this.paytypeList.length - 1); // this.paytypeList = res.return_data.productPayType.split(',');
// this.paytypeList = this.paytypeList.slice(0, this.paytypeList.length - 1);
this.paytypeList = res.return_data.productPayTypeNew;
let zkprice = parseFloat(res.return_data.integralDiscount / 100).toFixed(2); let zkprice = parseFloat(res.return_data.integralDiscount / 100).toFixed(2);
let pprice = parseFloat(this.paytheprice * 100).toFixed(0) let pprice = parseFloat(this.paytheprice * 100).toFixed(0)
let payprice = parseFloat(this.paytheprice * 100 * zkprice).toFixed( let payprice = parseFloat(this.paytheprice * 100 * zkprice).toFixed(
@ -398,6 +432,26 @@
} else { } else {
this.availIntegal = payprice; this.availIntegal = payprice;
} }
/* 默认选第一个支付方式 */
if(this.paytypeList.length>0){
this.paytype = this.paytypeList[0].payTypeId;
if(this.paytype == 8){
if(this.isDiscount){
this.isDiscount = false;
this.$nextTick(()=>{
this.priceValue = [0,Number(this.availIntegal)];
this.isDiscount = true;
this.blockEnd();
console.log(this.paytype,"11111111",this.priceValue);
})
}
}
}
} }
}); });
}, },
@ -408,6 +462,7 @@
if (res.return_code == '000000') { if (res.return_code == '000000') {
app.globalData.userInfo = res.return_data; app.globalData.userInfo = res.return_data;
this.user = res.return_data; this.user = res.return_data;
if (this.user.hltCardNo) { if (this.user.hltCardNo) {
this.getHuiLianTongCardBalance(); this.getHuiLianTongCardBalance();
} }
@ -545,7 +600,7 @@
}, },
// //
priceCaluc(item) { priceCaluc(item) {
let zkprice = parseFloat(this.rechargeDes.integralDiscount / 100).toFixed(2); let zkprice = parseFloat(this.rechargeDes.integralDiscount / 100).toFixed(2);//使integralDiscount
let pprice = parseFloat(item * 100).toFixed(0); let pprice = parseFloat(item * 100).toFixed(0);
let payprice = parseFloat(item * 100 * zkprice).toFixed(0); let payprice = parseFloat(item * 100 * zkprice).toFixed(0);
if (payprice > this.user.gold) { if (payprice > this.user.gold) {
@ -670,6 +725,48 @@
return; return;
} }
/* 积分兑换*/
if(this.paytype == '8'){
let title="";
if(this.priceValue[1] >= this.availIntegal){ //
title = "积分不足,是否充值积分?"
}else{ //
let Remain = parseFloat(this.availIntegal - this.priceValue[1]);/* 剩余积分数量 */
let price = parseFloat(this.paytheprice*100); /* 需要的积分数量*/
if(Remain >=price){
uni.showToast({
title: '积分充足,请拖动滑杆进行抵扣',
icon: 'none',
duration: 2000
})
return
}else{
title = "积分不足,是否充值积分?"
}
}
let that = this;
uni.showModal({
title: '提示',
content: title,
success: function (res) {
if (res.confirm) {
uni.navigateTo({
url:'/pages/user/deposit/deposit?inputAmount='+that.paytheprice
})
} else if (res.cancel) {
}
}
});
return
}
if (this.orderDetails) { if (this.orderDetails) {
this.wechatPay(this.orderDetails); this.wechatPay(this.orderDetails);
return; return;
@ -698,6 +795,7 @@
"phone": this.contactPhone "phone": this.contactPhone
} }
} }
create(goods).then(res => { create(goods).then(res => {
uni.hideLoading(); uni.hideLoading();
if (res.return_code == '000000') { if (res.return_code == '000000') {
@ -743,6 +841,7 @@
}) })
return; return;
} }
if (that.paytype == '2') { if (that.paytype == '2') {
// #ifdef H5 // #ifdef H5
let params = { let params = {
@ -1050,8 +1149,10 @@
.deductionPrice).toFixed(2); .deductionPrice).toFixed(2);
} }
if (this.paytheprice == 0) { if (this.paytheprice == 0) {
if(this.paytype!=8){
this.isUse = false; this.isUse = false;
this.paytype = ''; this.paytype = '';
}
} else { } else {
this.isUse = true; this.isUse = true;
} }

@ -83,8 +83,9 @@
</cover-view> </cover-view>
<cover-view class="width96 height80 bor-botm1 alijusstart" v-for="(box,i) in marker" :key="i" <cover-view class="width96 height80 bor-botm1 alijusstart" v-for="(box,i) in marker" :key="i"
@click="seeloaction(box)"> @click="seeloaction(box)">
<image mode="aspectFit" :src="box.logo" class="recontleft flleft border-r" <template v-if="box.id != 0">
style="width: 50px;height:50px"> <image mode="widthFix" :src="box.logo" class="recontleft flleft border-r"
@error="imgerror($event, i )" style="width: 50px;">
</image> </image>
<cover-view class="fotlt paddleft5"> <cover-view class="fotlt paddleft5">
<cover-view class="text2 width100 font16 fontwig6"> <cover-view class="text2 width100 font16 fontwig6">
@ -100,6 +101,7 @@
</cover-view> </cover-view>
</cover-view> </cover-view>
</cover-view> </cover-view>
</template>
</cover-view> </cover-view>
</scroll-view> </scroll-view>
</cover-view> </cover-view>
@ -188,8 +190,8 @@
<view class="width96 height80 bor-botm1 alijusstart" v-for="(box,i) in marker" :key="i" <view class="width96 height80 bor-botm1 alijusstart" v-for="(box,i) in marker" :key="i"
@click="seeloaction(box)"> @click="seeloaction(box)">
<template v-if="box.id != 0"> <template v-if="box.id != 0">
<image mode="aspectFit" :src="box.logo" class="recontleft flleft border-r" <image mode="widthFix" :src="box.logo" class="recontleft flleft border-r"
style="width: 50px;height: 50px;"> @error="imgerror($event, i )" style="width: 50px;">
</image> </image>
<view class="fotlt paddleft5"> <view class="fotlt paddleft5">
<view class="text2 width100 font16 fontwig6"> <view class="text2 width100 font16 fontwig6">
@ -398,7 +400,8 @@
rotate: 1, rotate: 1,
alpha: 1, alpha: 1,
width: 40, width: 40,
height: 40 height: 40,
callout:{},
}) })
@ -433,6 +436,7 @@
callouttap(e) { callouttap(e) {
// console.log(e, "") // console.log(e, "")
let markerId = e.detail.markerId; let markerId = e.detail.markerId;
if(markerId == 0) return;
for (var i = 0; i < this.marker.length; i++) { for (var i = 0; i < this.marker.length; i++) {
if (markerId == this.marker[i].id) { if (markerId == this.marker[i].id) {
this.seeloaction(this.marker[i]); this.seeloaction(this.marker[i]);
@ -656,12 +660,17 @@
*/ */
}, },
//
imgerror(e,index){
console.log(e,index,"图片出错")
this.marker[index].logo = this.imagewxUrl+this.imgadres3;
}
} }
} }
</script> </script>
<style lang='less' scoped> <style lang='less' scoped>
image{will-change: transform}
.map-container { .map-container {
position: relative; position: relative;

@ -81,11 +81,20 @@
user: "", user: "",
imagewxUrl: app.globalData.imageWxImg, imagewxUrl: app.globalData.imageWxImg,
imgadres: 'wxpay.png', imgadres: 'wxpay.png',
paytypeList: [] // paytypeList: [], //
isGoBack:false,
}; };
}, },
onLoad() { onLoad(options) {
console.log(options)
if(options.inputAmount){
this.inputAmount=options.inputAmount;
this.isGoBack = true;
}
this.user = app.globalData.userInfo this.user = app.globalData.userInfo
}, },
onShow() { onShow() {
this.getThirdPartyByDetail(); this.getThirdPartyByDetail();
@ -222,6 +231,7 @@
}) })
}, },
payRequest: function(self) { payRequest: function(self) {
let that = this;
uni.showLoading({ uni.showLoading({
title: '支付中...' title: '支付中...'
}) })
@ -254,9 +264,16 @@
uni.showToast({ uni.showToast({
title: '支付成功' title: '支付成功'
}) })
if(that.isGoBack){
setTimeout(() => {
uni.navigateBack({})
}, 100)
}else{
uni.reLaunch({ uni.reLaunch({
url: '../success/success?id=' + that.couponId url: '../success/success?id=' + that.couponId
}); });
}
}, },
cancel: function(r) {}, cancel: function(r) {},
fail: function(res) {} fail: function(res) {}

@ -62,7 +62,7 @@
@click="perImage(codes)"> @click="perImage(codes)">
</image> </image>
</view> </view>
<view style="height: 48px;"> <view style="height: 99upx;">
</view> </view>
</view> </view>

Loading…
Cancel
Save