feat: 积分商城-供应商-对账

This commit is contained in:
2026-09-03 18:06:07 +08:00
parent 750c36116d
commit 5c8fbddb2e
9 changed files with 1195 additions and 16 deletions
+12 -5
View File
@@ -20,6 +20,7 @@ const saveUser = data => {
export const useUserStore = defineStore('joyfulSelectionUser', {
state: () => ({
userId: '',
encryptedParam: '',
supplierIdentification: '',
supplierId: '',
supplierName: '',
@@ -58,10 +59,11 @@ export const useUserStore = defineStore('joyfulSelectionUser', {
this.loadUser()
}
const nextUserId = query.userId || ''
const encryptedParam = query.AplParmObjct || query.aplParmObjct || ''
if (nextUserId && nextUserId !== this.userId) {
this.userId = nextUserId
if (encryptedParam) {
this.encryptedParam = encryptedParam
this.userId = ''
this.pointsBalance = 0
}
if (!this.supplierIdentification) {
@@ -90,7 +92,10 @@ export const useUserStore = defineStore('joyfulSelectionUser', {
if (!this.loaded) {
this.loadUser()
}
if (!this.userId || !this.supplierIdentification || this.hasToken) {
if (!this.supplierIdentification || (!this.encryptedParam && this.hasToken)) {
return
}
if (!this.encryptedParam) {
return
}
if (this.loadingToken && bridgeTokenPromise) {
@@ -104,10 +109,12 @@ export const useUserStore = defineStore('joyfulSelectionUser', {
}
const data = await postFunction('supplier-token', {
userId: this.userId,
AplParmObjct: this.encryptedParam,
supplierIdentification: this.supplierIdentification
})
this.userId = data?.userId || ''
this.encryptedParam = ''
this.supplierId = data?.supplierId || this.supplierId
this.supplierName = data?.supplierName || this.supplierName
this.persistUser()