my.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  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://oss.familydaf.cn/sxsnfile/20251218/0ac9931a34bd432a8a44ef619fa51362.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://oss.familydaf.cn/sxsnfile/20251218/3821654e080945998d464f3c3aa64122.png'" @click="handleTurnPage('/pagesMy/information')"></image>
  11. <view class="text" @click.prevent="showLogin">
  12. <view class="text-top adfac">{{userInfo?userInfo?.realName:'未登录'}}<text class="lv-inline" v-if="userInfo&&isFamilyMember" @click.stop="handleTurnPage('/pagesMy/levelDetail')">&nbsp;Lv&nbsp;{{userInfo?.userLevel||0}}&nbsp;></text></view>
  13. <view class="text-bottom no adfac" v-if="userInfo&&!isFamilyMember">编号:{{userInfo?.uniqueNo||''}}</view>
  14. <view class="text-bottom" v-if="!userInfo">去登录注册&nbsp;>></view>
  15. </view>
  16. </view>
  17. <div class="info-top-change adfac" v-if="userInfo" @click="handleChangeUser">
  18. <image src="https://oss.familydaf.cn/sxsnfile/20260105/7242f7d209f646a29e5570fa73da352d.png"></image>
  19. <text>切换用户</text>
  20. </div>
  21. </view>
  22. <view class="info-tip">
  23. <view class="info-tip-pre adfacjb" @click="handleTurnPage('/pagesMy/information')">
  24. <view class="left">{{isFamilyMember?'个人':'家庭'}}公益名称:<text v-if="userInfo">{{userInfo?.welfareName||''}}</text><text style="color: #657588;" v-else>暂无,快去填写吧~</text></view>
  25. <view class="right">
  26. <image src="https://oss.familydaf.cn/sxsnfile/20251218/938f573288ad401fbd1e57404a870059.png"></image>
  27. </view>
  28. </view>
  29. <view class="info-tip-pre adfacjb" @click="handleTurnPage('/pagesMy/information')">
  30. <view class="left">{{isFamilyMember?'个人':'家庭'}}公益口号:<text v-if="userInfo">{{userInfo?.welfareSlogan||''}}</text><text style="color: #657588;" v-else>暂无,快去填写吧~</text></view>
  31. <view class="right">
  32. <image src="https://oss.familydaf.cn/sxsnfile/20251218/938f573288ad401fbd1e57404a870059.png"></image>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="box" style="margin-top: 40rpx;">
  38. <view class="box-title">公益记录</view>
  39. <view class="box-card adfacjb">
  40. <view class="box-card-pre adffcac red" @click="handleTurnPage('/pagesMy/heartNumber?loveValue='+(isFamilyMember?(numInfo?.loveValueBalance??0):numInfo?.loveValue))">
  41. <image class="top" src="https://oss.familydaf.cn/sxsnfile/20251218/046c057625704329a478d535cd1b4364.png"></image>
  42. <view class="num">{{isFamilyMember?((numInfo?.loveValueBalance||0)).toFixed(2):((numInfo?.loveValue||0)).toFixed(2)}}</view>
  43. <view class="text adf">
  44. <text>{{isFamilyMember?'爱心值余额':'我的爱心值'}}</text>
  45. <image src="https://oss.familydaf.cn/sxsnfile/20251218/2e8332c5f36a45cab3af336aa324d20c.png"></image>
  46. </view>
  47. </view>
  48. <view class="box-card-pre adffcac purple" @click="handleTurnPage('/pagesMy/archives')">
  49. <image class="top" src="https://oss.familydaf.cn/sxsnfile/20251218/ee5fffc2b10647ef9492150aed6bb29d.png"></image>
  50. <view class="num">{{(numInfo?.myArchives||0).toFixed(2)}}</view>
  51. <view class="text adf">
  52. <text>我的档案</text>
  53. <image src="https://oss.familydaf.cn/sxsnfile/20251218/6e9e879da03944a4911b48550e915641.png"></image>
  54. </view>
  55. </view>
  56. <view class="box-card-pre adffcac orange" @click="handleTurnPage('/pagesMy/volunteerHours?volunteerHours='+numInfo?.volunteerHours)">
  57. <image class="top" src="https://oss.familydaf.cn/sxsnfile/20251218/3fdb7e3c0d3c444ab03dd5f51a5e3fe0.png"></image>
  58. <view class="num">{{(numInfo?.volunteerHours||0).toFixed(2)}}</view>
  59. <view class="text adf">
  60. <text>义工时长(h)</text>
  61. <image src="https://oss.familydaf.cn/sxsnfile/20251218/625a9a7d454c4e7985bd7e12a9f1af93.png"></image>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="box" @click="handleTurnPage('/pagesMy/achievement')" v-if="isFamilyMember">
  67. <view class="box-title">我的成就</view>
  68. <view class="box-achievement adfacjb">
  69. <view class="box-achievement-left">收获<span>{{numInfo?.myMedals||0}}</span>项成就</view>
  70. <view class="box-achievement-right adfacjb">
  71. <view class="imgs"></view>
  72. <view class="jt">
  73. <image src="https://oss.familydaf.cn/sxsnfile/20251218/938f573288ad401fbd1e57404a870059.png"></image>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. <view class="box">
  79. <view class="box-title">其他功能</view>
  80. <view class="box-other adfacjb">
  81. <view class="box-other-pre adffcac" @click="handleTurnPage('/pagesMy/practice')">
  82. <image src="https://oss.familydaf.cn/sxsnfile/20251218/f6d2c342d9414909b4626e34909917c7.png"></image>
  83. <text>申领社会实践记录</text>
  84. </view>
  85. <view class="box-other-pre adffcac" @click="handleTurnPage('/pagesMy/familyMember')">
  86. <image src="https://oss.familydaf.cn/sxsnfile/20251218/248ed751f8bf4821b29cd236ec2dc78b.png"></image>
  87. <text>家庭成员</text>
  88. </view>
  89. <view class="box-other-pre adffcac" @click="handleTurnPage('/pagesMy/exclusiveScroll')" v-if="!isFamilyMember">
  90. <image src="https://oss.familydaf.cn/sxsnfile/20251218/7ee3c42e8408489fb0768406d72b73b4.png"></image>
  91. <text>我的专享券</text>
  92. </view>
  93. <view class="box-other-pre adffcac" @click="handleBackUser" v-else>
  94. <image src="https://oss.familydaf.cn/sxsnfile/20260105/5b8a24ffd1e34486a6aa5d88260677d0.png"></image>
  95. <text>返回家庭页</text>
  96. </view>
  97. </view>
  98. </view>
  99. <div class="dialog adffc" v-if="changeShow">
  100. <div class="change adffc">
  101. <div class="change-top adfacjc">
  102. <text>切换用户</text>
  103. <image src="https://oss.familydaf.cn/sxsnfile/20260105/2ffe44b1abef403788b21aca09f6a8c3.png" @click="changeShow=false"></image>
  104. </div>
  105. <div class="change-list">
  106. <div class="change-list-item adfacjb" v-for="(item,index) in familyMemberList" :key="item.id" @click="selectFamilyMember(index)">
  107. <div class="change-list-item-left">
  108. <view class="change-list-item-left-top adfac">
  109. <view class="name">{{item.name||''}}</view>
  110. <image class="sex" v-if="item.gender==1" src="https://oss.familydaf.cn/sxsnfile/20251218/473d5677fbdb4106acdb9a163377d27f.png"></image>
  111. <image class="sex" v-else-if="item.gender==0" src="https://oss.familydaf.cn/sxsnfile/20251218/02bc40a1c47b40f1a36b55cd0553211c.png"></image>
  112. <view class="age" :class="{'women':item.gender==1,'man':item.gender==0}">{{item.age}}岁</view>
  113. </view>
  114. <view class="change-list-item-left-bottom">
  115. 身份证 {{item.idCardCopy}}
  116. </view>
  117. </div>
  118. <div class="change-list-item-right">
  119. <image v-if="item.select" src="https://oss.familydaf.cn/sxsnfile/20251218/c11b9a1b56f34e1189621f4270f0349a.png"></image>
  120. <image v-else src="https://oss.familydaf.cn/sxsnfile/20251218/2a2f7bdefb474a3e93faa00aef6d0e1f.png"></image>
  121. </div>
  122. </div>
  123. </div>
  124. <div class="change-btn" @click="changeUserConfirm">确定</div>
  125. </div>
  126. </div>
  127. <CusTabbar :tabbarIndex="2"></CusTabbar>
  128. <login-register></login-register>
  129. </view>
  130. </template>
  131. <script setup name="">
  132. import CusTabbar from '@/components/CusTabbar/index.vue'
  133. import { ref, onMounted, watch, nextTick, getCurrentInstance } from 'vue'
  134. const { proxy } = getCurrentInstance();
  135. import { useUserStore } from '@/common/stores/user';
  136. const userStore = useUserStore();
  137. import { useGlobalShare } from '@/common/composables/useGlobalShare';
  138. const { isLogin } = useGlobalShare();
  139. const userInfo = ref(null)
  140. const numInfo = ref(null)
  141. const isFamilyMember = ref(false)
  142. const changeShow = ref(false)
  143. const familyMemberList = ref([])
  144. const familyMemberInfo = ref(null)
  145. const memberId = ref('')
  146. const showLogin = () => {
  147. if(!isLogin()) return
  148. handleTurnPage('/pagesMy/information')
  149. }
  150. const handleChangeUser = () => {
  151. changeShow.value = true;
  152. getMemberList();
  153. }
  154. const getMemberList = () => {
  155. const userId = uni.getStorageSync('userInfo')?JSON.parse(uni.getStorageSync('userInfo'))?.id:'';
  156. proxy.$api.get('/core/family/member/page',{page:1,limit:-1,userId}).then(({data:res})=>{
  157. if(res.code!==0) return proxy.$showToast(res.msg)
  158. familyMemberList.value = res.data.list;
  159. familyMemberList.value.forEach(l=>{
  160. l.select = false;
  161. l.age = getAge(l.idCard)
  162. l.idCardCopy = l.idCard.replace(/^(\d{6})(\d{8})(\d{3}[\dX])$/i,'$1********$3')
  163. })
  164. })
  165. }
  166. const isValid = (idCard) => {
  167. // 正则表达式校验18位身份证号码(最后一位可以是数字或X/x)
  168. const regex = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
  169. return typeof idCard === 'string' && regex.test(idCard);
  170. }
  171. const getAge = (idCard) => {
  172. if (!isValid(idCard)) return 0
  173. // 从身份证的第7位开始,截取8位作为出生日期字符串 (YYYYMMDD)
  174. const birthDateStr = idCard.substring(6, 14);
  175. const birthYear = parseInt(birthDateStr.substring(0, 4), 10);
  176. const birthMonth = parseInt(birthDateStr.substring(4, 6), 10);
  177. const birthDay = parseInt(birthDateStr.substring(6, 8), 10);
  178. const today = new Date();
  179. const currentYear = today.getFullYear();
  180. const currentMonth = today.getMonth() + 1; // getMonth() 返回 0-11
  181. const currentDay = today.getDate();
  182. // 计算周岁
  183. let age = currentYear - birthYear;
  184. // 如果当前月份小于出生月份,或者月份相同但日期小于出生日期,说明今年的生日还没过
  185. if (currentMonth < birthMonth || (currentMonth === birthMonth && currentDay < birthDay)) {
  186. age--;
  187. }
  188. return age < 0 ? 0 : age;
  189. }
  190. const selectFamilyMember = index => {
  191. familyMemberList.value.forEach((f,i)=>{
  192. familyMemberList.value[i].select = index===i;
  193. })
  194. }
  195. const handleBackUser = () => {
  196. memberId.value = '';
  197. familyMemberInfo.value = null;
  198. isFamilyMember.value = false;
  199. uni.removeStorageSync('isFamilyMember');
  200. uni.removeStorageSync('familyMemberInfo');
  201. }
  202. const changeUserConfirm = () => {
  203. const selectedUser = familyMemberList.value.find(f=>f.select)
  204. if(!selectedUser) return proxy.$showToast('请选择要切换的用户')
  205. memberId.value = selectedUser?.id||'';
  206. familyMemberInfo.value = selectedUser;
  207. isFamilyMember.value = true;
  208. userInfo.value = {...deepClone(userInfo.value),...deepClone(selectedUser)};
  209. uni.setStorageSync('isFamilyMember',true);
  210. uni.setStorageSync('familyMemberInfo',JSON.stringify(familyMemberInfo.value));
  211. changeShow.value = false;
  212. }
  213. const handleTurnPage = (url) => {
  214. if(!isLogin()) return
  215. if(url == '/pagesMy/information'){
  216. if(isFamilyMember.value){
  217. uni.navigateTo({
  218. url:'/pagesMy/familyMemberVindicate?id='+(JSON.parse(uni.getStorageSync('familyMemberInfo'))?.id||'')+'&type=my'
  219. })
  220. return
  221. }
  222. }
  223. if(url == '/pagesMy/achievement'){
  224. url = `/pagesMy/achievement?numInfo=`+JSON.stringify(numInfo.value)+`&userLevel=`+userInfo.value?.userLevel
  225. }
  226. uni.navigateTo({ url })
  227. }
  228. const deepClone = (obj) => {
  229. if (obj === null || typeof obj !== 'object') {
  230. return obj;
  231. }
  232. if (Array.isArray(obj)) {
  233. return obj.map(item => deepClone(item));
  234. }
  235. const clonedObj = {};
  236. for (const key in obj) {
  237. clonedObj[key] = deepClone(obj[key]);
  238. }
  239. return clonedObj;
  240. }
  241. const getUserInfo = () => {
  242. try{
  243. let mid = deepClone(memberId.value);
  244. if(uni.getStorageSync('isFamilyMember')) mid = uni.getStorageSync('familyMemberInfo')?JSON.parse(uni.getStorageSync('familyMemberInfo')).id:'';
  245. proxy.$api.get(`/wx/userWelfareData`,{memberId:mid}).then(({data:res})=>{
  246. if(res.code!==0) return proxy.$showToast(res.msg)
  247. userInfo.value = res.data;
  248. numInfo.value = res.data;
  249. if(uni.getStorageSync('isFamilyMember')){
  250. uni.setStorageSync('isFamilyMember',JSON.stringify(res.data));
  251. }else {
  252. uni.setStorageSync('userInfo',JSON.stringify({...JSON.parse(uni.getStorageSync('userInfo')),...res.data}));
  253. }
  254. })
  255. }catch(e){
  256. userInfo.value = null
  257. numInfo.value = null
  258. }
  259. }
  260. watch(()=>userStore.token,(newVal,oldVal)=>{
  261. if(oldVal!=newVal&&newVal){
  262. setTimeout(()=>{
  263. uni.showToast({
  264. title: '登录成功',
  265. icon: 'success'
  266. });
  267. },200)
  268. nextTick(()=>{
  269. getUserInfo()
  270. })
  271. }
  272. })
  273. watch(()=>memberId.value,(newVal,oldVal)=>{
  274. if(oldVal!=newVal){
  275. nextTick(()=>{
  276. getUserInfo()
  277. })
  278. }
  279. })
  280. onMounted(()=>{
  281. isFamilyMember.value = uni.getStorageSync('isFamilyMember')?true:false;
  282. if(uni.getStorageSync('familyMemberInfo')) memberId.value = JSON.parse(uni.getStorageSync('familyMemberInfo')).id;
  283. if(uni.getStorageSync('userInfo')){
  284. getUserInfo()
  285. }
  286. })
  287. </script>
  288. <style scoped lang="scss">
  289. .dialog{
  290. position: fixed;
  291. left: 0;
  292. right: 0;
  293. top: 0;
  294. bottom: 0;
  295. background: rgba(0, 0, 0, .4);
  296. z-index: 1001;
  297. justify-content: flex-end;
  298. .change{
  299. width: 100%;
  300. height: 920rpx;
  301. background: #FFFFFF;
  302. border-radius: 24rpx 24rpx 0rpx 0rpx;
  303. padding: 48rpx 30rpx 64rpx;
  304. box-sizing: border-box;
  305. &-top{
  306. position: relative;
  307. text{
  308. font-family: PingFang-SC, PingFang-SC;
  309. font-weight: bold;
  310. font-size: 36rpx;
  311. color: #151B29;
  312. line-height: 36rpx;
  313. }
  314. image{
  315. width: 36rpx;
  316. height: 36rpx;
  317. position: absolute;
  318. right: 0;
  319. }
  320. }
  321. &-list{
  322. flex: 1;
  323. margin-top: 48rpx;
  324. overflow-y: auto;
  325. &-item{
  326. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #E5E7EB;
  327. width: 100%;
  328. padding: 36rpx 0;
  329. &-left{
  330. &-top{
  331. .name{
  332. font-family: PingFang-SC, PingFang-SC;
  333. font-weight: bold;
  334. font-size: 32rpx;
  335. color: #151B29;
  336. line-height: 32rpx;
  337. }
  338. .sex{
  339. width: 44rpx;
  340. height: 32rpx;
  341. margin-left: 16rpx;
  342. }
  343. .age{
  344. border-radius: 13rpx;
  345. font-family: PingFangSC, PingFang SC;
  346. font-weight: 400;
  347. font-size: 20rpx;
  348. line-height: 24rpx;
  349. padding: 4rpx 10rpx;
  350. margin-left: 13rpx;
  351. &.women{
  352. background: rgba(244,101,122,0.14);
  353. color: #F4657A;
  354. }
  355. &.man{
  356. background: rgba(5,169,254,0.12);
  357. color: #05A9FE;
  358. }
  359. }
  360. }
  361. &-bottom{
  362. font-family: PingFangSC, PingFang SC;
  363. font-weight: 400;
  364. font-size: 24rpx;
  365. color: #989998;
  366. line-height: 24rpx;
  367. margin-top: 23rpx;
  368. }
  369. }
  370. &-right{
  371. image{
  372. width: 36rpx;
  373. height: 36rpx;
  374. }
  375. }
  376. }
  377. }
  378. &-btn{
  379. width: 100%;
  380. height: 90rpx;
  381. background: #B7F358;
  382. border-radius: 45rpx;
  383. font-family: PingFang-SC, PingFang-SC;
  384. font-weight: bold;
  385. font-size: 32rpx;
  386. color: #151B29;
  387. line-height: 90rpx;
  388. text-align: center;
  389. letter-spacing: 2rpx;
  390. margin-top: 20rpx;
  391. }
  392. }
  393. }
  394. .tab_page{
  395. .info{
  396. margin-top: 40rpx;
  397. position: relative;
  398. padding: 0 24rpx 0 16rpx;
  399. &-top{
  400. position: relative;
  401. &-left{
  402. .avatar{
  403. width: 148rpx;
  404. height: 148rpx;
  405. border-radius: 50%;
  406. }
  407. .text{
  408. margin-left: 24rpx;
  409. &-top{
  410. font-family: PingFang-SC, PingFang-SC;
  411. font-weight: bold;
  412. font-size: 40rpx;
  413. color: #151B29;
  414. line-height: 40rpx;
  415. .lv-inline{
  416. display: inline-block;
  417. width: 137rpx;
  418. height: 42rpx;
  419. background: url('https://oss.familydaf.cn/sxsnfile/20251218/b6e6f5b45ad34f91bbaf66c9890fc2cd.png') no-repeat;
  420. background-size: 100% 100%;
  421. font-family: PingFangSC, PingFang SC;
  422. font-weight: 600;
  423. font-size: 26rpx;
  424. color: #FFFFFF;
  425. line-height: 42rpx;
  426. padding-left: 16rpx;
  427. box-sizing: border-box;
  428. vertical-align: middle;
  429. }
  430. }
  431. &-bottom{
  432. font-family: PingFangSC, PingFang SC;
  433. font-weight: 400;
  434. font-size: 26rpx;
  435. color: #151B29;
  436. line-height: 26rpx;
  437. margin-top: 26rpx;
  438. &.lv{
  439. width: 137rpx;
  440. height: 42rpx;
  441. background: url('https://oss.familydaf.cn/sxsnfile/20251218/b6e6f5b45ad34f91bbaf66c9890fc2cd.png') no-repeat;
  442. background-size: 100% 100%;
  443. font-family: PingFangSC, PingFang SC;
  444. font-weight: 600;
  445. font-size: 26rpx;
  446. color: #FFFFFF;
  447. line-height: 38rpx;
  448. padding-left: 16rpx;
  449. box-sizing: border-box;
  450. margin-top: 18rpx;
  451. }
  452. &.no{
  453. font-family: PingFangSC, PingFang SC;
  454. font-weight: 400;
  455. font-size: 26rpx;
  456. color: #657588;
  457. line-height: 26rpx;
  458. }
  459. }
  460. }
  461. }
  462. &-right{
  463. image{
  464. width: 48rpx;
  465. height: 48rpx;
  466. }
  467. }
  468. &-change{
  469. padding: 0 20rpx 0 16rpx;
  470. height: 60rpx;
  471. background: #B7F358;
  472. border-radius: 30rpx 0rpx 0rpx 30rpx;
  473. position: absolute;
  474. top: 24rpx;
  475. right: -48rpx;
  476. image{
  477. width: 32rpx;
  478. height: 32rpx;
  479. }
  480. text{
  481. font-family: PingFang-SC, PingFang-SC;
  482. font-weight: bold;
  483. font-size: 24rpx;
  484. color: #151B29;
  485. line-height: 30rpx;
  486. margin-left: 8rpx;
  487. }
  488. }
  489. }
  490. &-tip{
  491. margin-top: 4rpx;
  492. &-pre{
  493. margin-top: 36rpx;
  494. .left{
  495. font-family: PingFangSC, PingFang SC;
  496. font-weight: 400;
  497. font-size: 28rpx;
  498. color: #252525;
  499. line-height: 28rpx;
  500. }
  501. .right{
  502. image{
  503. width: 32rpx;
  504. height: 32rpx;
  505. }
  506. }
  507. }
  508. }
  509. }
  510. .box{
  511. background: #FFFFFF;
  512. border-radius: 24rpx;
  513. padding: 40rpx 24rpx 36rpx;
  514. margin-top: 20rpx;
  515. position: relative;
  516. &-title{
  517. font-family: PingFang-SC, PingFang-SC;
  518. font-weight: bold;
  519. font-size: 36rpx;
  520. color: #151B29;
  521. line-height: 40rpx;
  522. }
  523. &-card{
  524. margin-top: 72rpx;
  525. &-pre{
  526. width: calc(100% / 3 - 8rpx);
  527. height: 200rpx;
  528. position: relative;
  529. background-size: 100% 100%;
  530. background-repeat: no-repeat;
  531. .top{
  532. width: 82rpx;
  533. height: 82rpx;
  534. position: absolute;
  535. left: 50%;
  536. margin-left: -41rpx;
  537. top: -32rpx;
  538. }
  539. .num{
  540. font-family: DINAlternate, DINAlternate;
  541. font-weight: bold;
  542. font-size: 40rpx;
  543. line-height: 40rpx;
  544. text-align: center;
  545. margin-top: 86rpx;
  546. }
  547. .text{
  548. margin-top: 20rpx;
  549. text{
  550. font-family: PingFangSC, PingFang SC;
  551. font-weight: 400;
  552. font-size: 24rpx;
  553. line-height: 24rpx;
  554. }
  555. image{
  556. width: 26rpx;
  557. height: 26rpx;
  558. margin-left: 6rpx;
  559. }
  560. }
  561. &.red{
  562. background-image: url('https://oss.familydaf.cn/sxsnfile/20251218/57acefa1a0084d1e980002e165668bc9.png');
  563. .num,.text text{
  564. color: #FC5768;
  565. }
  566. }
  567. &.purple{
  568. background-image: url('https://oss.familydaf.cn/sxsnfile/20251218/e0f97b6ca8864d2ca0c3dc48b07dae58.png');
  569. .num,.text text{
  570. color: #8360E8;
  571. }
  572. }
  573. &.orange{
  574. background-image: url('https://oss.familydaf.cn/sxsnfile/20251218/eabb899f7ab14010b61fb30ed24bd818.png');
  575. .num,.text text{
  576. color: #FF8200;
  577. }
  578. }
  579. }
  580. }
  581. &-achievement{
  582. margin-top: 24rpx;
  583. &-left{
  584. width: 210rpx;
  585. font-family: PingFangSC, PingFang SC;
  586. font-weight: 400;
  587. font-size: 24rpx;
  588. color: #676775;
  589. line-height: 24rpx;
  590. label{
  591. font-weight: bold;
  592. font-size: 32rpx;
  593. color: #EA3044;
  594. line-height: 32rpx;
  595. margin: 0 7rpx;
  596. }
  597. }
  598. &-right{
  599. width: calc(100% - 210rpx);
  600. .jt{
  601. image{
  602. width: 32rpx;
  603. height: 32rpx;
  604. }
  605. }
  606. }
  607. }
  608. &-other{
  609. margin-top: 39rpx;
  610. &-pre{
  611. width: calc(100% / 3);
  612. image{
  613. width: 48rpx;
  614. height: 48rpx;
  615. }
  616. text{
  617. font-family: PingFangSC, PingFang SC;
  618. font-weight: 400;
  619. font-size: 24rpx;
  620. color: #151B29;
  621. line-height: 33rpx;
  622. text-align: center;
  623. margin-top: 16rpx;
  624. }
  625. }
  626. }
  627. }
  628. }
  629. </style>