actFission.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  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. </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. marqueeList: [],
  318. timer: null,
  319. },
  320. created() {
  321. this.getAwardPage(); //获取奖励列表
  322. },
  323. mounted() {
  324. this.getActDetailList(); //获取活动上下架
  325. this.getMarquee(); //跑马灯
  326. },
  327. methods: {
  328. goReward() {
  329. this.$toast.loading({
  330. duration: 0,
  331. message: '加载中...',
  332. forbidClick: true,
  333. loadingType: 'spinner',
  334. });
  335. getActDetailList(this.token).then(res => {
  336. this.$toast.clear();
  337. if (res.status === 0) {
  338. this.actStatus = res.data.actStatus;
  339. this.shareInfo = res.data;
  340. if (this.actStatus != 1) {
  341. this.$toast('活动已下架');
  342. return
  343. }
  344. // this.stopManyClick(() => {
  345. this.getShare();
  346. // })
  347. } else {
  348. this.$toast(res.msg);
  349. }
  350. })
  351. },
  352. standarImg(id) {
  353. return `${fileCenterApi}/file-center/fileOperate/getImage?id=${id}`;
  354. },
  355. getShare() {
  356. systemBuriedPoint({
  357. pointName: 'dt_裂变_h5_分享攻略'
  358. }).then(res => {
  359. })
  360. const {
  361. title,
  362. content,
  363. gotoUrl,
  364. shareImg
  365. } = this.shareInfo;
  366. console.log({
  367. title: title,
  368. content: content,
  369. gotoUrl: gotoUrl,
  370. shareImg: shareImg
  371. });
  372. if (isAndroid) {
  373. window.native.share(title, content, gotoUrl, shareImg)
  374. } else if (isIOS) {
  375. window.webkit.messageHandlers.share.postMessage({
  376. title: title,
  377. content: content,
  378. gotoUrl: gotoUrl,
  379. shareImg: shareImg
  380. });
  381. }
  382. },
  383. getActDetailList() { //获取活动状态
  384. this.$toast.loading({
  385. duration: 0,
  386. message: '加载中...',
  387. forbidClick: true,
  388. loadingType: 'spinner',
  389. });
  390. getActDetailList(this.token).then(res => {
  391. this.$toast.clear();
  392. if (res.status === 0) {
  393. this.actStatus = res.data.actStatus;
  394. this.shareInfo = res.data;
  395. } else {
  396. this.$toast(res.msg);
  397. }
  398. })
  399. },
  400. getAwardPage() { //获取活动列表
  401. getAwardPage(this.token, this.queryParams).then(res => {
  402. if (res.status == 0) {
  403. this.loading = false //取消正在加载状态
  404. let infolist = res.data.list;
  405. this.total = res.data.total;
  406. if (infolist) {
  407. this.rewardList = this.rewardList.concat(infolist);
  408. if (this.rewardList.length >= this.queryParams.pageSize) {
  409. this.finishedText = '没有更多了'
  410. }
  411. if (this.rewardList.length >= this.total) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
  412. this.finished = true;
  413. }
  414. } else {
  415. this.finished = true;
  416. }
  417. } else {
  418. this.$toast(res.msg);
  419. this.loading = false
  420. if (this.queryParams.pageNum > 1) {
  421. this.queryParams.pageNum -= 1
  422. }
  423. }
  424. }).catch((error) => {
  425. console.log(error)
  426. this.$toast('网络异常');
  427. });
  428. },
  429. //滚动加载时触发,list组件定义的方法
  430. onLoad() {
  431. let times = setTimeout(() => {
  432. this.queryParams.pageNum += 1 //每请求一次,页面数+1
  433. this.getAwardPage();
  434. clearTimeout(times)
  435. }, 500)
  436. },
  437. getMarquee() {
  438. getMarquee().then(res => {
  439. if (res.status === 0) {
  440. this.marqueeList = res.data;
  441. } else {
  442. this.$toast(res.msg);
  443. }
  444. })
  445. },
  446. goGetReward(id) {
  447. this.stopManyClick(() => {
  448. getCheck(this.token).then(res => {
  449. if (res.status === 0) {
  450. if (isAndroid) {
  451. window.native.activatePhone(1, id)
  452. } else if (isIOS) {
  453. window.webkit.messageHandlers.receive.postMessage({
  454. "awardId": id
  455. });
  456. }
  457. } else if (res.status == 1) {
  458. this.$toast(res.msg);
  459. return;
  460. } else {
  461. this.$toast(res.msg);
  462. return
  463. }
  464. }).catch((error) => {
  465. console.log(error)
  466. this.$toast('网络异常');
  467. });
  468. })
  469. },
  470. stopManyClick(fn) { //防抖
  471. if (this.flag) {
  472. fn();
  473. }
  474. this.flag = false;
  475. if (this.timer) {
  476. clearTimeout(this.timer);
  477. }
  478. this.timer = setTimeout(() => {
  479. this.flag = true
  480. }, 1500);
  481. },
  482. download() {
  483. },
  484. }
  485. })
  486. </script>
  487. </body>
  488. </html>