notice-center1.html 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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 pt0" style="padding-top:0;">
  18. <div id="app">
  19. <van-nav-bar class="mall_title bottom_line" title="消息中心" v-if="tabsisshow"></van-nav-bar>
  20. <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
  21. <div style="height:80vh;">
  22. <van-cell-group class="notice-center">
  23. <van-cell class="cm" is-link @click="systemnotice">
  24. <template #title><img class="notice-center-img vm" src="./static/images/notice-btn1@2x.png" alt=""><span class="f14 c333 pl6">系统消息</span></template>
  25. <template #right-icon>
  26. <van-tag class="cm" type="warning" round v-if="unreadnoticenum.PlacardCount &gt; 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><img class="notice-center-img vm" src="./static/images/notice-btn2@2x.png" alt=""><span class="f14 c333 pl6">个人消息</span></template>
  32. <template #right-icon>
  33. <van-tag class="cm" type="warning" round v-if="unreadnoticenum.PersonalCount &gt; 0">{{unreadnoticenum.PersonalCount}}</van-tag>
  34. <van-icon name="arrow"></van-icon>
  35. </template>
  36. </van-cell>
  37. </van-cell-group>
  38. </div>
  39. </van-pull-refresh>
  40. <van-tabbar v-model="active" active-color="#333" inactive-color="#999" 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="mall">商城
  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/appfunc.min.js"></script>
  57. <script src="./static/js/klm-axios-config.js"></script>
  58. <script src="./static/js/publicfn.js"></script>
  59. <script>
  60. function OnStart(){
  61. app.getnoticecount();
  62. };
  63. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  64. // 可以通过下面的方式手动注册
  65. Vue.use(vant.Lazyload);
  66. PublicLib.SetStatusBarBgColor({bgcolor:'ffffff'});
  67. // 在 #app 标签下渲染一个按钮组件
  68. let app = new Vue({
  69. el: '#app',
  70. data() {
  71. return {
  72. active: 2,
  73. unreadnoticenum:{
  74. PersonalCount:0,
  75. PlacardCount:0,
  76. },
  77. icon1: {
  78. active: './static/images/tab-icon1-active.png',
  79. inactive: './static/images/tab-icon1-no.png',
  80. },
  81. icon2: {
  82. active: './static/images/tab-icon2-active.png',
  83. inactive: './static/images/tab-icon2-no.png',
  84. },
  85. icon3: {
  86. active: './static/images/tab-icon3-active.png',
  87. inactive: './static/images/tab-icon3-no.png',
  88. },
  89. icon4: {
  90. active: './static/images/tab-icon4-active.png',
  91. inactive: './static/images/tab-icon4-no.png',
  92. },
  93. tabsisshow:false,
  94. isLoading:false,
  95. };
  96. },
  97. created() {
  98. this.tabsisshow = bottomtabisshow;
  99. //- this.getnoticecount();
  100. },
  101. computed:{
  102. isnotice:function(){
  103. if(this.unreadnoticenum.PersonalCount !== 0 || this.unreadnoticenum.PlacardCount !== 0){
  104. PublicLib.putCookieInfo('noticeiscount', true);
  105. } else {
  106. PublicLib.putCookieInfo('noticeiscount', "");
  107. };
  108. return PublicLib.getCookieInfo('noticeiscount') !== "";
  109. }
  110. },
  111. methods: {
  112. async onRefresh(){
  113. //- await this.getnoticecount();
  114. this.isLoading = false;
  115. },
  116. //- 跳转商城
  117. mall(){
  118. PublicLib.Goto({Url:'mall'});
  119. },
  120. //- 跳转主页
  121. index(){
  122. PublicLib.Goto({Url:'index'});
  123. },
  124. //- 跳转我的
  125. user(){
  126. PublicLib.Goto({Url:'user-center'});
  127. },
  128. //- 跳转系统消息
  129. systemnotice(){
  130. PublicLib.putCookieInfo('noticeType', '系统消息');
  131. PublicLib.Goto({Url:'notice-list1'});
  132. },
  133. //- 跳转个人消息
  134. personalnotice(){
  135. PublicLib.putCookieInfo('noticeType', '个人消息');
  136. PublicLib.Goto({Url:'notice-list1'});
  137. },
  138. //- 活动页面
  139. goactive(){
  140. PublicLib.Goto({Url:'market-active'});
  141. },
  142. //- 获取消息数量
  143. async getnoticecount(){
  144. PublicLib.ShowLoading({Message:''});
  145. const UserId = PublicLib.getCookieInfo('userId');
  146. const res = await getRequest('api/v1/msgplacard/notread',JSON.stringify({UserId}));
  147. if(res.status === '1'){
  148. PublicLib.HideLoading();
  149. this.unreadnoticenum = res.data;
  150. };
  151. }
  152. }
  153. });
  154. </script>
  155. </body>
  156. </html>