diff --git a/src/components/sku-dialog.vue b/src/components/sku-dialog.vue
index f53b33b..3eb7241 100644
--- a/src/components/sku-dialog.vue
+++ b/src/components/sku-dialog.vue
@@ -85,7 +85,7 @@ const show = async (goodsId: string, fn: Function) => {
callback = fn;
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) {
showToast('暂无库存');
diff --git a/src/pages/mall/index.vue b/src/pages/mall/index.vue
index 18c4d67..28eac68 100644
--- a/src/pages/mall/index.vue
+++ b/src/pages/mall/index.vue
@@ -22,8 +22,8 @@
@click.stop='goPath(`/pages/mall/subs/goods/detail?goodsId=${item.goodsId}`)'>
{{ item.goodsName || '未知' }}
- ¥{{ (item.price * ((userInfo.levelEntity?.discount || 100) / 100)).toFixed(2) }}
- ¥{{ (item.price * userInfo.userDiscount).toFixed(2) }}
+ ¥{{ item.price }}
@@ -55,7 +55,7 @@ import useShoppingCartStore from '@/store/modules/shoppingcart';
import { useUserStore } from '@/store';
const userStore = useUserStore();
-const { userInfo, companyConfigInfo } = storeToRefs(userStore);
+const { userInfo,companyConfigInfo } = storeToRefs(userStore);
const shoppingCartStore = useShoppingCartStore();
const { totalCount } = storeToRefs(shoppingCartStore);
diff --git a/src/pages/mall/subs/goods/detail.vue b/src/pages/mall/subs/goods/detail.vue
index 65f1ec1..b9030b1 100644
--- a/src/pages/mall/subs/goods/detail.vue
+++ b/src/pages/mall/subs/goods/detail.vue
@@ -15,8 +15,8 @@
- ¥{{ ((goodsBean?.price || 0) * ((userInfo.levelEntity?.discount || 100) / 100)).toFixed(2) }}
-
¥{{ goodsBean?.price || 0 }}
@@ -56,8 +56,8 @@
{{ item.goodsName || '未知' }}
- {{ (item.price * ((userInfo.levelEntity?.discount || 100) / 100)).toFixed(2) }}
- {{ (item.price * userInfo.userDiscount).toFixed(2) }}
+ {{ item.price }}
diff --git a/src/pages/mall/subs/search/index.vue b/src/pages/mall/subs/search/index.vue
index fa4a1b0..89375cb 100644
--- a/src/pages/mall/subs/search/index.vue
+++ b/src/pages/mall/subs/search/index.vue
@@ -13,8 +13,8 @@
@click.stop='goPath(`/pages/mall/subs/goods/detail?goodsId=${item.goodsId}`)'>
{{ item.goodsName || '未知' }}
- ¥{{ (item.price * ((userInfo.levelEntity?.discount || 100)/100)).toFixed(2) }}
- ¥{{ (item.price * userInfo.userDiscount).toFixed(2) }}
+ ¥{{ item.price }}
diff --git a/src/pages/mall/subs/shoppingcart/index.vue b/src/pages/mall/subs/shoppingcart/index.vue
index d837c49..461012d 100644
--- a/src/pages/mall/subs/shoppingcart/index.vue
+++ b/src/pages/mall/subs/shoppingcart/index.vue
@@ -25,8 +25,8 @@
- ¥{{ (item?.price * ((userInfo.levelEntity?.discount || 100) / 100)).toFixed(2) }}
- ¥{{ item?.price }}
diff --git a/src/store/modules/user/index.ts b/src/store/modules/user/index.ts
index b6e5058..4bbec6f 100644
--- a/src/store/modules/user/index.ts
+++ b/src/store/modules/user/index.ts
@@ -50,12 +50,24 @@ const useUserStore = defineStore('user', {
// getUserInfo(state: UserBean): UserBean {
// 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: {
// 设置用户的信息
async setUserInfo(partial: Partial) {
this.userInfo = partial as UserBean;
+ this.userInfo.levelEntity.discount = 79;
+ this.userInfo.userDiscount = this.getUserDiscount;
await setCompanyId(this.userInfo.companyId);
await this.fetchTerminal();
await this.fetchCompanyInfo();
diff --git a/src/store/modules/user/types.ts b/src/store/modules/user/types.ts
index 75e999b..84e5197 100644
--- a/src/store/modules/user/types.ts
+++ b/src/store/modules/user/types.ts
@@ -50,6 +50,7 @@ export interface UserBean {
updateTime: string;
useCouponsPrice: number;
wirelinedTelephone: string;
+ userDiscount:number
}
export type providerType =