Index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  1. <template>
  2. <view class="container" v-show="isShow">
  3. <image class="bgImg" :src="bgImg"></image>
  4. <view class="headerBox">
  5. <view class="osNavigationBar" :style="{height: statusBarHeight + 'px'}"></view>
  6. <view class="viewTopTitle" :style="{height: navBarHeight + 'px', 'line-height': navBarHeight + 'px'}">
  7. <view class="topTitleBackButton" @tap="onBackTo" :style="{top: (navBarHeight - 20) / 2 + 'px'}">
  8. <image class="topTitleBackButtonImg" src="/static/img/common/back_black.png"></image>
  9. </view>
  10. <text class="topTitleText">积分荣誉榜</text>
  11. </view>
  12. </view>
  13. <view class="contentBox" :style="{height: 'calc(100% - ' + (statusBarHeight + navBarHeight) + 'px)'}">
  14. <view class="numberBox">
  15. <view class="userNumber">{{userPoints}}</view>
  16. <view class="userNumberTips">
  17. <image class="userNumberTipsIcon" src="../static/img/pointsIndex/goldCoin.png"></image>
  18. <text class="userNumberTipsText">当前可用积分</text>
  19. </view>
  20. <view class="numberBtnBox">
  21. <view class="numberBtn" @tap="onDetailTo">积分详情</view>
  22. <view class="numberBtn" @tap="onDescribeTo">积分说明</view>
  23. </view>
  24. </view>
  25. <view class="moduleBox">
  26. <view class="pointShopBox">
  27. <image class="pointShopBG" :src="pointShopBG"></image>
  28. <view class="pointShopBtn" @tap="onTapPointShop">我要兑换</view>
  29. </view>
  30. <view class="noticeBox">
  31. <image class="noticeBG" :src="noticeBG"></image>
  32. <view class="noticeInfoBox">
  33. <view class="noticeInfo">
  34. <view class="noticeInfoTitle">宣传视频</view>
  35. <view class="noticeInfoText">学习安全知识</view>
  36. <view class="noticeInfoBtn" @tap="onNoticeTo">点击学习</view>
  37. </view>
  38. <view class="noticeInfoVedioBox">
  39. <video class="noticeInfoVedio" src="https://www.bilibili.com/video/BV1MD4y1s7Yr/?spm_id_from=333.337.search-card.all.click&vd_source=c43d610aba47c5411d57d16a5dd7edd2"></video>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="publicizeBox">
  44. <image class="publicizeBG" :src="publicizeBG"></image>
  45. <view class="publicizeInfoBox" @tap="onPublicizeTo">
  46. <view class="publicizeInfoTitle">通知公告</view>
  47. <view class="publicizeInfo">
  48. <image class="publicizeInfoIcon" src="../static/img/pointsIndex/noticeIcon.png"></image>
  49. <text class="publicizeInfoText">积分累计规则变动啦!</text>
  50. <text class="publicizeInfoRight"> > </text>
  51. </view>
  52. <view class="publicizeInfo">
  53. <image class="publicizeInfoIcon" src="../static/img/pointsIndex/noticeIcon.png"></image>
  54. <text class="publicizeInfoText">积分累计规则变动啦!</text>
  55. <text class="publicizeInfoRight"> > </text>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. <view class="pointsRankBox">
  61. <view class="pointsRankTitle">
  62. <image class="pointsRankTitleIcon" src="../static/img/pointsIndex/circle.png"></image>
  63. <text class="pointsRankTitleText">年度排名</text>
  64. <image class="pointsRankTitleIcon" src="../static/img/pointsIndex/circle.png"></image>
  65. </view>
  66. <view class="pointsRankBody">
  67. <view class="rankListHeader">
  68. <text class="rankList_rank">排名</text>
  69. <text class="rankList_tel">联系号码</text>
  70. <text class="rankList_point">累计积分</text>
  71. </view>
  72. <view class="rankList">
  73. <view class="rankListItem" v-for="(item, index) in listData" :class="index == 0 ? 'rankListItem_mine' : ''" >
  74. <image class="rankListItem_rankImg" :src="'../static/img/pointsIndex/rank' + item.rank + '.png'" v-if="[1,2,3].includes(item.rank)"></image>
  75. <text class="rankListItem_rank" v-else>{{item.rank}}</text>
  76. <view class="rankListItem_telBox">
  77. <image class="rankListItem_userImg" :src="item.headUrl"></image>
  78. <text class="rankListItem_tel">{{item.phoneNumber}}</text>
  79. </view>
  80. <text class="rankListItem_point">{{item.points}}</text>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. <!-- <view class="noneBox" v-else>
  86. <image class="noneImg" src="../../static/img/home/noneImg.png"></image>
  87. <view class="noneTips">暂无数据</view>
  88. </view> -->
  89. </view>
  90. </view>
  91. </template>
  92. <script>
  93. var that;
  94. export default {
  95. data() {
  96. return {
  97. isShow: false,
  98. statusBarHeight: 0,
  99. navBarHeight: 0,
  100. bgImg: '../../static/img/home/noneImg.png',
  101. pointShopBG: '/static/logo.png',
  102. noticeBG: '/static/logo.png',
  103. publicizeBG: '/static/logo.png',
  104. // pointShopBG: '../../static/img/home/noneImg.png',
  105. // noticeBG: '../../static/img/home/noneImg.png',
  106. // publicizeBG: '../../static/img/home/noneImg.png',
  107. userPoints: '0',
  108. listData: []
  109. }
  110. },
  111. onLoad() {
  112. that = this;
  113. that.statusBarHeight = that.$systemInfo.statusBarHeight;
  114. that.navBarHeight = that.$systemInfo.navBarHeight;
  115. that.onGetData(function() {
  116. that.onGetPointData(function() {
  117. that.onGetListData(function() {
  118. that.isShow = true;
  119. });
  120. });
  121. });
  122. },
  123. methods: {
  124. onGetData(fun) {
  125. that.$admin.req({
  126. method: 'GET',
  127. url: '/api/v1/Snapshot/page/setting?PageType=1&Name=Points_Index'
  128. }).then(res => {
  129. if (res && res.length > 0) {
  130. res.forEach(item => {
  131. if (item.tagValue){
  132. that[item.tagName] = that.$admin.config.getfileurl + item.tagValue;
  133. }
  134. })
  135. }
  136. typeof fun === 'function' && fun();
  137. })
  138. },
  139. onGetPointData(fun) {
  140. that.$admin.req({
  141. method: 'GET',
  142. url: '/api/v1/Snapshot/points/total'
  143. }).then(res => {
  144. if (res) {
  145. that.userPoints = res;
  146. }
  147. typeof fun === 'function' && fun();
  148. })
  149. },
  150. onGetListData(fun) {
  151. that.$admin.req({
  152. method: 'GET',
  153. url: '/api/v1/Snapshot/points/rank'
  154. }).then(res => {
  155. that.listData = res.ranks || [];
  156. // that.listData = [
  157. // {citizenId: "08dd6c0d-e843-49bd-8965-9f97a4aa3df7", isSecurityMax: false, phoneNumber: "159****8027", points: 41, rank: 32, userName: null},
  158. // {citizenId: "08dd6c0d-e843-49bd-8965-9f97a4aa3df7", isSecurityMax: false, phoneNumber: "159****8027", points: 41, rank: 1, userName: null},
  159. // {citizenId: "08dd6c0d-e843-49bd-8965-9f97a4aa3df7", isSecurityMax: false, phoneNumber: "159****8027", points: 41, rank: 2, userName: null},
  160. // {citizenId: "08dd6c0d-e843-49bd-8965-9f97a4aa3df7", isSecurityMax: false, phoneNumber: "159****8027", points: 41, rank: 3, userName: null},
  161. // {citizenId: "08dd6c0d-e843-49bd-8965-9f97a4aa3df7", isSecurityMax: false, phoneNumber: "159****8027", points: 41, rank: 4, userName: null},
  162. // {citizenId: "08dd6c0d-e843-49bd-8965-9f97a4aa3df7", isSecurityMax: false, phoneNumber: "159****8027", points: 41, rank: 5, userName: null},
  163. // {citizenId: "08dd6c0d-e843-49bd-8965-9f97a4aa3df7", isSecurityMax: false, phoneNumber: "159****8027", points: 41, rank: 6, userName: null},
  164. // {citizenId: "08dd6c0d-e843-49bd-8965-9f97a4aa3df7", isSecurityMax: false, phoneNumber: "159****8027", points: 41, rank: 7, userName: null},
  165. // {citizenId: "08dd6c0d-e843-49bd-8965-9f97a4aa3df7", isSecurityMax: false, phoneNumber: "159****8027", points: 41, rank: 8, userName: null},
  166. // {citizenId: "08dd6c0d-e843-49bd-8965-9f97a4aa3df7", isSecurityMax: false, phoneNumber: "159****8027", points: 41, rank: 9, userName: null},
  167. // {citizenId: "08dd6c0d-e843-49bd-8965-9f97a4aa3df7", isSecurityMax: false, phoneNumber: "159****8027", points: 41, rank: 10, userName: null}
  168. // ];
  169. typeof fun === 'function' && fun();
  170. })
  171. },
  172. onDetailTo() {
  173. that.$util.msg("功能即将上线,敬请期待!");
  174. },
  175. onDescribeTo() {
  176. that.$util.msg("功能即将上线,敬请期待!");
  177. },
  178. onTapPointShop() {
  179. that.$util.msg("功能即将上线,敬请期待!");
  180. },
  181. onNoticeTo() {
  182. that.$util.msg("功能即将上线,敬请期待!");
  183. },
  184. onPublicizeTo() {
  185. that.$util.msg("功能即将上线,敬请期待!");
  186. },
  187. // 返回按钮点击事件
  188. onBackTo() {
  189. uni.navigateBack();
  190. },
  191. }
  192. }
  193. </script>
  194. <style lang="less">
  195. .container{
  196. background-color: #f5f5f5;
  197. }
  198. .bgImg {
  199. height: 520rpx;
  200. width: 100%;
  201. position: absolute;
  202. top: 0;
  203. left: 0;
  204. }
  205. .topTitleText {
  206. color: #000;
  207. font-size: 36rpx;
  208. font-weight: bold;
  209. }
  210. .contentBox {
  211. overflow-y: auto;
  212. position: relative;
  213. z-index: 9;
  214. }
  215. .numberBox {
  216. text-align: center;
  217. font-size: 32rpx;
  218. color: #fff;
  219. padding: 50rpx 0 40rpx;
  220. display: flex;
  221. justify-content: center;
  222. flex-wrap: wrap;
  223. }
  224. .userNumber {
  225. width: 100%;
  226. color: #000;
  227. font-size: 64rpx;
  228. font-weight: bold;
  229. vertical-align: text-bottom;
  230. margin-left: 4rpx;
  231. margin-bottom: 20rpx;
  232. }
  233. .userNumberTips {
  234. background-color: #e8ebfc;
  235. border-radius: 50rpx;
  236. text-align: center;
  237. padding: 10rpx 40rpx;
  238. display: flex;
  239. justify-content: space-between;
  240. align-items: center;
  241. }
  242. .userNumberTipsIcon {
  243. width: 40rpx;
  244. height: 40rpx;
  245. margin-right: 20rpx;
  246. }
  247. .userNumberTipsText{
  248. font-weight: bold;
  249. color: #555;
  250. }
  251. .numberBtnBox {
  252. position: absolute;
  253. right: 0;
  254. height: 150rpx;
  255. width: 160rpx;
  256. display: flex;
  257. flex-wrap: wrap;
  258. align-content: space-between;
  259. justify-content: right;
  260. }
  261. .numberBtn{
  262. width: 160rpx;
  263. height: 60rpx;
  264. line-height: 60rpx;
  265. text-align: center;
  266. border-radius: 60rpx 0 0 60rpx;
  267. background: linear-gradient(45deg, #0bbafb, #4285ec);
  268. color: #fff;
  269. }
  270. .moduleBox{
  271. display: flex;
  272. width: calc(100% - 40rpx);
  273. height: 420rpx;
  274. padding: 30rpx 20rpx;
  275. justify-content: space-between;
  276. flex-wrap: wrap;
  277. align-content: space-between;
  278. }
  279. .pointShopBox {
  280. width: 100%;
  281. height: 200rpx;
  282. position: relative;
  283. }
  284. .pointShopBG {
  285. height: 200rpx;
  286. width: 100%;
  287. border-radius: 20rpx;
  288. position: absolute;
  289. top: 0;
  290. left: 0;
  291. }
  292. .pointShopBtn {
  293. background: url(../static/img/pointsIndex/button2.png) no-repeat;
  294. background-size: 100% 100%;
  295. background-attachment: fixed;
  296. color: #fff;
  297. padding: 20rpx 40rpx;
  298. border-radius: 50rpx;
  299. position: absolute;
  300. bottom: 14rpx;
  301. left: 60rpx;
  302. }
  303. .noticeBox {
  304. width: calc(60% - 20rpx);
  305. height: 200rpx;
  306. position: relative;
  307. }
  308. .noticeBG {
  309. height: 200rpx;
  310. width: 100%;
  311. border-radius: 20rpx;
  312. position: absolute;
  313. top: 0;
  314. left: 0;
  315. z-index: -1;
  316. }
  317. .noticeInfoBox {
  318. display: flex;
  319. justify-content: space-evenly;
  320. align-items: center;
  321. width: 100%;
  322. height: 100%;
  323. }
  324. .noticeInfoTitle {
  325. width: 100%;
  326. color: #000;
  327. font-size: 36rpx;
  328. font-weight: bold;
  329. margin-bottom: 20rpx;
  330. text-align: center;
  331. }
  332. .noticeInfoText {
  333. width: 100%;
  334. color: #596bbd;
  335. margin-bottom: 20rpx;
  336. text-align: center;
  337. }
  338. .noticeInfoBtn {
  339. background: url(../static/img/pointsIndex/button1.png) no-repeat;
  340. background-size: 100% 100%;
  341. background-attachment: fixed;
  342. color: #000;
  343. padding: 10rpx 0;
  344. border-radius: 50rpx;
  345. text-align: center;
  346. }
  347. .noticeInfoVedio {
  348. width: 160rpx;
  349. height: 160rpx;
  350. }
  351. .publicizeBox {
  352. width: 40%;
  353. height: 200rpx;
  354. position: relative;
  355. }
  356. .publicizeBG {
  357. height: 200rpx;
  358. width: 100%;
  359. border-radius: 20rpx;
  360. position: absolute;
  361. top: 0;
  362. left: 0;
  363. z-index: -1;
  364. }
  365. .publicizeInfoBox{
  366. width: calc(100% - 40rpx);
  367. height: 100%;
  368. padding: 0 20rpx;
  369. display: flex;
  370. flex-wrap: wrap;
  371. justify-content: left;
  372. align-content: space-evenly;
  373. }
  374. .publicizeInfoTitle {
  375. width: 100%;
  376. font-size: 36rpx;
  377. font-weight: bold;
  378. }
  379. .publicizeInfo {
  380. width: 100%;
  381. display: flex;
  382. justify-content: space-between;
  383. align-items: center;
  384. }
  385. .publicizeInfoIcon {
  386. width: 40rpx;
  387. height: 40rpx;
  388. margin-right: 10rpx;
  389. }
  390. .publicizeInfoText {
  391. width: calc(100% - 80rpx);
  392. overflow: hidden;
  393. white-space: nowrap;
  394. text-overflow: ellipsis;
  395. color: #333;
  396. }
  397. .publicizeInfoRight {
  398. width: 30rpx;
  399. height: 30rpx;
  400. line-height: 30rpx;
  401. text-align: center;
  402. font-size: 36rpx;
  403. font-weight: bold;
  404. }
  405. .pointsRankBox {
  406. background-color: #fff;
  407. margin: 0 20rpx;
  408. border-radius: 30rpx;
  409. }
  410. .pointsRankTitle {
  411. display: flex;
  412. justify-content: center;
  413. align-items: center;
  414. height: 100rpx;
  415. }
  416. .pointsRankTitleIcon {
  417. width: 20rpx;
  418. height: 20rpx;
  419. }
  420. .pointsRankTitleText {
  421. padding: 0 20rpx;
  422. font-size: 40rpx;
  423. font-weight: bold;
  424. color: #478dff;
  425. }
  426. .pointsRankBody {
  427. padding: 0 30rpx 20rpx;
  428. margin-bottom: 20rpx;
  429. }
  430. .rankListHeader {
  431. display: flex;
  432. justify-content: space-between;
  433. font-size: 32rpx;
  434. color: #333;
  435. padding: 20rpx 0 30rpx;
  436. text-align: center;
  437. }
  438. .rankList_rank {
  439. width: 120rpx;
  440. }
  441. .rankList_tel {}
  442. .rankList_point {
  443. }
  444. .rankList {}
  445. .rankListItem {
  446. display: flex;
  447. justify-content: space-between;
  448. align-items: center;
  449. font-size: 32rpx;
  450. font-weight: bold;
  451. text-align: center;
  452. color: #000;
  453. height: 120rpx;
  454. border-bottom: 2rpx #e5ecff solid;
  455. }
  456. .rankListItem_mine {
  457. border-bottom: none;
  458. border: 2rpx #e5ecff solid;
  459. border-radius: 100rpx;
  460. position: relative;
  461. }
  462. .rankListItem_mine::after{
  463. content: "本人";
  464. padding: 10rpx 40rpx;
  465. position: absolute;
  466. top: -10rpx;
  467. right: 0;
  468. background-color: #639dff;
  469. border-radius: 50rpx;
  470. color: #fff;
  471. font-size: 24rpx;
  472. }
  473. .rankListItem_rankImg {
  474. width: 60rpx;
  475. height: 60rpx;
  476. padding: 0 20rpx;
  477. }
  478. .rankListItem_rank {
  479. width: 100rpx;
  480. }
  481. .rankListItem_telBox{
  482. display: flex;
  483. justify-content: center;
  484. align-items: center;
  485. }
  486. .rankListItem_userImg {
  487. width: 80rpx;
  488. height: 80rpx;
  489. margin-right: 20rpx;
  490. }
  491. .rankListItem_tel {}
  492. .rankListItem_point{
  493. width: 120rpx;
  494. color: #fe0000;
  495. }
  496. // .noneBox {
  497. // background-color: #fff;
  498. // border-radius: 50rpx 50rpx 0 0;
  499. // padding: 50rpx 20rpx;
  500. // text-align: center;
  501. // }
  502. // .noneImg {
  503. // width: 200rpx;
  504. // height: 200rpx;
  505. // }
  506. // .noneTips {
  507. // font-size: 26rpx;
  508. // color: #aaaaaa;
  509. // text-align: center;
  510. // margin-top: 10rpx;
  511. // }
  512. </style>