店铺信息
This commit is contained in:
@@ -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
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user