|
|
@ -561,6 +561,79 @@ const detailPagePoint = function (url, res) { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// app 要传进来 util 获取不到
|
|
|
|
|
|
const orderByShoppingCart = function (listData, app) { |
|
|
|
|
|
let productType,flag,isCar; |
|
|
|
|
|
commonApi.user_post('wx/get_user_keep', { |
|
|
|
|
|
jumpurl: '/pages/user/cartlist/list', |
|
|
|
|
|
title: '购物车', |
|
|
|
|
|
type: 'mini' |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
if (res.data.subscribe == 0) { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
wxqrcode: res.data.qrcode, |
|
|
|
|
|
showQrCode: true |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
app.globalData.couponInfo = null; |
|
|
|
|
|
let list = listData, product = [], product1 = [] |
|
|
|
|
|
list.map(item => { |
|
|
|
|
|
// item.product.type="post";
|
|
|
|
|
|
if (item.product.type == 'post') { |
|
|
|
|
|
product.push({ |
|
|
|
|
|
product: item.product, |
|
|
|
|
|
sku: item.sku, |
|
|
|
|
|
productNum: item.num |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
product1.push(item) |
|
|
|
|
|
app.globalData.list = product1 |
|
|
|
|
|
} |
|
|
|
|
|
if (item.product.type.includes('post')) { |
|
|
|
|
|
productType = 'post' |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
if (product.length == 0 && product1.length == 0) { |
|
|
|
|
|
wx.showToast({ |
|
|
|
|
|
title: '请先选择产品', |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}) |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
if (product.length > 0 && product1.length > 0) { |
|
|
|
|
|
flag = "mix"; |
|
|
|
|
|
isCar = "multiple" |
|
|
|
|
|
} |
|
|
|
|
|
if (product1.length > 1) { |
|
|
|
|
|
isCar = "multiple" |
|
|
|
|
|
} else { |
|
|
|
|
|
isCar = "single" |
|
|
|
|
|
} |
|
|
|
|
|
console.log(product1,'product1'); |
|
|
|
|
|
|
|
|
|
|
|
app.globalData.listName = null |
|
|
|
|
|
if (product1.length>0) { |
|
|
|
|
|
app.globalData.listName = 'car' |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
app.globalData.postProduct = product; |
|
|
|
|
|
if (app.globalData.list) { |
|
|
|
|
|
app.globalData.index = 0 |
|
|
|
|
|
app.globalData.product = app.globalData.list[app.globalData.index] |
|
|
|
|
|
} |
|
|
|
|
|
if (productType == 'post') { |
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
url: '/pages/order/postOrder/index?from=cart&flag=' + flag, |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
url: '/subPackages/gwcOrder/index?isCar=' + isCar, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = { |
|
|
module.exports = { |
|
|
formatTime: formatTime, |
|
|
formatTime: formatTime, |
|
|
@ -586,4 +659,5 @@ module.exports = { |
|
|
getGlobalPagePoint: getGlobalPagePoint, |
|
|
getGlobalPagePoint: getGlobalPagePoint, |
|
|
clearGlobalPagePoint: clearGlobalPagePoint, |
|
|
clearGlobalPagePoint: clearGlobalPagePoint, |
|
|
detailPagePoint: detailPagePoint, |
|
|
detailPagePoint: detailPagePoint, |
|
|
|
|
|
orderByShoppingCart: orderByShoppingCart, |
|
|
} |
|
|
} |
|
|
|