add
This commit is contained in:
parent
45b51b0a11
commit
d6c715bdd3
|
@ -14,7 +14,9 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="row">
|
<view class="row">
|
||||||
<view>商品价格</view>
|
<view>商品价格</view>
|
||||||
<view>¥ {{ datas.price || datas.sell }} / {{ datas.unit_name }}</view>
|
<view>¥ {{priceKey.off_activity==1? datas[priceKey.price]: datas[priceKey.op_price] }} /
|
||||||
|
{{ datas.unit_name }}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="row" v-if="datas.batch > 0">
|
<view class="row" v-if="datas.batch > 0">
|
||||||
<view>起批量</view>
|
<view>起批量</view>
|
||||||
|
@ -30,20 +32,14 @@
|
||||||
</view>
|
</view>
|
||||||
<view v-if="datas.is_bulk" class="row" style="height: 100rpx;">
|
<view v-if="datas.is_bulk" class="row" style="height: 100rpx;">
|
||||||
<view>购买重量<text style="color: #F55726;">*</text></view>
|
<view>购买重量<text style="color: #F55726;">*</text></view>
|
||||||
<view style="flex: 1;">
|
<view style="justify-content: end;">
|
||||||
<up-input v-model="datas.cart_num" :cursorSpacing='120' type="digit" border="none"
|
<up-number-box v-model="datas.cart_num"></up-number-box>
|
||||||
placeholder="请输入购买重量" inputAlign="right"></up-input>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-else class="row" style="height: 100rpx;">
|
<view v-else class="row" style="height: 100rpx;">
|
||||||
<view>购买数量<text style="color: #F55726;">*</text></view>
|
<view>购买数量<text style="color: #F55726;">*</text></view>
|
||||||
<view style="flex: 1;">
|
<view style="justify-content: end;">
|
||||||
<up-input ref='foucs1' v-model="datas.cart_num" :cursorSpacing='120' type="digit" border="none"
|
<up-number-box v-model="datas.cart_num"></up-number-box>
|
||||||
placeholder="请输入购买数量" inputAlign="right">
|
|
||||||
<template #suffix>
|
|
||||||
<span style="color: #20b128;">{{ datas.unit_name }}</span>
|
|
||||||
</template>
|
|
||||||
</up-input>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="row" style="padding-top: 30px;padding-bottom: 30rpx;">
|
<view class="row" style="padding-top: 30px;padding-bottom: 30rpx;">
|
||||||
|
@ -80,13 +76,22 @@
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
let priceKey = ref({})
|
||||||
|
if (uni.getStorageSync('PRICE_KEY')) {
|
||||||
|
priceKey.value = JSON.parse(uni.getStorageSync('PRICE_KEY'));
|
||||||
|
} else {
|
||||||
|
priceKey.value = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const datas = ref({
|
const datas = ref({
|
||||||
cart_num: ''
|
cart_num: ''
|
||||||
});
|
});
|
||||||
const setData = (e) => {
|
const setData = (e) => {
|
||||||
datas.value = e;
|
datas.value = e;
|
||||||
if (Number(e.batch) > 0) datas.value.cart_num = e.batch;
|
if (Number(e.batch) > 0) datas.value.cart_num = e.batch;
|
||||||
else datas.value.cart_num = '';
|
else datas.value.cart_num = 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,13 +112,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const subtotal = computed(() => {
|
const subtotal = computed(() => {
|
||||||
let num = +datas.value.cart_num || 0;
|
let num = +datas.value.cart_num || 1;
|
||||||
let sell = +datas.value.sell || +datas.value.price;
|
let sell = +datas.value[priceKey.value.off_activity == 1 ? priceKey.value.price : priceKey.value.op_price];
|
||||||
return Number(num * sell * 100 / 100).toFixed(2)
|
return Number(num * sell * 100 / 100).toFixed(2)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
setData,
|
setData,
|
||||||
// founcsFn
|
// founcsFn
|
||||||
|
|
|
@ -424,7 +424,7 @@
|
||||||
|
|
||||||
// 支付相关
|
// 支付相关
|
||||||
// scoket
|
// scoket
|
||||||
let timer = null
|
let timerInvol = null
|
||||||
const userInfo = useUserStore().userInfo;
|
const userInfo = useUserStore().userInfo;
|
||||||
const connection = new Push({
|
const connection = new Push({
|
||||||
url: config.WSS_URL, // websocket地址
|
url: config.WSS_URL, // websocket地址
|
||||||
|
@ -434,9 +434,8 @@
|
||||||
// 浏览器监听user-1
|
// 浏览器监听user-1
|
||||||
const user_channel = connection.subscribe(`wechat_mmp_${userInfo.id}`);
|
const user_channel = connection.subscribe(`wechat_mmp_${userInfo.id}`);
|
||||||
user_channel.on('message', function(data) {
|
user_channel.on('message', function(data) {
|
||||||
console.log("收到消息--", data);
|
|
||||||
try {
|
try {
|
||||||
if (timer) clearTimeout(timer);
|
if (timerInvol) clearTimeout(timerInvol);
|
||||||
paySuccessToTabs2()
|
paySuccessToTabs2()
|
||||||
} catch (error) {}
|
} catch (error) {}
|
||||||
});
|
});
|
||||||
|
@ -461,7 +460,7 @@
|
||||||
formData.recharge_type = 'INDUSTRYMEMBERS'
|
formData.recharge_type = 'INDUSTRYMEMBERS'
|
||||||
formData.user_ship = 1
|
formData.user_ship = 1
|
||||||
vipRechargeApi(formData).then(res => {
|
vipRechargeApi(formData).then(res => {
|
||||||
timer = setTimeout(() => {
|
timerInvol = setTimeout(() => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
uni.$u.toast('支付超时');
|
uni.$u.toast('支付超时');
|
||||||
}, 30000)
|
}, 30000)
|
||||||
|
@ -507,7 +506,7 @@
|
||||||
id: item.id,
|
id: item.id,
|
||||||
auth_code: res.result
|
auth_code: res.result
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
timer = setTimeout(() => {
|
timerInvol = setTimeout(() => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
uni.$u.toast('支付超时');
|
uni.$u.toast('支付超时');
|
||||||
}, 30000)
|
}, 30000)
|
||||||
|
|
|
@ -264,6 +264,9 @@
|
||||||
pay_price: res.data?.extend.pay_price || '0.00',
|
pay_price: res.data?.extend.pay_price || '0.00',
|
||||||
count: res.data?.count || 0
|
count: res.data?.count || 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
console.log(cartInfo.value)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
triggered.value = false;
|
triggered.value = false;
|
||||||
}, 300)
|
}, 300)
|
||||||
|
@ -275,7 +278,7 @@
|
||||||
return price.split('.')[0] || '0';
|
return price.split('.')[0] || '0';
|
||||||
})
|
})
|
||||||
const c_price1 = computed(() => {
|
const c_price1 = computed(() => {
|
||||||
let price = cartInfo.value.total_price + '';
|
let price = cartInfo.value.pay_price + '';
|
||||||
return price.split('.')[1] || '00';
|
return price.split('.')[1] || '00';
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -160,8 +160,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="shop-content-li" v-if="priceKey.off_activity==1">
|
<view class="shop-content-li" v-if="priceKey.off_activity==1">
|
||||||
<view class="shop-content-li-l" style="color: #FC452F;">
|
<view class="shop-content-li-l" style="color: #FC452F;">
|
||||||
<text style="font-size: 20rpx;">活</text><text>动</text><text
|
活动价
|
||||||
style="font-size: 20rpx;">价</text>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="shop-content-li-r" style="color:#FC452F ;">¥<text
|
<view class="shop-content-li-r" style="color:#FC452F ;">¥<text
|
||||||
style="font-size: 30rpx;">{{item[priceKey.price]}}</text>/{{ item.unit_name }}
|
style="font-size: 30rpx;">{{item[priceKey.price]}}</text>/{{ item.unit_name }}
|
||||||
|
@ -172,12 +171,12 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="shop-content-li" style="color: #999999;" v-if="priceKey.off_activity==1">
|
<view class="shop-content-li" style="color: #999999;" v-if="priceKey.off_activity==1">
|
||||||
<view class="shop-content-li-l">原 价</view>
|
<view class="shop-content-li-l">原价</view>
|
||||||
<view class="shop-content-li-r line-through">¥{{item[priceKey.op_price]}}</view>
|
<view class="shop-content-li-r line-through">¥{{item[priceKey.op_price]}}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="shop-content-li" v-else>
|
<view class="shop-content-li" v-else>
|
||||||
<view class="shop-content-li-l">售 价</view>
|
<view class="shop-content-li-l">售价</view>
|
||||||
<view class="shop-content-li-r" style="color:#FC452F ;">¥<text
|
<view class="shop-content-li-r" style="color:#FC452F ;">¥<text
|
||||||
style="font-size: 28rpx;">{{item[priceKey.op_price]}}</text>
|
style="font-size: 28rpx;">{{item[priceKey.op_price]}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
@ -185,7 +184,7 @@
|
||||||
|
|
||||||
<view class="shop-content-li" style="justify-content: space-between;">
|
<view class="shop-content-li" style="justify-content: space-between;">
|
||||||
<view style="display: flex;">
|
<view style="display: flex;">
|
||||||
<view class="shop-content-li-l">规 格</view>
|
<view class="shop-content-li-l">规格</view>
|
||||||
<view class="shop-content-li-r">{{ item.unit+item.unit_name }}/份</view>
|
<view class="shop-content-li-r">{{ item.unit+item.unit_name }}/份</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="btn" v-if="!item.batch">
|
<view class="btn" v-if="!item.batch">
|
||||||
|
@ -1101,12 +1100,14 @@
|
||||||
.shop-content-li-l {
|
.shop-content-li-l {
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
width: 70rpx;
|
width: 70rpx;
|
||||||
|
text-align-last: justify;
|
||||||
|
margin-right: 6rpx;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.tag {
|
.tag {
|
||||||
font-size: 18rpx;
|
font-size: 16rpx;
|
||||||
color: #A17C3A;
|
color: #A17C3A;
|
||||||
background-color: #F3E7C0;
|
background-color: #F3E7C0;
|
||||||
padding: 8rpx 4rpx;
|
padding: 8rpx 4rpx;
|
||||||
|
@ -1122,7 +1123,6 @@
|
||||||
// height: 14rpx;
|
// height: 14rpx;
|
||||||
// background-size: 100% 100%;
|
// background-size: 100% 100%;
|
||||||
// margin: 5rpx;
|
// margin: 5rpx;
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.rest {
|
.rest {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-around;
|
justify-content: space-between;
|
||||||
margin: 20rpx;
|
margin: 20rpx;
|
||||||
|
|
||||||
.rest-item {
|
.rest-item {
|
||||||
|
@ -40,8 +40,11 @@
|
||||||
会员报备
|
会员报备
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<view class="rest">
|
<view class="rest">
|
||||||
<view class="rest-item" @click="navgo('/pageQuota/balanceDetail/index?type=2')">
|
<view class="rest-item" @click="navgo('/pageQuota/balanceDetail/index?type=2')">
|
||||||
<view class="rest-item-num">{{userInfo.now_money||"0.00"}}</view>
|
<view class="rest-item-num">{{userInfo.now_money||"0.00"}}</view>
|
||||||
|
@ -51,14 +54,19 @@
|
||||||
<view class="rest-item-num">{{userInfo.purchase_funds||'0.00'}}</view>
|
<view class="rest-item-num">{{userInfo.purchase_funds||'0.00'}}</view>
|
||||||
<view class="rest-item-txt">采购款</view>
|
<view class="rest-item-txt">采购款</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="rest-item">
|
||||||
|
<view class="rest-item-num">{{userInfo.return_money||'0.00'}}</view>
|
||||||
|
<!-- <view class="rest-item-num">{{"10000.00"}}</view> -->
|
||||||
|
<view class="rest-item-txt">返还金</view>
|
||||||
|
</view>
|
||||||
<!-- <view class="rest-item" @click="navgo('/pageQuota/balanceDetail/index?type=3')"> -->
|
<!-- <view class="rest-item" @click="navgo('/pageQuota/balanceDetail/index?type=3')"> -->
|
||||||
<view class="rest-item">
|
<view class="rest-item">
|
||||||
<view class="rest-item-num">{{userInfo.integral ||"0.00"}}</view>
|
<view class="rest-item-num">{{userInfo.number ||"0.00"}}</view>
|
||||||
<view class="rest-item-txt">冻结礼品券</view>
|
<view class="rest-item-txt">冻结礼品券</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="rest-item" @click="navgo('/pageQuota/balanceDetail/index?type=3')"> -->
|
<!-- <view class="rest-item" @click="navgo('/pageQuota/balanceDetail/index?type=3')"> -->
|
||||||
<view class="rest-item">
|
<view class="rest-item">
|
||||||
<view class="rest-item-num">{{userInfo.integral ||"0.00"}}</view>
|
<view class="rest-item-num">{{userInfo.get_number ||"0.00"}}</view>
|
||||||
<view class="rest-item-txt">可用礼品券</view>
|
<view class="rest-item-txt">可用礼品券</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
@ -107,7 +107,7 @@
|
||||||
<view class="mask" v-if='showVerifyPop' @click="showVerifyPop=false">
|
<view class="mask" v-if='showVerifyPop' @click="showVerifyPop=false">
|
||||||
<view
|
<view
|
||||||
style="position: absolute;top: 50%;left: 50%;transform: translate(-50%,-50%);background-color: white;padding: 20rpx;">
|
style="position: absolute;top: 50%;left: 50%;transform: translate(-50%,-50%);background-color: white;padding: 20rpx;">
|
||||||
<up-image :src="orderData.verify_img" width="404rpx" height="60rpx"></up-image>
|
<up-image :src="orderData.verify_img" width="550rpx" height="100rpx"></up-image>
|
||||||
<view style="font-weight: bold;color: #333;font-size: 26;text-align: center;margin-top: 20rpx;">
|
<view style="font-weight: bold;color: #333;font-size: 26;text-align: center;margin-top: 20rpx;">
|
||||||
核销码 {{orderData.verify_code}}
|
核销码 {{orderData.verify_code}}
|
||||||
</view>
|
</view>
|
||||||
|
|
Loading…
Reference in New Issue