diff --git a/components/product/productCard.vue b/components/product/productCard.vue index d7fbdf8..9717744 100644 --- a/components/product/productCard.vue +++ b/components/product/productCard.vue @@ -29,7 +29,7 @@ {{ `已售出 ${data.sales}单` }} - + @@ -64,8 +64,8 @@ } }, methods: { - goToPlaceOrder() { - // todo + goToPlaceOrder(id) { + this.$utils.navigateTo(`/pages_order/product/productDetail?id=${id}`) } }, } diff --git a/pages.json b/pages.json index 7250bd8..ac0bcd2 100644 --- a/pages.json +++ b/pages.json @@ -48,7 +48,12 @@ }, "subPackages": [{ "root": "pages_order", - "pages": [{ + "pages": [ + { + "path": "product/productDetail" + }, + + { "path": "mine/partner" }, { @@ -66,9 +71,6 @@ { "path": "mine/address" }, - { - "path": "product/productDetail" - }, { "path": "auth/wxLogin" }, diff --git a/pages/index/category.vue b/pages/index/category.vue index 37c3289..e093f3b 100644 --- a/pages/index/category.vue +++ b/pages/index/category.vue @@ -100,6 +100,11 @@ return { mixinsListApi: 'queryItemList', current : 0, + queryParams: { + pageNo: 1, + pageSize: 10, + title: null, + }, } }, computed: { @@ -109,9 +114,13 @@ search, cid }) { + if (search) { this.queryParams.title = search } + + // todo: check + return // this.$store.commit('getCategoryList') if(this.category.length > 0 && cid){ this.category.forEach((n, i) => { diff --git a/pages/index/index.vue b/pages/index/index.vue index dead682..8a2de41 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -15,7 +15,7 @@ - + diff --git a/pages_order/product/productDetail.vue b/pages_order/product/productDetail.vue index 39ea245..58fbded 100644 --- a/pages_order/product/productDetail.vue +++ b/pages_order/product/productDetail.vue @@ -1,110 +1,71 @@ @@ -126,6 +87,18 @@ details: '', }, id: 0, + role: 'member-business', // member-personal | member-business + } + }, + computed: { + bannerList() { + const { image } = this.productDetail + + if (!image) { + return [] + } + + return Array.isArray(image) ? image : image.split(',') } }, onLoad(args) { @@ -134,25 +107,21 @@ onShow() { this.getRiceProductDetail() }, - methods: { - // 分享商品 - share() { + onShareAppMessage(res) { + const { + title, + } = this.productDetail - }, - // 加入购物车 - addCart(){ - this.$api('addCart', { - shopId : this.id, - num : 1, - }, res => { - if(res.code == 200){ - uni.showToast({ - title: '加入购物车成功', - icon: 'none' - }) - } - }) - }, + // todo: check + let o = { + title: title, + imageUrl: bannerList[0], + query: `id=${this.productDetail.id}`, + } + + return o + }, + methods: { // 立即下单 submit() { this.$store.commit('setPayOrderProduct', [ @@ -172,6 +141,20 @@ }, // 获取商品 getRiceProductDetail() { + // todo: delete test data + + const TEMP_BANNER_IMG_URL = 'http://gips3.baidu.com/it/u=70459541,3412285454&fm=3028&app=3028&f=JPEG&fmt=auto?w=960&h=1280' + + this.productDetail = { + image: new Array(4).fill(1).map(() => TEMP_BANNER_IMG_URL), + price: 99, + sales: 235, + title: '60分钟肩颈推拿按摩', + tags: ['专业技师', '舒适环境', '深度放松'], + details: '

这里是商品详情..............
这里是商品详情..............

' + } + + return this.$api('getRiceProductDetail', { id: this.id }, res => { @@ -181,118 +164,181 @@ } }) }, - // 联系客服 - service() { - this.$refs.customerServicePopup.open() - }, } } \ No newline at end of file diff --git a/pages_order/static/productDetail/icon-share.png b/pages_order/static/productDetail/icon-share.png new file mode 100644 index 0000000..1f8b7a7 Binary files /dev/null and b/pages_order/static/productDetail/icon-share.png differ diff --git a/pages_order/static/productDetail/temp-product.png b/pages_order/static/productDetail/temp-product.png new file mode 100644 index 0000000..49a8ced Binary files /dev/null and b/pages_order/static/productDetail/temp-product.png differ