新增套餐推广

This commit is contained in:
gyq
2025-12-20 09:12:07 +08:00
parent 8826b206df
commit e8e474d971
15 changed files with 1584 additions and 441 deletions

View File

@@ -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;