From 5cb45e94c5bfa348382abb0503cd2886ea37e69f Mon Sep 17 00:00:00 2001
From: liuyongli <1598631486@qq.com>
Date: Tue, 20 Sep 2022 13:35:05 +0800
Subject: [PATCH] no message
---
components/indexCom/atlasChild/index.js | 2 +-
pages/brandCrisis/crisisList/index.js | 85 ++++++++++++++++++++-----
pages/brandCrisis/crisisList/index.wxml | 52 ++++++++-------
pages/brandCrisis/crisisList/index.wxss | 16 +++++
project.private.config.json | 7 ++
5 files changed, 123 insertions(+), 39 deletions(-)
diff --git a/components/indexCom/atlasChild/index.js b/components/indexCom/atlasChild/index.js
index 6a9a174..b8650d5 100644
--- a/components/indexCom/atlasChild/index.js
+++ b/components/indexCom/atlasChild/index.js
@@ -63,7 +63,7 @@ Component({
sStartTime: sStartTime,
sEndTime: sEndTime
}
- app.globalData.request(obj).then(res => {
+ (obj).then(res => {
// const data = res
// const arr1 = []
// Object.keys(data).forEach(key => {
diff --git a/pages/brandCrisis/crisisList/index.js b/pages/brandCrisis/crisisList/index.js
index 2e1fe44..4d63939 100644
--- a/pages/brandCrisis/crisisList/index.js
+++ b/pages/brandCrisis/crisisList/index.js
@@ -9,7 +9,16 @@ Page({
active: 0,
activetab: 0,
brand: '',
- // intervalSel:0,
+ intervalSel: 0,
+ newsList: [{
+ title: '已读',
+ value: 1
+ },
+ {
+ title: '未读',
+ value: 2
+ },
+ ],
// news: '',
// Grade: '',
// option: [{
@@ -53,10 +62,11 @@ Page({
],
crisisList: [],
- DataList:[],
+ DataList: [],
value: 1,
loadMore: false, //"上拉加载"的变量,默认false,隐藏
loadAll: false, //“没有数据”的变量,默认false,隐藏
+ iReadState: 0, //0 未读 1 已读
},
onLoad() {
wx.setNavigationBarTitle({
@@ -70,6 +80,7 @@ Page({
})
iPageIndex = 1;
this.getData(3);
+ this.getList();
},
onReachBottom: function () {
console.log("上拉触底事件")
@@ -81,6 +92,7 @@ Page({
});
//加载更多,这里做下延时加载
that.getData(this.data.value);
+ that.getList(this.data.value);
}
},
getList() {
@@ -89,26 +101,27 @@ Page({
let sEndTime = wx.getStorageSync("sEndTime") || '';
let sCrisis = this.data.value;
let obj = {
- action: "getList",
+ action: "getSwsQyMessageList",
sTimeType: sTimeType,
sStartTime: sStartTime,
sEndTime: sEndTime,
iPageIndex: iPageIndex,
iPageSize: iPageSize,
- sType: "BrandData",
+ // sType: "BrandData",
+ iReadState: this.data.iReadState,
sCrisis: sCrisis,
- sBrand: this.data.brand,
+ // sBrand: this.data.brand,
// sSeriesName: sSeriesName,
token: wx.getStorageSync('token') || 't%2BrswgjvzGM='
}
app.globalData.request(obj).then(res => {
if (res && res.length > 0) {
iPageIndex++;
- res.forEach(ele => {
- ele._source.affections = ele._source.affections;
- ele._source.title = doStr(ele._source.title, 70);
- ele._source.content = doStr(ele._source.content, 200);
- })
+ // res.forEach(ele => {
+ // ele._source.affections = ele._source.affections;
+ // ele._source.title = doStr(ele._source.title, 70);
+ // ele._source.content = doStr(ele._source.content, 200);
+ // })
let arr = this.data.DataList.concat(res);
this.setData({
DataList: arr,
@@ -128,6 +141,16 @@ Page({
}
})
},
+ // 设置已读
+ getTimeData(e) {
+ let id = e.currentTarget.dataset.row.ID
+ app.globalData.request({
+ action: 'updSwsQyMessageByIDRead',
+ Id: id,
+ token: wx.getStorageSync('token') || 't%2BrswgjvzGM='
+ }).then(res => {
+ })
+ },
getData() {
let sTimeType = wx.getStorageSync("sTimeType") || 34;
let sStartTime = wx.getStorageSync("sStartTime") || '';
@@ -153,9 +176,9 @@ Page({
ele._source.title = doStr(ele._source.title, 70);
ele._source.content = doStr(ele._source.content, 200);
})
- let arr = this.data.crisisList.concat(res);
+ let arr1 = this.data.crisisList.concat(res);
this.setData({
- crisisList: arr,
+ crisisList: arr1,
loadMore: false
})
if (res.length < iPageSize) {
@@ -183,19 +206,51 @@ Page({
})
},
handlerTap(e) {
- let intervalSel = e.currentTarget.dataset.index;
- let value = this.data.list[intervalSel].value
+ let n = e.currentTarget.dataset.index;
+ let value = this.data.list[n].value
iPageIndex = 1;
this.setData({
+ intervalSel: e.currentTarget.dataset.index,
value: value,
crisisList: []
})
this.getData();
},
+ handList(e) {
+ let n = e.currentTarget.dataset.index;
+ let value = this.data.list[n].value
+ iPageIndex = 1;
+ this.setData({
+ intervalSel: e.currentTarget.dataset.index,
+ value: value,
+ DataList: []
+ })
+ this.getList();
+
+ },
handlerDetail(e) {
let row = e.currentTarget.dataset.row;
wx.navigateTo({
url: '/subPackages/pages/detail/index?id=' + row._id
})
- }
+ },
+ //复制链接
+ handlerCopy(e) {
+ const {
+ msg
+ } = e.currentTarget.dataset
+ wx.setClipboardData({
+ data: `${msg}`, //这个是要复制的数据
+
+ })
+
+ },
+ ChangeList(e) {
+ this.setData({
+ intervalSel: e.currentTarget.dataset.index,
+ iReadState: e.currentTarget.dataset.index,
+ DataList: []
+ });
+ this.getList()
+ },
})
\ No newline at end of file
diff --git a/pages/brandCrisis/crisisList/index.wxml b/pages/brandCrisis/crisisList/index.wxml
index f7431ab..2df38f0 100644
--- a/pages/brandCrisis/crisisList/index.wxml
+++ b/pages/brandCrisis/crisisList/index.wxml
@@ -1,31 +1,37 @@
+
-
+
{{item.title}}
diff --git a/pages/brandCrisis/crisisList/index.wxss b/pages/brandCrisis/crisisList/index.wxss
index 44f1b96..9130ea1 100644
--- a/pages/brandCrisis/crisisList/index.wxss
+++ b/pages/brandCrisis/crisisList/index.wxss
@@ -18,6 +18,14 @@
font-size: 13px;
padding: 4px 8px;
}
+.negative{
+ color: #4ccf5e;
+ background: #e8f5e3;
+ border-radius: 2px;
+ font-weight: 600;
+ font-size: 13px;
+ padding: 4px 8px;
+}
.lCs {
color: #FF4852;
background: #FFF0F1;
@@ -48,6 +56,14 @@
color: #999999;
margin-top: 8px;
}
+.jie{
+ width: 95%;
+ font-size: 12px;
+ font-weight: 400;
+ color: #999999;
+ margin-top: 8px;
+ word-wrap: break-word
+}
.cl-i-line {
width: 100%;
diff --git a/project.private.config.json b/project.private.config.json
index 7d08662..38d0bf2 100644
--- a/project.private.config.json
+++ b/project.private.config.json
@@ -35,6 +35,13 @@
"query": "",
"launchMode": "default",
"scene": null
+ },
+ {
+ "name": "",
+ "pathName": "pages/brandCrisis/crisisList/index",
+ "query": "brand=%E5%A5%87%E7%91%9E%E6%96%B0%E8%83%BD%E6%BA%90",
+ "launchMode": "default",
+ "scene": null
}
]
}