修复优惠券问题

This commit is contained in:
gyq
2025-11-21 18:15:09 +08:00
parent 97feb2c588
commit da8aedb149
7 changed files with 83 additions and 22 deletions

View File

@@ -75,7 +75,10 @@
<u-form-item label="可用门店" prop="useShops" v-if="shopInfo.isHeadShop && shopInfo.shopType != 'only'">
<my-shop-select-w v-model:useType="form.useShopType" v-model:selShops="form.useShops"></my-shop-select-w>
</u-form-item>
<u-form-item label="可用商品" v-if="form.couponType != 2 && form.couponType != 4 && form.couponType != 6" prop="foods">
<u-form-item label="指定门槛商品" prop="foods" v-if="form.couponType == 1">
<my-select-goods v-model="form.foods" v-model:foodType="form.goodsType" @foodTypeChange="goodsTypeChange"></my-select-goods>
</u-form-item>
<u-form-item label="可用商品" v-if="form.couponType != 2 && form.couponType != 4 && form.couponType != 6 && form.couponType != 1" prop="foods">
<my-select-goods v-model="form.foods" v-model:foodType="form.goodsType" @foodTypeChange="goodsTypeChange"></my-select-goods>
</u-form-item>
<u-form-item label="可使用类型" prop="useType">
@@ -567,7 +570,7 @@ function submitHandle() {
const inputTime = 50;
function fullAmountInput(e) {
setTimeout(() => {
form.value.fullAmount = filterNumberInput(e, 0);
form.value.fullAmount = filterNumberInput(e);
}, inputTime);
}
@@ -600,7 +603,7 @@ function maxDiscountAmountInput(e) {
function validDaysInput(e) {
setTimeout(() => {
form.value.validDays = filterNumberInput(e);
form.value.validDays = filterNumberInput(e, 1);
}, inputTime);
}

View File

@@ -6,7 +6,7 @@
<view class="ipt" @click="showStatusSheet = true">
<u-input suffix-icon="arrow-down" readonly placeholder="全部" :customStyle="inputStyle" v-model="statusValue"></u-input>
</view>
<view class="ipt" style="flex: 1.5" @click="showTime = true">
<view class="ipt" style="flex: 2" @click="showTime = true">
<u-input suffix-icon="arrow-right" readonly placeholder="请选择日期" :customStyle="inputStyle" v-model="timeVlaue"></u-input>
</view>
</div>
@@ -14,9 +14,12 @@
<view class="ipt">
<u-input prefix-icon="search" shape="circle" placeholder="用户昵称/用户ID" :customStyle="inputStyle"></u-input>
</view>
<div class="btn" style="width: 80px">
<div class="btn" style="width: 60px">
<u-button shape="circle" type="primary" :customStyle="inputStyle" @click="resetGetTabdleData">搜索</u-button>
</div>
<div class="btn" style="width: 60px">
<u-button shape="circle" :customStyle="inputStyle" @click="resetHandle">重置</u-button>
</div>
</div>
</view>
</view>
@@ -35,29 +38,29 @@
</view>
</view>
<view class="status">
<u-tag :type="getStatus(item.status).type">{{ getStatus(item.status).label }}</u-tag>
<u-tag :type="getStatus(item.status).type">{{ getStatus(item.status).name }}</u-tag>
</view>
</view>
<view class="content">
<view class="row">
<text class="title">领取时间</text>
<text class="b">领取时间</text>
<text class="b">{{ item.createTime }}</text>
</view>
<view class="row">
<text class="title">使用时间</text>
<text class="b">-</text>
<text class="b">{{ item.useTime || '-' }}</text>
</view>
<view class="row">
<text class="title">获得来源</text>
<text class="b">-</text>
<text class="b">{{ item.source || '-' }}</text>
</view>
<view class="row">
<text class="title">使用门店</text>
<text class="b">-</text>
<text class="b">{{ item.shopId || '-' }}</text>
</view>
<view class="row">
<text class="title">优惠金额</text>
<text class="b">-</text>
<text class="b">{{ item.discountAmount }}</text>
</view>
</view>
<!-- <view class="footer-wrap">
@@ -123,7 +126,8 @@ const showStatusSheet = ref(false);
const statusSheetList = ref([
{
value: '',
name: '全部'
name: '全部',
type: 'success'
},
{
value: 0,
@@ -144,7 +148,7 @@ const statusSheetList = ref([
// 获取状态参数
function getStatus(val) {
let obj = statusSheetList.value.find(val.value == val);
let obj = statusSheetList.value.find((item) => item.value === val);
if (obj) {
return obj;
} else {
@@ -180,7 +184,7 @@ const showTime2 = ref(false);
function selectTime2(e) {
tableData.endTime = dayjs(e.value).format('YYYY-MM-DD 23:59:59');
showTime2.value = false;
timeVlaue.value = `${tableData.startTime} - ${tableData.endTime}`;
timeVlaue.value = `${dayjs(tableData.startTime).format('YYYY-MM-DD')} - ${dayjs(tableData.endTime).format('YYYY-MM-DD')}`;
resetGetTabdleData();
}
@@ -191,6 +195,16 @@ function resetGetTabdleData() {
couponGetRecordAjax();
}
function resetHandle() {
statusValue.value = '';
timeVlaue.value = '';
tableData.startTime = '';
tableData.endTime = '';
tableData.status = '';
resetGetTabdleData();
}
const tableData = reactive({
couponId: '',
startTime: '',
@@ -291,12 +305,49 @@ page {
.info {
display: flex;
flex-direction: column;
padding-left: 20upx;
.id {
.t {
padding: 2upx 10upx;
font-size: 24upx;
background-color: #f8f8f8;
color: #999999;
}
}
.name {
.t {
color: #666666;
font-size: 28upx;
}
}
}
}
}
.content {
background-color: #f8f8f8;
padding: 28upx;
border-radius: 12upx;
margin-top: 28upx;
.row {
display: flex;
&:not(:first-child) {
margin-top: 20upx;
}
.title,
.b {
font-size: 28upx;
}
.title {
flex: 1;
width: 180upx;
color: #666666;
}
.b {
flex: 1.5;
display: flex;
justify-content: flex-end;
color: #333333;
}
}
}
.footer-wrap {

View File

@@ -61,7 +61,7 @@
</view>
</template>
<template v-else>
<view class="row" v-if="couponType == 1">
<view class="row" v-if="couponType == 1 || couponType == 3">
<text class="title">使用门槛</text>
<text class="info">{{ item.fullAmount }}元减{{ item.discountAmount }}</text>
</view>
@@ -75,7 +75,7 @@
</view>
<view class="row">
<text class="title">发放方式</text>
<text class="info">用户{{ getEmunListLabel('getType', item.getType) }}</text>
<text class="info">{{ getEmunListLabel('getType', item.getType) }}</text>
</view>
<view class="row">
<text class="title">有效期</text>
@@ -87,7 +87,7 @@
</text>
</view>
</template>
<view class="row">
<view class="row" v-if="couponType != 3 && couponType != 1">
<text class="title">创建时间</text>
<text class="info">{{ item.createTime }}</text>
</view>
@@ -115,6 +115,7 @@ const scrollLeft = ref(0); // scroll-view的滚动距离
// 切换类型
function changeType(type, index) {
couponType.value = type;
tableData.query = '';
resetGetData();
calculateCenterScroll(index);
}

View File

@@ -34,11 +34,11 @@ export const emunList = {
}
],
getType: [{
label: '不可自行领取',
label: '用户不可自行领取',
value: 'no'
},
{
label: '领取',
label: '用户可自行在小程序领取',
value: 'yes'
}
],

View File

@@ -0,0 +1,8 @@
<template>
</template>
<script>
</script>
<style>
</style>