Commit 50efee182919442a287cae28b7b9a2c108a299c7

Authored by vking
1 parent ae6477b5

fix map & api

@@ -10,7 +10,7 @@ Page({ @@ -10,7 +10,7 @@ Page({
10 * 页面的初始数据 10 * 页面的初始数据
11 */ 11 */
12 data: { 12 data: {
13 - list: [], 13 + list: [[],[],[],[],[]],
14 total: 0, 14 total: 0,
15 tabType:1, 15 tabType:1,
16 hasMore:true, 16 hasMore:true,
@@ -55,8 +55,9 @@ Page({ @@ -55,8 +55,9 @@ Page({
55 55
56 }, 56 },
57 getListData() { 57 getListData() {
  58 + let tabType=this.tabType
58 App.Customer.GetMyOrder({ 59 App.Customer.GetMyOrder({
59 - type: this.tabType, 60 + type: tabType,
60 openid: getApp().openid, 61 openid: getApp().openid,
61 offset:this.offset, 62 offset:this.offset,
62 limit:this.limit, 63 limit:this.limit,
@@ -68,7 +69,7 @@ Page({ @@ -68,7 +69,7 @@ Page({
68 this.offset+=this.limit 69 this.offset+=this.limit
69 } 70 }
70 this.setData({ 71 this.setData({
71 - list: this.data.list.concat(data), 72 + [`list[`+tabType+`]`]: this.data.list[tabType].concat(data),
72 hasMore:this.hasMore 73 hasMore:this.hasMore
73 }) 74 })
74 if(res.data.length==0){ 75 if(res.data.length==0){
@@ -129,7 +130,7 @@ Page({ @@ -129,7 +130,7 @@ Page({
129 this.tabType=util.attr(e,'type') 130 this.tabType=util.attr(e,'type')
130 this.setData({ 131 this.setData({
131 tabType:this.tabType, 132 tabType:this.tabType,
132 - list: [], 133 + list: [[],[],[],[],[]],
133 hasMore:false 134 hasMore:false
134 }) 135 })
135 this.getListData() 136 this.getListData()
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 </view> 14 </view>
15 </block> 15 </block>
16 <block wx:else=""> 16 <block wx:else="">
17 - <block wx:for="{{list}}" wx:key="success.key" wx:for-item="detail" wx:for-index="dateIndex"> 17 + <block wx:for="{{list[tabType]}}" wx:key="success.key" wx:for-item="detail" wx:for-index="dateIndex">
18 <view class="card"> 18 <view class="card">
19 <card 19 <card
20 hasShowStatus bindevent="gotoDetail" 20 hasShowStatus bindevent="gotoDetail"
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
23 </block> 23 </block>
24 </block> 24 </block>
25 </view> 25 </view>
26 -<block wx:if="{{list.length==0 && rsl.length>0}}"> 26 +<block wx:if="{{list[tabType].length==0 && rsl.length>0}}">
27 <view class="rsl-block"> 27 <view class="rsl-block">
28 <view class="line-push">为你推荐</view> 28 <view class="line-push">为你推荐</view>
29 <view class="transverse-list"> 29 <view class="transverse-list">
@@ -47,7 +47,7 @@ class rpcm { @@ -47,7 +47,7 @@ class rpcm {
47 set(key,type='',res=null) { 47 set(key,type='',res=null) {
48 let nt = new Date().getTime() 48 let nt = new Date().getTime()
49 this.tasks[key] = { 49 this.tasks[key] = {
50 - timeout: nt + 5000 50 + timeout: nt + 1000
51 } 51 }
52 if(type){ 52 if(type){
53 this.tasks[key]['type']=type 53 this.tasks[key]['type']=type