diff --git a/apis/commonApi.js b/apis/commonApi.js index 3482615..16dd7d3 100644 --- a/apis/commonApi.js +++ b/apis/commonApi.js @@ -37,6 +37,15 @@ function syncStore(res) { mobile: res.mobile, avatar: null }) + } else { + if (res) { + store.commit('setUserInfo', { + name: '', + userId: res.userId, + mobile: res.mobile, + avatar: null + }) + } } } diff --git a/pages.json b/pages.json index fe422e2..8038f69 100644 --- a/pages.json +++ b/pages.json @@ -5,7 +5,8 @@ "style": { "navigationBarTitleText": "店铺首页", "navigationStyle": "custom" - } + }, + "h5": { "titleNView": false } }, { "path": "pages/cart/index", @@ -160,8 +161,7 @@ "navigationBarTextStyle": "black", "navigationBarTitleText": "uni-app", "navigationBarBackgroundColor": "#F8F8F8", - "backgroundColor": "#F8F8F8", - "app-plus": { "titleNView": false } + "backgroundColor": "#F8F8F8" }, "tabBar": { "color": "#888", diff --git a/pages/order-make/index.vue b/pages/order-make/index.vue index 29542aa..8063572 100644 --- a/pages/order-make/index.vue +++ b/pages/order-make/index.vue @@ -198,6 +198,13 @@ export default { if (this.loading) { return } + if (!this.deliveryAddress.addressId) { + uni.showToast({ + title: '请选择收货地址', + icon: 'none' + }) + return + } this.loading = true let itemsRemarkList = [] // 拼接订单信息 diff --git a/pages/paper-details/index.vue b/pages/paper-details/index.vue index 33d7d43..abddf95 100644 --- a/pages/paper-details/index.vue +++ b/pages/paper-details/index.vue @@ -58,15 +58,15 @@ - + - 店铺 + 店铺 - + - 购物车 + 购物车 - + 加购物车 @@ -227,14 +227,35 @@ export default { } }, onLoad(option) { - this.params.productId = option.paperId - this.queryData() + if (option.paperId) { + this.params.productId = option.paperId + if (this.hasLogin) { + this.queryData() + } else { + this.$store.commit('setNextPage', { name: 'paper-detail', data: { paperId: option.paperId } }) + go2('login') + } + } else { + uni.showToast({ + title: '参数错误', + icon: 'fail', + success: () => { + back() + } + }) + } }, computed: { buyTon() { let num = 0 num = round(this.buyPaperDto.gramWeight * this.buyPaperDto.width * this.buyPaperDto.length * this.buyPaperDto.pieceQuantity * 1e-12, 4) return num + }, + hasCompany() { + return this.$store.state.companyInfo.id != null + }, + hasLogin() { + return this.$store.state.qnToken != '' } }, watch: { @@ -266,6 +287,13 @@ export default { }, // 立即订购 addShoppingTap(type) { + if (!this.hasCompany) { + uni.showToast({ + title: '请先完善公司信息', + icon: 'none' + }) + return + } this.shoppingCarType = type this.buyPaperDto = { buyTon: 0, @@ -283,6 +311,13 @@ export default { // 路由到实单询比价 inquiryTap() { + if (!this.hasCompany) { + uni.showToast({ + title: '请先完善公司信息', + icon: 'none' + }) + return + } go2('for-comparison', { id: this.info.supplierId, productImg: this.info.imgList[0] }) }, closeTap() { diff --git a/pages/store/index.vue b/pages/store/index.vue index 42dab85..5b2b6b5 100644 --- a/pages/store/index.vue +++ b/pages/store/index.vue @@ -30,8 +30,8 @@ /> - - + +