Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
417a4a455c |
16
main.js
16
main.js
|
|
@ -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'
|
// const baseUrl = 'https://bajiapi.onelight.vip'
|
||||||
Vue.prototype.siteBaseUrl = baseUrl + '/api/'
|
Vue.prototype.siteBaseUrl = baseUrl + '/api/'
|
||||||
|
const imageBaseUrl="https://mh.shhuanmeng.com";
|
||||||
Vue.prototype.$z_img2 = baseUrl + '/zcq/'
|
Vue.prototype.$z_img2 =imageBaseUrl + '/zcq/'
|
||||||
Vue.prototype.$baseUrl = baseUrl
|
Vue.prototype.$baseUrl = imageBaseUrl
|
||||||
Vue.prototype.$img = url => baseUrl + '/static/web' + url
|
Vue.prototype.$img = url => imageBaseUrl + '/static/web' + url
|
||||||
// Vue.prototype.$img1 = url => baseUrl + '/static/web' + url
|
// Vue.prototype.$img1 = url => imageBaseUrl + '/static/web' + url
|
||||||
Vue.prototype.$img1 = url => baseUrl + '/static/web/static/' + url
|
Vue.prototype.$img1 = url => imageBaseUrl + '/static/web/static/' + url
|
||||||
|
|
||||||
Vue.prototype.$sys = () => uni.getSystemInfoSync()
|
Vue.prototype.$sys = () => uni.getSystemInfoSync()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@
|
||||||
"quickapp" : {},
|
"quickapp" : {},
|
||||||
/* 小程序特有相关 */
|
/* 小程序特有相关 */
|
||||||
"mp-weixin" : {
|
"mp-weixin" : {
|
||||||
"appid" : "wxb7b0409b4b36e4b1",
|
"appid" : "wx595ec949c6efd72b",
|
||||||
"setting" : {
|
"setting" : {
|
||||||
"urlCheck" : false,
|
"urlCheck" : false,
|
||||||
"es6" : false,
|
"es6" : false,
|
||||||
|
|
|
||||||
|
|
@ -82,17 +82,29 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="pay-title ziti">选择支付方式</view>
|
<view class="pay-title ziti">选择支付方式</view>
|
||||||
<view class="br20 mt20" style="background: #5B5B5D;">
|
<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 class="" style="width: 100%; color: white;">
|
||||||
微信支付
|
微信支付
|
||||||
</view>
|
</view>
|
||||||
<view class="icon">
|
<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>
|
<image v-else :src="$img1('common/check.png')" lazy-load></image>
|
||||||
</view>
|
</view>
|
||||||
</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;">
|
<view class="" style="width: 100%; color: white;">
|
||||||
星钻支付¥
|
星钻支付¥
|
||||||
|
|
@ -104,7 +116,7 @@
|
||||||
|
|
||||||
<image v-else :src="$img1('common/check.png')" lazy-load></image>
|
<image v-else :src="$img1('common/check.png')" lazy-load></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="rule">
|
<view class="rule">
|
||||||
|
|
@ -132,14 +144,16 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<view class="pay-btn" @click="$c.noDouble(confirmSubmit(1))">
|
<view class="pay-btn" v-if="zhifu==0" @click="$c.noDouble(confirmSubmit(1))">
|
||||||
<text>立即支付</text>
|
|
||||||
<text>
|
<text>
|
||||||
{{
|
{{
|
||||||
` ¥${orderData.price}`
|
` ¥${orderData.price}`
|
||||||
}}
|
}}
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="pay-btn" v-if="zhifu==1" @click="$c.noDouble(pay(1))">
|
||||||
|
<text>{{orderData.price*100}}吧唧币</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</uni-popup>
|
</uni-popup>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -161,8 +175,9 @@
|
||||||
orderData: null,
|
orderData: null,
|
||||||
isAgree: true,
|
isAgree: true,
|
||||||
isWXPay: true,
|
isWXPay: true,
|
||||||
useMoney: true,
|
useMoney: false,
|
||||||
|
integral: true,
|
||||||
|
zhifu: 0,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
|
@ -232,25 +247,17 @@
|
||||||
this.goodsId = data.id;
|
this.goodsId = data.id;
|
||||||
var that = this;
|
var that = this;
|
||||||
this.req({
|
this.req({
|
||||||
url: 'ordermoney',
|
url: 'mall_ordermoney',
|
||||||
data: {
|
data: {
|
||||||
prize_num: 1,
|
prize_num: 1,
|
||||||
goods_id: data.id,
|
goods_id: data.id,
|
||||||
goods_num: 1,
|
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) {
|
success(res) {
|
||||||
if (res.status == 1) {
|
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.orderData = res.data
|
||||||
|
that.zhifu = 0;
|
||||||
that.$refs.pop.open()
|
that.$refs.pop.open()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -262,9 +269,15 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
changePay(e) {
|
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) {
|
confirmSubmit(type) {
|
||||||
|
|
@ -281,16 +294,11 @@
|
||||||
|
|
||||||
var that = this;
|
var that = this;
|
||||||
|
|
||||||
let url = 'infinite_ordermoney'
|
let url = 'mall_ordermoney'
|
||||||
|
|
||||||
let data = {
|
let data = {
|
||||||
goods_id: this.goodsId,
|
goods_id: this.goodsId,
|
||||||
prize_num: 1,
|
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) {
|
if (type == 1) {
|
||||||
|
|
@ -320,8 +328,6 @@
|
||||||
if (type == 0) {
|
if (type == 0) {
|
||||||
console.log("res.data", res.data);
|
console.log("res.data", res.data);
|
||||||
this.orderData = res.data;
|
this.orderData = res.data;
|
||||||
|
|
||||||
// that.open('pop');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == 1) {
|
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>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -86,9 +86,7 @@
|
||||||
<view class="pic">
|
<view class="pic">
|
||||||
<image :src="a.goodslist_imgurl" lazy-load></image>
|
<image :src="a.goodslist_imgurl" lazy-load></image>
|
||||||
<view class="num center">×{{ a.prize_num }}</view>
|
<view class="num center">×{{ a.prize_num }}</view>
|
||||||
<view class="num"
|
<view class="num" style="left:auto;right:0;border-radius:0rpx 0rpx 0rpx 15rpx;background: #FF4D1E;" v-if="a.fh_status==1">已发货</view>
|
||||||
style="left:auto;right:0;border-radius:0rpx 0rpx 0rpx 15rpx;background: #FF4D1E;"
|
|
||||||
v-if="a.fh_status==1">已发货</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="title hang1">
|
<view class="title hang1">
|
||||||
|
|
@ -166,7 +164,7 @@
|
||||||
<view class="align-center justify-between mt30">
|
<view class="align-center justify-between mt30">
|
||||||
<view class="" style="color: #FFFFFF;">
|
<view class="" style="color: #FFFFFF;">
|
||||||
共<text style="color: #D3AFFF;">{{nowChooseNum}}</text>
|
共<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>
|
<text style="color: #D3AFFF; font-size: 30rpx;">{{totalChangeMoney}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="change-pop-ft" @click="$c.noDouble(submitChange)">
|
<view class="change-pop-ft" @click="$c.noDouble(submitChange)">
|
||||||
|
|
@ -234,11 +232,11 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="freight border">
|
<view class="freight border">
|
||||||
<view>快递(满288包邮,当前货物价值:{{nowChooseMoney}})</view>
|
<view>快递(满{{ freightData.free_post }}件包邮)</view>
|
||||||
<view>
|
<view>
|
||||||
<text>
|
<text>
|
||||||
{{
|
{{
|
||||||
nowChooseMoney >= 288
|
nowChooseNum >= freightData.free_post
|
||||||
? '包邮'
|
? '包邮'
|
||||||
: `¥${freightData.post_money}`
|
: `¥${freightData.post_money}`
|
||||||
}}
|
}}
|
||||||
|
|
@ -301,7 +299,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="item-info">
|
<view class="item-info">
|
||||||
<view class="title center hang1">
|
<view class="title center hang1">
|
||||||
恭喜您兑换成功获得¥{{zhanshiMoney}}
|
成功获得{{zhanshiMoney}}吧唧币
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -443,37 +441,10 @@
|
||||||
if (this.tabList[this.tabCur].id != 1) return
|
if (this.tabList[this.tabCur].id != 1) return
|
||||||
|
|
||||||
const arr = this.getChooseGoods()
|
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)
|
return arr.reduce((pre, item) => pre + Number(item.chooseNum), 0)
|
||||||
|
|
||||||
}, 0)
|
|
||||||
// return mon;
|
|
||||||
},
|
},
|
||||||
/* 当前选中数量 */
|
|
||||||
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() {
|
nowNum() {
|
||||||
if (this.tabList[this.tabCur].id != 1) return
|
if (this.tabList[this.tabCur].id != 1) return
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user