修复生产环境折扣价显示错误问题
This commit is contained in:
parent
100744cfaf
commit
62c9994444
@ -85,7 +85,7 @@ const show = async (goodsId: string, fn: Function) => {
|
|||||||
callback = fn;
|
callback = fn;
|
||||||
|
|
||||||
goodsDetailBean.value = await getGoodsDetail(goodsId);
|
goodsDetailBean.value = await getGoodsDetail(goodsId);
|
||||||
goodsDetailBean.value.consumePrice = Number((goodsDetailBean.value?.price * ((userInfo?.value?.levelEntity?.discount || 100) / 100)).toFixed(2));
|
goodsDetailBean.value.consumePrice = Number((goodsDetailBean.value?.price * userInfo?.value.userDiscount).toFixed(2));
|
||||||
|
|
||||||
if((goodsDetailBean.value?.stocks?.length || 0) <= 0) {
|
if((goodsDetailBean.value?.stocks?.length || 0) <= 0) {
|
||||||
showToast('暂无库存');
|
showToast('暂无库存');
|
||||||
|
@ -22,8 +22,8 @@
|
|||||||
@click.stop='goPath(`/pages/mall/subs/goods/detail?goodsId=${item.goodsId}`)'>
|
@click.stop='goPath(`/pages/mall/subs/goods/detail?goodsId=${item.goodsId}`)'>
|
||||||
<image class='goods-image' :src='item.images||defaultImage' />
|
<image class='goods-image' :src='item.images||defaultImage' />
|
||||||
<text class='goods-name'>{{ item.goodsName || '未知' }}</text>
|
<text class='goods-name'>{{ item.goodsName || '未知' }}</text>
|
||||||
<text class='goods-price'>¥{{ (item.price * ((userInfo.levelEntity?.discount || 100) / 100)).toFixed(2) }}
|
<text class='goods-price'>¥{{ (item.price * userInfo.userDiscount).toFixed(2) }}
|
||||||
<text v-if='userInfo.levelEntity?.discount>0&&userInfo.levelEntity?.discount<100'
|
<text v-if='userInfo.userDiscount>0&&userInfo.userDiscount<1'
|
||||||
style='text-decoration: line-through;color: #999999;font-size: 25rpx'>¥{{ item.price }}
|
style='text-decoration: line-through;color: #999999;font-size: 25rpx'>¥{{ item.price }}
|
||||||
</text>
|
</text>
|
||||||
</text>
|
</text>
|
||||||
@ -55,7 +55,7 @@ import useShoppingCartStore from '@/store/modules/shoppingcart';
|
|||||||
import { useUserStore } from '@/store';
|
import { useUserStore } from '@/store';
|
||||||
|
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const { userInfo, companyConfigInfo } = storeToRefs(userStore);
|
const { userInfo,companyConfigInfo } = storeToRefs(userStore);
|
||||||
const shoppingCartStore = useShoppingCartStore();
|
const shoppingCartStore = useShoppingCartStore();
|
||||||
const { totalCount } = storeToRefs(shoppingCartStore);
|
const { totalCount } = storeToRefs(shoppingCartStore);
|
||||||
|
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
<view class='goods-info-view c-flex-column' style='margin-right: 10rpx'>
|
<view class='goods-info-view c-flex-column' style='margin-right: 10rpx'>
|
||||||
<view class='c-flex-row'>
|
<view class='c-flex-row'>
|
||||||
<text class='goods-price accent-text-color'>
|
<text class='goods-price accent-text-color'>
|
||||||
¥{{ ((goodsBean?.price || 0) * ((userInfo.levelEntity?.discount || 100) / 100)).toFixed(2) }}
|
¥{{ ((goodsBean?.price || 0) * userInfo.userDiscount).toFixed(2) }}
|
||||||
<text v-if='userInfo.levelEntity?.discount>0&&userInfo.levelEntity?.discount<100'
|
<text v-if='userInfo.userDiscount>0&&userInfo.userDiscount<1'
|
||||||
style='display:unset;text-decoration: line-through;font-size: 30rpx;color: #999999'>
|
style='display:unset;text-decoration: line-through;font-size: 30rpx;color: #999999'>
|
||||||
¥{{ goodsBean?.price || 0 }}
|
¥{{ goodsBean?.price || 0 }}
|
||||||
</text>
|
</text>
|
||||||
@ -56,8 +56,8 @@
|
|||||||
<view class='recommend-item c-flex-column'>
|
<view class='recommend-item c-flex-column'>
|
||||||
<image :src='item.images||defaultImage' />
|
<image :src='item.images||defaultImage' />
|
||||||
<text>{{ item.goodsName || '未知' }}</text>
|
<text>{{ item.goodsName || '未知' }}</text>
|
||||||
<text class='goods-price'>{{ (item.price * ((userInfo.levelEntity?.discount || 100) / 100)).toFixed(2) }}
|
<text class='goods-price'>{{ (item.price * userInfo.userDiscount).toFixed(2) }}
|
||||||
<text v-if='userInfo.levelEntity?.discount>0&&userInfo.levelEntity?.discount<100'
|
<text v-if='userInfo.userDiscount>0&&userInfo.userDiscount<1'
|
||||||
style='text-decoration: line-through;font-size: 25rpx;color: #999999'>{{ item.price }}
|
style='text-decoration: line-through;font-size: 25rpx;color: #999999'>{{ item.price }}
|
||||||
</text>
|
</text>
|
||||||
</text>
|
</text>
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
@click.stop='goPath(`/pages/mall/subs/goods/detail?goodsId=${item.goodsId}`)'>
|
@click.stop='goPath(`/pages/mall/subs/goods/detail?goodsId=${item.goodsId}`)'>
|
||||||
<image class='goods-image' :src='item.images||defaultImage' />
|
<image class='goods-image' :src='item.images||defaultImage' />
|
||||||
<text class='goods-name'>{{ item.goodsName || '未知' }}</text>
|
<text class='goods-name'>{{ item.goodsName || '未知' }}</text>
|
||||||
<text class='goods-price'>¥{{ (item.price * ((userInfo.levelEntity?.discount || 100)/100)).toFixed(2) }}
|
<text class='goods-price'>¥{{ (item.price * userInfo.userDiscount).toFixed(2) }}
|
||||||
<text v-if='userInfo.levelEntity?.discount>0&&userInfo.levelEntity?.discount<100'
|
<text v-if='userInfo.userDiscount>0&&userInfo.userDiscount<1'
|
||||||
style='text-decoration: line-through;color: #999999;font-size: 25rpx'>¥{{ item.price }}
|
style='text-decoration: line-through;color: #999999;font-size: 25rpx'>¥{{ item.price }}
|
||||||
</text>
|
</text>
|
||||||
</text>
|
</text>
|
||||||
|
@ -25,8 +25,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<text style='margin-top: 50rpx'>
|
<text style='margin-top: 50rpx'>
|
||||||
¥{{ (item?.price * ((userInfo.levelEntity?.discount || 100) / 100)).toFixed(2) }}
|
¥{{ (item?.price * userInfo.userDiscount).toFixed(2) }}
|
||||||
<text v-if='userInfo.levelEntity?.discount>0&&userInfo.levelEntity?.discount<100'
|
<text v-if='userInfo.userDiscount>0&&userInfo.userDiscount<1'
|
||||||
style='text-decoration: line-through;color: #999999;font-size: 25rpx'>¥{{ item?.price }}
|
style='text-decoration: line-through;color: #999999;font-size: 25rpx'>¥{{ item?.price }}
|
||||||
</text>
|
</text>
|
||||||
</text>
|
</text>
|
||||||
|
@ -50,12 +50,24 @@ const useUserStore = defineStore('user', {
|
|||||||
// getUserInfo(state: UserBean): UserBean {
|
// getUserInfo(state: UserBean): UserBean {
|
||||||
// return { state };
|
// return { state };
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
getUserDiscount(): number {
|
||||||
|
if(this.userInfo.levelEntity.discount > 0 && this.userInfo.levelEntity.discount < 10) {
|
||||||
|
return this.userInfo.levelEntity.discount / 10;
|
||||||
|
} else if(this.userInfo.levelEntity.discount >= 10 && this.userInfo.levelEntity.discount <= 100) {
|
||||||
|
return this.userInfo.levelEntity.discount / 100;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
// 设置用户的信息
|
// 设置用户的信息
|
||||||
async setUserInfo(partial: Partial<UserBean>) {
|
async setUserInfo(partial: Partial<UserBean>) {
|
||||||
this.userInfo = partial as UserBean;
|
this.userInfo = partial as UserBean;
|
||||||
|
this.userInfo.levelEntity.discount = 79;
|
||||||
|
this.userInfo.userDiscount = this.getUserDiscount;
|
||||||
await setCompanyId(this.userInfo.companyId);
|
await setCompanyId(this.userInfo.companyId);
|
||||||
await this.fetchTerminal();
|
await this.fetchTerminal();
|
||||||
await this.fetchCompanyInfo();
|
await this.fetchCompanyInfo();
|
||||||
|
@ -50,6 +50,7 @@ export interface UserBean {
|
|||||||
updateTime: string;
|
updateTime: string;
|
||||||
useCouponsPrice: number;
|
useCouponsPrice: number;
|
||||||
wirelinedTelephone: string;
|
wirelinedTelephone: string;
|
||||||
|
userDiscount:number
|
||||||
}
|
}
|
||||||
|
|
||||||
export type providerType =
|
export type providerType =
|
||||||
|
Loading…
Reference in New Issue
Block a user