From e8e474d9718cd18a58236031dec30e5e9721d9c0 Mon Sep 17 00:00:00 2001 From: gyq <875626088@qq.com> Date: Sat, 20 Dec 2025 09:12:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=A5=97=E9=A4=90=E6=8E=A8?= =?UTF-8?q?=E5=B9=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/my-components/my-footer-btn.vue | 2 +- components/my-components/my-hour-area.vue | 166 ++- components/my-components/my-week-sel.vue | 102 +- http/api/ware.js | 155 +++ pageMarket/groupGoods/addGoods.vue | 39 +- .../groupGoods/components/goodsList.vue | 38 +- .../groupGoods/components/orderList.vue | 59 +- pageMarket/groupGoods/index.vue | 33 +- pageMarket/groupGoods/selectGoods.vue | 95 ++ pageMarket/packagePopularize/addGoods.vue | 984 +++++++++++++++--- .../components/goodsList.vue | 71 +- .../components/orderList.vue | 129 ++- pageMarket/packagePopularize/index.vue | 43 +- pageMarket/packagePopularize/selectGoods.vue | 95 ++ pages.json | 14 + 15 files changed, 1584 insertions(+), 441 deletions(-) create mode 100644 pageMarket/groupGoods/selectGoods.vue create mode 100644 pageMarket/packagePopularize/selectGoods.vue diff --git a/components/my-components/my-footer-btn.vue b/components/my-components/my-footer-btn.vue index be1a74c..3bca82f 100644 --- a/components/my-components/my-footer-btn.vue +++ b/components/my-components/my-footer-btn.vue @@ -71,7 +71,7 @@ const emits = defineEmits(['confirm', 'cancel']); position: fixed; bottom: 0; left: 0; - z-index: 99; + z-index: 999; padding: 10px 14px calc(20px + env(safe-area-inset-bottom) / 2) 10px; background-color: #fff; &.horizontal { diff --git a/components/my-components/my-hour-area.vue b/components/my-components/my-hour-area.vue index 7bb2442..1a99827 100644 --- a/components/my-components/my-hour-area.vue +++ b/components/my-components/my-hour-area.vue @@ -1,118 +1,110 @@ diff --git a/components/my-components/my-week-sel.vue b/components/my-components/my-week-sel.vue index 28295d0..a99c814 100644 --- a/components/my-components/my-week-sel.vue +++ b/components/my-components/my-week-sel.vue @@ -1,63 +1,57 @@ \ No newline at end of file + diff --git a/http/api/ware.js b/http/api/ware.js index 0820ce5..50c903e 100644 --- a/http/api/ware.js +++ b/http/api/ware.js @@ -1,6 +1,7 @@ import http from '@/http/http.js' const request = http.request const ORDER_URL = 'order' +const Market_BaseUrl = 'market' /** * 拼团商品-列表 @@ -119,4 +120,158 @@ export function checkout(data) { method: "POST", data }) +} + + +/** + * 套餐推广:添加套餐 + * @param {*} data + * @returns + */ +export function packageAddEdit(data) { + return request({ + url: `${Market_BaseUrl}/admin/package`, + method: data.id ? 'put' : 'post', + data, + }); +} + +/** + * 套餐推广:获取套餐列表 + * @param {*} data + * @returns + */ +export function packageGet(params) { + return request({ + url: `${Market_BaseUrl}/admin/package`, + method: 'get', + params, + }); +} + +/** + * 套餐推广:获取套餐推广开关 + * @param {*} data + * @returns + */ +export function packageSwitchGet() { + return request({ + url: `${Market_BaseUrl}/admin/package/switch`, + method: 'get' + }); +} + +/** + * 套餐推广:修改套餐推广开关 + * @param {*} data + * @returns + */ +export function packageSwitchPut(data) { + return request({ + url: `${Market_BaseUrl}/admin/package/switch`, + method: 'put', + data + }); +} + +/** + * 套餐推广:删除套餐 + * @param {*} data + * @returns + */ +export function packageDel(id) { + return request({ + url: `${Market_BaseUrl}/admin/package/${id}`, + method: 'DELETE' + }); +} + +/** + * 套餐推广:确认删除套餐 + * @param {*} data + * @returns + */ +export function packageSureDel(id) { + return request({ + url: `${Market_BaseUrl}/admin/package/sure/${id}`, + method: 'DELETE' + }); +} + +/** + * 套餐推广:修改套餐推广开关 + * @param {*} data + * @returns + */ +export function packageOnline(data) { + return request({ + url: `${Market_BaseUrl}/admin/package/online`, + method: 'put', + data + }); +} + +/** + * 套餐推广:获取套餐推广订单列表 + * @param {*} data + * @returns + */ +export function packageOrder(params) { + return request({ + url: `${Market_BaseUrl}/admin/package/order`, + method: 'GET', + params + }); +} + +/** + * 套餐推广:订单统计 + * @param {*} data + * @returns + */ +export function packageOrderStat(params) { + return request({ + url: `${Market_BaseUrl}/admin/package/order/stat`, + method: 'GET', + params + }); +} + +/** + * 套餐推广:确认退单 + * @param {*} data + * @returns + */ +export function packageConfirmRefund(data) { + return request({ + url: `${ORDER_URL}/admin/ppOrder/confirmRefund`, + method: 'post', + data + }); +} + +/** + * 套餐推广:驳回退单 + * @param {*} data + * @returns + */ +export function packageRejectRefund(data) { + return request({ + url: `${ORDER_URL}/admin/ppOrder/rejectRefund`, + method: 'post', + data + }); +} + +/** + * 套餐推广:核销 + * @param {*} data + * @returns + */ +export function packageCheckout(data) { + return request({ + url: `${ORDER_URL}/admin/ppOrder/checkout`, + method: 'post', + data + }); } \ No newline at end of file diff --git a/pageMarket/groupGoods/addGoods.vue b/pageMarket/groupGoods/addGoods.vue index 95fcaf2..4218760 100644 --- a/pageMarket/groupGoods/addGoods.vue +++ b/pageMarket/groupGoods/addGoods.vue @@ -8,9 +8,14 @@ 可用门店 - + + + + + + @@ -20,6 +25,7 @@ 商品名称 + 导入已有商品 @@ -147,9 +153,10 @@ diff --git a/pageMarket/groupGoods/components/orderList.vue b/pageMarket/groupGoods/components/orderList.vue index 7fb3a44..3af7f36 100644 --- a/pageMarket/groupGoods/components/orderList.vue +++ b/pageMarket/groupGoods/components/orderList.vue @@ -9,8 +9,8 @@ shape="circle" clearable v-model="queryForm.orderNo" - @confirm="gbOrderPageAjax(1)" - @clear="gbOrderPageAjax(1)" + @confirm="resetGetList(1)" + @clear="resetGetList(1)" >
@@ -128,7 +128,7 @@ function dateConfirmHandle(e) { queryForm.orderStartTime = e.start; queryForm.orderEndTime = e.end; time.value = e.text; - gbOrderPageAjax(1); + resetGetList(); } const statusActive = ref(0); @@ -199,7 +199,7 @@ function tabChange(index) { statusActive.value = index; listData.page = 1; queryForm.status = tabs.value[index].value; - gbOrderPageAjax(); + resetGetList(); } const listData = reactive({ @@ -239,7 +239,7 @@ function refundHandle(item) { icon: 'none' }); }, 100); - goodsRecordPageAjax(1); + resetGetList(); } } catch (error) { uni.hideLoading(); @@ -281,7 +281,7 @@ async function returnCostConfirmHandle() { icon: 'none' }); }, 100); - gbOrderPageAjax(1); + resetGetList(); } catch (error) { console.log(error); } @@ -294,33 +294,40 @@ async function checkoutHandle(item) { title: '注意', content: '确认要核销吗?', success: async (res) => { - try { - uni.showLoading({ - title: '核销中...', - mask: true - }); - await checkout(item.verifyCode); - setTimeout(() => { - uni.showToast({ - title: '已核销', - icon: 'none' + if (res.confirm) { + try { + uni.showLoading({ + title: '核销中...', + mask: true }); - }, 100); - item.status = '已核销'; - item.verifyTime = dayjs().format('YYYY-MM-DD HH:mm:ss'); - } catch (error) { - console.log(error); + await checkout(item.verifyCode); + setTimeout(() => { + uni.showToast({ + title: '已核销', + icon: 'none' + }); + }, 100); + resetGetList(); + } catch (error) { + console.log(error); + } + uni.hideLoading(); } - uni.hideLoading(); } }); } +// 重置列表请求 +function resetGetList() { + listData.page = 1; + gbOrderPageAjax(); +} + // 获取拼团商品:订单列表 -async function gbOrderPageAjax(page = listData.page, isPull = false) { +async function gbOrderPageAjax() { try { const res = await gbOrderPage({ - page: page, + page: listData.page, size: listData.size, ...queryForm }); @@ -345,11 +352,11 @@ async function gbOrderPageAjax(page = listData.page, isPull = false) { defineExpose({ reachBottom, - gbOrderPageAjax + resetGetList }); onMounted(() => { - gbOrderPageAjax(); + resetGetList(); }); diff --git a/pageMarket/groupGoods/index.vue b/pageMarket/groupGoods/index.vue index 80dc19c..e95bca9 100644 --- a/pageMarket/groupGoods/index.vue +++ b/pageMarket/groupGoods/index.vue @@ -32,6 +32,7 @@ import goodsList from './components/goodsList.vue'; import orderList from './components/orderList.vue'; import { upShopConfig } from '@/http/api/ware.js'; import { getShopInfo } from '@/http/api/shop.js'; +import { isMainShop } from '@/store/account.js'; const goodsListRef = ref(null); const orderListRef = ref(null); @@ -67,7 +68,23 @@ const form = ref({ watch( () => form.value.onlineStatus, (newValue, oldValue) => { - upShopConfigAjax(); + if (loading.value == false) { + if (newValue == 0) { + uni.showModal({ + title: '注意', + content: '关闭拼团商品所有未支付的订单都将自动取消,是否确定关闭?', + success: (res) => { + if (res.confirm) { + upShopConfigAjax(); + } else { + form.value.onlineStatus = 1; + } + } + }); + } else { + upShopConfigAjax(); + } + } } ); @@ -79,6 +96,9 @@ async function upShopConfigAjax() { mask: true }); const res = await upShopConfig(form.value); + if (tabsActive.value == 0) { + goodsListRef.value?.resetGetList(); + } } catch (error) { console.log(error); } @@ -89,10 +109,10 @@ async function upShopConfigAjax() { onPullDownRefresh(() => { switch (tabsActive.value) { case 0: - goodsListRef.value?.getGbWarePageAjax(1, true); + goodsListRef.value?.resetGetList(); break; case 1: - orderListRef.value?.getGbWarePageAjax(1, true); + orderListRef.value?.resetGetList(); break; default: break; @@ -114,20 +134,25 @@ onReachBottom(() => { }); // 获取配置信息 +const loading = ref(true); async function getShopInfoAjax() { try { + loading.value = true; const res = await getShopInfo(); form.value.onlineStatus = res.isGroupBuy; } catch (error) { console.log(error); } + setTimeout(() => { + loading.value = false; + }, 500); } // 页面显示 onShow(() => { switch (tabsActive.value) { case 0: - goodsListRef.value?.getGbWarePageAjax(1); + goodsListRef.value?.resetGetList(); break; case 1: break; diff --git a/pageMarket/groupGoods/selectGoods.vue b/pageMarket/groupGoods/selectGoods.vue new file mode 100644 index 0000000..749ca48 --- /dev/null +++ b/pageMarket/groupGoods/selectGoods.vue @@ -0,0 +1,95 @@ + + + + + + diff --git a/pageMarket/packagePopularize/addGoods.vue b/pageMarket/packagePopularize/addGoods.vue index 95fcaf2..26573e8 100644 --- a/pageMarket/packagePopularize/addGoods.vue +++ b/pageMarket/packagePopularize/addGoods.vue @@ -8,22 +8,27 @@ 可用门店 - + + + + + + - + - 商品名称 + 套餐名称 - + @@ -31,38 +36,38 @@ - 商品描述 + 套餐描述 - + - + - 商品图片 + 套餐图片 *建议优先选择jpg格式,并且最好控制在500kb内 - + - + 原价 - + @@ -71,14 +76,14 @@ - + - 拼团价 + 价格 - + @@ -87,46 +92,242 @@ - - - - 成团人数 - - - - - - - - - - - - 成团期限(小时) - - - - - - - - - + - 限购数量 - + 选择商品 - - - + + + + + + 第{{ index + 1 }}组菜品 + + + 删除套餐组 + + + + + + + + + 导入商品 + + + + 添加商品 + + + + + + + 名称 + + + 价格 + + + 数量 + + + 操作 + + + + + + + + + + + + + + + + 删除 + + + + + 请添加商品 + + + + + 套餐{{ item.packageProducts.length }}选{{ item.num }} + + + + + + + + + + + 添加菜品组 + + + + + + + 可用周期 + + + + + + + + + + + + 指定时间段 + + + + + + + + + + + + + + 其他使用说明 + + + + + + + + + + + + + + + 分享优惠阶梯 + 如果没有分享裂变需求可以不设置,最多三级 + + + + {{ form.price ? '添加方案' : '请添加价格' }} + + + + + + + + + + 分享人数 + + + 价格(元) + + + 操作 + + + + + + + {{ val.peopleNum }} + + + {{ val.price }} + + + 编辑 + 删除 + + + + + 请添加阶梯 + + + + + + + + + + + + 分享期限(小时) + + + + + + + + + + + + + + 上架状态 + + + + + @@ -135,39 +336,127 @@ *建议优先选择jpg格式,并且最好控制在500kb内 - + + + + + + {{ stepFormType == 'add' ? '添加阶梯' : '编辑阶梯' }} + + + + + + + + 分享人数 + + + + + + + + + + + + + + 价格 + + + + + + + + + + + + + + + 取消 + + + 确定 + + + + diff --git a/pageMarket/packagePopularize/components/orderList.vue b/pageMarket/packagePopularize/components/orderList.vue index 9f2bc3b..bb92f47 100644 --- a/pageMarket/packagePopularize/components/orderList.vue +++ b/pageMarket/packagePopularize/components/orderList.vue @@ -9,8 +9,8 @@ shape="circle" clearable v-model="queryForm.orderNo" - @confirm="gbOrderPageAjax(1)" - @clear="gbOrderPageAjax(1)" + @confirm="resetGetList()" + @clear="resetGetList()" >
@@ -28,40 +28,40 @@ 订单号:{{ item.orderNo }} - 团单号:{{ item.groupOrderNo }} - {{ item.status }} + {{ statusFilter(item.status).label }} - + - {{ item.wareJson.wareName }} - x{{ item.num }} + {{ item.packageName }} + {{ item.price }}元 - {{ item.payAmount }}元 + 分享人数:{{ item.shareNum || 0 }} + 最终支付:{{ item.payAmount || 0 }} - 下单时间:{{ item.createTime }} + 支付时间:{{ item.payTime }} 核销时间:{{ item.verifyTime }} - 审核 + 审核 - + 退款 - + 核销 @@ -104,7 +104,7 @@ import dayjs from 'dayjs'; import { ref, reactive, onMounted } from 'vue'; import { includesString } from '@/utils/index.js'; -import { gbOrderPage, agreeRefund, rejectRefund, checkout } from '@/http/api/ware.js'; +import { packageOrder, packageConfirmRefund, packageRejectRefund, packageCheckout } from '@/http/api/ware.js'; const dateRef = ref(null); @@ -128,7 +128,7 @@ function dateConfirmHandle(e) { queryForm.orderStartTime = e.start; queryForm.orderEndTime = e.end; time.value = e.text; - gbOrderPageAjax(1); + resetGetList(); } const statusActive = ref(0); @@ -138,47 +138,54 @@ const tabs = ref([ label: '全部' }, { - value: '待成团', - label: '待成团' - }, - { - value: '待核销', + value: 'wait_verify', label: '待核销' }, { - value: '已核销', + value: 'finish', label: '已核销' }, { - value: '退款中', + value: 'refund', label: '退款' } ]); const statusList = ref([ { - value: '待支付', - type: 'info' - }, - { - value: '待核销', + label: '进行中', + value: 'ing', type: 'warning' }, { - value: '待成团', + label: '待核销', + value: 'wait_verify', type: 'warning' }, { - value: '已核销', + label: '已核销', + value: 'finish', + type: 'success' + }, + { + label: '退款中', + value: 'refunding', + type: 'error' + }, + { + label: '已退款', + value: 'refund', type: 'info' }, { - value: '退款中', - type: 'danger' + label: '已取消', + value: 'cancel', + type: 'info' }, { - value: '已退款', - type: 'info' + label: '超时', + value: 'timeout', + type: 'error' } ]); @@ -197,9 +204,8 @@ function statusFilter(status) { function tabChange(index) { statusActive.value = index; - listData.page = 1; queryForm.status = tabs.value[index].value; - gbOrderPageAjax(); + resetGetList(); } const listData = reactive({ @@ -221,14 +227,14 @@ function reachBottom() { function refundHandle(item) { uni.showModal({ title: '注意', - content: `确定要给[${item.userName}/${item.userPhone}]退款吗?`, + content: `确定要给[${item.nickname}/${item.phone}]退款吗?`, success: async (res) => { try { if (res.confirm) { uni.showLoading({ title: '退款中...' }); - const res = await agreeRefund({ + const res = await packageConfirmRefund({ recordId: item.id, orderNo: item.orderNo, reason: '' @@ -239,9 +245,10 @@ function refundHandle(item) { icon: 'none' }); }, 100); - goodsRecordPageAjax(1); + resetGetList(); } } catch (error) { + console.log(error); uni.hideLoading(); } } @@ -269,10 +276,10 @@ async function returnCostConfirmHandle() { refundLoading.value = true; if (refundForm.value.type == 1) { // 同意 - await agreeRefund(refundForm.value); + await packageConfirmRefund(refundForm.value); } else { // 驳回 - await rejectRefund(refundForm.value); + await packageRejectRefund(refundForm.value); } showRefundPopup.value = false; setTimeout(() => { @@ -281,7 +288,7 @@ async function returnCostConfirmHandle() { icon: 'none' }); }, 100); - goodsRecordPageAjax(1); + resetGetList(); } catch (error) { console.log(error); } @@ -299,15 +306,14 @@ async function checkoutHandle(item) { title: '核销中...', mask: true }); - await checkout(item.verifyCode); + await packageCheckout({ verifyCode: item.verifyCode }); setTimeout(() => { uni.showToast({ title: '已核销', icon: 'none' }); }, 100); - item.status = '已核销'; - item.verifyTime = dayjs().format('YYYY-MM-DD HH:mm:ss'); + resetGetList(); } catch (error) { console.log(error); } @@ -316,19 +322,21 @@ async function checkoutHandle(item) { }); } +// 重置列表请求 +function resetGetList() { + listData.page = 1; + gbOrderPageAjax(); +} + // 获取拼团商品:订单列表 -async function gbOrderPageAjax(page = listData.page, isPull = false) { +async function gbOrderPageAjax() { try { - const res = await gbOrderPage({ - page: page, + const res = await packageOrder({ + page: listData.page, size: listData.size, ...queryForm }); - res.records.forEach((item) => { - item.wareJson = JSON.parse(item.wareJson); - }); - if (listData.page == 1) { listData.list = res.records; } else { @@ -345,11 +353,11 @@ async function gbOrderPageAjax(page = listData.page, isPull = false) { defineExpose({ reachBottom, - gbOrderPageAjax + resetGetList }); onMounted(() => { - gbOrderPageAjax(); + resetGetList(); }); @@ -426,6 +434,11 @@ onMounted(() => { color: #999; font-size: 28upx; } + .t2 { + color: #333; + font-size: 28upx; + font-weight: bold; + } } } .user-info { @@ -465,9 +478,15 @@ onMounted(() => { } } .price { + display: flex; + flex-direction: column; .t1 { - font-size: 32upx; - color: #333; + font-size: 28upx; + color: #666; + } + .t2 { + font-size: 28upx; + color: #ff383c; font-weight: bold; } } diff --git a/pageMarket/packagePopularize/index.vue b/pageMarket/packagePopularize/index.vue index 87e3059..c76d0d0 100644 --- a/pageMarket/packagePopularize/index.vue +++ b/pageMarket/packagePopularize/index.vue @@ -31,8 +31,7 @@ import { ref, watch } from 'vue'; import { onLoad, onShow, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'; import goodsList from './components/goodsList.vue'; import orderList from './components/orderList.vue'; -import { upShopConfig } from '@/http/api/ware.js'; -import { getShopInfo } from '@/http/api/shop.js'; +import { packageSwitchGet, packageSwitchPut } from '@/http/api/ware.js'; const goodsListRef = ref(null); const orderListRef = ref(null); @@ -56,7 +55,7 @@ function tabClickHandle(item, index) { function toAdd() { uni.navigateTo({ - url: '/pageMarket/groupGoods/addGoods' + url: '/pageMarket/packagePopularize/addGoods' }); } @@ -68,7 +67,23 @@ const form = ref({ watch( () => form.value.onlineStatus, (newValue, oldValue) => { - upShopConfigAjax(); + if (loading.value == false) { + if (newValue == 0) { + uni.showModal({ + title: '注意', + content: '关闭套餐推广所有未支付的订单都将自动取消,是否确定关闭?', + success: (res) => { + if (res.confirm) { + upShopConfigAjax(); + } else { + form.value.onlineStatus = 1; + } + } + }); + } else { + upShopConfigAjax(); + } + } } ); @@ -79,7 +94,10 @@ async function upShopConfigAjax() { title: '保存中...', mask: true }); - const res = await upShopConfig(form.value); + await packageSwitchPut({ status: form.value.onlineStatus }); + if (tabsActive.value == 0) { + goodsListRef.value?.resetGetList(); + } } catch (error) { console.log(error); } @@ -90,10 +108,10 @@ async function upShopConfigAjax() { onPullDownRefresh(() => { switch (tabsActive.value) { case 0: - goodsListRef.value?.getGbWarePageAjax(1, true); + goodsListRef.value?.resetGetList(); break; case 1: - orderListRef.value?.getGbWarePageAjax(1, true); + orderListRef.value?.gbOrderPageAjax(1, true); break; default: break; @@ -115,20 +133,25 @@ onReachBottom(() => { }); // 获取配置信息 +const loading = ref(true); async function getShopInfoAjax() { try { - const res = await getShopInfo(); - form.value.onlineStatus = res.isGroupBuy; + loading.value = true; + const res = await packageSwitchGet(); + form.value.onlineStatus = res; } catch (error) { console.log(error); } + setTimeout(() => { + loading.value = false; + }, 500); } // 页面显示 onShow(() => { switch (tabsActive.value) { case 0: - goodsListRef.value?.getGbWarePageAjax(1); + goodsListRef.value?.resetGetList(); break; case 1: break; diff --git a/pageMarket/packagePopularize/selectGoods.vue b/pageMarket/packagePopularize/selectGoods.vue new file mode 100644 index 0000000..34eb245 --- /dev/null +++ b/pageMarket/packagePopularize/selectGoods.vue @@ -0,0 +1,95 @@ + + + + + + diff --git a/pages.json b/pages.json index 8bab498..50485c9 100644 --- a/pages.json +++ b/pages.json @@ -845,6 +845,13 @@ "navigationBarTitleText": "添加商品" } }, + { + "pageId": "PAGES_MARKET_GROUP_GOODS_ADDGOODS", + "path": "groupGoods/selectGoods", + "style": { + "navigationBarTitleText": "选择商品" + } + }, { "pageId": "PAGES_MARKET_PACKAGE_POPULARIZE_INDEX", "path": "packagePopularize/index", @@ -858,6 +865,13 @@ "style": { "navigationBarTitleText": "添加套餐" } + }, + { + "pageId": "PAGES_MARKET_GROUP_GOODS_PACKAGE", + "path": "packagePopularize/selectGoods", + "style": { + "navigationBarTitleText": "选择商品" + } } ] },