actFission.html 14 KB

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