my.uvue 6.8 KB

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