achievement.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. <template>
  2. <view class="common_page adffc" :style="{'height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title="我的成就" bgColor="transparent"></cus-header>
  4. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/29/8dbf51e7-85cb-496a-b3d0-d5816fa8ff34.png" class="top_bg_img" mode="widthFix"></image>
  5. <div class="info">
  6. <div class="info-top adfac">
  7. <image class="avatar" :src="userInfo?.avatarPath||'https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/29/5dded84d-8594-4bbe-9204-c693098e7532.png'"></image>
  8. <div class="name">Hi~ {{userInfo?.realName??''}}</div>
  9. <div class="level adfac"><text>LV</text><text>{{userInfo?.userLevel??1}}</text></div>
  10. </div>
  11. <div class="info-num">收获勋章:{{numInfo?.myMedals??0}} <text>枚</text></div>
  12. <div class="info-memo">共参与<text>{{numInfo?.activityCount??0}}</text>次公益活动,累计义工时长<text>{{numInfo?.volunteerHours??0}}</text>小时</div>
  13. </div>
  14. <div class="tab adfacjc">
  15. <div class="tab-pre" :class="{'active':queryParams.obtained===''}" @tap="changeTab('')">全部</div>
  16. <div class="tab-pre" :class="{'active':queryParams.obtained===1}" @tap="changeTab(1)">已获得</div>
  17. </div>
  18. <div class="list" v-if="list.length">
  19. <div class="list-pre adffcac" v-for="(item,index) in list" :key="index" @tap="showSz(item)">
  20. <image :src="item.imageUrl??''"></image>
  21. <div class="p">{{item?.medalName||''}}</div>
  22. <div class="p tip" v-if="item?.lightUp">{{item?.lightUpDate2??''}}点亮</div>
  23. <div class="p tip" v-else>未获得</div>
  24. </div>
  25. </div>
  26. <div class="dataEmpty" v-else>
  27. <page-empty text="暂无勋章"></page-empty>
  28. </div>
  29. <div class="btn" @tap="showSave">晒出我的成就</div>
  30. <div class="dialog adffcac" :style="{'height':'calc(100vh - '+mt+')px', 'top':mt+'px'}" v-if="xzShow">
  31. <div class="title">"恭喜您获得荣誉勋章"</div>
  32. <div class="img adfacjc">
  33. <image :src="xzInfo.img"></image>
  34. </div>
  35. <div class="name adfac">
  36. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/29/902a8c25-9961-48fd-b869-8fd1ac47b271.png"></image>
  37. <text>{{xzInfo.title}}</text>
  38. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/29/0f48d5d2-2961-4d95-9bf9-148b7f615227.png"></image>
  39. </div>
  40. <div class="heartnum">累计捐赠爱心值{{xzInfo.heartnum||10000}}</div>
  41. <div class="date">{{xzInfo.date}}获得</div>
  42. <div class="btn adfacjc">
  43. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/29/4e76f71e-cd46-4380-8437-04b83eec40f3.png"></image>
  44. <text>炫耀一下</text>
  45. </div>
  46. <image class="close" @tap="xzShow=false;xzInfo=null" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/29/34582f76-ea26-4e83-8172-e1f81c0634aa.png"></image>
  47. </div>
  48. <div class="save adffcacjc" :style="{'height':'calc(100vh - '+mt+')px', 'top':mt+'px'}" v-if="saveShow">
  49. <div class="box">
  50. <image class="close" @tap="saveShow=false" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/29/d1bbde08-3c0f-44bb-bed6-a6c3fce72aa2.png"></image>
  51. <div class="top adfac">
  52. <image :src="'https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/29/98671459-4599-44d2-a5ca-bb8200d42436.png'"></image>
  53. <text>{{'周晓瑾'}}的公益勋章墙</text>
  54. </div>
  55. <div class="num"><text>{{4}}</text> 枚公益勋章</div>
  56. <div class="xzimgs adfac">
  57. <div class="imgbox">
  58. <scroll-view class="scroll-view_H" scroll-x="true" scroll-with-animation="true">
  59. <view class="scroll-view-item_H" v-for="(item,index) in xzImgList" :key="index">
  60. <view class="cl_item">
  61. <image :src="item"></image>
  62. </view>
  63. </view>
  64. </scroll-view>
  65. </div>
  66. </div>
  67. <div class="bottom adfacjb">
  68. <div class="left adfac">
  69. <div class="img">
  70. <image src=""></image>
  71. </div>
  72. <div class="texts adffc">
  73. <text>扫描二维码</text>
  74. <text>查看你的公益勋章</text>
  75. </div>
  76. </div>
  77. <div class="right">善行少年</div>
  78. </div>
  79. </div>
  80. <div class="text">长按图片,保存到手机</div>
  81. </div>
  82. </view>
  83. </template>
  84. <script setup name="">
  85. import CusHeader from '@/components/CusHeader/index.vue'
  86. import PageEmpty from '@/components/pageEmpty/index.vue'
  87. import { onLoad } from '@dcloudio/uni-app'
  88. import { ref, getCurrentInstance } from 'vue'
  89. const { proxy } = getCurrentInstance()
  90. const userInfo = ref(null)
  91. const numInfo = ref(null)
  92. const queryParams = ref({
  93. page:1,
  94. limit:-1,
  95. userId:'',
  96. obtained:''
  97. })
  98. const typeDict = ref({
  99. 1:'公益萌新',
  100. 2:'青铜公益',
  101. 3:'白银公益',
  102. 4:'黄金公益',
  103. 5:'铂金公益',
  104. 6:'公益王者',
  105. 7:'公益活动能手',
  106. 8:'公益活动达人',
  107. 9:'月月公益达人'
  108. })
  109. const list = ref([])
  110. const xzShow = ref(false)
  111. const xzInfo = ref(null)
  112. const saveShow = ref(false)
  113. const xzImgList = ref([
  114. 'https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/29/94bda1ce-50c2-4e49-90ed-90db9b98c390.png',
  115. 'https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/29/7c0b9a7c-a095-495b-a3e9-d953417ebfb1.png',
  116. 'https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/29/94bda1ce-50c2-4e49-90ed-90db9b98c390.png',
  117. 'https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/29/7c0b9a7c-a095-495b-a3e9-d953417ebfb1.png',
  118. 'https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/29/94bda1ce-50c2-4e49-90ed-90db9b98c390.png',
  119. 'https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/29/7c0b9a7c-a095-495b-a3e9-d953417ebfb1.png',
  120. ])
  121. const changeTab = type => {
  122. queryParams.value.obtained = type;
  123. getList()
  124. }
  125. const showSz = item => {
  126. if(!item.date) return
  127. xzInfo.value = item;
  128. xzShow.value = true;
  129. }
  130. const showSave = () => {
  131. saveShow.value = true;
  132. }
  133. const getList = () => {
  134. proxy.$api.get('/core/love/value/record/obtainedMedalList',queryParams.value).then(({data:res})=>{
  135. if(res.code!==0) return proxy.$showToast(res.msg)
  136. list.value = res.data.list;
  137. list.value.forEach(l=>l.lightUpDate2 = new Date(l.lightUpDate).Format('yyyy-MM-dd'));
  138. })
  139. }
  140. onLoad((options)=>{
  141. userInfo.value = uni.getStorageSync('userInfo')&&JSON.parse(uni.getStorageSync('userInfo'));
  142. numInfo.value = options.numInfo&&JSON.parse(options.numInfo);
  143. queryParams.value.userId = userInfo.value&&userInfo.value.id;
  144. getList()
  145. })
  146. </script>
  147. <style scoped lang="scss">
  148. .scroll-view_H {
  149. white-space: nowrap;
  150. width: 100%;
  151. }
  152. .scroll-view-item_H {
  153. display: inline-block;
  154. width: 111rpx;
  155. height: 100%;
  156. margin-left: 23rpx;
  157. &:first-child{
  158. margin-left: 0;
  159. }
  160. }
  161. .common_page{
  162. background: #FFFFFF;
  163. overflow: hidden;
  164. .info{
  165. position: relative;
  166. margin-top: 31rpx;
  167. &-top{
  168. .avatar{
  169. width: 98rpx;
  170. height: 98rpx;
  171. }
  172. .name{
  173. font-family: PingFang-SC, PingFang-SC;
  174. font-weight: bold;
  175. font-size: 32rpx;
  176. color: #252525;
  177. line-height: 54rpx;
  178. margin-left: 15rpx;
  179. }
  180. .level{
  181. width: 137rpx;
  182. height: 42rpx;
  183. background: url('https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/29/acff6d97-0292-4d2d-9663-9761ac76ba3a.png') no-repeat;
  184. background-size: 100% 100%;
  185. margin-left: 20rpx;
  186. text{
  187. font-family: PingFangSC, PingFang SC;
  188. font-weight: 600;
  189. font-size: 26rpx;
  190. color: #FFFFFF;
  191. line-height: 26rpx;
  192. margin-left: 16rpx;
  193. }
  194. }
  195. }
  196. &-num{
  197. font-family: PingFang-SC, PingFang-SC;
  198. font-weight: bold;
  199. font-size: 44rpx;
  200. color: #252525;
  201. line-height: 48rpx;
  202. margin-top: 24rpx;
  203. text{
  204. font-weight: 400;
  205. font-size: 24rpx;
  206. line-height: 40rpx;
  207. }
  208. }
  209. &-memo{
  210. margin-top: 29rpx;
  211. font-family: PingFangSC, PingFang SC;
  212. font-weight: 400;
  213. font-size: 28rpx;
  214. color: #252525;
  215. line-height: 28rpx;
  216. text{
  217. font-weight: bold;
  218. margin: 0 10rpx;
  219. }
  220. }
  221. }
  222. .tab{
  223. position: relative;
  224. margin-top: 92rpx;
  225. &-pre{
  226. padding: 0 65rpx;
  227. font-family: PingFangSC, PingFang SC;
  228. font-weight: 400;
  229. font-size: 32rpx;
  230. color: #676775;
  231. line-height: 48rpx;
  232. position: relative;
  233. &.active{
  234. font-weight: bold;
  235. font-size: 36rpx;
  236. color: #252525;
  237. &::after{
  238. content: '';
  239. width: 42rpx;
  240. height: 6rpx;
  241. background: #77F99B;
  242. border-radius: 3rpx;
  243. position: absolute;
  244. left: 50%;
  245. margin-left: -21rpx;
  246. bottom: -15rpx;
  247. }
  248. }
  249. }
  250. }
  251. .list{
  252. margin-left: -60rpx;
  253. overflow: hidden;
  254. flex: 1;
  255. overflow-y: auto;
  256. &-pre{
  257. width: calc(100% / 3 - 60rpx);
  258. margin-top: 48rpx;
  259. float: left;
  260. margin-left: 60rpx;
  261. image{
  262. width: 180rpx;
  263. height: 176rpx;
  264. }
  265. .p{
  266. font-family: PingFang-SC, PingFang-SC;
  267. font-weight: bold;
  268. font-size: 28rpx;
  269. color: #252525;
  270. line-height: 28rpx;
  271. text-align: center;
  272. margin-top: 24rpx;
  273. &.tip{
  274. font-weight: 400;
  275. font-size: 24rpx;
  276. color: #676775;
  277. line-height: 24rpx;
  278. }
  279. }
  280. }
  281. }
  282. .btn{
  283. width: 100%;
  284. height: 90rpx;
  285. background: #B7F358;
  286. border-radius: 45rpx;
  287. font-family: PingFang-SC, PingFang-SC;
  288. font-weight: bold;
  289. font-size: 32rpx;
  290. color: #151B29;
  291. line-height: 90rpx;
  292. text-align: center;
  293. letter-spacing: 2rpx;
  294. margin-top: 60rpx;
  295. }
  296. .dialog{
  297. position: fixed;
  298. left: 0;
  299. right: 0;
  300. top: 0;
  301. bottom: 0;
  302. background: #252525;
  303. .title{
  304. font-family: FZZCHJW--GB1, FZZCHJW--GB1;
  305. font-weight: normal;
  306. font-size: 36rpx;
  307. color: #FDE2B2;
  308. line-height: 44rpx;
  309. text-align: center;
  310. margin-top: 113rpx;
  311. }
  312. .img{
  313. width: 567rpx;
  314. height: 496rpx;
  315. background: url('https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/29/e8c96426-1d12-47f1-a105-1fb2f6bf3a19.png') no-repeat;
  316. background-size: 100% 100%;
  317. margin-top: 27rpx;
  318. image{
  319. width: 279rpx;
  320. height: 275rpx;
  321. }
  322. }
  323. .name{
  324. margin-top: 18rpx;
  325. image{
  326. width: 53rpx;
  327. height: 67rpx;
  328. }
  329. text{
  330. font-family: FZZCHJW--GB1, FZZCHJW--GB1;
  331. font-weight: normal;
  332. font-size: 64rpx;
  333. color: #FDE2B2;
  334. line-height: 77rpx;
  335. text-align: center;
  336. }
  337. }
  338. .heartnum{
  339. font-family: PingFangSC, PingFang SC;
  340. font-weight: 400;
  341. font-size: 26rpx;
  342. color: #FDE2B2;
  343. line-height: 37rpx;
  344. text-align: center;
  345. margin-top: 13rpx;
  346. }
  347. .date{
  348. font-family: PingFangSC, PingFang SC;
  349. font-weight: 400;
  350. font-size: 26rpx;
  351. color: #B2AB95;
  352. line-height: 37rpx;
  353. text-align: center;
  354. margin-top: 13rpx;
  355. }
  356. .btn{
  357. width: 368rpx;
  358. height: 88rpx;
  359. background: linear-gradient( 270deg, #F8D7AC 0%, #FEFAD9 100%);
  360. border-radius: 44rpx;
  361. margin-top: 89rpx;
  362. image{
  363. width: 30rpx;
  364. height: 25rpx;
  365. }
  366. text{
  367. font-family: PingFang-SC, PingFang-SC;
  368. font-weight: bold;
  369. font-size: 32rpx;
  370. color: #252525;
  371. line-height: 45rpx;
  372. margin-left: 14rpx;
  373. }
  374. }
  375. .close{
  376. width: 48rpx;
  377. height: 48rpx;
  378. margin-top: 73rpx;
  379. }
  380. }
  381. .save{
  382. position: fixed;
  383. left: 0;
  384. right: 0;
  385. bottom: 0;
  386. background: rgba(0, 0, 0, .8);
  387. .box{
  388. width: calc(100% - 128rpx);
  389. padding: 34rpx 36rpx 28rpx;
  390. box-sizing: border-box;
  391. background: url('https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/29/bfdff5f5-e57f-4deb-8359-b12a0a6ee7dd.png') no-repeat;
  392. background-size: 100% 100%;
  393. position: relative;
  394. .close{
  395. width: 48rpx;
  396. height: 48rpx;
  397. position: absolute;
  398. top: 0;
  399. right: 0;
  400. }
  401. .top{
  402. image{
  403. width: 90rpx;
  404. height: 90rpx;
  405. }
  406. text{
  407. font-family: PingFang-SC, PingFang-SC;
  408. font-weight: bold;
  409. font-size: 32rpx;
  410. color: #FAE5B9;
  411. line-height: 45rpx;
  412. margin-left: 18rpx;
  413. }
  414. }
  415. .num{
  416. margin-top: 10rpx;
  417. font-family: PingFangSC, PingFang SC;
  418. font-weight: 400;
  419. font-size: 28rpx;
  420. color: #FFFFFF;
  421. line-height: 40rpx;
  422. text{
  423. font-weight: bold;
  424. font-size: 40rpx;
  425. color: #FAE5B9;
  426. line-height: 56rpx;
  427. }
  428. }
  429. .xzimgs{
  430. margin-top: 48rpx;
  431. width: 100%;
  432. height: 328rpx;
  433. background: #222632;
  434. border-radius: 16rpx;
  435. padding: 0 26rpx;
  436. box-sizing: border-box;
  437. .imgbox{
  438. width: 100%;
  439. height: 111rpx;
  440. .cl_item{
  441. width: 111rpx;
  442. height: 111rpx;
  443. image{
  444. width: 100%;
  445. height: 100%;
  446. }
  447. }
  448. }
  449. }
  450. .bottom{
  451. margin-top: 26rpx;
  452. .left{
  453. .img{
  454. width: 100rpx;
  455. height: 100rpx;
  456. image{
  457. width: 100%;
  458. height: 100%;
  459. }
  460. }
  461. .texts{
  462. margin-left: 24rpx;
  463. text{
  464. font-family: PingFangSC, PingFang SC;
  465. font-weight: 400;
  466. font-size: 20rpx;
  467. color: #FFFFFF;
  468. line-height: 20rpx;
  469. &:last-child{
  470. margin-top: 20rpx;
  471. }
  472. }
  473. }
  474. }
  475. .right{
  476. font-family: kuaikanshijieti;
  477. font-size: 22rpx;
  478. color: #FFFFFF;
  479. line-height: 38rpx;
  480. font-style: italic;
  481. }
  482. }
  483. }
  484. .text{
  485. font-family: PingFangSC, PingFang SC;
  486. font-weight: 400;
  487. font-size: 28rpx;
  488. color: #FFFFFF;
  489. line-height: 40rpx;
  490. text-align: center;
  491. margin-top: 44rpx;
  492. }
  493. }
  494. }
  495. </style>