Commit ad208c0d by liangyuhang

首页部分修改

parent d89ca9e7
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
"pages": [ "pages": [
"pages/index/index", "pages/index/index",
"pages/logs/logs", "pages/logs/logs",
"pages/crisisrep/crisisrep", "pages/report/report",
"pages/crisislib/crisislib", "pages/library/library",
"pages/usercenter/index" "pages/usercenter/usercenter"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",
...@@ -13,23 +13,24 @@ ...@@ -13,23 +13,24 @@
"navigationBarTextStyle": "black" "navigationBarTextStyle": "black"
}, },
"tabBar": { "tabBar": {
"selectedColor":"#4551c2",
"list": [{ "list": [{
"pagePath": "pages/index/index", "pagePath": "pages/index/index",
"iconPath": "image/icon_cloud.png", "iconPath": "image/icon_cloud.png",
"selectedIconPath": "image/icon_cloud_HL.png", "selectedIconPath": "image/icon_cloud_HL.png",
"text": "首页" "text": "首页"
},{ },{
"pagePath": "pages/crisisrep/crisisrep", "pagePath": "pages/report/report",
"iconPath": "image/icon_API.png", "iconPath": "image/icon_API.png",
"selectedIconPath": "image/icon_API_HL.png", "selectedIconPath": "image/icon_API_HL.png",
"text": "危机报告" "text": "危机报告"
}, { }, {
"pagePath": "pages/crisislib/crisislib", "pagePath": "pages/library/library",
"iconPath": "image/icon_component.png", "iconPath": "image/icon_component.png",
"selectedIconPath": "image/icon_component_HL.png", "selectedIconPath": "image/icon_component_HL.png",
"text": "危机库" "text": "危机库"
}, { }, {
"pagePath": "pages/usercenter/index", "pagePath": "pages/usercenter/usercenter",
"iconPath": "image/icon_component.png", "iconPath": "image/icon_component.png",
"selectedIconPath": "image/icon_component_HL.png", "selectedIconPath": "image/icon_component_HL.png",
"text": "用户中心" "text": "用户中心"
......
{
"name": "mymp_01",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@vant/weapp": {
"version": "1.3.3",
"resolved": "https://registry.npmmirror.com/@vant/weapp/-/weapp-1.3.3.tgz",
"integrity": "sha512-XZFRsam3QSnkbBRqdcldi1+VZtAtHbj92S7AF9dG/YpEN0FFEm+vDb881+xXkHFfzLPx509TriKWU6ktlNZSmw=="
}
}
}
{
"name": "mymp_01",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@vant/weapp": "^1.3.3"
}
}
// pages/crisislib/crisislib.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
<!--pages/crisislib/crisislib.wxml-->
<text>pages/crisislib/crisislib.wxml</text>
/* pages/crisislib/crisislib.wxss */
\ No newline at end of file
<!--pages/crisisrep/crisisrep.wxml-->
<text>pages/crisisrep/crisisrep.wxml</text>
/* pages/crisisrep/crisisrep.wxss */
\ No newline at end of file
// index.js // index.js
// 获取应用实例 // 获取应用实例
const app = getApp() const app = getApp()
var http = require('../../utils/http')
const moment = require('../../utils/moment.min.js')
Page({ Page({
data: { data: {
...@@ -10,12 +12,28 @@ Page({ ...@@ -10,12 +12,28 @@ Page({
crisisReport:[], crisisReport:[],
banner:true, banner:true,
toView: 'banner', toView: 'banner',
}, anchorList:[
// 事件处理函数 {
bindViewTap() { id: 'dynamic',
wx.navigateTo({ text: '危机动态',
url: '../logs/logs' img: 'https://d1icd6shlvmxi6.cloudfront.net/gsc/L5VHPP/e9/83/b8/e983b88902ca4085bcbc34d714ac6904/images/%E9%A6%96%E9%A1%B5/u7.svg?pageId=794f4729-ba77-4770-92d6-71dfe84a18c1'
}) },
{
id: 'field',
text: '聚焦领域',
img: 'https://d1icd6shlvmxi6.cloudfront.net/gsc/L5VHPP/e9/83/b8/e983b88902ca4085bcbc34d714ac6904/images/首页/u14.svg?pageId=794f4729-ba77-4770-92d6-71dfe84a18c1'
},
{
id: 'article',
text: '危机复盘',
img: 'https://d1icd6shlvmxi6.cloudfront.net/gsc/L5VHPP/e9/83/b8/e983b88902ca4085bcbc34d714ac6904/images/首页/u17.svg?pageId=794f4729-ba77-4770-92d6-71dfe84a18c1'
},
{
id: 'report',
text: '危机报告',
img: 'https://d1icd6shlvmxi6.cloudfront.net/gsc/L5VHPP/e9/83/b8/e983b88902ca4085bcbc34d714ac6904/images/首页/u10.svg?pageId=794f4729-ba77-4770-92d6-71dfe84a18c1'
},
]
}, },
onLoad() { onLoad() {
this.setCrisisDynamicData(); this.setCrisisDynamicData();
...@@ -24,71 +42,43 @@ Page({ ...@@ -24,71 +42,43 @@ Page({
this.setCrisisReportData(); this.setCrisisReportData();
}, },
setCrisisDynamicData(){ setCrisisDynamicData(){
wx.request({ http.getRequest('/mobile/index/event/recently').then(res=>{
method: 'GET', if(res){
url: 'http://localhost:8088/mobile/index/event/recently',
success: (res) =>{
this.setData({ this.setData({
crisisDynamic:res.data.data.list crisisDynamic:res.data.data.list
}) })
},
fail(e){
console.log(e)
} }
}) })
}, },
setCrisisFieldData(){ setCrisisFieldData(){
wx.request({ http.getRequest('/mobile/index/focusIndustry?timeType=halfYear').then(res=>{
method: 'GET', if(res){
url: 'http://localhost:8088/mobile/index/focusIndustry?timeType=month',
success: (res) =>{
this.setData({ this.setData({
crisisField:res.data.data crisisField:res.data.data
}) })
},
fail(e){
console.log(e)
} }
}) })
}, },
setCrisisArticleData(){ setCrisisArticleData(){
wx.request({ http.getRequest('/mobile/index/article/recently').then(res=>{
method: 'GET', if(res){
url: 'http://localhost:8088/mobile/index/article/recently', let arr = res.data.data
success: (res) =>{ arr.forEach(item => {
// console.log(res) console.log(item)
this.setData({ item.publishTime = moment(item.publishTime).format('YYYY-MM-DD')
crisisArticle:res.data.data
}) })
}, this.setData({
fail(e){ crisisArticle:arr
console.log(e) })
} }
}) })
}, },
setCrisisReportData(){ setCrisisReportData(){
wx.request({ http.getRequest('/mobile/index/report/recently?size=4').then(res=>{
method: 'GET', if(res){
url: 'http://localhost:8088/mobile/index/report/recently?size=4',
success: (res) =>{
this.setData({ this.setData({
crisisReport:res.data.data crisisReport:res.data.data
}) })
},
fail(e){
console.log(e)
}
})
},
onGetOpenid() {
wx.request({
method: 'GET',
url: 'http://localhost:8088/mobile/index/event/recently?page=1&size=3',
success(res) {
console.log(res)
},
fail(e){
console.log(e)
} }
}) })
}, },
...@@ -104,20 +94,20 @@ Page({ ...@@ -104,20 +94,20 @@ Page({
}) })
// console.log(this.data.toView) // console.log(this.data.toView)
}, },
refreshFieldData(e){ // refreshFieldData(e){
var _id = e.currentTarget.dataset.id; // var _id = e.currentTarget.dataset.id;
console.log(_id);
wx.request({ // wx.request({
method: 'GET', // method: 'GET',
header: { 'content-type':'application/json' }, // header: { 'content-type':'application/json' },
url: 'http://localhost:8088/mobile/index/focusIndustry?timeType='+_id, // url: 'http://localhost:8088/mobile/index/focusIndustry?timeType='+_id,
success(res) { // success(res) {
console.log(res.data.data) // console.log(res.data.data)
crisisField:res.data.data // crisisField:res.data.data
}, // },
fail(e){ // fail(e){
console.log(e) // console.log(e)
} // }
}) // })
} // }
}) })
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<!-- 横幅 --> <!-- 横幅 -->
<view class="banner" wx:if="{{banner}}"> <view class="banner" wx:if="{{banner}}">
<swiper class="banner_container" autoplay="true" vertical="true" circular="true"> <swiper style="height: 50rpx;" autoplay="true" vertical="true" circular="true">
<block wx:for="{{crisisDynamic}}"> <block wx:for="{{crisisDynamic}}">
<swiper-item> <swiper-item>
<text>{{item.title}}</text> <text>{{item.title}}</text>
...@@ -15,29 +15,21 @@ ...@@ -15,29 +15,21 @@
<!-- 顶部 --> <!-- 顶部 -->
<view id="top" class="con"> <view id="top" class="con">
<!-- 搜索 -->
<view class="search"> <view class="search">
<view class="search_in"> <view class="search_in">
<input type="text"/> <input type="text"/>
<button class="search_btn" bindtap="search">搜索</button> <button class="search_btn" bindtap="search">搜索</button>
</view> </view>
</view> </view>
<view class="box"> <!-- 锚点 -->
<view class="icon" bindtap="scrollToViewFn" data-id="dynamic"> <view class="anchor">
<image src="https://d1icd6shlvmxi6.cloudfront.net/gsc/L5VHPP/e9/83/b8/e983b88902ca4085bcbc34d714ac6904/images/%E9%A6%96%E9%A1%B5/u7.svg?pageId=794f4729-ba77-4770-92d6-71dfe84a18c1"/> <block wx:for="{{anchorList}}">
<text class="text">危机动态</text> <view class="icon" bindtap="scrollToViewFn" data-id="{{item.id}}">
</view> <image src="{{item.img}}"/>
<view class="icon" bindtap="scrollToViewFn" data-id="field"> <text class="text">{{item.text}}</text>
<image src="https://d1icd6shlvmxi6.cloudfront.net/gsc/L5VHPP/e9/83/b8/e983b88902ca4085bcbc34d714ac6904/images/首页/u14.svg?pageId=794f4729-ba77-4770-92d6-71dfe84a18c1"/>
<text class="text">聚焦领域</text>
</view>
<view class="icon" bindtap="scrollToViewFn" data-id="article">
<image src="https://d1icd6shlvmxi6.cloudfront.net/gsc/L5VHPP/e9/83/b8/e983b88902ca4085bcbc34d714ac6904/images/首页/u17.svg?pageId=794f4729-ba77-4770-92d6-71dfe84a18c1"/>
<text class="text">危机复盘</text>
</view>
<view class="icon" bindtap="scrollToViewFn" data-id="report">
<image src="https://d1icd6shlvmxi6.cloudfront.net/gsc/L5VHPP/e9/83/b8/e983b88902ca4085bcbc34d714ac6904/images/首页/u10.svg?pageId=794f4729-ba77-4770-92d6-71dfe84a18c1"/>
<text class="text">危机报告</text>
</view> </view>
</block>
</view> </view>
</view> </view>
...@@ -45,15 +37,13 @@ ...@@ -45,15 +37,13 @@
<!-- 危机动态 --> <!-- 危机动态 -->
<view id="dynamic" class="con"> <view id="dynamic" class="con">
<view class="up"> <view class="title-line">
<text class="title left">危机动态</text> <text class="title">危机动态</text>
<navigator url="/pages/crisislib/crisislib" open-type="switchTab" class="right">查看全部></navigator> <navigator url="/pages/crisislib/crisislib" open-type="switchTab" class="right">查看全部></navigator>
<view class="clear"></view>
</view> </view>
<swiper indicator-dots="true" autoplay="true" class="carousel" circular="true"> <swiper indicator-dots="true" autoplay="true" class="carousel" circular="true">
<block wx:for="{{crisisDynamic}}"> <block wx:for="{{crisisDynamic}}">
<swiper-item> <swiper-item>
<navigator url="https://crisis.zhiweidata.com/event/{{item.id}}"> <navigator url="https://crisis.zhiweidata.com/event/{{item.id}}">
<image class="dynamic_img" src="https://d1icd6shlvmxi6.cloudfront.net/gsc/L5VHPP/e9/83/b8/e983b88902ca4085bcbc34d714ac6904/images/首页/u22.svg?pageId=794f4729-ba77-4770-92d6-71dfe84a18c1" mode="scaleToFill" /> <image class="dynamic_img" src="https://d1icd6shlvmxi6.cloudfront.net/gsc/L5VHPP/e9/83/b8/e983b88902ca4085bcbc34d714ac6904/images/首页/u22.svg?pageId=794f4729-ba77-4770-92d6-71dfe84a18c1" mode="scaleToFill" />
<image class="dynamic_img2" src="https://d1icd6shlvmxi6.cloudfront.net/gsc/L5VHPP/e9/83/b8/e983b88902ca4085bcbc34d714ac6904/images/%E9%A6%96%E9%A1%B5/u21.png?pageId=794f4729-ba77-4770-92d6-71dfe84a18c1" mode="scaleToFill" /> <image class="dynamic_img2" src="https://d1icd6shlvmxi6.cloudfront.net/gsc/L5VHPP/e9/83/b8/e983b88902ca4085bcbc34d714ac6904/images/%E9%A6%96%E9%A1%B5/u21.png?pageId=794f4729-ba77-4770-92d6-71dfe84a18c1" mode="scaleToFill" />
...@@ -72,27 +62,30 @@ ...@@ -72,27 +62,30 @@
<!-- 聚焦领域 --> <!-- 聚焦领域 -->
<view id="field" class="con"> <view id="field" class="con">
<view> <view class="title-line">
<text class="title left">聚焦领域</text> <text class="title">聚焦领域</text>
<text class="right">查看全部></text> <text class="right">查看全部></text>
<view class="clear"></view>
</view> </view>
<view class="time"> <view class="time-type">
<view class="select_time" bindtap="refreshFieldData" data-id="month">近一月</view> <view class="select_time" bindtap="refreshFieldData" data-id="month">近一月</view>
<view class="select_time" bindtap="refreshFieldData" data-id="halfYear">近半年</view> <view class="select_time" bindtap="refreshFieldData" data-id="halfYear">近半年</view>
<view class="select_time" bindtap="refreshFieldData" data-id="year">近一年</view> <view class="select_time" bindtap="refreshFieldData" data-id="year">近一年</view>
</view> </view>
<view class="table"> <view class="field-table">
<view class="tr bg-w"> <view class="field-th">
<view class="th">全行业</view> <text>全行业</text>
<view class="th">危机占比</view> <text>危机占比</text>
<view class="th">涉及品牌</view> <text>涉及品牌</text>
</view> </view>
<block wx:for="{{crisisField}}" wx:key="index"> <block wx:for="{{crisisField}}">
<view class="tr {{index%2 === 0?'':'bg-g'}}"> <view class="field-list">
<view class="td">{{item.tag}}</view> <view class="field-tag">
<view class="td">{{item.proportion}}</view> <text>{{item.tag}}</text>
<view class="td">{{item.brand}}</view> <text style="display:block;color: red;font-size: 24rpx;">↑10%</text>
</view>
<!-- <view class="field-proportion">{{item.proportion}}</view> -->
<view class="field-proportion">50%</view>
<text class="field-brand">{{item.brand}}</text>
</view> </view>
</block> </block>
</view> </view>
...@@ -102,17 +95,17 @@ ...@@ -102,17 +95,17 @@
<!-- 危机复盘 --> <!-- 危机复盘 -->
<view id="article" class="con"> <view id="article" class="con">
<view> <view class="title-line">
<text class="title left">危机复盘</text> <text class="title">危机复盘</text>
<text class="right">查看全部></text> <text class="right">查看全部></text>
<view class="clear"></view>
</view> </view>
<block wx:for="{{crisisArticle}}" wx:key="index"> <block wx:for="{{crisisArticle}}">
<view class="tr {{index%2 === 0?'':'bg-g'}}"> <view class="article-list">
<view class="td">{{item.title}}</view> <view class="article-title">{{item.title}}</view>
<view class="td">{{item.publishTime}}</view> <view class="article-time">{{item.publishTime}}</view>
</view> </view>
</block> </block>
</view> </view>
...@@ -120,31 +113,32 @@ ...@@ -120,31 +113,32 @@
<!-- 危机报告 --> <!-- 危机报告 -->
<view id="report" class="con"> <view id="report" class="con">
<view> <view class="title-line">
<text class="title left">危机报告</text> <text class="title">危机报告</text>
<navigator url="/pages/crisisrep/crisisrep" open-type="switchTab" class="right">查看全部></navigator> <navigator url="/pages/crisisrep/crisisrep" open-type="switchTab" class="right">查看全部></navigator>
<view class="clear"></view>
</view> </view>
<block wx:for="{{crisisReport}}" wx:key="index"> <block wx:for="{{crisisReport}}" wx:key="index">
<!-- 首个新闻 --> <!-- 首个新闻 -->
<view wx:if="{{index==0}}" class="top_report" data-item="{{crisisReport[0]}}"> <view class="report-first" wx:if="{{index==0}}" data-item="{{crisisReport[0]}}">
<image class="img" src="https://crisis.zhiweidata.com/app/{{crisisReport[0].imgUrl}}" /> <image src="https://crisis.zhiweidata.com/app/{{crisisReport[0].imgUrl}}" />
<view class="info">{{crisisReport[0].reportName}}</view> <view class="info">{{crisisReport[0].reportName}}</view>
</view> </view>
<!-- 列表 --> <!-- 列表 -->
<view wx:if="{{index>0}}"> <view class="report-list" wx:if="{{index>0}}">
<view class="imgBox"> <view class="imgBox">
<image src="https://crisis.zhiweidata.com/app/{{item.imgUrl}}"/> <image mode="heightFix" src="https://crisis.zhiweidata.com/app/{{item.imgUrl}}"/>
</view> </view>
<view class="content"> <view class="content">
<view class="report_name">{{item.reportName}}</view> <text class="report-name">{{item.reportName}}</text>
<view class="report_time">{{item.time}}</view> <text class="report-introduction">{{item.introduction}}</text>
<text class="report-time">{{item.publishTime}}</text>
</view> </view>
</view> </view>
</block> </block>
<view class="line-title">--我是有底线的--</view>
</view> </view>
<view class="line-title">--我是有底线的--</view>
</scroll-view> </scroll-view>
/**index.wxss**/ /**index.wxss**/
page{
font-family: "微软雅黑 Bold", "微软雅黑 Regular", 微软雅黑, sans-serif;
}
.con{
width: 92%;
margin: 0 auto;
}
.line{
margin : 15px 0;
width: 100%;
border-top: 15px solid rgb(242 242 242);
}
.title-line{
margin-bottom: 25rpx;
}
.title{
font-weight: 700;
font-style: normal;
font-size: 18px;
color: rgb(0, 0, 0);
}
.right{
float:right;
min-width: 80rpx;
text-align: center;
display:block;
color: #7f7f7f;
}
/* 横幅 */
.banner{ .banner{
position: relative; position: relative;
height: 50rpx; height: 50rpx;
...@@ -7,9 +37,6 @@ ...@@ -7,9 +37,6 @@
background-color: #dae3f1; background-color: #dae3f1;
color: #025FEA; color: #025FEA;
} }
.banner .banner_container{
height: 50rpx;
}
.banner text{ .banner text{
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
...@@ -22,6 +49,7 @@ ...@@ -22,6 +49,7 @@
right: 20rpx; right: 20rpx;
} }
/* 搜索 */
.search { .search {
position: relative; position: relative;
height: 90rpx; height: 90rpx;
...@@ -50,87 +78,40 @@ ...@@ -50,87 +78,40 @@
font-size: 26rpx; font-size: 26rpx;
} }
.line{ /* 锚点 */
margin : 15px 0; .anchor{
width: 100%;
border-top: 15px solid rgb(242 242 242);
}
.clear{
clear:both;
}
.con{
width: 92%;
margin: 0 auto;
}
.box{
display: flex; display: flex;
flex-direction: row; justify-content: center;
text-align: center; text-align: center;
margin-top: 25px; margin-top: 25px;
} }
.icon{ .icon{
width: 25vw; width: 25vw;
} }
.icon image{ .icon image{
width: 7vw; width: 7vw;
height: 7vw; height: 7vw;
} }
.title{
display: flex;
font-family: "微软雅黑 Bold", "微软雅黑 Regular", 微软雅黑, sans-serif;
font-weight: 700;
font-style: normal;
font-size: 18px;
color: rgb(0, 0, 0);
text-align: left;
}
.carousel{
margin-top: 25rpx;
}
.icon .text{ .icon .text{
display: block; display: block;
} }
.left{ /* 危机动态 */
float: left;
}
.right{
float:right;
display:block;
color: #7f7f7f;
}
.clear{
clear: both;
}
.carousel{ .carousel{
margin-top: 25rpx;
position: relative; position: relative;
} }
.carousel .dynamic_img{ .carousel .dynamic_img{
position: absolute; position: absolute;
} }
.carousel .dynamic_title{ .carousel .dynamic_title{
position: absolute; position: absolute;
top: 20rpx; top: 20rpx;
left: 30rpx; left: 30rpx;
font-weight: 700; font-weight: bold;
font-style: normal; font-size: 36rpx;
font-size: 18px;
color: #FFFFFF; color: #FFFFFF;
} }
.carousel .dynamic_level{ .carousel .dynamic_level{
position: absolute; position: absolute;
top: 20rpx; top: 20rpx;
...@@ -141,14 +122,14 @@ ...@@ -141,14 +122,14 @@
background-color: #f87653; background-color: #f87653;
text-align: center; text-align: center;
} }
.carousel .dynamic_introduction{ .carousel .dynamic_introduction{
position: absolute; position: absolute;
top: 100rpx; top: 100rpx;
left: 30rpx; left: 30rpx;
font-weight: bold;
font-size: 30rpx;
color: #FFFFFF; color: #FFFFFF;
} }
.carousel .dynamic_brand{ .carousel .dynamic_brand{
position: absolute; position: absolute;
bottom: 50rpx; bottom: 50rpx;
...@@ -158,7 +139,6 @@ ...@@ -158,7 +139,6 @@
background-color: #ffffff; background-color: #ffffff;
text-align: center; text-align: center;
} }
.carousel .dynamic_tag{ .carousel .dynamic_tag{
position: absolute; position: absolute;
bottom: 50rpx; bottom: 50rpx;
...@@ -169,62 +149,85 @@ ...@@ -169,62 +149,85 @@
text-align: center; text-align: center;
} }
.time{ /* 聚焦领域 */
.time-type{
display: flex; display: flex;
flex-direction: row; height: 80rpx;
} }
.select_time{ .select_time{
width: 15vw; width: 15vw;
height: 35rpx; height: 35rpx;
background-color: #f2f2f2; background-color: #f2f2f2;
font-size: 25rpx; font-size: 25rpx;
margin: 25rpx 15rpx 25rpx 0rpx; margin: 0rpx 15rpx 25rpx 0rpx;
text-align: center; text-align: center;
} }
.field-table{
.tr { border: solid 2px #f3f3f3;
}
.field-th{
display: flex; display: flex;
width: 100%;
justify-content: center;
height: 72rpx;
align-items: center;
font-size: 22rpx;
color: #666666;
}
.td {
width:40%;
justify-content: center; justify-content: center;
height: 60rpx;
line-height: 60rpx;
text-align: center; text-align: center;
align-items: center; margin-bottom: 20rpx;
color: #666666; }
} .field-th text:nth-child(1){
.bg-g{ width: 25vh;
background: #F6F7F9; }
} .field-th text:nth-child(2){
.th { width: 25vh;
width: 40%; }
.field-th text:nth-child(3){
width: 50vh;
}
.field-list{
display: flex;
justify-content: center; justify-content: center;
background: #E9E9E9; height: 100rpx;
}
.field-tag{
width: 25%;
font-weight: bold;
text-align: center;
}
.field-proportion{
width: 25%;
line-height: 100rpx;
color: #00a2ff;
text-align: center;
}
.field-brand{
flex: 1;
font-size: 26rpx;
color: #333333; color: #333333;
display: flex; display: -webkit-box;
height: 72rpx; -webkit-box-orient: vertical;
align-items: center; -webkit-line-clamp: 2;
font-size: 22rpx; overflow: hidden;
} }
#report image{
margin-top: 25rpx;
width: 100%;
}
.line-title { /* 危机复盘 */
text-align: center; .article-list{
padding: 30rpx 0; border: solid 2px #f3f3f3;
color: #888888; display: flex;
flex-direction: column;
margin-top: 25rpx;
padding: 15rpx;
}
.article-title{
color: #333;
font-weight: bold;
margin-bottom: 25rpx;
}
.article-time{
color: #999;
} }
.top_report{ /* 危机报告 */
.report-first{
position: relative; position: relative;
width: 100%; width: 100%;
height: 324rpx; height: 324rpx;
...@@ -232,12 +235,13 @@ ...@@ -232,12 +235,13 @@
border-radius: 10px; border-radius: 10px;
border: solid 2px #eeeeee; border: solid 2px #eeeeee;
overflow: hidden; overflow: hidden;
margin-bottom: 25rpx;
} }
.top_report .img{ .report-first image{
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.info{ .report-first .info{
position: absolute; position: absolute;
bottom: 0; bottom: 0;
width: 100%; width: 100%;
...@@ -247,93 +251,57 @@ ...@@ -247,93 +251,57 @@
background-color: rgba(0,0,0,0.4); background-color: rgba(0,0,0,0.4);
color: #ffffff;font-size: 28rpx; color: #ffffff;font-size: 28rpx;
} }
.report-list{
.imgBox { width: 100%;
position: relative; height: 180rpx;
width: 230rpx; margin-bottom: 25rpx;
height: 144rpx; display: flex;
margin-right: 30rpx; }
.report-list .imgBox {
height: 100%;
margin-right: 20rpx;
} }
.imgBox .img { .report-list .imgBox image{
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.report-list .content{
.content { position: relative;
flex: 1; height: 180rpx;
width: 100%;
} }
.content .report-name{
.content .title { position: absolute;
height: 28rpx; top: 0;
line-height: 28rpx; left: 0;
margin-bottom: 14rpx; color: #333;
font-size: 28rpx;
color: #353535;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
line-clamp: 1; white-space: nowrap;
}
.infos {
display: flex;
}
.brand {
padding: 0 10rpx;
height: 36rpx;
margin-right: 14rpx;
background-color: #a1a3b6;
border-radius: 4rpx;
font-size: 20rpx;
color: #ffffff;
display: flex;
justify-content: center;
align-items: center;
}
.labels {
border-radius: 4rpx;
border: solid 2rpx #dddddd;
font-size: 20rpx;
color: #999999;
padding: 0 6rpx;
height: 36rpx;
display: flex;
justify-content: center;
align-items: center;
}
.labels .right {
padding: 8rpx 10rpx;
}
.time {
height: 19rpx;
font-size: 24rpx;
line-height: 24rpx;
color: #999999;
padding-top: 35rpx;
} }
.tag { .content .report-introduction{
position: absolute; position: absolute;
left: -10rpx; top: 50rpx;
top: -10rpx; left: 0;
width: 66rpx; color: #999;
height: 35rpx; font-size: 24rpx;
line-height: 35rpx; display: -webkit-box;
background-color: #ff7f49; -webkit-box-orient: vertical;
border-radius: 4rpx 4rpx 4rpx 0rpx; -webkit-line-clamp: 2;
text-align: center; overflow: hidden;
color: #ffffff;
font-size: 19rpx;
} }
.tag::before { .content .report-time{
position: absolute; position: absolute;
bottom: -10rpx; bottom: 0;
left: 0; left: 0;
content: '';
width: 0;
height: 0;
border-top: 10rpx solid #ff7f49;
border-left: 10rpx solid transparent;
} }
.line-title {
text-align: center;
margin: 30rpx 0;
color: #888888;
}
// pages/library/library.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<!--pages/library/library.wxml-->
<text>pages/library/library.wxml</text>
/* pages/library/library.wxss */
\ No newline at end of file
// pages/report/report.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<!--pages/report/report.wxml-->
<text>pages/report/report.wxml</text>
/* pages/report/report.wxss */
\ No newline at end of file
<!--pages/usercenter/index.wxml-->
<text>pages/usercenter/index.wxml</text>
/* pages/usercenter/index.wxss */
\ No newline at end of file
// pages/usercenter/usercenter.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<!--pages/usercenter/usercenter.wxml-->
<text>pages/usercenter/usercenter.wxml</text>
/* pages/usercenter/usercenter.wxss */
\ No newline at end of file
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
"minified": true, "minified": true,
"newFeature": false, "newFeature": false,
"coverView": true, "coverView": true,
"nodeModules": false, "nodeModules": true,
"autoAudits": false, "autoAudits": false,
"showShadowRootInWxmlPanel": true, "showShadowRootInWxmlPanel": true,
"scopeDataCheck": false, "scopeDataCheck": false,
......
// const baseURL = 'https://crisis.zhiweidata.com'
const baseURL = 'http://localhost:8088'
function wxPromisify(fn) {
return function (obj = {}) {
return new Promise((resolve, reject) => {
obj.success = function (res) {
//成功
wx.hideNavigationBarLoading()
resolve(res)
}
obj.fail = function (res) {
//失败
reject(res)
wx.hideNavigationBarLoading()
console.log(res)
}
fn(obj)
})
}
}
//get
export const getRequest = (url, data) => {
var getRequest = wxPromisify(wx.request);
wx.showNavigationBarLoading()
return getRequest({
url: baseURL+url,
method: 'GET',
data: data,
header: {
'Content-Type': 'application/json'
}
})
}
//post
export const postRequest = (url, data) => {
var postRequest = wxPromisify(wx.request)
wx.showNavigationBarLoading()
return postRequest({
url: baseURL+url,
method: 'POST',
data: data,
header: {
"content-type": "application/json"
},
})
}
//put
export const putRequest = (url, data) => {
var putRequest = wxPromisify(wx.request)
wx.showNavigationBarLoading()
return putRequest({
url: baseURL+url,
method: 'PUT',
data: data,
header: {
"content-type": "application/json"
},
})
}
//delete
export const deleteRequest = (url, data) => {
var deleteRequest = wxPromisify(wx.request)
wx.showNavigationBarLoading()
return deleteRequest({
url: baseURL+url,
method: 'PUT',
data: data,
header: {
"content-type": "application/json"
},
})
}
\ No newline at end of file
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