123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>消息中心-创业帮</title>
- <meta name="keywords" content="消息中心-创业帮">
- <meta name="description" content="消息中心-创业帮">
- <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <meta content="telephone=no" name="format-detection">
- <meta content="email=no" name="format-detection">
- <meta name="apple-mobile-web-app-title" content="消息中心-创业帮">
- <meta http-equiv="Cache-Control" content="no-siteapp">
- <link rel="stylesheet" href="./static/css/main.css">
- </head>
- <body class="bgcf7f7f7 ovh" style="padding-top:0;">
- <div id="app">
- <van-nav-bar class="mall_title bottom_line" title="消息中心" v-if="toptitleisshow"></van-nav-bar>
- <van-pull-refresh class="noticexy" v-model="isLoading" @refresh="onRefresh">
- <van-cell class="cm" is-link @click="systemnotice">
- <template #title>
- <div class="notice-center-b rel"><img class="notice-center-img" src="./static/images/notice-btn1.png" alt=""></div><span class="f14 c333 pl6">系统消息</span>
- </template>
- <template #right-icon>
- <van-tag class="cm" type="warning" round v-if="unreadnoticenum.PlacardCount !== 0">{{unreadnoticenum.PlacardCount}}</van-tag>
- <van-icon name="arrow"></van-icon>
- </template>
- </van-cell>
- <van-cell class="cm" is-link @click="personalnotice">
- <template #title>
- <div class="notice-center-b rel"><img class="notice-center-img" src="./static/images/notice-btn2.png" alt=""></div><span class="f14 c333 pl6">个人消息</span>
- </template>
- <template #right-icon>
- <van-tag class="cm" type="warning" round v-if="unreadnoticenum.PersonalCount !== 0">{{unreadnoticenum.PersonalCount}}</van-tag>
- <van-icon name="arrow"></van-icon>
- </template>
- </van-cell>
- </van-pull-refresh>
- <van-tabbar v-model="active" active-color="#FF502A" v-cloak v-if="tabsisshow">
- <van-tabbar-item icon="home-o" @click="index">工作台
- <template #icon="props"><img :src="props.active ? icon1.active : icon1.inactive"></template>
- </van-tabbar-item>
- <van-tabbar-item icon="search" @click="management">经营数据
- <template #icon="props"><img :src="props.active ? icon2.active : icon2.inactive"></template>
- </van-tabbar-item>
- <van-tabbar-item icon="friends-o" :dot="isnotice">消息
- <template #icon="props"><img :src="props.active ? icon3.active : icon3.inactive"></template>
- </van-tabbar-item>
- <van-tabbar-item icon="setting-o" @click="user">我的
- <template #icon="props"><img :src="props.active ? icon4.active : icon4.inactive"></template>
- </van-tabbar-item>
- </van-tabbar>
- </div>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script>
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- active: 2,
- toptitleisshow:false,
- unreadnoticenum:{
- PersonalCount:0,
- PlacardCount:0,
- },
- icon1: {
- active: './static/images/tab-icon1-active.png',
- inactive: './static/images/tab-icon1-no.png',
- },
- icon2: {
- active: './static/images/tab-icon2-active.png',
- inactive: './static/images/tab-icon2-no.png',
- },
- icon3: {
- active: './static/images/tab-icon3-active.png',
- inactive: './static/images/tab-icon3-no.png',
- },
- icon4: {
- active: './static/images/tab-icon4-active.png',
- inactive: './static/images/tab-icon4-no.png',
- },
- tabsisshow:false,
- isLoading:false,
- };
- },
- created() {
- this.tabsisshow = bottomtabisshow;
- this.getnoticecount();
- },
- computed:{
- isnotice:function(){
- if(this.unreadnoticenum.PersonalCount !== 0 || this.unreadnoticenum.PlacardCount !== 0){
- PublicLib.putCookieInfo('noticeiscount', true);
- } else {
- PublicLib.putCookieInfo('noticeiscount', "");
- };
- return PublicLib.getCookieInfo('noticeiscount') !== "";
- }
- },
- methods: {
- async onRefresh(){
- await this.getnoticecount();
- this.isLoading = false;
- },
- //- 跳转商城
- management(){
- PublicLib.Goto({Url:'management'});
- },
- //- 跳转主页
- index(){
- PublicLib.Goto({Url:'index'});
- },
- //- 跳转我的
- user(){
- PublicLib.Goto({Url:'user-center'});
- },
- //- 跳转系统消息
- systemnotice(){
- PublicLib.putCookieInfo('noticeType', '系统消息');
- PublicLib.Goto({Url:'notice-list'});
- },
- //- 跳转个人消息
- personalnotice(){
- PublicLib.putCookieInfo('noticeType', '个人消息');
- PublicLib.Goto({Url:'notice-list'});
- },
- //- 活动页面
- goactive(){
- PublicLib.Goto({Url:'market-active'});
- },
- //- 获取消息数量
- async getnoticecount(){
- //- PublicLib.ShowLoading({Message:''});
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('/api/v1/msgplacard/notread?t='+Math.random(6),JSON.stringify({UserId}));
- if(res.status === 1){
- //- PublicLib.HideLoading();
- this.unreadnoticenum = res.data;
- };
- }
-
- }
- });
- </script>
- </body>
- </html>
|