|
@ -14,7 +14,7 @@ |
|
|
<view class="item flex_row flex_start bg-white padding solid-bottom" @click="jumpPage('messageList')"> |
|
|
<view class="item flex_row flex_start bg-white padding solid-bottom" @click="jumpPage('messageList')"> |
|
|
<image src="../../static/images/index/index_bell.png" mode=""></image> |
|
|
<image src="../../static/images/index/index_bell.png" mode=""></image> |
|
|
<view class="text-m text-left">消息中心</view> |
|
|
<view class="text-m text-left">消息中心</view> |
|
|
<view class="bandage">99</view> |
|
|
|
|
|
|
|
|
<view class="bandage" v-if="unReadNum">{{unReadNum}}</view> |
|
|
<image src="../../static/images/index/arrow_right.png" mode=""></image> |
|
|
<image src="../../static/images/index/arrow_right.png" mode=""></image> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
@ -33,11 +33,13 @@ |
|
|
</template> |
|
|
</template> |
|
|
<script> |
|
|
<script> |
|
|
import { mapState,mapActions,mapGetters } from 'vuex' |
|
|
import { mapState,mapActions,mapGetters } from 'vuex' |
|
|
|
|
|
import {msgNum} from "../../nxTemp/apis/userAPI.js" |
|
|
export default { |
|
|
export default { |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
address:"", |
|
|
address:"", |
|
|
login:false |
|
|
|
|
|
|
|
|
login:false, |
|
|
|
|
|
unReadNum:"" |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
computed:{ |
|
|
computed:{ |
|
@ -45,7 +47,7 @@ |
|
|
...mapGetters(['hasLogin']), |
|
|
...mapGetters(['hasLogin']), |
|
|
}, |
|
|
}, |
|
|
onLoad(opt) { |
|
|
onLoad(opt) { |
|
|
|
|
|
|
|
|
|
|
|
this.updateMsgNum() |
|
|
}, |
|
|
}, |
|
|
onUnload() { |
|
|
onUnload() { |
|
|
|
|
|
|
|
@ -55,6 +57,14 @@ |
|
|
jumpPage(name){ |
|
|
jumpPage(name){ |
|
|
this.$Router.push({name:name}) |
|
|
this.$Router.push({name:name}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
updateMsgNum(){ |
|
|
|
|
|
console.log(123); |
|
|
|
|
|
msgNum(this.postData).then(res => { |
|
|
|
|
|
this.unReadNum = res |
|
|
|
|
|
}).catch(e=>{ |
|
|
|
|
|
this.$tools.showNone(e.errMsg) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
async clickEvent(){ |
|
|
async clickEvent(){ |
|
|
if(this.hasLogin)this.jumpPage('eventList'); |
|
|
if(this.hasLogin)this.jumpPage('eventList'); |
|
|
else await this.$tools.showModal("该功能需要登录后才能查看,是否跳转去登录界面?",()=>{this.jumpPage('login')}) |
|
|
else await this.$tools.showModal("该功能需要登录后才能查看,是否跳转去登录界面?",()=>{this.jumpPage('login')}) |
|
|