Commit 330c65f6 by 严立

LL - 代码合并

parent 01a66768
......@@ -58,6 +58,7 @@ Page({
}
this.queryCommodity()
if (this.data.shopInfo.appId === 3) this.queryCommodityChild()
},
queryCommodity: function () {
......@@ -159,8 +160,117 @@ Page({
this.setData({
winLoading: false,
commodityList: funcCommodityList,
commodityList: this.data.commodityList.concat(funcCommodityList),
})
console.log('1111', this.data.commodityList)
},
})
},
queryCommodityChild: function () {
this.setData({
shopInfo: wx.getStorageSync('shopInfoBuffer')
})
App.wxRequest({
url: '/api/v1/commodity/getCommoditys',
data: {
'officeId': this.data.shopInfo.id,
'genre': 3,
},
success: (response) => {
let funcCommodityList = []
let funcResponse = response.data
switch (3) {
// 年卡月卡
case 1:
for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = {
'id': funcResponse[i].id, // 商品标识
'typeId': funcResponse[i].genre, // 商品类型
'inventoriesId': funcResponse[i].inventorie[0].inventoriesId, // 仓库标识
'name': funcResponse[i].name,
'cover': funcResponse[i].coverImg, // 商品封面
'price': funcResponse[i].inventorie[0].sightseerPrice, // 普通价
'priceText': App.modular.utils.formatAmount(funcResponse[i].inventorie[0].sightseerPrice), // 普通价文本格式
'priceSpecial': funcResponse[i].inventorie[0].ownerPrice, // 业主价
'priceSpecialText': App.modular.utils.formatAmount(funcResponse[i].inventorie[0].ownerPrice), // 业主价文本格式
'priceDiscount': funcResponse[i].inventorie[0].price, // 活动价
'priceDiscountText': App.modular.utils.formatAmount(funcResponse[i].inventorie[0].price), // 活动价文本格式
'priceType': 1,
'describe': funcResponse[i].synopsis,
'tags': funcResponse[i].tags,
'notificationId': funcResponse[i].notificationId, // 下单须知
}
let funcUserType = wx.getStorageSync('userInfo').userType
// 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
if (funcItem.priceDiscount) {
funcItem.priceType = 1
} else {
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if (funcItem.price !== funcItem.priceSpecial && funcUserType) {
funcItem.priceType = 2
} else {
funcItem.priceType = 3
}
}
funcCommodityList.push(funcItem)
}
break
// 普通商品
case 2:
// 门票商品
case 3:
default:
for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = {
'id': funcResponse[i].id, // 商品标识
'typeId': funcResponse[i].genre, // 商品分类标识
'inventoriesId': funcResponse[i].inventoriesId, // 仓库标识
'name': funcResponse[i].name,
'cover': funcResponse[i].coverImg, // 商品封面
'price': funcResponse[i].sightseerPrice, // 普通价
'priceText': App.modular.utils.formatAmount(funcResponse[i].sightseerPrice), // 普通价文本格式
'priceSpecial': funcResponse[i].ownerPrice, // 业主价
'priceSpecialText': App.modular.utils.formatAmount(funcResponse[i].ownerPrice), // 业主价文本格式
'priceDiscount': funcResponse[i].price, // 活动价
'priceDiscountText': App.modular.utils.formatAmount(funcResponse[i].price), // 活动价文本格式
'priceType': 1,
'describe': funcResponse[i].synopsis,
'tags': funcResponse[i].tags,
'notificationId': funcResponse[i].notificationId, // 下单须知
}
let funcUserType = wx.getStorageSync('userInfo').userType
// 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
if (funcItem.priceDiscount) {
funcItem.priceType = 1
} else {
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if (funcItem.price !== funcItem.priceSpecial && funcUserType) {
funcItem.priceType = 2
} else {
funcItem.priceType = 3
}
}
funcCommodityList.push(funcItem)
}
break
}
this.setData({
winLoading: false,
commodityList: this.data.commodityList.concat(funcCommodityList),
})
console.log('2222', this.data.commodityList)
},
})
},
......@@ -176,7 +286,7 @@ Page({
wx.setStorageSync('shoppingCartBuffer', [funcCommodityInfo])
wx.navigateTo({
url: '/pages/pay/order-input/order-input?type=' + this.data.shopInfo.shopType
url: '/pages/pay/order-input/order-input?type=' + funcCommodityInfo.typeId
})
},
})
\ No newline at end of file
......@@ -2,6 +2,8 @@ const App = getApp()
Page({
data: {
imageBase: App.globalData.appImageBase,
resourcesBase: App.globalData.appResourcesBase,
// formType: 1,
// entryComplete: false,
......
......@@ -3,7 +3,7 @@
<view class="entry-complete row con-c align-c" wx:if="{{entryComplete}}">
<view class="entry-complete-tip">
<image src="./image/tip-1.png"></image>
<image src="./image/tip.png"></image>
<l-button l-class="button" plain="{{true}}" bind:lintap="onEntryComplete">我知道了</l-button>
</view>
</view>
......@@ -96,11 +96,11 @@
</view>
<view class="input-wrap row con-b align-c" style="padding: 0">
<l-button special="{{true}}" bind:lintap="onQuantityCut">
<image class="input-icon" src="../../image/cut.png"></image>
<image class="input-icon" src="{{imageBase + 'icon/cut-1.png'}}"></image>
</l-button>
<text>{{formInto.quantity}}</text>
<l-button special="{{true}}" bind:lintap="onQuantityAdd">
<image class="input-icon" src="../../image/add.png"></image>
<image class="input-icon" src="{{imageBase + 'icon/add-1.png'}}"></image>
</l-button>
</view>
</view>
......
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