卖家端申请接口。人口

This commit is contained in:
李志鹏
2026-04-24 16:57:13 +08:00
parent 071930f257
commit e4fc51c574
9 changed files with 149 additions and 62 deletions

View File

@@ -7,6 +7,7 @@ import UserHabit from './userHabit/userHabit'
import Workspace from './workspace/workspace'
import Guide from './guide/guide'
import adminPage from './adminPage/adminPage'
import seller from './seller/index'
export interface RootState{
}
@@ -41,5 +42,6 @@ export default createStore<RootState>({
Workspace,
Guide,
adminPage,
seller,
}
})

6
src/store/seller/index.d.ts vendored Normal file
View File

@@ -0,0 +1,6 @@
export const ApplyStatus = {
Null: null,// 未申请过
Pending: 0,// 已提交, 待审核
Approved: 1,// 审核通过
Rejected: 2,// 审核拒绝
}

40
src/store/seller/index.ts Normal file
View File

@@ -0,0 +1,40 @@
import { Module } from 'vuex'
import { RootState } from '../index'
import i18n from "@/lang/index";
import { Https } from '@/tool/https'
import { ApplyStatus } from "./index.d"
import store from '../index'
interface Seller {
isSeller: boolean,
applyStatus: number,
}
const seller: Module<Seller, RootState> = {
namespaced: true,
state: {
isSeller: false,
applyStatus: null,
},
mutations: {
set_isSeller(state: Seller, value: boolean) {
state.isSeller = value
},
set_applyStatus(state: Seller, value: number) {
state.applyStatus = value
if (value == ApplyStatus.Approved) {
state.isSeller = true
}
},
},
actions: {
get_isSeller({ commit }) {
Https.axiosGet(Https.httpUrls.checkSellerDesigner).then(rv => {
commit('set_isSeller', !!rv)
})
},
}
}
export default seller