my.uvue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <template>
  2. <cl-page>
  3. <cl-topbar
  4. fixed
  5. :height="44"
  6. :show-back="false"
  7. safe-area-top
  8. background-color="transparent"
  9. >
  10. <view class="flex flex-row items-center w-full flex-1 px-3">
  11. <view class="top-icon dark:!bg-surface-700" @tap="toSet">
  12. <cl-icon name="settings-line" :size="16"></cl-icon>
  13. </view>
  14. <view class="top-icon dark:!bg-surface-700" @tap="toTest">
  15. <cl-icon name="notification-4-line" :size="16"></cl-icon>
  16. </view>
  17. </view>
  18. </cl-topbar>
  19. <view class="p-3">
  20. <view class="flex flex-col justify-center items-center py-6">
  21. <view class="relative overflow-visible" @tap="toEdit">
  22. <cl-avatar
  23. :src="userInfo?.avatarUrl"
  24. :size="80"
  25. :pt="{ className: '!rounded-3xl', icon: { size: 32 } }"
  26. >
  27. </cl-avatar>
  28. <view
  29. class="flex flex-col justify-center items-center absolute bottom-0 right-[-3px] bg-black rounded-full p-1 border border-solid border-white"
  30. v-if="!user.isNull()"
  31. >
  32. <cl-icon name="edit-line" color="white" :size="10"></cl-icon>
  33. </view>
  34. </view>
  35. <view class="flex-1 flex flex-col justify-center items-center w-full" @tap="toEdit">
  36. <cl-text :size="18" :pt="{ className: 'mt-5 mb-1 font-bold' }">{{
  37. userInfo?.nickName ?? t("未登录")
  38. }}</cl-text>
  39. <cl-text color="info" :size="12" v-if="!user.isNull()">{{
  40. userInfo?.phone
  41. }}</cl-text>
  42. </view>
  43. </view>
  44. <cl-row
  45. :pt="{
  46. className: 'pt-3 pb-6'
  47. }"
  48. >
  49. <cl-col :span="6">
  50. <view class="flex flex-col items-center justify-center">
  51. <cl-rolling-number :size="18" :value="171"></cl-rolling-number>
  52. <cl-text :size="12" :pt="{ className: 'mt-1' }" color="info">{{
  53. t("总点击")
  54. }}</cl-text>
  55. </view>
  56. </cl-col>
  57. <cl-col :span="6">
  58. <view class="flex flex-col items-center justify-center">
  59. <cl-rolling-number :size="18" :value="24"></cl-rolling-number>
  60. <cl-text :size="12" :pt="{ className: 'mt-1' }" color="info">{{
  61. t("赞")
  62. }}</cl-text>
  63. </view>
  64. </cl-col>
  65. <cl-col :span="6">
  66. <view class="flex flex-col items-center justify-center">
  67. <cl-rolling-number :size="18" :value="89"></cl-rolling-number>
  68. <cl-text :size="12" :pt="{ className: 'mt-1' }" color="info">{{
  69. t("收藏")
  70. }}</cl-text>
  71. </view>
  72. </cl-col>
  73. <cl-col :span="6">
  74. <view class="flex flex-col items-center justify-center">
  75. <cl-rolling-number :size="18" :value="653"></cl-rolling-number>
  76. <cl-text :size="12" :pt="{ className: 'mt-1' }" color="info">{{
  77. t("粉丝")
  78. }}</cl-text>
  79. </view>
  80. </cl-col>
  81. </cl-row>
  82. <cl-row :gutter="20" :pt="{ className: 'mb-3' }">
  83. <cl-col :span="12">
  84. <view class="bg-white dark:!bg-surface-800 p-4 rounded-2xl flex flex-row">
  85. <view class="flex flex-col mr-auto">
  86. <cl-text
  87. ellipsis
  88. :pt="{
  89. className: '!w-[90px]'
  90. }"
  91. >{{ t("接单模式") }}</cl-text
  92. >
  93. <cl-text :size="12" :pt="{ className: 'mt-1' }" color="info">{{
  94. t("已关闭")
  95. }}</cl-text>
  96. </view>
  97. <cl-switch></cl-switch>
  98. </view>
  99. </cl-col>
  100. <cl-col :span="12">
  101. <view class="bg-white dark:!bg-surface-800 p-4 rounded-2xl flex flex-row">
  102. <view class="flex flex-col mr-auto">
  103. <cl-text
  104. ellipsis
  105. :pt="{
  106. className: '!w-[90px]'
  107. }"
  108. >{{ t("消息通知") }}</cl-text
  109. >
  110. <cl-text :size="12" :pt="{ className: 'mt-1' }" color="info">{{
  111. t("已关闭")
  112. }}</cl-text>
  113. </view>
  114. <cl-switch></cl-switch>
  115. </view>
  116. </cl-col>
  117. </cl-row>
  118. <view class="bg-white dark:!bg-surface-800 py-5 rounded-2xl mb-3 h-[80px]">
  119. <cl-row :pt="{ className: 'overflow-visible' }">
  120. <cl-col :span="6">
  121. <view class="flex flex-col justify-center items-center px-2">
  122. <cl-icon name="money-cny-circle-line" :size="24"></cl-icon>
  123. <cl-text
  124. :size="12"
  125. :pt="{ className: 'mt-2 text-center' }"
  126. color="info"
  127. >{{ t("待支付") }}</cl-text
  128. >
  129. </view>
  130. </cl-col>
  131. <cl-col :span="6">
  132. <view class="flex flex-col justify-center items-center px-2">
  133. <cl-icon name="box-1-line" :size="24"></cl-icon>
  134. <cl-text
  135. :size="12"
  136. :pt="{ className: 'mt-2 text-center' }"
  137. color="info"
  138. >{{ t("未发货") }}</cl-text
  139. >
  140. </view>
  141. </cl-col>
  142. <cl-col :span="6">
  143. <view
  144. class="flex flex-col justify-center items-center relative overflow-visible px-2"
  145. >
  146. <cl-icon name="flight-takeoff-line" :size="24"></cl-icon>
  147. <cl-text
  148. :size="12"
  149. :pt="{ className: 'mt-2 text-center' }"
  150. color="info"
  151. >{{ t("已发货") }}</cl-text
  152. >
  153. <cl-badge
  154. type="primary"
  155. :value="3"
  156. position
  157. :pt="{ className: '!right-6' }"
  158. ></cl-badge>
  159. </view>
  160. </cl-col>
  161. <cl-col :span="6">
  162. <view class="flex flex-col justify-center items-center px-2">
  163. <cl-icon name="exchange-cny-line" :size="24"></cl-icon>
  164. <cl-text
  165. :size="12"
  166. :pt="{ className: 'mt-2 text-center' }"
  167. color="info"
  168. >{{ t("售后 / 退款") }}</cl-text
  169. >
  170. </view>
  171. </cl-col>
  172. </cl-row>
  173. </view>
  174. <cl-list :pt="{ className: 'mb-3' }">
  175. <cl-list-item
  176. :label="t('我的钱包')"
  177. icon="wallet-line"
  178. arrow
  179. hoverable
  180. @tap="toTest"
  181. >
  182. </cl-list-item>
  183. <cl-list-item
  184. :label="t('数据看板')"
  185. icon="pie-chart-line"
  186. arrow
  187. hoverable
  188. @tap="toTest"
  189. >
  190. </cl-list-item>
  191. <cl-list-item
  192. :label="t('历史记录')"
  193. icon="history-line"
  194. arrow
  195. hoverable
  196. @tap="toTest"
  197. >
  198. </cl-list-item>
  199. <cl-list-item
  200. :label="t('邀请好友')"
  201. icon="share-line"
  202. arrow
  203. hoverable
  204. @tap="toTest"
  205. >
  206. </cl-list-item>
  207. </cl-list>
  208. <cl-list>
  209. <cl-list-item :label="t('设置')" icon="settings-line" arrow hoverable @tap="toSet">
  210. </cl-list-item>
  211. </cl-list>
  212. </view>
  213. <!-- 自定义底部导航栏 -->
  214. <custom-tabbar></custom-tabbar>
  215. </cl-page>
  216. </template>
  217. <script setup lang="ts">
  218. import { router, userInfo, useStore, t } from "@/.cool";
  219. import { useUi } from "@/uni_modules/cool-ui";
  220. import CustomTabbar from "./components/tabbar.uvue";
  221. const { user } = useStore();
  222. const ui = useUi();
  223. function toTest() {
  224. ui.showToast({
  225. message: t("开发中,敬请期待")
  226. });
  227. }
  228. function toSet() {
  229. router.to("/pages/set/index");
  230. }
  231. function toEdit() {
  232. router.to("/pages/user/edit");
  233. }
  234. onReady(() => {
  235. user.get();
  236. });
  237. </script>
  238. <style lang="scss" scoped>
  239. .top-icon {
  240. @apply flex items-center justify-center rounded-lg bg-white mr-3 p-2;
  241. }
  242. </style>