actFission.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  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.82rem;
  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: 8.4rem;
  161. padding: 1.1rem 0.3rem 0.4rem 0.3rem;
  162. }
  163. .rule-box .rule {
  164. margin-top: 0.2rem;
  165. font-size: 0.26rem;
  166. font-family: PingFangSC-Regular, PingFang SC;
  167. color: #FFFFFF;
  168. line-height: 0.37rem;
  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 + `/document/newFile/download/0/${uploadKey}?fileKey=${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'?'星曜':'唔即'}}1天卡]</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等,好友通过分享链接注册成功后,分享者即可获得1天{{phoneType === 'VIP'?'星动':phoneType === 'SVIP'?'星曜':'唔即'}}云手机时长,被分享者可获{{phoneType === 'VIP'?'星动':phoneType === 'SVIP'?'星曜':'唔即'}}云手机3天激活码。</p>
  340. <p>2.用户通过该分享链接获取的激活码仅限新注册用户兑换。</p>
  341. <p>3.分享者每日最多获得5位好友的注册奖励,且奖励当日有效,奖励过期失效后无法领取且不予补发。</p>
  342. <p>4.分享者需拥有{{phoneType === 'VIP'?'星动':phoneType === 'SVIP'?'星曜':'唔即'}}云机(除试用机外)才可领取奖励,若无{{phoneType === 'VIP'?'星动':phoneType === 'SVIP'?'星曜':'唔即'}}云手机请先创建,创建后继续领取奖励。</p>
  343. <p>5.新用户领取激活码需在有效期内使用(有效期为3天),若超过有效期则激活码失效。</p>
  344. <p>6.本活动仅限真实有效用户参与,任何非正常获利手段经核查验证,官方将进行账户回收等惩罚措施。</p>
  345. </div>
  346. <!-- <div class="bottoms">
  347. <img src="../static/offImg/bottom.png" class="bottom" alt="">
  348. </div> -->
  349. </div>
  350. </div>
  351. </div>
  352. <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
  353. <script src="../static/js/vender/vue/axios.min.js"></script>
  354. <script src="../static/js/vender/vue/config.js"></script>
  355. <script src="../static/js/vender/vue/api.js"></script>
  356. <script type="text/javascript">
  357. var u = navigator.userAgent,
  358. app = navigator.appVersion;
  359. var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
  360. var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
  361. new Vue({
  362. el: '#app',
  363. data: {
  364. isshow: false,
  365. rewardList: [],
  366. queryParams: {
  367. pageNum: 1,
  368. pageSize: 10
  369. },
  370. isDisable: false,
  371. finished: false,
  372. flag: true,
  373. loading: false,
  374. finishedText: '',
  375. offset: 100,
  376. total: 0,
  377. shareInfo: {},
  378. defaultImg: 'this.src="' + "../static/offImg/tou.png" + '"',
  379. actStatus: 0, //0活动状态 1开始
  380. phoneType: '',
  381. marqueeList: [],
  382. timer: null,
  383. tagList: []
  384. },
  385. created() {
  386. this.getAwardPage(); //获取奖励列表
  387. },
  388. mounted() {
  389. this.getActDetailList(); //获取活动上下架
  390. this.getMarquee(); //跑马灯
  391. this.goReward('look');
  392. this.getTagList();//获取标签列表
  393. },
  394. methods: {
  395. toDetail(item){
  396. location.href = `./actFissionList.html?id=${item.id}&title=${encodeURI(item.tagName)}&token=${GetRequest().token}`;
  397. },
  398. getTagList(){
  399. // 获取标签列表
  400. getTagList(GetRequest().token).then(res => {
  401. if (res.status === 0) {
  402. this.tagList = res.data;
  403. } else {
  404. this.$toast(res.msg);
  405. }
  406. })
  407. },
  408. goReward(type) {
  409. this.$toast.loading({
  410. duration: 0,
  411. message: '加载中...',
  412. forbidClick: true,
  413. loadingType: 'spinner',
  414. });
  415. getActDetailList(GetRequest().token).then(res => {
  416. if (res.status === 0) {
  417. console.log(type)
  418. if(type === 'look'){
  419. this.phoneType = res.data.phoneType;
  420. return
  421. }
  422. this.actStatus = res.data.actStatus;
  423. this.shareInfo = res.data;
  424. if (this.actStatus != 1) {
  425. this.$toast('活动已下架');
  426. return
  427. } else {
  428. this.$toast.clear();
  429. }
  430. // this.stopManyClick(() => {
  431. this.getShare();
  432. // })
  433. } else {
  434. this.$toast(res.msg);
  435. }
  436. })
  437. },
  438. standarImg(id) {
  439. return `${fileCenterApi}/document/newFile/download/0/${uploadKey}?fileKey=${id}`;
  440. },
  441. getShare() {
  442. systemBuriedPoint({
  443. pointName: 'dt_裂变_h5_分享攻略'
  444. }).then(res => {
  445. })
  446. const {
  447. title,
  448. content,
  449. gotoUrl,
  450. shareImg
  451. } = this.shareInfo;
  452. console.log({
  453. title: title,
  454. content: content,
  455. gotoUrl: gotoUrl,
  456. shareImg: shareImg
  457. });
  458. if (isAndroid) {
  459. window.native.share(title, content, gotoUrl, shareImg)
  460. } else if (isIOS) {
  461. window.webkit.messageHandlers.share.postMessage({
  462. title: title,
  463. content: content,
  464. gotoUrl: gotoUrl,
  465. shareImg: shareImg
  466. });
  467. }
  468. },
  469. getActDetailList() { //获取活动状态
  470. this.$toast.loading({
  471. duration: 0,
  472. message: '加载中...',
  473. forbidClick: true,
  474. loadingType: 'spinner',
  475. });
  476. getActDetailList(GetRequest().token).then(res => {
  477. if (res.status === 0) {
  478. this.actStatus = res.data.actStatus;
  479. if (this.actStatus == 0) {
  480. this.$toast('活动已下架');
  481. return
  482. } else {
  483. this.$toast.clear();
  484. }
  485. this.shareInfo = res.data;
  486. } else {
  487. this.$toast(res.msg);
  488. }
  489. })
  490. },
  491. getAwardPage() { //获取活动列表
  492. getAwardPage(GetRequest().token, this.queryParams).then(res => {
  493. if (res.status == 0) {
  494. this.loading = false //取消正在加载状态
  495. let infolist = res.data.list;
  496. this.total = res.data.total;
  497. if (infolist) {
  498. this.rewardList = this.rewardList.concat(infolist);
  499. console.log(this.rewardList)
  500. if (this.rewardList.length >= this.queryParams.pageSize) {
  501. this.finishedText = '没有更多了'
  502. }
  503. if (this.rewardList.length >= this.total) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
  504. this.finished = true;
  505. }
  506. } else {
  507. this.finished = true;
  508. }
  509. } else {
  510. this.$toast(res.msg);
  511. this.loading = false
  512. if (this.queryParams.pageNum > 1) {
  513. this.queryParams.pageNum -= 1
  514. }
  515. }
  516. }).catch((error) => {
  517. console.log(error)
  518. this.$toast('网络异常');
  519. });
  520. },
  521. //滚动加载时触发,list组件定义的方法
  522. onLoad() {
  523. let times = setTimeout(() => {
  524. this.queryParams.pageNum += 1 //每请求一次,页面数+1
  525. this.getAwardPage();
  526. clearTimeout(times)
  527. }, 500)
  528. },
  529. getMarquee() {
  530. getMarquee().then(res => {
  531. if (res.status === 0) {
  532. this.marqueeList = res.data;
  533. } else {
  534. this.$toast(res.msg);
  535. }
  536. })
  537. },
  538. goGetReward(id, phoneType) {
  539. this.stopManyClick(() => {
  540. getCheck(GetRequest().token).then(res => {
  541. if (res.status === 0) {
  542. if (isAndroid) {
  543. window.native.activatePhones(1, id, phoneType)
  544. } else if (isIOS) {
  545. window.webkit.messageHandlers.receive.postMessage({
  546. "awardId": id,
  547. "phoneType": phoneType
  548. });
  549. }
  550. } else if (res.status == 1) {
  551. this.$toast(res.msg);
  552. return;
  553. } else {
  554. this.$toast(res.msg);
  555. return
  556. }
  557. }).catch((error) => {
  558. console.log(error)
  559. this.$toast('网络异常');
  560. });
  561. })
  562. },
  563. stopManyClick(fn) { //防抖
  564. if (this.flag) {
  565. fn();
  566. }
  567. this.flag = false;
  568. if (this.timer) {
  569. clearTimeout(this.timer);
  570. }
  571. this.timer = setTimeout(() => {
  572. this.flag = true
  573. }, 1500);
  574. },
  575. download() {
  576. },
  577. }
  578. })
  579. </script>
  580. </body>
  581. </html>