Compare commits
5 Commits
106d0cb1e7
...
d950aef4e5
| Author | SHA1 | Date |
|---|---|---|
|
|
d950aef4e5 | |
|
|
ea4230a9e8 | |
|
|
1004defd02 | |
|
|
2710f276e3 | |
|
|
83eaf368ca |
|
|
@ -8,3 +8,4 @@ export const Account_BaseUrl = "account";
|
||||||
export const Order_BaseUrl = "order";
|
export const Order_BaseUrl = "order";
|
||||||
export const Product_BaseUrl = "product";
|
export const Product_BaseUrl = "product";
|
||||||
export const System_BaseUrl = "system";
|
export const System_BaseUrl = "system";
|
||||||
|
export const Market_BaseUrl = "market";
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,240 @@
|
||||||
|
import request from "@/utils/request";
|
||||||
|
import { Market_BaseUrl } from "@/api/config";
|
||||||
|
const baseURL = Market_BaseUrl + "/admin/member";
|
||||||
|
const API = {
|
||||||
|
getConfig(params: any) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}`,
|
||||||
|
method: "get",
|
||||||
|
params
|
||||||
|
});
|
||||||
|
},
|
||||||
|
editConfig(data: editRequest) {
|
||||||
|
return request({
|
||||||
|
url: `${baseURL}`,
|
||||||
|
method: "post",
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
levelAdd(data: levelAddRequest) {
|
||||||
|
return request({
|
||||||
|
url: `${baseURL}/level`,
|
||||||
|
method: "post",
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
levelEdit(data: levelEditRequest) {
|
||||||
|
return request({
|
||||||
|
url: `${baseURL}/level`,
|
||||||
|
method: "put",
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
levelDel(data: levelDelRequest) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/level/${data.id}`,
|
||||||
|
method: "delete",
|
||||||
|
// data
|
||||||
|
});
|
||||||
|
},
|
||||||
|
levelList(params: any) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/level/list`,
|
||||||
|
method: "get",
|
||||||
|
params
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
export default API;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MemberConfigDTO
|
||||||
|
*/
|
||||||
|
export interface editRequest {
|
||||||
|
/**
|
||||||
|
* 条件开通条件项
|
||||||
|
*/
|
||||||
|
conditionList?: Condition[] | null;
|
||||||
|
/**
|
||||||
|
* 金额购买方案列表
|
||||||
|
*/
|
||||||
|
configList?: ConfigList[] | null;
|
||||||
|
/**
|
||||||
|
* 每消费一元经验值
|
||||||
|
*/
|
||||||
|
costReward?: number | null;
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
id: number | null;
|
||||||
|
/**
|
||||||
|
* 是否享受会员价
|
||||||
|
*/
|
||||||
|
isMemberPrice: number | null;
|
||||||
|
/**
|
||||||
|
* 是否开启
|
||||||
|
*/
|
||||||
|
isOpen: string;
|
||||||
|
/**
|
||||||
|
* 提交生日/姓名
|
||||||
|
*/
|
||||||
|
isSubmitInfo: number | null;
|
||||||
|
/**
|
||||||
|
* 参与会员价门店
|
||||||
|
*/
|
||||||
|
memberPriceShopIdList?: number[] | null;
|
||||||
|
/**
|
||||||
|
* 每充值一元经验值
|
||||||
|
*/
|
||||||
|
rechargeReward?: number | null;
|
||||||
|
/**
|
||||||
|
* 规则说明
|
||||||
|
*/
|
||||||
|
remark: null | string;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* com.czg.account.dto.MemberConfigDTO.condition
|
||||||
|
*
|
||||||
|
* condition
|
||||||
|
*/
|
||||||
|
export interface Condition {
|
||||||
|
code?: null | string;
|
||||||
|
value?: null | string;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* com.czg.account.dto.MemberConfigDTO.ConfigList
|
||||||
|
*
|
||||||
|
* ConfigList
|
||||||
|
*/
|
||||||
|
export interface ConfigList {
|
||||||
|
/**
|
||||||
|
* 会员周期 1月 1日
|
||||||
|
*/
|
||||||
|
circleTime: null | string;
|
||||||
|
/**
|
||||||
|
* 赠送优惠券
|
||||||
|
*/
|
||||||
|
couponIdList?: number[] | null;
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
name: null | string;
|
||||||
|
/**
|
||||||
|
* 价格
|
||||||
|
*/
|
||||||
|
price: number | null;
|
||||||
|
/**
|
||||||
|
* 赠送成长值
|
||||||
|
*/
|
||||||
|
reward?: number | null;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MemberLevelDTO
|
||||||
|
*/
|
||||||
|
export interface levelAddRequest {
|
||||||
|
/**
|
||||||
|
* 消费送积分,消费n元送1积分, 0为禁用
|
||||||
|
*/
|
||||||
|
costRewardPoints?: number | null;
|
||||||
|
/**
|
||||||
|
* 优惠券列表
|
||||||
|
*/
|
||||||
|
cycleRewardCouponList?: number[] | null;
|
||||||
|
/**
|
||||||
|
* 赠送积分
|
||||||
|
*/
|
||||||
|
cycleRewardPoints?: number | null;
|
||||||
|
/**
|
||||||
|
* 周期时间包含周 月 年 日
|
||||||
|
*/
|
||||||
|
cycleTime?: null | string;
|
||||||
|
/**
|
||||||
|
* 会员折扣
|
||||||
|
*/
|
||||||
|
discount: number | null;
|
||||||
|
/**
|
||||||
|
* 所需成长值
|
||||||
|
*/
|
||||||
|
experienceValue: number | null;
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
id?: number | null;
|
||||||
|
/**
|
||||||
|
* 周期奖励状态 0禁用 1启用
|
||||||
|
*/
|
||||||
|
isCycleReward: number | null;
|
||||||
|
/**
|
||||||
|
* logo
|
||||||
|
*/
|
||||||
|
logo?: null | string;
|
||||||
|
/**
|
||||||
|
* 会员名称
|
||||||
|
*/
|
||||||
|
name: null | string;
|
||||||
|
/**
|
||||||
|
* 描述说明
|
||||||
|
*/
|
||||||
|
remark: string;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MemberLevelDTOUpdateGroup
|
||||||
|
*/
|
||||||
|
export interface levelEditRequest {
|
||||||
|
/**
|
||||||
|
* 消费送积分,消费n元送1积分, 0为禁用
|
||||||
|
*/
|
||||||
|
costRewardPoints?: number | null;
|
||||||
|
/**
|
||||||
|
* 优惠券列表
|
||||||
|
*/
|
||||||
|
cycleRewardCouponList?: number[] | null;
|
||||||
|
/**
|
||||||
|
* 赠送积分
|
||||||
|
*/
|
||||||
|
cycleRewardPoints?: number | null;
|
||||||
|
/**
|
||||||
|
* 周期时间包含周 月 年 日
|
||||||
|
*/
|
||||||
|
cycleTime?: null | string;
|
||||||
|
/**
|
||||||
|
* 会员折扣
|
||||||
|
*/
|
||||||
|
discount?: number | null;
|
||||||
|
/**
|
||||||
|
* 所需成长值
|
||||||
|
*/
|
||||||
|
experienceValue?: number | null;
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
id: number | null;
|
||||||
|
/**
|
||||||
|
* 周期奖励状态 0禁用 1启用
|
||||||
|
*/
|
||||||
|
isCycleReward?: number | null;
|
||||||
|
/**
|
||||||
|
* logo
|
||||||
|
*/
|
||||||
|
logo?: null | string;
|
||||||
|
/**
|
||||||
|
* 会员名称
|
||||||
|
*/
|
||||||
|
name?: null | string;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface levelDelRequest {
|
||||||
|
id: number;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
|
|
@ -1,7 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<el-breadcrumb class="flex-y-center">
|
<el-breadcrumb class="flex-y-center">
|
||||||
<el-breadcrumb-item v-for="(item, index) in breadcrumbs" :key="item.path">
|
<el-breadcrumb-item v-for="(item, index) in breadcrumbs" :key="item.path">
|
||||||
<span v-if="item.redirect === 'noredirect' || index === breadcrumbs.length - 1" class="color-gray-400">
|
<span
|
||||||
|
v-if="item.redirect === 'noredirect' || index === breadcrumbs.length - 1"
|
||||||
|
class="color-gray-400"
|
||||||
|
>
|
||||||
{{ translateRouteTitle(item.meta.title) }}
|
{{ translateRouteTitle(item.meta.title) }}
|
||||||
</span>
|
</span>
|
||||||
<a v-else @click.prevent="handleLink(item)">
|
<a v-else @click.prevent="handleLink(item)">
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,23 @@ export const usePermissionStore = defineStore("permission", () => {
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
if (!isTest) {
|
if (!isTest) {
|
||||||
const dynamicRoutes = parseDynamicRoutes(data.filter(v => v.type == 0));
|
const dynamicRoutes = parseDynamicRoutes(data.filter(v => v.type == 0));
|
||||||
|
console.log('dynamicRoutes')
|
||||||
|
console.log(dynamicRoutes)
|
||||||
|
dynamicRoutes.forEach((route) => {
|
||||||
|
//过滤出可见子节点
|
||||||
|
let onlyOneChild = null
|
||||||
|
const showingChildren = route.children.filter((route) => {
|
||||||
|
if (!route.meta?.hidden) {
|
||||||
|
onlyOneChild = route;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
// 仅有一个节点
|
||||||
|
if (showingChildren.length === 1 && onlyOneChild) {
|
||||||
|
route.redirect = onlyOneChild.path;
|
||||||
|
}
|
||||||
|
})
|
||||||
routes.value = [...constantRoutes, ...dynamicRoutes];
|
routes.value = [...constantRoutes, ...dynamicRoutes];
|
||||||
isRoutesLoaded.value = true;
|
isRoutesLoaded.value = true;
|
||||||
resolve(dynamicRoutes);
|
resolve(dynamicRoutes);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,13 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="login" :style="'background-image:url(' + Background + ');'">
|
<div class="login" :style="'background-image:url(' + Background + ');'">
|
||||||
<el-form ref="loginForm" :model="state.loginForm" :rules="state.loginRules" label-position="left" label-width="0px"
|
<el-form
|
||||||
class="login-form">
|
ref="loginForm"
|
||||||
|
:model="state.loginForm"
|
||||||
|
:rules="state.loginRules"
|
||||||
|
label-position="left"
|
||||||
|
label-width="0px"
|
||||||
|
class="login-form"
|
||||||
|
>
|
||||||
<h3 class="title">银收客后台管理</h3>
|
<h3 class="title">银收客后台管理</h3>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio-group v-model="state.loginForm.loginType">
|
<el-radio-group v-model="state.loginForm.loginType">
|
||||||
|
|
@ -10,19 +16,39 @@
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="username">
|
<el-form-item prop="username">
|
||||||
<el-input v-model="state.loginForm.username" type="text" auto-complete="off" placeholder="商户号"></el-input>
|
<el-input
|
||||||
|
v-model="state.loginForm.username"
|
||||||
|
type="text"
|
||||||
|
auto-complete="off"
|
||||||
|
placeholder="商户号"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="staffUserName" v-if="state.loginForm.loginType == 1">
|
<el-form-item prop="staffUserName" v-if="state.loginForm.loginType == 1">
|
||||||
<el-input v-model="state.loginForm.staffUserName" type="text" auto-complete="off" placeholder="账号"></el-input>
|
<el-input
|
||||||
|
v-model="state.loginForm.staffUserName"
|
||||||
|
type="text"
|
||||||
|
auto-complete="off"
|
||||||
|
placeholder="账号"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="password">
|
<el-form-item prop="password">
|
||||||
<el-input v-model="state.loginForm.password" type="password" auto-complete="off" placeholder="密码"
|
<el-input
|
||||||
@keyup.enter="handleLogin"></el-input>
|
v-model="state.loginForm.password"
|
||||||
|
type="password"
|
||||||
|
auto-complete="off"
|
||||||
|
placeholder="密码"
|
||||||
|
@keyup.enter="handleLogin"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="code">
|
<el-form-item prop="code">
|
||||||
<div class="code_wrap">
|
<div class="code_wrap">
|
||||||
<el-input v-model="state.loginForm.code" auto-complete="off" placeholder="验证码" style="width: 63%"
|
<el-input
|
||||||
@keyup.enter="handleLogin"></el-input>
|
v-model="state.loginForm.code"
|
||||||
|
auto-complete="off"
|
||||||
|
placeholder="验证码"
|
||||||
|
style="width: 63%"
|
||||||
|
@keyup.enter="handleLogin"
|
||||||
|
></el-input>
|
||||||
<div class="login-code">
|
<div class="login-code">
|
||||||
<img :src="state.codeUrl" @click="getCode" />
|
<img :src="state.codeUrl" @click="getCode" />
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -30,8 +56,13 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item style="width: 100%">
|
<el-form-item style="width: 100%">
|
||||||
<el-button :loading="state.loading" size="default" type="primary" style="width: 100%"
|
<el-button
|
||||||
@click.prevent="handleLogin">
|
:loading="state.loading"
|
||||||
|
size="default"
|
||||||
|
type="primary"
|
||||||
|
style="width: 100%"
|
||||||
|
@click.prevent="handleLogin"
|
||||||
|
>
|
||||||
<span v-if="!state.loading">登 录</span>
|
<span v-if="!state.loading">登 录</span>
|
||||||
<span v-else>登 录 中...</span>
|
<span v-else>登 录 中...</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
@ -168,14 +199,16 @@ function handleLogin() {
|
||||||
token,
|
token,
|
||||||
}).then((checkInfo) => {
|
}).then((checkInfo) => {
|
||||||
console.log("checkInfo", checkInfo);
|
console.log("checkInfo", checkInfo);
|
||||||
userStore.meituan_douyin_info = checkInfo.userInfo;
|
if (checkInfo && checkInfo.userInfo) {
|
||||||
setDouyinToken(checkInfo.userInfo.token);
|
userStore.meituan_douyin_info = checkInfo.userInfo;
|
||||||
|
setDouyinToken(checkInfo.userInfo.token);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
localStorage.removeItem("shopName")
|
localStorage.removeItem("shopName");
|
||||||
let resData = await $API_login.getPermission()
|
let resData = await $API_login.getPermission();
|
||||||
localStorage.setItem("permission",JSON.stringify(resData))
|
localStorage.setItem("permission", JSON.stringify(resData));
|
||||||
localStorage.setItem("loginType",state.loginForm.loginType)
|
localStorage.setItem("loginType", state.loginForm.loginType);
|
||||||
|
|
||||||
const { path, queryParams } = parseRedirect();
|
const { path, queryParams } = parseRedirect();
|
||||||
console.log(path, queryParams);
|
console.log(path, queryParams);
|
||||||
// router.replace({ path: path, query: queryParams });
|
// router.replace({ path: path, query: queryParams });
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,96 @@
|
||||||
|
<template>
|
||||||
|
<div class="item">
|
||||||
|
<img :src="getIconPath(props.icon)" class="icon" />
|
||||||
|
<div class="info">
|
||||||
|
<div class="name">{{ props.name }}</div>
|
||||||
|
<div class="intro">
|
||||||
|
{{ props.intro }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="ml-30">
|
||||||
|
<el-switch v-model="isOpen" v-if="props.showSwitch" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import defaultIcon from "@/assets/logo.png";
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
icon: {
|
||||||
|
type: String,
|
||||||
|
defautl: "",
|
||||||
|
},
|
||||||
|
name: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
intro: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
showSwitch: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const isOpen = defineModel("isOpen", {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 动态获取PNG图标路径
|
||||||
|
const getIconPath = (iconName) => {
|
||||||
|
try {
|
||||||
|
// 直接导入对应PNG文件
|
||||||
|
return new URL(`/src/assets/applocation/${iconName}.png`, import.meta.url).href;
|
||||||
|
} catch (error) {
|
||||||
|
console.warn(`图标 ${iconName}.png 不存在`);
|
||||||
|
return defaultIcon; // 图标不存在时使用默认图标
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 10px;
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
border-radius: 4px;
|
||||||
|
transition: all 0.1s ease-in-out;
|
||||||
|
|
||||||
|
// &:hover {
|
||||||
|
// cursor: pointer;
|
||||||
|
// background-color: #d5ebff;
|
||||||
|
// }
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: 48px;
|
||||||
|
height: 48px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
.name {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.intro {
|
||||||
|
margin-top: 4px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #666;
|
||||||
|
line-height: 1.4em;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-line-clamp: 1;
|
||||||
|
line-clamp: 1;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
word-break: break-all;
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
<!-- 消费赠券 -->
|
||||||
|
<template>
|
||||||
|
<div class="app_main">
|
||||||
|
<div class="card">
|
||||||
|
<headerCard icon="xfzq" name="消费赠券" intro="达到指定消费金额赠送优惠券" />
|
||||||
|
<div class="tab_wrap">
|
||||||
|
<div class="row">
|
||||||
|
<el-button type="primary">新增消费赠券</el-button>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<el-table :data="tableData.list" border stripe>
|
||||||
|
<el-table-column prop="id" label="ID" width="180" />
|
||||||
|
<el-table-column prop="name" label="规则名称" width="180" />
|
||||||
|
<el-table-column prop="condition" label="消费条件" width="180" />
|
||||||
|
<el-table-column prop="coupon" label="赠送券" width="180" />
|
||||||
|
<el-table-column prop="status" label="状态" width="100" />
|
||||||
|
<el-table-column prop="created_at" label="创建时间" width="180" />
|
||||||
|
<el-table-column prop="actions" label="操作">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button type="text" size="small">编辑</el-button>
|
||||||
|
<el-button type="text" size="small">删除</el-button>
|
||||||
|
<el-button type="text" size="small">查看</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import headerCard from '@/views/marketing_center/components/headerCard.vue';
|
||||||
|
|
||||||
|
import { ref, reactive } from 'vue';
|
||||||
|
|
||||||
|
const tableData = reactive({
|
||||||
|
page: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
total: 0,
|
||||||
|
list: [],
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.app_main {
|
||||||
|
padding: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 14px;
|
||||||
|
|
||||||
|
.tab_wrap {
|
||||||
|
padding-top: 14px;
|
||||||
|
|
||||||
|
.row {
|
||||||
|
padding-top: 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -27,62 +27,64 @@ import { ElMessage } from 'element-plus'
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const to = (item) => {
|
const to = (item) => {
|
||||||
if (!item.path) {
|
if (!item.pathName) {
|
||||||
ElMessage.warning('暂未开放')
|
ElMessage.warning('暂未开放')
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
router.push("/application/" + item.path);
|
router.push({
|
||||||
|
name: item.pathName
|
||||||
|
});
|
||||||
};
|
};
|
||||||
const menus = ref([
|
const menus = ref([
|
||||||
{
|
{
|
||||||
label: '营销',
|
label: '营销',
|
||||||
list: [
|
list: [
|
||||||
{ name: "霸王餐", icon: 'bwc', path: "bwc", intro: '设置充值消费的N倍,当前订单立即免单' },
|
{ name: "霸王餐", icon: 'bwc', pathName: "bwc", intro: '设置充值消费的N倍,当前订单立即免单' },
|
||||||
{ name: "邀请列表", icon: 'yqlb', path: "invite", intro: '邀请好友领券' },
|
{ name: "邀请列表", icon: 'yqlb', pathName: "invite", intro: '邀请好友领券' },
|
||||||
{ name: "积分锁客", icon: 'jfsk', path: "points", intro: '设置充值消费的N倍,当前订单立即免单' },
|
{ name: "积分锁客", icon: 'jfsk', pathName: "points", intro: '设置充值消费的N倍,当前订单立即免单' },
|
||||||
{ name: "充值活动", icon: 'czhd', path: "", intro: '允许客户充值并使用余额支付' },
|
{ name: "充值活动", icon: 'czhd', pathName: "", intro: '允许客户充值并使用余额支付' },
|
||||||
{ name: "弹窗广告", icon: 'tcgg', path: "", intro: '设置弹窗广告' },
|
{ name: "弹窗广告", icon: 'tcgg', pathName: "", intro: '设置弹窗广告' },
|
||||||
{ name: "超级会员", icon: 'cjhy', path: "", intro: '用户会员管理设置' },
|
{ name: "超级会员", icon: 'cjhy', pathName: "", intro: '用户会员管理设置' },
|
||||||
{ name: "新客立减", icon: 'xklj', path: "", intro: '首单下单减免金额' },
|
{ name: "新客立减", icon: 'xklj', pathName: "", intro: '首单下单减免金额' },
|
||||||
{ name: "智慧充值", icon: 'zhcz', path: "", intro: '允许客户充值并使用余额支付' },
|
{ name: "智慧充值", icon: 'zhcz', pathName: "", intro: '允许客户充值并使用余额支付' },
|
||||||
{ name: "分销", icon: 'zhcz', path: "", intro: '允许客户充值并使用余额支付' },
|
{ name: "分销", icon: 'zhcz', pathName: "", intro: '允许客户充值并使用余额支付' },
|
||||||
{ name: "消费返现", icon: 'xffx', path: "", intro: '用户下单后返现一定的金额到余额,可促进复购' },
|
{ name: "消费返现", icon: 'xffx', pathName: "", intro: '用户下单后返现一定的金额到余额,可促进复购' },
|
||||||
{ name: "私域引流", icon: 'syyl', path: "", intro: '可设置用户下单成功后的群二维码' },
|
{ name: "私域引流", icon: 'syyl', pathName: "", intro: '可设置用户下单成功后的群二维码' },
|
||||||
{ name: "满减活动", icon: 'mjhd', path: "", intro: '达到指定支付金额享受减价' },
|
{ name: "满减活动", icon: 'mjhd', pathName: "", intro: '达到指定支付金额享受减价' },
|
||||||
{ name: "生日有礼", icon: 'sryl', path: "", intro: '用户生日管理设置' },
|
{ name: "生日有礼", icon: 'sryl', pathName: "", intro: '用户生日管理设置' },
|
||||||
{ name: "点餐智能推荐", icon: 'dczntj', path: "", intro: '进入点单页X秒未点自动推荐商品,此推荐设置启用即生效' },
|
{ name: "点餐智能推荐", icon: 'dczntj', pathName: "", intro: '进入点单页X秒未点自动推荐商品,此推荐设置启用即生效' },
|
||||||
{ name: "超值券包", icon: 'czqb', path: "", intro: '下单加购' },
|
{ name: "超值券包", icon: 'czqb', pathName: "", intro: '下单加购' },
|
||||||
{ name: "套餐推广", icon: 'tctg', path: "", intro: '下单通过用户邀请好友减免金额的方式裂变宣传套餐加购' },
|
{ name: "套餐推广", icon: 'tctg', pathName: "", intro: '下单通过用户邀请好友减免金额的方式裂变宣传套餐加购' },
|
||||||
{ name: "充值兑换码", icon: 'czdhm', path: "", intro: '兑换码直充余额,可当作礼品赠送' },
|
{ name: "充值兑换码", icon: 'czdhm', pathName: "", intro: '兑换码直充余额,可当作礼品赠送' },
|
||||||
{ name: "券兑换码", icon: 'qdhm', path: "", intro: '可添加多券组合兑换' },
|
{ name: "券兑换码", icon: 'qdhm', pathName: "", intro: '可添加多券组合兑换' },
|
||||||
{ name: "限时折扣", icon: 'xszk', path: "", intro: '批量设置商品折扣' },
|
{ name: "限时折扣", icon: 'xszk', pathName: "", intro: '批量设置商品折扣' },
|
||||||
{ name: "商品拼团", icon: 'sppt', path: "", intro: '拼团' },
|
{ name: "商品拼团", icon: 'sppt', pathName: "", intro: '拼团' },
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '优惠券',
|
label: '优惠券',
|
||||||
list: [
|
list: [
|
||||||
{ name: "满减券", icon: 'mjq', path: "coupon", intro: '用户满足指定金额后,可使用优惠券立减相应金额,如:设置满100-50券,符合要求的订单满100元后,立减50元。' },
|
{ name: "满减券", icon: 'mjq', pathName: "coupon", intro: '用户满足指定金额后,可使用优惠券立减相应金额,如:设置满100-50券,符合要求的订单满100元后,立减50元。' },
|
||||||
{ name: "商品兑换券", icon: 'spdhq', path: "bwc", intro: '设置可兑换成商品的券' },
|
{ name: "商品兑换券", icon: 'spdhq', pathName: "bwc", intro: '设置可兑换成商品的券' },
|
||||||
{ name: "折扣券", icon: 'zkq', path: "", intro: '下单享折扣但折扣的金额将在券中抵扣。' },
|
{ name: "折扣券", icon: 'zkq', pathName: "", intro: '下单享折扣但折扣的金额将在券中抵扣。' },
|
||||||
{ name: "第二件半价券", icon: 'dejbjq', path: "", intro: '设置第二件半价券' },
|
{ name: "第二件半价券", icon: 'dejbjq', pathName: "", intro: '设置第二件半价券' },
|
||||||
{ name: "消费赠券", icon: 'xfzq', path: "", intro: '达到指定消费金额赠送优惠券' },
|
{ name: "消费赠券", icon: 'xfzq', pathName: "consume_ticket", intro: '达到指定消费金额赠送优惠券' },
|
||||||
{ name: "买一送一券", icon: 'myzy', path: "", intro: '针对营销活动买一送一设置券品' },
|
{ name: "买一送一券", icon: 'myzy', pathName: "", intro: '针对营销活动买一送一设置券品' },
|
||||||
{ name: "固定价格券", icon: 'gdjkq', path: "", intro: '设置该券后,允许用户以固定价格兑换指定商品,如:设置一个固定价格9.9的券,商品20元,用户使用券后只需要9.9元兑换该商品。' },
|
{ name: "固定价格券", icon: 'gdjkq', pathName: "", intro: '设置该券后,允许用户以固定价格兑换指定商品,如:设置一个固定价格9.9的券,商品20元,用户使用券后只需要9.9元兑换该商品。' },
|
||||||
{ name: "免配送费券", icon: 'mfpsq', path: "", intro: '可设置一张免除订单配送费的券' },
|
{ name: "免配送费券", icon: 'mfpsq', pathName: "", intro: '可设置一张免除订单配送费的券' },
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '推送功能',
|
label: '推送功能',
|
||||||
list: [
|
list: [
|
||||||
{ name: "推送活动消息", icon: 'tshdxx', path: "coupon", intro: '给用户推送服务通知' },
|
{ name: "推送活动消息", icon: 'tshdxx', pathName: "", intro: '给用户推送服务通知' },
|
||||||
{ name: "短信推送", icon: 'dxts', path: "bwc", intro: '给用户推送服务通知' },
|
{ name: "短信推送", icon: 'dxts', pathName: "", intro: '给用户推送服务通知' },
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '扩展功能',
|
label: '扩展功能',
|
||||||
list: [
|
list: [
|
||||||
{ name: "微信公众号", icon: 'wxgzh', path: "coupon", intro: '授权微信公众号后,让你能够在后台查看和维护公众号的粉丝;同时你的店铺也有出现关注公众号的入口。' },
|
{ name: "微信公众号", icon: 'wxgzh', pathName: "", intro: '授权微信公众号后,让你能够在后台查看和维护公众号的粉丝;同时你的店铺也有出现关注公众号的入口。' },
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div v-for="(item, index) in modelValue" :key="index" class="flex gap-4 mb-2">
|
||||||
|
<el-select v-model="item.coupon.id" placeholder="请选择优惠券">
|
||||||
|
<el-option
|
||||||
|
v-for="coupon in couponList"
|
||||||
|
:key="coupon.id"
|
||||||
|
:label="coupon.name"
|
||||||
|
:value="coupon.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
<el-input v-model="item.num" placeholder="请输入数量">
|
||||||
|
<template #append>数量</template>
|
||||||
|
</el-input>
|
||||||
|
<div>
|
||||||
|
<el-link
|
||||||
|
:underline="false"
|
||||||
|
type="danger"
|
||||||
|
class="no-wrap"
|
||||||
|
@click="modelValue.splice(index, 1)"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex gap-1 cursor-pointer" @click="addCoupon()">
|
||||||
|
<el-icon color="#3F9EFF">
|
||||||
|
<CirclePlus />
|
||||||
|
</el-icon>
|
||||||
|
<el-link :underline="false" type="primary" class="no-wrap">新增券</el-link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import { ref, reactive } from "vue";
|
||||||
|
const modelValue = defineModel({
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
});
|
||||||
|
|
||||||
|
// 优惠券列表
|
||||||
|
const couponList = ref([
|
||||||
|
{ id: 1, name: "满100减10" },
|
||||||
|
{ id: 2, name: "满200减30" },
|
||||||
|
]);
|
||||||
|
function addCoupon() {
|
||||||
|
modelValue.value.push({
|
||||||
|
num: 1,
|
||||||
|
coupon: {
|
||||||
|
id: null,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
console.log(modelValue.value);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,153 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-dialog title="购买会员方案" v-model="show" @close="reset" width="60%">
|
||||||
|
<el-form :model="form" label-width="120px">
|
||||||
|
<el-form-item label="周期名称" required>
|
||||||
|
<el-input v-model="form.name" placeholder="周期名称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="周期价格" required>
|
||||||
|
<el-input v-model="form.price" placeholder="周期价格" type="number" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="赠送成长值" required>
|
||||||
|
<el-input v-model="form.reward" placeholder="开通后立刻获得经验" type="number" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="赠送优惠券">
|
||||||
|
<div>
|
||||||
|
<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 label="周期时间" required>
|
||||||
|
<div class="flex">
|
||||||
|
<el-input-number
|
||||||
|
style="width: 300px"
|
||||||
|
v-model="form.circleTime"
|
||||||
|
placeholder="周期时间"
|
||||||
|
type="number"
|
||||||
|
/>
|
||||||
|
<el-select class="ml-2" v-model="form.circleUnit" placeholder="">
|
||||||
|
<el-option label="年" value="年" />
|
||||||
|
<el-option label="月" value="月" />
|
||||||
|
<el-option label="周" value="周" />
|
||||||
|
<el-option label="天" value="天" />
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div style="text-align: right; margin-top: 20px">
|
||||||
|
<el-button @click="close">取消</el-button>
|
||||||
|
<el-button type="primary" @click="submit">{{ isedit ? "更新" : "提交" }}</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref } from "vue";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
// 控制主弹窗显示
|
||||||
|
const show = ref(false);
|
||||||
|
|
||||||
|
// 控制优惠券选择弹窗显示
|
||||||
|
const couponDialogVisible = ref(false);
|
||||||
|
|
||||||
|
// 表单数据
|
||||||
|
const form = ref({
|
||||||
|
name: "",
|
||||||
|
price: 0,
|
||||||
|
reward: 0,
|
||||||
|
couponList: [], // 存储已选择的优惠券
|
||||||
|
circleTime: 1, // 会员周期
|
||||||
|
circleUnit: "月", // 会员周期单位
|
||||||
|
});
|
||||||
|
|
||||||
|
// 优惠券列表数据
|
||||||
|
const couponList = ref([
|
||||||
|
{ id: 1, name: "满100减10", value: "10元" },
|
||||||
|
{ id: 2, name: "满200减30", value: "30元" },
|
||||||
|
{ id: 3, name: "满500减100", value: "100元" },
|
||||||
|
]);
|
||||||
|
|
||||||
|
// 已选择的优惠券
|
||||||
|
const selectedCoupons = ref([]);
|
||||||
|
|
||||||
|
// 打开优惠券选择弹窗
|
||||||
|
function openCouponDialog() {
|
||||||
|
couponDialogVisible.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关闭优惠券选择弹窗
|
||||||
|
function closeCouponDialog() {
|
||||||
|
couponDialogVisible.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 确认选择优惠券
|
||||||
|
function confirmCouponSelection() {
|
||||||
|
form.value.couponList = [...selectedCoupons.value];
|
||||||
|
closeCouponDialog();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理优惠券选择
|
||||||
|
function handleCouponSelection(selection) {
|
||||||
|
selectedCoupons.value = selection;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 重置表单
|
||||||
|
function reset() {
|
||||||
|
form.value = {
|
||||||
|
name: "",
|
||||||
|
price: 0,
|
||||||
|
reward: 0,
|
||||||
|
couponList: [],
|
||||||
|
circleTime: "",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const emits = defineEmits(["submitSuccess"]);
|
||||||
|
// 提交表单
|
||||||
|
function submit() {
|
||||||
|
if (!form.value.name) {
|
||||||
|
ElMessage.error("请输入方案名称");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (form.value.price <= 0) {
|
||||||
|
ElMessage.error("请输入有效的价格");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!form.value.circleTime) {
|
||||||
|
ElMessage.error("请选择会员周期");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.log("提交表单数据:", form.value);
|
||||||
|
emits("submitSuccess", form.value, dataIndex);
|
||||||
|
// 在此处可以添加表单提交逻辑,例如调用 API
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
|
||||||
|
let isedit = ref(false);
|
||||||
|
let dataIndex = null;
|
||||||
|
function open(data, index) {
|
||||||
|
console.log("data", data);
|
||||||
|
console.log("index", index);
|
||||||
|
if (data) {
|
||||||
|
form.value = data;
|
||||||
|
isedit.value = true;
|
||||||
|
dataIndex = index;
|
||||||
|
} else {
|
||||||
|
isedit.value = false;
|
||||||
|
dataIndex = null;
|
||||||
|
}
|
||||||
|
console.log(data);
|
||||||
|
show.value = true;
|
||||||
|
}
|
||||||
|
function close() {
|
||||||
|
show.value = false;
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
defineExpose({ open, close, reset, submit });
|
||||||
|
</script>
|
||||||
|
|
@ -1,3 +1,528 @@
|
||||||
<template>
|
<template>
|
||||||
<div>超级会员管理</div>
|
<div class="m-4 bg-white p-4">
|
||||||
</template>
|
<HeaderCard
|
||||||
|
name="超级会员"
|
||||||
|
intro="用户会员管理设置"
|
||||||
|
icon="super_vip"
|
||||||
|
showSwitch
|
||||||
|
v-model:isOpen="isOpenSuperVip"
|
||||||
|
></HeaderCard>
|
||||||
|
<el-tabs class="mt-4" v-model="activeTab" type="border-card">
|
||||||
|
<el-tab-pane :label="item.label" v-for="item in configs" :key="item.name" :name="item.name">
|
||||||
|
<template v-if="item.name == 'basic'">
|
||||||
|
<h3>基础设置</h3>
|
||||||
|
<el-form ref="form" :model="basicForm">
|
||||||
|
<el-form-item label="提交生日/姓名">
|
||||||
|
<el-radio-group v-model="basicForm.isSubmitInfo">
|
||||||
|
<el-radio :value="1">是</el-radio>
|
||||||
|
<el-radio :value="0">否</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
<small class="color-999 m-l-6">*成为会员前需提交生日、姓名、性别信息。</small>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="会员开通方式">
|
||||||
|
<el-radio-group v-model="basicForm.openType">
|
||||||
|
<el-radio value="PAY">购买开通</el-radio>
|
||||||
|
<el-radio value="CONDITION">条件开通</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- 购买开通 -->
|
||||||
|
<div v-if="basicForm.openType == 'PAY'">
|
||||||
|
<el-form-item label="会员周期列表">
|
||||||
|
<el-button type="primary" @click="refDialogPlans.open()">添加方案</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="">
|
||||||
|
<el-table :data="basicForm.configList" border style="width: 60%">
|
||||||
|
<el-table-column prop="name" label="名称" align="center" />
|
||||||
|
<el-table-column prop="price" label="价格" align="center" />
|
||||||
|
<el-table-column prop="reward" label="赠送成长值" align="center" />
|
||||||
|
<el-table-column label="赠送优惠券" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ totalCount(scope.row.couponList) }}张优惠券
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="is_auto_renew" label="会员周期" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ scope.row.circleTime }} {{ scope.row.circleUnit }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button type="text" @click="refDialogPlans.open(scope.row, scope.$index)">
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button type="text" style="color: red" @click="deletePlan(scope.row)">
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
<!-- 条件开通 -->
|
||||||
|
<div v-if="basicForm.openType == 'CONDITION'">
|
||||||
|
<el-form-item label="成为会员条件">
|
||||||
|
<div>
|
||||||
|
<div class="m-b-2" v-for="(item, index) in conditionLists" :key="index">
|
||||||
|
<el-checkbox v-model="item.checked">{{ item.label }}</el-checkbox>
|
||||||
|
<el-input-number
|
||||||
|
style="margin-left: 20px"
|
||||||
|
v-if="item.label != '绑定手机号' && item.checked"
|
||||||
|
v-model="item.value"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
<el-form-item label="参与会员价门店">
|
||||||
|
<el-radio-group v-model="basicForm.memberPriceShopType">
|
||||||
|
<el-radio value="ALL">全部门店</el-radio>
|
||||||
|
<el-radio value="PART">指定门店</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="选择门店" v-if="basicForm.memberPriceShopType == 'PART'">
|
||||||
|
<el-select
|
||||||
|
style="max-width: 600px"
|
||||||
|
v-model="basicForm.memberPriceShopIdList"
|
||||||
|
multiple
|
||||||
|
placeholder="请选择门店"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in shops"
|
||||||
|
:key="item.shopId"
|
||||||
|
:label="item.shopName"
|
||||||
|
:value="item.shopId"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="享受会员价">
|
||||||
|
<el-radio-group v-model="basicForm.isMemberPrice">
|
||||||
|
<el-radio :value="1">所有支付方式</el-radio>
|
||||||
|
<el-radio :value="0">仅余额支付</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="规则说明">
|
||||||
|
<el-input
|
||||||
|
v-model="basicForm.remark"
|
||||||
|
style="width: 400px"
|
||||||
|
:autosize="{ minRows: 4, maxRows: 5 }"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<h3>升级规则</h3>
|
||||||
|
<el-form-item label="获取成长值升级">
|
||||||
|
<div class="color-666">
|
||||||
|
<div class="m-b-4">
|
||||||
|
<span>每消费1元获得</span>
|
||||||
|
<el-input-number
|
||||||
|
class="m-x-2"
|
||||||
|
v-model="basicForm.costReward"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
/>
|
||||||
|
<span>成长值</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span>每充值1元获得</span>
|
||||||
|
<el-input-number
|
||||||
|
class="m-x-2"
|
||||||
|
v-model="basicForm.rechargeReward"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
/>
|
||||||
|
<span>成长值</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
<div class="flex mt-10 justify-center gap-10">
|
||||||
|
<el-button style="width: 100px" type="primary" @click="basicSubmit" size="large">
|
||||||
|
保存
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="close" style="width: 100px" size="large">取消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<!-- 会员等级设置 -->
|
||||||
|
<template v-if="item.name == 'lv'">
|
||||||
|
<h3>会员等级设置</h3>
|
||||||
|
<div>
|
||||||
|
<el-button type="primary" @click="addLevel">添加会员等级</el-button>
|
||||||
|
</div>
|
||||||
|
<el-tabs
|
||||||
|
v-model="activeLevelId"
|
||||||
|
type="card"
|
||||||
|
style="margin-top: 20px"
|
||||||
|
@tab-remove="removeLevel"
|
||||||
|
@tab-add="addLevel"
|
||||||
|
editable
|
||||||
|
>
|
||||||
|
<el-tab-pane
|
||||||
|
v-for="(level, index) in levels"
|
||||||
|
:key="level.id"
|
||||||
|
:label="index + 1 + '级:' + level.name || '未命名等级'"
|
||||||
|
:name="index"
|
||||||
|
>
|
||||||
|
<!-- 编辑会员等级参数 -->
|
||||||
|
<el-form :model="level" label-width="150px">
|
||||||
|
<el-form-item label="会员标题">
|
||||||
|
<el-input v-model="level.name" maxlength="30" placeholder="请输入会员标题" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="所需成长值">
|
||||||
|
<el-input
|
||||||
|
v-model="level.experienceValue"
|
||||||
|
type="number"
|
||||||
|
placeholder="请输入所需成长值"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="会员折扣">
|
||||||
|
<el-input v-model="level.discount" type="number" placeholder="请输入会员折扣" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="等级标识">
|
||||||
|
<div>
|
||||||
|
<small class="color-666">建议优先选择 jpg 格式,大小控制在 500k 以内</small>
|
||||||
|
<div class="flex">
|
||||||
|
<SingleImageUpload v-model="level.logo" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="消费送积分">
|
||||||
|
<div>
|
||||||
|
<el-switch
|
||||||
|
v-model="level.isCostRewardPoints"
|
||||||
|
:inactive-value="0"
|
||||||
|
:active-value="1"
|
||||||
|
/>
|
||||||
|
<!-- <el-radio-group v-model="level.isPointsEnabled">
|
||||||
|
<el-radio :value="true">已启用</el-radio>
|
||||||
|
<el-radio :value="false">已禁用</el-radio>
|
||||||
|
</el-radio-group> -->
|
||||||
|
<div
|
||||||
|
v-if="level.isCostRewardPoints"
|
||||||
|
style="margin-top: 10px"
|
||||||
|
class="color-666 flex"
|
||||||
|
>
|
||||||
|
<span class="no-wrap">每消耗</span>
|
||||||
|
<el-input
|
||||||
|
class="m-x-2"
|
||||||
|
v-model="level.costRewardPoints"
|
||||||
|
type="number"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
/>
|
||||||
|
<span class="no-wrap">元赠送1积分</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="等级说明">
|
||||||
|
<el-input
|
||||||
|
v-model="level.remark"
|
||||||
|
type="textarea"
|
||||||
|
maxlength="250"
|
||||||
|
placeholder="请输入等级说明,最多 250 字"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="周期时间">
|
||||||
|
<div class="flex w-full gap-2">
|
||||||
|
<el-input
|
||||||
|
style="width: 140px"
|
||||||
|
v-model="level.cycleTime"
|
||||||
|
type="number"
|
||||||
|
placeholder="请输入周期时间"
|
||||||
|
/>
|
||||||
|
<el-select style="width: 80px" v-model="level.cycleUnit" placeholder="单位">
|
||||||
|
<el-option label="周" value="周" />
|
||||||
|
<el-option label="月" value="月" />
|
||||||
|
<el-option label="年" value="年" />
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="自动发放">
|
||||||
|
<div>
|
||||||
|
<el-switch
|
||||||
|
v-model="level.isCycleReward"
|
||||||
|
:inactive-value="0"
|
||||||
|
:active-value="1"
|
||||||
|
/>
|
||||||
|
<!-- <el-radio-group v-model="level.isCycleReward">
|
||||||
|
<el-radio :value="true">已启用</el-radio>
|
||||||
|
<el-radio :value="false">已禁用</el-radio>
|
||||||
|
</el-radio-group> -->
|
||||||
|
<div v-if="level.isCycleReward" style="margin-top: 10px">
|
||||||
|
<!-- <div class="flex">
|
||||||
|
<span class="color-666 no-wrap mr-4">周期时间</span>
|
||||||
|
<el-input
|
||||||
|
v-model="level.cycleTime"
|
||||||
|
type="number"
|
||||||
|
placeholder="请输入周期时间"
|
||||||
|
/>
|
||||||
|
<el-select v-model="level.cycleUnit" placeholder="选择单位">
|
||||||
|
<el-option label="周" value="周" />
|
||||||
|
<el-option label="月" value="月" />
|
||||||
|
<el-option label="年" value="年" />
|
||||||
|
</el-select>
|
||||||
|
</div> -->
|
||||||
|
<div class="flex mt-4">
|
||||||
|
<span class="color-666 no-wrap mr-4">赠送积分</span>
|
||||||
|
<el-input
|
||||||
|
v-model="level.cycleRewardPoints"
|
||||||
|
type="number"
|
||||||
|
placeholder="赠送积分"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="flex mt-4" style="align-items: flex-start">
|
||||||
|
<span class="color-666 no-wrap mr-4">送优惠券</span>
|
||||||
|
<CouponLists v-model="level.cycleRewardCouponList" />
|
||||||
|
<!-- <el-select v-model="level.autoSendCoupon" placeholder="选择赠送优惠券">
|
||||||
|
<el-option
|
||||||
|
v-for="coupon in couponList"
|
||||||
|
:key="coupon.id"
|
||||||
|
:label="coupon.name"
|
||||||
|
:value="coupon.id"
|
||||||
|
/>
|
||||||
|
</el-select> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div class="flex mt-10 justify-center gap-10">
|
||||||
|
<el-button
|
||||||
|
style="width: 100px"
|
||||||
|
type="primary"
|
||||||
|
@click="saveLevel(level)"
|
||||||
|
size="large"
|
||||||
|
>
|
||||||
|
保存
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="close" style="width: 100px" size="large">取消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</template>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
|
||||||
|
<DialogPlans ref="refDialogPlans" @submitSuccess="submitSuccess"></DialogPlans>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import shopApi from "@/api/account/shop";
|
||||||
|
import memberApi from "@/api/market/member";
|
||||||
|
import HeaderCard from "../components/headerCard.vue";
|
||||||
|
import DialogPlans from "./components/dialog-plans.vue";
|
||||||
|
import CouponLists from "./components/coup-lists.vue";
|
||||||
|
import { ref, reactive, watch, toRaw, getCurrentInstance, onMounted } from "vue";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
import { useRouter } from "vue-router";
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
//是否开启超级会员
|
||||||
|
const isOpenSuperVip = ref(false);
|
||||||
|
|
||||||
|
const refDialogPlans = ref();
|
||||||
|
const configs = [
|
||||||
|
{ name: "basic", label: "会员基础设置" },
|
||||||
|
{ name: "lv", label: "会员等级设置" },
|
||||||
|
{ name: "order", label: "购买会员订单" },
|
||||||
|
];
|
||||||
|
const activeTab = ref("basic");
|
||||||
|
const conditionLists = ref([
|
||||||
|
{ label: "绑定手机号", checked: false, code: "BIND_PHONE" },
|
||||||
|
{ label: "订单达成指定次数", checked: false, value: "", code: "ORDER" },
|
||||||
|
{ label: "消费达到指定金额", checked: false, value: "", cpde: "COST_AMOUNT" },
|
||||||
|
{ label: "充值达到指定金额", checked: false, value: "", code: "RECHARGE_AMOUNT" },
|
||||||
|
]);
|
||||||
|
const basicForm = reactive({
|
||||||
|
isSubmitInfo: 1,
|
||||||
|
openType: 0,
|
||||||
|
configList: [],
|
||||||
|
memberPriceShopType: "ALL",
|
||||||
|
remark: "",
|
||||||
|
costReward: 0,
|
||||||
|
rechargeReward: 0,
|
||||||
|
memberPriceShopIdList: [],
|
||||||
|
isMemberPrice: 1,
|
||||||
|
});
|
||||||
|
function deletePlan(row) {
|
||||||
|
const index = basicForm.configList.indexOf(row);
|
||||||
|
if (index > -1) {
|
||||||
|
basicForm.configList.splice(index, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function submitSuccess(plans, index) {
|
||||||
|
if (!basicForm.configList) {
|
||||||
|
basicForm.configList = [];
|
||||||
|
}
|
||||||
|
if (index) {
|
||||||
|
basicForm.configList[index] = plans;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
basicForm.configList.push(plans);
|
||||||
|
}
|
||||||
|
// 会员基础设置提交
|
||||||
|
function basicSubmit() {
|
||||||
|
const data = toRaw(basicForm);
|
||||||
|
// if (data.openType == "PAY") {
|
||||||
|
// data.conditionList = null;
|
||||||
|
// }
|
||||||
|
// if (data.openType == "CONDITION") {
|
||||||
|
// data.configList = null;
|
||||||
|
// }
|
||||||
|
memberApi.editConfig(data).then((res) => {
|
||||||
|
ElMessage.success("保存成功");
|
||||||
|
});
|
||||||
|
// ElMessage.success("保存成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 会员等级列表
|
||||||
|
const levels = ref([]);
|
||||||
|
|
||||||
|
// 当前选中的会员等级
|
||||||
|
const selectedLevel = ref(null);
|
||||||
|
|
||||||
|
// 优惠券列表
|
||||||
|
const couponList = ref([
|
||||||
|
{ id: 1, name: "满100减10" },
|
||||||
|
{ id: 2, name: "满200减30" },
|
||||||
|
]);
|
||||||
|
let activeLevelId = ref(null);
|
||||||
|
// 添加会员等级
|
||||||
|
function addLevel() {
|
||||||
|
const nowLastVip = levels.value[levels.value.length - 1];
|
||||||
|
let name = "VIP1";
|
||||||
|
if (levels.value.length) {
|
||||||
|
name = "VIP" + (levels.value.length + 1);
|
||||||
|
}
|
||||||
|
if (nowLastVip && !nowLastVip.id) {
|
||||||
|
ElMessage.error("请先保存当前等级");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const newLevel = {
|
||||||
|
id: 0,
|
||||||
|
name,
|
||||||
|
experienceValue: 0,
|
||||||
|
discount: 1,
|
||||||
|
logo: "",
|
||||||
|
costRewardPoints: 1,
|
||||||
|
isCostRewardPoints: 1,
|
||||||
|
isCycleReward: 0,
|
||||||
|
cycleTime: 1,
|
||||||
|
cycleUnit: "月",
|
||||||
|
cycleRewardPoints: 1,
|
||||||
|
cycleRewardCouponList: [],
|
||||||
|
};
|
||||||
|
console.log(newLevel);
|
||||||
|
levels.value.push(newLevel);
|
||||||
|
selectedLevel.value = newLevel;
|
||||||
|
activeLevelId.value = levels.value.length - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 编辑会员等级
|
||||||
|
function editLevel(level) {
|
||||||
|
selectedLevel.value = level;
|
||||||
|
}
|
||||||
|
// 删除会员等级
|
||||||
|
async function removeLevel(index) {
|
||||||
|
const item = levels.value[index];
|
||||||
|
const { id } = item;
|
||||||
|
ElMessageBox.confirm("确定要删除吗?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
}).then(async () => {
|
||||||
|
if (id) {
|
||||||
|
const res = await memberApi.levelDel({ id: id });
|
||||||
|
if (res) {
|
||||||
|
levels.value.splice(index, 1);
|
||||||
|
ElMessage.success("删除成功");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
levels.value.splice(index, 1);
|
||||||
|
ElMessage.success("删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
const newLevel = levels.value[index - 1];
|
||||||
|
selectedLevel.value = newLevel;
|
||||||
|
activeLevelId.value = index - 1;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 保存会员等级
|
||||||
|
async function saveLevel(level) {
|
||||||
|
const res = level.id ? await memberApi.levelEdit(level) : await memberApi.levelAdd(level);
|
||||||
|
if (res) {
|
||||||
|
ElMessage.success("保存成功");
|
||||||
|
}
|
||||||
|
levelRefresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
const shops = ref([]);
|
||||||
|
|
||||||
|
async function levelRefresh() {
|
||||||
|
memberApi.levelList().then((res) => {
|
||||||
|
if (res && res.length) {
|
||||||
|
levels.value = res;
|
||||||
|
if (res.length != 0) {
|
||||||
|
selectedLevel.value = res[activeLevelId.value];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async function init() {
|
||||||
|
shopApi.getBranchList().then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
if (res) {
|
||||||
|
shops.value = res;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
memberApi.getConfig().then((res) => {
|
||||||
|
Object.assign(basicForm, res);
|
||||||
|
conditionLists.value = conditionLists.value.map((v) => {
|
||||||
|
const findItem = res.conditionList.find((cond) => cond.code == v.code);
|
||||||
|
if (findItem) {
|
||||||
|
v.value = findItem.value;
|
||||||
|
v.checked = true;
|
||||||
|
} else {
|
||||||
|
v.checked = false;
|
||||||
|
}
|
||||||
|
return v;
|
||||||
|
});
|
||||||
|
console.log(conditionLists.value);
|
||||||
|
});
|
||||||
|
memberApi.levelList().then((res) => {
|
||||||
|
if (res && res.length) {
|
||||||
|
levels.value = res;
|
||||||
|
activeLevelId.value = 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
init();
|
||||||
|
});
|
||||||
|
//计算总优惠券数量
|
||||||
|
function totalCount(arr) {
|
||||||
|
return arr.reduce((total, item) => {
|
||||||
|
return total + item.num;
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
//返回
|
||||||
|
function close() {
|
||||||
|
router.back();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
:deep(.el-tabs--border-card) {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
:deep(.el-tabs--border-card > .el-tabs__header) {
|
||||||
|
border: none;
|
||||||
|
padding: 4px;
|
||||||
|
}
|
||||||
|
:deep(.el-tabs--border-card > .el-tabs__header .el-tabs__item) {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
:deep(.el-tabs--border-card > .el-tabs__header .el-tabs__item.is-active) {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue