优化添加优惠

This commit is contained in:
gyq
2025-03-25 00:31:50 +08:00
parent a914adc9f8
commit 3e84edbb6c
19 changed files with 402 additions and 238 deletions

View File

@@ -45,7 +45,7 @@
<div class="pay_wrap">
<payCard ref="payCardRef" :orderList="orderList" :amount="cartInfo.totalAmount"
:orderId="goodsStore.orderListInfo.id" @paySuccess="paySuccess" @orderExpired="orderExpiredHnadle"
:isPrint="0" />
:isPrint="0" @reset="show" />
</div>
</div>
<!-- <el-dialog v-model="showStaffDiscount" title="员工折扣" @close="global.updateData(true)">
@@ -229,6 +229,7 @@ function paySuccess() {
useStorage.del('tableCode')
socket.cartInit()
goodsStore.successClearCart()
goodsStore.clearVipUserInfo()
}
const payCardRef = ref(null)

View File

@@ -6,7 +6,7 @@
{{ item.product_name }}
</div>
<div class="n">x{{ formatDecimal(+item.number, 2, true) }}</div>
<div class="p">
<div class="p" :class="{ undeline: goodsStore.showVipPrice && item.memberPrice }">
<template v-if="item.is_temporary">
<template v-if="item.is_gift">
<span class="t_line">{{ formatDecimal(+item.discount_sale_amount) }}</span>
@@ -95,11 +95,25 @@
</span>
</div>
</div>
<div class="gift_wrap" v-if="goodsStore.showVipPrice && item.memberPrice">
<div class="name">
<span>[会员价]</span>
</div>
<div class="n"></div>
<div class="p">
<span>
{{ formatDecimal(+item.memberPrice) }}
</span>
</div>
</div>
</div>
</template>
<script setup>
import { formatDecimal } from '@/utils/index.js'
import { useGoods } from '@/store/goods.js'
const goodsStore = useGoods()
const props = defineProps({
list: {
@@ -129,6 +143,11 @@ const props = defineProps({
color: #555;
display: flex;
justify-content: flex-end;
&.undeline {
color: #999;
text-decoration: line-through;
}
}
.t_line {

View File

@@ -221,13 +221,15 @@ const cartLoading = ref(false);
const orderInfo = ref({});
const createOrderLoading = ref(false);
// 选择会员
function selectUser(row) {
console.log('selectUser===', row);
goodsStore.vipUserInfo = { ...row }
if (store.shopInfo.isMemberPrice && row.isVip) {
goodsStore.showVipPrice = 1
goodsStore.calcCartInfo()
}
goodsStore.calcCartInfo()
}
// 挂单量

View File

@@ -147,7 +147,7 @@ const submitHandle = () => {
.userlogin(form)
.then(async (res) => {
// 登录成功后保存商户号
// useStorage.set('merchantLoginAccount', form.username)
useStorage.set('merchantLoginAccount', form.username)
ElMessage.success("登录成功");
goodsStore.initGoods()
setTimeout(() => {
@@ -155,15 +155,16 @@ const submitHandle = () => {
name: "home",
});
}, 1000);
// const douyin = await douyincheckIn({
// token: store.token,
// loginName: res.loginName,
// clientType: 'pc'
// })
// useStorage.set('douyin', douyin.userInfo)
const douyin = await douyincheckIn({
token: store.token,
loginName: form.username,
clientType: 'pc'
})
useStorage.set('douyin', douyin.userInfo)
// global.updateData(true)
})
.catch((err) => {
console.log(err);
loading.value = false;
// 重新获取验证码
captchaAjax()
@@ -203,7 +204,7 @@ onMounted(() => {
let merchantLoginAccount = useStorage.get('merchantLoginAccount')
if (merchantLoginAccount) {
form.merchantName = merchantLoginAccount
form.username = merchantLoginAccount
}
})
</script>