|
@@ -1,4 +1,5 @@
|
|
|
// pages/file-browse/file-browse.js
|
|
|
+const util = require('../../utils/util.js');
|
|
|
Page({
|
|
|
|
|
|
/**
|
|
@@ -8,17 +9,7 @@ Page({
|
|
|
current: 1,
|
|
|
size: 10,
|
|
|
total: 0,
|
|
|
- list: [{
|
|
|
- id: 1,
|
|
|
- fileName: '上调300元 4月1日起 重庆执行两档最低工资标准',
|
|
|
- fileDesc: '4月1日起,重庆执行新的最低工资标准,具体为两档,分别为2100元/月、2000元/月,比原标准提高了300元。',
|
|
|
- publishTime: '2022-03-24'
|
|
|
- }, {
|
|
|
- id: 2,
|
|
|
- fileName: '市委办公厅、市政府办公厅印发《实施意见》要求铸魂育人倾情关爱 做好新时代关心下一代工作',
|
|
|
- fileDesc: '4月1日起,重庆执行新的最低工资标准,具体为两档,分别为2100元/月、2000元/月,比原标准提高了300元,比原标准提高了300元,比原标准提高了300元。',
|
|
|
- publishTime: '2022-03-24'
|
|
|
- }]
|
|
|
+ list: []
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -41,9 +32,15 @@ Page({
|
|
|
if (res.data.code != 200) {
|
|
|
util.toast(res.data.msg);
|
|
|
} else {
|
|
|
+ let records = res.data.data.records;
|
|
|
+ for (let i in records) {
|
|
|
+ let content = records[i].content;
|
|
|
+ content = content.match(/[\u4e00-\u9fa5]/g).join("");
|
|
|
+ records[i].desc = content;
|
|
|
+ }
|
|
|
that.setData({
|
|
|
total: res.data.data.total,
|
|
|
- list: res.data.data.records
|
|
|
+ list: records
|
|
|
});
|
|
|
}
|
|
|
}
|
|
@@ -100,9 +97,15 @@ Page({
|
|
|
if (res.data.code != 200) {
|
|
|
util.toast(res.data.msg);
|
|
|
} else {
|
|
|
+ let records = res.data.data.records;
|
|
|
+ for (let i in records) {
|
|
|
+ let content = records[i].content;
|
|
|
+ content = content.match(/[\u4e00-\u9fa5]/g).join("");
|
|
|
+ records[i].desc = content;
|
|
|
+ }
|
|
|
that.setData({
|
|
|
total: res.data.data.total,
|
|
|
- list: res.data.data.records
|
|
|
+ list: records
|
|
|
});
|
|
|
}
|
|
|
}
|
|
@@ -136,9 +139,14 @@ Page({
|
|
|
if (res.data.code != 200) {
|
|
|
util.toast(res.data.msg);
|
|
|
} else {
|
|
|
- let list = res.data.data.records;
|
|
|
+ let records = res.data.data.records;
|
|
|
+ for (let i in records) {
|
|
|
+ let content = records[i].content;
|
|
|
+ content = content.match(/[\u4e00-\u9fa5]/g).join("");
|
|
|
+ records[i].desc = content;
|
|
|
+ }
|
|
|
that.setData({
|
|
|
- list: arr.concat(list)
|
|
|
+ list: arr.concat(records)
|
|
|
});
|
|
|
}
|
|
|
}
|
|
@@ -151,10 +159,15 @@ Page({
|
|
|
onShareAppMessage: function () {
|
|
|
|
|
|
},
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查看文件详情
|
|
|
+ * @param {*} e
|
|
|
+ */
|
|
|
fileDetail: function (e) {
|
|
|
let id = e.currentTarget.dataset.id;
|
|
|
wx.navigateTo({
|
|
|
url: '../file-detail/file-detail?id=' + id,
|
|
|
- })
|
|
|
+ });
|
|
|
}
|
|
|
})
|