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) }