From 661be271206a6ea154509c1ebed78294e47aebf6 Mon Sep 17 00:00:00 2001 From: dengxiongfei Date: Mon, 14 Mar 2022 13:44:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/paper-details/index.vue | 9 ++++++++- store/index.js | 22 +++++++++------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/pages/paper-details/index.vue b/pages/paper-details/index.vue index ce96dc9..a687f92 100644 --- a/pages/paper-details/index.vue +++ b/pages/paper-details/index.vue @@ -5,7 +5,7 @@ - + @@ -227,6 +227,13 @@ export default { return value == 1 ? '张' : '吨' } }, + onShow() { + setTimeout(() => { + uni.showToast({ + title: window.location.href + }) + }, 2000) + }, onLoad(option) { if (option.paperId) { this.params.productId = option.paperId diff --git a/store/index.js b/store/index.js index 04261b0..0d3eac1 100644 --- a/store/index.js +++ b/store/index.js @@ -29,13 +29,7 @@ let qnToken = null, * @value id 当前被分享的供应商账号id */ userId = null -const companyInfoParams = [ - 'id', - 'name', - 'fddEnterpriseStatus', - 'isVip', - 'vipExpireTime' -] +const companyInfoParams = ['id', 'name', 'fddEnterpriseStatus', 'isVip', 'vipExpireTime'] const userInfoParams = ['name', 'userId', 'mobile', 'avatar'] try { uecToken = uni.getStorageSync('uecToken') @@ -187,12 +181,14 @@ const store = new Vuex.Store({ uni.setStorageSync('companyInfo', JSON.stringify(companyInfo)) state.companyInfo = companyInfo // 绑定供应商销售账号 - bindUser({ - customerEnterpriseId: companyInfo.id, - sellerId: state.userId, - sellerSupplierId: state.supplierId, - customerId: state.userId - }) + if (state.userId && state.userInfo.userId) { + bindUser({ + customerEnterpriseId: companyInfo.id, + sellerId: state.userId, + sellerSupplierId: state.supplierId, + customerId: state.userInfo.userId + }) + } } catch (e) { console.error('设置companyInfo失败:', e) }