新增套餐推广

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

@@ -8,8 +8,8 @@
shape="circle"
clearable
v-model="queryForm.wareName"
@confirm="getGbWarePageAjax(1)"
@clear="getGbWarePageAjax(1)"
@confirm="resetGetList()"
@clear="resetGetList()"
></u-input>
</view>
<div class="ipt" @click="showStatusSheet = true">
@@ -31,7 +31,7 @@
<text class="t1">原价{{ item.originalPrice }}</text>
<text class="t1">拼团价{{ item.groupPrice }}</text>
</view>
<view class="status">
<view class="status" v-if="item.shopId == shopInfo.id">
<view class="row">
<u-switch v-model="item.onlineStatus" :active-value="1" :inactive-value="0" @change="onlineStatusChange($event, item)"></u-switch>
</view>
@@ -41,7 +41,7 @@
</text>
</view>
</view>
<view class="footer-wrap">
<view class="footer-wrap" v-if="item.shopId == shopInfo.id">
<template v-if="!item.onlineStatus">
<view class="btn">
<u-button shape="circle" @click="delHandle(item)">删除</u-button>
@@ -77,6 +77,7 @@
<script setup>
import { onMounted, reactive, ref } from 'vue';
import { getGbWarePage, editOnlineStatus, deleteGbWare } from '@/http/api/ware.js';
const shopInfo = ref('');
const props = defineProps({
top: {
@@ -96,7 +97,7 @@ const queryForm = reactive({
function sheetConfirm(e) {
queryForm.onlineStatusLabel = e.name;
queryForm.onlineStatus = e.value;
getGbWarePageAjax(1);
resetGetList();
}
const listData = reactive({
@@ -158,11 +159,17 @@ function editorHandle(item) {
});
}
// 重置列表请求
function resetGetList() {
listData.page = 1;
getGbWarePageAjax();
}
// 拼团商品-列表
async function getGbWarePageAjax(page = listData.page, isPull = false) {
async function getGbWarePageAjax() {
try {
const res = await getGbWarePage({
page: page,
page: listData.page,
size: listData.size,
...queryForm
});
@@ -179,24 +186,19 @@ async function getGbWarePageAjax(page = listData.page, isPull = false) {
} catch (error) {
console.log(error);
}
if (isPull) {
setTimeout(() => {
uni.showToast({
title: '刷新成功',
icon: 'none'
});
uni.stopPullDownRefresh();
}, 300);
}
setTimeout(() => {
uni.stopPullDownRefresh();
}, 300);
}
defineExpose({
reachBottom,
getGbWarePageAjax
resetGetList
});
onMounted(() => {
getGbWarePageAjax();
shopInfo.value = uni.getStorageSync('shopInfo');
resetGetList();
});
</script>

View File

@@ -9,8 +9,8 @@
shape="circle"
clearable
v-model="queryForm.orderNo"
@confirm="gbOrderPageAjax(1)"
@clear="gbOrderPageAjax(1)"
@confirm="resetGetList(1)"
@clear="resetGetList(1)"
></u-input>
</view>
<div class="ipt" @click="dateRef.open()">
@@ -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();
});
</script>