新增部分优惠券页面

This commit is contained in:
gyq
2025-11-20 10:27:08 +08:00
parent 805236dc5d
commit f74364a253
13 changed files with 887 additions and 368 deletions

View File

@@ -11,26 +11,29 @@
<u-tag :type="statusFilter(item.status, 'type')" plain :text="statusFilter(item.status, 'label')"></u-tag>
</view>
</view>
<view class="row">
<!-- <view class="row">
<text class="b">活动名称</text>
<text class="t">{{ item.title }}</text>
</view>
</view> -->
<view class="row">
<text class="b">活动时间</text>
<text class="t">{{ item.updateTime }}</text>
<text class="t">{{ item.validStartTime }}{{ item.validEndTime }}</text>
</view>
<view class="row">
<text class="t">{{ item.useDays }}</text>
</view>
<view class="row">
<text class="t" v-if="item.useTimeType == 'custom'" style="margin-right: 20px">
{{ convertTimeFormat(item.useStartTime) }} - {{ convertTimeFormat(item.useEndTime) }}
</text>
<text class="t">折扣{{ item.discountRate }}%</text>
</view>
<view class="footer">
<view class="btn">
<u-button @click="delHandle(item)">删除</u-button>
<u-button shape="circle" @click="delHandle(item)">删除</u-button>
</view>
<view class="btn">
<u-button type="primary" @click="editorHandle(item)">编辑</u-button>
<u-button shape="circle" type="primary" @click="editorHandle(item)">编辑</u-button>
</view>
</view>
</view>
@@ -45,6 +48,7 @@ import { reactive, ref } from 'vue';
import { onLoad, onShow, onReachBottom } from '@dcloudio/uni-app';
import { limitTimeDiscountPage, limitTimeDiscountDel } from '@/http/api/market/index.js';
import go from '@/commons/utils/go.js';
import { convertTimeFormat } from '@/utils/index.js';
// 去编辑
function editorHandle(item) {
@@ -118,15 +122,21 @@ const tableData = reactive({
// 滚动到底部
onReachBottom(() => {
tableData.page++;
limitTimeDiscountPageAjax();
if (tableData.status != 'nomore') {
tableData.page++;
limitTimeDiscountPageAjax();
}
});
// 获取限时折扣分页
async function limitTimeDiscountPageAjax() {
try {
uni.showLoading({
title: '加载中...',
mask: true
});
const res = await limitTimeDiscountPage({
page: 1,
page: tableData.page,
size: 10,
startTime: '',
endTime: ''
@@ -142,6 +152,9 @@ async function limitTimeDiscountPageAjax() {
} catch (error) {
console.log(error);
}
setTimeout(() => {
uni.hideLoading();
}, 500);
}
onShow(() => {
@@ -159,7 +172,7 @@ page {
</style>
<style scoped lang="scss">
.container {
padding: 0 28upx;
padding: 0 28upx 28upx;
}
.list {
padding: 28upx 0;