tjdd() {
var settlistIn = this.settlistIn;
console.log(settlistIn);
var settlist = [];
var goods_num = 0;
for (var i = 0; i < settlistIn.length; i++) {
var list = {};
list.id = settlistIn[i].id;
list.name = settlistIn[i].product_name;
list.img = settlistIn[i].product_img;
list.num = settlistIn[i].num;
goods_num = goods_num + Number(settlistIn[i].num);
settlist[i] = list;
}
console.log(JSON.stringify(settlist));
let data = {};
data.cat_info = JSON.stringify(settlist);
data.province = this.settlist.province;
data.city = this.settlist.city;
data.district = this.settlist.district;
data.address = this.settlist.address;
data.contact = this.settlist.phone;
data.business_name = this.settlist.name;
data.business_id = uni.getStorageSync('id');
data.goods_num = goods_num;
data.note = '';
data.order_money = this.yigong;
uni.request({
url: getApp().globalData.url+'/order/add',
method: 'POST',
data: qs.stringify(data),
header: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
Authorization: 'Bearer ' + uni.getStorageSync('token')
},
success: function(res) {
console.log(res);
if (res.data.code != 0) {
wx.showToast({
title: res.data.msg,
icon: 'none',
duration: 3000
});
} else {
wx.showToast({
title: '提交成功',
icon: 'success',
duration: 3000
});
uni.navigateTo({
url: '../details/details?id=' + res.data.data.id+'&type=index',
success: res => {},
fail: () => {},
complete: () => {}
});
}
}
});
}
2***@qq.com
最后怎么处理的
2022-07-08 18:19