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
| // index.ts
| // 获取应用实例
| const userCause = getApp()
|
| Page({
| data: {
| swcurrent: 0,
| causeList: [],
| isShow: false
| },
| // 事件处理函数
| onLoad() {
| wx.request(
| {
| url: userCause.globalData.url + "/wx/publicity",
| method: "GET",
| header: { 'token': wx.getStorageSync('token') },
| success: (res) => {
|
| res.data.data.map(i => {
| if (i.photoStr != null) {
| i.photoStr = i.photoStr.split(",").map(i => userCause.globalData.imageUrl + "/img/" + i),
| this.data.images = i.photoStr
| }
| })
| this.setData({
| causeList: res.data.data
| })
| }
| })
| }
| })
|
|