初始为新媒体h5页

media_land_page1.html 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  1. <!DOCTYPE html>
  2. <html lang="zh" style="font-size: 365.867px;">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <meta content="yes" name="apple-mobile-web-app-capable">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0">
  7. <meta http-equiv="X-UA-Compatible" content="IE=8">
  8. <meta http-equiv="Expires" content="0">
  9. <meta http-equiv="Pragma" content="no-cache">
  10. <meta http-equiv="Cache-control" content="no-cache">
  11. <meta http-equiv="Cache" content="no-cache">
  12. <link rel="stylesheet" type="text/css" href="./static/public_css.css">
  13. <link rel="stylesheet" type="text/css" href="./static/common.css">
  14. <script type="text/javascript" src="./static/public.js"></script>
  15. <script type="text/javascript" src="./static/nanoid.js"></script>
  16. <script type="text/javascript" src="./static/jquery-2.1.0.js"></script>
  17. <script type="text/javascript" src="./static/vue.js"></script>
  18. <!-- <script src="https://cdn.jsdelivr.net/npm/vue@2"></script> -->
  19. <title>999感冒灵-暖心补给大吉大灵</title>
  20. <style>
  21. .container {
  22. background-color: #525E75;
  23. min-height: 100vh;
  24. box-sizing: border-box;
  25. position: relative;
  26. }
  27. .container .bg-img {
  28. width: 100%;
  29. }
  30. .title-btn {
  31. position: absolute;
  32. width: 2.5rem;
  33. top: 5.2rem;
  34. left: 50%;
  35. transform: translateX(-50%);
  36. }
  37. .container .prize-wrap {
  38. position: absolute;
  39. width: 100%;
  40. top: 7.35rem;
  41. left: 0;
  42. display: flex;
  43. flex-wrap: wrap;
  44. justify-content: space-around;
  45. align-items: center;
  46. padding: 0 0.25rem;
  47. }
  48. .container .prize-wrap .prize-item {
  49. width: 0.95rem;
  50. margin-bottom: 0.07rem;
  51. }
  52. .container .prize-wrap .prize-item:nth-child(7),
  53. .container .prize-wrap .prize-item:nth-child(8),
  54. .container .prize-wrap .prize-item:nth-child(9) {
  55. margin-bottom: 0;
  56. }
  57. .container .prize-wrap .prize-item img {
  58. width: 100%;
  59. }
  60. .container .prize-wrap .prize-item.active img {
  61. transform: scale(1.1);
  62. }
  63. .container .context {
  64. position: fixed;
  65. bottom: 50vh;
  66. width: 100%;
  67. z-index: 100;
  68. display: flex;
  69. justify-content: center;
  70. align-items: center;
  71. }
  72. .container .context .tip {
  73. background-color: rgba(40, 40, 40, 0.8);
  74. color: aliceblue;
  75. font-size: 0.13rem;
  76. padding: 0.1rem;
  77. border-radius: 0.08rem;
  78. }
  79. .win-dialog {
  80. position: fixed;
  81. top: 20vh;
  82. left: 50%;
  83. transform: translateX(-50%);
  84. z-index: 99;
  85. }
  86. .win-dialog .win-wrap {
  87. position: relative;
  88. width: 99vw;
  89. }
  90. .win-dialog .win-wrap .win-bg {
  91. width: 103%;
  92. margin-left: -0.18rem;
  93. }
  94. .win-dialog .win-wrap .win-prizeName {
  95. position: absolute;
  96. top: 1.88rem;
  97. /* left: 50%;
  98. transform: translateX(-45%); */
  99. color: #fff;
  100. text-align: center;
  101. display: flex;
  102. flex-direction: column;
  103. align-items: center;
  104. justify-content: center;
  105. height: 40px;
  106. width: 100%;
  107. margin-left: 0.06rem;
  108. }
  109. .win-dialog .win-wrap .win-prizeName .win-prizeName-name{
  110. font-size: 0.15rem;
  111. font-weight: 500;
  112. line-height: 0.18rem;
  113. }
  114. .win-dialog .win-wrap .win-prizeName-note {
  115. font-size: 0.1rem;
  116. transform: scale(0.88);
  117. margin-top: -0.03rem;
  118. }
  119. .win-dialog .win-wrap .win-prizeImg {
  120. position: absolute;
  121. top: 0.95rem;
  122. left: 50%;
  123. transform: translateX(-40%);
  124. width: 0.7rem;
  125. height: 0.7rem;
  126. }
  127. .win-dialog .win-wrap .win-name {
  128. position: absolute;
  129. bottom: 1.4rem;
  130. left: 1.1rem;
  131. width: 1.9rem;
  132. height: 0.22rem;
  133. font-size: 0.11rem;
  134. font-weight: 500;
  135. background-color: transparent;
  136. border: none;
  137. outline: none;
  138. color: #fff;
  139. }
  140. .win-dialog .win-wrap .win-phone {
  141. position: absolute;
  142. bottom: 1.05rem;
  143. left: 1.1rem;
  144. width: 1.9rem;
  145. height: 0.22rem;
  146. font-size: 0.11rem;
  147. font-weight: 500;
  148. background-color: transparent;
  149. border: none;
  150. outline: none;
  151. color: #fff;
  152. }
  153. .win-dialog .win-wrap .win-adress {
  154. position: absolute;
  155. bottom: 0.7rem;
  156. left: 1.1rem;
  157. width: 1.9rem;
  158. height: 0.22rem;
  159. font-size: 0.11rem;
  160. font-weight: 500;
  161. background-color: transparent;
  162. border: none;
  163. outline: none;
  164. color: #fff;
  165. }
  166. .win-dialog .win-wrap .win-submit {
  167. position: absolute;
  168. bottom: 0.2rem;
  169. left: 1.15rem;
  170. width: 1.4rem;
  171. }
  172. .lose-dialog {
  173. position: fixed;
  174. top: 25vh;
  175. left: 50%;
  176. transform: translateX(-50%);
  177. z-index: 99;
  178. }
  179. .lose-dialog .lose-wrap {
  180. position: relative;
  181. width: 96vw;
  182. }
  183. .lose-dialog .lose-wrap .lose-bg {
  184. width: 100%;
  185. margin-left: -0.12rem;
  186. }
  187. .close-btn {
  188. position: absolute;
  189. right: 0.1rem;
  190. top: -0.25rem;
  191. width: 0.25rem;
  192. height: 0.25rem;
  193. }
  194. </style>
  195. <script type="text/javascript">
  196. var url_params = getQueryUrl();
  197. var mz_ca = url_params.mz_ca || ''
  198. var mz_sp = url_params.mz_sp
  199. // 获取地址栏信息
  200. function getQueryUrl () {
  201. let url = window.location.href;
  202. let result = {};
  203. if (url.indexOf('?') > -1) {
  204. let str = url.split('?')[1];
  205. let temp = str.split('&');
  206. for (let i = 0; i < temp.length; i++) {
  207. let temp2 = temp[i].split('=');
  208. result[temp2[0]] = temp2[1]
  209. }
  210. }
  211. return result
  212. }
  213. </script>
  214. <script>
  215. (function(a, e, f, g, b, c, d) {
  216. a.ClickiTrackerName = b;
  217. a[b] = a[b] || function() {(a[b].queue = a[b].queue || []).push(arguments)};
  218. a[b].start = +new Date; c = e.createElement(f); d = e.getElementsByTagName(f)[0];
  219. c.async = 1; c.src = g; d.parentNode.insertBefore(c, d)
  220. })(window, document, 'script', '//stm-cdn.cn.miaozhen.com/clicki.min.js?v='+Math.round(new Date().getTime()/1000/300), 'stm_clicki');
  221. // console.log('mz_ca => ', mz_ca)
  222. // console.log('mz_sp => ', mz_sp)
  223. // var dcParam = 'dc-' + mz_ca
  224. // stm_clicki('create', dcParam, 'auto');
  225. stm_clicki('create', 'dc-2000593', 'auto');
  226. stm_clicki('send', 'pageview');
  227. </script>
  228. </head>
  229. <body>
  230. <div id="app" class="container">
  231. <div v-if="isShowWinDialog || isShowLoseDialog" class="mask"></div>
  232. <div class="context" v-show="isShowMsg">
  233. <span class="tip">{{ msg }}</span>
  234. </div>
  235. <img src="./static/bg-img.png" class="bg-img" />
  236. <img src="./static/title-btn.png" class="title-btn" />
  237. <div class="prize-wrap">
  238. <div
  239. v-for="(item, idx) in prizeList"
  240. :key="idx"
  241. :class="['prize-item', currentIdx === idx ? 'active' : '']"
  242. @click="onClickPrizeItem(idx)"
  243. >
  244. <img :src="item.img" />
  245. </div>
  246. </div>
  247. <div class="yszc" @click="showPrivacy = true">《隐私政策》</div>
  248. <div v-if="isShowWinDialog" class="win-dialog">
  249. <div class="win-wrap">
  250. <img class="close-btn" src="./static/close-btn.png" @click="onClickClose" />
  251. <img class="win-bg" src="./static/win-bg.png" />
  252. <img v-show="winPrizeImg" class="win-prizeImg" :src="winPrizeImg" />
  253. <div class="win-prizeName">
  254. <span class="win-prizeName-name">{{ winPrizeName }}</span>
  255. <p class="win-prizeName-note" v-if="winPrizeNote && winPrizeNote != ''">{{ winPrizeNote }}</p>
  256. </div>
  257. <input class="win-name" v-model="name" placeholder="请输入您的姓名" />
  258. <input class="win-phone" v-model="phone" placeholder="请输入您的电话" />
  259. <input class="win-adress" v-model="adress" placeholder="请输入您的地址" />
  260. <img class="win-submit" src="./static/submit-btn.png" @click="onClickSubmit" />
  261. </div>
  262. </div>
  263. <div v-if="isShowLoseDialog" class="lose-dialog">
  264. <div class="lose-wrap">
  265. <img class="close-btn" src="./static/close-btn.png" @click="onClickClose" />
  266. <img class="lose-bg" src="./static/lose-bg.png?v=1" />
  267. </div>
  268. </div>
  269. <!-- S 秒针隐私政策 -->
  270. <div class="mask" v-show="showPrivacy">
  271. <div class="mask_container">
  272. <div class="mask_title">隐私保护指引概要</div>
  273. <div class="mask_con">
  274. 为了数据统计和分析的目的,我们的平台集成合作方秒针的 SDK,将收集您的如下信息,收集信息的目的、方式和范围具体见下表所示。 若您想进一步了解秒针的个人信息保护政策,您可以前往 <a
  275. href="https://miaozhen.com/cn/privacy" style="color:#3173FF;">https://miaozhen.com/cn/privacy</a> 进行查看。
  276. </div>
  277. <div class="mask_btn" @click="showPrivacy = false">我知道了</div>
  278. </div>
  279. </div>
  280. <!-- E 秒针隐私政策 -->
  281. </div>
  282. <script>
  283. // stm_clicki('send', 'event', '返回首页按钮', '点击', '导航按钮');
  284. console.log('url_params => ', url_params)
  285. var app = new Vue({
  286. el: '#app',
  287. data() {
  288. return {
  289. prizeList: [
  290. { name: '', img: './static/prize-default.png' },
  291. { name: '', img: './static/prize-default.png' },
  292. { name: '', img: './static/prize-default.png' },
  293. { name: '', img: './static/prize-default.png' },
  294. { name: '', img: './static/start-btn.png' },
  295. { name: '', img: './static/prize-default.png' },
  296. { name: '', img: './static/prize-default.png' },
  297. { name: '', img: './static/prize-default.png' },
  298. { name: '', img: './static/prize-default.png' }
  299. ],
  300. prizeIdxList: [0, 1, 2, 5, 8, 7, 6, 3],
  301. currentIdx: '',
  302. intervalTimer: null,
  303. timeoutTimer: null,
  304. uid: '',
  305. name: '',
  306. phone: '',
  307. adress: '',
  308. isShowMsg: false,
  309. msg: '',
  310. winPrizeName: '',
  311. winPrizeImg: '',
  312. winPrizeNote: '',
  313. isShowWinDialog: false,
  314. isShowLoseDialog: false,
  315. showPrivacy: false
  316. }
  317. },
  318. watch: {
  319. isShowMsg(isShow) {
  320. if (isShow) {
  321. setTimeout(() => {
  322. this.isShowMsg = false;
  323. }, 2000);
  324. }
  325. },
  326. },
  327. mounted() {
  328. this.handleGetUserInfo()
  329. },
  330. methods: {
  331. handleGetUserInfo() {
  332. this.uid = localStorage.getItem('uid') || ''
  333. if (!this.uid) {
  334. this.uid = nanoid && nanoid(10)
  335. localStorage.setItem('uid', this.uid)
  336. }
  337. console.log('this.uid => ', this.uid)
  338. },
  339. handleSetCurrentDay() {
  340. let date = new Date();
  341. let currentDay = date.getDate();
  342. localStorage.setItem('currentDay', currentDay)
  343. },
  344. handleGetIsJoined() { // 每天1次抽奖
  345. this.handleSetCurrentDay()
  346. const preDay = localStorage.getItem('preDay') || 0
  347. const currentDay = localStorage.getItem('currentDay')
  348. if (preDay && (Number(preDay) === Number(currentDay))) {
  349. return true
  350. } else {
  351. localStorage.setItem('preDay', currentDay)
  352. return false
  353. }
  354. },
  355. // handleGetIsJoined() { // 每个设备(uid)1次抽奖
  356. // const isJoined = localStorage.getItem('isJoined') || false
  357. // return isJoined
  358. // },
  359. // handleGetIsJoined() { // 不限制次数
  360. // return false
  361. // },
  362. handleSetIsJoined(isJoined) {
  363. localStorage.setItem('isJoined', isJoined)
  364. },
  365. onClickPrizeItem(idx) {
  366. if (idx !== 4) return
  367. this.handleStart()
  368. },
  369. handleStart() {
  370. try {
  371. stm_clicki('send', 'event', '按钮', '点击', '抽奖按钮');
  372. } catch (error) {
  373. console.log(error)
  374. }
  375. if (this.handleGetIsJoined()) {
  376. this.msg = '您今日已参与过抽奖'
  377. this.isShowMsg = true
  378. return
  379. }
  380. this.handleSetIsJoined(true)
  381. this.handleGo()
  382. this.handleGetLucky()
  383. },
  384. handleGo() {
  385. let step = 0
  386. this.intervalTimer = setInterval(() => {
  387. if (step <= 7) {
  388. this.currentIdx = this.prizeIdxList[step]
  389. step++
  390. } else {
  391. this.currentIdx = 0
  392. step = 0
  393. }
  394. }, 60);
  395. },
  396. handleStop() {
  397. this.intervalTimer && clearInterval(this.intervalTimer)
  398. this.intervalTimer = null
  399. this.timeoutTimer && clearTimeout(this.timeoutTimer)
  400. this.timeoutTimer = null
  401. this.currentIdx = ''
  402. },
  403. handleGetLucky() {
  404. $.ajax({
  405. type: "post",
  406. url: "/api/kx/luckyDraw",
  407. dataType: 'json',
  408. data: {
  409. uid: this.uid
  410. },
  411. success: (res) => {
  412. if (this.intervalTimer) {
  413. setTimeout(() => {
  414. this.handleStop()
  415. if (res.code == 0) {
  416. if (res.data.lucky == 1) {
  417. this.winPrizeName = res.data.prize.name
  418. this.winPrizeImg = res.data.prize.img
  419. this.winPrizeNote = res.data.prize.note
  420. this.isShowWinDialog = true
  421. } else {
  422. this.isShowLoseDialog = true
  423. }
  424. } else {
  425. this.msg = res.msg
  426. this.isShowMsg = true
  427. }
  428. }, 2000);
  429. } else {
  430. if (res.code == 0) {
  431. if (res.data.lucky == 1) {
  432. this.winPrizeName = res.data.prize.name
  433. this.winPrizeImg = res.data.prize.img
  434. this.winPrizeNote = res.data.prize.note
  435. this.isShowWinDialog = true
  436. } else {
  437. this.isShowLoseDialog = true
  438. }
  439. } else {
  440. this.msg = res.msg
  441. this.isShowMsg = true
  442. }
  443. }
  444. },
  445. error: () => {
  446. this.handleStop()
  447. }
  448. });
  449. },
  450. onClickSubmit() {
  451. if (!this.name) {
  452. this.msg = '请输入您的姓名'
  453. this.isShowMsg = true
  454. return
  455. }
  456. if (!this.phone) {
  457. this.msg = '请输入您的电话'
  458. this.isShowMsg = true
  459. return
  460. }
  461. if (!this.adress) {
  462. this.msg = '请输入您的地址'
  463. this.isShowMsg = true
  464. return
  465. }
  466. $.ajax({
  467. type: "post",
  468. url: "/api/kx/addLuckyInfo",
  469. dataType: 'json',
  470. data: {
  471. uid: this.uid,
  472. phone: this.phone,
  473. name: this.name,
  474. adress: this.adress,
  475. },
  476. success: (res) => {
  477. if (res.code == 0) {
  478. this.isShowWinDialog = false
  479. this.msg = '提交成功,感谢参与'
  480. this.isShowMsg = true
  481. } else {
  482. this.msg = res.msg
  483. this.isShowMsg = true
  484. }
  485. }
  486. });
  487. },
  488. onClickClose() {
  489. this.isShowWinDialog = false
  490. this.isShowLoseDialog = false
  491. },
  492. },
  493. })
  494. </script>
  495. </body>
  496. </html>