index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <script setup lang="ts">
  2. import { StaticUrl } from '@/config'
  3. import router from '@/router'
  4. definePage({
  5. name: 'smqjh-my',
  6. layout: 'tabbar',
  7. islogin: false,
  8. style: {
  9. navigationBarTitleText: '个人中心',
  10. navigationStyle: 'custom',
  11. },
  12. })
  13. const tabList = ref([
  14. { title: '待支付', icon: `${StaticUrl}/1.png`, name: 'smqjh-order' },
  15. { title: '待收货', icon: `${StaticUrl}/2.png`, name: 'smqjh-order' },
  16. { title: '已完成', icon: `${StaticUrl}/6.png`, name: 'smqjh-order' },
  17. { title: '退款售后', icon: `${StaticUrl}/3.png`, name: 'common-afterSalesList' },
  18. ])
  19. onMounted(() => {
  20. useUserStore().getUserInfo()
  21. })
  22. const { token, userInfo, getUserAvatar } = storeToRefs(useUserStore())
  23. </script>
  24. <template>
  25. <view class="page-class bg-#F9F9F9 dark:bg-[var(--wot-dark-background)]">
  26. <wd-navbar
  27. title="个人中心" custom-style="background-color: transparent !important;" :bordered="false"
  28. safe-area-inset-top fixed :z-index="99"
  29. />
  30. <view class="header relative h-408rpx rounded-18px">
  31. <view class="absolute bottom-100rpx left-0 box-border w-full flex items-center justify-between pl48rpx pr58rpx">
  32. <template v-if="!token">
  33. <image :src="`${StaticUrl}/9.png`" alt="" class="h100rpx w100rpx" />
  34. <view class="text-32rpx font-semibold">
  35. 请登录后使用完整功能
  36. </view>
  37. <wd-button custom-class="login-btn" @click="router.replace({ name: 'smqjh-login' })">
  38. 登录
  39. </wd-button>
  40. </template>
  41. <template v-else>
  42. <view class="flex items-center">
  43. <image :src="getUserAvatar" alt="" class="h100rpx w100rpx flex-shrink-0 rounded-full" />
  44. <view class="ml20rpx flex-1">
  45. <view class="text-32rpx font-semibold">
  46. {{ userInfo.nickName }}
  47. </view>
  48. <view class="mt12rpx rounded-8rpx bg-white px12rpx py4rpx text-24rpx text-[var(--them-color)] opacity-70">
  49. 中数未来(广州)信息技术有限公司
  50. </view>
  51. </view>
  52. </view>
  53. <view class="flex flex-col items-center" @click="router.push({ name: 'common-user-center' })">
  54. <image
  55. :src="`${StaticUrl}/user-setting.png`"
  56. class="h48rpx w48rpx"
  57. />
  58. <view class="mt12rpx text-24rpx text-[var(--them-color)]">
  59. 账户设置
  60. </view>
  61. </view>
  62. </template>
  63. </view>
  64. </view>
  65. <view class="relative z-50 -mt48rpx">
  66. <wd-card>
  67. <template #title>
  68. <view class="flex items-center justify-between">
  69. <view class="text-32rpx font-semibold">
  70. 订单列表
  71. </view>
  72. <view class="flex items-center">
  73. <view class="text-28rpx">
  74. 查看全部
  75. </view>
  76. <wd-icon name="arrow-right" size="18px" />
  77. </view>
  78. </view>
  79. </template>
  80. <view class="grid grid-cols-4 gap-4">
  81. <view v-for="item in tabList" :key="item.title" class="flex flex-col items-center justify-center" @click="router.push({ name: item.name })">
  82. <image :src="item.icon" class="h56rpx w56rpx" />
  83. <view class="mt20rpx text-24rpx">
  84. {{ item.title }}
  85. </view>
  86. </view>
  87. </view>
  88. <view class="h20rpx" />
  89. </wd-card>
  90. </view>
  91. <view class="item-cell mt20rpx">
  92. <wd-card custom-class="card">
  93. <wd-cell-group custom-class="cell-group">
  94. <wd-cell title="收货地址" custom-title-class="cell-title" clickable is-link @click="router.push({ name: 'common-addressList' })">
  95. <template #icon>
  96. <image :src="`${StaticUrl}/4.png`" class="h50rpx w50rpx" />
  97. </template>
  98. </wd-cell>
  99. <wd-cell title="联系平台客服" custom-title-class="cell-title" clickable is-link>
  100. <template #icon>
  101. <image :src="`${StaticUrl}/5.png`" class="h50rpx w50rpx" />
  102. </template>
  103. </wd-cell>
  104. </wd-cell-group>
  105. </wd-card>
  106. </view>
  107. <view class="item-cell mt20rpx">
  108. <wd-card custom-class="card">
  109. <wd-cell-group custom-class="cell-group">
  110. <wd-cell title="积分" custom-title-class="cell-title" clickable is-link @click="router.push({ name: 'common-integral' })">
  111. <template #icon>
  112. <image :src="`${StaticUrl}/7.png`" class="h50rpx w50rpx" />
  113. </template>
  114. </wd-cell>
  115. <wd-cell title="评价" custom-title-class="cell-title" clickable is-link>
  116. <template #icon>
  117. <image :src="`${StaticUrl}/8.png`" class="h50rpx w50rpx" />
  118. </template>
  119. </wd-cell>
  120. </wd-cell-group>
  121. </wd-card>
  122. </view>
  123. </view>
  124. </template>
  125. <style lang="scss" scoped>
  126. .header {
  127. background: linear-gradient( 113deg, #F7FFDC 0%, #E0FF8E 25%, #F2FFCE 51%, #E3FF98 83%, #F6FFD6 100%);
  128. }
  129. .page-class {
  130. :deep() {
  131. .login-btn {
  132. min-width: 0 !important;
  133. width: 180rpx;
  134. }
  135. .cell-title {
  136. padding-left: 20rpx;
  137. }
  138. }
  139. }
  140. .item-cell {
  141. :deep() {
  142. .card {
  143. padding: 0 !important;
  144. }
  145. .cell-group{
  146. overflow: hidden;
  147. border-radius: 12rpx;
  148. }
  149. }
  150. }
  151. </style>