my.vue 5.6 KB

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