From ce3674be353b639c4a613e904682058d20d720b7 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Thu, 20 Nov 2025 18:45:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=82=B9=E9=A4=90=E6=99=BA?= =?UTF-8?q?=E8=83=BD=E6=8E=A8=E8=8D=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../my-components/my-bottom-btn-group.vue | 5 + components/my-components/my-hour-area.vue | 153 ++++++---- components/my-components/my-week-sel.vue | 8 +- http/api/market/suggest.js | 2 +- pageMarket/components/choose-goods.vue | 198 ++++++++++++ pageMarket/distribution/add-fenxiao-user.vue | 2 +- .../components/fenxiao-mingxi.vue | 2 +- pageMarket/newUserDiscount/index.vue | 12 +- pageMarket/orderRecommendation/add.vue | 190 ++++++++++++ pageMarket/orderRecommendation/index.vue | 281 +++++++++++++++++- pageMarket/static/images/suggest.png | Bin 0 -> 886 bytes pages.json | 7 + store/account.js | 29 ++ 13 files changed, 813 insertions(+), 76 deletions(-) create mode 100644 pageMarket/components/choose-goods.vue create mode 100644 pageMarket/orderRecommendation/add.vue create mode 100644 pageMarket/static/images/suggest.png create mode 100644 store/account.js diff --git a/components/my-components/my-bottom-btn-group.vue b/components/my-components/my-bottom-btn-group.vue index 862bca2..56f6c02 100644 --- a/components/my-components/my-bottom-btn-group.vue +++ b/components/my-components/my-bottom-btn-group.vue @@ -46,4 +46,9 @@ function cancel() { .zhanwei1{ height: 240rpx; } +.fixed-bottom { + &.u-flex-column{ + align-items: stretch; + } +} diff --git a/components/my-components/my-hour-area.vue b/components/my-components/my-hour-area.vue index 8e846c7..7bb2442 100644 --- a/components/my-components/my-hour-area.vue +++ b/components/my-components/my-hour-area.vue @@ -1,97 +1,118 @@ diff --git a/components/my-components/my-week-sel.vue b/components/my-components/my-week-sel.vue index 78ad6d9..28295d0 100644 --- a/components/my-components/my-week-sel.vue +++ b/components/my-components/my-week-sel.vue @@ -3,6 +3,7 @@ [], diff --git a/http/api/market/suggest.js b/http/api/market/suggest.js index 6068458..92106f7 100644 --- a/http/api/market/suggest.js +++ b/http/api/market/suggest.js @@ -31,7 +31,7 @@ export function editSuggest(params) { } export function deleteSuggest(params) { return request({ - url: urlType + `/admin/suggest`, + url: urlType + `/admin/suggest?id=${params.id}`, method: "DELETE", params: { ...params, diff --git a/pageMarket/components/choose-goods.vue b/pageMarket/components/choose-goods.vue new file mode 100644 index 0000000..bbd9da3 --- /dev/null +++ b/pageMarket/components/choose-goods.vue @@ -0,0 +1,198 @@ + + + + diff --git a/pageMarket/distribution/add-fenxiao-user.vue b/pageMarket/distribution/add-fenxiao-user.vue index 87f9d04..ef76980 100644 --- a/pageMarket/distribution/add-fenxiao-user.vue +++ b/pageMarket/distribution/add-fenxiao-user.vue @@ -66,7 +66,7 @@ {{ - item.accountPoints + item.consumeCount }} diff --git a/pageMarket/distribution/components/fenxiao-mingxi.vue b/pageMarket/distribution/components/fenxiao-mingxi.vue index 69032bc..8756e6e 100644 --- a/pageMarket/distribution/components/fenxiao-mingxi.vue +++ b/pageMarket/distribution/components/fenxiao-mingxi.vue @@ -38,7 +38,7 @@ {{ 0 }}{{ item.rewardAmount }} {{ item.level == 1 ? "直接分成" : "间接分成" diff --git a/pageMarket/newUserDiscount/index.vue b/pageMarket/newUserDiscount/index.vue index e8959bd..9b88fff 100644 --- a/pageMarket/newUserDiscount/index.vue +++ b/pageMarket/newUserDiscount/index.vue @@ -53,7 +53,7 @@ class="number-box" placeholder="请输入内容" placeholder-class="color-999 u-font-28" - type="number" + type="digit" v-model="form.discountAmount" /> @@ -65,13 +65,13 @@ class="u-flex default-box-x-padding default-box-y-padding" v-if="form.discountType === 'RANDOM'" > - 减免方式 - 添加方案 + 随机减免方案 + 添加方案 所有概率相加必须等于100% - + @@ -159,6 +159,8 @@ import Modal from "@/pageMarket/components/modal.vue"; import { ref, reactive, computed, watch, onMounted } from "vue"; import { useNewUserDiscountStore } from "@/store/market.js"; + +const isLoading = ref(false); const newUserDiscountStore = useNewUserDiscountStore(); const modalData = reactive({ @@ -274,6 +276,7 @@ function save() { watch( () => newUserDiscountStore.config.isEnable, (newVal) => { + if(isLoading.value) return; newUserDiscountStore.editConfig().then((res) => { if (res) { uni.showToast({ @@ -296,6 +299,7 @@ async function init() { }; console.log(data); Object.assign(form, data); + isLoading.value = false; } onMounted(() => { diff --git a/pageMarket/orderRecommendation/add.vue b/pageMarket/orderRecommendation/add.vue new file mode 100644 index 0000000..0629530 --- /dev/null +++ b/pageMarket/orderRecommendation/add.vue @@ -0,0 +1,190 @@ + + + + + diff --git a/pageMarket/orderRecommendation/index.vue b/pageMarket/orderRecommendation/index.vue index 46c1fa3..ffc3bb5 100644 --- a/pageMarket/orderRecommendation/index.vue +++ b/pageMarket/orderRecommendation/index.vue @@ -1,3 +1,280 @@ \ No newline at end of file + + + + + + + + 点餐智能推荐 + 进入点单页X秒未点自动推荐商品,此推荐设置启用即生效 + + + + + + + + 首次弹窗触发时间 + {{ + accountInfoStore.shopInfo.suggestTime + }} + + + 多个弹窗时,每个弹窗之间关闭和弹出间隔为15秒 + + + + + + + + {{ item.title }} + {{ + item.status == 1 ? "启用" : "禁用" + }} + + + {{ item.useDays }} + {{ returnUseTimeType(item) }} + + + 删除 + 编辑 + + + + + + 添加 + + + + + + + + + + + diff --git a/pageMarket/static/images/suggest.png b/pageMarket/static/images/suggest.png new file mode 100644 index 0000000000000000000000000000000000000000..d0c493f99d3515b571e05e9102b9373198eab01f GIT binary patch literal 886 zcmV-+1Bv{JP)@A|xrOCx1YKFPRV0B5F90fY;dAqa zHozgTU?}3|0mYm@X-_A1?u-J`5|vrU7j@P34*6P!qT(sg_!ho57xGk|uaZZ=$b@dD z8Z!#;C>z(_AzwkELf-UlihL=(Qq%dDO)1E15&@^Z@?kvN7e& z`-WX6`wfRI;P@6`Ip6&58({xNUl31|?w6I-ud08HbrU^;G)NpaeYb1q$lTXyCEbQ|U*865!<;<9`7YSZ2{G z@D`K+2|?WverybwTOkjBwn3zuAO5(n_jb_WTP(q7ABHC@xib1K> zTHxuXi0!b^0AP#=Ytt+yA-^Y_!u<~b0RR8wrh`fV000I_L_t&o0Iy(wsq7HfXaE2J M07*qoM6N<$f~?n_P5=M^ literal 0 HcmV?d00001 diff --git a/pages.json b/pages.json index 6fd44d8..43be175 100644 --- a/pages.json +++ b/pages.json @@ -705,6 +705,13 @@ "style": { "navigationBarTitleText": "点餐智能推荐" } + }, + { + "pageId": "PAGES_MARKET_ORDER_RECOMMENDATION_ADD", + "path": "orderRecommendation/add", + "style": { + "navigationBarTitleText": "添加" + } } ] }, diff --git a/store/account.js b/store/account.js new file mode 100644 index 0000000..cce171a --- /dev/null +++ b/store/account.js @@ -0,0 +1,29 @@ +// stores/counter.js +import { defineStore } from "pinia"; +import * as shopApi from "@/http/api/shop.js"; + +// 分销 +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 的数据读写都将持久化 +});