Commit 146b7fdba6be159093760beaba2933dc3ad73dbf

Authored by wangfan
1 parent 0e05c2fa

golist

... ... @@ -11,7 +11,7 @@
<view wx:if="{{hasSlogan && seller.slogan}}" class="slogan">“{{seller.slogan}}”</view>
<view class="text flex-ll">
<view class="text-item" wx:if="{{seller.cate[0].name}}">{{seller.cate[0].name}}</view>
<view class="text-item" wx:if="{{seller.distance}}">距当前位置{{se.distance}}</view>
<view class="text-item" wx:if="{{seller.distance}}">距当前位置{{seller.distance}}</view>
</view>
<view wx:if="{{hasStat}}" class="stat">
<stat stat="{{seller.score}}"></stat>
... ...
... ... @@ -121,7 +121,7 @@ Page({
App.Customer.SellerLists(this.param).then(res=>{
this.setData({
hasMore:res.data.length==this.size,
markers:res.data,
markers:this.sellerFormat(res.data),
})
this.triggerEvent('event',{type:'getListEnd',total:res.data.length})
})
... ... @@ -132,7 +132,7 @@ Page({
App.Customer.SellerLists(this.param).then(res=>{
this.setData({
hasMore:res.data.length==this.size,
markers:markers.concat(res.data),
markers:markers.concat(this.sellerFormat(res.data)),
})
})
},
... ... @@ -190,4 +190,17 @@ Page({
url:'/pages/reserve/detail?id='+util.attr(e,'sid')
})
},
sellerFormat(sellers){
sellers.forEach((seller) => {
if(seller.distance) {
seller.distance = parseInt(seller.distance);
if (seller.distance > 1000) {
seller.distance = (seller.distance / 1000).toFixed(2) + '公里'
} else {
seller.distance += '米';
}
}
})
return sellers;
}
})
\ No newline at end of file
... ...