fix: 营销中心增加跳转超级会员,超级会员页面选择优惠券调整
This commit is contained in:
parent
d950aef4e5
commit
6cc879f066
|
|
@ -0,0 +1,14 @@
|
||||||
|
import request from "@/utils/request";
|
||||||
|
import { Market_BaseUrl } from "@/api/config";
|
||||||
|
const baseURL = Market_BaseUrl + "/admin/coupon";
|
||||||
|
const API = {
|
||||||
|
getList(params: any) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/page`,
|
||||||
|
method: "get",
|
||||||
|
params
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
export default API;
|
||||||
|
|
||||||
|
|
@ -22,74 +22,121 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import defaultIcon from '@/assets/logo.png';
|
import defaultIcon from "@/assets/logo.png";
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from "element-plus";
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const to = (item) => {
|
const to = (item) => {
|
||||||
if (!item.pathName) {
|
if (!item.pathName) {
|
||||||
ElMessage.warning('暂未开放')
|
ElMessage.warning("暂未开放");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
router.push({
|
router.push({
|
||||||
name: item.pathName
|
name: item.pathName,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const menus = ref([
|
const menus = ref([
|
||||||
{
|
{
|
||||||
label: '营销',
|
label: "营销",
|
||||||
list: [
|
list: [
|
||||||
{ name: "霸王餐", icon: 'bwc', pathName: "bwc", intro: '设置充值消费的N倍,当前订单立即免单' },
|
{
|
||||||
{ name: "邀请列表", icon: 'yqlb', pathName: "invite", intro: '邀请好友领券' },
|
name: "霸王餐",
|
||||||
{ name: "积分锁客", icon: 'jfsk', pathName: "points", intro: '设置充值消费的N倍,当前订单立即免单' },
|
icon: "bwc",
|
||||||
{ name: "充值活动", icon: 'czhd', pathName: "", intro: '允许客户充值并使用余额支付' },
|
pathName: "bwc",
|
||||||
{ name: "弹窗广告", icon: 'tcgg', pathName: "", intro: '设置弹窗广告' },
|
intro: "设置充值消费的N倍,当前订单立即免单",
|
||||||
{ name: "超级会员", icon: 'cjhy', pathName: "", intro: '用户会员管理设置' },
|
},
|
||||||
{ name: "新客立减", icon: 'xklj', pathName: "", intro: '首单下单减免金额' },
|
{ name: "邀请列表", icon: "yqlb", pathName: "invite", intro: "邀请好友领券" },
|
||||||
{ name: "智慧充值", icon: 'zhcz', pathName: "", intro: '允许客户充值并使用余额支付' },
|
{
|
||||||
{ name: "分销", icon: 'zhcz', pathName: "", intro: '允许客户充值并使用余额支付' },
|
name: "积分锁客",
|
||||||
{ name: "消费返现", icon: 'xffx', pathName: "", intro: '用户下单后返现一定的金额到余额,可促进复购' },
|
icon: "jfsk",
|
||||||
{ name: "私域引流", icon: 'syyl', pathName: "", intro: '可设置用户下单成功后的群二维码' },
|
pathName: "points",
|
||||||
{ name: "满减活动", icon: 'mjhd', pathName: "", intro: '达到指定支付金额享受减价' },
|
intro: "设置充值消费的N倍,当前订单立即免单",
|
||||||
{ name: "生日有礼", icon: 'sryl', pathName: "", intro: '用户生日管理设置' },
|
},
|
||||||
{ name: "点餐智能推荐", icon: 'dczntj', pathName: "", intro: '进入点单页X秒未点自动推荐商品,此推荐设置启用即生效' },
|
{ name: "充值活动", icon: "czhd", pathName: "", intro: "允许客户充值并使用余额支付" },
|
||||||
{ name: "超值券包", icon: 'czqb', pathName: "", intro: '下单加购' },
|
{ name: "弹窗广告", icon: "tcgg", pathName: "", intro: "设置弹窗广告" },
|
||||||
{ name: "套餐推广", icon: 'tctg', pathName: "", intro: '下单通过用户邀请好友减免金额的方式裂变宣传套餐加购' },
|
{ name: "超级会员", icon: "cjhy", pathName: "superVip", intro: "用户会员管理设置" },
|
||||||
{ name: "充值兑换码", icon: 'czdhm', pathName: "", intro: '兑换码直充余额,可当作礼品赠送' },
|
{ name: "新客立减", icon: "xklj", pathName: "", intro: "首单下单减免金额" },
|
||||||
{ name: "券兑换码", icon: 'qdhm', pathName: "", intro: '可添加多券组合兑换' },
|
{ name: "智慧充值", icon: "zhcz", pathName: "", intro: "允许客户充值并使用余额支付" },
|
||||||
{ name: "限时折扣", icon: 'xszk', pathName: "", intro: '批量设置商品折扣' },
|
{ name: "分销", icon: "zhcz", pathName: "", intro: "允许客户充值并使用余额支付" },
|
||||||
{ name: "商品拼团", icon: 'sppt', pathName: "", intro: '拼团' },
|
{
|
||||||
]
|
name: "消费返现",
|
||||||
|
icon: "xffx",
|
||||||
|
pathName: "",
|
||||||
|
intro: "用户下单后返现一定的金额到余额,可促进复购",
|
||||||
|
},
|
||||||
|
{ name: "私域引流", icon: "syyl", pathName: "", intro: "可设置用户下单成功后的群二维码" },
|
||||||
|
{ name: "满减活动", icon: "mjhd", pathName: "", intro: "达到指定支付金额享受减价" },
|
||||||
|
{ name: "生日有礼", icon: "sryl", pathName: "", intro: "用户生日管理设置" },
|
||||||
|
{
|
||||||
|
name: "点餐智能推荐",
|
||||||
|
icon: "dczntj",
|
||||||
|
pathName: "",
|
||||||
|
intro: "进入点单页X秒未点自动推荐商品,此推荐设置启用即生效",
|
||||||
|
},
|
||||||
|
{ name: "超值券包", icon: "czqb", pathName: "", intro: "下单加购" },
|
||||||
|
{
|
||||||
|
name: "套餐推广",
|
||||||
|
icon: "tctg",
|
||||||
|
pathName: "",
|
||||||
|
intro: "下单通过用户邀请好友减免金额的方式裂变宣传套餐加购",
|
||||||
|
},
|
||||||
|
{ name: "充值兑换码", icon: "czdhm", pathName: "", intro: "兑换码直充余额,可当作礼品赠送" },
|
||||||
|
{ name: "券兑换码", icon: "qdhm", pathName: "", intro: "可添加多券组合兑换" },
|
||||||
|
{ name: "限时折扣", icon: "xszk", pathName: "", intro: "批量设置商品折扣" },
|
||||||
|
{ name: "商品拼团", icon: "sppt", pathName: "", intro: "拼团" },
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '优惠券',
|
label: "优惠券",
|
||||||
list: [
|
list: [
|
||||||
{ name: "满减券", icon: 'mjq', pathName: "coupon", intro: '用户满足指定金额后,可使用优惠券立减相应金额,如:设置满100-50券,符合要求的订单满100元后,立减50元。' },
|
{
|
||||||
{ name: "商品兑换券", icon: 'spdhq', pathName: "bwc", intro: '设置可兑换成商品的券' },
|
name: "满减券",
|
||||||
{ name: "折扣券", icon: 'zkq', pathName: "", intro: '下单享折扣但折扣的金额将在券中抵扣。' },
|
icon: "mjq",
|
||||||
{ name: "第二件半价券", icon: 'dejbjq', pathName: "", intro: '设置第二件半价券' },
|
pathName: "coupon",
|
||||||
{ name: "消费赠券", icon: 'xfzq', pathName: "consume_ticket", intro: '达到指定消费金额赠送优惠券' },
|
intro:
|
||||||
{ name: "买一送一券", icon: 'myzy', pathName: "", intro: '针对营销活动买一送一设置券品' },
|
"用户满足指定金额后,可使用优惠券立减相应金额,如:设置满100-50券,符合要求的订单满100元后,立减50元。",
|
||||||
{ name: "固定价格券", icon: 'gdjkq', pathName: "", intro: '设置该券后,允许用户以固定价格兑换指定商品,如:设置一个固定价格9.9的券,商品20元,用户使用券后只需要9.9元兑换该商品。' },
|
},
|
||||||
{ name: "免配送费券", icon: 'mfpsq', pathName: "", intro: '可设置一张免除订单配送费的券' },
|
{ name: "商品兑换券", icon: "spdhq", pathName: "bwc", intro: "设置可兑换成商品的券" },
|
||||||
]
|
{ name: "折扣券", icon: "zkq", pathName: "", intro: "下单享折扣但折扣的金额将在券中抵扣。" },
|
||||||
|
{ name: "第二件半价券", icon: "dejbjq", pathName: "", intro: "设置第二件半价券" },
|
||||||
|
{
|
||||||
|
name: "消费赠券",
|
||||||
|
icon: "xfzq",
|
||||||
|
pathName: "consume_ticket",
|
||||||
|
intro: "达到指定消费金额赠送优惠券",
|
||||||
|
},
|
||||||
|
{ name: "买一送一券", icon: "myzy", pathName: "", intro: "针对营销活动买一送一设置券品" },
|
||||||
|
{
|
||||||
|
name: "固定价格券",
|
||||||
|
icon: "gdjkq",
|
||||||
|
pathName: "",
|
||||||
|
intro:
|
||||||
|
"设置该券后,允许用户以固定价格兑换指定商品,如:设置一个固定价格9.9的券,商品20元,用户使用券后只需要9.9元兑换该商品。",
|
||||||
|
},
|
||||||
|
{ name: "免配送费券", icon: "mfpsq", pathName: "", intro: "可设置一张免除订单配送费的券" },
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '推送功能',
|
label: "推送功能",
|
||||||
list: [
|
list: [
|
||||||
{ name: "推送活动消息", icon: 'tshdxx', pathName: "", intro: '给用户推送服务通知' },
|
{ name: "推送活动消息", icon: "tshdxx", pathName: "", intro: "给用户推送服务通知" },
|
||||||
{ name: "短信推送", icon: 'dxts', pathName: "", intro: '给用户推送服务通知' },
|
{ name: "短信推送", icon: "dxts", pathName: "", intro: "给用户推送服务通知" },
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '扩展功能',
|
label: "扩展功能",
|
||||||
list: [
|
list: [
|
||||||
{ name: "微信公众号", icon: 'wxgzh', pathName: "", intro: '授权微信公众号后,让你能够在后台查看和维护公众号的粉丝;同时你的店铺也有出现关注公众号的入口。' },
|
{
|
||||||
]
|
name: "微信公众号",
|
||||||
}
|
icon: "wxgzh",
|
||||||
|
pathName: "",
|
||||||
|
intro:
|
||||||
|
"授权微信公众号后,让你能够在后台查看和维护公众号的粉丝;同时你的店铺也有出现关注公众号的入口。",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
// 动态获取PNG图标路径
|
// 动态获取PNG图标路径
|
||||||
const getIconPath = (iconName) => {
|
const getIconPath = (iconName) => {
|
||||||
try {
|
try {
|
||||||
|
|
@ -132,7 +179,7 @@ const handleImageError = (item) => {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
background-color: #F8F8F8;
|
background-color: #f8f8f8;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
transition: all 0.1s ease-in-out;
|
transition: all 0.1s ease-in-out;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,15 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div v-for="(item, index) in modelValue" :key="index" class="flex gap-4 mb-2">
|
<div v-for="(item, index) in modelValue" :key="index" class="flex gap-4 mb-2">
|
||||||
<el-select v-model="item.coupon.id" placeholder="请选择优惠券">
|
<el-select
|
||||||
|
v-model="item.coupon.id"
|
||||||
|
placeholder="请选择优惠券"
|
||||||
|
@change="changeCoupon($event, index)"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="coupon in couponList"
|
v-for="coupon in couponList"
|
||||||
:key="coupon.id"
|
:key="coupon.id"
|
||||||
:label="coupon.name"
|
:label="coupon.title"
|
||||||
:value="coupon.id"
|
:value="coupon.id"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
@ -23,6 +27,7 @@
|
||||||
</el-link>
|
</el-link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="flex">
|
||||||
<div class="flex gap-1 cursor-pointer" @click="addCoupon()">
|
<div class="flex gap-1 cursor-pointer" @click="addCoupon()">
|
||||||
<el-icon color="#3F9EFF">
|
<el-icon color="#3F9EFF">
|
||||||
<CirclePlus />
|
<CirclePlus />
|
||||||
|
|
@ -30,20 +35,31 @@
|
||||||
<el-link :underline="false" type="primary" class="no-wrap">新增券</el-link>
|
<el-link :underline="false" type="primary" class="no-wrap">新增券</el-link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive } from "vue";
|
import couponApi from "@/api/market/coupon";
|
||||||
|
|
||||||
|
import { ref, reactive, onMounted } from "vue";
|
||||||
const modelValue = defineModel({
|
const modelValue = defineModel({
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
});
|
});
|
||||||
|
|
||||||
// 优惠券列表
|
// 优惠券列表
|
||||||
const couponList = ref([
|
const couponList = ref([]);
|
||||||
{ id: 1, name: "满100减10" },
|
|
||||||
{ id: 2, name: "满200减30" },
|
|
||||||
]);
|
|
||||||
function addCoupon() {
|
function addCoupon() {
|
||||||
|
if (!modelValue.value) {
|
||||||
|
modelValue.value = [
|
||||||
|
{
|
||||||
|
num: 1,
|
||||||
|
coupon: {
|
||||||
|
id: null,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
return;
|
||||||
|
}
|
||||||
modelValue.value.push({
|
modelValue.value.push({
|
||||||
num: 1,
|
num: 1,
|
||||||
coupon: {
|
coupon: {
|
||||||
|
|
@ -52,4 +68,18 @@ function addCoupon() {
|
||||||
});
|
});
|
||||||
console.log(modelValue.value);
|
console.log(modelValue.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
couponApi.getList({ size: 999 }).then((res) => {
|
||||||
|
if (res) {
|
||||||
|
couponList.value = res.records || [];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function changeCoupon(e, index) {
|
||||||
|
const coupon = couponList.value.find((item) => item.id === e);
|
||||||
|
console.log(coupon);
|
||||||
|
modelValue.value[index].coupon = coupon;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -12,15 +12,7 @@
|
||||||
<el-input v-model="form.reward" placeholder="开通后立刻获得经验" type="number" />
|
<el-input v-model="form.reward" placeholder="开通后立刻获得经验" type="number" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="赠送优惠券">
|
<el-form-item label="赠送优惠券">
|
||||||
<div>
|
<CouponLists v-model="form.couponList" />
|
||||||
<div></div>
|
|
||||||
<div class="flex gap-1">
|
|
||||||
<el-icon color="#3F9EFF">
|
|
||||||
<CirclePlus />
|
|
||||||
</el-icon>
|
|
||||||
<el-text type="primary">新增券</el-text>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="周期时间" required>
|
<el-form-item label="周期时间" required>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
|
|
@ -48,7 +40,9 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from "vue";
|
import CouponLists from "./coup-lists.vue";
|
||||||
|
|
||||||
|
import { ref, toRaw } from "vue";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
// 控制主弹窗显示
|
// 控制主弹窗显示
|
||||||
const show = ref(false);
|
const show = ref(false);
|
||||||
|
|
@ -123,6 +117,11 @@ function submit() {
|
||||||
ElMessage.error("请选择会员周期");
|
ElMessage.error("请选择会员周期");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const ispass = form.value.couponList.every((item) => item.num && item.coupon.id);
|
||||||
|
if (!ispass) {
|
||||||
|
ElMessage.error("请选择优惠券并输入数量");
|
||||||
|
return;
|
||||||
|
}
|
||||||
console.log("提交表单数据:", form.value);
|
console.log("提交表单数据:", form.value);
|
||||||
emits("submitSuccess", form.value, dataIndex);
|
emits("submitSuccess", form.value, dataIndex);
|
||||||
// 在此处可以添加表单提交逻辑,例如调用 API
|
// 在此处可以添加表单提交逻辑,例如调用 API
|
||||||
|
|
@ -132,6 +131,7 @@ function submit() {
|
||||||
let isedit = ref(false);
|
let isedit = ref(false);
|
||||||
let dataIndex = null;
|
let dataIndex = null;
|
||||||
function open(data, index) {
|
function open(data, index) {
|
||||||
|
data = toRaw(data);
|
||||||
console.log("data", data);
|
console.log("data", data);
|
||||||
console.log("index", index);
|
console.log("index", index);
|
||||||
if (data) {
|
if (data) {
|
||||||
|
|
|
||||||
|
|
@ -213,8 +213,9 @@
|
||||||
<el-form-item label="等级说明">
|
<el-form-item label="等级说明">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="level.remark"
|
v-model="level.remark"
|
||||||
|
style="width: 400px"
|
||||||
|
:autosize="{ minRows: 4, maxRows: 5 }"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
maxlength="250"
|
|
||||||
placeholder="请输入等级说明,最多 250 字"
|
placeholder="请输入等级说明,最多 250 字"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -352,7 +353,7 @@ function submitSuccess(plans, index) {
|
||||||
if (!basicForm.configList) {
|
if (!basicForm.configList) {
|
||||||
basicForm.configList = [];
|
basicForm.configList = [];
|
||||||
}
|
}
|
||||||
if (index) {
|
if (index !== null && index !== undefined) {
|
||||||
basicForm.configList[index] = plans;
|
basicForm.configList[index] = plans;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -398,7 +399,6 @@ function addLevel() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const newLevel = {
|
const newLevel = {
|
||||||
id: 0,
|
|
||||||
name,
|
name,
|
||||||
experienceValue: 0,
|
experienceValue: 0,
|
||||||
discount: 1,
|
discount: 1,
|
||||||
|
|
@ -425,21 +425,25 @@ function editLevel(level) {
|
||||||
async function removeLevel(index) {
|
async function removeLevel(index) {
|
||||||
const item = levels.value[index];
|
const item = levels.value[index];
|
||||||
const { id } = item;
|
const { id } = item;
|
||||||
|
if (!id) {
|
||||||
|
// 本地删除
|
||||||
|
levels.value.splice(index, 1);
|
||||||
|
const newLevel = levels.value[index - 1];
|
||||||
|
selectedLevel.value = newLevel;
|
||||||
|
activeLevelId.value = index - 1;
|
||||||
|
ElMessage.success("删除成功");
|
||||||
|
return;
|
||||||
|
}
|
||||||
ElMessageBox.confirm("确定要删除吗?", "提示", {
|
ElMessageBox.confirm("确定要删除吗?", "提示", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
}).then(async () => {
|
}).then(async () => {
|
||||||
if (id) {
|
|
||||||
const res = await memberApi.levelDel({ id: id });
|
const res = await memberApi.levelDel({ id: id });
|
||||||
if (res) {
|
if (res) {
|
||||||
levels.value.splice(index, 1);
|
levels.value.splice(index, 1);
|
||||||
ElMessage.success("删除成功");
|
ElMessage.success("删除成功");
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
levels.value.splice(index, 1);
|
|
||||||
ElMessage.success("删除成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
const newLevel = levels.value[index - 1];
|
const newLevel = levels.value[index - 1];
|
||||||
selectedLevel.value = newLevel;
|
selectedLevel.value = newLevel;
|
||||||
|
|
@ -448,6 +452,11 @@ async function removeLevel(index) {
|
||||||
}
|
}
|
||||||
// 保存会员等级
|
// 保存会员等级
|
||||||
async function saveLevel(level) {
|
async function saveLevel(level) {
|
||||||
|
const isPass = level.cycleRewardCouponList.every((item) => item.num && item.coupon.id);
|
||||||
|
if (!isPass) {
|
||||||
|
ElMessage.error("请选择优惠券并输入数量");
|
||||||
|
return;
|
||||||
|
}
|
||||||
const res = level.id ? await memberApi.levelEdit(level) : await memberApi.levelAdd(level);
|
const res = level.id ? await memberApi.levelEdit(level) : await memberApi.levelAdd(level);
|
||||||
if (res) {
|
if (res) {
|
||||||
ElMessage.success("保存成功");
|
ElMessage.success("保存成功");
|
||||||
|
|
@ -502,7 +511,7 @@ onMounted(() => {
|
||||||
//计算总优惠券数量
|
//计算总优惠券数量
|
||||||
function totalCount(arr) {
|
function totalCount(arr) {
|
||||||
return arr.reduce((total, item) => {
|
return arr.reduce((total, item) => {
|
||||||
return total + item.num;
|
return total + item.num * 1;
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
//返回
|
//返回
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue