From ca77a403b5561c589dd78a524aa970fb2382daf8 Mon Sep 17 00:00:00 2001 From: gyq <875626088@qq.com> Date: Fri, 5 Dec 2025 10:14:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=88=86=E5=BA=97=E8=90=A5?= =?UTF-8?q?=E9=94=80=E4=B8=AD=E5=BF=83=E7=9A=84=E6=9D=83=E9=99=90=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../my-components/my-marketing-mask.vue | 41 ++ pageBwc/index/index.vue | 385 ++++++------- .../consumeCashback/components/config.vue | 490 ++++++++-------- pageMarket/consumeCashback/index.vue | 285 +++++----- pageMarket/couponExchangeCode/index.vue | 512 ++++++++--------- pageMarket/rechargeExchangeCode/index.vue | 533 ++++++++---------- pageRecharge/index.vue | 14 +- store/account.js | 90 +-- 8 files changed, 1140 insertions(+), 1210 deletions(-) create mode 100644 components/my-components/my-marketing-mask.vue diff --git a/components/my-components/my-marketing-mask.vue b/components/my-components/my-marketing-mask.vue new file mode 100644 index 0000000..d290956 --- /dev/null +++ b/components/my-components/my-marketing-mask.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/pageBwc/index/index.vue b/pageBwc/index/index.vue index d61f3f4..a039d37 100644 --- a/pageBwc/index/index.vue +++ b/pageBwc/index/index.vue @@ -1,53 +1,37 @@ \ No newline at end of file + diff --git a/pageMarket/consumeCashback/components/config.vue b/pageMarket/consumeCashback/components/config.vue index 25f6837..672a883 100644 --- a/pageMarket/consumeCashback/components/config.vue +++ b/pageMarket/consumeCashback/components/config.vue @@ -1,333 +1,293 @@ - - - - \ No newline at end of file + diff --git a/pageMarket/consumeCashback/index.vue b/pageMarket/consumeCashback/index.vue index 0a7b6b9..d853a99 100644 --- a/pageMarket/consumeCashback/index.vue +++ b/pageMarket/consumeCashback/index.vue @@ -5,29 +5,27 @@ - {{selShop.shopName || "全部门店"}} + {{ selShop.shopName || '全部门店' }} - + - + - 关联订单:{{ item.orderNo }} + 关联订单:{{ item.orderNo }} - {{ item.shopName }} + {{ item.shopName }} {{ item.createTime }} - ID:{{ item.id }} + ID:{{ item.id }} @@ -40,16 +38,15 @@ 返现金额 - {{ item.cashbackAmount ||0 }} + {{ item.cashbackAmount || 0 }} - + 支付金额 {{ item.amount || 0 }} - - + @@ -57,159 +54,157 @@ - - + + + \ No newline at end of file +.delete-btn { + background: #ffe7e6; + color: #ff1c1c; +} + diff --git a/pageMarket/couponExchangeCode/index.vue b/pageMarket/couponExchangeCode/index.vue index a8e52dd..b769bcf 100644 --- a/pageMarket/couponExchangeCode/index.vue +++ b/pageMarket/couponExchangeCode/index.vue @@ -1,359 +1,325 @@ diff --git a/pageMarket/rechargeExchangeCode/index.vue b/pageMarket/rechargeExchangeCode/index.vue index 5179f15..97a7cec 100644 --- a/pageMarket/rechargeExchangeCode/index.vue +++ b/pageMarket/rechargeExchangeCode/index.vue @@ -1,372 +1,335 @@ diff --git a/pageRecharge/index.vue b/pageRecharge/index.vue index 882292f..7ff478a 100644 --- a/pageRecharge/index.vue +++ b/pageRecharge/index.vue @@ -87,6 +87,7 @@ + @@ -105,7 +106,7 @@ import $util from '@/commons/utils/getDateArea.js'; import go from '@/commons/utils/go.js'; import { shopRechargePost, shopRechargeGet } from '@/http/api/market/index.js'; import { onLoad } from '@dcloudio/uni-app'; -import { isMainShop } from '@/store/account.js'; +import { isMainShop, isMarketShow } from '@/store/account.js'; const isCanEdit = computed(() => { return isMainShop(); @@ -192,11 +193,12 @@ function useTypeChange(e) { } // 获取设置 +const shopRechargeRes = ref({}); async function shopRechargeGetAjax() { try { - const res = await shopRechargeGet(); - isOpen.value = res.isEnable; - res.rechargeDetailList.forEach((item) => { + shopRechargeRes.value = await shopRechargeGet(); + isOpen.value = shopRechargeRes.value.isEnable; + shopRechargeRes.value.rechargeDetailList.forEach((item) => { item.couponInfoList.forEach((val) => { if (val.coupon && val.coupon !== null) { val.id = val.coupon.id; @@ -204,8 +206,8 @@ async function shopRechargeGetAjax() { } }); }); - settingForm.value = res; - rechargeLists.value = res.rechargeDetailList; + settingForm.value = shopRechargeRes.value; + rechargeLists.value = shopRechargeRes.value.rechargeDetailList; } catch (error) { console.log(error); } diff --git a/store/account.js b/store/account.js index c3bf537..c0990f8 100644 --- a/store/account.js +++ b/store/account.js @@ -1,41 +1,65 @@ // stores/counter.js -import { defineStore } from "pinia"; +import { + defineStore +} from "pinia"; import * as shopApi from "@/http/api/shop.js"; -//判断是否是主店 +// 判断是否是主店,并且是否有查看权限 export const isMainShop = (shopId) => { - const shopInfo=uni.getStorageSync("shopInfo"); - if(shopInfo.isHeadShop){ - return true - } - if(shopInfo.shopType=='only'){ - return true - } - return false + const shopInfo = uni.getStorageSync("shopInfo"); + if (shopInfo.isHeadShop) { + return true + } + if (shopInfo.shopType == 'only') { + return true + } + return false +} + +/** + * 主店在配置该功能时未选择分店 + * 判断分店是否显示活动信息 + * @param {Object} activit + * 活动信息 + */ +export function isMarketShow(activit = null, key = 'shopIdList') { + console.log('isMarketShow===', activit); + if (activit == null || !activit.id) return false + + let flag = false + const shopInfo = uni.getStorageSync("shopInfo"); + + if (!shopInfo.isHeadShop && (!activit[key].some(item => item == shopInfo.id) || !activit.isEnable)) { + flag = true + } else { + flag = false + } + console.log('isMarketShow===', flag); + return flag } // 分销 export const useAccountInfoStore = defineStore("accountInfo", { - state: () => { - return { - shopInfo: {}, - }; - }, - actions: { - getShopInfo() { - return shopApi.getShopInfo().then((res) => { - this.shopInfo = res; - return this.shopInfo; - }); - }, - editShopInfo(data,autoRefresh = true) { - return shopApi.editShopInfo(data).then((res) => { - if(autoRefresh) { - this.getShopInfo() - } - return res - }); - }, - }, - unistorage: true, // 开启后对 state 的数据读写都将持久化 -}); + state: () => { + return { + shopInfo: {}, + }; + }, + actions: { + getShopInfo() { + return shopApi.getShopInfo().then((res) => { + this.shopInfo = res; + return this.shopInfo; + }); + }, + editShopInfo(data, autoRefresh = true) { + return shopApi.editShopInfo(data).then((res) => { + if (autoRefresh) { + this.getShopInfo() + } + return res + }); + }, + }, + unistorage: true, // 开启后对 state 的数据读写都将持久化 +}); \ No newline at end of file