店铺信息

This commit is contained in:
李志鹏
2026-04-27 10:49:37 +08:00
parent 39c0ee110a
commit 0c140c2896
5 changed files with 104 additions and 48 deletions

View File

@@ -5,9 +5,20 @@ import { Https } from '@/tool/https'
import { ApplyStatus } from "./index.d"
import store from '../index'
interface DesignerInfo {
shopName: string,
avatar: string,
brandBanner: string,
ownerName: string,
email: string,
mobile: string,
socialLinks: string,
description: string,
}
interface Seller {
isSeller: boolean,
applyStatus: number,
designerInfo: DesignerInfo,
}
const seller: Module<Seller, RootState> = {
@@ -15,6 +26,16 @@ const seller: Module<Seller, RootState> = {
state: {
isSeller: false,
applyStatus: null,
designerInfo: {
shopName: "--",
avatar: null,
brandBanner: null,
ownerName: "--",
email: "--",
mobile: "--",
socialLinks: ["--"],
description: "--"
},
},
mutations: {
set_isSeller(state: Seller, value: boolean) {
@@ -26,13 +47,24 @@ const seller: Module<Seller, RootState> = {
state.isSeller = true
}
},
set_designerInfo(state: Seller, value: DesignerInfo) {
state.designerInfo = {
...value,
socialLinks: JSON.parse(value.socialLinks)
}
},
},
actions: {
get_isSeller({ commit }) {
// Https.axiosGet(Https.httpUrls.checkSellerDesigner).then(rv => {
// commit('set_isSeller', !!rv)
// })
Https.axiosGet(Https.httpUrls.checkSellerDesigner).then(rv => {
commit('set_isSeller', !!rv)
})
},
async get_designerInfo({ commit }) {
const rv = await Https.axiosGet(Https.httpUrls.getDesignerInfo)
commit('set_designerInfo', rv)
return rv
},
}
}