From 046437ce54ca2b8d01663f82900ed7c45a31caed Mon Sep 17 00:00:00 2001 From: gyq <875626088@qq.com> Date: Mon, 24 Nov 2025 10:53:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=99=BA=E6=85=A7=E5=85=85?= =?UTF-8?q?=E5=80=BC=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- http/api/market/index.js | 18 +- pageMarket/components/choose-coupon.vue | 285 ++++--- pageMarket/components/coupon-list.vue | 123 ++- pageMarket/couponExchangeCode/add.vue | 294 ++++--- pageMarket/limitDiscount/index.vue | 2 +- pageRecharge/add-recharge-item.vue | 760 ++++--------------- pageRecharge/components/choose-coupon.vue | 186 +++++ pageRecharge/components/coupon-list.vue | 89 +++ pageRecharge/components/date-time-picker.vue | 108 +++ pageRecharge/components/recharge-item.vue | 127 ++-- pageRecharge/components/rechargeRerord.vue | 271 +++++++ pageRecharge/index.vue | 130 ++-- pages.json | 14 +- pages/appliccation/marketing.vue | 67 +- 14 files changed, 1342 insertions(+), 1132 deletions(-) create mode 100644 pageRecharge/components/choose-coupon.vue create mode 100644 pageRecharge/components/coupon-list.vue create mode 100644 pageRecharge/components/date-time-picker.vue create mode 100644 pageRecharge/components/rechargeRerord.vue diff --git a/http/api/market/index.js b/http/api/market/index.js index 1e37574..014ff57 100644 --- a/http/api/market/index.js +++ b/http/api/market/index.js @@ -168,12 +168,24 @@ export function shopRechargePost(data) { /** * 智慧充值规/配置信息获取 - * @param {Object} parmas + * @param {Object} data */ -export function shopRechargeGet(parmas) { +export function shopRechargeGet(data) { return request({ url: `${urlType}/admin/shopRecharge`, method: 'get', - parmas + data + }); +} + +/** + * 获取店铺用户充值记录 + * @param {Object} data + */ +export function shopUserFlow(data) { + return request({ + url: `/account/admin/shopUser/flow`, + method: 'get', + data }); } \ No newline at end of file diff --git a/pageMarket/components/choose-coupon.vue b/pageMarket/components/choose-coupon.vue index d7197ea..2f411d9 100644 --- a/pageMarket/components/choose-coupon.vue +++ b/pageMarket/components/choose-coupon.vue @@ -1,28 +1,16 @@ diff --git a/pageMarket/components/coupon-list.vue b/pageMarket/components/coupon-list.vue index 824d273..f777eab 100644 --- a/pageMarket/components/coupon-list.vue +++ b/pageMarket/components/coupon-list.vue @@ -1,92 +1,79 @@ diff --git a/pageMarket/couponExchangeCode/add.vue b/pageMarket/couponExchangeCode/add.vue index 2060500..d3c4ef0 100644 --- a/pageMarket/couponExchangeCode/add.vue +++ b/pageMarket/couponExchangeCode/add.vue @@ -1,174 +1,146 @@ - diff --git a/pageRecharge/components/choose-coupon.vue b/pageRecharge/components/choose-coupon.vue new file mode 100644 index 0000000..df8ea9f --- /dev/null +++ b/pageRecharge/components/choose-coupon.vue @@ -0,0 +1,186 @@ + + + + diff --git a/pageRecharge/components/coupon-list.vue b/pageRecharge/components/coupon-list.vue new file mode 100644 index 0000000..2efaa2e --- /dev/null +++ b/pageRecharge/components/coupon-list.vue @@ -0,0 +1,89 @@ + + + + diff --git a/pageRecharge/components/date-time-picker.vue b/pageRecharge/components/date-time-picker.vue new file mode 100644 index 0000000..9234ac3 --- /dev/null +++ b/pageRecharge/components/date-time-picker.vue @@ -0,0 +1,108 @@ + + + + diff --git a/pageRecharge/components/recharge-item.vue b/pageRecharge/components/recharge-item.vue index 6809d65..7535130 100644 --- a/pageRecharge/components/recharge-item.vue +++ b/pageRecharge/components/recharge-item.vue @@ -1,79 +1,98 @@ \ No newline at end of file + + .id { + background: #f7f7fa; + border-radius: 4rpx 4rpx 4rpx 4rpx; + padding: 4prx 10rpx; + overflow: hidden; + } +} + diff --git a/pageRecharge/components/rechargeRerord.vue b/pageRecharge/components/rechargeRerord.vue new file mode 100644 index 0000000..a6cd964 --- /dev/null +++ b/pageRecharge/components/rechargeRerord.vue @@ -0,0 +1,271 @@ + + + + + + diff --git a/pageRecharge/index.vue b/pageRecharge/index.vue index 7bdd61b..ae0b84c 100644 --- a/pageRecharge/index.vue +++ b/pageRecharge/index.vue @@ -73,76 +73,8 @@ - @@ -157,36 +89,51 @@ import myButton from '@/components/my-components/my-button.vue'; import myModel from '@/components/my-components/my-model.vue'; import myDatePickerview from '@/components/my-components/my-date-pickerview'; import rechargeItem from './components/recharge-item.vue'; +import rechargeRecord from './components/rechargeRerord.vue'; 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 { shopRechargePost, shopRechargeGet, shopUserFlow } from '@/http/api/market/index.js'; +import { onShow } from '@dcloudio/uni-app'; const model = ref(null); const modelData = reactive({ desc: '' }); function rechargeItemDel(e) { - modelData.desc = `确定删除【${Number(e.data.price).toFixed(2)}】面额吗?`; - model.value.open(); - console.log(e); + uni.showModal({ + title: '注意', + content: '确定要删除该充值面额吗?', + success: async (res) => { + try { + if (res.confirm) { + settingForm.value.rechargeDetailList.splice(e.index, 1); + uni.showLoading({ + title: '删除中...' + }); + await shopRechargePost(settingForm.value); + uni.showToast({ + title: '删除成功', + icon: 'none' + }); + } + } catch (error) { + console.log(error); + } + setTimeout(() => { + uni.hideLoading(); + }, 500); + } + }); + + // modelData.desc = `确定删除【${Number(e.data.price).toFixed(2)}】面额吗?`; + // model.value.open(); + // console.log(e); } function toAddRecharge() { go.to('PAGES_RECHARGE_ADD_RECHARGE'); } -const rechargeLists = ref([ - { - id: 1, - price: 200, - desc: '20.00元、2张券' - }, - { - id: 2, - price: 500, - desc: '60.00元、4张券' - } -]); +const rechargeLists = ref([]); let mustBindPhone = ref(true); const nowDate = new Date(); @@ -218,7 +165,16 @@ function useTypeChange(e) { async function shopRechargeGetAjax() { try { const res = await shopRechargeGet(); + res.rechargeDetailList.forEach((item) => { + item.couponInfoList.forEach((val) => { + if (val.coupon && val.coupon !== null) { + val.id = val.coupon.id; + val.title = val.coupon.title; + } + }); + }); settingForm.value = res; + rechargeLists.value = res.rechargeDetailList; } catch (error) { console.log(error); } @@ -291,7 +247,7 @@ function datePickerConfirm(e) { filters.time.end = e.end; } -onLoad(() => { +onShow(() => { shopRechargeGetAjax(); }); diff --git a/pages.json b/pages.json index 6f9db8b..b2a1ed0 100644 --- a/pages.json +++ b/pages.json @@ -694,18 +694,6 @@ "navigationBarTitleText": "运营余额" } }, - - - - - - - - - - - - { "pageId": "PAGES_MARKET_NEW_USER_DISCOUNT", "path": "newUserDiscount/index", @@ -769,7 +757,7 @@ "navigationBarTitleText": "充值兑换码详情" } } - + ] }, diff --git a/pages/appliccation/marketing.vue b/pages/appliccation/marketing.vue index e15262a..70ea5d9 100644 --- a/pages/appliccation/marketing.vue +++ b/pages/appliccation/marketing.vue @@ -58,7 +58,7 @@ const menuList = ref([ { title: '新客立减', icon: '', - pageUrl: 'PAGES_ORDER_INDEX', + pageUrl: 'PAGES_MARKET_NEW_USER_DISCOUNT', intro: '首单下单减免金额' }, { @@ -144,6 +144,15 @@ const menuList = ref([ { label: '优惠券', menus: [ + { + icon: 'mjq', + pageUrl: 'PAGES_EXCHANGE_COUPON', + title: '满减券', + intro: '用户满足指定金额后,可使用优惠券立减相应金额,如:设置满100-50券,符合要求的订单满100元后,立减50元。', + query: { + couponType: 1 + } + }, { icon: 'spdhq', pageUrl: 'PAGES_EXCHANGE_COUPON', @@ -152,6 +161,60 @@ const menuList = ref([ query: { couponType: 2 } + }, + { + icon: 'zkq', + pageUrl: 'PAGES_EXCHANGE_COUPON', + title: '折扣券', + intro: '下单享折扣但折扣的金额将在券中抵扣。', + query: { + couponType: 3 + } + }, + { + icon: 'dejbjq', + pageUrl: 'PAGES_EXCHANGE_COUPON', + title: '第二件半价券', + intro: '设置第二件半价券', + query: { + couponType: 4 + } + }, + { + icon: 'xfzq', + pageUrl: 'PAGES_EXCHANGE_COUPON', + title: '消费赠券', + intro: '达到指定消费金额赠送优惠券', + query: { + couponType: 5 + } + }, + { + icon: 'myzy', + pageUrl: 'PAGES_EXCHANGE_COUPON', + title: '买一送一券', + intro: '针对营销活动买一送一设置券品', + query: { + couponType: 6 + } + }, + { + icon: 'gdjkq', + pageUrl: 'PAGES_EXCHANGE_COUPON', + title: '固定价格券', + intro: '设置该券后,允许用户以固定价格兑换指定商品,如:设置一个固定价格9.9的券,商品20元,用户使用券后只需要9.9元兑换该商品。', + query: { + couponType: 7 + } + }, + { + icon: 'mfpsq', + pageUrl: 'PAGES_EXCHANGE_COUPON', + title: '免配送费券', + intro: '可设置一张免除订单配送费的券', + query: { + couponType: 8 + } } ] } @@ -185,7 +248,7 @@ page {