index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <template>
  2. <view class="my-page">
  3. <!-- 顶部背景墙 -->
  4. <view class="header-curve">
  5. <view class="user-block" @click="goToLogin">
  6. <image class="user-avatar" src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg"
  7. mode="aspectFill"></image>
  8. <view class="user-info">
  9. <text class="user-name">点击登录</text>
  10. <text class="user-desc-text">登录后享受更多权益 🐾</text>
  11. </view>
  12. <uni-icons type="right" size="16" color="rgba(100, 70, 20, 0.4)"></uni-icons>
  13. </view>
  14. <view class="wave-shape"></view>
  15. </view>
  16. <!-- 我的服务订单区 -->
  17. <view class="cute-card order-wrap">
  18. <view class="card-head">
  19. <text class="card-title">我的服务订单</text>
  20. <view class="card-more" @click="goToOrder('all')">
  21. <text>查看全部</text>
  22. <uni-icons type="right" size="12" color="#a39686"></uni-icons>
  23. </view>
  24. </view>
  25. <view class="order-nav">
  26. <view class="nav-item" v-for="item in orderItems" :key="item.key" @click="goToOrder(item.key)">
  27. <view class="icon-bulb">
  28. <image class="custom-icon" :src="item.icon" mode="aspectFit"></image>
  29. </view>
  30. <text class="nav-label">{{ item.label }}</text>
  31. </view>
  32. </view>
  33. </view>
  34. <!-- 主功能网格 -->
  35. <view class="menu-grid">
  36. <view class="menu-box" v-for="item in menuItems" :key="item.path" @click="goToMenu(item)">
  37. <view class="menu-icon-wrap">
  38. <image class="custom-icon" :src="item.icon" mode="aspectFit"></image>
  39. </view>
  40. <text class="menu-text">{{ item.title }}</text>
  41. </view>
  42. </view>
  43. <view class="footer-msg">
  44. <text>~ 感谢您的陪伴 ~</text>
  45. </view>
  46. <custom-tabbar></custom-tabbar>
  47. </view>
  48. </template>
  49. <script setup>
  50. import { ref } from 'vue'
  51. import customTabbar from '@/components/custom-tabbar/index.vue'
  52. const goToLogin = () => {
  53. uni.navigateTo({ url: '/pages/login/index' })
  54. }
  55. const goToOrder = (status) => {
  56. uni.reLaunch({ url: `/pages/order/list/index?status=${status}` })
  57. }
  58. const goToMenu = (item) => {
  59. if (item.path) {
  60. uni.navigateTo({ url: item.path })
  61. }
  62. }
  63. // 订单图标
  64. const orderItems = [
  65. { key: 'wait_dispatch', label: '待派单', icon: '/static/icon/order-wait.svg' },
  66. { key: 'wait_accept', label: '待接单', icon: '/static/icon/order-accept.svg' },
  67. { key: 'serving', label: '服务中', icon: '/static/icon/order-service.svg' },
  68. { key: 'done', label: '已完成', icon: '/static/icon/order-done.svg' },
  69. { key: 'cancel', label: '已取消', icon: '/static/icon/order-cancel.svg' }
  70. ]
  71. // 功能菜单
  72. const menuItems = [
  73. { title: '宠物档案', icon: '/static/icon/pet-archive.svg', path: '/pages/my/pet/list/index' },
  74. { title: '用户管理', icon: '/static/icon/user-manage.svg', path: '/pages/my/user/list/index' },
  75. { title: '我的评价', icon: '/static/icon/review.svg', path: '/pages/my/review/list/index' },
  76. { title: '客服中心', icon: '/static/icon/service-center.svg', path: '' },
  77. { title: '协议中心', icon: '/static/icon/agreement.svg', path: '/pages/my/agreement/list/index' },
  78. { title: '系统设置', icon: '/static/icon/settings.svg', path: '/pages/my/settings/index' }
  79. ]
  80. </script>
  81. <style lang="scss" scoped>
  82. .my-page {
  83. min-height: 100vh;
  84. background-color: #fcfaf5;
  85. padding-bottom: 140rpx;
  86. }
  87. .header-curve {
  88. position: relative;
  89. background: #f7ca3e;
  90. padding: 120rpx 40rpx 160rpx;
  91. overflow: hidden;
  92. }
  93. .user-block {
  94. display: flex;
  95. align-items: center;
  96. position: relative;
  97. z-index: 2;
  98. }
  99. .user-avatar {
  100. width: 140rpx;
  101. height: 140rpx;
  102. border: 8rpx solid #fff;
  103. border-radius: 50%;
  104. background-color: #fff;
  105. }
  106. .user-info {
  107. flex: 1;
  108. margin-left: 32rpx;
  109. }
  110. .user-name {
  111. display: block;
  112. font-size: 40rpx;
  113. font-weight: 800;
  114. color: #5c4314;
  115. margin-bottom: 12rpx;
  116. letter-spacing: 2rpx;
  117. }
  118. .user-desc-text {
  119. display: block;
  120. font-size: 24rpx;
  121. color: #5c4314;
  122. opacity: 0.85;
  123. font-weight: 600;
  124. }
  125. .wave-shape {
  126. position: absolute;
  127. bottom: -80rpx;
  128. left: 0;
  129. width: 100%;
  130. height: 160rpx;
  131. background: #fcfaf5;
  132. border-radius: 50%;
  133. transform: scaleX(1.5);
  134. }
  135. .cute-card {
  136. background: #fff;
  137. border-radius: 40rpx;
  138. padding: 40rpx;
  139. margin: 0 32rpx;
  140. box-shadow: 0 12rpx 40rpx rgba(220, 212, 196, 0.4);
  141. position: relative;
  142. z-index: 3;
  143. }
  144. .order-wrap {
  145. margin-top: -60rpx;
  146. border: 4rpx solid #fffdfa;
  147. }
  148. .card-head {
  149. display: flex;
  150. justify-content: space-between;
  151. align-items: center;
  152. margin-bottom: 32rpx;
  153. }
  154. .card-title {
  155. font-size: 30rpx;
  156. font-weight: 800;
  157. color: #4a3e2e;
  158. }
  159. .card-more {
  160. display: flex;
  161. align-items: center;
  162. gap: 4rpx;
  163. font-size: 24rpx;
  164. color: #a39686;
  165. font-weight: 600;
  166. }
  167. .order-nav {
  168. display: flex;
  169. justify-content: space-between;
  170. }
  171. .nav-item {
  172. display: flex;
  173. flex-direction: column;
  174. align-items: center;
  175. gap: 16rpx;
  176. }
  177. .icon-bulb {
  178. width: 92rpx;
  179. height: 92rpx;
  180. background: #fef6df;
  181. border-radius: 32rpx;
  182. display: flex;
  183. align-items: center;
  184. justify-content: center;
  185. }
  186. .menu-grid {
  187. display: grid;
  188. grid-template-columns: repeat(4, 1fr);
  189. gap: 24rpx;
  190. padding: 0 32rpx;
  191. margin-top: 40rpx;
  192. }
  193. .menu-box {
  194. background: #fff;
  195. border-radius: 36rpx;
  196. padding: 36rpx 12rpx;
  197. display: flex;
  198. flex-direction: column;
  199. align-items: center;
  200. justify-content: center;
  201. gap: 24rpx;
  202. box-shadow: 0 8rpx 24rpx rgba(220, 212, 196, 0.3);
  203. }
  204. .menu-icon-wrap {
  205. width: 80rpx;
  206. height: 80rpx;
  207. border-radius: 50%;
  208. background: #fef6df;
  209. display: flex;
  210. align-items: center;
  211. justify-content: center;
  212. }
  213. .custom-icon {
  214. width: 44rpx;
  215. height: 44rpx;
  216. }
  217. .nav-label, .menu-text {
  218. font-size: 22rpx;
  219. font-weight: 700;
  220. color: #6d5b45;
  221. text-align: center;
  222. }
  223. .nav-label {
  224. font-weight: 600;
  225. }
  226. .footer-msg {
  227. text-align: center;
  228. margin-top: 60rpx;
  229. margin-bottom: 40rpx;
  230. font-size: 24rpx;
  231. font-weight: 600;
  232. color: #d1c5b4;
  233. letter-spacing: 4rpx;
  234. }
  235. </style>