Myth 5 years ago
parent
commit
396a15f5a8
  1. 8
      pages/map/index.wxml
  2. 43
      pages/user/order/list.js
  3. 1
      pages/user/order/list.wxml

8
pages/map/index.wxml

@ -64,12 +64,12 @@
<image bindtap="showImages" data-index="{{index}}" src="{{item}}" wx:for="{{info.info.listimg}}" mode="aspectFill"></image> <image bindtap="showImages" data-index="{{index}}" src="{{item}}" wx:for="{{info.info.listimg}}" mode="aspectFill"></image>
</view> </view>
<view class="map-item-menus" wx:if="{{menus.length>0}}"> <view class="map-item-menus" wx:if="{{menus.length>0}}">
<view bindtap="changeMenu" data-index="{{index}}" wx:for="{{menus}}" class="map-item-menu {{menuIndex==index?'active':''}}">{{item}}</view> <view bindtap="changeMenu" wx:if="{{item}}" data-index="{{index}}" wx:for="{{menus}}" class="map-item-menu {{menuIndex==index?'active':''}}">{{item}}</view>
</view> </view>
<view class="list"> <view class="list">
<view wx:for="{{productList}}" bindtap="gotoDetail" data-item="{{item}}"> <view wx:for="{{productList}}" bindtap="gotoDetail" data-item="{{item}}">
<view wx:if="{{menus[menuIndex]!='攻略'}}" class="item"> <view wx:if="{{menus[menuIndex]!='攻略'}}" class="item">
<image src="{{info.info.headimg}}" mode="aspectFill"></image> <image src="{{item.headimg}}" mode="aspectFill"></image>
<view class="right-info" style="display:flex;flex-direction:column;justify-content:space-between"> <view class="right-info" style="display:flex;flex-direction:column;justify-content:space-between">
<view> <view>
<view class="title textOver2">{{item.title}}</view> <view class="title textOver2">{{item.title}}</view>
@ -84,7 +84,7 @@
</view> </view>
</view> </view>
</view> </view>
<view wx:else class="right-info strategy-item"> <navigator url="/pages/info/strategyInfo/index?id={{item.id}}" wx:else class="right-info strategy-item">
<view class="title textOver2">{{item.title}}</view> <view class="title textOver2">{{item.title}}</view>
<view class="product-address textOver">{{item.subtitle}}</view> <view class="product-address textOver">{{item.subtitle}}</view>
<view class="product-bottom"> <view class="product-bottom">
@ -97,7 +97,7 @@
<view class="iconfont icon-eye"></view> <view class="iconfont icon-eye"></view>
<view>{{item.view_number}}</view> <view>{{item.view_number}}</view>
</view> </view>
</view> </navigator>
</view> </view>
<view bindtap="getProductList" wx:if="{{productList.length<productTotal}}" style="text-align:center;line-height:50rpx;font-size:26rpx;color:#666"> <view bindtap="getProductList" wx:if="{{productList.length<productTotal}}" style="text-align:center;line-height:50rpx;font-size:26rpx;color:#666">
查看更多 查看更多

43
pages/user/order/list.js

@ -11,7 +11,9 @@ Page({
list:[], list:[],
keywords:"", keywords:"",
orderState:app.globalData.orderState, orderState:app.globalData.orderState,
type:"" type:"",
lon:"",
lat:""
}, },
/** /**
@ -21,7 +23,17 @@ Page({
this.setData({ this.setData({
type:options.type type:options.type
}) })
this.getList() wx.getLocation({
type: 'gcj02',
success: (r)=>{
this.setData({
lon:r.longitude,
lat:r.latitude
})
this.getList();
}
})
}, },
changeKeyword:function(e){ changeKeyword:function(e){
this.setData({ this.setData({
@ -68,17 +80,36 @@ Page({
limit:10, limit:10,
keywords:this.data.keywords keywords:this.data.keywords
}).then(res=>{ }).then(res=>{
res.data.list.map(item=>{ let ajaxes = [],indexes=[]
res.data.list.map((item,index)=>{
let orderNum = 0; let orderNum = 0;
item.order_product_list.map(order=>{ item.order_product_list.map(order=>{
orderNum = orderNum + order.product_num; 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; item.orderNum = orderNum;
}) })
this.setData({ Promise.all(ajaxes).then((r)=>{
total:res.data.total, r.map((item,index)=>{
list:list.concat(res.data.list) 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){ gotoDetail:function(e){

1
pages/user/order/list.wxml

@ -39,6 +39,7 @@
</view> </view>
<!-- <view class="total"><text>共{{item.orderNum}}件商品</text><text style="margin-left:20rpx">合计</text> <text class="all-price">¥{{item.total_money/100}}</text></view> --> <!-- <view class="total"><text>共{{item.orderNum}}件商品</text><text style="margin-left:20rpx">合计</text> <text class="all-price">¥{{item.total_money/100}}</text></view> -->
<view class="btns"> <view class="btns">
<view wx:if="{{item.guihuaUrl}}" class="btn" catchtap="order" data-item="{{item}}">行程规划</view>
<view class="btn" catchtap="order" data-item="{{item}}">再次购买</view> <view class="btn" catchtap="order" data-item="{{item}}">再次购买</view>
<view catchtap="gotoComment" data-id="{{item.order_id}}" class="btn" wx:if="{{item.state=='WAIT_COMMENT'}}">立即评价</view> <view catchtap="gotoComment" data-id="{{item.order_id}}" class="btn" wx:if="{{item.state=='WAIT_COMMENT'}}">立即评价</view>
<view catchtap="cancel" data-index="{{index}}" class="btn" wx:if="{{item.state=='UNPAID'}}">取消预订</view> <view catchtap="cancel" data-index="{{index}}" class="btn" wx:if="{{item.state=='UNPAID'}}">取消预订</view>

Loading…
Cancel
Save