actFissionShare.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  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?v=1.0.0.6">
  9. <link rel="stylesheet" href="../static/css/vant.css" />
  10. <script src="../static/js/vender/jquery-3.4.1.min.js"></script>
  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. <script src="../static/js/vender/uuid.js"></script>
  15. <script src="../static/js/vender/vue/axios.min.js"></script>
  16. <script src="../static/js/vender/vue/config.js"></script>
  17. <script src="../static/js/vender/vue/api.js"></script> -->
  18. <title> 分享攻略</title>
  19. <style>
  20. [v-cloak] {
  21. display: none !important;
  22. }
  23. .container {
  24. display: flex;
  25. height: 100vh;
  26. padding: 0.2rem 0.3rem;
  27. /* align-items: center;
  28. justify-content: center; */
  29. }
  30. .top-banner {
  31. width: 6.82rem;
  32. height: 0.82rem;
  33. background: url("../static/offImg/share-top.png") no-repeat;
  34. background-size: 100% 100%;
  35. }
  36. .footer {
  37. position: fixed;
  38. bottom: 0.5rem;
  39. padding: 0 0.3rem;
  40. width: 100%;
  41. left: 0;
  42. display: flex;
  43. justify-content: center;
  44. }
  45. .download-btn {
  46. width: 6.9rem;
  47. height: 1.3rem;
  48. background: url('../static/offImg/btn-down.png') no-repeat scroll top center #3B7FFF;
  49. background-size: 100% 100%;
  50. box-shadow: 0rem 0.06rem 0.4rem 0rem rgba(59, 127, 255, 0.6);
  51. border-radius: 0.2rem;
  52. display: flex;
  53. justify-content: space-between;
  54. align-items: center;
  55. padding: 0 0.4rem;
  56. }
  57. .button-download {
  58. width: 2.5rem;
  59. height: 0.8rem;
  60. line-height: 0.8rem;
  61. background: linear-gradient(360deg, #FF8300 0%, #FEC000 100%);
  62. border-radius: 0.2rem;
  63. text-align: center;
  64. font-size: 0.3rem;
  65. font-family: PingFangSC-Medium, PingFang SC;
  66. color: #FFFFFF;
  67. }
  68. .download-btn .left-nav p:first-of-type {
  69. font-size: 0.24rem;
  70. font-family: PingFangSC-Regular, PingFang SC;
  71. font-weight: 400;
  72. color: rgba(255, 255, 255, 0.7);
  73. margin-bottom: 0.02rem;
  74. }
  75. .download-btn .left-nav p+p {
  76. font-size: 0.28rem;
  77. font-family: PingFangSC-Regular, PingFang SC;
  78. font-weight: 400;
  79. color: rgba(255, 255, 255, 0.9);
  80. }
  81. .hideContainer {
  82. width: 100%;
  83. display: flex;
  84. justify-content: center;
  85. align-items: center;
  86. height: calc(100vh - 1.36rem);
  87. text-align: center;
  88. }
  89. .hideContainer img {
  90. width: 2.8rem;
  91. height: 2.8rem;
  92. }
  93. .hideContainer p {
  94. margin-top: 0.3rem;
  95. font-family: PingFangSC-Regular, PingFang SC;
  96. color: #999999;
  97. font-size: 0.28rem;
  98. }
  99. .top-content {
  100. width: 6.9rem;
  101. padding-bottom: 0.3rem;
  102. }
  103. .top-content .title {
  104. font-size: 0.44rem;
  105. font-family: PingFangSC-Medium, PingFang SC;
  106. color: #000000;
  107. letter-spacing: 0.01rem;
  108. margin-bottom: 0.2rem;
  109. }
  110. .topic-info {
  111. padding-bottom: 1.6rem;
  112. }
  113. .topic-info img {
  114. max-width: 100%;
  115. width: auto;
  116. height: auto;
  117. border-radius: 0.2rem;
  118. margin-bottom: 0.2rem;
  119. margin-top: 0.2rem;
  120. }
  121. .topic-info {
  122. font-size: 0.3rem;
  123. font-family: PingFangSC-Regular, PingFang SC;
  124. font-weight: 400;
  125. color: #333333;
  126. letter-spacing: 0.02rem;
  127. }
  128. .topic-info p {
  129. font-size: 0.36rem;
  130. font-family: PingFangSC-Regular, PingFang SC;
  131. font-weight: 400;
  132. color: #333333;
  133. letter-spacing: 0.02rem;
  134. }
  135. .van-notice-bar {
  136. height: 100%;
  137. background: none;
  138. width: 100%;
  139. }
  140. .notice-swipe {
  141. height: 0.8rem;
  142. line-height: 0.8rem;
  143. }
  144. .van-swipe-item {
  145. display: flex;
  146. align-items: center;
  147. }
  148. .van-swipe-item img {
  149. width: 0.6rem;
  150. margin-left: 0.3rem;
  151. border-radius: 50%;
  152. margin-right: 0.1rem;
  153. height: 0.6rem;
  154. }
  155. .van-swipe-item p {
  156. font-size: 0.28rem;
  157. font-family: PingFangSC-Regular, PingFang SC;
  158. color: #FFFFFF;
  159. }
  160. .van-swipe-item p:first-of-type {
  161. max-width: 2.4rem;
  162. display: block;
  163. overflow: hidden;
  164. word-break: keep-all;
  165. white-space: nowrap;
  166. text-overflow: ellipsis;
  167. }
  168. .topic-info img {
  169. max-width: 100%;
  170. width: auto;
  171. height: auto;
  172. border-radius: 0.2rem;
  173. margin-bottom: 0.2rem;
  174. margin-top: 0.2rem;
  175. }
  176. .topic-info p {
  177. font-size: 0.3rem;
  178. font-family: PingFangSC-Regular, PingFang SC;
  179. font-weight: 400;
  180. color: #333333;
  181. letter-spacing: 0.02rem;
  182. }
  183. .van-dialog__footer {
  184. display: none;
  185. }
  186. .top-banner {
  187. margin: 0 auto;
  188. }
  189. .hide {
  190. display: none;
  191. }
  192. </style>
  193. </head>
  194. <body>
  195. <div id="app" v-cloak class="container ">
  196. <div v-if='isshow&&topic!=null' style="margin: 0 auto;">
  197. <div class="top-banner">
  198. <van-notice-bar :scrollable="false">
  199. <van-swipe vertical class="notice-swipe" :autoplay="2000" :show-indicators="false">
  200. <van-swipe-item v-for="(item,index) in marqueeList">
  201. <img :src="standarImg(item.headImgUrl)" :onerror="defaultImg" alt="">
  202. <p class="hide">测试1212111111112</p>
  203. <p>{{item.surfaceName}}</p>
  204. <p>已获得星动云手机套餐</p>
  205. </van-swipe-item>
  206. </van-swipe>
  207. </van-notice-bar>
  208. </div>
  209. <div class="top-content">
  210. <div v-html="topic" class="topic-info"></div>
  211. <div class="ipt"></div>
  212. </div>
  213. <div class="footer">
  214. <div class="download-btn">
  215. <div class="left-nav">
  216. <p>激活码:</p>
  217. <p>AS4*********SD3</p>
  218. </div>
  219. <div class="button-download copybtn" @click='createCopy()'>点击复制并下载</div>
  220. </div>
  221. </div>
  222. </div>
  223. <div v-if='!isshow' class="hideContainer">
  224. <div>
  225. <img src="../static/offImg/no-data.png" alt="" />
  226. <p>{{msg}},敬请期待</p>
  227. </div>
  228. </div>
  229. </div>
  230. <!-- <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script> -->
  231. <script src="../static/js/vender/vue/vue.min.js"></script>
  232. <script src="../static/js/vender/vue/vant.min.js"></script>
  233. <script src="../static/js/vender/config.js"></script>
  234. <script src="../static/js/vender/uuid.js"></script>
  235. <script src="../static/js/vender/vue/axios.min.js"></script>
  236. <script src="../static/js/vender/vue/config.js"></script>
  237. <script src="../static/js/vender/vue/api.js"></script>
  238. <script type="text/javascript">
  239. // var meta_description = document.getElementsByTagName('meta')['description']
  240. // document.title = '更新标题'
  241. // meta_description.content = '更新描述'; // Android iOS
  242. var u = navigator.userAgent,
  243. app = navigator.appVersion;
  244. var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
  245. var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
  246. new Vue({
  247. el: '#app',
  248. data: {
  249. isshow: true,
  250. id: GetRequest().id ? GetRequest().id : 404,
  251. username: GetRequest().username ? GetRequest().username : 'KtIC61639034703',
  252. topic: null,
  253. defaultImg: 'this.src="' + "../static/offImg/tou.png" + '"',
  254. marqueeList: [],
  255. code: '',
  256. msg: '活动已下架',
  257. tagId: 0,
  258. uuid: '',
  259. flag: true,
  260. timer: null,
  261. },
  262. created() {
  263. // window.location.href = 'investigate.html'
  264. },
  265. mounted() {
  266. // document.querySelector('#app').classList.remove('hide');
  267. this.getActDetail();
  268. this.getMarquee(); //跑马灯
  269. if (localStorage.getItem("uuid")) {
  270. this.uuid = localStorage.getItem("uuid");
  271. } else {
  272. this.uuid = UUID.generate();
  273. localStorage.setItem("uuid", this.uuid);
  274. }
  275. console.log(this.uuid);
  276. },
  277. methods: {
  278. //查看活动是否下架
  279. getActDetail() { //获取活动状态
  280. getActDetail().then(res => {
  281. this.$toast.clear();
  282. if (res.status === 0) {
  283. if (res.data.actStatus == 1) {
  284. this.isshow = true;
  285. this.getStrategy();
  286. } else {
  287. this.isshow = false;
  288. }
  289. } else {
  290. this.$toast(res.msg);
  291. }
  292. }).catch((error) => {
  293. console.log(error)
  294. this.$toast('网络异常');
  295. });
  296. },
  297. getCheck() {
  298. getEvantCheck(this.id).then(res => {
  299. console.log(res)
  300. })
  301. },
  302. createCopy() {
  303. // this.$toast.loading({
  304. // duration: 0,
  305. // message: '加载中...',
  306. // forbidClick: true,
  307. // loadingType: 'spinner',
  308. // });
  309. systemBuriedPoint({
  310. pointName: 'dt_裂变_h5_复制激活码'
  311. }).then(res => {})
  312. // var clipboard = new ClipboardJS('.copybtn')
  313. getActivationCode(this.username, this.tagId, this.uuid).then(res => {
  314. this.$toast.clear();
  315. if (res.status === 0) {
  316. //此处为点击的dom的类名
  317. this.code = res.data;
  318. console.log(this.code);
  319. this.copyUrl(this.code);
  320. } else {
  321. this.$dialog.alert({
  322. message: res.msg
  323. });
  324. setTimeout(() => {
  325. this.$dialog.close();
  326. }, 2000)
  327. }
  328. }).catch((error) => {
  329. console.log(error)
  330. this.$toast('复制失败');
  331. });
  332. },
  333. download() {
  334. if (isAndroid) {
  335. console.log(isAndroid);
  336. window.location.href =
  337. 'http://www.androidscloud.com//suanchou';
  338. } else if (isIOS) {
  339. window.location.href = 'https://www.pgyer.com/gemini6';
  340. }
  341. },
  342. standarImg(id) {
  343. return `${fileCenterApi}/file-center/fileOperate/getImage?id=${id}`;
  344. },
  345. getMarquee() {
  346. getMarquee().then(res => {
  347. if (res.status === 0) {
  348. this.marqueeList = res.data;
  349. } else {
  350. this.$toast(res.msg);
  351. }
  352. })
  353. },
  354. getStrategy() {
  355. this.$toast.loading({
  356. duration: 0,
  357. message: '加载中...',
  358. forbidClick: true,
  359. loadingType: 'spinner',
  360. });
  361. getStrategy().then(res => {
  362. this.$toast.clear();
  363. if (res.status == 0) {
  364. if (res.data) {
  365. this.isshow = true;
  366. this.topic = res.data.content;
  367. this.tagId = res.data.tagId;
  368. console.log(this.topic)
  369. } else {
  370. this.msg = res.msg;
  371. this.isshow = false;
  372. }
  373. }
  374. console.log(res)
  375. }).catch((error) => {
  376. console.log(error)
  377. this.$toast('网络异常');
  378. });
  379. },
  380. copyUrl() {
  381. this.stopManyClick(() => {
  382. var oInput = document.createElement('input'); //创建一个input
  383. oInput.setAttribute("readonly", "readonly"); //设置只读,否则移动端使用复制功能时可能会造成软件盘弹出
  384. // this.$nextTick();
  385. setTimeout(() => {
  386. try {
  387. const input = document.createElement('textarea')
  388. input.value = this.code
  389. document.body.appendChild(input)
  390. input.select() // 选择对象
  391. document.execCommand('Copy') // 执行浏览器复制命令
  392. input.style.display = 'none'
  393. input.remove()
  394. this.$dialog.alert({
  395. message: `复制成功`
  396. });
  397. setTimeout(() => {
  398. this.$dialog.close();
  399. this.download();
  400. }, 2000)
  401. } catch (err) {
  402. this.$dialog.alert({
  403. message: `复制失败`
  404. });
  405. setTimeout(() => {
  406. this.$dialog.close();
  407. // this.download();
  408. }, 2000)
  409. }
  410. }, 0)
  411. })
  412. },
  413. selectText(textbox, startIndex, stopIndex) {
  414. if (textbox.createTextRange) { //ie
  415. const range = textbox.createTextRange();
  416. range.collapse(true);
  417. range.moveStart('character', startIndex); //起始光标
  418. range.moveEnd('character', stopIndex - startIndex); //结束光标
  419. range.select(); //不兼容苹果
  420. } else { //firefox/chrome
  421. textbox.setSelectionRange(startIndex, stopIndex);
  422. textbox.focus();
  423. }
  424. },
  425. stopManyClick(fn) { //防抖
  426. if (this.flag) {
  427. fn();
  428. }
  429. this.flag = false;
  430. if (this.timer) {
  431. clearTimeout(this.timer);
  432. }
  433. this.timer = setTimeout(() => {
  434. this.flag = true
  435. }, 1500);
  436. },
  437. onCopy() {
  438. console.log(2323);
  439. this.$toast('复制成功');
  440. },
  441. onError() {
  442. this.$toast('复制失败');
  443. },
  444. }
  445. })
  446. </script>
  447. </body>
  448. </html>