actFission.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
  6. <meta name="description" content="活动">
  7. <title>免费领机</title>
  8. <link rel="icon" href="../static/img/favicon2.ico" type="img/x-ico">
  9. <link rel="stylesheet" href="../static/css/index.css?v=1.0.0.6">
  10. <link rel="stylesheet" href="../static/css/vant.css" />
  11. <script src="../static/js/vender/vue/vue.min.js"></script>
  12. <script src="../static/js/vender/vue/vant.min.js"></script>
  13. <script src="../static/js/vender/config.js"></script>
  14. <style>
  15. .container {
  16. background-color: #1F1A3A;
  17. }
  18. .top-banner {
  19. background: url("../static/offImg/bg.png") no-repeat;
  20. width: 100%;
  21. height: 13.1rem;
  22. background-size: 100% 100%;
  23. position: relative;
  24. }
  25. .top-banner .hongbao {
  26. width: 5.24rem;
  27. height: 1.55rem;
  28. position: absolute;
  29. top: 1rem;
  30. left: 50%;
  31. transform: translateX(-50%);
  32. }
  33. .bottom-btn {
  34. position: absolute;
  35. width: 100%;
  36. bottom: 0.32rem;
  37. display: flex;
  38. justify-content: center;
  39. left: 0;
  40. }
  41. .bottom-btn .time-box {
  42. width: 5.34rem;
  43. height: 1.44rem;
  44. background: url("../static/offImg/time.png") no-repeat;
  45. background-size: 100% 100%;
  46. }
  47. .no-start {
  48. width: 5.34rem !important;
  49. height: 1.44rem !important;
  50. background: url("../static/offImg/time-end.png") no-repeat !important;
  51. background-size: 100% 100% !important;
  52. }
  53. .list {
  54. width: 100%;
  55. height: 14.42rem;
  56. background-color: #1F1A3A;
  57. padding: 0 0.3rem;
  58. }
  59. .nav-box {
  60. margin-top: 0.44rem;
  61. width: 100%;
  62. height: 5.7rem;
  63. background: url("../static/offImg/share.png") no-repeat;
  64. background-size: 100% 100%;
  65. border-radius: 0.2rem;
  66. position: relative;
  67. padding-top: 0.01rem;
  68. }
  69. .rule-box {
  70. margin-top: 0.44rem;
  71. width: 100%;
  72. height: 5.7rem;
  73. background: url("../static/offImg/rule.png") no-repeat;
  74. background-size: 100% 100%;
  75. border-radius: 0.2rem;
  76. position: relative;
  77. }
  78. .rule-box .title-box,
  79. .nav-box .title-box {
  80. width: 100%;
  81. position: absolute;
  82. left: 0;
  83. top: -0.17rem;
  84. display: flex;
  85. justify-content: center;
  86. }
  87. /* .rule-box .title-box .img-box,
  88. .nav-box .title-box .img-box {
  89. background: url("../static/offImg/title-bg.png") no-repeat;
  90. background-size: 100% 100%;
  91. width: 3.96rem;
  92. height: 0.64rem;
  93. text-align: center;
  94. line-height: 0.64rem;
  95. font-size: 0.32rem;
  96. font-family: PingFangSC-Medium, PingFang SC;
  97. color: #FFFFFF;
  98. } */
  99. .outer-box {
  100. margin-top: 1rem;
  101. padding: 0.1rem 0.4rem;
  102. overflow-y: scroll;
  103. height: 4.4rem;
  104. }
  105. .list-nav {
  106. display: flex;
  107. margin-bottom: 0.2rem;
  108. justify-content: space-between;
  109. }
  110. .list-nav .user {
  111. display: flex;
  112. }
  113. .list-nav .user .tou {
  114. width: 0.6rem;
  115. height: 0.6rem;
  116. border-radius: 50%;
  117. margin-right: 0.12rem;
  118. }
  119. .list-nav .user .text p:first-of-type {
  120. font-size: 0.24rem;
  121. margin-bottom: 0.08rem;
  122. font-family: PingFangSC-Regular, PingFang SC;
  123. color: #ffffff;
  124. width: 2.6rem;
  125. display: block;
  126. overflow: hidden;
  127. word-break: keep-all;
  128. white-space: nowrap;
  129. text-overflow: ellipsis;
  130. }
  131. .list-nav .user .text p+p {
  132. font-size: 0.24rem;
  133. font-family: PingFangSC-Regular, PingFang SC;
  134. color: #CCCCCC;
  135. }
  136. .right-nav {
  137. display: flex;
  138. align-items: center;
  139. }
  140. .right-nav P:first-of-type {
  141. font-size: 0.24rem;
  142. font-family: PingFangSC-Medium, PingFang SC;
  143. font-weight: 500;
  144. color: #F2AE45;
  145. margin-right: 0.3rem;
  146. }
  147. .right-nav .btn {
  148. width: 1.14rem;
  149. height: 0.44rem;
  150. line-height: 0.44rem;
  151. background: #F2AE45;
  152. border-radius: 0.22rem;
  153. text-align: center;
  154. font-size: 0.24rem;
  155. font-family: PingFangSC-Regular, PingFang SC;
  156. color: #FFFFFF;
  157. }
  158. .rule-box {
  159. margin-top: 0.62rem;
  160. width: 100%;
  161. height: 7.6rem;
  162. padding: 0.3rem 0.4rem;
  163. }
  164. .rule-box .rule {
  165. margin-top: 0.48rem;
  166. font-size: 0.28rem;
  167. font-family: PingFangSC-Regular, PingFang SC;
  168. color: #333333;
  169. line-height: 0.46rem;
  170. letter-spacing: 0.013rem;
  171. }
  172. .rule-box .rule p {
  173. margin-bottom: 0.12rem;
  174. }
  175. .isdisabled {
  176. background: #F2AE45 !important;
  177. color: #ffffff !important;
  178. opacity: 0.3;
  179. }
  180. .notice-swipe {
  181. height: 40px;
  182. line-height: 40px;
  183. }
  184. .top-notice {
  185. width: 100%;
  186. padding: 3rem 0.3rem 0 0.3rem;
  187. height: 0.82rem;
  188. }
  189. .select-content{
  190. position: absolute;
  191. bottom: 0.2rem;
  192. color: #FFFFFF;
  193. left: 50%;
  194. transform: translateX(-50%);
  195. }
  196. .van-notice-bar {
  197. width: 100%;
  198. height: 0.82rem;
  199. background: url("../static/offImg/lunbo.png") no-repeat;
  200. background-size: 100% 100%;
  201. }
  202. .van-swipe-item {
  203. display: flex;
  204. align-items: center;
  205. }
  206. .van-swipe-item p:first-of-type {
  207. font-size: 0.28rem;
  208. width: 1.8rem;
  209. color: #00FFFF;
  210. display: block;
  211. overflow: hidden;
  212. word-break: keep-all;
  213. white-space: nowrap;
  214. text-overflow: ellipsis;
  215. }
  216. .van-swipe-item p+p {
  217. font-size: 0.28rem;
  218. color: #FFFFFF;
  219. }
  220. .van-swipe-item img {
  221. width: 0.6rem;
  222. margin-left: 0.4rem;
  223. margin-right: 0.1rem;
  224. border-radius: 50%;
  225. height: 0.6rem;
  226. }
  227. .no-user {
  228. width: 100%;
  229. height: 100%;
  230. display: flex;
  231. justify-content: center;
  232. align-items: center;
  233. font-size: 0.3rem;
  234. font-family: PingFangSC-Regular, PingFang SC;
  235. color: #666666;
  236. }
  237. .select-list{
  238. display: flex;
  239. justify-content: center;
  240. }
  241. .select-title{
  242. margin-bottom: 0.2rem;
  243. text-align: center;
  244. }
  245. .icon{
  246. width: 1.66rem;
  247. height: 1.66rem;
  248. margin: 0 0.1rem;
  249. }
  250. .join-wrap{
  251. background-color: #1F1A3A;
  252. display: flex;
  253. justify-content: center;
  254. }
  255. .join{
  256. width: 6.8rem;
  257. height: 4.1rem;
  258. }
  259. </style>
  260. </head>
  261. <body>
  262. <div id="app" v-cloak class="app container">
  263. <div class="top-banner">
  264. <!-- <img src="../static/offImg/hongbao.png" class="hongbao" alt=""> -->
  265. <img src="../static/offImg/title.png" class="hongbao" alt="">
  266. <div class="top-notice">
  267. <van-notice-bar :scrollable="false">
  268. <van-swipe vertical class="notice-swipe" :autoplay="2000" :show-indicators="false">
  269. <van-swipe-item v-for="(item,index) in marqueeList">
  270. <!-- <img :src="standarImg(item.headImgUrl)" :onerror="defaultImg" alt=""> -->
  271. <img src="" :onerror="defaultImg" alt="">
  272. <p>{{item.sharerSurfaceName}}</p>
  273. <p>已领取分享奖励</p>
  274. </van-swipe-item>
  275. </van-swipe>
  276. </van-notice-bar>
  277. </div>
  278. <div class="select-content">
  279. <div class="select-title">选择你要分享的内容</div>
  280. <div class="select-list">
  281. <div v-for="(item,index) in tagList" :key="index" @click="toDetail(item)">
  282. <img :src="fileCenterApi + `/file-center/fileOperate/getImage?id=${item.cover}`" class="icon" alt="">
  283. </div>
  284. </div>
  285. </div>
  286. <!-- <div class="bottom-btn">
  287. <div class="time-box" @click='goReward()' :class="{'no-start':actStatus==0}"></div>
  288. </div> -->
  289. </div>
  290. <div class="join-wrap">
  291. <img src="../static/offImg/join.png" class="join" alt="">
  292. </div>
  293. <div class="list">
  294. <div class="nav-box">
  295. <!-- <img src="../static/offImg/title-bg.png" alt=""></img> -->
  296. <!-- <div class="title-box">
  297. <div class="img-box">活动奖励</div>
  298. </div> -->
  299. <div class="outer-box" v-if='rewardList&&rewardList.length>0'>
  300. <van-list v-model="loading" :finished-text="finishedText" :finished="finished"
  301. :immediate-check=false @load="onLoad">
  302. <div class="list-nav" v-for="(item,index) in rewardList" :key="index">
  303. <div class="user">
  304. <img :src="standarImg(item.headImgUrl)" class="tou" :onerror="defaultImg" alt="">
  305. <div class="text">
  306. <p>{{item.surfaceName}}</p>
  307. <p>{{item.registerTime}}</p>
  308. </div>
  309. </div>
  310. <div class="right-nav">
  311. <p>{{item.phoneType === 'VIP'?'星动':item.phoneType === 'SVIP'?'星曜':'唔即'}}天卡</p>
  312. <p class="btn" @click='goGetReward(item.id, item.phoneType)' v-if='item.receiveStatus==0'>领取</p>
  313. <p class="btn isdisabled" v-if='item.receiveStatus==1'>已领取</p>
  314. </div>
  315. </div>
  316. </van-list>
  317. </div>
  318. <div class="no-user" v-if='rewardList.length==0'>
  319. <p>
  320. 暂无用户注册
  321. </p>
  322. </div>
  323. </div>
  324. <div class="rule-box">
  325. <!-- <img src="../static/offImg/title-bg.png" alt=""></img> -->
  326. <!-- <div class="title-box">
  327. <div class="img-box">活动规则</div>
  328. </div> -->
  329. <!-- <div class="rule">
  330. <p>1.分享双子星攻略文章至微信好友/微信朋友圈/QQ,好友注册成功后,分享者即可获得3天{{phoneType === 'VIP'?'星动':phoneType === 'SVIP'?'星曜':'唔即'}}套餐时长,被分享者可获得{{phoneType === 'VIP'?'星动':phoneType === 'SVIP'?'星曜':'唔即'}}7天卡激活码。</p>
  331. <p>2.用户通过该分享链接获取的激活码,只针对新注册用户有效领取并兑换一次。</p>
  332. <p>3.分享者每日最多分享给10位好友领取激活码并获得注册奖励,且奖励为当日有效,奖励过期不补发。</p>
  333. <p>4.分享者若没有云机,需要先创建{{phoneType === 'VIP'?'星动':phoneType === 'SVIP'?'星曜':'唔即'}}云机才可继续领取奖励。</p>
  334. <p>5.新用户领取的激活码需在有效期内使用,若超过有效期则激活码失效。</p>
  335. </div> -->
  336. </div>
  337. </div>
  338. </div>
  339. <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
  340. <script src="../static/js/vender/vue/axios.min.js"></script>
  341. <script src="../static/js/vender/vue/config.js"></script>
  342. <script src="../static/js/vender/vue/api.js"></script>
  343. <script type="text/javascript">
  344. var u = navigator.userAgent,
  345. app = navigator.appVersion;
  346. var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
  347. var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
  348. new Vue({
  349. el: '#app',
  350. data: {
  351. isshow: false,
  352. rewardList: [],
  353. queryParams: {
  354. pageNum: 1,
  355. pageSize: 10
  356. },
  357. isDisable: false,
  358. finished: false,
  359. flag: true,
  360. loading: false,
  361. finishedText: '',
  362. offset: 100,
  363. total: 0,
  364. shareInfo: {},
  365. defaultImg: 'this.src="' + "../static/offImg/tou.png" + '"',
  366. actStatus: 0, //0活动状态 1开始
  367. phoneType: '',
  368. marqueeList: [],
  369. timer: null,
  370. tagList: []
  371. },
  372. created() {
  373. this.getAwardPage(); //获取奖励列表
  374. },
  375. mounted() {
  376. this.getActDetailList(); //获取活动上下架
  377. this.getMarquee(); //跑马灯
  378. this.goReward('look');
  379. this.getTagList();//获取标签列表
  380. },
  381. methods: {
  382. toDetail(item){
  383. location.href = `./actFissionList.html?id=${item.id}&title=${encodeURI(item.tagName)}&token=${GetRequest().token}`;
  384. },
  385. getTagList(){
  386. this.$toast.loading({
  387. duration: 0,
  388. message: '加载中...',
  389. forbidClick: true,
  390. loadingType: 'spinner',
  391. });
  392. // 获取标签列表
  393. getTagList(GetRequest().token).then(res => {
  394. this.$toast.clear();
  395. if (res.status === 0) {
  396. this.tagList = res.data;
  397. } else {
  398. this.$toast(res.msg);
  399. }
  400. })
  401. },
  402. goReward(type) {
  403. this.$toast.loading({
  404. duration: 0,
  405. message: '加载中...',
  406. forbidClick: true,
  407. loadingType: 'spinner',
  408. });
  409. getActDetailList(this.token).then(res => {
  410. this.$toast.clear();
  411. if (res.status === 0) {
  412. if(type === 'look'){
  413. this.phoneType = res.data.phoneType;
  414. return
  415. }
  416. this.actStatus = res.data.actStatus;
  417. this.shareInfo = res.data;
  418. if (this.actStatus != 1) {
  419. this.$toast('活动已下架');
  420. return
  421. }
  422. // this.stopManyClick(() => {
  423. this.getShare();
  424. // })
  425. } else {
  426. this.$toast(res.msg);
  427. }
  428. })
  429. },
  430. standarImg(id) {
  431. return `${fileCenterApi}/file-center/fileOperate/getImage?id=${id}`;
  432. },
  433. getShare() {
  434. systemBuriedPoint({
  435. pointName: 'dt_裂变_h5_分享攻略'
  436. }).then(res => {
  437. })
  438. const {
  439. title,
  440. content,
  441. gotoUrl,
  442. shareImg
  443. } = this.shareInfo;
  444. console.log({
  445. title: title,
  446. content: content,
  447. gotoUrl: gotoUrl,
  448. shareImg: shareImg
  449. });
  450. if (isAndroid) {
  451. window.native.share(title, content, gotoUrl, shareImg)
  452. } else if (isIOS) {
  453. window.webkit.messageHandlers.share.postMessage({
  454. title: title,
  455. content: content,
  456. gotoUrl: gotoUrl,
  457. shareImg: shareImg
  458. });
  459. }
  460. },
  461. getActDetailList() { //获取活动状态
  462. this.$toast.loading({
  463. duration: 0,
  464. message: '加载中...',
  465. forbidClick: true,
  466. loadingType: 'spinner',
  467. });
  468. getActDetailList(this.token).then(res => {
  469. this.$toast.clear();
  470. if (res.status === 0) {
  471. this.actStatus = res.data.actStatus;
  472. this.shareInfo = res.data;
  473. } else {
  474. this.$toast(res.msg);
  475. }
  476. })
  477. },
  478. getAwardPage() { //获取活动列表
  479. getAwardPage(this.token, this.queryParams).then(res => {
  480. if (res.status == 0) {
  481. this.loading = false //取消正在加载状态
  482. let infolist = res.data.list;
  483. this.total = res.data.total;
  484. if (infolist) {
  485. this.rewardList = this.rewardList.concat(infolist);
  486. console.log(this.rewardList)
  487. if (this.rewardList.length >= this.queryParams.pageSize) {
  488. this.finishedText = '没有更多了'
  489. }
  490. if (this.rewardList.length >= this.total) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
  491. this.finished = true;
  492. }
  493. } else {
  494. this.finished = true;
  495. }
  496. } else {
  497. this.$toast(res.msg);
  498. this.loading = false
  499. if (this.queryParams.pageNum > 1) {
  500. this.queryParams.pageNum -= 1
  501. }
  502. }
  503. }).catch((error) => {
  504. console.log(error)
  505. this.$toast('网络异常');
  506. });
  507. },
  508. //滚动加载时触发,list组件定义的方法
  509. onLoad() {
  510. let times = setTimeout(() => {
  511. this.queryParams.pageNum += 1 //每请求一次,页面数+1
  512. this.getAwardPage();
  513. clearTimeout(times)
  514. }, 500)
  515. },
  516. getMarquee() {
  517. getMarquee().then(res => {
  518. if (res.status === 0) {
  519. this.marqueeList = res.data;
  520. } else {
  521. this.$toast(res.msg);
  522. }
  523. })
  524. },
  525. goGetReward(id, phoneType) {
  526. this.stopManyClick(() => {
  527. getCheck(this.token).then(res => {
  528. if (res.status === 0) {
  529. if (isAndroid) {
  530. window.native.activatePhones(1, id, phoneType)
  531. } else if (isIOS) {
  532. window.webkit.messageHandlers.receive.postMessage({
  533. "awardId": id,
  534. "phoneType": phoneType
  535. });
  536. }
  537. } else if (res.status == 1) {
  538. this.$toast(res.msg);
  539. return;
  540. } else {
  541. this.$toast(res.msg);
  542. return
  543. }
  544. }).catch((error) => {
  545. console.log(error)
  546. this.$toast('网络异常');
  547. });
  548. })
  549. },
  550. stopManyClick(fn) { //防抖
  551. if (this.flag) {
  552. fn();
  553. }
  554. this.flag = false;
  555. if (this.timer) {
  556. clearTimeout(this.timer);
  557. }
  558. this.timer = setTimeout(() => {
  559. this.flag = true
  560. }, 1500);
  561. },
  562. download() {
  563. },
  564. }
  565. })
  566. </script>
  567. </body>
  568. </html>