diff --git a/app.json b/app.json
index 8dce5a3..0339c99 100644
--- a/app.json
+++ b/app.json
@@ -26,7 +26,8 @@
"pages/brandCrisis/index",
"pages/detail/index",
"pages/brandCrisis/crisiSet/index",
- "pages/brandCrisis/chooseModel/index"
+ "pages/brandCrisis/chooseModel/index",
+ "pages/brandCrisis/crisisList/index"
],
"window": {
"backgroundTextStyle": "light",
diff --git a/pages/brandCrisis/crisisList/index.js b/pages/brandCrisis/crisisList/index.js
new file mode 100644
index 0000000..41673af
--- /dev/null
+++ b/pages/brandCrisis/crisisList/index.js
@@ -0,0 +1,109 @@
+import {doStr} from "../../../utils/doStr.js"
+const app = getApp();
+let iPageIndex = 1 // 当前第几页,0代表第一页
+let iPageSize = 10 //每页显示多少数据
+Page({
+ data: {
+ active: 0,
+ brand: '',
+ list: [
+ {
+ title: "高级危机",
+ val: 3
+ },
+ {
+ title: "中级危机",
+ val: 2
+ },
+ {
+ title: "低级危机",
+ val: 1
+ }
+ ],
+ crisisList: [],
+ val: 3,
+ loadMore: false, //"上拉加载"的变量,默认false,隐藏
+ loadAll: false, //“没有数据”的变量,默认false,隐藏
+ },
+ onLoad() {
+ wx.setNavigationBarTitle({
+ title: '负面消息'
+ })
+ let pages = getCurrentPages();
+ let currentPage = pages[pages.length - 1]
+ let options = currentPage.options
+ this.setData({
+ brand: options.brand
+ })
+ this.getData(3);
+ },
+ onReachBottom: function () {
+ console.log("上拉触底事件")
+ let that = this
+ if (!that.data.loadMore) {
+ that.setData({
+ loadMore: true, //加载中
+ loadAll: false //是否加载完所有数据
+ });
+ //加载更多,这里做下延时加载
+ that.getData(this.data.val);
+ }
+ },
+ getData(val) {
+ let sTimeType = wx.getStorageSync("sTimeType") || 34;
+ let sStartTime = wx.getStorageSync("sStartTime") || '';
+ let sEndTime = wx.getStorageSync("sEndTime") || '';
+ let sCrisis = val;
+ let obj = {
+ action: "getList",
+ sTimeType: sTimeType,
+ sStartTime: sStartTime,
+ sEndTime: sEndTime,
+ iPageIndex: iPageIndex,
+ iPageSize: iPageSize,
+ sType: "BrandData",
+ sCrisis: sCrisis,
+ 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.title = doStr(ele._source.title, 70);
+ ele._source.content = doStr(ele._source.content, 200);
+ })
+ let arr = this.data.crisisList.concat(res);
+ this.setData({
+ crisisList: arr,
+ loadMore: false
+ })
+ if (res.length < iPageSize) {
+ this.setData({
+ loadMore: false, //隐藏加载中。。
+ loadAll: true //所有数据都加载完了
+ });
+ }
+ } else {
+ this.setData({
+ loadAll: true, //把“没有数据”设为true,显示
+ loadMore: false //把"上拉加载"的变量设为false,隐藏
+ });
+ }
+ })
+ },
+ searchScrollLower() {
+ this.getData(this.data.val);
+ },
+ handlerTap(e) {
+ let n = e.detail.index;
+ let val = this.data.list[n].val;
+ iPageIndex = 1;
+ this.setData({
+ val: val,
+ crisisList: []
+ })
+ this.getData(val);
+ }
+})
\ No newline at end of file
diff --git a/pages/brandCrisis/crisisList/index.json b/pages/brandCrisis/crisisList/index.json
new file mode 100644
index 0000000..cdf14a7
--- /dev/null
+++ b/pages/brandCrisis/crisisList/index.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {
+ }
+}
\ No newline at end of file
diff --git a/pages/brandCrisis/crisisList/index.wxml b/pages/brandCrisis/crisisList/index.wxml
new file mode 100644
index 0000000..0748009
--- /dev/null
+++ b/pages/brandCrisis/crisisList/index.wxml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+ 高级危机
+ 中级危机
+ 低级危机
+ {{it._source.firsttime}}
+
+
+ {{it._source.title}}
+ {{it._source.content}}
+
+
+ 查看详情
+
+
+ 正在载入更多...
+ 已加载全部
+
+
+
+
\ No newline at end of file
diff --git a/pages/brandCrisis/crisisList/index.wxss b/pages/brandCrisis/crisisList/index.wxss
new file mode 100644
index 0000000..d8950fc
--- /dev/null
+++ b/pages/brandCrisis/crisisList/index.wxss
@@ -0,0 +1,72 @@
+.cl-outer {
+ padding: 16px;
+}
+
+.cl-inner {
+ padding: 16px;
+ background: #fff;
+}
+
+.cl-i-d1 {
+ display: flex;
+ justify-content: space-between;
+}
+
+.cl-i-d-s1 {
+ border-radius: 2px;
+ font-weight: 600;
+ font-size: 13px;
+ padding: 4px 8px;
+}
+.lCs {
+ color: #FF4852;
+ background: #FFF0F1;
+}
+.mCs {
+ color: #FF6E25;
+ background: #FFE5DF;
+}
+.dCs {
+ color: #FFBF00;
+ background: #FCFFE0;
+}
+.cl-i-d-s2 {
+ font-size: 13px;
+ color: #999999;
+}
+
+.cl-i-d-s3 {
+ font-size: 14px;
+ font-weight: 600;
+ color: #333333;
+ margin-top: 12px;
+}
+
+.cl-i-d-s4 {
+ font-size: 12px;
+ font-weight: 400;
+ color: #999999;
+ margin-top: 8px;
+}
+
+.cl-i-line {
+ width: 100%;
+ height: 1px;
+ background: linear-gradient(117deg, rgba(245, 245, 245, 0) 0%, #EEEEEE 50%, rgba(232, 232, 232, 0) 100%);
+ margin-top: 16px;
+}
+.cl-i-d-btn {
+ width: 100%;
+ height: 30px;
+ text-align: center;
+ line-height: 40px;
+ color: #0084FF;
+ font-size: 13px;
+}
+.loading {
+ position: relative;
+ bottom: 5rpx;
+ padding: 10rpx;
+ text-align: center;
+ font-size: 12px;
+}
\ No newline at end of file
diff --git a/pages/brandCrisis/index.js b/pages/brandCrisis/index.js
index 614cfaf..f3c5fe3 100644
--- a/pages/brandCrisis/index.js
+++ b/pages/brandCrisis/index.js
@@ -219,5 +219,10 @@ Page({
wx.navigateTo({
url: '/pages/brandCrisis/crisiSet/index'
})
+ },
+ handlerGoList() {
+ wx.navigateTo({
+ url: '/pages/brandCrisis/crisisList/index?brand=' + this.data.sBrand
+ })
}
})
\ No newline at end of file
diff --git a/pages/brandCrisis/index.wxml b/pages/brandCrisis/index.wxml
index 487cb04..c7e9ea5 100644
--- a/pages/brandCrisis/index.wxml
+++ b/pages/brandCrisis/index.wxml
@@ -36,14 +36,16 @@
- 高级危机
+ 高级危机
+ 中级危机
+ 低级危机
{{item._source.title}}
-
+
{{crisisNum}}
diff --git a/pages/detail/index.js b/pages/detail/index.js
index 52a3e88..9543cb9 100644
--- a/pages/detail/index.js
+++ b/pages/detail/index.js
@@ -126,7 +126,7 @@ Page({
dataList: list, //获取数据数组
loadMore: false //把"上拉加载"的变量设为false,显示
});
- if (res.length < pageSize) {
+ if (res.length < iPageSize) {
this.setData({
loadMore: false, //隐藏加载中。。
loadAll: true //所有数据都加载完了