Commit ad208c0d by liangyuhang

首页部分修改

parent d89ca9e7
......@@ -2,9 +2,9 @@
"pages": [
"pages/index/index",
"pages/logs/logs",
"pages/crisisrep/crisisrep",
"pages/crisislib/crisislib",
"pages/usercenter/index"
"pages/report/report",
"pages/library/library",
"pages/usercenter/usercenter"
],
"window": {
"backgroundTextStyle": "light",
......@@ -13,23 +13,24 @@
"navigationBarTextStyle": "black"
},
"tabBar": {
"selectedColor":"#4551c2",
"list": [{
"pagePath": "pages/index/index",
"iconPath": "image/icon_cloud.png",
"selectedIconPath": "image/icon_cloud_HL.png",
"text": "首页"
},{
"pagePath": "pages/crisisrep/crisisrep",
"pagePath": "pages/report/report",
"iconPath": "image/icon_API.png",
"selectedIconPath": "image/icon_API_HL.png",
"text": "危机报告"
}, {
"pagePath": "pages/crisislib/crisislib",
"pagePath": "pages/library/library",
"iconPath": "image/icon_component.png",
"selectedIconPath": "image/icon_component_HL.png",
"text": "危机库"
}, {
"pagePath": "pages/usercenter/index",
"pagePath": "pages/usercenter/usercenter",
"iconPath": "image/icon_component.png",
"selectedIconPath": "image/icon_component_HL.png",
"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
// 获取应用实例
const app = getApp()
var http = require('../../utils/http')
const moment = require('../../utils/moment.min.js')
Page({
data: {
......@@ -10,12 +12,28 @@ Page({
crisisReport:[],
banner:true,
toView: 'banner',
},
// 事件处理函数
bindViewTap() {
wx.navigateTo({
url: '../logs/logs'
})
anchorList:[
{
id: 'dynamic',
text: '危机动态',
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() {
this.setCrisisDynamicData();
......@@ -24,71 +42,43 @@ Page({
this.setCrisisReportData();
},
setCrisisDynamicData(){
wx.request({
method: 'GET',
url: 'http://localhost:8088/mobile/index/event/recently',
success: (res) =>{
http.getRequest('/mobile/index/event/recently').then(res=>{
if(res){
this.setData({
crisisDynamic:res.data.data.list
})
},
fail(e){
console.log(e)
crisisDynamic:res.data.data.list
})
}
})
},
setCrisisFieldData(){
wx.request({
method: 'GET',
url: 'http://localhost:8088/mobile/index/focusIndustry?timeType=month',
success: (res) =>{
http.getRequest('/mobile/index/focusIndustry?timeType=halfYear').then(res=>{
if(res){
this.setData({
crisisField:res.data.data
})
},
fail(e){
console.log(e)
crisisField:res.data.data
})
}
})
},
setCrisisArticleData(){
wx.request({
method: 'GET',
url: 'http://localhost:8088/mobile/index/article/recently',
success: (res) =>{
// console.log(res)
this.setData({
crisisArticle:res.data.data
http.getRequest('/mobile/index/article/recently').then(res=>{
if(res){
let arr = res.data.data
arr.forEach(item => {
console.log(item)
item.publishTime = moment(item.publishTime).format('YYYY-MM-DD')
})
},
fail(e){
console.log(e)
this.setData({
crisisArticle:arr
})
}
})
},
setCrisisReportData(){
wx.request({
method: 'GET',
url: 'http://localhost:8088/mobile/index/report/recently?size=4',
success: (res) =>{
http.getRequest('/mobile/index/report/recently?size=4').then(res=>{
if(res){
this.setData({
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)
crisisReport:res.data.data
})
}
})
},
......@@ -104,20 +94,20 @@ Page({
})
// console.log(this.data.toView)
},
refreshFieldData(e){
var _id = e.currentTarget.dataset.id;
console.log(_id);
wx.request({
method: 'GET',
header: { 'content-type':'application/json' },
url: 'http://localhost:8088/mobile/index/focusIndustry?timeType='+_id,
success(res) {
console.log(res.data.data)
crisisField:res.data.data
},
fail(e){
console.log(e)
}
})
}
// refreshFieldData(e){
// var _id = e.currentTarget.dataset.id;
// wx.request({
// method: 'GET',
// header: { 'content-type':'application/json' },
// url: 'http://localhost:8088/mobile/index/focusIndustry?timeType='+_id,
// success(res) {
// console.log(res.data.data)
// crisisField:res.data.data
// },
// fail(e){
// console.log(e)
// }
// })
// }
})
......@@ -3,7 +3,7 @@
<!-- 横幅 -->
<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}}">
<swiper-item>
<text>{{item.title}}</text>
......@@ -15,29 +15,21 @@
<!-- 顶部 -->
<view id="top" class="con">
<!-- 搜索 -->
<view class="search">
<view class="search_in">
<input type="text"/>
<button class="search_btn" bindtap="search">搜索</button>
</view>
</view>
<view class="box">
<view class="icon" bindtap="scrollToViewFn" data-id="dynamic">
<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"/>
<text class="text">危机动态</text>
</view>
<view class="icon" bindtap="scrollToViewFn" data-id="field">
<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 class="anchor">
<block wx:for="{{anchorList}}">
<view class="icon" bindtap="scrollToViewFn" data-id="{{item.id}}">
<image src="{{item.img}}"/>
<text class="text">{{item.text}}</text>
</view>
</block>
</view>
</view>
......@@ -45,15 +37,13 @@
<!-- 危机动态 -->
<view id="dynamic" class="con">
<view class="up">
<text class="title left">危机动态</text>
<view class="title-line">
<text class="title">危机动态</text>
<navigator url="/pages/crisislib/crisislib" open-type="switchTab" class="right">查看全部></navigator>
<view class="clear"></view>
</view>
<swiper indicator-dots="true" autoplay="true" class="carousel" circular="true">
<block wx:for="{{crisisDynamic}}">
<swiper-item>
<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_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 @@
<!-- 聚焦领域 -->
<view id="field" class="con">
<view>
<text class="title left">聚焦领域</text>
<view class="title-line">
<text class="title">聚焦领域</text>
<text class="right">查看全部></text>
<view class="clear"></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="halfYear">近半年</view>
<view class="select_time" bindtap="refreshFieldData" data-id="year">近一年</view>
</view>
<view class="table">
<view class="tr bg-w">
<view class="th">全行业</view>
<view class="th">危机占比</view>
<view class="th">涉及品牌</view>
<view class="field-table">
<view class="field-th">
<text>全行业</text>
<text>危机占比</text>
<text>涉及品牌</text>
</view>
<block wx:for="{{crisisField}}" wx:key="index">
<view class="tr {{index%2 === 0?'':'bg-g'}}">
<view class="td">{{item.tag}}</view>
<view class="td">{{item.proportion}}</view>
<view class="td">{{item.brand}}</view>
<block wx:for="{{crisisField}}">
<view class="field-list">
<view class="field-tag">
<text>{{item.tag}}</text>
<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>
</block>
</view>
......@@ -102,17 +95,17 @@
<!-- 危机复盘 -->
<view id="article" class="con">
<view>
<text class="title left">危机复盘</text>
<view class="title-line">
<text class="title">危机复盘</text>
<text class="right">查看全部></text>
<view class="clear"></view>
</view>
<block wx:for="{{crisisArticle}}" wx:key="index">
<view class="tr {{index%2 === 0?'':'bg-g'}}">
<view class="td">{{item.title}}</view>
<view class="td">{{item.publishTime}}</view>
<block wx:for="{{crisisArticle}}">
<view class="article-list">
<view class="article-title">{{item.title}}</view>
<view class="article-time">{{item.publishTime}}</view>
</view>
</block>
</view>
......@@ -120,31 +113,32 @@
<!-- 危机报告 -->
<view id="report" class="con">
<view>
<text class="title left">危机报告</text>
<view class="title-line">
<text class="title">危机报告</text>
<navigator url="/pages/crisisrep/crisisrep" open-type="switchTab" class="right">查看全部></navigator>
<view class="clear"></view>
</view>
<block wx:for="{{crisisReport}}" wx:key="index">
<!-- 首个新闻 -->
<view wx:if="{{index==0}}" class="top_report" data-item="{{crisisReport[0]}}">
<image class="img" src="https://crisis.zhiweidata.com/app/{{crisisReport[0].imgUrl}}" />
<view class="report-first" wx:if="{{index==0}}" data-item="{{crisisReport[0]}}">
<image src="https://crisis.zhiweidata.com/app/{{crisisReport[0].imgUrl}}" />
<view class="info">{{crisisReport[0].reportName}}</view>
</view>
<!-- 列表 -->
<view wx:if="{{index>0}}">
<view class="report-list" wx:if="{{index>0}}">
<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 class="content">
<view class="report_name">{{item.reportName}}</view>
<view class="report_time">{{item.time}}</view>
<text class="report-name">{{item.reportName}}</text>
<text class="report-introduction">{{item.introduction}}</text>
<text class="report-time">{{item.publishTime}}</text>
</view>
</view>
</block>
<view class="line-title">--我是有底线的--</view>
</view>
<view class="line-title">--我是有底线的--</view>
</scroll-view>
/**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{
position: relative;
height: 50rpx;
......@@ -7,9 +37,6 @@
background-color: #dae3f1;
color: #025FEA;
}
.banner .banner_container{
height: 50rpx;
}
.banner text{
overflow: hidden;
text-overflow: ellipsis;
......@@ -22,6 +49,7 @@
right: 20rpx;
}
/* 搜索 */
.search {
position: relative;
height: 90rpx;
......@@ -50,87 +78,40 @@
font-size: 26rpx;
}
.line{
margin : 15px 0;
width: 100%;
border-top: 15px solid rgb(242 242 242);
}
.clear{
clear:both;
}
.con{
width: 92%;
margin: 0 auto;
}
.box{
/* 锚点 */
.anchor{
display: flex;
flex-direction: row;
justify-content: center;
text-align: center;
margin-top: 25px;
}
.icon{
width: 25vw;
}
.icon image{
width: 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{
display: block;
}
.left{
float: left;
}
.right{
float:right;
display:block;
color: #7f7f7f;
}
.clear{
clear: both;
}
/* 危机动态 */
.carousel{
margin-top: 25rpx;
position: relative;
}
.carousel .dynamic_img{
position: absolute;
}
.carousel .dynamic_title{
position: absolute;
top: 20rpx;
left: 30rpx;
font-weight: 700;
font-style: normal;
font-size: 18px;
font-weight: bold;
font-size: 36rpx;
color: #FFFFFF;
}
.carousel .dynamic_level{
position: absolute;
top: 20rpx;
......@@ -141,14 +122,14 @@
background-color: #f87653;
text-align: center;
}
.carousel .dynamic_introduction{
position: absolute;
top: 100rpx;
left: 30rpx;
font-weight: bold;
font-size: 30rpx;
color: #FFFFFF;
}
.carousel .dynamic_brand{
position: absolute;
bottom: 50rpx;
......@@ -158,7 +139,6 @@
background-color: #ffffff;
text-align: center;
}
.carousel .dynamic_tag{
position: absolute;
bottom: 50rpx;
......@@ -169,62 +149,85 @@
text-align: center;
}
.time{
/* 聚焦领域 */
.time-type{
display: flex;
flex-direction: row;
height: 80rpx;
}
.select_time{
width: 15vw;
height: 35rpx;
background-color: #f2f2f2;
font-size: 25rpx;
margin: 25rpx 15rpx 25rpx 0rpx;
margin: 0rpx 15rpx 25rpx 0rpx;
text-align: center;
}
.tr {
.field-table{
border: solid 2px #f3f3f3;
}
.field-th{
display: flex;
width: 100%;
justify-content: center;
height: 72rpx;
align-items: center;
font-size: 22rpx;
color: #666666;
}
.td {
width:40%;
justify-content: center;
height: 60rpx;
line-height: 60rpx;
text-align: center;
align-items: center;
color: #666666;
}
.bg-g{
background: #F6F7F9;
}
.th {
width: 40%;
margin-bottom: 20rpx;
}
.field-th text:nth-child(1){
width: 25vh;
}
.field-th text:nth-child(2){
width: 25vh;
}
.field-th text:nth-child(3){
width: 50vh;
}
.field-list{
display: flex;
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;
display: flex;
height: 72rpx;
align-items: center;
font-size: 22rpx;
}
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
#report image{
margin-top: 25rpx;
width: 100%;
}
.line-title {
text-align: center;
padding: 30rpx 0;
color: #888888;
/* 危机复盘 */
.article-list{
border: solid 2px #f3f3f3;
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;
width: 100%;
height: 324rpx;
......@@ -232,12 +235,13 @@
border-radius: 10px;
border: solid 2px #eeeeee;
overflow: hidden;
margin-bottom: 25rpx;
}
.top_report .img{
.report-first image{
width: 100%;
height: 100%;
}
.info{
.report-first .info{
position: absolute;
bottom: 0;
width: 100%;
......@@ -247,93 +251,57 @@
background-color: rgba(0,0,0,0.4);
color: #ffffff;font-size: 28rpx;
}
.imgBox {
position: relative;
width: 230rpx;
height: 144rpx;
margin-right: 30rpx;
.report-list{
width: 100%;
height: 180rpx;
margin-bottom: 25rpx;
display: flex;
}
.report-list .imgBox {
height: 100%;
margin-right: 20rpx;
}
.imgBox .img {
.report-list .imgBox image{
width: 100%;
height: 100%;
}
.content {
flex: 1;
.report-list .content{
position: relative;
height: 180rpx;
width: 100%;
}
.content .title {
height: 28rpx;
line-height: 28rpx;
margin-bottom: 14rpx;
font-size: 28rpx;
color: #353535;
.content .report-name{
position: absolute;
top: 0;
left: 0;
color: #333;
overflow: hidden;
text-overflow: ellipsis;
line-clamp: 1;
}
.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;
white-space: nowrap;
}
.tag {
.content .report-introduction{
position: absolute;
left: -10rpx;
top: -10rpx;
width: 66rpx;
height: 35rpx;
line-height: 35rpx;
background-color: #ff7f49;
border-radius: 4rpx 4rpx 4rpx 0rpx;
text-align: center;
color: #ffffff;
font-size: 19rpx;
top: 50rpx;
left: 0;
color: #999;
font-size: 24rpx;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.tag::before {
.content .report-time{
position: absolute;
bottom: -10rpx;
bottom: 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 @@
"minified": true,
"newFeature": false,
"coverView": true,
"nodeModules": false,
"nodeModules": true,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"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