my.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. <template>
  2. <view class="tab_page" :style="{'height':h+'px', 'padding-top':mt+'px'}">
  3. <up-navbar title=" " bgColor="transparent">
  4. <template #left></template>
  5. </up-navbar>
  6. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/17/9043fbbe-2e5d-4adb-ba36-039d33a9b694.png" class="top_bg_img" mode="widthFix"></image>
  7. <view class="info">
  8. <view class="info-top adfacjb">
  9. <view class="info-top-left adfac">
  10. <image class="avatar" :src="userInfo?.avatarPath||'https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/17/6db27a79-235b-4595-87f2-89ff09fc66a5.png'"></image>
  11. <view class="text" @click="showLogin">
  12. <view class="text-top">{{userInfo?userInfo?.realName:'未登录'}}</view>
  13. <view class="text-bottom lv" v-if="userInfo">Lv&nbsp;&nbsp;&nbsp;{{userInfo?.userLevel||1}}&nbsp;&nbsp;></view>
  14. <view class="text-bottom" v-else>去登录注册&nbsp;>></view>
  15. </view>
  16. </view>
  17. <view class="info-top-right" @click="handleTurnPage('/pagesMy/information')">
  18. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/17/d0319d8d-1445-47d6-94fa-cb934e022ab8.png"></image>
  19. </view>
  20. </view>
  21. <view class="info-tip">
  22. <view class="info-tip-pre adfacjb">
  23. <view class="left">家庭公益名称:{{userInfo?userInfo.welfareName:'暂无'}}</view>
  24. <view class="right">
  25. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/17/79079542-4711-44e8-9246-9cd1b8ea4e39.png"></image>
  26. </view>
  27. </view>
  28. <view class="info-tip-pre adfacjb">
  29. <view class="left">家庭公益口号:{{userInfo?userInfo.welfareSlogan:'暂无'}}</view>
  30. <view class="right">
  31. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/17/79079542-4711-44e8-9246-9cd1b8ea4e39.png"></image>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="box" style="margin-top: 40rpx;">
  37. <view class="box-title">公益记录</view>
  38. <view class="box-card adfacjb">
  39. <view class="box-card-pre adffcac red" @click="handleTurnPage('/pagesMy/heartNumber')">
  40. <image class="top" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/18/4e6e3db8-127f-433d-9644-66f1451a6d72.png"></image>
  41. <view class="num">{{(heartNum||0).toFixed(2)}}</view>
  42. <view class="text adf">
  43. <text>我的爱心值</text>
  44. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/18/35df3e58-7b8c-4d3c-8f09-41f252cb3805.png"></image>
  45. </view>
  46. </view>
  47. <view class="box-card-pre adffcac purple" @click="handleTurnPage('/pagesMy/archives')">
  48. <image class="top" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/18/dc26c6af-2617-47b7-ab38-9ccbf2016c5c.png"></image>
  49. <view class="num">{{(fileNum||0).toFixed(2)}}</view>
  50. <view class="text adf">
  51. <text>我的档案</text>
  52. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/18/51adb43e-acdd-475e-9e3d-64cbeedd4fe4.png"></image>
  53. </view>
  54. </view>
  55. <view class="box-card-pre adffcac orange" @click="handleTurnPage('/pagesMy/volunteerHours')">
  56. <image class="top" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/18/c5048d96-826e-4bbf-a133-dd2115162746.png"></image>
  57. <view class="num">{{(hourNum||0).toFixed(2)}}</view>
  58. <view class="text adf">
  59. <text>义工时长(h)</text>
  60. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/18/9bdc2845-e4bc-4215-82d0-9582066b710f.png"></image>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. <view class="box" @click="handleTurnPage('/pagesMy/achievement')">
  66. <view class="box-title">我的成就</view>
  67. <view class="box-achievement adfacjb">
  68. <view class="box-achievement-left">收获<span>{{achievement}}</span>项成就</view>
  69. <view class="box-achievement-right adfacjb">
  70. <view class="imgs"></view>
  71. <view class="jt">
  72. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/17/79079542-4711-44e8-9246-9cd1b8ea4e39.png"></image>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. <view class="box">
  78. <view class="box-title">其他功能</view>
  79. <view class="box-other adfacjb">
  80. <view class="box-other-pre adffcac" @click="handleTurnPage('/pagesMy/practice')">
  81. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/18/53fb5a7a-e7fb-4e5d-b902-f434cfc6d786.png"></image>
  82. <text>申领社会实践记录</text>
  83. </view>
  84. <view class="box-other-pre adffcac" @click="handleTurnPage('/pagesMy/familyMember')">
  85. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/18/06acc5f2-45e8-43ea-96a3-c17e79a190bc.png"></image>
  86. <text>家庭成员</text>
  87. </view>
  88. <view class="box-other-pre adffcac" @click="handleTurnPage('/pagesMy/exclusiveScroll')">
  89. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/18/7746f429-615d-4e1b-8564-c943f07882be.png"></image>
  90. <text>我的专享卷</text>
  91. </view>
  92. </view>
  93. </view>
  94. <CusTabbar :tabbarIndex="2"></CusTabbar>
  95. <login-register @loginSucc="loginSucc"></login-register>
  96. </view>
  97. </template>
  98. <script setup name="">
  99. import CusTabbar from '@/components/CusTabbar/index.vue'
  100. import { ref, onMounted, watch, getCurrentInstance } from 'vue'
  101. const { proxy } = getCurrentInstance();
  102. import { useUserStore } from '@/common/stores/user';
  103. const userStore = useUserStore();
  104. import { useGlobalShare } from '@/common/composables/useGlobalShare';
  105. const { isLogin } = useGlobalShare();
  106. const userInfo = ref(null)
  107. const heartNum = ref(0)
  108. const fileNum = ref(0)
  109. const hourNum = ref(0)
  110. const achievement = ref(0)
  111. const showLogin = () => {
  112. if(userInfo.value) return
  113. userStore.openLoginModal();
  114. }
  115. const handleTurnPage = (url) => {
  116. if(!isLogin()) return
  117. uni.navigateTo({ url })
  118. }
  119. const getUserInfo = () => {
  120. if(uni.getStorageSync('userInfo')){
  121. userInfo.value = JSON.parse(uni.getStorageSync('userInfo'));
  122. }
  123. }
  124. watch(()=>userStore.token,newVal=>{
  125. getUserInfo()
  126. })
  127. onMounted(()=>{
  128. getUserInfo()
  129. })
  130. </script>
  131. <style scoped lang="scss">
  132. .tab_page{
  133. .info{
  134. margin-top: 40rpx;
  135. position: relative;
  136. padding: 0 24rpx 0 16rpx;
  137. &-top{
  138. &-left{
  139. .avatar{
  140. width: 148rpx;
  141. height: 148rpx;
  142. }
  143. .text{
  144. margin-left: 24rpx;
  145. &-top{
  146. font-family: PingFang-SC, PingFang-SC;
  147. font-weight: bold;
  148. font-size: 40rpx;
  149. color: #151B29;
  150. line-height: 40rpx;
  151. }
  152. &-bottom{
  153. font-family: PingFangSC, PingFang SC;
  154. font-weight: 400;
  155. font-size: 26rpx;
  156. color: #151B29;
  157. line-height: 26rpx;
  158. margin-top: 26rpx;
  159. &.lv{
  160. width: 137rpx;
  161. height: 42rpx;
  162. background: url('https://transcend.ringzle.com/xiaozhi-app/profile/2025/11/17/0d460a9f-e13b-4469-b08d-dcc73e417ce9.png') no-repeat;
  163. background-size: 100% 100%;
  164. font-family: PingFangSC, PingFang SC;
  165. font-weight: 600;
  166. font-size: 26rpx;
  167. color: #FFFFFF;
  168. line-height: 38rpx;
  169. padding-left: 16rpx;
  170. box-sizing: border-box;
  171. margin-top: 18rpx;
  172. }
  173. }
  174. }
  175. }
  176. &-right{
  177. image{
  178. width: 48rpx;
  179. height: 48rpx;
  180. }
  181. }
  182. }
  183. &-tip{
  184. margin-top: 4rpx;
  185. &-pre{
  186. margin-top: 36rpx;
  187. .left{
  188. font-family: PingFangSC, PingFang SC;
  189. font-weight: 400;
  190. font-size: 28rpx;
  191. color: #252525;
  192. line-height: 28rpx;
  193. }
  194. .right{
  195. image{
  196. width: 32rpx;
  197. height: 32rpx;
  198. }
  199. }
  200. }
  201. }
  202. }
  203. .box{
  204. background: #FFFFFF;
  205. border-radius: 24rpx;
  206. padding: 40rpx 24rpx 36rpx;
  207. margin-top: 20rpx;
  208. position: relative;
  209. &-title{
  210. font-family: PingFang-SC, PingFang-SC;
  211. font-weight: bold;
  212. font-size: 36rpx;
  213. color: #151B29;
  214. line-height: 40rpx;
  215. }
  216. &-card{
  217. margin-top: 72rpx;
  218. &-pre{
  219. width: calc(100% / 3 - 8rpx);
  220. height: 200rpx;
  221. position: relative;
  222. background-size: 100% 100%;
  223. background-repeat: no-repeat;
  224. .top{
  225. width: 82rpx;
  226. height: 82rpx;
  227. position: absolute;
  228. left: 50%;
  229. margin-left: -41rpx;
  230. top: -32rpx;
  231. }
  232. .num{
  233. font-family: DINAlternate, DINAlternate;
  234. font-weight: bold;
  235. font-size: 40rpx;
  236. line-height: 40rpx;
  237. text-align: center;
  238. margin-top: 86rpx;
  239. }
  240. .text{
  241. margin-top: 20rpx;
  242. text{
  243. font-family: PingFangSC, PingFang SC;
  244. font-weight: 400;
  245. font-size: 24rpx;
  246. line-height: 24rpx;
  247. }
  248. image{
  249. width: 26rpx;
  250. height: 26rpx;
  251. margin-left: 6rpx;
  252. }
  253. }
  254. &.red{
  255. background-image: url('https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/18/0b81f526-1698-459f-9428-f875c91c9e23.png');
  256. .num,.text text{
  257. color: #FC5768;
  258. }
  259. }
  260. &.purple{
  261. background-image: url('https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/18/cca2576e-318c-4cbc-8e42-67c27b6882e4.png');
  262. .num,.text text{
  263. color: #8360E8;
  264. }
  265. }
  266. &.orange{
  267. background-image: url('https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/18/ce8e6415-4490-41e9-b04c-292e6344f9ed.png');
  268. .num,.text text{
  269. color: #FF8200;
  270. }
  271. }
  272. }
  273. }
  274. &-achievement{
  275. margin-top: 24rpx;
  276. &-left{
  277. width: 210rpx;
  278. font-family: PingFangSC, PingFang SC;
  279. font-weight: 400;
  280. font-size: 24rpx;
  281. color: #676775;
  282. line-height: 24rpx;
  283. label{
  284. font-weight: bold;
  285. font-size: 32rpx;
  286. color: #EA3044;
  287. line-height: 32rpx;
  288. margin: 0 7rpx;
  289. }
  290. }
  291. &-right{
  292. width: calc(100% - 210rpx);
  293. .jt{
  294. image{
  295. width: 32rpx;
  296. height: 32rpx;
  297. }
  298. }
  299. }
  300. }
  301. &-other{
  302. margin-top: 39rpx;
  303. &-pre{
  304. width: calc(100% / 3);
  305. image{
  306. width: 48rpx;
  307. height: 48rpx;
  308. }
  309. text{
  310. font-family: PingFangSC, PingFang SC;
  311. font-weight: 400;
  312. font-size: 24rpx;
  313. color: #151B29;
  314. line-height: 33rpx;
  315. text-align: center;
  316. margin-top: 16rpx;
  317. }
  318. }
  319. }
  320. }
  321. }
  322. </style>