moreActivity.js
1.5 KB
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
import {
request
} from "../../request/index.js"
const a = getApp()
Page({
data: {
imagesUrl: a.globalData.baseUrl,
id: '',
moreActivity: '',
},
onLoad: function (options) {
},
ToActivityDetails(e) {
let id = e.currentTarget.dataset.id
let type = e.currentTarget.dataset.types
if (type == 1) {
wx.navigateTo({
url: '/pages/activityDetails/activityDetails?id=' + id + '&type=' + type
})
} else {
wx.navigateTo({
url: '/pages/details/details?id=' + id + '&type=' + type
})
}
// let id = e.currentTarget.dataset.id
// wx.navigateTo({
// url: '?id=' + id
// })
},
onReady: function () {
},
onShow: function () {
wx.showToast({
title: '加载中',
icon: "loading",
duration: 1000
})
this.getMoreActivity()
},
async getMoreActivity() {
let that = this
try {
const {
data: {
data
}
} = await request({
url: 'api/index/moreActive'
})
that.setData({
moreActivity: data
})
// console.log(data, "更多活动");
} catch (err) {
that.setData({
msg: err.msg
})
that.popMaskTest()
}
},
popMaskTest() {
wx.showToast({
title: this.data.msg,
duration: 2000,
icon: 'none',
mask: true //是否有透明蒙层,默认为false
//如果有透明蒙层,弹窗的期间不能点击文档内容
})
},
})