actFission.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  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>星曜天卡</p>
  260. <p class="btn" @click='goGetReward(item.id)' 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天星曜套餐时长,被分享者可获得星曜7天卡激活码。</p>
  279. <p>2.用户通过该分享链接获取的激活码,只针对新注册用户有效领取并兑换一次。</p>
  280. <p>3.分享者每日最多分享给10位好友领取激活码并获得注册奖励,且奖励为当日有效,奖励过期不补发。</p>
  281. <p>4.分享者若没有云机,需要先创建星曜云机才可继续领取奖励。</p>
  282. <p>5.新用户领取的激活码需在有效期内使用,若超过有效期则激活码失效。</p>
  283. <p>6.手机虚拟号段用户暂不支持参与本次活动。</p>
  284. </div>
  285. </div>
  286. </div>
  287. </div>
  288. <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
  289. <script src="../static/js/vender/vue/axios.min.js"></script>
  290. <script src="../static/js/vender/vue/config.js"></script>
  291. <script src="../static/js/vender/vue/api.js"></script>
  292. <script type="text/javascript">
  293. var u = navigator.userAgent,
  294. app = navigator.appVersion;
  295. var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
  296. var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
  297. new Vue({
  298. el: '#app',
  299. data: {
  300. isshow: false,
  301. token: GetRequest().token ? GetRequest().token :
  302. 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyYW5kb20iOiI3MDY1NSIsImNsaWVudCI6IjUiLCJleHAiOjE2NDExOTA0MzMsInVzZXJuYW1lX2FwcGxldCI6Im5naEN0MTYzMTYwNDY4OSJ9.cXj7Ks5XYCnGFANZ0uHAkDn8MJtWrMm4I3qqvikewGg',
  303. rewardList: [],
  304. queryParams: {
  305. pageNum: 1,
  306. pageSize: 10
  307. },
  308. isDisable: false,
  309. finished: false,
  310. flag: true,
  311. loading: false,
  312. finishedText: '',
  313. offset: 100,
  314. total: 0,
  315. shareInfo: {},
  316. defaultImg: 'this.src="' + "../static/offImg/tou.png" + '"',
  317. actStatus: 0, //0活动状态 1开始
  318. marqueeList: [],
  319. timer: null,
  320. },
  321. created() {
  322. this.getAwardPage(); //获取奖励列表
  323. },
  324. mounted() {
  325. this.getActDetailList(); //获取活动上下架
  326. this.getMarquee(); //跑马灯
  327. },
  328. methods: {
  329. goReward() {
  330. this.$toast.loading({
  331. duration: 0,
  332. message: '加载中...',
  333. forbidClick: true,
  334. loadingType: 'spinner',
  335. });
  336. getActDetailList(this.token).then(res => {
  337. this.$toast.clear();
  338. if (res.status === 0) {
  339. this.actStatus = res.data.actStatus;
  340. this.shareInfo = res.data;
  341. if (this.actStatus != 1) {
  342. this.$toast('活动已下架');
  343. return
  344. }
  345. // this.stopManyClick(() => {
  346. this.getShare();
  347. // })
  348. } else {
  349. this.$toast(res.msg);
  350. }
  351. })
  352. },
  353. standarImg(id) {
  354. return `${fileCenterApi}/file-center/fileOperate/getImage?id=${id}`;
  355. },
  356. getShare() {
  357. systemBuriedPoint({
  358. pointName: 'dt_裂变_h5_分享攻略'
  359. }).then(res => {
  360. })
  361. const {
  362. title,
  363. content,
  364. gotoUrl,
  365. shareImg
  366. } = this.shareInfo;
  367. console.log({
  368. title: title,
  369. content: content,
  370. gotoUrl: gotoUrl,
  371. shareImg: shareImg
  372. });
  373. if (isAndroid) {
  374. window.native.share(title, content, gotoUrl, shareImg)
  375. } else if (isIOS) {
  376. window.webkit.messageHandlers.share.postMessage({
  377. title: title,
  378. content: content,
  379. gotoUrl: gotoUrl,
  380. shareImg: shareImg
  381. });
  382. }
  383. },
  384. getActDetailList() { //获取活动状态
  385. this.$toast.loading({
  386. duration: 0,
  387. message: '加载中...',
  388. forbidClick: true,
  389. loadingType: 'spinner',
  390. });
  391. getActDetailList(this.token).then(res => {
  392. this.$toast.clear();
  393. if (res.status === 0) {
  394. this.actStatus = res.data.actStatus;
  395. this.shareInfo = res.data;
  396. } else {
  397. this.$toast(res.msg);
  398. }
  399. })
  400. },
  401. getAwardPage() { //获取活动列表
  402. getAwardPage(this.token, this.queryParams).then(res => {
  403. if (res.status == 0) {
  404. this.loading = false //取消正在加载状态
  405. let infolist = res.data.list;
  406. this.total = res.data.total;
  407. if (infolist) {
  408. this.rewardList = this.rewardList.concat(infolist);
  409. if (this.rewardList.length >= this.queryParams.pageSize) {
  410. this.finishedText = '没有更多了'
  411. }
  412. if (this.rewardList.length >= this.total) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
  413. this.finished = true;
  414. }
  415. } else {
  416. this.finished = true;
  417. }
  418. } else {
  419. this.$toast(res.msg);
  420. this.loading = false
  421. if (this.queryParams.pageNum > 1) {
  422. this.queryParams.pageNum -= 1
  423. }
  424. }
  425. }).catch((error) => {
  426. console.log(error)
  427. this.$toast('网络异常');
  428. });
  429. },
  430. //滚动加载时触发,list组件定义的方法
  431. onLoad() {
  432. let times = setTimeout(() => {
  433. this.queryParams.pageNum += 1 //每请求一次,页面数+1
  434. this.getAwardPage();
  435. clearTimeout(times)
  436. }, 500)
  437. },
  438. getMarquee() {
  439. getMarquee().then(res => {
  440. if (res.status === 0) {
  441. this.marqueeList = res.data;
  442. } else {
  443. this.$toast(res.msg);
  444. }
  445. })
  446. },
  447. goGetReward(id) {
  448. this.stopManyClick(() => {
  449. getCheck(this.token).then(res => {
  450. if (res.status === 0) {
  451. if (isAndroid) {
  452. window.native.activatePhone(1, id)
  453. } else if (isIOS) {
  454. window.webkit.messageHandlers.receive.postMessage({
  455. "awardId": id
  456. });
  457. }
  458. } else if (res.status == 1) {
  459. this.$toast(res.msg);
  460. return;
  461. } else {
  462. this.$toast(res.msg);
  463. return
  464. }
  465. }).catch((error) => {
  466. console.log(error)
  467. this.$toast('网络异常');
  468. });
  469. })
  470. },
  471. stopManyClick(fn) { //防抖
  472. if (this.flag) {
  473. fn();
  474. }
  475. this.flag = false;
  476. if (this.timer) {
  477. clearTimeout(this.timer);
  478. }
  479. this.timer = setTimeout(() => {
  480. this.flag = true
  481. }, 1500);
  482. },
  483. download() {
  484. },
  485. }
  486. })
  487. </script>
  488. </body>
  489. </html>