actFission.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  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: 15.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. width: 100%;
  160. height: 7.9rem;
  161. padding: 0.8rem 0.4rem 0.4rem 0.4rem;
  162. }
  163. .rule-box .rule {
  164. margin-top: 0.48rem;
  165. font-size: 0.28rem;
  166. font-family: PingFangSC-Regular, PingFang SC;
  167. color: #FFFFFF;
  168. line-height: 0.46rem;
  169. letter-spacing: 0.013rem;
  170. }
  171. .rule-box .rule p {
  172. margin-bottom: 0.12rem;
  173. }
  174. .isdisabled {
  175. background: #F2AE45 !important;
  176. color: #ffffff !important;
  177. opacity: 0.3;
  178. }
  179. .notice-swipe {
  180. height: 40px;
  181. line-height: 40px;
  182. }
  183. .top-notice {
  184. width: 100%;
  185. padding: 3rem 0.3rem 0 0.3rem;
  186. height: 0.82rem;
  187. }
  188. .select-content{
  189. position: absolute;
  190. bottom: 0.2rem;
  191. color: #FFFFFF;
  192. left: 50%;
  193. transform: translateX(-50%);
  194. }
  195. .van-notice-bar {
  196. width: 100%;
  197. height: 0.82rem;
  198. background: url("../static/offImg/lunbo.png") no-repeat;
  199. background-size: 100% 100%;
  200. }
  201. .van-swipe-item {
  202. display: flex;
  203. align-items: center;
  204. }
  205. .van-swipe-item p:first-of-type {
  206. font-size: 0.28rem;
  207. width: 1.8rem;
  208. color: #00FFFF;
  209. display: block;
  210. overflow: hidden;
  211. word-break: keep-all;
  212. white-space: nowrap;
  213. text-overflow: ellipsis;
  214. }
  215. .van-swipe-item p+p {
  216. font-size: 0.28rem;
  217. color: #FFFFFF;
  218. }
  219. .van-swipe-item img {
  220. width: 0.6rem;
  221. margin-left: 0.4rem;
  222. margin-right: 0.1rem;
  223. border-radius: 50%;
  224. height: 0.6rem;
  225. }
  226. .no-user {
  227. width: 100%;
  228. height: 100%;
  229. display: flex;
  230. justify-content: center;
  231. align-items: center;
  232. font-size: 0.3rem;
  233. font-family: PingFangSC-Regular, PingFang SC;
  234. color: #666666;
  235. }
  236. .select-list{
  237. display: flex;
  238. justify-content: center;
  239. }
  240. .select-title{
  241. margin-bottom: 0.3rem;
  242. font-size: 0.36rem;
  243. text-align: center;
  244. }
  245. .icon{
  246. width: 1.21rem;
  247. height: 1.21rem;
  248. margin: 0 0.24rem;
  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. .bottoms{
  260. display: flex;
  261. justify-content: center;
  262. padding: 0.4rem 0;
  263. }
  264. .bottom{
  265. width: 6.34rem;
  266. height: 0.24rem;
  267. }
  268. </style>
  269. </head>
  270. <body>
  271. <div id="app" v-cloak class="app container">
  272. <div class="top-banner">
  273. <!-- <img src="../static/offImg/hongbao.png" class="hongbao" alt=""> -->
  274. <img src="../static/offImg/title.png" class="hongbao" alt="">
  275. <div class="top-notice">
  276. <van-notice-bar :scrollable="false">
  277. <van-swipe vertical class="notice-swipe" :autoplay="2000" :show-indicators="false">
  278. <van-swipe-item v-for="(item,index) in marqueeList">
  279. <!-- <img :src="standarImg(item.headImgUrl)" :onerror="defaultImg" alt=""> -->
  280. <img src="" :onerror="defaultImg" alt="">
  281. <p>{{item.sharerSurfaceName}}</p>
  282. <p>已领取分享奖励</p>
  283. </van-swipe-item>
  284. </van-swipe>
  285. </van-notice-bar>
  286. </div>
  287. <div class="select-content">
  288. <div class="select-title">选择你要分享的内容</div>
  289. <div class="select-list">
  290. <div v-for="(item,index) in tagList" :key="index" @click="toDetail(item)">
  291. <img :src="fileCenterApi + `/file-center/fileOperate/getImage?id=${item.cover}`" class="icon" alt="">
  292. </div>
  293. </div>
  294. </div>
  295. <!-- <div class="bottom-btn">
  296. <div class="time-box" @click='goReward()' :class="{'no-start':actStatus==0}"></div>
  297. </div> -->
  298. </div>
  299. <div class="join-wrap">
  300. <img src="../static/offImg/join.png" class="join" alt="">
  301. </div>
  302. <div class="list">
  303. <div class="nav-box">
  304. <!-- <img src="../static/offImg/title-bg.png" alt=""></img> -->
  305. <!-- <div class="title-box">
  306. <div class="img-box">活动奖励</div>
  307. </div> -->
  308. <div class="outer-box" v-if='rewardList&&rewardList.length>0'>
  309. <van-list v-model="loading" :finished-text="finishedText" :finished="finished"
  310. :immediate-check=false @load="onLoad">
  311. <div class="list-nav" v-for="(item,index) in rewardList" :key="index">
  312. <div class="user">
  313. <img :src="standarImg(item.headImgUrl)" class="tou" :onerror="defaultImg" alt="">
  314. <div class="text">
  315. <p>{{item.surfaceName}}</p>
  316. <p>{{item.registerTime}}</p>
  317. </div>
  318. </div>
  319. <div class="right-nav">
  320. <p>{{item.phoneType === 'VIP'?'星动':item.phoneType === 'SVIP'?'星曜':'唔即'}}天卡</p>
  321. <p class="btn" @click='goGetReward(item.id, item.phoneType)' v-if='item.receiveStatus==0'>领取</p>
  322. <p class="btn isdisabled" v-if='item.receiveStatus==1'>已领取</p>
  323. </div>
  324. </div>
  325. </van-list>
  326. </div>
  327. <div class="no-user" v-if='rewardList.length==0'>
  328. <p>
  329. 暂无用户注册
  330. </p>
  331. </div>
  332. </div>
  333. <div class="rule-box">
  334. <!-- <img src="../static/offImg/title-bg.png" alt=""></img> -->
  335. <!-- <div class="title-box">
  336. <div class="img-box">活动规则</div>
  337. </div> -->
  338. <div class="rule">
  339. <p>1.分享双子星攻略文章至微信好友/微信朋友圈/QQ,好友注册成功后,分享者即可获得3天{{phoneType === 'VIP'?'星动':phoneType === 'SVIP'?'星曜':'唔即'}}套餐时长,被分享者可获得{{phoneType === 'VIP'?'星动':phoneType === 'SVIP'?'星曜':'唔即'}}7天卡激活码。</p>
  340. <p>2.用户通过该分享链接获取的激活码,只针对新注册用户有效领取并兑换一次。</p>
  341. <p>3.分享者每日最多分享给10位好友领取激活码并获得注册奖励,且奖励为当日有效,奖励过期不补发。</p>
  342. <p>4.分享者若没有云机,需要先创建{{phoneType === 'VIP'?'星动':phoneType === 'SVIP'?'星曜':'唔即'}}云机才可继续领取奖励。</p>
  343. <p>5.新用户领取的激活码需在有效期内使用,若超过有效期则激活码失效。</p>
  344. </div>
  345. <div class="bottoms">
  346. <img src="../static/offImg/bottom.png" class="bottom" alt="">
  347. </div>
  348. </div>
  349. </div>
  350. </div>
  351. <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
  352. <script src="../static/js/vender/vue/axios.min.js"></script>
  353. <script src="../static/js/vender/vue/config.js"></script>
  354. <script src="../static/js/vender/vue/api.js"></script>
  355. <script type="text/javascript">
  356. var u = navigator.userAgent,
  357. app = navigator.appVersion;
  358. var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
  359. var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
  360. new Vue({
  361. el: '#app',
  362. data: {
  363. isshow: false,
  364. rewardList: [],
  365. queryParams: {
  366. pageNum: 1,
  367. pageSize: 10
  368. },
  369. isDisable: false,
  370. finished: false,
  371. flag: true,
  372. loading: false,
  373. finishedText: '',
  374. offset: 100,
  375. total: 0,
  376. shareInfo: {},
  377. defaultImg: 'this.src="' + "../static/offImg/tou.png" + '"',
  378. actStatus: 0, //0活动状态 1开始
  379. phoneType: '',
  380. marqueeList: [],
  381. timer: null,
  382. tagList: []
  383. },
  384. created() {
  385. this.getAwardPage(); //获取奖励列表
  386. },
  387. mounted() {
  388. this.getActDetailList(); //获取活动上下架
  389. this.getMarquee(); //跑马灯
  390. this.goReward('look');
  391. this.getTagList();//获取标签列表
  392. },
  393. methods: {
  394. toDetail(item){
  395. location.href = `./actFissionList.html?id=${item.id}&title=${encodeURI(item.tagName)}&token=${GetRequest().token}`;
  396. },
  397. getTagList(){
  398. this.$toast.loading({
  399. duration: 0,
  400. message: '加载中...',
  401. forbidClick: true,
  402. loadingType: 'spinner',
  403. });
  404. // 获取标签列表
  405. getTagList(GetRequest().token).then(res => {
  406. this.$toast.clear();
  407. if (res.status === 0) {
  408. this.tagList = res.data;
  409. } else {
  410. this.$toast(res.msg);
  411. }
  412. })
  413. },
  414. goReward(type) {
  415. this.$toast.loading({
  416. duration: 0,
  417. message: '加载中...',
  418. forbidClick: true,
  419. loadingType: 'spinner',
  420. });
  421. getActDetailList(GetRequest().token).then(res => {
  422. this.$toast.clear();
  423. if (res.status === 0) {
  424. console.log(type)
  425. if(type === 'look'){
  426. this.phoneType = res.data.phoneType;
  427. return
  428. }
  429. this.actStatus = res.data.actStatus;
  430. this.shareInfo = res.data;
  431. if (this.actStatus != 1) {
  432. this.$toast('活动已下架');
  433. return
  434. }
  435. // this.stopManyClick(() => {
  436. this.getShare();
  437. // })
  438. } else {
  439. this.$toast(res.msg);
  440. }
  441. })
  442. },
  443. standarImg(id) {
  444. return `${fileCenterApi}/file-center/fileOperate/getImage?id=${id}`;
  445. },
  446. getShare() {
  447. systemBuriedPoint({
  448. pointName: 'dt_裂变_h5_分享攻略'
  449. }).then(res => {
  450. })
  451. const {
  452. title,
  453. content,
  454. gotoUrl,
  455. shareImg
  456. } = this.shareInfo;
  457. console.log({
  458. title: title,
  459. content: content,
  460. gotoUrl: gotoUrl,
  461. shareImg: shareImg
  462. });
  463. if (isAndroid) {
  464. window.native.share(title, content, gotoUrl, shareImg)
  465. } else if (isIOS) {
  466. window.webkit.messageHandlers.share.postMessage({
  467. title: title,
  468. content: content,
  469. gotoUrl: gotoUrl,
  470. shareImg: shareImg
  471. });
  472. }
  473. },
  474. getActDetailList() { //获取活动状态
  475. this.$toast.loading({
  476. duration: 0,
  477. message: '加载中...',
  478. forbidClick: true,
  479. loadingType: 'spinner',
  480. });
  481. getActDetailList(GetRequest().token).then(res => {
  482. this.$toast.clear();
  483. if (res.status === 0) {
  484. this.actStatus = res.data.actStatus;
  485. if (this.actStatus == 0) {
  486. this.$toast('活动已下架');
  487. return
  488. }
  489. this.shareInfo = res.data;
  490. } else {
  491. this.$toast(res.msg);
  492. }
  493. })
  494. },
  495. getAwardPage() { //获取活动列表
  496. getAwardPage(GetRequest().token, this.queryParams).then(res => {
  497. if (res.status == 0) {
  498. this.loading = false //取消正在加载状态
  499. let infolist = res.data.list;
  500. this.total = res.data.total;
  501. if (infolist) {
  502. this.rewardList = this.rewardList.concat(infolist);
  503. console.log(this.rewardList)
  504. if (this.rewardList.length >= this.queryParams.pageSize) {
  505. this.finishedText = '没有更多了'
  506. }
  507. if (this.rewardList.length >= this.total) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
  508. this.finished = true;
  509. }
  510. } else {
  511. this.finished = true;
  512. }
  513. } else {
  514. this.$toast(res.msg);
  515. this.loading = false
  516. if (this.queryParams.pageNum > 1) {
  517. this.queryParams.pageNum -= 1
  518. }
  519. }
  520. }).catch((error) => {
  521. console.log(error)
  522. this.$toast('网络异常');
  523. });
  524. },
  525. //滚动加载时触发,list组件定义的方法
  526. onLoad() {
  527. let times = setTimeout(() => {
  528. this.queryParams.pageNum += 1 //每请求一次,页面数+1
  529. this.getAwardPage();
  530. clearTimeout(times)
  531. }, 500)
  532. },
  533. getMarquee() {
  534. getMarquee().then(res => {
  535. if (res.status === 0) {
  536. this.marqueeList = res.data;
  537. } else {
  538. this.$toast(res.msg);
  539. }
  540. })
  541. },
  542. goGetReward(id, phoneType) {
  543. this.stopManyClick(() => {
  544. getCheck(GetRequest().token).then(res => {
  545. if (res.status === 0) {
  546. if (isAndroid) {
  547. window.native.activatePhones(1, id, phoneType)
  548. } else if (isIOS) {
  549. window.webkit.messageHandlers.receive.postMessage({
  550. "awardId": id,
  551. "phoneType": phoneType
  552. });
  553. }
  554. } else if (res.status == 1) {
  555. this.$toast(res.msg);
  556. return;
  557. } else {
  558. this.$toast(res.msg);
  559. return
  560. }
  561. }).catch((error) => {
  562. console.log(error)
  563. this.$toast('网络异常');
  564. });
  565. })
  566. },
  567. stopManyClick(fn) { //防抖
  568. if (this.flag) {
  569. fn();
  570. }
  571. this.flag = false;
  572. if (this.timer) {
  573. clearTimeout(this.timer);
  574. }
  575. this.timer = setTimeout(() => {
  576. this.flag = true
  577. }, 1500);
  578. },
  579. download() {
  580. },
  581. }
  582. })
  583. </script>
  584. </body>
  585. </html>