index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <CustomNav title="后台管理" leftType="home" />
  3. <view class="page-container">
  4. <view class="content">
  5. <view class="function-container">
  6. <view class="function-row">
  7. <view class="function-item blue" @click="onItemClick('资讯管理')">
  8. <view class="item-content">
  9. <view class="title-row">
  10. <view class="item-line"></view>
  11. <text class="item-title">资讯管理</text>
  12. </view>
  13. <text class="item-desc">管理病人看到的资讯</text>
  14. </view>
  15. </view>
  16. <view class="function-item orange" @click="onItemClick('快捷问题管理')">
  17. <view class="item-content">
  18. <view class="title-row">
  19. <view class="item-line"></view>
  20. <text class="item-title">快捷问题管理</text>
  21. </view>
  22. <text class="item-desc">管理快捷问题</text>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="function-row">
  27. <view class="function-item green" @click="onItemClick('药品信息管理')">
  28. <view class="item-content">
  29. <view class="title-row">
  30. <view class="item-line"></view>
  31. <text class="item-title">药品信息管理</text>
  32. </view>
  33. <text class="item-desc">管理药品信息</text>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. <TabBar />
  41. </template>
  42. <script setup lang="ts">
  43. import { onShow } from '@dcloudio/uni-app'
  44. import CustomNav from '@/components/custom-nav.vue'
  45. import TabBar from '@/components/tab-bar.vue'
  46. // 如果在微信小程序端且未登录,自动跳转到登录页
  47. onShow(() => {
  48. const token = uni.getStorageSync('token')
  49. if (!token) {
  50. uni.reLaunch({ url: '/pages/public/login/index' })
  51. }
  52. })
  53. function onItemClick(type: string) {
  54. uni.showToast({ title: `${type} 功能正在开发中`, icon: 'none' })
  55. }
  56. </script>
  57. <style>
  58. .page-container {
  59. min-height: 100vh;
  60. padding-top: calc(var(--status-bar-height) + 44px);
  61. padding-bottom: 100rpx;
  62. box-sizing: border-box;
  63. justify-content: center;
  64. align-items: center;
  65. background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  66. }
  67. .content {
  68. width: 100%;
  69. }
  70. .function-container {
  71. padding-inline: 20rpx;
  72. margin-top: 40rpx;
  73. }
  74. .function-row {
  75. display: flex;
  76. justify-content: space-between;
  77. margin-bottom: 20rpx;
  78. }
  79. .function-row:last-child {
  80. margin-bottom: 0;
  81. }
  82. .function-item {
  83. flex: 1;
  84. height: 160rpx;
  85. background-color: #fff;
  86. border-radius: 20rpx;
  87. margin: 0 10rpx;
  88. position: relative;
  89. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
  90. overflow: hidden;
  91. }
  92. .item-content {
  93. position: absolute;
  94. top: 20rpx;
  95. left: 20rpx;
  96. display: flex;
  97. flex-direction: column;
  98. }
  99. .title-row {
  100. display: flex;
  101. align-items: center;
  102. margin-bottom: 10rpx;
  103. }
  104. .item-line {
  105. width: 8rpx;
  106. height: 48rpx;
  107. margin-right: 15rpx;
  108. border-radius: 10rpx;
  109. }
  110. .blue .item-line {
  111. background-color: #3742fa;
  112. }
  113. .orange .item-line {
  114. background-color: #ffa502;
  115. }
  116. .green .item-line {
  117. background-color: #2ed573;
  118. }
  119. .item-title {
  120. font-size: 36rpx;
  121. font-weight: bold;
  122. color: #333;
  123. }
  124. .item-desc {
  125. font-size: 28rpx;
  126. color: #666;
  127. }
  128. </style>