message.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <template>
  2. <view class="messBox">
  3. <statusBar :item="navbarData"></statusBar>
  4. <view class="" v-if="isLogin==1">
  5. <view class="mesItem" @click="goToMesDetail">
  6. <view class="leftBox">
  7. <view class="mesImg">
  8. <image src="http://43.139.158.220:5007/img/static/message/notice.svg" mode="aspectFill"></image>
  9. </view>
  10. <view class="mesBrief">
  11. <view class="tit">活动通知</view>
  12. <view class="breif fz-font" style="line-height: 40rpx;">活动报名成功</view>
  13. </view>
  14. </view>
  15. <view class="right">
  16. <view class="">
  17. <view v-if="isAll" class="newMessage"></view>
  18. </view>
  19. <view class="mesTime fz-font">07-12</view>
  20. </view>
  21. </view>
  22. <view class="mesItem" @click="goToMeGXt">
  23. <view class="leftBox">
  24. <view class="mesImg">
  25. <image src="http://43.139.158.220:5007/img/static/message/system.svg" mode=""></image>
  26. </view>
  27. <view class="mesBrief">
  28. <view class="tit ">系统通知</view>
  29. <view class="breif fz-font" style="line-height: 40rpx;">已加入xxxxxx教研室</view>
  30. </view>
  31. </view>
  32. <view class="right">
  33. <view class="">
  34. <view v-if="xt" class="newMessage"></view>
  35. </view>
  36. <view class="mesTime fz-font">07-12</view>
  37. </view>
  38. </view>
  39. <view class="mesItem" @click="goToMegDy">
  40. <view class="leftBox">
  41. <view class="mesImg">
  42. <image src="http://43.139.158.220:5007/img/static/message/subscribe.svg" mode=""></image>
  43. </view>
  44. <view class="mesBrief">
  45. <view class="tit ">订阅消息</view>
  46. <view class="breif fz-font" style="line-height: 40rpx;">xxx教研室更新了课程</view>
  47. </view>
  48. </view>
  49. <view class="right">
  50. <view class="">
  51. <view v-if="dy" class="newMessage"></view>
  52. </view>
  53. <view class="mesTime fz-font">07-12</view>
  54. </view>
  55. </view>
  56. </view>
  57. <view v-else class="noLogin"> <!-- 未登录展示样式 -->
  58. <view class="mid">
  59. <image src="http://43.139.158.220:5007/img/static/yym/Vector.png" mode="aspectFill"></image>
  60. <view class="tit" style="">您暂时还没有消息</view>
  61. <view class="brief fz-font" style="color: rgba(0, 0, 0, 0.4);">快去登录查看消息吧</view>
  62. <view class="btn" @click="gotoLogin">去登录</view>
  63. </view>
  64. </view>
  65. </view>
  66. </template>
  67. <script>
  68. export default {
  69. data() {
  70. return {
  71. navbarData: {
  72. title: '消息'
  73. },
  74. // msgList:[
  75. // {tit:'hd',isClick:0},
  76. // {tit:'hd',isClick:0},
  77. // {tit:'hd',isClick:0},
  78. // ]
  79. isAll: 1,
  80. xt: 1,
  81. dy: 1,
  82. isLogin: 0
  83. };
  84. },
  85. methods: {
  86. goToMesDetail() {
  87. uni.navigateTo({
  88. url: '/pages/hdxx/hdxx'
  89. });
  90. this.isAll = 0
  91. },
  92. goToMeGXt() {
  93. uni.navigateTo({
  94. url: '/pages/messageSystem/messageSystem'
  95. });
  96. this.xt = 0
  97. },
  98. goToMegDy() {
  99. uni.navigateTo({
  100. url: '/pages/messageDy/messageDy'
  101. });
  102. this.dy = 0
  103. },
  104. gotoLogin() {
  105. uni.navigateTo({
  106. url: '/pages/login/login'
  107. });
  108. }
  109. },
  110. onShow() {
  111. this.isLogin = uni.getStorageSync('login');
  112. }
  113. }
  114. </script>
  115. <style lang="scss">
  116. .messBox {
  117. background: #fff;
  118. display: flex;
  119. flex-direction: column;
  120. flex-wrap: nowrap;
  121. // align-items: center;
  122. // 未登录展示样式
  123. .noLogin {
  124. width: 750rpx;
  125. height: 80vh;
  126. background-color: #f0f2f5;
  127. display: flex;
  128. justify-content: center;
  129. align-items: center;
  130. .mid {
  131. display: flex;
  132. flex-direction: column;
  133. align-items: center;
  134. height: 20vh;
  135. justify-content: space-between;
  136. .tit {
  137. margin-top: 30rpx;
  138. font-weight: 400;
  139. color: rgba(0, 0, 0, 0.8);
  140. line-height: 48rpx;
  141. font-size: 34rpx;
  142. }
  143. .brief{
  144. margin-top: 10rpx;
  145. }
  146. image {
  147. width: 175rpx;
  148. height: 148rpx;
  149. }
  150. .btn {
  151. margin-top: 30rpx;
  152. width: 160rpx;
  153. height: 64rpx;
  154. display: flex;
  155. justify-content: center;
  156. align-items: center;
  157. background-color: rgba(0, 86, 168, 1);
  158. border-radius: 100rpx;
  159. color: #ffffff;
  160. }
  161. }
  162. }
  163. .mesItem {
  164. display: flex;
  165. // flex-direction: row;
  166. // flex-wrap: nowrap;
  167. // align-items: flex-end;
  168. justify-content: space-between;
  169. width: 750rpx;
  170. padding: 30rpx 20rpx;
  171. // position: relative;
  172. .leftBox {
  173. display: flex;
  174. justify-content: flex-start;
  175. // flex-direction: row;
  176. // flex-wrap: nowrap;
  177. // align-items: center;
  178. .mesImg {
  179. width: 96rpx;
  180. height: 96rpx;
  181. // padding: 30rpx 5rpx;
  182. margin-right: 25rpx;
  183. image {
  184. width: 100%;
  185. height: 100%;
  186. }
  187. }
  188. .mesBrief {
  189. display: flex;
  190. flex-direction: column;
  191. justify-content: space-between;
  192. .tit {
  193. font-size: 32rpx;
  194. font-weight: 400;
  195. line-height: 48rpx;
  196. color: #333333;
  197. }
  198. .breif {
  199. // font-size: 16px;
  200. color: rgba(51, 51, 51, 1);
  201. }
  202. }
  203. // .mesBrief:nth-child(1){
  204. // // font-size: 36rpx;
  205. // }
  206. // .mesBrief:nth-last-child(1){
  207. // color: #999;
  208. // padding: 10rpx 0 0 0;
  209. // }
  210. }
  211. .right {
  212. display: flex;
  213. flex-direction: column;
  214. justify-content: space-between;
  215. align-items: center;
  216. padding-top: 10px;
  217. .mesTime {
  218. color: #999;
  219. bottom: 30px;
  220. }
  221. .newMessage {
  222. width: 16rpx;
  223. height: 16rpx;
  224. background: red;
  225. border-radius: 10rpx;
  226. }
  227. }
  228. }
  229. }
  230. </style>