diff --git a/pages/info/postProductInfo/index.js b/pages/info/postProductInfo/index.js index c38f82f..5135dbe 100644 --- a/pages/info/postProductInfo/index.js +++ b/pages/info/postProductInfo/index.js @@ -30,7 +30,8 @@ Page({ shareImg: null, showShareFlag: false, allowance_data: null, - showAllowance: false + showAllowance: false, + tjList: [], //推荐商品列表 }, /** @@ -108,6 +109,20 @@ Page({ }) }) + commonApi._post("product/get_product_by_type", { + offset: 0, + limit: 6, + rand: true, + type: 'post' + }).then(res => { + try { + this.setData({ + tjList: res.data.list + }) + } catch (error) { + console.log(error); + } + }) }, changeAllowance: function () { this.setData({ @@ -263,64 +278,64 @@ Page({ if (res && res.code != 1) { return; } else { - if (this.data.skuFlag == 'order') { - util.pagePoint({ - event: 'product_order', - param: { - id: this.data.info.id, - type: this.data.info.type - } - }, 1) - wx.setStorageSync('login_from', 'product_order_login') - wx.setStorageSync('order_from', 'product_order_submit') - app.globalData.couponInfo = null; - // 购买 - let product = [{ - product: this.data.info, - sku: this.data.info.sku[this.data.skuIndex], - productNum: this.data.producNum - }]; - app.globalData.postProduct = product; - app.globalData.retailId = this.data.retailId; - wx.navigateTo({ - url: '/pages/order/postOrder/index', - }) - } else { - commonApi.user_post("cart/add_sku", { - sku_id: this.data.info.sku[this.data.skuIndex].id, - num: this.data.producNum - }).then(res => { - if (res.code == 1) { - commonApi.user_post('cart/get_list', {}).then(res => { - this.setData({ - cartCount: res.data.length - }) + if (this.data.skuFlag == 'order') { + util.pagePoint({ + event: 'product_order', + param: { + id: this.data.info.id, + type: this.data.info.type + } + }, 1) + wx.setStorageSync('login_from', 'product_order_login') + wx.setStorageSync('order_from', 'product_order_submit') + app.globalData.couponInfo = null; + // 购买 + let product = [{ + product: this.data.info, + sku: this.data.info.sku[this.data.skuIndex], + productNum: this.data.producNum + }]; + app.globalData.postProduct = product; + app.globalData.retailId = this.data.retailId; + wx.navigateTo({ + url: '/pages/order/postOrder/index', }) - // 加动效 - this.setData({ - skuFlag: null, - aniSkuIndex: this.data.skuIndex, - cartImgInfo: null + } else { + commonApi.user_post("cart/add_sku", { + sku_id: this.data.info.sku[this.data.skuIndex].id, + num: this.data.producNum + }).then(res => { + if (res.code == 1) { + commonApi.user_post('cart/get_list', {}).then(res => { + this.setData({ + cartCount: res.data.length + }) + }) + // 加动效 + this.setData({ + skuFlag: null, + aniSkuIndex: this.data.skuIndex, + cartImgInfo: null + }) + setTimeout(() => { + this.setData({ + aniSkuIndex: -1 + }) + wx.showModal({ + title: "提示", + content: "去购物车结算?", + success: function (res) { + if (res.confirm) { + wx.navigateTo({ + url: '/pages/user/cartlist/list', + }) + } + } + }) + }, 650) + } }) - setTimeout(() => { - this.setData({ - aniSkuIndex: -1 - }) - wx.showModal({ - title: "提示", - content: "去购物车结算?", - success: function (res) { - if (res.confirm) { - wx.navigateTo({ - url: '/pages/user/cartlist/list', - }) - } - } - }) - }, 650) } - }) - } } }) @@ -592,6 +607,24 @@ Page({ ctx.fillText(row[b], x, y + b * 40 * ratio, canvasWidth); } }, + gotoDetail: function (e) { + let item = e.currentTarget.dataset.item; + util.pagePoint({ + event: 'recommend_click', + param: { + id: item.id, + type: item.type + } + }, 1) + if (item.type == 'travels') { + // 游记做特殊处理 其他都按照原来的来 + wx.navigateTo({ + url: '/pages/info/strategyInfo/index?id=' + item.s_id, + }) + } else { + util.gotoDetail(item); + } + }, /** * 生命周期函数--监听页面初次渲染完成 */ diff --git a/pages/info/postProductInfo/index.wxml b/pages/info/postProductInfo/index.wxml index d9fb7cd..4a088a5 100644 --- a/pages/info/postProductInfo/index.wxml +++ b/pages/info/postProductInfo/index.wxml @@ -2,10 +2,8 @@ - - + + @@ -54,22 +52,20 @@ - 游客点评{{info.rate}}分 - 共{{commentTotal}}条 > - + 游客点评{{info.rate}}分 + 共{{commentTotal}}条 > + 这里空空如也,快去点评吧! - + {{item.nickname}} - + @@ -78,9 +74,9 @@ - - 共{{item.img_list.length}}张 - 查看全部 + + 共{{item.img_list.length}}张 + 查看全部 @@ -88,6 +84,26 @@ 查看全部点评 + + + + + + + + + + + + + {{item.title}} + + {{item.price/100}} + + + + + @@ -107,8 +123,7 @@ - + {{cartCount}} @@ -127,8 +142,7 @@ - {{item.sku_name}} + {{item.sku_name}} 数量 @@ -162,8 +176,7 @@ - + diff --git a/pages/info/postProductInfo/index.wxss b/pages/info/postProductInfo/index.wxss index ec28d92..5896343 100644 --- a/pages/info/postProductInfo/index.wxss +++ b/pages/info/postProductInfo/index.wxss @@ -842,4 +842,62 @@ page { color: #666; font-size: 24rpx; margin-top: 8rpx; +} +.proad{ + margin: 20rpx; +} +.proad-title{ + display: flex; + align-items: center; + justify-content: center; + margin-bottom: 16rpx; +} +.proad-title image{ + width: 292rpx; + height: 34rpx; +} +.pro-list{ + display: flex; + justify-content: space-between; + align-items: center; + flex-wrap: wrap; +} +.proitem{ + width: 226rpx; + height: 234rpx; + background: #FFFFFF; + border-radius: 10rpx; + margin-top: 20rpx; +} +.item-hd image{ + width: 226rpx; + height: 130rpx; + border-radius: 10rpx 10rpx 0px 0px; +} +.item-bm{ + padding: 8rpx 12rpx; +} +.protitle{ + font-size: 28rpx; + font-family: PingFang SC; + font-weight: 400; + color: #000000; +} +.pro-price{ + color: #D62828; + font-weight: 500; + font-size: 30rpx; +} +.pro-price:before { + display: inline-block; + content:"¥"; + color: #D62828; + font-size: 20rpx; +} + +.pro-price:after { + display: inline-block; + content:'起'; + color: #999999; + font-size: 10px; } \ No newline at end of file diff --git a/pages/info/sceneProductInfo/index.js b/pages/info/sceneProductInfo/index.js index 4337e9f..9ff83c7 100644 --- a/pages/info/sceneProductInfo/index.js +++ b/pages/info/sceneProductInfo/index.js @@ -250,7 +250,7 @@ Page({ // }, selectSku: function (e) { console.log(e.currentTarget.dataset.item); - if (e.currentTarget.dataset.item.stock == 0) { + if (e.currentTarget.dataset.item.stock == 0 && e.currentTarget.dataset.item.is_third_stock!=1) { wx.showToast({ title: "该商品暂无库存", icon: 'none' diff --git a/pages/user/order/postOrderInfo/index.js b/pages/user/order/postOrderInfo/index.js index 3f28c4e..8982e37 100644 --- a/pages/user/order/postOrderInfo/index.js +++ b/pages/user/order/postOrderInfo/index.js @@ -20,7 +20,9 @@ Page({ minute:"", second:"", id:null, - pay_methods:app.globalData.pay_methods + pay_methods:app.globalData.pay_methods, + tjList:[], + showLoading:true }, /** @@ -30,7 +32,23 @@ Page({ this.setData({ id:options.id }) - + commonApi._post("product/get_product_by_type", { + offset: 0, + limit: 6, + rand: true, + type:"venue,post,line,ticket" + }).then(res => { + this.setData({ + showLoading:false + }) + try { + this.setData({ + tjList: res.data.list + }) + } catch (error) { + console.log(error); + } + }) }, close:function(){ let _this = this,info = _this.data.info; @@ -189,6 +207,25 @@ Page({ this.daojishi(time); },1000) }, + + gotoDetail: function (e) { + let item = e.currentTarget.dataset.item; + util.pagePoint({ + event: 'recommend_click', + param: { + id: item.id, + type: item.type + } + }, 1) + if (item.type == 'travels') { + // 游记做特殊处理 其他都按照原来的来 + wx.navigateTo({ + url: '/pages/info/strategyInfo/index?id=' + item.s_id, + }) + } else { + util.gotoDetail(item); + } + }, /** * 生命周期函数--监听页面显示 */ @@ -234,7 +271,6 @@ Page({ * 生命周期函数--监听页面卸载 */ onUnload: function () { - }, /** diff --git a/pages/user/order/postOrderInfo/index.wxml b/pages/user/order/postOrderInfo/index.wxml index 329d809..b60f190 100644 --- a/pages/user/order/postOrderInfo/index.wxml +++ b/pages/user/order/postOrderInfo/index.wxml @@ -12,6 +12,23 @@ {{info.order_product_list[0].consignee_info.name}}{{info.order_product_list[0].consignee_info.tel}} {{info.order_product_list[0].consignee_info.address}} + + 商品推荐 + 加载中... + + + + + + + {{item.title}} + + {{item.price/100}} + + + + + diff --git a/pages/user/order/postOrderInfo/index.wxss b/pages/user/order/postOrderInfo/index.wxss index 4e93140..eeab2be 100644 --- a/pages/user/order/postOrderInfo/index.wxss +++ b/pages/user/order/postOrderInfo/index.wxss @@ -291,4 +291,57 @@ page { font-size: 24rpx; color: #999; margin-top: 30rpx; +} +.tj-title{ +font-size: 30rpx; +font-family: PingFang SC; +font-weight: 500; +color: #333333; +} +.tj-list{ + display: flex; + align-items: center; + overflow-x: scroll; + overflow-y: hidden; +} + +.proitem{ + width: 226rpx; + height: 234rpx; + background: #F5F5F5; + border-radius: 10rpx; + margin-top: 20rpx; + margin-right: 20rpx; +} +.item-hd image{ + width: 226rpx; + height: 130rpx; + border-radius: 10rpx 10rpx 0px 0px; +} +.item-bm{ + padding: 8rpx 12rpx; +} +.protitle{ + font-size: 28rpx; + font-family: PingFang SC; + font-weight: 400; + color: #000000; +} +.pro-price{ + color: #D62828; + font-weight: 500; + font-size: 30rpx; +} +.pro-price:before { + display: inline-block; + content:"¥"; + color: #D62828; + font-size: 20rpx; +} + +.pro-price:after { + display: inline-block; + content:'起'; + color: #999999; + font-size: 10px; } \ No newline at end of file