diff --git a/assets/css/store.less b/assets/css/store.less index 3351917..898fc4d 100644 --- a/assets/css/store.less +++ b/assets/css/store.less @@ -9,10 +9,9 @@ } .box-share { + width: 600rpx; .box-img { position: relative; - width: 600rpx; - height: 832rpx; border-radius: 40rpx; overflow: hidden; } @@ -26,14 +25,12 @@ } .main-img { - width: 600rpx; - height: 832rpx; + width: 100%; border-radius: 40rpx; } .btn { - width: 600rpx; - height: 120rpx; + width: 100%; margin-top: 20rpx; } } \ No newline at end of file diff --git a/pages/cart.vue b/pages/cart.vue index 3c5fa8b..571eb40 100644 --- a/pages/cart.vue +++ b/pages/cart.vue @@ -399,21 +399,22 @@ export default { }, created() { this.getCart() - }, - onLoad() { this.getAddress() }, onShow() { this.isEdit = false - uni.$on('chooseAddress', (res) => { - this.addressInfo = res; - this.$forceUpdate() - }) if (!this.isLoad) { return } this.closeAttr() this.getCart() + // 选择地址 + const cartChooseAddress = uni.getStorageSync('cartChooseAddress') || {} + if (cartChooseAddress.id) { + this.addressInfo = cartChooseAddress + uni.setStorageSync('cartChooseAddress', {}) + return + } this.getAddress() }, onHide() { @@ -435,7 +436,7 @@ export default { this.$yrouter.push({ path: "/pages/user/address/AddressManagement/index", query: { - choosMode: 1 + choosMode: 2 } }); }, @@ -443,15 +444,28 @@ export default { this.$yrouter.push({ path: "/pages/user/address/AddAddress/index", query: { - choosMode: 1 + choosMode: 2 } }); }, getAddress() { getAddressList({page: 1, limit: 9999}).then(res => { - this.addressList = res.data - this.addressInfo = res.data.find(e => e.isDefault == 1) || res.data[0] && res.data[0] || null - }); + const { data = [] } = res + this.addressList = data + if (!this.addressInfo.id) { + this.addressInfo = data.find(e => e.isDefault == 1) || (data && data[0]) || null + } else { + let isExist = false + data.map(item => { + if (item.id === this.addressInfo.id) { + isExist = true + } + }) + if (!isExist) { + this.addressInfo = data.find(e => e.isDefault == 1) || (data && data[0]) || null + } + } + }) }, clearCart() { const ids = this.list.map(l => { diff --git a/pages/home/components/serviec.vue b/pages/home/components/serviec.vue index 6a97641..c5180ab 100644 --- a/pages/home/components/serviec.vue +++ b/pages/home/components/serviec.vue @@ -25,7 +25,7 @@ - 客服 + 咨询 diff --git a/pages/home/components/shareImg.vue b/pages/home/components/shareImg.vue index 7a91e2f..0a90cd8 100644 --- a/pages/home/components/shareImg.vue +++ b/pages/home/components/shareImg.vue @@ -1,14 +1,11 @@