fission-page.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  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"></script>
  16. </head>
  17. <body>
  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">
  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="" @click="goWeChat" v-if="shareCount < 3" />
  29. <div v-else>
  30. <div>
  31. <span>第一步.</span>
  32. <span>复制提取码</span>
  33. <span>qaki</span>
  34. <button>复制</button>
  35. </div>
  36. <div>
  37. <span>第二步.</span>
  38. <span>下载地址:</span>
  39. <span>qaki</span>
  40. </div>
  41. <div>
  42. 【温馨提示】不建议购买网盘会员,由于文件过大,请保存后在电脑上打开网盘,先下载到本地电脑,再解压!
  43. </div>
  44. </div>
  45. </div>
  46. <div class="modal-share" v-show="isShareFlag">
  47. <div class="share-content">
  48. <p>为了帮助更多的家庭</p>
  49. <p>点击菜单<span>“发送给朋友”</span></p>
  50. <p>分享到<span>{{this.shareCount}}个</span>家长群或特教群</p>
  51. <p>分享成功后即可学习!</p>
  52. </div>
  53. <footer class="share-footer">知道了</footer>
  54. </div>
  55. </div>
  56. </body>
  57. <script>
  58. const apiUrl = 'http://fission.xazhima.com/api/api.php';
  59. new Vue({
  60. el:'#myApp',
  61. data:{
  62. num:52255,
  63. headSrc:'image/headImg.png',
  64. contentSrc:"image/content-bg.png",
  65. weChatCode:'',
  66. isFollow:'0',
  67. openId:'',
  68. shareCount:0,
  69. isShareFlag:false
  70. },
  71. methods:{
  72. goWeChat(){
  73. if(this.isFollow === '0'){
  74. location.href = 'http://mp.weixin.qq.com/mp/getmasssendmsg?__biz=MzUzOTcwMjM0OQ==#wechat_webview_type=1&wechat_redirect'
  75. }
  76. else {
  77. console.log('show share modal');
  78. this.isShareFlag = true;
  79. }
  80. },
  81. subStrUrlCode: function () {
  82. let weChatCodeUrl = location.search; //获取url中"?"符后的字符串
  83. let theRequest = {};
  84. if (weChatCodeUrl.indexOf("?") !== -1) {
  85. let str = weChatCodeUrl.substr(1);
  86. let strS = str.split("&");
  87. for(let i = 0; i < strS.length; i ++) {
  88. theRequest[strS[i].split("=")[0]]=(strS[i].split("=")[1]);
  89. }
  90. }
  91. console.log(theRequest);
  92. return theRequest.code;
  93. },
  94. judgeLogin(){
  95. axios({
  96. method: 'post', //请求方式 有常用的有get post等
  97. url: apiUrl, //请求地址
  98. data: {
  99. method: 'login',
  100. timestamp: 11111111,
  101. sign:md5('login'+'11111111')
  102. }, //代表传过去的参数对象,
  103. transformRequest: [function(data) {
  104. let ret = '';
  105. for (let it in data) {
  106. ret += encodeURIComponent(it) + '=' +
  107. encodeURIComponent(data[it]) + '&'
  108. }
  109. return ret
  110. }], //将传参修改为formData格式 注释则为JSON格式
  111. }).then(function(rs) {
  112. if(rs.data.code === 200) {
  113. window.location.href = rs.data.msg;
  114. console.log(rs.data)
  115. }else {
  116. alert(rs.data.msg)
  117. }
  118. }).catch(function(e) {
  119. console.log(e);
  120. });
  121. },
  122. setWxConfig(param){
  123. wx.config({
  124. debug: false,
  125. appId: param.appId,
  126. timestamp: param.timestamp ,
  127. nonceStr : param.nonceStr,
  128. signature: param.signature,
  129. jsApiList: [
  130. 'imagePreview', 'chooseImage', 'uploadImage','onMenuShareAppMessage'
  131. ]
  132. });
  133. wx.onMenuShareAppMessage({
  134. title: '语言训练认知图片大全', // 分享标题
  135. desc: '已有239218领取成功', // 分享描述
  136. link: '', // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
  137. imgUrl: this.headSrc, // 分享图标
  138. type: 'link', // 分享类型:music | video | link,默认为:link
  139. dataUrl: '', // 如果type为:music | video,则要提供数据,默认为:空
  140. success: function(){
  141. console.log('share success')
  142. },
  143. cancel: function(){
  144. console.log('share cancel')
  145. },
  146. })
  147. },
  148. sendCodeRequest(){
  149. let that = this , jsUrl = location.href.split('#')[0];
  150. axios({
  151. method: 'post', //请求方式 有常用的有get post等
  152. url: apiUrl, //请求地址
  153. data: {
  154. method: 'wxinfo',
  155. timestamp: 11111111,
  156. code:that.weChatCode,
  157. jsUrl:jsUrl,
  158. sign:md5('wxinfo'+'11111111')
  159. }, //代表传过去的参数对象,
  160. transformRequest: [function(data) {
  161. let ret = '';
  162. for (let it in data) {
  163. ret += encodeURIComponent(it) + '=' +
  164. encodeURIComponent(data[it]) + '&'
  165. }
  166. return ret
  167. }], //将传参修改为formData格式 注释则为JSON格式
  168. }).then(function(rs) {
  169. if(rs.data.code === 200) {
  170. that.setWxConfig(rs.data.msg.js_sign);
  171. that.headSrc = rs.data.msg.headimgurl;
  172. that.isFollow = rs.data.msg.subscribe;
  173. that.openId = rs.data.msg.openid;
  174. }else {
  175. alert(rs.data.msg)
  176. }
  177. }).catch(function(e) {
  178. console.log(e);
  179. });
  180. },
  181. addCountRequest(){
  182. axios({
  183. method: 'post', //请求方式 有常用的有get post等
  184. url: apiUrl, //请求地址
  185. data: {
  186. method: 'addcount',
  187. timestamp: 11111111,
  188. openid:this.openId,
  189. sign:md5('addcount'+'11111111')
  190. }, //代表传过去的参数对象,
  191. transformRequest: [function(data) {
  192. let ret = '';
  193. for (let it in data) {
  194. ret += encodeURIComponent(it) + '=' +
  195. encodeURIComponent(data[it]) + '&'
  196. }
  197. return ret
  198. }], //将传参修改为formData格式 注释则为JSON格式
  199. }).then(function(rs) {
  200. if(rs.data.code === 200) {
  201. this.shareCount = Number(rs.data.msg.count)
  202. }else {
  203. alert(rs.data.msg)
  204. }
  205. }).catch(function(e) {
  206. console.log(e);
  207. });
  208. },
  209. },
  210. mounted(){
  211. this.weChatCode = this.subStrUrlCode();
  212. this.weChatCode ? this.sendCodeRequest() : this.judgeLogin()
  213. }
  214. })
  215. </script>
  216. <style>
  217. .bg-box{
  218. width: 100%;
  219. height: 100%;
  220. background-image: url(./image/bg.jpg);
  221. background-size: 100% 100%;
  222. background-repeat: no-repeat;
  223. display: flex;
  224. flex-direction: column;
  225. align-items: center;
  226. }
  227. .content-box {
  228. width: 90%;
  229. height: 55%;
  230. background-color: #ffffff;
  231. border-radius: 10px;
  232. z-index: 99;
  233. margin-top: 15%;
  234. position: relative;
  235. }
  236. .content-box img {
  237. margin-top: 10%;
  238. width: 100%;
  239. }
  240. .headImg-box {
  241. width: 80px;
  242. height: 80px;
  243. border-radius: 40px;
  244. position: absolute;
  245. top: 15px;
  246. z-index: 100;
  247. }
  248. .num-box {
  249. font-size: 1rem;
  250. margin-top: 10%;
  251. margin-bottom: 5%;
  252. font-family: fantasy
  253. }
  254. .get-btn-box {
  255. width: 65%;
  256. border-radius: 3%;
  257. }
  258. .download-box {
  259. display: flex;
  260. justify-content: center;
  261. }
  262. .modal-share {
  263. width: 100%;
  264. height: 100%;
  265. background-color: rgba(0,0,0,.8);
  266. z-index: 108;
  267. display: flex;
  268. flex-direction: column;
  269. justify-content: space-around;
  270. align-items: center;
  271. position: absolute;
  272. }
  273. .share-content {
  274. text-align: center;
  275. color: #F3F3F3;
  276. }
  277. .share-footer {
  278. border: 1px dotted #f1f1f1;
  279. color: #F3F3F3;
  280. }
  281. </style>
  282. </html>