actFission.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  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">
  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.12rem;
  36. display: flex;
  37. justify-content: center;
  38. left: 0;
  39. }
  40. .bottom-btn .time-box {
  41. width: 6.26rem;
  42. height: 1.88rem;
  43. background: url("../static/offImg/time.png") no-repeat;
  44. background-size: 100% 100%;
  45. }
  46. .no-start {
  47. width: 6.26rem !important;
  48. height: 1.88rem !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: 6.92rem;
  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: 2.4rem;
  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. <p>{{item.surfaceName}}</p>
  231. <p>已领取分享奖励</p>
  232. </van-swipe-item>
  233. </van-swipe>
  234. </van-notice-bar>
  235. </div>
  236. <div class="bottom-btn">
  237. <div class="time-box" @click='goReward()' :class="{'no-start':actStatus==0}"></div>
  238. </div>
  239. </div>
  240. <div class="list">
  241. <div class="nav-box">
  242. <!-- <img src="../static/offImg/title-bg.png" alt=""></img> -->
  243. <div class="title-box">
  244. <div class="img-box">活动奖励</div>
  245. </div>
  246. <div class="outer-box" v-if='rewardList&&rewardList.length>0'>
  247. <van-list v-model="loading" :finished-text="finishedText" :finished="finished"
  248. :immediate-check=false @load="onLoad">
  249. <div class="list-nav" v-for="(item,index) in rewardList" :key="index">
  250. <div class="user">
  251. <img :src="standarImg(item.headImgUrl)" class="tou" :onerror="defaultImg" alt="">
  252. <div class="text">
  253. <p>{{item.surfaceName}}</p>
  254. <p>{{item.createTime}}</p>
  255. </div>
  256. </div>
  257. <div class="right-nav">
  258. <p>星动天卡</p>
  259. <p class="btn" @click='goGetReward(item.id)' v-if='item.receiveStatus==0'>领取</p>
  260. <p class="btn isdisabled" v-if='item.receiveStatus==1'>已领取</p>
  261. </div>
  262. </div>
  263. </van-list>
  264. </div>
  265. <div class="no-user" v-if='rewardList.length==0'>
  266. <p>
  267. 暂无用户注册
  268. </p>
  269. </div>
  270. </div>
  271. <div class="rule-box">
  272. <!-- <img src="../static/offImg/title-bg.png" alt=""></img> -->
  273. <div class="title-box">
  274. <div class="img-box">活动规则</div>
  275. </div>
  276. <div class="rule">
  277. <p>1.分享双子星攻略文章至微信好友/微信朋友圈/QQ,好友注册成功后,分享者即可获得1小时星动套餐时长。</p>
  278. <p>2.用户通过该分享链接获取的激活码,只针对新注册用户有效领取并兑换一次。</p>
  279. <p>3.分享者每日最多获得10位好友的注册奖励,且奖励为当日有效,奖励过期不补发。</p>
  280. <p>4.分享者若没有云机,需要先创建星动云机才可继续领取奖励。</p>
  281. <p>5.新用户领取的激活码需在有效期内使用,若超过有效期则激活码失效。</p>
  282. </div>
  283. </div>
  284. </div>
  285. </div>
  286. <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
  287. <script src="../static/js/vender/vue/axios.min.js"></script>
  288. <script src="../static/js/vender/vue/config.js"></script>
  289. <script src="../static/js/vender/vue/api.js"></script>
  290. <script type="text/javascript">
  291. var u = navigator.userAgent,
  292. app = navigator.appVersion;
  293. var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
  294. var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
  295. new Vue({
  296. el: '#app',
  297. data: {
  298. isshow: false,
  299. token: GetRequest().token ? GetRequest().token:'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyYW5kb20iOiI1MTc5OSIsImNsaWVudCI6IjAiLCJleHAiOjE2NDAyMzY0NjQsInVzZXJuYW1lIjoiYWRtaW4ifQ.M8qTMKfMQjKjQ1uAu1M-ty8HRRmWJgq7ED1Kbhu4p4Q',
  300. topic: {},
  301. rewardList: [{surfaceName:'1221',receiveStatus:0,id:1},{surfaceName:'1221',receiveStatus:1,id:12}],
  302. queryParams: {
  303. pageNum: 1,
  304. pageSize: 10
  305. },
  306. isDisable: false,
  307. finished: false,
  308. loading: false,
  309. finishedText: '没有更多了',
  310. offset: 100,
  311. total: 0,
  312. shareInfo: {},
  313. defaultImg: 'this.src="' + "../static/offImg/tou.png" + '"',
  314. actStatus: 1, //0活动状态 1开始
  315. marqueeList: [],
  316. },
  317. created() {
  318. // this.getAwardPage(); //获取奖励列表
  319. },
  320. mounted() {
  321. // this.getActDetail();
  322. // this.getMarquee(); //跑马灯
  323. //this.getList();
  324. },
  325. methods: {
  326. goReward() {
  327. if (this.actStatus != 1) {
  328. return
  329. }
  330. const {
  331. title,
  332. content,
  333. gotoUrl,
  334. shareImg
  335. } = this.shareInfo;
  336. if (isAndroid) {
  337. window.native.share(title, content, gotoUrl, shareImg)
  338. } else if (isIOS) {
  339. window.webkit.messageHandlers.share.postMessage(type);
  340. }
  341. },
  342. standarImg(id) {
  343. return `${fileCenterApi}/file-center/fileOperate/getImage?id=${id}`;
  344. },
  345. getActDetail() { //获取活动状态
  346. this.$toast.loading({
  347. duration: 0,
  348. message: '加载中...',
  349. forbidClick: true,
  350. loadingType: 'spinner',
  351. });
  352. getActDetail().then(res => {
  353. this.$toast.clear();
  354. if (res.status === 0) {
  355. this.actStatus = res.data.actStatus;
  356. this.shareInfo = res.data;
  357. } else {
  358. this.$toast(res.msg);
  359. }
  360. })
  361. },
  362. getAwardPage() { //获取活动列表
  363. getAwardPage(this.token, this.queryParams).then(res => {
  364. if (res.status == 0) {
  365. this.loading = false //取消正在加载状态
  366. let infolist = res.data.list;
  367. if (infolist) {
  368. this.rewardList = this.rewardList.concat(infolist);
  369. if (infolist.length < this.queryParams
  370. .pageSize) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
  371. this.finished = true;
  372. }
  373. } else {
  374. this.finished = true;
  375. }
  376. } else {
  377. this.$toast(res.msg);
  378. this.loading = false
  379. if (this.queryParams.pageNum > 1) {
  380. this.queryParams.pageNum -= 1
  381. }
  382. }
  383. })
  384. },
  385. //滚动加载时触发,list组件定义的方法
  386. onLoad() {
  387. let times = setTimeout(() => {
  388. this.queryParams.pageNum += 1 //每请求一次,页面数+1
  389. this.getAwardPage();
  390. clearTimeout(times)
  391. }, 500)
  392. },
  393. getMarquee() {
  394. getMarquee().then(res => {
  395. if (res.status === 0) {
  396. this.marqueeList = res.data;
  397. } else {
  398. this.$toast(res.msg);
  399. }
  400. })
  401. },
  402. goGetReward(id) {
  403. getCheck(this.token).then(res => {
  404. if (res.status === 0) {
  405. if (isAndroid) {
  406. window.native.activatePhone(1, id)
  407. } else if (isIOS) {
  408. window.webkit.messageHandlers.receive.postMessage({"awardId":id});
  409. }
  410. } else if (res.status == 1) {
  411. return;
  412. this.$toast(res.msg);
  413. } else {
  414. return
  415. this.$toast(res.msg);
  416. }
  417. })
  418. },
  419. download() {
  420. },
  421. }
  422. })
  423. </script>
  424. </body>
  425. </html>