index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <view class="msg-container">
  3. <view class="msg-header">消息</view>
  4. <view class="msg-list">
  5. <view class="msg-item" v-for="item in msgList" :key="item.title" @click="goTo(item)">
  6. <view class="msg-icon" :style="{background: item.bg}">
  7. <image :src="item.icon" class="icon-img" />
  8. </view>
  9. <view class="msg-info">
  10. <view class="msg-title">{{ item.title }}</view>
  11. <view class="msg-desc">暂无新消息</view>
  12. </view>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. msgList: [
  22. { title: '课程精选', icon: '/static/msg1.png', bg: 'linear-gradient(135deg,#ffbcbc,#ffeded)', path: '/pages/message/selected' },
  23. { title: '课程上新', icon: '/static/msg2.png', bg: 'linear-gradient(135deg,#b6e3ff,#eaf7ff)', path: '' },
  24. { title: '直播预约', icon: '/static/msg3.png', bg: 'linear-gradient(135deg,#d6caff,#f3f0ff)', path: '' },
  25. { title: '圈子消息', icon: '/static/msg4.png', bg: 'linear-gradient(135deg,#b6ffe0,#eafff6)', path: '' },
  26. ]
  27. }
  28. },
  29. methods: {
  30. goTo(item) {
  31. if (item.path) {
  32. uni.navigateTo({ url: item.path })
  33. }
  34. }
  35. }
  36. }
  37. </script>
  38. <style lang="scss">
  39. .msg-container {
  40. min-height: 100vh;
  41. background: #f7f8fa;
  42. padding-bottom: 120rpx;
  43. }
  44. .msg-header {
  45. text-align: center;
  46. font-size: 40rpx;
  47. font-weight: bold;
  48. color: #222;
  49. margin-top: 80rpx;
  50. margin-bottom: 40rpx;
  51. letter-spacing: 2rpx;
  52. }
  53. .msg-list {
  54. margin: 0 0 0 0;
  55. }
  56. .msg-item {
  57. display: flex;
  58. align-items: center;
  59. padding: 32rpx 40rpx 32rpx 40rpx;
  60. background: #fff;
  61. border-radius: 20rpx;
  62. margin: 0 24rpx 32rpx 24rpx;
  63. box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.04);
  64. transition: box-shadow 0.2s;
  65. }
  66. .msg-item:active {
  67. box-shadow: 0 8rpx 24rpx rgba(0,0,0,0.08);
  68. }
  69. .msg-icon {
  70. width: 80rpx;
  71. height: 80rpx;
  72. border-radius: 50%;
  73. display: flex;
  74. align-items: center;
  75. justify-content: center;
  76. margin-right: 32rpx;
  77. }
  78. .icon-img {
  79. width: 48rpx;
  80. height: 48rpx;
  81. }
  82. .msg-info {
  83. display: flex;
  84. flex-direction: column;
  85. }
  86. .msg-title {
  87. font-size: 32rpx;
  88. font-weight: bold;
  89. color: #222;
  90. margin-bottom: 8rpx;
  91. }
  92. .msg-desc {
  93. font-size: 24rpx;
  94. color: #bbb;
  95. }
  96. </style>