actFissionShare.html 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963
  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. <link rel="icon" href="../static/img/favicon2.ico" type="img/x-ico">
  8. <link rel="stylesheet" href="../static/css/index.css">
  9. <link rel="stylesheet" href="../static/css/vant.css" />
  10. <script src="../static/js/vender/jquery-3.4.1.min.js"></script>
  11. <link rel="stylesheet" href="../static/css/verify.css">
  12. <link rel="stylesheet" href="../static/js/vender/toastr/toastr.min.css">
  13. <script>
  14. (function () {
  15. if (!window.Promise) {
  16. document.writeln('<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-promise/4.1.1/es6-promise.min.js"><' + '/' + 'script>');
  17. }
  18. })();
  19. </script>
  20. <script src="../static/js/vender/toastr/toastr.min.js"></script>
  21. <script src="../static/js/vender/config.js"></script>
  22. <script src="../static/js/vender/crypto-js.js"></script>
  23. <script src="../static/js/vender/ase.js"></script>
  24. <!-- <script src="../static/js/vender/vue/vue.min.js"></script>
  25. <script src="../static/js/vender/vue/vant.min.js"></script>
  26. <script src="../static/js/vender/config.js"></script>
  27. <script src="../static/js/vender/uuid.js"></script>
  28. <script src="../static/js/vender/vue/axios.min.js"></script>
  29. <script src="../static/js/vender/vue/config.js"></script>
  30. <script src="../static/js/vender/vue/api.js"></script> -->
  31. <title>分享攻略</title>
  32. <style>
  33. [v-cloak] {
  34. display: none !important;
  35. }
  36. .container {
  37. display: flex;
  38. height: 100vh;
  39. padding-top: 0.2rem;
  40. /* align-items: center;
  41. justify-content: center; */
  42. }
  43. .top-banner {
  44. width: 6.9rem;
  45. height: 0.82rem;
  46. background: url("../static/offImg/share-top.png") no-repeat;
  47. background-size: 100% 100%;
  48. }
  49. .footer {
  50. position: fixed;
  51. bottom: 0.5rem;
  52. padding: 0 0.3rem;
  53. width: 100%;
  54. left: 0;
  55. display: flex;
  56. justify-content: center;
  57. }
  58. .download-btn {
  59. width: 7.2rem;
  60. height: 1.3rem;
  61. background: url('../static/offImg/btn-down.png') no-repeat scroll top center #3B7FFF;
  62. background-size: 100% 100%;
  63. box-shadow: 0rem 0.06rem 0.4rem 0rem rgba(59, 127, 255, 0.6);
  64. border-radius: 0.2rem;
  65. display: flex;
  66. justify-content: space-between;
  67. align-items: center;
  68. padding: 0 0.4rem;
  69. }
  70. .button-download {
  71. width: 2.5rem;
  72. height: 0.8rem;
  73. line-height: 0.8rem;
  74. background: linear-gradient(360deg, #FF8300 0%, #FEC000 100%);
  75. border-radius: 0.2rem;
  76. text-align: center;
  77. font-size: 0.3rem;
  78. font-family: PingFangSC-Medium, PingFang SC;
  79. color: #FFFFFF;
  80. }
  81. .download-btn .left-nav p:first-of-type {
  82. font-size: 0.24rem;
  83. font-family: PingFangSC-Regular, PingFang SC;
  84. font-weight: 400;
  85. color: rgba(255, 255, 255, 0.7);
  86. margin-bottom: 0.02rem;
  87. }
  88. .download-btn .left-nav p+p {
  89. font-size: 0.28rem;
  90. font-family: PingFangSC-Regular, PingFang SC;
  91. font-weight: 400;
  92. color: rgba(255, 255, 255, 0.9);
  93. }
  94. .hideContainer {
  95. width: 100%;
  96. display: flex;
  97. justify-content: center;
  98. align-items: center;
  99. height: calc(100vh - 1.36rem);
  100. text-align: center;
  101. }
  102. .hideContainer img {
  103. width: 2.8rem;
  104. height: 2.8rem;
  105. }
  106. .hideContainer p {
  107. margin-top: 0.3rem;
  108. font-family: PingFangSC-Regular, PingFang SC;
  109. color: #999999;
  110. font-size: 0.28rem;
  111. }
  112. .top-content {
  113. width: 6.9rem;
  114. padding-bottom: 0.3rem;
  115. }
  116. .top-content .title {
  117. font-size: 0.44rem;
  118. font-family: PingFangSC-Medium, PingFang SC;
  119. color: #000000;
  120. letter-spacing: 0.01rem;
  121. margin-bottom: 0.2rem;
  122. }
  123. .topic-info {
  124. padding-bottom: 1.6rem;
  125. }
  126. .topic-info img {
  127. max-width: 100%;
  128. width: auto;
  129. height: auto;
  130. border-radius: 0.2rem;
  131. margin-bottom: 0.2rem;
  132. margin-top: 0.2rem;
  133. }
  134. .topic-info {
  135. font-size: 0.3rem;
  136. font-family: PingFangSC-Regular, PingFang SC;
  137. font-weight: 400;
  138. color: #333333;
  139. letter-spacing: 0.02rem;
  140. }
  141. .topic-info p {
  142. font-size: 0.36rem;
  143. font-family: PingFangSC-Regular, PingFang SC;
  144. font-weight: 400;
  145. color: #333333;
  146. letter-spacing: 0.02rem;
  147. }
  148. .van-notice-bar {
  149. height: 100%;
  150. background: none;
  151. width: 100%;
  152. }
  153. .notice-swipe {
  154. height: 0.8rem;
  155. line-height: 0.8rem;
  156. }
  157. .van-swipe-item {
  158. display: flex;
  159. align-items: center;
  160. }
  161. .van-swipe-item img {
  162. width: 0.6rem;
  163. margin-left: 0.3rem;
  164. border-radius: 50%;
  165. margin-right: 0.1rem;
  166. height: 0.6rem;
  167. }
  168. .van-swipe-item p {
  169. font-size: 0.28rem;
  170. font-family: PingFangSC-Regular, PingFang SC;
  171. color: #FFFFFF;
  172. }
  173. .van-swipe-item p:first-of-type {
  174. max-width: 2.4rem;
  175. display: block;
  176. overflow: hidden;
  177. word-break: keep-all;
  178. white-space: nowrap;
  179. text-overflow: ellipsis;
  180. }
  181. .topic-info img {
  182. max-width: 100%;
  183. width: auto;
  184. height: auto;
  185. border-radius: 0.2rem;
  186. margin-bottom: 0.2rem;
  187. margin-top: 0.2rem;
  188. }
  189. .topic-info p {
  190. font-size: 0.3rem;
  191. font-family: PingFangSC-Regular, PingFang SC;
  192. font-weight: 400;
  193. color: #333333;
  194. letter-spacing: 0.02rem;
  195. }
  196. .van-dialog__footer {
  197. display: none;
  198. }
  199. .top-banner {
  200. margin: 0 auto;
  201. margin-bottom: 0.1rem;
  202. }
  203. .hide {
  204. display: none !important;
  205. }
  206. .van-overlay {
  207. background-color: rgba(0, 0, 0, 0.5);
  208. }
  209. .van-dialog__content {
  210. /* padding: 0.3rem 0.6rem; */
  211. min-height: unset !important;
  212. }
  213. .van-dialog {
  214. border-radius: 0.2rem;
  215. width: unset !important;
  216. }
  217. .van-dialog__message {
  218. padding: 0.3rem 0.6rem;
  219. font-size: 0.3rem;
  220. white-space: nowrap;
  221. font-family: PingFangSC-Regular, PingFang SC;
  222. }
  223. .van-dialog__content {
  224. border-radius: 0.2rem;
  225. }
  226. .mask {
  227. width: 7.5rem;
  228. height: 100vh;
  229. position: absolute;
  230. top: 0;
  231. left: 0;
  232. background: rgba(0, 0, 0, 0.24);
  233. display: none;
  234. }
  235. .dialog {
  236. width: 6.22rem;
  237. height: 8.56rem;
  238. background: #FFFFFF;
  239. border-radius: 0.2rem;
  240. position: absolute;
  241. left:50%;
  242. transform: translateX(-50%);
  243. padding: 0 0.4rem;
  244. top: -6.96rem;
  245. overflow: hidden;
  246. }
  247. .imgs-block{
  248. width: 100%;
  249. display: flex;
  250. justify-content: center;
  251. align-items: center;
  252. position: relative;
  253. margin-top: 0.5rem;
  254. }
  255. .copy-tip{
  256. display: flex;
  257. justify-content: center;
  258. font-size: 0.28rem;
  259. margin-top: 0.32rem;
  260. color: #333333;
  261. }
  262. .my{
  263. color: #000000;
  264. font-weight: 600;
  265. }
  266. .point1{
  267. font-size: 0.26rem;
  268. margin-top: 0.16rem;
  269. color: #666666;
  270. }
  271. .point-img{
  272. width: 5.42rem;
  273. height: 1.7rem;
  274. margin: auto;
  275. margin-top: 0.2rem;
  276. }
  277. .point2{
  278. margin-top: 0.32rem;
  279. }
  280. .imgs{
  281. width: 0.38rem;
  282. height: 0.38rem;
  283. }
  284. .imgs-text{
  285. font-size: 0.36rem;
  286. color: #3B7FFF;
  287. }
  288. .get-success-block{
  289. display: flex;
  290. justify-content: center;
  291. margin-top: 0.3rem;
  292. }
  293. .get-success{
  294. width: 4.6rem;
  295. height: 0.9rem;
  296. line-height: 0.9rem;
  297. text-align: center;
  298. color: #FFFFFF;
  299. font-size: 0.25rem;
  300. background: linear-gradient(180deg, #6DB6FF 0%, #3B7FFF 100%);
  301. border-radius: 0.2rem;
  302. }
  303. .close{
  304. width: 0.48rem;
  305. height: 0.48rem;
  306. position: absolute;
  307. bottom: -0.8rem;
  308. left: 50%;
  309. margin-left: -0.24rem;
  310. z-index: 999;
  311. }
  312. #toast-container>.toast-error {
  313. background-image: none!important;
  314. }
  315. .toast-error {
  316. background-color: rgba(0, 0, 0, 0.7);
  317. }
  318. .toast-message {
  319. font-size: 0.24rem;
  320. padding: 0 0.1rem;
  321. line-height: 0.9rem;
  322. text-align: center;
  323. font-weight: 400;
  324. color: #FFFFFF;
  325. }
  326. #toast-container>div {
  327. width: 4rem;
  328. height: 0.9rem;
  329. opacity: 1;
  330. padding: 0 !important;
  331. border-radius: 0.2rem;
  332. box-shadow: none;
  333. }
  334. .toast-center-center {
  335. position: fixed;
  336. top: 50%;
  337. left: 50%;
  338. z-index: 99;
  339. margin-top: -0.45rem;
  340. transform: translate(-50%,-50%);
  341. }
  342. .mask{
  343. position: fixed;
  344. width: 100vw;
  345. }
  346. .share_btn{
  347. width: 2.4rem;
  348. height: 0.88rem;
  349. display: flex;
  350. justify-content: center;
  351. }
  352. @media (max-width: 480px) and (min-width: 241px) {
  353. #toast-container>div {
  354. min-width: 80px !important;
  355. width: auto;
  356. }
  357. }
  358. .miniprogram-wrap{
  359. position: relative;
  360. }
  361. .miniprogram{
  362. width: 6.25rem;
  363. height: 8.01rem;
  364. margin-left: -0.39rem;
  365. }
  366. .down-btn{
  367. width: 4.6rem;
  368. height: 0.9rem;
  369. position: absolute;
  370. bottom: 0.42rem;
  371. left: 0.42rem;
  372. }
  373. </style>
  374. </head>
  375. <body>
  376. <div id="mpanel2"></div>
  377. <div id="form-btn"></div>
  378. <div id="app" v-cloak class="container ">
  379. <div v-if='isshow&&topic!=null' style="margin: 0 auto;">
  380. <div class="footer">
  381. <div v-if="type == 1">
  382. <img @click="share" src="../static/offImg/share_btn.png" class="share_btn" alt="" />
  383. </div>
  384. <div class="download-btn" v-else>
  385. <div class="left-nav">
  386. <p>激活码:</p>
  387. <p>AS4*********SD3</p>
  388. </div>
  389. <div class="button-download" @click='copyHandle()'>点击复制并下载</div>
  390. </div>
  391. </div>
  392. <div class="top-banner">
  393. <van-notice-bar :scrollable="false">
  394. <van-swipe vertical class="notice-swipe" :autoplay="2000" :show-indicators="false">
  395. <van-swipe-item v-for="(item,index) in marqueeList">
  396. <img :src="standarImg(item.headImgUrl)" :onerror="defaultImg" alt="">
  397. <div class="hide">双子星邀请你免费领取云手机</div>
  398. <p>{{item.surfaceName}}</p>
  399. <p>已获得{{phoneType === 'VIP'?'星动':phoneType === 'SVIP'?'星曜':'唔即'}}云手机套餐</p>
  400. </van-swipe-item>
  401. </van-swipe>
  402. </van-notice-bar>
  403. </div>
  404. <div class="top-content">
  405. <div v-html="topic" class="topic-info"></div>
  406. </div>
  407. </div>
  408. <div v-if='!isshow' class="hideContainer">
  409. <div>
  410. <img src="../static/offImg/no-data.png" alt="" />
  411. <p>{{msg}},敬请期待</p>
  412. </div>
  413. </div>
  414. </div>
  415. <div class="mask">
  416. <div class="dialog">
  417. <div class="miniprogram-wrap">
  418. <img class="miniprogram" src="../static/offImg/tost.png" />
  419. <img class="down-btn" src="../static/offImg/down-btn.png" />
  420. </div>
  421. <div class="noMiniprogram">
  422. <div class="imgs-block">
  423. <img class="imgs" src="../static/img/icon-copy.png" />
  424. <div class="imgs-text">复制成功</div>
  425. <img class="imgs" src="../static/img/icon-copy.png" />
  426. </div>
  427. <div class="copy-tip">温馨提示:激活码使用教程</div>
  428. <div class="point1">1、在双子星APP的工具栏,点击 <span class="my">[我的]</span></div>
  429. <img class="point-img" src="../static/img/point1.png" />
  430. <div class="point1 point2">2、找到 我的工具 - <span class="my">[激活码] </span>,点击激活码
  431. 即可兑换使用激活码啦。</div>
  432. <img class="point-img" src="../static/img/point2.png" />
  433. <div class="get-success-block">
  434. <div class="get-success">下载APP</div>
  435. </div>
  436. <img class="close" src="img/close.png" />
  437. </div>
  438. </div>
  439. </div>
  440. <script src="../static/js/vender/verify.js"></script>
  441. <script src="../static/js/vender/vue/vue.min.js"></script>
  442. <script src="../static/js/vender/vue/vue-clipboard.min.js"></script>
  443. <script src="../static/js/vender/vue/vant.min.js"></script>
  444. <script src="../static/js/vender/config.js"></script>
  445. <script src="../static/js/vender/uuid.js"></script>
  446. <script src="../static/js/vender/vue/axios.min.js"></script>
  447. <script src="../static/js/vender/vue/config.js"></script>
  448. <script src="../static/js/vender/vue/api.js"></script>
  449. <script>
  450. toastr.options.positionClass = 'toast-center-center';
  451. toastr.options.timeOut = '1500';
  452. </script>
  453. <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
  454. <script type="text/javascript">
  455. // var meta_description = document.getElementsByTagName('meta')['description']
  456. // document.title = '更新标题'
  457. // meta_description.content = '更新描述'; // Android iOS
  458. // var oInput = document.createElement('input'); //创建一个input
  459. // oInput.setAttribute("readonly", "readonly"); //设置只读,否则移动端使用复制功能时可能会造成软件盘弹出
  460. var u = navigator.userAgent,
  461. app = navigator.appVersion;
  462. var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
  463. var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
  464. var clipboard = new ClipboardJS('.copybtn') //此处为点击的dom的类名
  465. var html = document.documentElement;
  466. var imgWidth = html.getBoundingClientRect().width / 750 * 400 + 'px';
  467. var imgHeight = html.getBoundingClientRect().width / 750 * 200 + 'px';
  468. var barHeight = html.getBoundingClientRect().width / 750 * 70 + 'px';
  469. var code = '';
  470. $('.close')[0].addEventListener('click', (e) => {
  471. $('.dialog').animate({top: '-6.96rem'},"fast");
  472. $('.mask').hide();
  473. document.documentElement.style.overflow='auto';
  474. });
  475. $('.get-success-block')[0].addEventListener('click', (e) => {
  476. if(isIOS){
  477. copyUrl();
  478. }else{
  479. download();
  480. }
  481. });
  482. $('.down-btn')[0].addEventListener('click', (e) => {
  483. let ua = navigator.userAgent.toLowerCase();
  484. if (ua.match(/MicroMessenger/i) == "micromessenger") {
  485. var oInput = document.createElement('input'); //创建一个input
  486. oInput.setAttribute("readonly", "readonly"); //设置只读,否则移动端使用复制功能时可能会造成软件盘弹出
  487. setTimeout(() => {
  488. oInput.value = code;
  489. document.body.appendChild(oInput);
  490. selectText(oInput, 0, oInput.value.length);
  491. document.execCommand("Copy"); // 执行浏览器复制命令
  492. $('.dialog').animate({top: '-6.96rem'},"fast");
  493. $('.mask').hide();
  494. document.documentElement.style.overflow='auto';
  495. oInput.style.display = 'none'; // 将input隐藏
  496. oInput.blur();
  497. oInput.remove(); // 将input销毁
  498. location.href = 'weixin://dl/business/?t=sg6FNjcPWip';
  499. }, 400)
  500. }else{
  501. alert('环境问题')
  502. }
  503. });
  504. function download() {
  505. if (isAndroid) {
  506. if (baseUrl.includes('prese.phone.androidscloud.com')) {
  507. window.location.href = 'http://14.18.190.144:18888/suanchou'
  508. } else {
  509. window.location.href = 'http://www.androidscloud.com/suanchou?timestamp=' + Math.random();
  510. }
  511. } else if (isIOS) {
  512. document.location.href = 'https://www.pgyer.com/gemini6?timestamp=' + Math.random();
  513. } else {
  514. document.location.href = 'https://www.androidscloud.com?timestamp=' + Math.random();
  515. }
  516. }
  517. function copyUrl() {
  518. var oInput = document.createElement('input'); //创建一个input
  519. oInput.setAttribute("readonly", "readonly"); //设置只读,否则移动端使用复制功能时可能会造成软件盘弹出
  520. setTimeout(() => {
  521. oInput.value = code;
  522. // $('.ipt')[0].appendChild(oInput); //将input插入到body
  523. // oInput.select(); // 选择对象 ios不支持
  524. document.body.appendChild(oInput)
  525. selectText(oInput, 0, oInput.value.length);
  526. document.execCommand("Copy"); // 执行浏览器复制命令
  527. toastr.error(`复制成功`);
  528. $('.dialog').animate({top: '-6.96rem'},"fast");
  529. $('.mask').hide();
  530. document.documentElement.style.overflow='auto';
  531. oInput.style.display = 'none'; // 将input隐藏
  532. oInput.blur();
  533. oInput.remove(); // 将input销毁
  534. setTimeout(() => {
  535. document.location.href = 'https://www.pgyer.com/gemini6?timestamp=' + Math.random();
  536. }, 1000)
  537. }, 400)
  538. };
  539. function selectText(textbox, startIndex, stopIndex) {
  540. if (textbox.createTextRange) { //ie
  541. const range = textbox.createTextRange();
  542. range.collapse(true);
  543. range.moveStart('character', startIndex); //起始光标
  544. range.moveEnd('character', stopIndex - startIndex); //结束光标
  545. range.select(); //不兼容苹果
  546. } else { //firefox/chrome
  547. textbox.setSelectionRange(startIndex, stopIndex);
  548. textbox.focus();
  549. }
  550. };
  551. new Vue({
  552. el: '#app',
  553. data: {
  554. isshow: true,
  555. id: GetRequest().id ? GetRequest().id : 404,
  556. username: GetRequest().username ? GetRequest().username : '',
  557. topic: null,
  558. defaultImg: 'this.src="' + "../static/offImg/tou.png" + '"',
  559. marqueeList: [],
  560. code: '',
  561. msg: '活动已下架',
  562. strategyId: GetRequest().strategyId ? GetRequest().strategyId : '',
  563. tagId: GetRequest().tagId ? GetRequest().tagId : '',
  564. uuid: '',
  565. shareInfo: {},
  566. flag: true,
  567. timer: null,
  568. phoneType: '',
  569. type: GetRequest().type,
  570. dataObj: {}
  571. },
  572. created() {
  573. // window.location.href = 'investigate.html'
  574. },
  575. mounted() {
  576. // this.$dialog.alert({
  577. // message: '激活码总数已上限,谢谢参与'
  578. // })
  579. // document.querySelector('#app').classList.remove('hide');
  580. // this.validate(); // 生成验证码
  581. this.getActDetailList();
  582. this.getMarquee(); //跑马灯
  583. if (localStorage.getItem("uuid")) {
  584. this.uuid = localStorage.getItem("uuid");
  585. } else {
  586. this.uuid = UUID.generate();
  587. localStorage.setItem("uuid", this.uuid);
  588. }
  589. },
  590. methods: {
  591. copyHandle(){
  592. getActivationCode(this.username, this.tagId, this.uuid).then(res => {
  593. this.$toast.clear();
  594. if (res.status === 2 || res.status === 11) {
  595. $('#mpanel2').eq(0).text('');
  596. this.validate(); // 生成验证码
  597. setTimeout(() => {
  598. document.getElementById('form-btn').click();
  599. },500)
  600. } else {
  601. systemBuriedPoint({
  602. pointName: 'dt_裂变_h5_复制激活码'
  603. }).then(res => {})
  604. this.code = res.data;
  605. this.copyUrl();
  606. }
  607. }).catch((error) => {
  608. alert(error)
  609. this.$toast('复制失败');
  610. // this.download()
  611. });
  612. },
  613. //查看活动是否下架
  614. getActDetailList() { //获取活动状态
  615. if(GetRequest().type == 1){
  616. getActDetailList(GetRequest().token).then(res => {
  617. this.$toast.clear();
  618. if (res.status === 0) {
  619. this.phoneType = res.data.phoneType;
  620. this.shareInfo = res.data;
  621. if (res.data.actStatus == 1) {
  622. this.isshow = true;
  623. this.getStrategy();
  624. } else {
  625. this.isshow = false;
  626. }
  627. } else {
  628. this.$toast(res.msg);
  629. }
  630. }).catch((error) => {
  631. console.log(error)
  632. this.$toast('网络异常');
  633. });
  634. } else {
  635. getActDetail().then(res => {
  636. this.$toast.clear();
  637. if (res.status === 0) {
  638. this.phoneType = res.data.phoneType;
  639. if (res.data.actStatus == 1) {
  640. this.isshow = true;
  641. this.getStrategy();
  642. } else {
  643. this.isshow = false;
  644. }
  645. } else {
  646. this.$toast(res.msg);
  647. }
  648. }).catch((error) => {
  649. console.log(error)
  650. this.$toast('网络异常');
  651. });
  652. }
  653. },
  654. getCheck() {
  655. getEvantCheck(this.id).then(res => {
  656. console.log(res)
  657. })
  658. },
  659. createCopy(captchaVerification) {
  660. // this.$toast.loading({
  661. // duration: 0,
  662. // message: '加载中...',
  663. // forbidClick: true,
  664. // loadingType: 'spinner',
  665. this.stopManyClick(() => {
  666. systemBuriedPoint({
  667. pointName: 'dt_裂变_h5_复制激活码'
  668. }).then(res => {})
  669. getActivationCode(this.username, this.tagId, this.uuid, captchaVerification).then(res => {
  670. this.$toast.clear();
  671. if (res.status === 0) {
  672. this.code = res.data;
  673. this.copyUrl();
  674. if(isIOS){
  675. code = res.data;
  676. }
  677. // if(isAndroid){
  678. // this.code = res.data;
  679. // this.copyUrl();
  680. // }else if(isIOS){
  681. // $('.dialog').animate({top: '3.36rem'},"fast");
  682. // $('.mask').show();
  683. // document.documentElement.style.overflow='hidden';
  684. // code = res.data;
  685. // } else {
  686. // this.code = res.data;
  687. // this.copyUrl();
  688. // }
  689. } else {
  690. this.$dialog.alert({
  691. message: res.msg
  692. });
  693. setTimeout(() => {
  694. this.$dialog.close();
  695. // this.download();
  696. }, 2000)
  697. }
  698. }).catch((error) => {
  699. alert(error)
  700. this.$toast('复制失败');
  701. // this.download()
  702. });
  703. })
  704. },
  705. download() {
  706. if (isAndroid) {
  707. if (baseUrl.includes('prese.phone.androidscloud.com')) {
  708. window.location.href = 'http://14.18.190.144:18888/suanchou'
  709. } else {
  710. window.location.href = 'http://www.androidscloud.com/suanchou?timestamp=' + Math.random();
  711. }
  712. } else if (isIOS) {
  713. document.location.href = 'https://www.pgyer.com/gemini6?timestamp=' + Math.random();
  714. } else {
  715. document.location.href = 'https://www.androidscloud.com?timestamp=' + Math.random();
  716. }
  717. },
  718. standarImg(id) {
  719. return `${fileCenterApi}/document/newFile/download/0/${uploadKey}?fileKey=${id}`;
  720. },
  721. getMarquee() {
  722. getMarquee().then(res => {
  723. if (res.status === 0) {
  724. this.marqueeList = res.data;
  725. } else {
  726. this.$toast(res.msg);
  727. }
  728. })
  729. },
  730. getStrategy() {
  731. this.$toast.loading({
  732. duration: 0,
  733. message: '加载中...',
  734. forbidClick: true,
  735. loadingType: 'spinner',
  736. });
  737. getStrategy(this.strategyId).then(res => {
  738. this.$toast.clear();
  739. if (res.status === 0) {
  740. if (res.data) {
  741. this.isshow = true;
  742. this.topic = res.data.content;
  743. this.dataObj = res.data;
  744. // this.tagId = res.data.tagId;
  745. console.log(this.topic)
  746. } else {
  747. this.msg = res.msg;
  748. this.isshow = false;
  749. }
  750. }else {
  751. this.$toast(res.msg);
  752. }
  753. console.log(res)
  754. }).catch((error) => {
  755. console.log(error)
  756. this.$toast('网络异常');
  757. });
  758. },
  759. validate() {
  760. $('#mpanel2').slideVerify({
  761. baseUrl: baseUrl + '/api/activity', //服务器请求地址, 默认地址为安吉服务器;
  762. mode: 'pop', //展示模式
  763. containerId: 'form-btn', //pop模式 必填 被点击之后出现行为验证码的元素id
  764. imgSize: { //图片的大小对象,有默认值{ width: '310px',height: '155px'},可省略
  765. width: imgWidth,
  766. height: imgHeight
  767. },
  768. barSize: {//下方滑块的大小对象,有默认值{ width: '310px',height: '50px'},可省略
  769. width: imgWidth,
  770. height: barHeight
  771. },
  772. beforeCheck: () => {
  773. return true
  774. },
  775. ready: () => {
  776. }, //加载完毕的回调
  777. success: (params) => { //成功的回调
  778. this.createCopy(params.captchaVerification);
  779. },
  780. error: function () {}
  781. });
  782. },
  783. handTouch(e){
  784. e.preventDefault();
  785. },
  786. //下载指引弹窗
  787. downloadTip(){
  788. if(isIOS){
  789. $('.copy-tip').eq(0).css('marginTop', '44px');
  790. $('.imgs-block').eq(0).css('display', 'none');
  791. $('.get-success').eq(0).text('下载APP并复制激活码');
  792. }
  793. let ua = navigator.userAgent.toLowerCase();
  794. if(ua.match(/MicroMessenger/i)=="micromessenger"){
  795. $('.miniprogram').eq(0).css('display', 'block');
  796. $('.noMiniprogram').eq(0).css('display', 'none');
  797. }else{
  798. $('.miniprogram').eq(0).css('display', 'none');
  799. $('.noMiniprogram').eq(0).css('display', 'block');
  800. }
  801. $('.dialog').animate({top: '1.8rem'},"fast");
  802. $('.mask').show();
  803. document.documentElement.style.overflow='hidden';
  804. },
  805. copyUrl() {
  806. var oInput = document.createElement('input'); //创建一个input
  807. oInput.setAttribute("readonly", "readonly"); //设置只读,否则移动端使用复制功能时可能会造成软件盘弹出
  808. setTimeout(() => {
  809. oInput.value = this.code;
  810. // $('.ipt')[0].appendChild(oInput); //将input插入到body
  811. // oInput.select(); // 选择对象 ios不支持
  812. document.body.appendChild(oInput)
  813. this.selectText(oInput, 0, oInput.value.length);
  814. document.execCommand("Copy"); // 执行浏览器复制命令
  815. // this.$dialog.alert({
  816. // message: `复制成功`
  817. // })
  818. oInput.style.display = 'none'; // 将input隐藏
  819. oInput.blur();
  820. oInput.remove(); // 将input销毁
  821. setTimeout(() => {
  822. this.$dialog.close();
  823. this.downloadTip();
  824. // this.download();
  825. }, 100)
  826. }, 400)
  827. },
  828. selectText(textbox, startIndex, stopIndex) {
  829. if (textbox.createTextRange) { //ie
  830. const range = textbox.createTextRange();
  831. range.collapse(true);
  832. range.moveStart('character', startIndex); //起始光标
  833. range.moveEnd('character', stopIndex - startIndex); //结束光标
  834. range.select(); //不兼容苹果
  835. } else { //firefox/chrome
  836. textbox.setSelectionRange(startIndex, stopIndex);
  837. textbox.focus();
  838. }
  839. },
  840. share(){
  841. let middle = this.shareInfo.gotoUrl.split('=')[1];
  842. let result = middle.split('&')[0];
  843. const {
  844. content,
  845. shareImg
  846. } = this.shareInfo;
  847. let title = '免费领机:' + decodeURIComponent(GetRequest().title);
  848. systemBuriedPoint({
  849. pointName: 'dt_裂变_h5_分享攻略'
  850. }).then(res => {})
  851. if (isAndroid) {
  852. window.native.share(title, content, `${baseUrl}/h5/microserviceUserH5/vcloud/actFissionShare.html?username=${result}&strategyId=${this.strategyId}&tagId=${GetRequest().tagId}`, shareImg)
  853. } else if (isIOS) {
  854. window.webkit.messageHandlers.share.postMessage({
  855. title: title,
  856. content: content,
  857. gotoUrl: `${baseUrl}/h5/microserviceUserH5/vcloud/actFissionShare.html?username=${result}&strategyId=${this.strategyId}&tagId=${GetRequest().tagId}`,
  858. shareImg: shareImg
  859. });
  860. } else {
  861. code = window.Location.href;
  862. copyUrl();
  863. }
  864. },
  865. stopManyClick(fn) { //防抖
  866. if (this.flag) {
  867. fn();
  868. }
  869. this.flag = false;
  870. if (this.timer) {
  871. clearTimeout(this.timer);
  872. }
  873. this.timer = setTimeout(() => {
  874. this.flag = true
  875. }, 1500);
  876. },
  877. onCopy() {
  878. console.log(2323);
  879. this.$toast('复制成功');
  880. },
  881. onError() {
  882. this.$toast('复制失败');
  883. },
  884. }
  885. })
  886. </script>
  887. </body>
  888. </html>