diff --git a/esf-relay/src/server.mjs b/esf-relay/src/server.mjs index cba117f..f1b8fd9 100644 --- a/esf-relay/src/server.mjs +++ b/esf-relay/src/server.mjs @@ -7,6 +7,8 @@ const addressRoutes = new Map([ ['/supplierOpenApi/pointOrder/queryOrderInfo', '/supplierOpenApi/pointOrder/queryOrderInfo'], ['/supplierOpenApi/pointOrder/queryReconciliationInfo', '/supplierOpenApi/pointOrder/queryReconciliationInfo'], ['/supplierOpenApi/pointOrder/applyForInvoices', '/supplierOpenApi/pointOrder/applyForInvoices'], + ['/supplierOpenApi/pointOrder/queryInvoicesInfo', '/supplierOpenApi/pointOrder/queryInvoicesInfo'], + ['/supplierOpenApi/pointOrder/queryFileBase64Info', '/supplierOpenApi/pointOrder/queryFileBase64Info'], ['/supplierOpenApi/pointOrder/unReconciledMsg', '/supplierOpenApi/pointOrder/unReconciledMsg'], ['/supplierOpenApi/pointOrder/reconciliationResult', '/supplierOpenApi/pointOrder/reconciliationResult'] ]) diff --git a/supplied-h5/src/store/user.js b/supplied-h5/src/store/user.js index 60af0f4..1d2137c 100644 --- a/supplied-h5/src/store/user.js +++ b/supplied-h5/src/store/user.js @@ -20,7 +20,6 @@ const saveUser = data => { export const useUserStore = defineStore('joyfulSelectionUser', { state: () => ({ userId: '', - encryptedParam: '', supplierIdentification: '', supplierId: '', supplierName: '', @@ -54,16 +53,27 @@ export const useUserStore = defineStore('joyfulSelectionUser', { }) this.loaded = true }, - hydrateFromRoute(query = {}) { + async hydrateFromRoute(query = {}) { if (!this.loaded) { this.loadUser() } - const encryptedParam = query.AplParmObjct || query.aplParmObjct || '' + const keyword = query.keyword || new URLSearchParams(window.location.search).get('keyword') || '' + let nextUserId = query.userId || '' - if (encryptedParam) { - this.encryptedParam = encryptedParam - this.userId = '' + if (keyword) { + const sessionKeyword = String(keyword).replace(/ /g, '+') + console.log('[supplier-session] keyword', { + routeKeyword: query.keyword, + searchKeyword: new URLSearchParams(window.location.search).get('keyword') || '', + sessionKeyword + }) + const data = await postFunction('supplier-session', { keyword: sessionKeyword }) + nextUserId = data?.userId || '' + } + + if (nextUserId && nextUserId !== this.userId) { + this.userId = nextUserId this.pointsBalance = 0 } if (!this.supplierIdentification) { @@ -92,10 +102,7 @@ export const useUserStore = defineStore('joyfulSelectionUser', { if (!this.loaded) { this.loadUser() } - if (!this.supplierIdentification || (!this.encryptedParam && this.hasToken)) { - return - } - if (!this.encryptedParam) { + if (!this.userId || !this.supplierIdentification || this.hasToken) { return } if (this.loadingToken && bridgeTokenPromise) { @@ -109,12 +116,10 @@ export const useUserStore = defineStore('joyfulSelectionUser', { } const data = await postFunction('supplier-token', { - AplParmObjct: this.encryptedParam, + userId: this.userId, supplierIdentification: this.supplierIdentification }) - this.userId = data?.userId || '' - this.encryptedParam = '' this.supplierId = data?.supplierId || this.supplierId this.supplierName = data?.supplierName || this.supplierName this.persistUser() diff --git a/supplied-h5/src/view/joyful-selection/layout.vue b/supplied-h5/src/view/joyful-selection/layout.vue index 1234ed9..01d42d6 100644 --- a/supplied-h5/src/view/joyful-selection/layout.vue +++ b/supplied-h5/src/view/joyful-selection/layout.vue @@ -49,15 +49,17 @@ export default { methods: { ...mapActions(useCartStore, ['loadCart']), ...mapActions(useUserStore, ['hydrateFromRoute', 'fetchBridgeToken']), - prepareUserSession() { + async prepareUserSession() { this.sessionLoading = true - this.hydrateFromRoute(this.$route.query) - this.fetchBridgeToken().catch(error => { + try { + await this.hydrateFromRoute(this.$route.query) + await this.fetchBridgeToken() + } catch (error) { console.warn('获取平台授权令牌失败', error) this.$toast(error.message || '供应商验证失败,请稍后再试') - }).finally(() => { + } finally { this.sessionLoading = false - }) + } } } } diff --git a/supplied-h5/src/view/joyful-selection/merchant/index.vue b/supplied-h5/src/view/joyful-selection/merchant/index.vue index e6b6e1a..5092833 100644 --- a/supplied-h5/src/view/joyful-selection/merchant/index.vue +++ b/supplied-h5/src/view/joyful-selection/merchant/index.vue @@ -6,6 +6,7 @@
+
@@ -359,11 +360,26 @@ export default { openShipPopup(item) { this.currentOrder = item this.shipForm = { - crrgBsnNm: item.crrgBsnNm || '', - logisticsOrderId: item.logisticsOrderId || '' + crrgBsnNm: item.crrgBsnNm || '韵达快递', + logisticsOrderId: item.logisticsOrderId || 'YT20260903142053001' } this.showShipPopup = true }, + async quickShipAll() { + await Dialog.confirm({ + title: '确认一键发货?', + message: `将为当前 ${this.orderItems.length} 个待发货订单提交发货。` + }) + await Promise.all(this.orderItems.map(item => postFunction('merchant-order-ship', { + supplierId: this.supplierId, + userId: item.userId, + orderId: item.orderId, + crrgBsnNm: item.crrgBsnNm || '韵达快递', + logisticsOrderId: item.logisticsOrderId || 'YT20260903142053001' + }))) + Toast('批量发货成功') + await this.loadOrders() + }, async submitShip() { if (!this.shipForm.crrgBsnNm || !this.shipForm.logisticsOrderId) { Toast('请填写完整发货信息') @@ -467,6 +483,18 @@ export default { padding: 12px 10px 18px; } +.batch-ship-button { + width: 100%; + height: 38px; + margin-bottom: 12px; + border: 0; + border-radius: 8px; + color: #fff; + font-size: 14px; + font-weight: 700; + background: linear-gradient(90deg, #ff6a2a 0%, #ff4b18 100%); +} + .work-card { position: relative; margin-bottom: 12px; diff --git a/supplied-h5/src/view/joyful-selection/profile/orders/index.vue b/supplied-h5/src/view/joyful-selection/profile/orders/index.vue index bcf1fe2..3f9fafb 100644 --- a/supplied-h5/src/view/joyful-selection/profile/orders/index.vue +++ b/supplied-h5/src/view/joyful-selection/profile/orders/index.vue @@ -15,6 +15,15 @@ + + 一键收货({{ receivableOrders.length }}) +