Compare commits

..

1 Commits
main ... manghe

Author SHA1 Message Date
zpc
417a4a455c 修改域名 2025-03-14 09:46:40 +08:00
4 changed files with 117 additions and 73 deletions

16
main.js
View File

@ -237,17 +237,17 @@ Vue.prototype.onBridgeReady = function(data) {
}
// 测试
const baseUrl = 'https://testbaji.onelight.vip'
const baseUrl = 'https://manghe.zpc-xy.com'
//20241114164139.png
// 正式
// const baseUrl = 'https://bajiapi.onelight.vip'
Vue.prototype.siteBaseUrl = baseUrl + '/api/'
Vue.prototype.$z_img2 = baseUrl + '/zcq/'
Vue.prototype.$baseUrl = baseUrl
Vue.prototype.$img = url => baseUrl + '/static/web' + url
// Vue.prototype.$img1 = url => baseUrl + '/static/web' + url
Vue.prototype.$img1 = url => baseUrl + '/static/web/static/' + url
const imageBaseUrl="https://mh.shhuanmeng.com";
Vue.prototype.$z_img2 =imageBaseUrl + '/zcq/'
Vue.prototype.$baseUrl = imageBaseUrl
Vue.prototype.$img = url => imageBaseUrl + '/static/web' + url
// Vue.prototype.$img1 = url => imageBaseUrl + '/static/web' + url
Vue.prototype.$img1 = url => imageBaseUrl + '/static/web/static/' + url
Vue.prototype.$sys = () => uni.getSystemInfoSync()

View File

@ -127,7 +127,7 @@
"quickapp" : {},
/* */
"mp-weixin" : {
"appid" : "wxb7b0409b4b36e4b1",
"appid" : "wx595ec949c6efd72b",
"setting" : {
"urlCheck" : false,
"es6" : false,

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

@ -86,9 +86,7 @@
<view class="pic">
<image :src="a.goodslist_imgurl" lazy-load></image>
<view class="num center">×{{ a.prize_num }}</view>
<view class="num"
style="left:auto;right:0;border-radius:0rpx 0rpx 0rpx 15rpx;background: #FF4D1E;"
v-if="a.fh_status==1">已发货</view>
<view class="num" style="left:auto;right:0;border-radius:0rpx 0rpx 0rpx 15rpx;background: #FF4D1E;" v-if="a.fh_status==1">已发货</view>
</view>
<view class="title hang1">
@ -166,7 +164,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)">
@ -234,11 +232,11 @@
</view>
</view>
<view class="freight border">
<view>快递(288包邮,当前货物价值{{nowChooseMoney}})</view>
<view>快递({{ freightData.free_post }}件包邮)</view>
<view>
<text>
{{
nowChooseMoney >= 288
nowChooseNum >= freightData.free_post
? '包邮'
: `¥${freightData.post_money}`
}}
@ -301,7 +299,7 @@
</view>
<view class="item-info">
<view class="title center hang1">
恭喜您兑换成功获得{{zhanshiMoney}}
成功获得{{zhanshiMoney}}吧唧币
</view>
</view>
</view>
@ -443,37 +441,10 @@
if (this.tabList[this.tabCur].id != 1) return
const arr = this.getChooseGoods()
var mon = 0;
arr.forEach(item => {
console.log(item);
if (item.goodslist_money > 0) {
let m = item.goodslist_money / 100;
mon += m;
}
});
return arr.reduce((pre, item) => {
return pre + Number(item.chooseNum)
}, 0)
// return mon;
return arr.reduce((pre, item) => pre + Number(item.chooseNum), 0)
},
/* 当前选中数量 */
nowChooseMoney() {
if (this.tabList[this.tabCur].id != 1) return
const arr = this.getChooseGoods()
var mon = 0;
arr.forEach(item => {
// console.log(item);
if (item.goodslist_money > 0 && item.chooseNum > 0) {
let m = item.goodslist_money * item.chooseNum;
mon += m;
}
});
return mon;
},
/* 当前赏品总数 */
nowNum() {
if (this.tabList[this.tabCur].id != 1) return