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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
| Page({
| data: {
| list: [1, 2, 3, 4, 5, 6, 7, 8, 10],
| showLoading: false,
| page: 1,
| total: 15,
| type: 1
| },
| onLoad() {
| // my.hideFavoriteMenu();
| my.setNavigationBar({
| title: "抽奖记录",
| backgroundColor: "#0080FF",
| borderBottomColor: "#0080FF"
| });
| },
| onPullDownRefresh() {
| console.log('onPullDownRefresh', new Date());
| my.showToast({
| content: "下拉刷新触发"
| });
|
| this.getActivityList(1);
| },
| async scrollMytrip() {
| try {
| console.log('scrollMytrip:');
| const { page, list, } = this.data;
| // 判断是否还有数据需要加载
| if (list.length < this.data.total) {
| //开启加载
| this.setData({ showLoading: true });
| const newPage = page + 1;
| this.getActivityList(newPage);
| }
| } catch (e) {
| this.setData({ show: false });
| console.log('scrollMytrip执行异常:', e);
| }
| },
| //获取列表
| getActivityList(page = 1) {
| setTimeout(function () {
| my.stopPullDownRefresh({
| complete(res) {
| console.log(res, new Date())
| }
| });
| my.showToast({
| content: "请求数据:" + page
| });
|
| }, 5000);
| },
| showDialog() {
|
|
| },
| onCloseDialog() {
| my.showToast({
| content: "关闭弹框"
| });
|
| },
| onRecieveAward() {
| my.showToast({
| content: "领奖"
| });
|
| },
| changeType(event) {
| console.log(event);
| var newType = parseInt(event.target.dataset.type);
| if (newType == this.type) {
| return;
| }
| this.setData({
| type: newType
| });
|
| }
|
|
| });
|
|