Browse Source

志愿者去哪儿中增加未读活动提示;

feature/optimise
ZhaoTongYao 5 years ago
parent
commit
dabdcbfd45
  1. 26
      pages/indexNew/indexNew.js
  2. 3
      pages/indexNew/indexNew.wxml
  3. 12
      pages/indexNew/indexNew.wxss
  4. 13
      project.config.json
  5. 3
      utils/api.js

26
pages/indexNew/indexNew.js

@ -50,11 +50,9 @@ Page({
title: "e锦水", //导航栏 中间的标题
},
height: app.globalData.height * 2 + 20,
infoObj: {
time: "",
title: "",
amount: ""
},
infoObj: [],
informationNum: 0, //新消息数量
unreadSignUpActNum: 0, //未查看报名中活动数量
noticeList: [],
innerHtmlStatus: true,
visibilityStatus: true,
@ -292,14 +290,21 @@ Page({
getFirstInfo: function () {
let that = this
api.getFirstInfo().then(function (res) {
// console.log('infoObj', res.data)
if (res.data !== null) {
that.data.infoObj = [ ...res.data ]
that.data.infoObj.forEach(item => {
if (item.dataType == 'informationNum') {
that.setData({
infoObj: res.data
informationNum: item.num
})
}
if (item.dataType == 'unreadSignUpActNum') {
that.setData({
unreadSignUpActNum: item.num
})
}
})
}
// console.log('zheli', that.data.infoObj)
})
},
getNoticeList: function () {
@ -310,14 +315,11 @@ Page({
}
let that = this
api.noticelist(para).then(function (res) {
// console.log('infoObj', res.data)
if (res.data !== null) {
that.setData({
noticeList: res.data
})
}
// console.log('zheli', that.data.infoObj)
})
},
// 根据微信code查询用户当前状态

3
pages/indexNew/indexNew.wxml

@ -20,7 +20,7 @@
<image src="../../images/home/signined.png" wx:else />
</view>
<view class="my-and-news">
<image wx:if="{{infoObj.title == ''}}" bindtap="noMore" class="news" src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/05/rBAB716nk4yASWCrAAAKA-kIkt0142.png" />
<image wx:if="{{informationNum == 0}}" bindtap="noMore" class="news" src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/05/rBAB716nk4yASWCrAAAKA-kIkt0142.png" />
<image wx:else bindtap="toInfoList" class="news" src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/07/rBAB7161EWKAIXwXAAAD4DwRkd4543.png" />
<!-- <image bindtap="toMine" class="my" src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/06/rBAB716n_HiAZ9BOAAAIkMWBOnA191.png" /> -->
</view>
@ -99,6 +99,7 @@
</button>
<view class="weui-btn-right">
<button bindtap="goheart" class="weui-btn-top" form-type='submit' plain='true' hover-class="hover-btn">
<view class="is-unread" wx:if="{{unreadSignUpActNum > 0}}"></view>
<image src='https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/06/rBAB7161BqiAGT25AADji64eXU8518.png'></image>
</button>
<button bindtap="dqhd" class="weui-btn-top" form-type='submit' plain='true' hover-class="hover-btn">

12
pages/indexNew/indexNew.wxss

@ -473,12 +473,24 @@ page {
width: 100%;
padding: 0;
border: none;
position: relative;
}
.weui-btn-top+.weui-btn-top {
margin-top: 0 !important;
}
.grid-all-new .weui-btn-right .weui-btn-top .is-unread {
width: 14rpx;
height: 14rpx;
background-color: red;
border-radius: 50%;
border: 2rpx solid white;
position: absolute;
right: 50rpx;
top: 30rpx;
}
.grid-all-new .weui-btn-right .weui-btn-top image {
height: 100%;
width: 100%;

13
project.config.json

@ -43,28 +43,19 @@
"hidedInDevtools": []
},
"scripts": {},
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"plugin": {
"current": -1,
"list": []
},
"game": {
"list": []
},
"gamePlugin": {
"current": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": [
{
"id": 0,

3
utils/api.js

@ -80,7 +80,8 @@ function getProjectList (param) {
}
function getFirstInfo () {
return fly.post("news/information/first")
// return fly.post("news/information/first")
return fly.post("news/v2/information/first")
}
function noticelist (param) {

Loading…
Cancel
Save