完成分销基础设置页面,分销员列表
This commit is contained in:
53
store/market.js
Normal file
53
store/market.js
Normal file
@@ -0,0 +1,53 @@
|
||||
// stores/counter.js
|
||||
import { defineStore } from "pinia";
|
||||
import * as distributionApi from "@/http/api/market/distribution.js";
|
||||
|
||||
export const upgradeTypes = [
|
||||
{
|
||||
value: "not_upgrade",
|
||||
label: "不自动升级",
|
||||
},
|
||||
{
|
||||
value: "invite",
|
||||
label: "邀请有效人数",
|
||||
},
|
||||
{
|
||||
value: "cost",
|
||||
label: "消费金额(不含退款)",
|
||||
},
|
||||
];
|
||||
// 分销
|
||||
export const useDistributionStore = defineStore("distribution", {
|
||||
state: () => {
|
||||
return {
|
||||
//分销配置
|
||||
config: {
|
||||
isEnable: 0,
|
||||
openType: "pay",
|
||||
inviteCount: 1,
|
||||
inviteConsume: 0,
|
||||
payAmount: 0,
|
||||
rewardCount: 1,
|
||||
settlementDay: 1,
|
||||
upgradeType: "auto",
|
||||
notActivatedPage: null,
|
||||
levelConfigList: [],
|
||||
},
|
||||
//升级条件
|
||||
upgradeTypes,
|
||||
};
|
||||
},
|
||||
actions: {
|
||||
async getConfig() {
|
||||
const data = await distributionApi.getConfig();
|
||||
this.config = data;
|
||||
return this.config;
|
||||
},
|
||||
async editConfig(data) {
|
||||
const res = await distributionApi.editConfig({ ...this.config, ...data });
|
||||
this.getConfig();
|
||||
return res;
|
||||
},
|
||||
},
|
||||
unistorage: true, // 开启后对 state 的数据读写都将持久化
|
||||
});
|
||||
Reference in New Issue
Block a user