wxml:
提交订单
js部分:
submitList: function (e) {
var mark = e.detail.value;
var openId = app.globalData.openId;
var orderLists = this.data.orderLists;
var storeId = wx.getStorageSync('storeId');
var orderPrice = this.data.orderPrice;
var allPrice = this.data.allPrice;
var discount = this.data.discount;
var storeInfoList = this.data.storeInfoList;
var cupNumber = this.data.cupNumber;
var activityList = storeInfoList.activityList;
var orderStr = {
"shopId": storeId,
"openid": openId,
"rtPic": allPrice,
"actualMoney": orderPrice,
"discount": discount ,
"remark": mark,
"goodsNum": cupNumber
};
var ordersList = [];
for (var i = 0; i < orderLists.length; i++) {
ordersList[i] = {
'goodsName': orderLists[i].foodName,
'goodsId': orderLists[i].foodId,
"goodsPrice": orderLists[i].foodPrice,
"goodsNumber": orderLists[i].foodQuantity,
"detailPrice": orderLists[i].foodQuantity * orderLists[i].foodPrice
}
}
var orderStrJson = JSON.stringify(orderStr);
var detailListJson = JSON.stringify(ordersList);
wx.request({
url: url,
data: {
"orderStr": orderStrJson,
"detailList": detailListJson
},
header: {
'Content-Type': 'application/json'
},
method: "GET",
dataType: "json",
success: function(res) {
console.log(res);
wx.reLaunch({
url: '/pages/order/order'
})
}
})
}
微信小程序开发相关问题解答;本文来自微信小程序工厂 http://www.xcxgc.com 转载请保留。
微信小程序开发者回答:
西***:
把 bindtap 改成 catchtap 试试看
壮***:
wxml代码再多帖一点,从js里看不出啥异常呢
下载头像后保存到联系人,线上版本点击了没有反应addPhoneContact ...
G***:
catchtap 也一样的 点一下触发两次 改成bindtouchend 只触发一次 可以了
本文网址:http://www.91bianli.com/kaifazhinan/74248.html