Index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654
  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">{{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. <text class="unReadCountTips" v-if="noticeUnReadCount">{{noticeUnReadCount}}</text>
  43. </view>
  44. <view class="publicizeBox">
  45. <image class="publicizeBG" :src="publicizeBG"></image>
  46. <view class="publicizeInfoBox" @tap="onPublicizeTo">
  47. <view class="publicizeInfoTitle">通知公告</view>
  48. <view class="publicizeInfo" v-for="(item, index) in publicizeList" @tap.stop="onPublicizeViewTo(item.notificationId)">
  49. <image class="publicizeInfoIcon" src="../static/img/pointsIndex/noticeIcon.png"></image>
  50. <text class="publicizeInfoText">{{item.title}}</text>
  51. <text class="publicizeInfoRight"> > </text>
  52. </view>
  53. <!-- <view class="publicizeInfo">
  54. <image class="publicizeInfoIcon" src="../static/img/pointsIndex/noticeIcon.png"></image>
  55. <text class="publicizeInfoText">积分累计规则变动啦!</text>
  56. <text class="publicizeInfoRight"> > </text>
  57. </view> -->
  58. </view>
  59. <text class="unReadCountTips" v-if="publicizeUnReadCount">{{publicizeUnReadCount}}</text>
  60. </view>
  61. </view>
  62. <view class="pointsRankBox">
  63. <view class="pointsRankTitle">
  64. <image class="pointsRankTitleIcon" src="../static/img/pointsIndex/circle.png"></image>
  65. <text class="pointsRankTitleText">年度排名</text>
  66. <image class="pointsRankTitleIcon" src="../static/img/pointsIndex/circle.png"></image>
  67. </view>
  68. <view class="pointsRankBody">
  69. <view class="rankListHeader">
  70. <text class="rankList_rank">排名</text>
  71. <text class="rankList_tel">联系号码</text>
  72. <text class="rankList_point">累计积分</text>
  73. </view>
  74. <view class="rankList">
  75. <view class="rankListItem" v-if="listData.length > 0" v-for="(item, index) in listData" :class="index == 0 ? 'rankListItem_mine' : ''" >
  76. <image class="rankListItem_rankImg" :src="'../static/img/pointsIndex/rank' + item.rank + '.png'" v-if="[1,2,3].includes(item.rank)"></image>
  77. <text class="rankListItem_rank" v-else>{{item.rank}}</text>
  78. <view class="rankListItem_telBox">
  79. <image class="rankListItem_userImg" :src="item.headUrl" v-if="index == 0" @tap="onSecurityMaxImg(item.isSecurityMax)"></image>
  80. <image class="rankListItem_userImg" :src="item.headUrl" v-else></image>
  81. <text class="rankListItem_tel">{{item.phoneNumber}}</text>
  82. </view>
  83. <text class="rankListItem_point">{{item.points}}</text>
  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. </view>
  92. </view>
  93. <!-- 安全卫士荣誉证书 -->
  94. <view class="popMask" v-if="isPopShow">
  95. <view class="popContent">
  96. <image class="popClose" src="../../static/img/common/close.png" @tap="onSecurityMaxImgCloseTo"></image>
  97. <image class="popImg" :src="certificateBG"></image>
  98. </view>
  99. </view>
  100. </view>
  101. </template>
  102. <script>
  103. var that;
  104. export default {
  105. data() {
  106. return {
  107. isShow: false,
  108. statusBarHeight: 0,
  109. navBarHeight: 0,
  110. bgImg: '../../static/img/home/noneImg.png',
  111. pointShopBG: '/static/logo.png',
  112. noticeBG: '/static/logo.png',
  113. noticeInfoText: '学习安全知识',
  114. noticeUnReadCount: 1,
  115. noticeVideoSrc: 'http://171.94.154.2:50105/hlfs//file/files_indefinitely?id=08dd7e3a-c12b-406a-8bbb-ab9db09f57f2&expires=1744958097&clientid=hotline&signature=BF5AD8DBEF553CDA6FD49AB9FEF1B6900177B1960682E722124EDFB8304556D64CC0040CC8DD796387EF704E8BD673ADE23E4D5CA32498CD',
  116. publicizeBG: '/static/logo.png',
  117. publicizeUnReadCount: 1,
  118. publicizeList: [],
  119. // pointShopBG: '../../static/img/home/noneImg.png',
  120. // noticeBG: '../../static/img/home/noneImg.png',
  121. // publicizeBG: '../../static/img/home/noneImg.png',
  122. userPoints: '0',
  123. listData: [],
  124. isPopShow: false,
  125. certificateBG :'../../static/img/home/noneImg.png'
  126. }
  127. },
  128. onLoad() {
  129. that = this;
  130. that.statusBarHeight = that.$systemInfo.statusBarHeight;
  131. that.navBarHeight = that.$systemInfo.navBarHeight;
  132. that.onGetData(function() {
  133. that.onGetPointData(function() {
  134. that.onGetListData(function() {
  135. that.isShow = true;
  136. });
  137. });
  138. });
  139. },
  140. methods: {
  141. onGetData(fun) {
  142. that.$admin.req({
  143. method: 'GET',
  144. url: '/api/v1/Snapshot/page/setting?PageType=1&Name=Points_Index'
  145. }).then(res => {
  146. if (res && res.length > 0) {
  147. res.forEach(item => {
  148. if (item.tagValue){
  149. that[item.tagName] = that.$admin.config.getfileurl + item.tagValue;
  150. }
  151. })
  152. }
  153. typeof fun === 'function' && fun();
  154. })
  155. },
  156. onGetPointData(fun) {
  157. that.$admin.req({
  158. method: 'GET',
  159. url: '/api/v1/Snapshot/points/total'
  160. }).then(res => {
  161. if (res) {
  162. that.userPoints = res;
  163. }
  164. typeof fun === 'function' && fun();
  165. })
  166. },
  167. onGetListData(fun) {
  168. that.$admin.req({
  169. method: 'GET',
  170. url: '/api/v1/Snapshot/points/rank'
  171. }).then(res => {
  172. that.listData = res.ranks || [];
  173. if (res.videoBulletin){
  174. that.noticeInfoText = res.videoBulletin.title || that.noticeInfoText;
  175. that.noticeUnReadCount = res.videoBulletin.unReadCount || 0;
  176. that.noticeVideoSrc = res.videoBulletin.videoPath ? (that.$admin.config.getfileurl + res.videoBulletin.videoPath) : that.noticeVideoSrc;
  177. console.log(that.noticeVideoSrc)
  178. }
  179. if (res.bulletins){
  180. that.publicizeUnReadCount = res.bulletins.unReadCount || 0;
  181. that.publicizeList = res.bulletins.items;
  182. }
  183. typeof fun === 'function' && fun();
  184. })
  185. },
  186. onDetailTo() {
  187. uni.navigateTo({
  188. url: '/pagesPointsBase/Points/Detail'
  189. })
  190. },
  191. onDescribeTo() {
  192. uni.navigateTo({
  193. url: '/pagesPointsBase/Points/Describe'
  194. })
  195. },
  196. onTapPointShop() {
  197. that.$util.msg("功能即将上线,敬请期待!");
  198. },
  199. onNoticeTo() {
  200. uni.navigateTo({
  201. url: '/pagesPointsBase/Publicize/Index?type=1'
  202. })
  203. },
  204. onPublicizeTo() {
  205. uni.navigateTo({
  206. url: '/pagesPointsBase/Publicize/Index?type=0'
  207. })
  208. },
  209. onPublicizeViewTo(id){
  210. uni.navigateTo({
  211. url: '/pagesPointsBase/Publicize/View?type=0&id=' + encodeURIComponent(id)
  212. })
  213. },
  214. onSecurityMaxImg(isSecurityMax){
  215. if (isSecurityMax){
  216. that.isPopShow = true;
  217. }
  218. },
  219. onSecurityMaxImgCloseTo() {
  220. that.isPopShow = false;
  221. },
  222. // 返回按钮点击事件
  223. onBackTo() {
  224. uni.navigateBack();
  225. },
  226. }
  227. }
  228. </script>
  229. <style lang="less">
  230. .container{
  231. background-color: #f5f5f5;
  232. }
  233. .bgImg {
  234. height: 520rpx;
  235. width: 100%;
  236. position: absolute;
  237. top: 0;
  238. left: 0;
  239. }
  240. .topTitleText {
  241. color: #000;
  242. font-size: 36rpx;
  243. font-weight: bold;
  244. }
  245. .contentBox {
  246. overflow-y: auto;
  247. position: relative;
  248. z-index: 9;
  249. }
  250. .numberBox {
  251. text-align: center;
  252. font-size: 32rpx;
  253. color: #fff;
  254. padding: 50rpx 0 40rpx;
  255. display: flex;
  256. justify-content: center;
  257. flex-wrap: wrap;
  258. }
  259. .userNumber {
  260. width: 100%;
  261. color: #000;
  262. font-size: 64rpx;
  263. font-weight: bold;
  264. vertical-align: text-bottom;
  265. margin-left: 4rpx;
  266. margin-bottom: 20rpx;
  267. }
  268. .userNumberTips {
  269. background-color: #e8ebfc;
  270. border-radius: 50rpx;
  271. text-align: center;
  272. padding: 10rpx 40rpx;
  273. display: flex;
  274. justify-content: space-between;
  275. align-items: center;
  276. }
  277. .userNumberTipsIcon {
  278. width: 40rpx;
  279. height: 40rpx;
  280. margin-right: 20rpx;
  281. }
  282. .userNumberTipsText{
  283. font-weight: bold;
  284. color: #555;
  285. }
  286. .numberBtnBox {
  287. position: absolute;
  288. right: 0;
  289. height: 150rpx;
  290. width: 160rpx;
  291. display: flex;
  292. flex-wrap: wrap;
  293. align-content: space-between;
  294. justify-content: right;
  295. }
  296. .numberBtn{
  297. width: 160rpx;
  298. height: 60rpx;
  299. line-height: 60rpx;
  300. text-align: center;
  301. border-radius: 60rpx 0 0 60rpx;
  302. background: linear-gradient(45deg, #0bbafb, #4285ec);
  303. color: #fff;
  304. }
  305. .moduleBox{
  306. display: flex;
  307. width: calc(100% - 40rpx);
  308. height: 420rpx;
  309. padding: 30rpx 20rpx;
  310. justify-content: space-between;
  311. flex-wrap: wrap;
  312. align-content: space-between;
  313. }
  314. .pointShopBox {
  315. width: 100%;
  316. height: 200rpx;
  317. position: relative;
  318. }
  319. .pointShopBG {
  320. height: 200rpx;
  321. width: 100%;
  322. border-radius: 20rpx;
  323. position: absolute;
  324. top: 0;
  325. left: 0;
  326. }
  327. .pointShopBtn {
  328. background: url(../static/img/pointsIndex/button2.png) no-repeat;
  329. background-size: 100% 100%;
  330. background-attachment: fixed;
  331. color: #fff;
  332. padding: 20rpx 40rpx;
  333. border-radius: 50rpx;
  334. position: absolute;
  335. bottom: 14rpx;
  336. left: 60rpx;
  337. }
  338. .noticeBox {
  339. width: calc(60% - 20rpx);
  340. height: 200rpx;
  341. position: relative;
  342. }
  343. .noticeBG {
  344. height: 200rpx;
  345. width: 100%;
  346. border-radius: 20rpx;
  347. position: absolute;
  348. top: 0;
  349. left: 0;
  350. z-index: -1;
  351. }
  352. .noticeInfoBox {
  353. display: flex;
  354. justify-content: space-evenly;
  355. align-items: center;
  356. width: 100%;
  357. height: 100%;
  358. }
  359. .noticeInfoTitle {
  360. width: 100%;
  361. color: #000;
  362. font-size: 36rpx;
  363. font-weight: bold;
  364. margin-bottom: 20rpx;
  365. text-align: center;
  366. }
  367. .noticeInfoText {
  368. width: 100%;
  369. color: #596bbd;
  370. margin-bottom: 20rpx;
  371. text-align: center;
  372. overflow: hidden;
  373. text-overflow: ellipsis;
  374. white-space: nowrap;
  375. }
  376. .noticeInfoBtn {
  377. background: url(../static/img/pointsIndex/button1.png) no-repeat;
  378. background-size: 100% 100%;
  379. background-attachment: fixed;
  380. color: #000;
  381. padding: 10rpx 0;
  382. border-radius: 50rpx;
  383. text-align: center;
  384. }
  385. .noticeInfoVedio {
  386. width: 160rpx;
  387. height: 160rpx;
  388. }
  389. .publicizeBox {
  390. width: 40%;
  391. height: 200rpx;
  392. position: relative;
  393. }
  394. .publicizeBG {
  395. height: 200rpx;
  396. width: 100%;
  397. border-radius: 20rpx;
  398. position: absolute;
  399. top: 0;
  400. left: 0;
  401. z-index: -1;
  402. }
  403. .publicizeInfoBox{
  404. width: calc(100% - 40rpx);
  405. height: 100%;
  406. padding: 0 20rpx;
  407. display: flex;
  408. flex-wrap: wrap;
  409. justify-content: left;
  410. align-content: space-evenly;
  411. }
  412. .publicizeInfoTitle {
  413. width: 100%;
  414. font-size: 36rpx;
  415. font-weight: bold;
  416. }
  417. .publicizeInfo {
  418. width: 100%;
  419. display: flex;
  420. justify-content: space-between;
  421. align-items: center;
  422. }
  423. .publicizeInfoIcon {
  424. width: 40rpx;
  425. height: 40rpx;
  426. margin-right: 10rpx;
  427. }
  428. .publicizeInfoText {
  429. width: calc(100% - 80rpx);
  430. overflow: hidden;
  431. white-space: nowrap;
  432. text-overflow: ellipsis;
  433. color: #333;
  434. }
  435. .publicizeInfoRight {
  436. width: 30rpx;
  437. height: 30rpx;
  438. line-height: 30rpx;
  439. text-align: center;
  440. font-size: 36rpx;
  441. font-weight: bold;
  442. }
  443. .unReadCountTips{
  444. position: absolute;
  445. text-align: center;
  446. top: -10rpx;
  447. right: -10rpx;
  448. width: 40rpx;
  449. height: 40rpx;
  450. line-height: 40rpx;
  451. border-radius: 50%;
  452. background-color: #d9001a;
  453. color: #fff;
  454. }
  455. .pointsRankBox {
  456. background-color: #fff;
  457. margin: 0 20rpx;
  458. border-radius: 30rpx;
  459. }
  460. .pointsRankTitle {
  461. display: flex;
  462. justify-content: center;
  463. align-items: center;
  464. height: 100rpx;
  465. }
  466. .pointsRankTitleIcon {
  467. width: 20rpx;
  468. height: 20rpx;
  469. }
  470. .pointsRankTitleText {
  471. padding: 0 20rpx;
  472. font-size: 40rpx;
  473. font-weight: bold;
  474. color: #478dff;
  475. }
  476. .pointsRankBody {
  477. padding: 0 30rpx 20rpx;
  478. margin-bottom: 20rpx;
  479. }
  480. .rankListHeader {
  481. display: flex;
  482. justify-content: space-between;
  483. font-size: 32rpx;
  484. color: #333;
  485. padding: 20rpx 0 30rpx;
  486. text-align: center;
  487. }
  488. .rankList_rank {
  489. width: 120rpx;
  490. }
  491. .rankList_tel {}
  492. .rankList_point {
  493. }
  494. .rankList {}
  495. .rankListItem {
  496. display: flex;
  497. justify-content: space-between;
  498. align-items: center;
  499. font-size: 32rpx;
  500. font-weight: bold;
  501. text-align: center;
  502. color: #000;
  503. height: 120rpx;
  504. border-bottom: 2rpx #e5ecff solid;
  505. }
  506. .rankListItem_mine {
  507. border-bottom: none;
  508. border: 2rpx #e5ecff solid;
  509. border-radius: 100rpx;
  510. position: relative;
  511. }
  512. .rankListItem_mine::after{
  513. content: "本人";
  514. padding: 10rpx 40rpx;
  515. position: absolute;
  516. top: -10rpx;
  517. right: 0;
  518. background-color: #639dff;
  519. border-radius: 50rpx;
  520. color: #fff;
  521. font-size: 24rpx;
  522. }
  523. .rankListItem_rankImg {
  524. width: 60rpx;
  525. height: 60rpx;
  526. padding: 0 20rpx;
  527. }
  528. .rankListItem_rank {
  529. width: 100rpx;
  530. }
  531. .rankListItem_telBox{
  532. display: flex;
  533. justify-content: center;
  534. align-items: center;
  535. }
  536. .rankListItem_userImg {
  537. width: 80rpx;
  538. height: 80rpx;
  539. margin-right: 20rpx;
  540. }
  541. .rankListItem_tel {}
  542. .rankListItem_point{
  543. width: 120rpx;
  544. color: #fe0000;
  545. }
  546. .noneBox {
  547. background-color: #fff;
  548. border-radius: 50rpx 50rpx 0 0;
  549. padding: 50rpx 20rpx;
  550. text-align: center;
  551. }
  552. .noneImg {
  553. width: 200rpx;
  554. height: 200rpx;
  555. }
  556. .noneTips {
  557. font-size: 26rpx;
  558. color: #aaaaaa;
  559. text-align: center;
  560. margin-top: 10rpx;
  561. }
  562. /* 自定提示弹窗 */
  563. .popMask {
  564. position: fixed;
  565. left: 0;
  566. top: 0;
  567. right: 0;
  568. bottom: 0;
  569. /* #ifndef APP-NVUE */
  570. display: flex;
  571. /* #endif */
  572. justify-content: center;
  573. align-items: center;
  574. background-color: rgba(0, 0, 0, 1);
  575. line-height: 1 !important;
  576. z-index: 99;
  577. }
  578. .popContent {
  579. width: 100%;
  580. height: 70%;
  581. line-height: 1 !important;
  582. position: relative;
  583. }
  584. .popImg {
  585. width: 100%;
  586. height: 100%;
  587. border-radius: 0 0 30rpx 30rpx;
  588. }
  589. .popClose {
  590. width: 40rpx;
  591. height: 40rpx;
  592. position: absolute;
  593. top: -80rpx;
  594. left: 20rpx;
  595. }
  596. </style>