Commit d0c0eb96 by liangyuhang

危机报告

parent 8effc804
......@@ -4,6 +4,8 @@
padding: 0;
box-sizing: border-box;
font-family: Microsoft YaHei;
height:100%;
overflow: scroll;
}
......
......@@ -37,10 +37,11 @@
.r .brand{
position: absolute;
background-color: #E5EDFA;
font-size: 28rpx;
font-size: 26rpx;
color: #0A63EA;
bottom: 15rpx;
left: 0;
padding: 5rpx 10rpx;
}
.r .time{
position: absolute;
......
......@@ -21,7 +21,6 @@ Component({
methods: {
//关闭遮罩层
closeLayer(){
console.log("点了关闭遮罩层")
this.triggerEvent('closePicture')
}
}
......
......@@ -18,6 +18,11 @@ Component({
* 组件的方法列表
*/
methods: {
toUrl(e){
var _url=e.currentTarget.dataset.url
wx.navigateTo({
url: '/components/out/out?url='+_url
})
}
}
})
<!--components/reportList.wxml-->
<text>等危机报告一起</text>
<block wx:for="{{reportList}}" wx:key="index">
<view class="list" bindtap="toUrl" data-url="https://crisis.zhiweidata.com/viewerpdf/{{item.id}}">
<view class="image-box">
<image src="https://crisis.zhiweidata.com/app/{{item.imgUrl}}" mode="aspectFill" lazy-load="true" />
</view>
<view class="r">
<rich-text nodes="{{item.reportName}}" class="title"></rich-text>
<text class="brand">{{item.priBrand}}</text>
<text class="time">{{dateUtil.dateFormat(item.startTime,'yyyy.MM.dd')}}</text>
</view>
</view>
</block>
<wxs module="dateUtil" src="../../wxs/timeUtil.wxs"></wxs>
/* components/reportList.wxss */
.report-first{
position: relative;
width: 100%;
height: 324rpx;
background-color: #ffffff;
border-radius: 10px;
border: solid 2px #eeeeee;
overflow: hidden;
margin-bottom: 25rpx;
}
.report-first image{
width: 100%;
height: 100%;
}
.report-first .info{
position: absolute;
bottom: 0;
width: 100%;
height: 66rpx;
padding: 0 10rpx;
line-height: 66rpx;
background-color: rgba(0,0,0,0.4);
color: #ffffff;font-size: 28rpx;
}
.report-list{
width: 100%;
height: 180rpx;
margin-bottom: 25rpx;
/* 列表 */
.list{
display: flex;
}
.report-list .imgBox {
height: 100%;
margin-right: 20rpx;
}
.report-list .imgBox image{
height: 150rpx;
margin: 20rpx;
border-bottom: 1px solid #e3e4e4;
}
.list .image-box{
width: 150rpx;
text-align:center;
}
.list .image-box image{
width: 120rpx;
height: 120rpx;
border-radius: 50%;
}
.r{
margin-left: 20rpx;
width: 100%;
height: 100%;
}
.report-list .content{
position: relative;
height: 180rpx;
width: 100%;
}
.content .report-name{
position: absolute;
top: 0;
left: 0;
color: #333;
}
.r .title{
font-weight: bold;
font-size: 30rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 100%;
}
.content .report-introduction{
}
.r .score{
position: absolute;
top: 60rpx;
font-size: 28rpx;
color: #A0A0A0;
top: 50rpx;
left: 0;
color: #999;
font-size: 24rpx;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.content .report-time{
}
.r .brand{
position: absolute;
bottom: 0;
background-color: #E5EDFA;
font-size: 26rpx;
color: #0A63EA;
bottom: 15rpx;
left: 0;
color: #999;
font-size: 24rpx;
}
\ No newline at end of file
padding: 5rpx 10rpx;
}
.r .time{
position: absolute;
font-size: 28rpx;
color: #A0A0A0;
bottom: 15rpx;
right: 0;
}
\ No newline at end of file
......@@ -7,20 +7,20 @@ Page({
* 页面的初始数据
*/
data: {
eventList:[],
tabIndex:0,
conditions:[
{"name":"不限"},
{"name":"新消费"},
{"name":"互联网"},
{"name":"医疗"},
{"name":"汽车"}
// {"name":"全部"}
// {"name":"汽车"}
{"name":"全部"}
],
tabIndex:0,
eventList:[],
page:1,
size:10,
total:0,
industry:'不限',
total:-1,
isloading:false
},
......@@ -28,7 +28,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getEeventList();
this.getEventList();
},
switchTap(e){
var _index = e.currentTarget.dataset.index;
......@@ -40,9 +40,9 @@ Page({
industry:_name,
eventList:[]
})
this.getEeventList();
this.getEventList();
},
getEeventList(){
getEventList(){
this.setData({
isloading:true
})
......@@ -100,7 +100,18 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
// 重置关键数据
this.setData({
eventList:[],
page:1,
total:0,
})
// 重新发起请求
var _this = this;
setTimeout(function() {
_this.getEventList()
wx.stopPullDownRefresh() //停止下拉刷新
}, 100);
},
/**
......@@ -119,7 +130,7 @@ Page({
this.setData({
page:this.data.page+1
})
this.getEeventList()
this.getEventList()
},
/**
......
{
"usingComponents": {
"eventList": "/components/eventList/eventList"
}
},
"enablePullDownRefresh": true,
"backgroundColor": "#025FEA",
"backgroundTextStyle": "dark"
}
\ No newline at end of file
<!--pages/library/library.wxml-->
<view class="condition-con">
<view class="container">
<view class="condition-con">
<view class="condition-list">
<block wx:for="{{conditions}}" wx:key="index">
<view class="condition {{tabIndex==index? 'active' : ''}}" data-index="{{index}}" data-name="{{item.name}}" bind:tap="switchTap" >
......@@ -7,23 +8,10 @@
</view>
</block>
</view>
</view>
<!-- <view>
<block wx:for="{{eventList}}" wx:key="index">
<view class="list">
<view class="image-box">
<image src="https://crisis.zhiweidata.com/app/{{item.imgUrl}}" mode="aspectFill" lazy-load="true" />
</view>
<view class="r">
<text class="title">{{item.eventName}}</text>
<view class="score">公关指数:<text style="color:#F7815A">{{item.interveneScore}}</text></view>
<text class="brand">{{item.priBrand}}</text>
<text class="time">{{dateUtil.dateFormat(item.startTime,'yyyy.MM.dd')}}</text>
</view>
</view>
</block>
</view> -->
<!-- 列表 -->
<eventList eventList="{{eventList}}"></eventList>
<!-- 列表 -->
<view class="list-con">
<eventList eventList="{{eventList}}"></eventList>
</view>
</view>
/* pages/library/library.wxss */
/* 条件 */
.condition-con{
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 80rpx;
background-color: #025FEA;
z-index: 999;
}
.condition-list{
display: flex;
......@@ -20,7 +25,6 @@
font-size: 32rpx;
color: #fff;
}
.active::after {
position: absolute;
content: '';
......@@ -33,53 +37,8 @@
border-radius: 4rpx;
}
/* 列表 */
.list{
display: flex;
height: 150rpx;
margin: 20rpx;
border-bottom: 1px solid #e3e4e4;
}
.list .image-box{
width: 150rpx;
text-align:center;
}
.list .image-box image{
width: 120rpx;
height: 120rpx;
border-radius: 50%;
}
.r{
margin-left: 20rpx;
width: 100%;
position: relative;
}
.r .title{
font-weight: bold;
font-size: 30rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.r .score{
position: absolute;
font-size: 28rpx;
color: #A0A0A0;
top: 50rpx;
left: 0;
}
.r .brand{
position: absolute;
background-color: #E5EDFA;
font-size: 28rpx;
color: #0A63EA;
bottom: 15rpx;
left: 0;
}
.r .time{
position: absolute;
font-size: 28rpx;
color: #A0A0A0;
bottom: 15rpx;
right: 0;
.list-con{
margin-top: 100rpx;
}
// pages/report/report.js
var http = require('../../utils/http')
Page({
/**
* 页面的初始数据
*/
data: {
conditions:[
{"name":"不限"},
{"name":"政治敏感"},
{"name":"民族歧视"},
{"name":"宗教歧视"},
{"name":"全部"}
],
tabIndex:0,
reportList:[],
page:1,
size:10,
total:0,
category:'不限',
isloading:false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getReportList();
},
switchTap(e){
var _index = e.currentTarget.dataset.index;
var _name = e.currentTarget.dataset.name;
this.setData({
tabIndex: _index,
category:_name,
reportList:[]
})
this.getReportList();
},
getReportList(){
this.setData({
isloading:true
})
wx.showLoading({
title: '加载中...'
})
http.getRequest('/reports?page='+this.data.page+'&size='+this.data.size+'&category='+this.data.category).then(res=>{
if(res.data.code==200){
this.setData({
reportList:this.data.reportList.concat(res.data.data.list),
total:res.data.data.total
})
}
wx.hideLoading()
this.setData({
isloading:false
})
})
},
/**
......@@ -47,14 +93,37 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
// 重置关键数据
this.setData({
reportList:[],
page:1,
total:0,
})
// 重新发起请求
var _this = this;
setTimeout(function() {
_this.getReportList()
wx.stopPullDownRefresh() //停止下拉刷新
}, 100);
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
if(this.data.page * this.data.size>=this.data.total){
//下一页无数据
return wx.showToast({
title: '没有下一页了!',
icon: 'none'
})
}
// 防止加载时刷新
if(this.data.isloading) return
this.setData({
page:this.data.page+1
})
this.getReportList()
},
/**
......
{
"usingComponents": {
"reportList": "/components/reportList/reportList"
}
},
"enablePullDownRefresh": true,
"backgroundColor": "#025FEA",
"backgroundTextStyle": "dark"
}
\ No newline at end of file
<!--pages/report/report.wxml-->
<reportList></reportList>
<view class="container">
<view class="condition-con">
<view class="condition-list">
<block wx:for="{{conditions}}" wx:key="index">
<view class="condition {{tabIndex==index? 'active' : ''}}" data-index="{{index}}" data-name="{{item.name}}" bind:tap="switchTap" >
{{item.name}}
</view>
</block>
</view>
</view>
<!-- 列表 -->
<reportList reportList="{{reportList}}"></reportList>
</view>
\ No newline at end of file
/* pages/report/report.wxss */
/* 条件 */
.condition-con{
height: 80rpx;
background-color: #025FEA;
}
.condition-list{
display: flex;
padding: 0 30rpx;
line-height: 80rpx;
}
.condition{
width: 20vh;
text-align: center;
font-size: 30rpx;
color: rgba(255, 255, 255, 0.5);
}
.active{
position: relative;
font-size: 32rpx;
color: #fff;
}
.active::after {
position: absolute;
content: '';
height: 5rpx;
width: 50rpx;
left: 50%;
bottom: 5rpx;
background: #fff;
margin-left: -25rpx;
border-radius: 4rpx;
}
\ No newline at end of file
......@@ -29,7 +29,7 @@
<image src='../../image/clear.png' bindtap='clearHistory'></image>
</view>
</view>
<block wx:for="{{historySearch}}" wx:key='{{item}}'>
<block wx:for="{{historySearch}}" wx:key='item'>
<view class='list'>
<text class='tags' bindtap='onHistorySearch' data-keyword="{{item}}">{{item}}</text>
</view>
......
......@@ -103,7 +103,7 @@ Page({
},
//搜索
search(){
this.getListByKeyword(e);
this.getListByKeyword();
},
/**
......
......@@ -53,6 +53,12 @@
"pathName": "pages/event-detail/event-detail",
"query": "eventId=433",
"scene": null
},
{
"name": "pages/report/report",
"pathName": "pages/report/report",
"query": "",
"scene": null
}
]
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment