my.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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. <div class="info">
  8. <div class="info-top adfacjb">
  9. <div class="info-top-left adfac">
  10. <image class="avatar" :src="userInfo?userInfo.avatar:'https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/17/6db27a79-235b-4595-87f2-89ff09fc66a5.png'"></image>
  11. <div class="text">
  12. <div class="text-top">{{userInfo?userInfo.name:'未登录'}}</div>
  13. <div class="text-bottom" v-if="userInfo"></div>
  14. <div class="text-bottom" v-else @tap="showLogin">去登录注册&nbsp;>></div>
  15. </div>
  16. </div>
  17. <div class="info-top-right" @tap="handleTurnPage('/pagesMy/information')">
  18. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/17/d0319d8d-1445-47d6-94fa-cb934e022ab8.png"></image>
  19. </div>
  20. </div>
  21. <div class="info-tip">
  22. <div class="info-tip-pre adfacjb">
  23. <div class="left">家庭公益名称:{{userInfo?userInfo.xxx:'暂无'}}</div>
  24. <div class="right">
  25. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/17/79079542-4711-44e8-9246-9cd1b8ea4e39.png"></image>
  26. </div>
  27. </div>
  28. <div class="info-tip-pre adfacjb">
  29. <div class="left">家庭公益口号:{{userInfo?userInfo.xxx:'暂无'}}</div>
  30. <div class="right">
  31. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/17/79079542-4711-44e8-9246-9cd1b8ea4e39.png"></image>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. <div class="box" style="margin-top: 40rpx;">
  37. <div class="box-title">公益记录</div>
  38. <div class="box-card adfacjb">
  39. <div class="box-card-pre adffcac red" @tap="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. <div class="num">{{(heartNum||0).toFixed(2)}}</div>
  42. <div 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. </div>
  46. </div>
  47. <div class="box-card-pre adffcac purple" @tap="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. <div class="num">{{(fileNum||0).toFixed(2)}}</div>
  50. <div 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. </div>
  54. </div>
  55. <div class="box-card-pre adffcac orange" @tap="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. <div class="num">{{(hourNum||0).toFixed(2)}}</div>
  58. <div 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. </div>
  62. </div>
  63. </div>
  64. </div>
  65. <div class="box" @tap="handleTurnPage('/pagesMy/achievement')">
  66. <div class="box-title">我的成就</div>
  67. <div class="box-achievement adfacjb">
  68. <div class="box-achievement-left">收获<span>{{achievement}}</span>项成就</div>
  69. <div class="box-achievement-right adfacjb">
  70. <div class="imgs"></div>
  71. <div class="jt">
  72. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/17/79079542-4711-44e8-9246-9cd1b8ea4e39.png"></image>
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. <div class="box">
  78. <div class="box-title">其他功能</div>
  79. <div class="box-other adfacjb">
  80. <div class="box-other-pre adffcac">
  81. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/18/53fb5a7a-e7fb-4e5d-b902-f434cfc6d786.png"></image>
  82. <text>申领社会实践记录</text>
  83. </div>
  84. <div class="box-other-pre adffcac">
  85. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/18/06acc5f2-45e8-43ea-96a3-c17e79a190bc.png"></image>
  86. <text>家庭成员</text>
  87. </div>
  88. <div class="box-other-pre adffcac">
  89. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/18/7746f429-615d-4e1b-8564-c943f07882be.png"></image>
  90. <text>我的专享卷</text>
  91. </div>
  92. </div>
  93. </div>
  94. <CusTabbar :tabbarIndex="2"></CusTabbar>
  95. <login-register></login-register>
  96. </view>
  97. </template>
  98. <script setup name="">
  99. import CusTabbar from '@/components/CusTabbar/index.vue'
  100. import { ref, 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. userStore.openLoginModal();
  113. }
  114. const handleTurnPage = (url) => {
  115. if(!isLogin()) return
  116. uni.navigateTo({ url })
  117. }
  118. </script>
  119. <style scoped lang="scss">
  120. .tab_page{
  121. .info{
  122. margin-top: 40rpx;
  123. position: relative;
  124. padding: 0 24rpx 0 16rpx;
  125. &-top{
  126. &-left{
  127. .avatar{
  128. width: 148rpx;
  129. height: 148rpx;
  130. }
  131. .text{
  132. margin-left: 24rpx;
  133. &-top{
  134. font-family: PingFang-SC, PingFang-SC;
  135. font-weight: bold;
  136. font-size: 40rpx;
  137. color: #151B29;
  138. line-height: 40rpx;
  139. }
  140. &-bottom{
  141. font-family: PingFangSC, PingFang SC;
  142. font-weight: 400;
  143. font-size: 26rpx;
  144. color: #151B29;
  145. line-height: 26rpx;
  146. margin-top: 26rpx;
  147. }
  148. }
  149. }
  150. &-right{
  151. image{
  152. width: 48rpx;
  153. height: 48rpx;
  154. }
  155. }
  156. }
  157. &-tip{
  158. margin-top: 4rpx;
  159. &-pre{
  160. margin-top: 36rpx;
  161. .left{
  162. font-family: PingFangSC, PingFang SC;
  163. font-weight: 400;
  164. font-size: 28rpx;
  165. color: #252525;
  166. line-height: 28rpx;
  167. }
  168. .right{
  169. image{
  170. width: 32rpx;
  171. height: 32rpx;
  172. }
  173. }
  174. }
  175. }
  176. }
  177. .box{
  178. background: #FFFFFF;
  179. border-radius: 24rpx;
  180. padding: 40rpx 24rpx 36rpx;
  181. margin-top: 20rpx;
  182. position: relative;
  183. &-title{
  184. font-family: PingFang-SC, PingFang-SC;
  185. font-weight: bold;
  186. font-size: 36rpx;
  187. color: #151B29;
  188. line-height: 40rpx;
  189. }
  190. &-card{
  191. margin-top: 72rpx;
  192. &-pre{
  193. width: calc(100% / 3 - 8rpx);
  194. height: 200rpx;
  195. position: relative;
  196. background-size: 100% 100%;
  197. background-repeat: no-repeat;
  198. .top{
  199. width: 82rpx;
  200. height: 82rpx;
  201. position: absolute;
  202. left: 50%;
  203. margin-left: -41rpx;
  204. top: -32rpx;
  205. }
  206. .num{
  207. font-family: DINAlternate, DINAlternate;
  208. font-weight: bold;
  209. font-size: 40rpx;
  210. line-height: 40rpx;
  211. text-align: center;
  212. margin-top: 86rpx;
  213. }
  214. .text{
  215. margin-top: 20rpx;
  216. text{
  217. font-family: PingFangSC, PingFang SC;
  218. font-weight: 400;
  219. font-size: 24rpx;
  220. line-height: 24rpx;
  221. }
  222. image{
  223. width: 26rpx;
  224. height: 26rpx;
  225. margin-left: 6rpx;
  226. }
  227. }
  228. &.red{
  229. background-image: url('https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/18/0b81f526-1698-459f-9428-f875c91c9e23.png');
  230. .num,.text text{
  231. color: #FC5768;
  232. }
  233. }
  234. &.purple{
  235. background-image: url('https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/18/cca2576e-318c-4cbc-8e42-67c27b6882e4.png');
  236. .num,.text text{
  237. color: #8360E8;
  238. }
  239. }
  240. &.orange{
  241. background-image: url('https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/18/ce8e6415-4490-41e9-b04c-292e6344f9ed.png');
  242. .num,.text text{
  243. color: #FF8200;
  244. }
  245. }
  246. }
  247. }
  248. &-achievement{
  249. margin-top: 24rpx;
  250. &-left{
  251. width: 210rpx;
  252. font-family: PingFangSC, PingFang SC;
  253. font-weight: 400;
  254. font-size: 24rpx;
  255. color: #676775;
  256. line-height: 24rpx;
  257. label{
  258. font-weight: bold;
  259. font-size: 32rpx;
  260. color: #EA3044;
  261. line-height: 32rpx;
  262. margin: 0 7rpx;
  263. }
  264. }
  265. &-right{
  266. width: calc(100% - 210rpx);
  267. .jt{
  268. image{
  269. width: 32rpx;
  270. height: 32rpx;
  271. }
  272. }
  273. }
  274. }
  275. &-other{
  276. margin-top: 39rpx;
  277. &-pre{
  278. width: calc(100% / 3);
  279. image{
  280. width: 48rpx;
  281. height: 48rpx;
  282. }
  283. text{
  284. font-family: PingFangSC, PingFang SC;
  285. font-weight: 400;
  286. font-size: 24rpx;
  287. color: #151B29;
  288. line-height: 33rpx;
  289. text-align: center;
  290. margin-top: 16rpx;
  291. }
  292. }
  293. }
  294. }
  295. }
  296. </style>