Index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  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="noticeVideoSrc"></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-if="listData.length > 0" 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 class="noneBox" v-else>
  83. <image class="noneImg" src="../../static/img/home/noneImg.png"></image>
  84. <view class="noneTips">暂无数据</view>
  85. </view>
  86. </view>
  87. </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. noticeVideoSrc: 'http://171.94.154.2:50105/hlfs//file/files_indefinitely?id=08dd7e3a-c12b-406a-8bbb-ab9db09f57f2&expires=1744958097&clientid=hotline&signature=BF5AD8DBEF553CDA6FD49AB9FEF1B6900177B1960682E722124EDFB8304556D64CC0040CC8DD796387EF704E8BD673ADE23E4D5CA32498CD',
  104. publicizeBG: '/static/logo.png',
  105. // pointShopBG: '../../static/img/home/noneImg.png',
  106. // noticeBG: '../../static/img/home/noneImg.png',
  107. // publicizeBG: '../../static/img/home/noneImg.png',
  108. userPoints: '0',
  109. listData: []
  110. }
  111. },
  112. onLoad() {
  113. that = this;
  114. that.statusBarHeight = that.$systemInfo.statusBarHeight;
  115. that.navBarHeight = that.$systemInfo.navBarHeight;
  116. that.onGetData(function() {
  117. that.onGetPointData(function() {
  118. that.onGetListData(function() {
  119. that.isShow = true;
  120. });
  121. });
  122. });
  123. },
  124. methods: {
  125. onGetData(fun) {
  126. that.$admin.req({
  127. method: 'GET',
  128. url: '/api/v1/Snapshot/page/setting?PageType=1&Name=Points_Index'
  129. }).then(res => {
  130. if (res && res.length > 0) {
  131. res.forEach(item => {
  132. if (item.tagValue){
  133. that[item.tagName] = that.$admin.config.getfileurl + item.tagValue;
  134. }
  135. })
  136. }
  137. typeof fun === 'function' && fun();
  138. })
  139. },
  140. onGetPointData(fun) {
  141. that.$admin.req({
  142. method: 'GET',
  143. url: '/api/v1/Snapshot/points/total'
  144. }).then(res => {
  145. if (res) {
  146. that.userPoints = res;
  147. }
  148. typeof fun === 'function' && fun();
  149. })
  150. },
  151. onGetListData(fun) {
  152. that.$admin.req({
  153. method: 'GET',
  154. url: '/api/v1/Snapshot/points/rank'
  155. }).then(res => {
  156. that.listData = res.ranks || [];
  157. // that.listData = [
  158. // {citizenId: "08dd6c0d-e843-49bd-8965-9f97a4aa3df7", isSecurityMax: false, phoneNumber: "159****8027", points: 41, rank: 32, userName: null},
  159. // {citizenId: "08dd6c0d-e843-49bd-8965-9f97a4aa3df7", isSecurityMax: false, phoneNumber: "159****8027", points: 41, rank: 1, userName: null},
  160. // {citizenId: "08dd6c0d-e843-49bd-8965-9f97a4aa3df7", isSecurityMax: false, phoneNumber: "159****8027", points: 41, rank: 2, userName: null},
  161. // {citizenId: "08dd6c0d-e843-49bd-8965-9f97a4aa3df7", isSecurityMax: false, phoneNumber: "159****8027", points: 41, rank: 3, userName: null},
  162. // {citizenId: "08dd6c0d-e843-49bd-8965-9f97a4aa3df7", isSecurityMax: false, phoneNumber: "159****8027", points: 41, rank: 4, userName: null},
  163. // {citizenId: "08dd6c0d-e843-49bd-8965-9f97a4aa3df7", isSecurityMax: false, phoneNumber: "159****8027", points: 41, rank: 5, userName: null},
  164. // {citizenId: "08dd6c0d-e843-49bd-8965-9f97a4aa3df7", isSecurityMax: false, phoneNumber: "159****8027", points: 41, rank: 6, userName: null},
  165. // {citizenId: "08dd6c0d-e843-49bd-8965-9f97a4aa3df7", isSecurityMax: false, phoneNumber: "159****8027", points: 41, rank: 7, userName: null},
  166. // {citizenId: "08dd6c0d-e843-49bd-8965-9f97a4aa3df7", isSecurityMax: false, phoneNumber: "159****8027", points: 41, rank: 8, userName: null},
  167. // {citizenId: "08dd6c0d-e843-49bd-8965-9f97a4aa3df7", isSecurityMax: false, phoneNumber: "159****8027", points: 41, rank: 9, userName: null},
  168. // {citizenId: "08dd6c0d-e843-49bd-8965-9f97a4aa3df7", isSecurityMax: false, phoneNumber: "159****8027", points: 41, rank: 10, userName: null}
  169. // ];
  170. typeof fun === 'function' && fun();
  171. })
  172. },
  173. onDetailTo() {
  174. uni.navigateTo({
  175. url: '/pagesPointsBase/Points/Detail'
  176. })
  177. },
  178. onDescribeTo() {
  179. uni.navigateTo({
  180. url: '/pagesPointsBase/Points/Describe'
  181. })
  182. },
  183. onTapPointShop() {
  184. that.$util.msg("功能即将上线,敬请期待!");
  185. },
  186. onNoticeTo() {
  187. that.$util.msg("功能即将上线,敬请期待!");
  188. },
  189. onPublicizeTo() {
  190. uni.navigateTo({
  191. url: '/pagesPointsBase/Points/Publicize'
  192. })
  193. },
  194. // 返回按钮点击事件
  195. onBackTo() {
  196. uni.navigateBack();
  197. },
  198. }
  199. }
  200. </script>
  201. <style lang="less">
  202. .container{
  203. background-color: #f5f5f5;
  204. }
  205. .bgImg {
  206. height: 520rpx;
  207. width: 100%;
  208. position: absolute;
  209. top: 0;
  210. left: 0;
  211. }
  212. .topTitleText {
  213. color: #000;
  214. font-size: 36rpx;
  215. font-weight: bold;
  216. }
  217. .contentBox {
  218. overflow-y: auto;
  219. position: relative;
  220. z-index: 9;
  221. }
  222. .numberBox {
  223. text-align: center;
  224. font-size: 32rpx;
  225. color: #fff;
  226. padding: 50rpx 0 40rpx;
  227. display: flex;
  228. justify-content: center;
  229. flex-wrap: wrap;
  230. }
  231. .userNumber {
  232. width: 100%;
  233. color: #000;
  234. font-size: 64rpx;
  235. font-weight: bold;
  236. vertical-align: text-bottom;
  237. margin-left: 4rpx;
  238. margin-bottom: 20rpx;
  239. }
  240. .userNumberTips {
  241. background-color: #e8ebfc;
  242. border-radius: 50rpx;
  243. text-align: center;
  244. padding: 10rpx 40rpx;
  245. display: flex;
  246. justify-content: space-between;
  247. align-items: center;
  248. }
  249. .userNumberTipsIcon {
  250. width: 40rpx;
  251. height: 40rpx;
  252. margin-right: 20rpx;
  253. }
  254. .userNumberTipsText{
  255. font-weight: bold;
  256. color: #555;
  257. }
  258. .numberBtnBox {
  259. position: absolute;
  260. right: 0;
  261. height: 150rpx;
  262. width: 160rpx;
  263. display: flex;
  264. flex-wrap: wrap;
  265. align-content: space-between;
  266. justify-content: right;
  267. }
  268. .numberBtn{
  269. width: 160rpx;
  270. height: 60rpx;
  271. line-height: 60rpx;
  272. text-align: center;
  273. border-radius: 60rpx 0 0 60rpx;
  274. background: linear-gradient(45deg, #0bbafb, #4285ec);
  275. color: #fff;
  276. }
  277. .moduleBox{
  278. display: flex;
  279. width: calc(100% - 40rpx);
  280. height: 420rpx;
  281. padding: 30rpx 20rpx;
  282. justify-content: space-between;
  283. flex-wrap: wrap;
  284. align-content: space-between;
  285. }
  286. .pointShopBox {
  287. width: 100%;
  288. height: 200rpx;
  289. position: relative;
  290. }
  291. .pointShopBG {
  292. height: 200rpx;
  293. width: 100%;
  294. border-radius: 20rpx;
  295. position: absolute;
  296. top: 0;
  297. left: 0;
  298. }
  299. .pointShopBtn {
  300. background: url(../static/img/pointsIndex/button2.png) no-repeat;
  301. background-size: 100% 100%;
  302. background-attachment: fixed;
  303. color: #fff;
  304. padding: 20rpx 40rpx;
  305. border-radius: 50rpx;
  306. position: absolute;
  307. bottom: 14rpx;
  308. left: 60rpx;
  309. }
  310. .noticeBox {
  311. width: calc(60% - 20rpx);
  312. height: 200rpx;
  313. position: relative;
  314. }
  315. .noticeBG {
  316. height: 200rpx;
  317. width: 100%;
  318. border-radius: 20rpx;
  319. position: absolute;
  320. top: 0;
  321. left: 0;
  322. z-index: -1;
  323. }
  324. .noticeInfoBox {
  325. display: flex;
  326. justify-content: space-evenly;
  327. align-items: center;
  328. width: 100%;
  329. height: 100%;
  330. }
  331. .noticeInfoTitle {
  332. width: 100%;
  333. color: #000;
  334. font-size: 36rpx;
  335. font-weight: bold;
  336. margin-bottom: 20rpx;
  337. text-align: center;
  338. }
  339. .noticeInfoText {
  340. width: 100%;
  341. color: #596bbd;
  342. margin-bottom: 20rpx;
  343. text-align: center;
  344. }
  345. .noticeInfoBtn {
  346. background: url(../static/img/pointsIndex/button1.png) no-repeat;
  347. background-size: 100% 100%;
  348. background-attachment: fixed;
  349. color: #000;
  350. padding: 10rpx 0;
  351. border-radius: 50rpx;
  352. text-align: center;
  353. }
  354. .noticeInfoVedio {
  355. width: 160rpx;
  356. height: 160rpx;
  357. }
  358. .publicizeBox {
  359. width: 40%;
  360. height: 200rpx;
  361. position: relative;
  362. }
  363. .publicizeBG {
  364. height: 200rpx;
  365. width: 100%;
  366. border-radius: 20rpx;
  367. position: absolute;
  368. top: 0;
  369. left: 0;
  370. z-index: -1;
  371. }
  372. .publicizeInfoBox{
  373. width: calc(100% - 40rpx);
  374. height: 100%;
  375. padding: 0 20rpx;
  376. display: flex;
  377. flex-wrap: wrap;
  378. justify-content: left;
  379. align-content: space-evenly;
  380. }
  381. .publicizeInfoTitle {
  382. width: 100%;
  383. font-size: 36rpx;
  384. font-weight: bold;
  385. }
  386. .publicizeInfo {
  387. width: 100%;
  388. display: flex;
  389. justify-content: space-between;
  390. align-items: center;
  391. }
  392. .publicizeInfoIcon {
  393. width: 40rpx;
  394. height: 40rpx;
  395. margin-right: 10rpx;
  396. }
  397. .publicizeInfoText {
  398. width: calc(100% - 80rpx);
  399. overflow: hidden;
  400. white-space: nowrap;
  401. text-overflow: ellipsis;
  402. color: #333;
  403. }
  404. .publicizeInfoRight {
  405. width: 30rpx;
  406. height: 30rpx;
  407. line-height: 30rpx;
  408. text-align: center;
  409. font-size: 36rpx;
  410. font-weight: bold;
  411. }
  412. .pointsRankBox {
  413. background-color: #fff;
  414. margin: 0 20rpx;
  415. border-radius: 30rpx;
  416. }
  417. .pointsRankTitle {
  418. display: flex;
  419. justify-content: center;
  420. align-items: center;
  421. height: 100rpx;
  422. }
  423. .pointsRankTitleIcon {
  424. width: 20rpx;
  425. height: 20rpx;
  426. }
  427. .pointsRankTitleText {
  428. padding: 0 20rpx;
  429. font-size: 40rpx;
  430. font-weight: bold;
  431. color: #478dff;
  432. }
  433. .pointsRankBody {
  434. padding: 0 30rpx 20rpx;
  435. margin-bottom: 20rpx;
  436. }
  437. .rankListHeader {
  438. display: flex;
  439. justify-content: space-between;
  440. font-size: 32rpx;
  441. color: #333;
  442. padding: 20rpx 0 30rpx;
  443. text-align: center;
  444. }
  445. .rankList_rank {
  446. width: 120rpx;
  447. }
  448. .rankList_tel {}
  449. .rankList_point {
  450. }
  451. .rankList {}
  452. .rankListItem {
  453. display: flex;
  454. justify-content: space-between;
  455. align-items: center;
  456. font-size: 32rpx;
  457. font-weight: bold;
  458. text-align: center;
  459. color: #000;
  460. height: 120rpx;
  461. border-bottom: 2rpx #e5ecff solid;
  462. }
  463. .rankListItem_mine {
  464. border-bottom: none;
  465. border: 2rpx #e5ecff solid;
  466. border-radius: 100rpx;
  467. position: relative;
  468. }
  469. .rankListItem_mine::after{
  470. content: "本人";
  471. padding: 10rpx 40rpx;
  472. position: absolute;
  473. top: -10rpx;
  474. right: 0;
  475. background-color: #639dff;
  476. border-radius: 50rpx;
  477. color: #fff;
  478. font-size: 24rpx;
  479. }
  480. .rankListItem_rankImg {
  481. width: 60rpx;
  482. height: 60rpx;
  483. padding: 0 20rpx;
  484. }
  485. .rankListItem_rank {
  486. width: 100rpx;
  487. }
  488. .rankListItem_telBox{
  489. display: flex;
  490. justify-content: center;
  491. align-items: center;
  492. }
  493. .rankListItem_userImg {
  494. width: 80rpx;
  495. height: 80rpx;
  496. margin-right: 20rpx;
  497. }
  498. .rankListItem_tel {}
  499. .rankListItem_point{
  500. width: 120rpx;
  501. color: #fe0000;
  502. }
  503. .noneBox {
  504. background-color: #fff;
  505. border-radius: 50rpx 50rpx 0 0;
  506. padding: 50rpx 20rpx;
  507. text-align: center;
  508. }
  509. .noneImg {
  510. width: 200rpx;
  511. height: 200rpx;
  512. }
  513. .noneTips {
  514. font-size: 26rpx;
  515. color: #aaaaaa;
  516. text-align: center;
  517. margin-top: 10rpx;
  518. }
  519. </style>