mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-11-13 04:18:55 +08:00
feat(coupon): 支持立减优惠券并统一营销管理页面
This commit is contained in:
@@ -162,7 +162,7 @@ lilishop-ui
|
|||||||
|
|
||||||
## 8. 升级计划
|
## 8. 升级计划
|
||||||
|
|
||||||
> 更新日期:2026-11-03,依据各端近期提交及当前代码实现同步。
|
> 更新日期:2026-11-04,依据各端近期提交及当前代码实现同步。
|
||||||
|
|
||||||
### ✅ 已完成特性
|
### ✅ 已完成特性
|
||||||
| 功能模块 | 功能模块 |
|
| 功能模块 | 功能模块 |
|
||||||
@@ -173,7 +173,7 @@ lilishop-ui
|
|||||||
| ✅ 购物卡 | ✅ 腾讯云-云直播 |
|
| ✅ 购物卡 | ✅ 腾讯云-云直播 |
|
||||||
| ✅ 卡密商品 | ✅ 二级分销 |
|
| ✅ 卡密商品 | ✅ 二级分销 |
|
||||||
| ✅ 定时任务管理(数据库配置驱动) | ✅ 预约服务商品 |
|
| ✅ 定时任务管理(数据库配置驱动) | ✅ 预约服务商品 |
|
||||||
| ✅ 主题色管理 | |
|
| ✅ 主题色管理 | ✅ 立减优惠券 |
|
||||||
|
|
||||||
### 🔜 近期规划中
|
### 🔜 近期规划中
|
||||||
- 🔜 微信小店对接
|
- 🔜 微信小店对接
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<span v-if="coupon.couponType === 'PRICE'" class="fontsize_12 global_color">¥<span class="price">{{ $filters.unitPrice(coupon.price) }}</span></span>
|
<span v-if="coupon.couponType === 'PRICE'" class="fontsize_12 global_color">¥<span class="price">{{ $filters.unitPrice(coupon.price) }}</span></span>
|
||||||
<span v-if="coupon.couponType === 'DISCOUNT'" class="fontsize_12 global_color"><span class="price">{{coupon.couponDiscount}}</span>折</span>
|
<span v-if="coupon.couponType === 'DISCOUNT'" class="fontsize_12 global_color"><span class="price">{{coupon.couponDiscount}}</span>折</span>
|
||||||
<span class="describe">满{{coupon.consumeThreshold}}元可用</span>
|
<span class="describe">{{ coupon.consumeThreshold > 0 ? '满' + coupon.consumeThreshold + '元可用' : '无门槛使用' }}</span>
|
||||||
</div>
|
</div>
|
||||||
<p>使用范围:{{useScope(coupon.scopeType, coupon.storeName)}}</p>
|
<p>使用范围:{{useScope(coupon.scopeType, coupon.storeName)}}</p>
|
||||||
<p>有效期:{{coupon.endTime}}</p>
|
<p>有效期:{{coupon.endTime}}</p>
|
||||||
|
|||||||
@@ -100,7 +100,7 @@
|
|||||||
@click="handleReceiveCoupon(item.id)"
|
@click="handleReceiveCoupon(item.id)"
|
||||||
>
|
>
|
||||||
<span v-if="item.couponType == 'PRICE'"
|
<span v-if="item.couponType == 'PRICE'"
|
||||||
>满{{ item.consumeThreshold }}减{{ item.price }}</span>
|
>{{ item.consumeThreshold > 0 ? '满' + item.consumeThreshold + '减' + item.price : '无门槛,立减' + item.price + '元' }}</span>
|
||||||
<span v-if="item.couponType == 'DISCOUNT'"
|
<span v-if="item.couponType == 'DISCOUNT'"
|
||||||
>满{{ item.consumeThreshold }}打{{
|
>满{{ item.consumeThreshold }}打{{
|
||||||
item.couponDiscount
|
item.couponDiscount
|
||||||
@@ -117,7 +117,7 @@
|
|||||||
@click="handleReceiveCoupon(item.id)"
|
@click="handleReceiveCoupon(item.id)"
|
||||||
>
|
>
|
||||||
<span v-if="item.couponType == 'PRICE'"
|
<span v-if="item.couponType == 'PRICE'"
|
||||||
>满{{ item.consumeThreshold }}减{{ item.price }}</span>
|
>{{ item.consumeThreshold > 0 ? '满' + item.consumeThreshold + '减' + item.price : '无门槛,立减' + item.price + '元' }}</span>
|
||||||
<span v-if="item.couponType == 'DISCOUNT'"
|
<span v-if="item.couponType == 'DISCOUNT'"
|
||||||
>满{{ item.consumeThreshold }}打{{
|
>满{{ item.consumeThreshold }}打{{
|
||||||
item.couponDiscount
|
item.couponDiscount
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
>¥{{ item.price }}</span>
|
>¥{{ item.price }}</span>
|
||||||
<span v-if="item.couponType === 'DISCOUNT'"
|
<span v-if="item.couponType === 'DISCOUNT'"
|
||||||
>{{ item.couponDiscount }}折</span>
|
>{{ item.couponDiscount }}折</span>
|
||||||
<span>满{{ item.consumeThreshold }}元可用</span>
|
<span>{{ item.consumeThreshold > 0 ? '满' + item.consumeThreshold + '元可用' : '无门槛使用' }}</span>
|
||||||
<el-button
|
<el-button
|
||||||
class="coupon-btn"
|
class="coupon-btn"
|
||||||
size="small"
|
size="small"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<el-card shadow="never" v-for="(item, index) in autoCoupList" :key="index" style="margin: 10px 15px">
|
<el-card shadow="never" v-for="(item, index) in autoCoupList" :key="index" style="margin: 10px 15px">
|
||||||
<span v-if="item.couponType === 'PRICE'" class="fontsize_12 global_color" style="font-size: 15px;">¥<span class="price">{{ $filters.unitPrice(item.price) }}</span></span>
|
<span v-if="item.couponType === 'PRICE'" class="fontsize_12 global_color" style="font-size: 15px;">¥<span class="price">{{ $filters.unitPrice(item.price) }}</span></span>
|
||||||
<span v-if="item.couponType === 'DISCOUNT'" class="fontsize_12 global_color" style="font-size: 15px;"><span class="price">{{item.discount}}</span>折</span>
|
<span v-if="item.couponType === 'DISCOUNT'" class="fontsize_12 global_color" style="font-size: 15px;"><span class="price">{{item.discount}}</span>折</span>
|
||||||
<span class="describe" style="font-size: 15px;margin-left: 5px;">满{{item.consumeThreshold}}元可用</span>
|
<span class="describe" style="font-size: 15px;margin-left: 5px;">{{ item.consumeThreshold > 0 ? '满' + item.consumeThreshold + '元可用' : '无门槛使用' }}</span>
|
||||||
<p style="font-size: 14px;">使用范围:{{useScope(item.scopeType, item.storeName)}}</p>
|
<p style="font-size: 14px;">使用范围:{{useScope(item.scopeType, item.storeName)}}</p>
|
||||||
<p style="font-size: 14px;">有效期:{{item.endTime}}</p>
|
<p style="font-size: 14px;">有效期:{{item.endTime}}</p>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
v-if="item.couponType === 'DISCOUNT'"
|
v-if="item.couponType === 'DISCOUNT'"
|
||||||
class="global_color coupon-amount"
|
class="global_color coupon-amount"
|
||||||
><span class="price">{{ item.discount }}</span>折</span>
|
><span class="price">{{ item.discount }}</span>折</span>
|
||||||
<span class="describe">满{{ item.consumeThreshold }}元可用</span>
|
<span class="describe">{{ item.consumeThreshold > 0 ? '满' + item.consumeThreshold + '元可用' : '无门槛使用' }}</span>
|
||||||
</div>
|
</div>
|
||||||
<p>使用范围:{{ useScope(item.scopeType, item.storeName) }}</p>
|
<p>使用范围:{{ useScope(item.scopeType, item.storeName) }}</p>
|
||||||
<p class="coupon-expire">有效期:{{ formatValidity(item) }}</p>
|
<p class="coupon-expire">有效期:{{ formatValidity(item) }}</p>
|
||||||
|
|||||||
@@ -202,7 +202,7 @@
|
|||||||
<template v-else>{{ item.discount }}折</template>
|
<template v-else>{{ item.discount }}折</template>
|
||||||
</div>
|
</div>
|
||||||
<div class="pay-coupon-info">
|
<div class="pay-coupon-info">
|
||||||
<p>满{{ item.consumeThreshold }}元可用</p>
|
<p>{{ item.consumeThreshold > 0 ? '满' + item.consumeThreshold + '元可用' : '无门槛使用' }}</p>
|
||||||
<p>使用范围:{{ useScope(item.scopeType, item.storeName) }}</p>
|
<p>使用范围:{{ useScope(item.scopeType, item.storeName) }}</p>
|
||||||
<p>有效期:{{ item.endTime }}</p>
|
<p>有效期:{{ item.endTime }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,29 +2,12 @@
|
|||||||
|
|
||||||
<div class="search member-benefit">
|
<div class="search member-benefit">
|
||||||
|
|
||||||
<el-card shadow="never" class="table-card">
|
<el-card>
|
||||||
|
|
||||||
<template #header>
|
<div class="operation padding-row benefit-actions">
|
||||||
|
<el-button type="primary" @click="openAdd">添加权益设置</el-button>
|
||||||
<div class="card-header-bar">
|
<el-button @click="getData">刷新</el-button>
|
||||||
|
</div>
|
||||||
<div class="header-title">
|
|
||||||
|
|
||||||
<span>客户权益列表</span>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="header-actions">
|
|
||||||
|
|
||||||
<el-button size="small" @click="getData">刷新</el-button>
|
|
||||||
|
|
||||||
<el-button type="primary" size="small" @click="openAdd">添加权益设置</el-button>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</template>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -33,16 +16,14 @@
|
|||||||
<el-table
|
<el-table
|
||||||
|
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
|
|
||||||
stripe
|
|
||||||
|
|
||||||
border
|
border
|
||||||
|
|
||||||
:data="data"
|
:data="data"
|
||||||
|
|
||||||
empty-text="暂无数据"
|
empty-text="暂无数据"
|
||||||
|
|
||||||
class="custom-benefit-table"
|
class="custom-benefit-table mt_10"
|
||||||
|
row-key="id"
|
||||||
|
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
|
|
||||||
@@ -50,13 +31,13 @@
|
|||||||
|
|
||||||
<!-- 权益ID -->
|
<!-- 权益ID -->
|
||||||
|
|
||||||
<el-table-column prop="id" label="权益ID" min-width="190" show-overflow-tooltip />
|
<el-table-column prop="id" label="权益ID" min-width="150" show-overflow-tooltip />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 权益LOGO -->
|
<!-- 权益LOGO -->
|
||||||
|
|
||||||
<el-table-column label="权益LOGO" width="86" align="center">
|
<el-table-column label="权益LOGO" width="100" align="center">
|
||||||
|
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
|
|
||||||
@@ -96,7 +77,7 @@
|
|||||||
|
|
||||||
<!-- 权益名称 -->
|
<!-- 权益名称 -->
|
||||||
|
|
||||||
<el-table-column prop="benefitName" label="权益名称" min-width="180" show-overflow-tooltip />
|
<el-table-column prop="benefitName" label="权益名称" min-width="150" show-overflow-tooltip />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -108,7 +89,7 @@
|
|||||||
|
|
||||||
<!-- 权益类型 -->
|
<!-- 权益类型 -->
|
||||||
|
|
||||||
<el-table-column label="权益类型" width="140" align="center">
|
<el-table-column label="权益类型" width="120" align="center">
|
||||||
|
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
|
|
||||||
@@ -122,13 +103,13 @@
|
|||||||
|
|
||||||
<!-- 排序 -->
|
<!-- 排序 -->
|
||||||
|
|
||||||
<el-table-column prop="benefitSort" label="排序" width="80" align="center" />
|
<el-table-column prop="benefitSort" label="排序" width="70" align="center" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 状态 -->
|
<!-- 状态 -->
|
||||||
|
|
||||||
<el-table-column label="状态" width="110" align="center">
|
<el-table-column label="状态" width="100" align="center">
|
||||||
|
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
|
|
||||||
@@ -158,7 +139,7 @@
|
|||||||
|
|
||||||
<!-- 操作 -->
|
<!-- 操作 -->
|
||||||
|
|
||||||
<el-table-column label="操作" width="140" align="center" fixed="right">
|
<el-table-column label="操作" width="120" align="center" fixed="right">
|
||||||
|
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
|
|
||||||
@@ -484,13 +465,15 @@
|
|||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<div class="benefit-drawer-footer-btns">
|
<template #footer>
|
||||||
|
<div class="benefit-drawer-footer-btns">
|
||||||
|
|
||||||
<el-button @click="addFlag = false">取消</el-button>
|
<el-button @click="addFlag = false">取消</el-button>
|
||||||
|
|
||||||
<el-button type="primary" :loading="submitAddLoading" @click="submitAdd">提交</el-button>
|
<el-button type="primary" :loading="submitAddLoading" @click="submitAdd">提交</el-button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
|
|
||||||
@@ -724,13 +707,15 @@
|
|||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<div class="benefit-drawer-footer-btns">
|
<template #footer>
|
||||||
|
<div class="benefit-drawer-footer-btns">
|
||||||
|
|
||||||
<el-button @click="editFlag = false">取消</el-button>
|
<el-button @click="editFlag = false">取消</el-button>
|
||||||
|
|
||||||
<el-button type="primary" :loading="submitEditLoading" @click="submitEdit">提交</el-button>
|
<el-button type="primary" :loading="submitEditLoading" @click="submitEdit">提交</el-button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
|
|
||||||
@@ -1770,47 +1755,15 @@ onMounted(() => {
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
.card-header-bar {
|
.benefit-actions {
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
.header-title {
|
.benefit-actions .el-button + .el-button {
|
||||||
|
margin-left: 0;
|
||||||
display: flex;
|
|
||||||
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
gap: 10px;
|
|
||||||
|
|
||||||
font-size: 15px;
|
|
||||||
|
|
||||||
font-weight: 600;
|
|
||||||
|
|
||||||
color: #303133;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.header-actions {
|
|
||||||
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
gap: 8px;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.font-mono {
|
.font-mono {
|
||||||
|
|
||||||
@@ -1913,21 +1866,13 @@ onMounted(() => {
|
|||||||
|
|
||||||
|
|
||||||
.benefit-drawer-footer-btns {
|
.benefit-drawer-footer-btns {
|
||||||
|
display: flex;
|
||||||
margin-top: 24px;
|
justify-content: flex-end;
|
||||||
|
gap: 10px;
|
||||||
padding-top: 16px;
|
|
||||||
|
|
||||||
border-top: 1px solid #e8eaec;
|
|
||||||
|
|
||||||
text-align: right;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.benefit-drawer-footer-btns .el-button + .el-button {
|
.benefit-drawer-footer-btns .el-button + .el-button {
|
||||||
|
margin-left: 0;
|
||||||
margin-left: 8px;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.link-text {
|
.link-text {
|
||||||
@@ -1953,6 +1898,21 @@ onMounted(() => {
|
|||||||
|
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
.benefit-form-drawer {
|
||||||
|
max-width: 100vw;
|
||||||
|
.el-drawer__header {
|
||||||
|
margin-bottom: 0;
|
||||||
|
padding: 20px 24px;
|
||||||
|
border-bottom: 1px solid var(--el-border-color-lighter);
|
||||||
|
}
|
||||||
|
.el-drawer__body { padding: 24px; }
|
||||||
|
.el-drawer__footer {
|
||||||
|
padding: 16px 24px;
|
||||||
|
border-top: 1px solid var(--el-border-color-lighter);
|
||||||
|
}
|
||||||
|
.el-form-item__content { min-width: 0; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.benefit-logo-thumb {
|
.benefit-logo-thumb {
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<span class="val">{{ cp.price }}</span>
|
<span class="val">{{ cp.price }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="right-info">
|
<div class="right-info">
|
||||||
<span class="title">满{{ cp.consumeThreshold }}可用</span>
|
<span class="title">{{ cp.consumeThreshold > 0 ? '满' + cp.consumeThreshold + '可用' : '无门槛使用' }}</span>
|
||||||
<span class="scope" v-if="cp.title">{{ cp.title }}</span>
|
<span class="scope" v-if="cp.title">{{ cp.title }}</span>
|
||||||
<span class="btn">立即领取</span>
|
<span class="btn">立即领取</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -91,7 +91,7 @@
|
|||||||
<el-table-column label="优惠券类型" width="130" align="center">
|
<el-table-column label="优惠券类型" width="130" align="center">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag v-if="row" size="small" effect="light" :type="row.couponType === 'DISCOUNT' ? 'warning' : 'danger'">
|
<el-tag v-if="row" size="small" effect="light" :type="row.couponType === 'DISCOUNT' ? 'warning' : 'danger'">
|
||||||
{{ couponTypeText(row.couponType) }}
|
{{ couponTypeText(row) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -181,9 +181,9 @@ onMounted(() => {
|
|||||||
getCouponActivity();
|
getCouponActivity();
|
||||||
});
|
});
|
||||||
|
|
||||||
function couponTypeText(v) {
|
function couponTypeText(row) {
|
||||||
if (v === "DISCOUNT") return "打折券";
|
if (row.couponType === "DISCOUNT") return "满折优惠券";
|
||||||
if (v === "PRICE") return "减免现金券";
|
if (row.couponType === "PRICE") return Number(row.consumeThreshold) === 0 ? "立减优惠券" : "满减优惠券";
|
||||||
return "未知类型";
|
return "未知类型";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,13 +25,6 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="优惠券活动类型" prop="couponActivityType">
|
|
||||||
<el-radio-group v-model="form.couponActivityType">
|
|
||||||
<el-radio-button value="REGISTERED">新人发券</el-radio-button>
|
|
||||||
<el-radio-button value="SPECIFY">精确发券</el-radio-button>
|
|
||||||
<el-radio-button value="AUTO_COUPON">自动赠券</el-radio-button>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="领取频率"
|
label="领取频率"
|
||||||
v-if="form.couponActivityType === 'AUTO_COUPON'"
|
v-if="form.couponActivityType === 'AUTO_COUPON'"
|
||||||
@@ -170,8 +163,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive } from "vue";
|
import { ref, reactive, watch } from "vue";
|
||||||
import { useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import couponTemplate from "@/views/promotions/coupon/coupon";
|
import couponTemplate from "@/views/promotions/coupon/coupon";
|
||||||
import userList from "@/views/member/list/index";
|
import userList from "@/views/member/list/index";
|
||||||
import { saveActivityCoupon } from "@/api/promotion";
|
import { saveActivityCoupon } from "@/api/promotion";
|
||||||
@@ -182,6 +175,7 @@ import { unixToDate } from "@/utils/filters";
|
|||||||
defineOptions({ name: "add-coupon-activity" });
|
defineOptions({ name: "add-coupon-activity" });
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const route = useRoute();
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
|
|
||||||
const options = reactive({
|
const options = reactive({
|
||||||
@@ -205,6 +199,15 @@ const form = reactive({
|
|||||||
couponActivityItems: [],
|
couponActivityItems: [],
|
||||||
couponFrequencyEnum: "",
|
couponFrequencyEnum: "",
|
||||||
});
|
});
|
||||||
|
watch(
|
||||||
|
() => route.query.couponActivityType,
|
||||||
|
(type) => {
|
||||||
|
if (["REGISTERED", "SPECIFY", "AUTO_COUPON"].includes(type)) {
|
||||||
|
form.couponActivityType = type;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
const submitLoading = ref(false);
|
const submitLoading = ref(false);
|
||||||
const selectCouponList = ref([]);
|
const selectCouponList = ref([]);
|
||||||
const formRule = reactive({
|
const formRule = reactive({
|
||||||
|
|||||||
@@ -2,7 +2,9 @@
|
|||||||
<div class="search">
|
<div class="search">
|
||||||
<el-card>
|
<el-card>
|
||||||
<div class="operation padding-row">
|
<div class="operation padding-row">
|
||||||
<el-button type="primary" @click="add">添加活动</el-button>
|
<el-button type="primary" plain @click="addRegistered">注册赠券</el-button>
|
||||||
|
<el-button type="primary" plain @click="addSpecify">精准发券</el-button>
|
||||||
|
<el-button type="primary" plain @click="addAutoCoupon">自动赠券</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-table
|
<el-table
|
||||||
@@ -105,7 +107,7 @@ function activityTypeText(type) {
|
|||||||
REGISTERED: "注册赠券",
|
REGISTERED: "注册赠券",
|
||||||
AUTO_COUPON: "自动发券",
|
AUTO_COUPON: "自动发券",
|
||||||
};
|
};
|
||||||
return map[type] || "精确发券";
|
return map[type] || "精准发券";
|
||||||
}
|
}
|
||||||
function activityScopeText(scope) {
|
function activityScopeText(scope) {
|
||||||
return scope === "DESIGNATED" ? "指定会员" : "全部会员";
|
return scope === "DESIGNATED" ? "指定会员" : "全部会员";
|
||||||
@@ -145,8 +147,23 @@ function promotionStatusTagType(status) {
|
|||||||
function init() {
|
function init() {
|
||||||
getDataList();
|
getDataList();
|
||||||
}
|
}
|
||||||
function add() {
|
function addRegistered() {
|
||||||
router.push({ name: "add-coupon-activity" });
|
router.push({
|
||||||
|
name: "add-coupon-activity",
|
||||||
|
query: { couponActivityType: "REGISTERED" },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function addSpecify() {
|
||||||
|
router.push({
|
||||||
|
name: "add-coupon-activity",
|
||||||
|
query: { couponActivityType: "SPECIFY" },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function addAutoCoupon() {
|
||||||
|
router.push({
|
||||||
|
name: "add-coupon-activity",
|
||||||
|
query: { couponActivityType: "AUTO_COUPON" },
|
||||||
|
});
|
||||||
}
|
}
|
||||||
function info(v) {
|
function info(v) {
|
||||||
router.push({ name: "coupon-activity-info", query: { id: v.id } });
|
router.push({ name: "coupon-activity-info", query: { id: v.id } });
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -72,7 +72,7 @@
|
|||||||
<el-table-column label="面额/折扣" width="100">
|
<el-table-column label="面额/折扣" width="100">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<priceColorScheme
|
<priceColorScheme
|
||||||
v-if="row && row.price"
|
v-if="row && row.couponType === 'PRICE'"
|
||||||
:value="row.price"
|
:value="row.price"
|
||||||
:color="$mainColor"
|
:color="$mainColor"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -93,7 +93,7 @@
|
|||||||
<el-table-column label="面额/折扣" width="150">
|
<el-table-column label="面额/折扣" width="150">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<span v-if="row">
|
<span v-if="row">
|
||||||
<span v-if="row.price" :style="{ color: $mainColor }">
|
<span v-if="row.couponType === 'PRICE'" :style="{ color: $mainColor }">
|
||||||
{{ $filters.unitPrice(row.price, "¥") }}</span>
|
{{ $filters.unitPrice(row.price, "¥") }}</span>
|
||||||
<span v-else>{{ row.couponDiscount }}折</span>
|
<span v-else>{{ row.couponDiscount }}折</span>
|
||||||
</span>
|
</span>
|
||||||
@@ -118,7 +118,7 @@
|
|||||||
<el-table-column label="优惠券类型" width="120">
|
<el-table-column label="优惠券类型" width="120">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag v-if="row" :type="couponTypeTagType(row.couponType)">
|
<el-tag v-if="row" :type="couponTypeTagType(row.couponType)">
|
||||||
{{ couponTypeText(row.couponType) }}
|
{{ couponTypeText(row) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -362,12 +362,10 @@ function getTypeTagType(type) {
|
|||||||
};
|
};
|
||||||
return map[type] || "";
|
return map[type] || "";
|
||||||
}
|
}
|
||||||
function couponTypeText(type) {
|
function couponTypeText(row) {
|
||||||
const map = {
|
if (row.couponType === "DISCOUNT") return "满折优惠券";
|
||||||
DISCOUNT: "打折",
|
if (row.couponType === "PRICE") return Number(row.consumeThreshold) === 0 ? "立减优惠券" : "满减优惠券";
|
||||||
PRICE: "减免现金",
|
return "未知";
|
||||||
};
|
|
||||||
return map[type] || "未知";
|
|
||||||
}
|
}
|
||||||
function couponTypeTagType(type) {
|
function couponTypeTagType(type) {
|
||||||
const map = {
|
const map = {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -67,7 +67,7 @@
|
|||||||
<el-table-column label="面额/折扣" width="100">
|
<el-table-column label="面额/折扣" width="100">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<priceColorScheme
|
<priceColorScheme
|
||||||
v-if="row && row.price"
|
v-if="row && row.couponType === 'PRICE'"
|
||||||
:value="row.price"
|
:value="row.price"
|
||||||
:color="$mainColor"
|
:color="$mainColor"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -17,10 +17,10 @@
|
|||||||
style="width: 240px"
|
style="width: 240px"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="获取方式" prop="getType">
|
<el-form-item label="优惠券类型" prop="couponType">
|
||||||
<el-select v-model="searchForm.getType" placeholder="请选择" clearable style="width: 240px">
|
<el-select v-model="searchForm.couponType" placeholder="请选择" clearable style="width: 240px">
|
||||||
<el-option label="免费获取" value="FREE" />
|
<el-option label="满减优惠券" value="PRICE" />
|
||||||
<el-option label="活动获取" value="ACTIVITY" />
|
<el-option label="满折优惠券" value="DISCOUNT" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="活动状态" prop="promotionStatus">
|
<el-form-item label="活动状态" prop="promotionStatus">
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
<el-table-column label="面额/折扣" width="150">
|
<el-table-column label="面额/折扣" width="150">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<span v-if="row">
|
<span v-if="row">
|
||||||
<span v-if="row.price" :style="{ color: $mainColor }">
|
<span v-if="row.couponType === 'PRICE'" :style="{ color: $mainColor }">
|
||||||
{{ $filters.unitPrice(row.price, "¥") }}</span>
|
{{ $filters.unitPrice(row.price, "¥") }}</span>
|
||||||
<span v-else>{{ row.couponDiscount }}折</span>
|
<span v-else>{{ row.couponDiscount }}折</span>
|
||||||
</span>
|
</span>
|
||||||
@@ -94,21 +94,17 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="获取方式" width="120">
|
<el-table-column label="获取方式" width="120">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag v-if="row" :type="getTypeTagType(row.getType)">{{ getTypeText(row.getType) }}</el-tag>
|
<span v-if="row">{{ getTypeText(row.getType) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="优惠券类型" width="120">
|
<el-table-column label="优惠券类型" width="120">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag v-if="row" :type="couponTypeTagType(row.couponType)">
|
<span v-if="row">{{ couponTypeText(row) }}</span>
|
||||||
{{ couponTypeText(row.couponType) }}
|
|
||||||
</el-tag>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="品类描述" width="120">
|
<el-table-column label="品类描述" width="120">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag v-if="row" :type="scopeTypeTagType(row.scopeType)">
|
<span v-if="row">{{ scopeTypeText(row.scopeType) }}</span>
|
||||||
{{ scopeTypeText(row.scopeType) }}
|
|
||||||
</el-tag>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="活动时间" width="200">
|
<el-table-column label="活动时间" width="200">
|
||||||
@@ -124,9 +120,7 @@
|
|||||||
fixed="right"
|
fixed="right"
|
||||||
>
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag v-if="row" :type="promotionStatusTagType(row.promotionStatus)">
|
<span v-if="row">{{ promotionStatusText(row.promotionStatus) }}</span>
|
||||||
{{ promotionStatusText(row.promotionStatus) }}
|
|
||||||
</el-tag>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
@@ -269,15 +263,6 @@ function promotionStatusText(status) {
|
|||||||
return map[status] || "未知";
|
return map[status] || "未知";
|
||||||
}
|
}
|
||||||
|
|
||||||
function promotionStatusTagType(status) {
|
|
||||||
const map = {
|
|
||||||
NEW: "info",
|
|
||||||
START: "success",
|
|
||||||
END: "danger",
|
|
||||||
CLOSE: "danger",
|
|
||||||
};
|
|
||||||
return map[status] || "danger";
|
|
||||||
}
|
|
||||||
|
|
||||||
function scopeTypeText(type) {
|
function scopeTypeText(type) {
|
||||||
const map = {
|
const map = {
|
||||||
@@ -289,15 +274,6 @@ function scopeTypeText(type) {
|
|||||||
return map[type] || "未知";
|
return map[type] || "未知";
|
||||||
}
|
}
|
||||||
|
|
||||||
function scopeTypeTagType(type) {
|
|
||||||
const map = {
|
|
||||||
ALL: "info",
|
|
||||||
PORTION_GOODS_CATEGORY: "warning",
|
|
||||||
PORTION_SHOP_CATEGORY: "warning",
|
|
||||||
PORTION_GOODS: "primary",
|
|
||||||
};
|
|
||||||
return map[type] || "danger";
|
|
||||||
}
|
|
||||||
|
|
||||||
function getTypeText(type) {
|
function getTypeText(type) {
|
||||||
const map = {
|
const map = {
|
||||||
@@ -309,31 +285,13 @@ function getTypeText(type) {
|
|||||||
return map[type] || "未知";
|
return map[type] || "未知";
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTypeTagType(type) {
|
|
||||||
const map = {
|
function couponTypeText(row) {
|
||||||
FREE: "danger",
|
if (row.couponType === "DISCOUNT") return "满折优惠券";
|
||||||
ACTIVITY: "warning",
|
if (row.couponType === "PRICE") return Number(row.consumeThreshold) === 0 ? "立减优惠券" : "满减优惠券";
|
||||||
INSIDE: "success",
|
return "未知";
|
||||||
IGAME: "success",
|
|
||||||
};
|
|
||||||
return map[type] || "info";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function couponTypeText(type) {
|
|
||||||
const map = {
|
|
||||||
DISCOUNT: "打折",
|
|
||||||
PRICE: "减免现金",
|
|
||||||
};
|
|
||||||
return map[type] || "未知";
|
|
||||||
}
|
|
||||||
|
|
||||||
function couponTypeTagType(type) {
|
|
||||||
const map = {
|
|
||||||
DISCOUNT: "primary",
|
|
||||||
PRICE: "info",
|
|
||||||
};
|
|
||||||
return map[type] || "info";
|
|
||||||
}
|
|
||||||
|
|
||||||
function isSameSelection(next, current) {
|
function isSameSelection(next, current) {
|
||||||
const a = next || [];
|
const a = next || [];
|
||||||
|
|||||||
Reference in New Issue
Block a user