修改商城

This commit is contained in:
zpc 2025-03-06 18:44:53 +08:00
parent 6e4a7249a4
commit 2ef3897856
2 changed files with 104 additions and 31 deletions

View File

@ -82,17 +82,29 @@
</view>
<view class="pay-title ziti">选择支付方式</view>
<view class="br20 mt20" style="background: #5B5B5D;">
<view class="pay-type" @click="changePay('isWXPay')">
<view class="pay-type" @click="changePay(0)">
<view class="" style="width: 100%; color: white;">
微信支付
</view>
<view class="icon">
<image v-if="isWXPay" :src="$img1('common/check_act.png')" lazy-load></image>
<image v-if="zhifu==0" :src="$img1('common/check_act.png')" lazy-load></image>
<image v-else :src="$img1('common/check.png')" lazy-load></image>
</view>
</view>
<view class="pay-type" @click="changePay('useMoney')">
<view class="pay-type" @click="changePay(1)">
<view class="" style="width: 100%; color: white;">
吧唧币¥
{{ orderData.goods.price*100 }} (剩余:{{ orderData.use_integral }})
</view>
<view class="icon">
<image v-if="zhifu==1" :src="$img1('common/check_act.png')" lazy-load></image>
<image v-else :src="$img1('common/check.png')" lazy-load></image>
</view>
</view>
<!-- <view class="pay-type" @click="changePay('useMoney')">
<view class="" style="width: 100%; color: white;">
星钻支付¥
@ -104,7 +116,7 @@
<image v-else :src="$img1('common/check.png')" lazy-load></image>
</view>
</view>
</view> -->
</view>
<view class="rule">
@ -132,14 +144,16 @@
<view class="pay-btn" @click="$c.noDouble(confirmSubmit(1))">
<text>立即支付</text>
<view class="pay-btn" v-if="zhifu==0" @click="$c.noDouble(confirmSubmit(1))">
<text>
{{
` ¥${orderData.price}`
}}
</text>
</view>
<view class="pay-btn" v-if="zhifu==1" @click="$c.noDouble(pay(1))">
<text>{{orderData.price*100}}吧唧币</text>
</view>
</view>
</uni-popup>
</view>
@ -161,8 +175,9 @@
orderData: null,
isAgree: true,
isWXPay: true,
useMoney: true,
useMoney: false,
integral: true,
zhifu: 0,
}
},
onLoad() {
@ -232,25 +247,17 @@
this.goodsId = data.id;
var that = this;
this.req({
url: 'ordermoney',
url: 'mall_ordermoney',
data: {
prize_num: 1,
goods_id: data.id,
goods_num: 1,
use_money_is: this.useMoney ? 1 : 2,
use_integral_is: this.isWXPay ? 1 : 2,
// coupon_id: (that.couponData && that.couponData.id) || ''
},
success(res) {
if (res.status == 1) {
// that.pay_news = res.data
// if (res.data.coupon_id) {
// that.couponData = {
// id: res.data.coupon_id,
// price: res.data.coupon_price
// }
// }
that.orderData = res.data
that.zhifu = 0;
that.$refs.pop.open()
}
}
@ -262,9 +269,15 @@
},
changePay(e) {
this[e] = !this[e]
if (this.zhifu != e) {
this.zhifu = e;
}
if (this.zhifu == 1) {
this.confirmSubmit(0)
}
// this[e] = !this[e]
// this.confirmSubmit(0)
},
confirmSubmit(type) {
@ -281,16 +294,11 @@
var that = this;
let url = 'infinite_ordermoney'
let url = 'mall_ordermoney'
let data = {
goods_id: this.goodsId,
prize_num: 1,
use_money_is: this.useMoney ? 1 : 2,
use_integral_is: this.isWXPay ? 1 : 2,
// coupon_id: (this.couponData && this.couponData.id) || '',
// is_mibao: this.pageTabCur
// ad_id: uni.getStorageSync('_ad_id')
}
if (type == 1) {
@ -320,8 +328,6 @@
if (type == 0) {
console.log("res.data", res.data);
this.orderData = res.data;
// that.open('pop');
}
if (type == 1) {
@ -356,6 +362,73 @@
},
pay(type) {
//orderData.price
//{{ orderData.goods.price*100 }} (:{{ orderData.use_integral }})
var pri = this.orderData.goods.price * 100;
if (this.orderData.use_integral < pri) {
uni.showToast({
title: '吧唧币不足',
icon: 'none',
});
return;
}
console.log("type", type);
var that = this;
let url = 'mall_orderbuy'
let data = {
goods_id: this.goodsId,
prize_num: 1,
}
this.req({
url,
data,
success: async res => {
if (res.status == 1) {
if (type == 0) {
console.log("res.data", res.data);
this.orderData = res.data;
}
if (type == 1) {
that.close('pop')
if (res.data.status == 1) {
const status = await that.$c.wxMpPay({
data: res.data.res
})
if (status == 'success') {
// that.getPrize(res.data.order_num)
that.getData();
}
} else {
that.$c.toast({
title: res.msg,
duration: 500,
success: () => {
// that.getPrize(res.data.order_num)
that.getData();
}
})
}
}
}
}
})
},
},
}
</script>

View File

@ -163,7 +163,7 @@
<view class="align-center justify-between mt30">
<view class="" style="color: #FFFFFF;">
<text style="color: #D3AFFF;">{{nowChooseNum}}</text>
件物品合计兑换<text style="color: #D3AFFF;"></text>
件物品合计兑换<text style="color: #D3AFFF;">吧唧币</text>
<text style="color: #D3AFFF; font-size: 30rpx;">{{totalChangeMoney}}</text>
</view>
<view class="change-pop-ft" @click="$c.noDouble(submitChange)">
@ -298,7 +298,7 @@
</view>
<view class="item-info">
<view class="title center hang1">
恭喜您兑换成功获得{{zhanshiMoney}}
成功获得{{zhanshiMoney}}吧唧币
</view>
</view>
</view>