my.vue 5.3 KB

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