diff --git a/components/common-card/horizontal-name-card.vue b/components/common-card/horizontal-name-card.vue new file mode 100644 index 0000000..83b9e4f --- /dev/null +++ b/components/common-card/horizontal-name-card.vue @@ -0,0 +1,59 @@ + + + + + diff --git a/components/goods-card/horizontal-goods-card.vue b/components/goods-card/horizontal-goods-card.vue new file mode 100644 index 0000000..d5fff76 --- /dev/null +++ b/components/goods-card/horizontal-goods-card.vue @@ -0,0 +1,70 @@ + + + + + diff --git a/components/goods-card/classify-goods-card.vue b/components/goods-card/vertical-goods-card.vue similarity index 91% rename from components/goods-card/classify-goods-card.vue rename to components/goods-card/vertical-goods-card.vue index a4d3ebc..cfc94ed 100644 --- a/components/goods-card/classify-goods-card.vue +++ b/components/goods-card/vertical-goods-card.vue @@ -28,7 +28,7 @@ + + diff --git a/pages/order/product-picked.vue b/pages/order/product-picked.vue new file mode 100644 index 0000000..e09a511 --- /dev/null +++ b/pages/order/product-picked.vue @@ -0,0 +1,53 @@ + + + + + diff --git a/pages/product/product-detail.vue b/pages/product/product-detail.vue index 5074a7f..ebe2cea 100644 --- a/pages/product/product-detail.vue +++ b/pages/product/product-detail.vue @@ -104,15 +104,15 @@ - + @@ -122,7 +122,7 @@ @@ -131,18 +131,18 @@ --> - 99 + {{totalPickCount}} 购物车 加入购物车 - 立即订购 + 立即订购 - + - + @@ -170,11 +170,15 @@ showTopNav: false, curTopNav: 0, shopInfo: {}, - ifShowPageMeta: false + ifShowPageMeta: false, + orderNow: false, + totalPickCount: 0, + ifHasCsMsg: true } }, onLoad() { - this.loadData(); + this.loadData(); + this.bindEvent(); }, onReady() { this.productVideoContext = uni.createVideoContext('productVideo'); @@ -193,6 +197,9 @@ this.reviewers = productDetail.reviewers; this.productDetailImgUrl = productDetail.productDetailImgUrl; this.shopInfo = productDetail.shopInfo; + }, + bindEvent() { + uni.$on('product-detail_add2Cart', this.add2Cart); }, chooseSpecs(item) { this.curProductSpecs = item; @@ -226,13 +233,25 @@ selector: '#pageAnchor' + index }) }, - toggleProductPickModal() { + toggleProductPickModal(e, orderNow) { + this.orderNow = orderNow ? true : false; if (this.ifShowPageMeta) { this.$refs.productPickPopup.close(); } else { this.$refs.productPickPopup.open(); - } - this.ifShowPageMeta = !this.ifShowPageMeta; + } + }, + changePopupState(e) { + this.ifShowPageMeta = e.show; + }, + add2Cart(totalPickCount) { + this.totalPickCount = totalPickCount; + this.toggleProductPickModal(); + }, + showShopDetail(shopInfo) { + uni.navigateTo({ + url: '../product/shop-detail?shopInfo='+ encodeURIComponent(JSON.stringify(shopInfo)) + }); } } } diff --git a/pages/product/product-pick.vue b/pages/product/product-pick.vue index 23c154d..c80fc79 100644 --- a/pages/product/product-pick.vue +++ b/pages/product/product-pick.vue @@ -1,6 +1,6 @@ @@ -50,6 +50,10 @@ specsList: { type: Array, default: [] + }, + orderNow: { + type: Boolean, + default: false } }, data() { @@ -83,6 +87,17 @@ }, chooseSpecs(item) { this.curSpec = item; + }, + submit() { + if (this.orderNow) { + // 从立即订购按钮进来的直接跳转到订单详情确认页 + uni.navigateTo({ + url: '../order/order-detail' + }) + } else { + // 从加入购物车按钮进来的触发父页面事件 + uni.$emit('product-detail_add2Cart', this.totalPickCount) + } } }, } @@ -103,7 +118,12 @@ } .certern-height-with-scroll { - height: 600rpx; + height: 600rpx; + margin-bottom: calc(100rpx - env(safe-area-inset-bottom)/2); overflow: scroll; + } + + .main-container { + padding-top: 45rpx; } diff --git a/pages/product/shop-detail.vue b/pages/product/shop-detail.vue new file mode 100644 index 0000000..a6d4307 --- /dev/null +++ b/pages/product/shop-detail.vue @@ -0,0 +1,109 @@ + + + + + diff --git a/style/blue/blue-topic.css b/style/blue/blue-topic.css index bb7e2cb..5504d70 100644 --- a/style/blue/blue-topic.css +++ b/style/blue/blue-topic.css @@ -20,4 +20,15 @@ .bg-gradual-color { background-image: linear-gradient(45deg, #0081ff, #1cbbb4); color: #ffffff; +} + +switch.main-color[checked] .wx-switch-input, +checkbox.main-color[checked] .wx-checkbox-input, +radio.main-color[checked] .wx-radio-input, +switch.main-color.checked .uni-switch-input, +checkbox.main-color.checked .uni-checkbox-input, +radio.main-color.checked .uni-radio-input { + background-color: #0081ff !important; + border-color: #0081ff !important; + color: #ffffff !important; } \ No newline at end of file diff --git a/style/default.css b/style/default.css index e5674c4..d14b6b9 100644 --- a/style/default.css +++ b/style/default.css @@ -1,5 +1,5 @@ .margin-bottom-with-bar { - margin-bottom: 130rpx; + margin-bottom: calc(120rpx + env(safe-area-inset-bottom) / 2) } .fixed-bottom-bar { @@ -14,4 +14,10 @@ position: fixed !important; z-index: 98; width: 100%; +} + +.sticky-bar { + z-index: 10; + position: sticky; + top: 0; } \ No newline at end of file