|
|
|
@ -11,7 +11,9 @@ Page({ |
|
|
|
list:[], |
|
|
|
keywords:"", |
|
|
|
orderState:app.globalData.orderState, |
|
|
|
type:"" |
|
|
|
type:"", |
|
|
|
lon:"", |
|
|
|
lat:"" |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
@ -21,7 +23,17 @@ Page({ |
|
|
|
this.setData({ |
|
|
|
type:options.type |
|
|
|
}) |
|
|
|
this.getList() |
|
|
|
wx.getLocation({ |
|
|
|
type: 'gcj02', |
|
|
|
success: (r)=>{ |
|
|
|
this.setData({ |
|
|
|
lon:r.longitude, |
|
|
|
lat:r.latitude |
|
|
|
}) |
|
|
|
this.getList(); |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
changeKeyword:function(e){ |
|
|
|
this.setData({ |
|
|
|
@ -68,17 +80,36 @@ Page({ |
|
|
|
limit:10, |
|
|
|
keywords:this.data.keywords |
|
|
|
}).then(res=>{ |
|
|
|
res.data.list.map(item=>{ |
|
|
|
let ajaxes = [],indexes=[] |
|
|
|
res.data.list.map((item,index)=>{ |
|
|
|
let orderNum = 0; |
|
|
|
item.order_product_list.map(order=>{ |
|
|
|
orderNum = orderNum + order.product_num; |
|
|
|
}) |
|
|
|
if(item.order_product_list.length==1 && item.order_product_list[0].scene_id && item.state!='UNPAID' && item.state!='CLOSED' && item.state.indexOf("REFUND")==-1){ |
|
|
|
let ajax = commonApi.user_post("order/tripplan",{ |
|
|
|
point_type: "gd", |
|
|
|
child_order_id:item.order_product_list[0].child_order_id, |
|
|
|
lat:this.data.lat, |
|
|
|
lon:this.data.lon |
|
|
|
}) |
|
|
|
ajaxes.push(ajax); |
|
|
|
indexes.push(index); |
|
|
|
} |
|
|
|
item.orderNum = orderNum; |
|
|
|
}) |
|
|
|
this.setData({ |
|
|
|
total:res.data.total, |
|
|
|
list:list.concat(res.data.list) |
|
|
|
Promise.all(ajaxes).then((r)=>{ |
|
|
|
r.map((item,index)=>{ |
|
|
|
if(item && item.data && item.data.url){ |
|
|
|
res.data.list[indexes[index]].guihuaUrl = item.data.url |
|
|
|
} |
|
|
|
this.setData({ |
|
|
|
total:res.data.total, |
|
|
|
list:list.concat(res.data.list) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
gotoDetail:function(e){ |
|
|
|
|