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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
| // pages/test2/test2.js
| Page({
|
| /**
| * 页面的初始数据
| */
| data: {
| imgFiles: [
| '/res/icons/ass_1.png',
| '/res/icons/ass_2.png',
| '/res/icons/ass_3.png',
| '/res/icons/ass_3.png',
| '/res/icons/ass_3.png',
| '/res/icons/ass_3.png',
| '/res/icons/ass_3.png',
| '/res/icons/ass_3.png',
| '/res/icons/ass_3.png',
| '/res/icons/ass_3.png',
| '/res/icons/ass_3.png',
| '/res/icons/ass_3.png',
| ],
| ledgerRemark: '台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注',
| previewImageUrls:[],
| previewCurrent: 0,
| showPreview: false,
| },
|
| /**
| * 生命周期函数--监听页面加载
| */
| onLoad(options) {
|
| },
|
| /**
| * 生命周期函数--监听页面初次渲染完成
| */
| onReady() {
|
| },
|
| previewImage(e) {
| const {
| index
| } = e.currentTarget.dataset;
| const previewImageUrls = this.data.imgFiles;
| this.setData({
| previewImageUrls,
| previewCurrent: index,
| showPreview: true
| });
| },
|
| /**
| * 获取热门搜索内容
| */
| getHotTopic() {
| var that = this
| // 1. 热门法律法规
| consultservice.getTopicLaw(app.globalData.accessToken.userId, {
| success(res) {
| res.forEach(r => {
| r.mfKeywordLv1 = r.mfKeywordLv1.split('、').slice(0, 5)
| r.mfReleaseDate = that.formatTime(r.mfReleaseDate)
| r.mfEffectiveDate = that.formatTime(r.mfEffectiveDate)
| r.mfClosingDate = that.formatTime(r.mfClosingDate)
| });
| that.setData({
| 'pageList[0]': res,
| 'pageList[4]': res
| })
| }
| })
| // 2. 热门法律法规条目
| consultservice.getTopicItem(app.globalData.accessToken.userId, {
| success(res) {
| res.forEach(r => {
| r.miItemContent = r.miItemContent.replaceAll('\\n', '<br/>')
| });
| that.setData({
| 'pageList[3]': res
| })
| }
| })
| // 3. 热门问答
| consultservice.getTopicQA(app.globalData.accessToken.userId, {
| success(res) {
| res.forEach(r => {
| r.cqCreateTime = that.formatTime(r.cqCreateTime)
| });
| that.setData({
| 'pageList[1]': res
| })
| }
| })
| // 4. 热门案例
| consultservice.getTopicCase(app.globalData.accessToken.userId, {
| success(res) {
| res.forEach(r => {
| r.ecSummary = r.ecSummary.replaceAll('\\n', '<br/>')
| r.ecMeaning = r.ecMeaning.replaceAll('\\n', '<br/>')
| r.ecExamined = r.ecExamined.replaceAll('\\n', '<br/>')
| r.ecEnlightenment = r.ecEnlightenment.replaceAll('\\n', '<br/>')
| r.ecOccurDate = that.formatTime(r.ecOccurDate)
| });
| that.setData({
| 'pageList[2]': res
| })
| console.log(that.data.pageList);
| }
| })
| },
| })
|
|