fission-page.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  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" @click="closeShareModal">知道了</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. closeShareModal(){
  95. this.isShareFlag = false;
  96. },
  97. judgeLogin(){
  98. axios({
  99. method: 'post', //请求方式 有常用的有get post等
  100. url: apiUrl, //请求地址
  101. data: {
  102. method: 'login',
  103. timestamp: 11111111,
  104. sign:md5('login'+'11111111')
  105. }, //代表传过去的参数对象,
  106. transformRequest: [function(data) {
  107. let ret = '';
  108. for (let it in data) {
  109. ret += encodeURIComponent(it) + '=' +
  110. encodeURIComponent(data[it]) + '&'
  111. }
  112. return ret
  113. }], //将传参修改为formData格式 注释则为JSON格式
  114. }).then(function(rs) {
  115. if(rs.data.code === 200) {
  116. window.location.href = rs.data.msg;
  117. console.log(rs.data)
  118. }else {
  119. alert(rs.data.msg)
  120. }
  121. }).catch(function(e) {
  122. console.log(e);
  123. });
  124. },
  125. setWxConfig(param){
  126. wx.config({
  127. debug: false,
  128. appId: param.appId,
  129. timestamp: param.timestamp ,
  130. nonceStr : param.nonceStr,
  131. signature: param.signature,
  132. jsApiList: [
  133. 'imagePreview', 'chooseImage', 'uploadImage','onMenuShareAppMessage'
  134. ]
  135. });
  136. wx.onMenuShareAppMessage({
  137. title: '语言训练认知图片大全', // 分享标题
  138. desc: '已有239218领取成功', // 分享描述
  139. link: '', // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
  140. imgUrl: this.headSrc, // 分享图标
  141. type: 'link', // 分享类型:music | video | link,默认为:link
  142. dataUrl: '', // 如果type为:music | video,则要提供数据,默认为:空
  143. success: function(){
  144. console.log('share success')
  145. },
  146. cancel: function(){
  147. console.log('share cancel')
  148. },
  149. })
  150. },
  151. sendCodeRequest(){
  152. let that = this , jsUrl = location.href.split('#')[0];
  153. axios({
  154. method: 'post', //请求方式 有常用的有get post等
  155. url: apiUrl, //请求地址
  156. data: {
  157. method: 'wxinfo',
  158. timestamp: 11111111,
  159. code:that.weChatCode,
  160. jsUrl:jsUrl,
  161. sign:md5('wxinfo'+'11111111')
  162. }, //代表传过去的参数对象,
  163. transformRequest: [function(data) {
  164. let ret = '';
  165. for (let it in data) {
  166. ret += encodeURIComponent(it) + '=' +
  167. encodeURIComponent(data[it]) + '&'
  168. }
  169. return ret
  170. }], //将传参修改为formData格式 注释则为JSON格式
  171. }).then(function(rs) {
  172. if(rs.data.code === 200) {
  173. that.setWxConfig(rs.data.msg.js_sign);
  174. that.headSrc = rs.data.msg.headimgurl;
  175. that.isFollow = rs.data.msg.subscribe;
  176. that.openId = rs.data.msg.openid;
  177. }else {
  178. alert(rs.data.msg)
  179. }
  180. }).catch(function(e) {
  181. console.log(e);
  182. });
  183. },
  184. addCountRequest(){
  185. axios({
  186. method: 'post', //请求方式 有常用的有get post等
  187. url: apiUrl, //请求地址
  188. data: {
  189. method: 'addcount',
  190. timestamp: 11111111,
  191. openid:this.openId,
  192. sign:md5('addcount'+'11111111')
  193. }, //代表传过去的参数对象,
  194. transformRequest: [function(data) {
  195. let ret = '';
  196. for (let it in data) {
  197. ret += encodeURIComponent(it) + '=' +
  198. encodeURIComponent(data[it]) + '&'
  199. }
  200. return ret
  201. }], //将传参修改为formData格式 注释则为JSON格式
  202. }).then(function(rs) {
  203. if(rs.data.code === 200) {
  204. this.shareCount = Number(rs.data.msg.count)
  205. }else {
  206. alert(rs.data.msg)
  207. }
  208. }).catch(function(e) {
  209. console.log(e);
  210. });
  211. },
  212. },
  213. mounted(){
  214. this.weChatCode = this.subStrUrlCode();
  215. this.weChatCode ? this.sendCodeRequest() : this.judgeLogin()
  216. }
  217. })
  218. </script>
  219. <style>
  220. .bg-box{
  221. width: 100%;
  222. height: 100%;
  223. background-image: url(./image/bg.jpg);
  224. background-size: 100% 100%;
  225. background-repeat: no-repeat;
  226. display: flex;
  227. flex-direction: column;
  228. align-items: center;
  229. }
  230. .content-box {
  231. width: 90%;
  232. height: 60%;
  233. background-color: #ffffff;
  234. border-radius: 10px;
  235. z-index: 99;
  236. margin-top: 15%;
  237. position: relative;
  238. }
  239. .content-box img {
  240. margin-top: 10%;
  241. width: 100%;
  242. }
  243. .headImg-box {
  244. width: 80px;
  245. height: 80px;
  246. border-radius: 40px;
  247. position: absolute;
  248. top: 15px;
  249. z-index: 100;
  250. }
  251. .num-box {
  252. font-size: 1rem;
  253. font-family: fantasy
  254. }
  255. .get-btn-box {
  256. width: 65%;
  257. border-radius: 3%;
  258. }
  259. .download-box {
  260. display: flex;
  261. justify-content: center;
  262. }
  263. .modal-share {
  264. width: 100%;
  265. height: 100%;
  266. background-color: rgba(0,0,0,.8);
  267. z-index: 108;
  268. display: flex;
  269. flex-direction: column;
  270. justify-content: space-around;
  271. align-items: center;
  272. position: absolute;
  273. }
  274. .share-content {
  275. text-align: center;
  276. color: #F3F3F3;
  277. }
  278. .share-footer {
  279. border: 1px dotted #f1f1f1;
  280. color: #F3F3F3;
  281. width: 100px;
  282. height: 30px;
  283. text-align: center;
  284. line-height: 30px;
  285. border-radius: 5px;
  286. }
  287. </style>
  288. </html>