list.js
1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import App from '../../../utils/api.js'
import util from '../../../utils/util.js'
Page({
data:{
orderlist:{},
},
onLoad(opt){
let systeminfo=util.cache('system.info');
let headerheight=util.cache('headerHeight');
this.setData({
contentheight:systeminfo.windowHeight-headerheight
})
this.page=0;
this.hasmore=true;
this.getlist();
// console.log(this.getlist())
},
getlist(){
App.Orders.GetOrderListByOpenid({openid:util.cache('openid'),page:this.page,size:10}).then((json)=>{
console.log(json)
if(json.ret==200){
json.data.forEach((v,i)=>{
v.showdate=util.unixtoTime(v.cdate,'YYYY-MM-DD HH:II:SS')
})
let orderlist='orderlist['+this.page+']';
console.log('yyyyy',orderlist)
if(json.data.length<10){
console.log('yyyyy',)
this.hasmore=false;
}
this.setData({
[orderlist]:json.data
})
}
})
},
getnext(){
console.log('rrrrr',this.hasmore);
if(this.hasmore){
this.page+=1;
this.getlist();
}
}
})