@@ -86,4 +86,14 @@ export const readAll = function (data) { | |||
method: 'PUT', | |||
data | |||
}) | |||
} | |||
/** | |||
* 全部已读 | |||
*/ | |||
export const messageSum = function (data) { | |||
return request({ | |||
url: '/message/sum', | |||
method: 'get', | |||
data | |||
}) | |||
} |
@@ -3,5 +3,6 @@ | |||
"list": "../../../components/List/index", | |||
"ImageList": "../../../components/ImageList/index" | |||
}, | |||
"navigationStyle": "custom" | |||
"navigationBarTitleText": "护河活动", | |||
"navigationBarBackgroundColor": "#2C81F6" | |||
} |
@@ -1,8 +1,8 @@ | |||
<!--package_first/pages/ProtectionActivity/index.wxml--> | |||
<view class="pageContainer"> | |||
<!-- <view class="pageContainer"> | |||
<image class="navBg" mode="widthFix" src="../../../assets/img/activitytitle.png" /> | |||
<image class="home" bindtap="homepage" src="../../../assets/img/back.png" mode=""/> | |||
</view> | |||
</view> --> | |||
<view class="activity_container"> | |||
<view class="top"> | |||
<image class="activity_bg" src="../../../assets/img/activitybg.png" mode=""/> |
@@ -1,12 +1,12 @@ | |||
/* package_first/pages/ProtectionActivity/index.wxss */ | |||
.navBg { | |||
/* .navBg { | |||
width: 100%; | |||
position: absolute; | |||
top: 0; | |||
} | |||
} */ | |||
.activity_container{ | |||
margin-top: 175rpx; | |||
/* margin-top: 175rpx; */ | |||
width: 103%; | |||
height: 1664rpx; | |||
background-color: #F2F3F6; |
@@ -1,5 +1,6 @@ | |||
// pages/mine/index.js | |||
import {getUserData} from '../../api/login.js' | |||
import {messageSum} from '../../api/mine.js' | |||
Page({ | |||
/** | |||
@@ -13,10 +14,11 @@ Page({ | |||
{title: '我的兑换', type: 'exchange', path: '/package_mine/pages/exchange/index'}, | |||
{title: '河湖问题反馈', type: 'feedback', path: '/package_mine/pages/records/index'}, | |||
// {title: '我的美拍', type: 'beauty', path: '/package_mine/pages/beauties/index'}, | |||
{title: '消息通知', type: 'notice', path: '/package_mine/pages/notice/index'}, | |||
{title: '消息通知', type: 'notice', path: '/package_mine/pages/notice/index',showNumbers: true}, | |||
], | |||
myId: '', // 身份 | |||
integral: 0, // 积分 | |||
numbers: 0 | |||
}, | |||
/** | |||
@@ -30,6 +32,7 @@ Page({ | |||
}, | |||
onShow:function() { | |||
this.getUserInfo() | |||
this.getUnReadNums() | |||
}, | |||
goRecords(e) { | |||
@@ -52,6 +55,14 @@ Page({ | |||
this.setData({userInfo}) | |||
}) | |||
}, | |||
getUnReadNums(){ | |||
const openId = wx.getStorageSync('openid') | |||
messageSum({openId}).then(res=>{ | |||
this.setData({ | |||
numbers: res.data || 0 | |||
}) | |||
}) | |||
}, | |||
// 进入申请身份页面 | |||
goApprove() { | |||
wx.navigateTo({ |
@@ -21,7 +21,8 @@ | |||
<view class="function_item" wx:for="{{list}}" wx:key="index" bindtap="goRecords" data-path="{{item.path}}"> | |||
<view class="item_title"> | |||
<image style="height: 60rpx;width: 60rpx;margin-right: 20rpx;" src="{{'../../assets/img/'+ item.type +'.png'}}"></image> | |||
<text style="font-size: 26rpx;">{{item.title}}</text> | |||
<view style="font-size: 26rpx;z-index:99">{{item.title}}</view> | |||
<text wx:if="{{item.showNumbers && numbers > 0}}" class="badge">{{numbers > 99 ? '99+' : numbers }}</text> | |||
</view> | |||
<image style="height: 30rpx;width: 30rpx;" src="../../assets/img/more.png"></image> | |||
</view> |
@@ -94,4 +94,15 @@ | |||
display: flex; | |||
justify-content: flex-start; | |||
align-items: center; | |||
} | |||
.badge{ | |||
background: #E73F3F; | |||
border-radius: 10px; | |||
padding: 0 15rpx; | |||
color: #FFFFFF; | |||
font-size: 24rpx; | |||
position: relative; | |||
top: -10rpx; | |||
right: 20rpx; | |||
} |