删除部分图片,增加超级会员页面功能
This commit is contained in:
@@ -2,6 +2,18 @@
|
||||
import { defineStore } from "pinia";
|
||||
import * as shopApi from "@/http/api/shop.js";
|
||||
|
||||
//判断是否是主店
|
||||
export const isMainShop = (shopId) => {
|
||||
const shopInfo=uni.getStorageSync("shopInfo");
|
||||
if(shopInfo.isHeadShop){
|
||||
return true
|
||||
}
|
||||
if(shopInfo.shopType=='only'){
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// 分销
|
||||
export const useAccountInfoStore = defineStore("accountInfo", {
|
||||
state: () => {
|
||||
|
||||
17
store/chat.js
Normal file
17
store/chat.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import { defineStore } from "pinia";
|
||||
// import * as shopApi from "@/http/api/shop.js";
|
||||
|
||||
// 聊天
|
||||
export const useChatStore = defineStore("chat", {
|
||||
state: () => {
|
||||
return {
|
||||
chatList: [],
|
||||
};
|
||||
},
|
||||
actions: {
|
||||
sendMessage(message) {
|
||||
this.chatList.push(message);
|
||||
},
|
||||
},
|
||||
unistorage: true, // 开启后对 state 的数据读写都将持久化
|
||||
});
|
||||
@@ -2,6 +2,7 @@
|
||||
import { defineStore } from "pinia";
|
||||
import * as distributionApi from "@/http/api/market/distribution.js";
|
||||
import * as consumeDiscountApi from "@/http/api/market/consumeDiscount.js";
|
||||
import * as memberApi from "@/http/api/market/member.js";
|
||||
|
||||
export const upgradeTypes = [
|
||||
{
|
||||
@@ -57,7 +58,6 @@ export const useDistributionStore = defineStore("distribution", {
|
||||
export const useNewUserDiscountStore = defineStore("newUserDiscount", {
|
||||
state: () => {
|
||||
return {
|
||||
//分销配置
|
||||
config: {
|
||||
isEnable: 0,
|
||||
},
|
||||
@@ -70,15 +70,56 @@ export const useNewUserDiscountStore = defineStore("newUserDiscount", {
|
||||
return this.config;
|
||||
},
|
||||
async editConfig(data, isAutoResrefresh = true) {
|
||||
if (data.discountType === "FIXED") {
|
||||
data.randomDiscountList = [];
|
||||
}
|
||||
const res = await consumeDiscountApi.editConfig({
|
||||
...this.config,
|
||||
...data,
|
||||
});
|
||||
if (isAutoResrefresh) {
|
||||
this.getConfig();
|
||||
setTimeout(() => {
|
||||
this.getConfig();
|
||||
}, 1500);
|
||||
}
|
||||
return res;
|
||||
},
|
||||
},
|
||||
unistorage: true, // 开启后对 state 的数据读写都将持久化
|
||||
});
|
||||
|
||||
//超级会员
|
||||
export const useSuperVipStore = defineStore("superVip", {
|
||||
state: () => {
|
||||
return {
|
||||
config: {
|
||||
isOpen: 0,
|
||||
configList:[]
|
||||
},
|
||||
vipLevelList:[]
|
||||
};
|
||||
},
|
||||
actions: {
|
||||
setVipLevelList(list){
|
||||
this.vipLevelList = list||[];
|
||||
},
|
||||
editPlan(index,plan){
|
||||
this.config.configList[index] = plan;
|
||||
},
|
||||
addPlan(plan){
|
||||
this.config.configList.push(plan);
|
||||
},
|
||||
async getConfig() {
|
||||
const data = await memberApi.getConfig();
|
||||
data.memberPriceShopType = data.memberPriceShopType.toLowerCase();
|
||||
this.config = data;
|
||||
return this.config;
|
||||
},
|
||||
async editConfig(data) {
|
||||
const res = await memberApi.editConfig({ ...this.config,memberPriceShopType:this.config.memberPriceShopType.toUpperCase(), ...data });
|
||||
this.getConfig();
|
||||
return res;
|
||||
},
|
||||
},
|
||||
unistorage: true, // 开启后对 state 的数据读写都将持久化
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user