test.html 15 KB

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