|
@@ -90,35 +90,23 @@ Page({
|
|
|
|
|
|
},
|
|
},
|
|
submitOrder(){
|
|
submitOrder(){
|
|
- let that = this, goodsList = that.data.goodsList;
|
|
|
|
|
|
+ let that = this, goodsList = that.data.goodsList, address = that.data.address;
|
|
//生成订单
|
|
//生成订单
|
|
goodsList.forEach(res=>{
|
|
goodsList.forEach(res=>{
|
|
- res['userId'] = app.globalData.user_id, //'oovpNwjlsY6xx8ceCebFa1dOLd9E',
|
|
|
|
- res['adress'] = '虹漕路88号',
|
|
|
|
- res['area'] = '闵行区',
|
|
|
|
- res['city'] = '上海市',
|
|
|
|
- res['province'] = '上海市',
|
|
|
|
- res['consignee'] = '阿哥子',
|
|
|
|
- res['phone'] = '18888888888'
|
|
|
|
|
|
+ res['userId'] = app.globalData.user_id; //'oovpNwjlsY6xx8ceCebFa1dOLd9E',
|
|
|
|
+ res['adress'] = address.adress;
|
|
|
|
+ res['area'] = address.area;
|
|
|
|
+ res['city'] = address.city;
|
|
|
|
+ res['province'] = address.province;
|
|
|
|
+ res['consignee'] = address.consignee;
|
|
|
|
+ res['phone'] = address.phone;
|
|
|
|
+ delete res.imgArray
|
|
});
|
|
});
|
|
- // let params = {
|
|
|
|
- // userId: 'oovpNwjlsY6xx8ceCebFa1dOLd9E', //app.globalData.user_id,
|
|
|
|
- // adress: '',// string 街道
|
|
|
|
- // area: '闵行区',// string 区
|
|
|
|
- // city: '上海市',// string 市
|
|
|
|
- // province: '上海市',// string 省
|
|
|
|
- // consignee: '王勇',// string 收件人
|
|
|
|
- // phone: '15055166539',// string 收件人电话
|
|
|
|
- // shopCarList: [...that.data.goodsList]
|
|
|
|
- // }
|
|
|
|
wx.request({
|
|
wx.request({
|
|
url: host + '/createNewOrderCustomer',
|
|
url: host + '/createNewOrderCustomer',
|
|
method:'post',
|
|
method:'post',
|
|
- // header: {
|
|
|
|
- // 'content-type': 'application/x-www-form-urlencoded'
|
|
|
|
- // },
|
|
|
|
data: {
|
|
data: {
|
|
- shopCarList:goodsList
|
|
|
|
|
|
+ shopCarList:JSON.stringify(goodsList)
|
|
},
|
|
},
|
|
success(res){
|
|
success(res){
|
|
console.log(res)
|
|
console.log(res)
|