fission-page.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  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. <span class="share-font download-url">{{downLoadObj.url}}</span>
  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. wx.showToast({
  110. title: '复制成功',//提示文字
  111. duration:2000,//显示时长
  112. mask:true,//是否显示透明蒙层,防止触摸穿透,默认:false
  113. icon:'success', //图标,支持"success"、"loading"
  114. })
  115. },
  116. judgeLogin(){
  117. axios({
  118. method: 'post', //请求方式 有常用的有get post等
  119. url: apiUrl, //请求地址
  120. data: {
  121. method: 'login',
  122. timestamp: 11111111,
  123. sign:md5('login'+'11111111')
  124. }, //代表传过去的参数对象,
  125. transformRequest: [function(data) {
  126. let ret = '';
  127. for (let it in data) {
  128. ret += encodeURIComponent(it) + '=' +
  129. encodeURIComponent(data[it]) + '&'
  130. }
  131. return ret
  132. }], //将传参修改为formData格式 注释则为JSON格式
  133. }).then(function(rs) {
  134. if(rs.data.code === 200) {
  135. window.location.href = rs.data.msg;
  136. console.log(rs.data)
  137. }else {
  138. alert(rs.data.msg)
  139. }
  140. }).catch(function(e) {
  141. console.log(e);
  142. });
  143. },
  144. setWxConfig(param){
  145. wx.config({
  146. debug: false,
  147. appId: param.appId,
  148. timestamp: param.timestamp ,
  149. nonceStr : param.nonceStr,
  150. signature: param.signature,
  151. jsApiList: [
  152. 'updateAppMessageShareData'
  153. ]
  154. });
  155. wx.ready(function () {
  156. wx.updateAppMessageShareData({
  157. title: '语言训练认知图片大全AAAA', // 分享标题
  158. desc: '已有239218领取成功语言训练认知图片大全AAAA', // 分享描述
  159. link: thisUrl, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
  160. imgUrl: this.headSrc, // 分享图标
  161. // type: 'link', // 分享类型:music | video | link,默认为:link
  162. // dataUrl: '', // 如果type为:music | video,则要提供数据,默认为:空
  163. success: function(){
  164. console.log('success')
  165. },
  166. })
  167. })
  168. },
  169. sendCodeRequest(){
  170. let that = this , jsUrl = location.href.split('#')[0];
  171. axios({
  172. method: 'post', //请求方式 有常用的有get post等
  173. url: apiUrl, //请求地址
  174. data: {
  175. method: 'wxinfo',
  176. timestamp: 11111111,
  177. code:that.weChatCode,
  178. jsUrl:jsUrl,
  179. sign:md5('wxinfo'+'11111111')
  180. }, //代表传过去的参数对象,
  181. transformRequest: [function(data) {
  182. let ret = '';
  183. for (let it in data) {
  184. ret += encodeURIComponent(it) + '=' +
  185. encodeURIComponent(data[it]) + '&'
  186. }
  187. return ret
  188. }], //将传参修改为formData格式 注释则为JSON格式
  189. }).then(function(rs) {
  190. if(rs.data.code === 200) {
  191. that.setWxConfig(rs.data.msg.js_sign);
  192. that.headSrc = rs.data.msg.headimgurl;
  193. that.isFollow = rs.data.msg.subscribe;
  194. that.openId = rs.data.msg.openid;
  195. }else {
  196. alert(rs.data.msg)
  197. }
  198. }).catch(function(e) {
  199. console.log(e);
  200. });
  201. },
  202. addCountRequest(){
  203. axios({
  204. method: 'post', //请求方式 有常用的有get post等
  205. url: apiUrl, //请求地址
  206. data: {
  207. method: 'addcount',
  208. timestamp: 11111111,
  209. openid:this.openId,
  210. sign:md5('addcount'+'11111111')
  211. }, //代表传过去的参数对象,
  212. transformRequest: [function(data) {
  213. let ret = '';
  214. for (let it in data) {
  215. ret += encodeURIComponent(it) + '=' +
  216. encodeURIComponent(data[it]) + '&'
  217. }
  218. return ret
  219. }], //将传参修改为formData格式 注释则为JSON格式
  220. }).then(function(rs) {
  221. if(rs.data.code === 200) {
  222. this.shareCount = Number(rs.data.msg.count)
  223. }else {
  224. alert(rs.data.msg)
  225. }
  226. }).catch(function(e) {
  227. console.log(e);
  228. });
  229. },
  230. },
  231. mounted(){
  232. this.weChatCode = this.subStrUrlCode();
  233. this.weChatCode ? this.sendCodeRequest() : this.judgeLogin()
  234. }
  235. })
  236. </script>
  237. <style>
  238. .bg-box{
  239. width: 100%;
  240. height: 100%;
  241. background-image: url(./image/bg.jpg);
  242. background-size: 100% 100%;
  243. background-repeat: no-repeat;
  244. display: flex;
  245. flex-direction: column;
  246. align-items: center;
  247. }
  248. .content-box {
  249. width: 90%;
  250. height: 60%;
  251. background-color: #ffffff;
  252. border-radius: 10px;
  253. z-index: 99;
  254. margin-top: 15%;
  255. position: relative;
  256. }
  257. .content-box img {
  258. margin-top: 10%;
  259. width: 100%;
  260. }
  261. .headImg-box {
  262. width: 80px;
  263. height: 80px;
  264. border-radius: 40px;
  265. position: absolute;
  266. top: 15px;
  267. z-index: 100;
  268. }
  269. .num-box {
  270. font-size: 1rem;
  271. font-family: fantasy
  272. }
  273. .get-btn-box {
  274. width: 65%;
  275. border-radius: 3%;
  276. }
  277. .download-box {
  278. display: flex;
  279. justify-content: center;
  280. }
  281. .download-content {
  282. padding: 10px;
  283. }
  284. .download-content i {
  285. font-size: 18px;
  286. font-weight: 700;
  287. }
  288. .download-content button {
  289. color: #fff;
  290. background-color: rgba(206,61,70,1);
  291. width: 75px;
  292. border-radius: 20px;
  293. height: 40px;
  294. font-size: 16px;
  295. border: none;
  296. float: right;
  297. }
  298. .font-monospace {
  299. font-size: 18px;
  300. font-family: monospace;
  301. font-weight: 600;
  302. }
  303. .download-code {
  304. border: 1px dashed #888;
  305. padding: 8px;
  306. color: rgba(166,44,53,1);
  307. }
  308. .download-url {
  309. width: 350px;
  310. font-size: 18px;
  311. text-decoration: underline;
  312. word-break: break-word;
  313. }
  314. .download-footer {
  315. padding: 5px;
  316. font-size: 13px;
  317. }
  318. .modal-share {
  319. width: 100%;
  320. height: 100%;
  321. background-color: rgba(0,0,0,.8);
  322. z-index: 108;
  323. display: flex;
  324. flex-direction: column;
  325. justify-content: space-around;
  326. align-items: center;
  327. position: absolute;
  328. }
  329. .modal-share img {
  330. position: absolute;
  331. top: 15px;
  332. right: 0;
  333. }
  334. .share-content {
  335. text-align: center;
  336. color: #F3F3F3;
  337. border: 1px dashed;
  338. padding: 25px;
  339. border-radius: 25px;
  340. margin-top: 30px;
  341. letter-spacing: 2px;
  342. font-family: fantasy;
  343. }
  344. .share-footer {
  345. border: 1px dotted #f1f1f1;
  346. color: #F3F3F3;
  347. width: 120px;
  348. height: 35px;
  349. text-align: center;
  350. line-height: 35px;
  351. border-radius: 5px;
  352. }
  353. .share-font {
  354. color: rgba(166,44,53,1);
  355. }
  356. </style>
  357. </html>