|
|
@@ -2,6 +2,7 @@ const _Http = getApp().globalData.http;
|
|
|
Page({
|
|
|
data: {
|
|
|
list: [],
|
|
|
+ filtrate: false,
|
|
|
"content": {
|
|
|
nocache: true,
|
|
|
"pageNumber": 1,
|
|
|
@@ -11,7 +12,16 @@ Page({
|
|
|
"condition": ""
|
|
|
}
|
|
|
},
|
|
|
- unreadNum: 0
|
|
|
+ unreadNum: 0,
|
|
|
+ filtratelist: [{
|
|
|
+ label: "板块",
|
|
|
+ index: null,
|
|
|
+ showName: "classname", //显示字段
|
|
|
+ valueKey: "sat_notice_classid", //返回Key
|
|
|
+ selectKey: "sat_notice_classid", //传参 代表选着字段 不传参返回整个选择对象
|
|
|
+ value: "", //选中值
|
|
|
+ list: null
|
|
|
+ }]
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
const auth = options.auth ? JSON.parse(options.auth) : getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['营销工具'], ['通告'])[0].apps;
|
|
|
@@ -22,16 +32,14 @@ Page({
|
|
|
})
|
|
|
this.getList();
|
|
|
},
|
|
|
-
|
|
|
getList(init = false) {
|
|
|
if (init.detail != undefined) init = init.detail;
|
|
|
- if (init) this.setData({
|
|
|
- ['content.pageNumber']: 1
|
|
|
- })
|
|
|
- if (this.data.content.pageNumber > this.data.content.pageTotal) return;
|
|
|
+ let content = this.data.content;
|
|
|
+ if (init) content.pageNumber = 1;
|
|
|
+ if (content.pageNumber > content.pageTotal) return;
|
|
|
_Http.basic({
|
|
|
id: 20221111090904,
|
|
|
- content: this.data.content
|
|
|
+ content: content
|
|
|
}).then(res => {
|
|
|
console.log("通告列表", res)
|
|
|
this.selectComponent('#ListBox').RefreshToComplete();
|
|
|
@@ -42,8 +50,8 @@ Page({
|
|
|
this.setData({
|
|
|
total: res.total,
|
|
|
list: (res.pageNumber == 1) ? res.data : this.data.list.concat(res.data),
|
|
|
- ['content.pageNumber']: res.pageNumber + 1,
|
|
|
- ['content.pageTotal']: res.pageTotal,
|
|
|
+ 'content.pageNumber': res.pageNumber + 1,
|
|
|
+ 'content.pageTotal': res.pageTotal,
|
|
|
unreadNum: res.total - res.tips.readNum
|
|
|
})
|
|
|
})
|
|
|
@@ -60,4 +68,46 @@ Page({
|
|
|
onReady() {
|
|
|
this.selectComponent("#ListBox").setHeight(".top", this);
|
|
|
},
|
|
|
+ startSearch({
|
|
|
+ detail
|
|
|
+ }) {
|
|
|
+ if (detail == this.data.content.where.condition) return;
|
|
|
+ this.data.content.where.condition = detail;
|
|
|
+ this.getList(true);
|
|
|
+ },
|
|
|
+ /* 取消搜索 */
|
|
|
+ onClear() {
|
|
|
+ this.data.content.where.condition = "";
|
|
|
+ this.getList(true);
|
|
|
+ },
|
|
|
+ openFiltrate() {
|
|
|
+ if (this.data.filtratelist[0].list == null) {
|
|
|
+ _Http.basic({
|
|
|
+ id: 20221101094603,
|
|
|
+ "content": {
|
|
|
+ nocache: true,
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 999,
|
|
|
+ "where": {
|
|
|
+ "condition": ""
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ console.log("通告板块", res)
|
|
|
+ this.setData({
|
|
|
+ "filtratelist[0].list": res.data,
|
|
|
+ filtrate: true
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.setData({
|
|
|
+ filtrate: true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /* 处理筛选 */
|
|
|
+ handleFilter(e) {
|
|
|
+ this.data.content.where.sat_notice_classid = e.detail.sat_notice_classid || "";
|
|
|
+ this.getList(true)
|
|
|
+ },
|
|
|
})
|