notice-center.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>消息中心-创业帮</title>
  6. <meta name="keywords" content="消息中心-创业帮">
  7. <meta name="description" content="消息中心-创业帮">
  8. <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  11. <meta content="telephone=no" name="format-detection">
  12. <meta content="email=no" name="format-detection">
  13. <meta name="apple-mobile-web-app-title" content="消息中心-创业帮">
  14. <meta http-equiv="Cache-Control" content="no-siteapp">
  15. <link rel="stylesheet" href="./static/css/main.css">
  16. </head>
  17. <body class="bgcf7f7f7 ovh" style="padding-top:0;">
  18. <div id="app">
  19. <van-nav-bar class="mall_title bottom_line" title="消息中心" v-if="toptitleisshow"></van-nav-bar>
  20. <van-pull-refresh class="noticexy" v-model="isLoading" @refresh="onRefresh">
  21. <van-cell class="cm" is-link @click="systemnotice">
  22. <template #title>
  23. <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>
  24. </template>
  25. <template #right-icon>
  26. <van-tag class="cm" type="warning" round v-if="unreadnoticenum.PlacardCount !== 0">{{unreadnoticenum.PlacardCount}}</van-tag>
  27. <van-icon name="arrow"></van-icon>
  28. </template>
  29. </van-cell>
  30. <van-cell class="cm" is-link @click="personalnotice">
  31. <template #title>
  32. <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>
  33. </template>
  34. <template #right-icon>
  35. <van-tag class="cm" type="warning" round v-if="unreadnoticenum.PersonalCount !== 0">{{unreadnoticenum.PersonalCount}}</van-tag>
  36. <van-icon name="arrow"></van-icon>
  37. </template>
  38. </van-cell>
  39. </van-pull-refresh>
  40. <van-tabbar v-model="active" active-color="#FF502A" v-cloak v-if="tabsisshow">
  41. <van-tabbar-item icon="home-o" @click="index">工作台
  42. <template #icon="props"><img :src="props.active ? icon1.active : icon1.inactive"></template>
  43. </van-tabbar-item>
  44. <van-tabbar-item icon="search" @click="management">经营数据
  45. <template #icon="props"><img :src="props.active ? icon2.active : icon2.inactive"></template>
  46. </van-tabbar-item>
  47. <van-tabbar-item icon="friends-o" :dot="isnotice">消息
  48. <template #icon="props"><img :src="props.active ? icon3.active : icon3.inactive"></template>
  49. </van-tabbar-item>
  50. <van-tabbar-item icon="setting-o" @click="user">我的
  51. <template #icon="props"><img :src="props.active ? icon4.active : icon4.inactive"></template>
  52. </van-tabbar-item>
  53. </van-tabbar>
  54. </div>
  55. <script src="./static/js/klm-vv.min.js"></script>
  56. <script src="./static/js/klm-axios-config.js"></script>
  57. <script>
  58. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  59. // 可以通过下面的方式手动注册
  60. Vue.use(vant.Lazyload);
  61. // 在 #app 标签下渲染一个按钮组件
  62. let app = new Vue({
  63. el: '#app',
  64. data() {
  65. return {
  66. active: 2,
  67. toptitleisshow:false,
  68. unreadnoticenum:{
  69. PersonalCount:0,
  70. PlacardCount:0,
  71. },
  72. icon1: {
  73. active: './static/images/tab-icon1-active.png',
  74. inactive: './static/images/tab-icon1-no.png',
  75. },
  76. icon2: {
  77. active: './static/images/tab-icon2-active.png',
  78. inactive: './static/images/tab-icon2-no.png',
  79. },
  80. icon3: {
  81. active: './static/images/tab-icon3-active.png',
  82. inactive: './static/images/tab-icon3-no.png',
  83. },
  84. icon4: {
  85. active: './static/images/tab-icon4-active.png',
  86. inactive: './static/images/tab-icon4-no.png',
  87. },
  88. tabsisshow:false,
  89. isLoading:false,
  90. };
  91. },
  92. created() {
  93. this.tabsisshow = bottomtabisshow;
  94. this.getnoticecount();
  95. },
  96. computed:{
  97. isnotice:function(){
  98. if(this.unreadnoticenum.PersonalCount !== 0 || this.unreadnoticenum.PlacardCount !== 0){
  99. PublicLib.putCookieInfo('noticeiscount', true);
  100. } else {
  101. PublicLib.putCookieInfo('noticeiscount', "");
  102. };
  103. return PublicLib.getCookieInfo('noticeiscount') !== "";
  104. }
  105. },
  106. methods: {
  107. async onRefresh(){
  108. await this.getnoticecount();
  109. this.isLoading = false;
  110. },
  111. //- 跳转商城
  112. management(){
  113. PublicLib.Goto({Url:'management'});
  114. },
  115. //- 跳转主页
  116. index(){
  117. PublicLib.Goto({Url:'index'});
  118. },
  119. //- 跳转我的
  120. user(){
  121. PublicLib.Goto({Url:'user-center'});
  122. },
  123. //- 跳转系统消息
  124. systemnotice(){
  125. PublicLib.putCookieInfo('noticeType', '系统消息');
  126. PublicLib.Goto({Url:'notice-list'});
  127. },
  128. //- 跳转个人消息
  129. personalnotice(){
  130. PublicLib.putCookieInfo('noticeType', '个人消息');
  131. PublicLib.Goto({Url:'notice-list'});
  132. },
  133. //- 活动页面
  134. goactive(){
  135. PublicLib.Goto({Url:'market-active'});
  136. },
  137. //- 获取消息数量
  138. async getnoticecount(){
  139. //- PublicLib.ShowLoading({Message:''});
  140. const UserId = PublicLib.getCookieInfo('userId');
  141. const res = await getRequest('/api/v1/msgplacard/notread?t='+Math.random(6),JSON.stringify({UserId}));
  142. if(res.status === 1){
  143. //- PublicLib.HideLoading();
  144. this.unreadnoticenum = res.data;
  145. };
  146. }
  147. }
  148. });
  149. </script>
  150. </body>
  151. </html>