Commit 188cc4dc by 严立

LL - banner 跳转

parent 0050ff0e
Showing with 27 additions and 13 deletions
......@@ -338,7 +338,8 @@ App({
// 商品通用属性设置
let funcInfo = {
'id': funcInfoRaw.id,
'typeId': funcInfoRaw.genre, // 分类
'typeId': Number(funcInfoRaw.genre), // 分类
'shopId': funcInfoRaw.officeId, // 门店
'name': funcInfoRaw.name, // 名称
'cover': funcInfoRaw.ticketsImg, // 封面
'notificationId': funcInfoRaw.notificationId, // 购买须知
......@@ -353,6 +354,11 @@ App({
'dateValid': this.modular.miment().format('YYYY.MM.DD'), // 有效时间
'dateInvalid': funcInfoRaw.cardNam, // 失效时间
'quantity': 1,
'quantityMin': 1,
'quantityMax': 1,
'isActive': true
}
let funcUserType = wx.getStorageSync('userInfo').userType
......
......@@ -235,11 +235,10 @@ Page({
* @returns
*/
onBanner: function (event) {
return
let funcItme = event.currentTarget.dataset.item
// 月卡商品
funcItme.targetId = '94b7a6a7f82845d3a1875ee1e7a033fa'
// funcItme.targetId = '94b7a6a7f82845d3a1875ee1e7a033fa'
// 门票商品
// funcItme.targetId = '0ac170457a8546469976753ea21cd8e9'
......@@ -253,7 +252,7 @@ Page({
// 餐品
// funcItme.targetId = '329f304aca104ff1887dde5877e15126'
funcItme.targetType = 4
// funcItme.targetType = 4
let funcUrl = ''
if (funcItme.targetType) {
......@@ -285,17 +284,17 @@ Page({
case 3:
// 攻略详情
if (funcItme.targetId) {
if (funcItme.targetId === '') return
funcUrl = '/pages/play/strategy-detail/strategy-detail?id=' + funcItme.targetId
wx.navigateTo({
url: funcUrl
})
}
break
case 4:
// 商品
// 跳转商品下单,需要查询商品参数
if (funcItme.targetId === '') return
App.wxRequest({
url: '/api/v1/commodity/getCommodityParticulars',
data: {
......@@ -304,15 +303,24 @@ Page({
success: (response) => {
console.log(response)
console.log(App.setCommodityInfo(response.data))
let funcCommodityInfo = App.setCommodityInfo(response.data)
let funcShopInfo = App.globalData.shopId
for (let i = 0, l = funcShopInfo.length; i < l; i++) {
if (funcCommodityInfo.shopId === funcShopInfo[i].id) {
App.setShopInfo(funcShopInfo[i].appId, funcCommodityInfo.typeId)
break
}
}
})
// if (funcItme.targetId) {
// funcUrl = '/pages/pay/order-input/order-input?type=' + funcItme.targetId
// wx.navigateTo({
// url: funcUrl
// })
// }
wx.setStorageSync('shoppingCartBuffer', [funcCommodityInfo])
funcUrl = '/pages/pay/order-input/order-input?type=' + funcCommodityInfo.typeId
wx.navigateTo({
url: funcUrl
})
}
})
break
}
}
......
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