Commit 61ac35fc by wjw

ww--SPA门店详情修改

parent c8b2ef96
......@@ -64,6 +64,7 @@ Page({
detailEvaluate: [], // 评论
evaluateAlbum: [],
emptyImg: App.globalData.appResourcesBase + 'play/service/nothing.jpg',
isBlack: false,
......@@ -458,7 +459,6 @@ Page({
success: (response) => {
let funcCommodityList = []
let funcResponse = response.data
console.log(JSON.stringify(funcResponse))
for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = {
'id': funcResponse[i].id, // 商品标识
......@@ -653,9 +653,26 @@ Page({
onBuyCommodity: function (event) {
let id = event.currentTarget.dataset.id
let classifyId = event.currentTarget.dataset.classid
wx.navigateTo({
url: '/pages/commodity/menu-food/menu-food?commodityId=' + id + '&sideBarId=' + classifyId
})
console.log(this.data.option)
switch (Number(this.data.option.id)) {
case 7:
let funcCommodityInfo = this.data.detailCommodity.filter(v => v.id === id)[0]
funcCommodityInfo.quantity = 1
funcCommodityInfo.quantityMin = 1
funcCommodityInfo.quantityMax = 1
funcCommodityInfo.isActive = true
wx.setStorageSync('shoppingCartBuffer', [funcCommodityInfo])
wx.navigateTo({
url: '/pages/play/service-sell/service-sell'
})
break
default:
wx.navigateTo({
url: '/pages/commodity/menu-food/menu-food?commodityId=' + id + '&sideBarId=' + classifyId
})
}
},
// 跳转到能量补给站
onBuySnacks(event) {
......
......@@ -126,7 +126,7 @@
<block wx:for="{{detailCommodity}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="commodity-card-item col">
<view class="commodity-card-item-cover row con-c align-c">
<image mode="aspectFit" src="{{item.img[0]}}"></image>
<image mode="aspectFit" src="{{item.img[0] ? item.img[0] : emptyImg}}"></image>
</view>
<view class="commodity-card-item-title row con-b align-c">
<text>{{item.name}}</text>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment