fission-page.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Title</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
  7. <link rel="stylesheet" href="css/weui.min.css"/>
  8. <link rel="stylesheet" href="css/weuix.min.css"/>
  9. <script src="js/md5.js"></script>
  10. <script src="js/vue.min.js"></script>
  11. <script src="js/zepto.min.js"></script>
  12. <script src="js/zepto.weui.min.js"></script>
  13. <script src="js/php.js"></script>
  14. <script src="js/axios.min.js"></script>
  15. <script src="js/weChatSdk.js?version=1.6"></script>
  16. </head>
  17. <body style="touch-action: none;">
  18. <div id="myApp" class="bg-box">
  19. <img alt="" class="headImg-box" :src=headSrc>
  20. <div class="content-box">
  21. <img alt="" :src=contentSrc />
  22. </div>
  23. <div class="num-box" v-if="startCount > 0">
  24. 已有 <span style="color: #A4404E">{{num}}</span> 人领取成功
  25. </div>
  26. <!--<img class="get-btn-box" src="image/get-free.gif" alt="" onclick="isfollowqr('http://open.weixin.qq.com/qr/code?username=hszuqiu')" />-->
  27. <div class="download-box">
  28. <img class="get-btn-box" src="image/get-free.gif" alt="free" @click="goWeChat" v-if="startCount > 0"/>
  29. <div class="download-content" v-if="startCount === 0">
  30. <div>
  31. <i>第一步.</i>
  32. <span class="font-monospace">复制提取码</span>
  33. <span class="download-code">{{downLoadObj.code}}</span>
  34. <button @click="copyCode">复制</button>
  35. </div>
  36. <div>
  37. <i>第二步.</i>
  38. <span class="font-monospace">下载地址:</span>
  39. <a class="share-font download-url">{{downLoadObj.url}}</a>
  40. </div>
  41. <div class="download-footer">
  42. <p>【温馨提示】不建议购买网盘会员,由于文件过大,请保存后在电脑上打开网盘,先下载到本地电脑,再解压!</p>
  43. </div>
  44. </div>
  45. </div>
  46. <div class="modal-share" v-show="isShareFlag">
  47. <img src="./image/share-arrow.png" alt="">
  48. <div class="share-content">
  49. <p>为了帮助更多的家庭</p>
  50. <p>点击菜单<span class="share-font">“发送给朋友”</span></p>
  51. <p>分享到<span class="share-font" style="text-decoration: underline;">{{this.startCount}}个</span>家长群或特教群</p>
  52. <p class="share-font">分享成功后即可学习!</p>
  53. </div>
  54. <footer class="share-footer" @click="closeShareModal">知道了</footer>
  55. </div>
  56. </div>
  57. </body>
  58. <script>
  59. const apiUrl = 'http://fission.xazhima.com/api/api.php';
  60. const thisUrl = 'http://fission.xazhima.com/front-page/fission-page.html';
  61. new Vue({
  62. el:'#myApp',
  63. data:{
  64. num:52255,
  65. headSrc:'image/headImg.png',
  66. contentSrc:"image/content-bg.png",
  67. weChatCode:'',
  68. isFollow:'0',
  69. openId:'',
  70. shareCount:0,
  71. startCount:4,
  72. isShareFlag:false,
  73. downLoadObj:{
  74. code:'qaki',
  75. url:'https://pan.baidu.com/s/1TwABWTpV8cMID9j2_hMdag'
  76. }
  77. },
  78. methods:{
  79. goWeChat(){
  80. if(this.isFollow === '0'){
  81. location.href = 'http://mp.weixin.qq.com/mp/getmasssendmsg?__biz=MzUzOTcwMjM0OQ==#wechat_webview_type=1&wechat_redirect'
  82. }
  83. else {
  84. this.isShareFlag = true;
  85. this.startCount--;
  86. if(this.startCount === 0){
  87. this.isShareFlag = false;
  88. }
  89. }
  90. },
  91. subStrUrlCode: function () {
  92. let weChatCodeUrl = location.search; //获取url中"?"符后的字符串
  93. let theRequest = {};
  94. if (weChatCodeUrl.indexOf("?") !== -1) {
  95. let str = weChatCodeUrl.substr(1);
  96. let strS = str.split("&");
  97. for(let i = 0; i < strS.length; i ++) {
  98. theRequest[strS[i].split("=")[0]]=(strS[i].split("=")[1]);
  99. }
  100. }
  101. console.log(theRequest);
  102. return theRequest.code;
  103. },
  104. closeShareModal(){
  105. this.isShareFlag = false;
  106. },
  107. copyCode(){
  108. document.execCommand(this.downLoadObj.code); // 执行浏览器复制命令
  109. alert('复制成功!')
  110. },
  111. judgeLogin(){
  112. axios({
  113. method: 'post', //请求方式 有常用的有get post等
  114. url: apiUrl, //请求地址
  115. data: {
  116. method: 'login',
  117. timestamp: 11111111,
  118. sign:md5('login'+'11111111')
  119. }, //代表传过去的参数对象,
  120. transformRequest: [function(data) {
  121. let ret = '';
  122. for (let it in data) {
  123. ret += encodeURIComponent(it) + '=' +
  124. encodeURIComponent(data[it]) + '&'
  125. }
  126. return ret
  127. }], //将传参修改为formData格式 注释则为JSON格式
  128. }).then(function(rs) {
  129. if(rs.data.code === 200) {
  130. window.location.href = rs.data.msg;
  131. console.log(rs.data)
  132. }else {
  133. alert(rs.data.msg)
  134. }
  135. }).catch(function(e) {
  136. console.log(e);
  137. });
  138. },
  139. setWxConfig(param){
  140. wx.config({
  141. debug: false,
  142. appId: param.appId,
  143. timestamp: param.timestamp ,
  144. nonceStr : param.nonceStr,
  145. signature: param.signature,
  146. jsApiList: [
  147. 'updateAppMessageShareData'
  148. ]
  149. });
  150. wx.ready(function () {
  151. wx.updateAppMessageShareData({
  152. title: '语言训练认知图片大全AAAA', // 分享标题
  153. desc: '已有239218领取成功语言训练认知图片大全AAAA', // 分享描述
  154. link: thisUrl, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
  155. imgUrl: this.headSrc, // 分享图标
  156. // type: 'link', // 分享类型:music | video | link,默认为:link
  157. // dataUrl: '', // 如果type为:music | video,则要提供数据,默认为:空
  158. success: function(){
  159. console.log('success')
  160. },
  161. })
  162. })
  163. },
  164. sendCodeRequest(){
  165. let that = this , jsUrl = location.href.split('#')[0];
  166. axios({
  167. method: 'post', //请求方式 有常用的有get post等
  168. url: apiUrl, //请求地址
  169. data: {
  170. method: 'wxinfo',
  171. timestamp: 11111111,
  172. code:that.weChatCode,
  173. jsUrl:jsUrl,
  174. sign:md5('wxinfo'+'11111111')
  175. }, //代表传过去的参数对象,
  176. transformRequest: [function(data) {
  177. let ret = '';
  178. for (let it in data) {
  179. ret += encodeURIComponent(it) + '=' +
  180. encodeURIComponent(data[it]) + '&'
  181. }
  182. return ret
  183. }], //将传参修改为formData格式 注释则为JSON格式
  184. }).then(function(rs) {
  185. if(rs.data.code === 200) {
  186. that.setWxConfig(rs.data.msg.js_sign);
  187. that.headSrc = rs.data.msg.headimgurl;
  188. that.isFollow = rs.data.msg.subscribe;
  189. that.openId = rs.data.msg.openid;
  190. }else {
  191. alert(rs.data.msg)
  192. }
  193. }).catch(function(e) {
  194. console.log(e);
  195. });
  196. },
  197. addCountRequest(){
  198. axios({
  199. method: 'post', //请求方式 有常用的有get post等
  200. url: apiUrl, //请求地址
  201. data: {
  202. method: 'addcount',
  203. timestamp: 11111111,
  204. openid:this.openId,
  205. sign:md5('addcount'+'11111111')
  206. }, //代表传过去的参数对象,
  207. transformRequest: [function(data) {
  208. let ret = '';
  209. for (let it in data) {
  210. ret += encodeURIComponent(it) + '=' +
  211. encodeURIComponent(data[it]) + '&'
  212. }
  213. return ret
  214. }], //将传参修改为formData格式 注释则为JSON格式
  215. }).then(function(rs) {
  216. if(rs.data.code === 200) {
  217. this.shareCount = Number(rs.data.msg.count)
  218. }else {
  219. alert(rs.data.msg)
  220. }
  221. }).catch(function(e) {
  222. console.log(e);
  223. });
  224. },
  225. },
  226. mounted(){
  227. this.weChatCode = this.subStrUrlCode();
  228. this.weChatCode ? this.sendCodeRequest() : this.judgeLogin()
  229. }
  230. })
  231. </script>
  232. <style>
  233. .bg-box{
  234. width: 100%;
  235. height: 100%;
  236. background-image: url(./image/bg.jpg);
  237. background-size: 100% 100%;
  238. background-repeat: no-repeat;
  239. display: flex;
  240. flex-direction: column;
  241. align-items: center;
  242. }
  243. .content-box {
  244. width: 90%;
  245. height: 60%;
  246. background-color: #ffffff;
  247. border-radius: 10px;
  248. z-index: 99;
  249. margin-top: 15%;
  250. position: relative;
  251. }
  252. .content-box img {
  253. margin-top: 10%;
  254. width: 100%;
  255. }
  256. .headImg-box {
  257. width: 80px;
  258. height: 80px;
  259. border-radius: 40px;
  260. position: absolute;
  261. top: 15px;
  262. z-index: 100;
  263. }
  264. .num-box {
  265. font-size: 1rem;
  266. font-family: fantasy
  267. }
  268. .get-btn-box {
  269. width: 65%;
  270. border-radius: 3%;
  271. }
  272. .download-box {
  273. display: flex;
  274. justify-content: center;
  275. }
  276. .download-content {
  277. padding: 10px;
  278. }
  279. .download-content i {
  280. font-size: 18px;
  281. font-weight: 700;
  282. }
  283. .download-content button {
  284. color: #fff;
  285. background-color: rgba(206,61,70,1);
  286. width: 75px;
  287. border-radius: 20px;
  288. height: 40px;
  289. font-size: 16px;
  290. border: none;
  291. float: right;
  292. }
  293. .font-monospace {
  294. font-size: 18px;
  295. font-family: monospace;
  296. font-weight: 600;
  297. }
  298. .download-code {
  299. border: 1px dashed #888;
  300. padding: 8px;
  301. color: rgba(166,44,53,1);
  302. }
  303. .download-url {
  304. width: 350px;
  305. font-size: 18px;
  306. text-decoration: underline;
  307. word-break: break-word;
  308. }
  309. .download-footer {
  310. padding: 5px;
  311. font-size: 13px;
  312. }
  313. .modal-share {
  314. width: 100%;
  315. height: 100%;
  316. background-color: rgba(0,0,0,.8);
  317. z-index: 108;
  318. display: flex;
  319. flex-direction: column;
  320. justify-content: space-around;
  321. align-items: center;
  322. position: absolute;
  323. }
  324. .modal-share img {
  325. position: absolute;
  326. top: 15px;
  327. right: 0;
  328. }
  329. .share-content {
  330. text-align: center;
  331. color: #F3F3F3;
  332. border: 1px dashed;
  333. padding: 25px;
  334. border-radius: 25px;
  335. margin-top: 30px;
  336. letter-spacing: 2px;
  337. font-family: fantasy;
  338. }
  339. .share-footer {
  340. border: 1px dotted #f1f1f1;
  341. color: #F3F3F3;
  342. width: 120px;
  343. height: 35px;
  344. text-align: center;
  345. line-height: 35px;
  346. border-radius: 5px;
  347. }
  348. .share-font {
  349. color: rgba(166,44,53,1);
  350. }
  351. </style>
  352. </html>