fission-page.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  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="free" @click="goWeChat" v-if="startCount > 1"/>
  29. <div class="download-content" 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. <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. new Vue({
  61. el:'#myApp',
  62. data:{
  63. num:52255,
  64. headSrc:'image/headImg.png',
  65. contentSrc:"image/content-bg.png",
  66. weChatCode:'',
  67. isFollow:'0',
  68. openId:'',
  69. shareCount:0,
  70. startCount:3,
  71. isShareFlag:false
  72. },
  73. methods:{
  74. goWeChat(){
  75. if(this.isFollow === '0'){
  76. location.href = 'http://mp.weixin.qq.com/mp/getmasssendmsg?__biz=MzUzOTcwMjM0OQ==#wechat_webview_type=1&wechat_redirect'
  77. }
  78. else {
  79. console.log('show share modal');
  80. this.isShareFlag = true;
  81. wx.ready(function () {
  82. wx.onMenuShareAppMessage({
  83. title: '语言训练认知图片大全', // 分享标题
  84. desc: '已有239218领取成功', // 分享描述
  85. link: '', // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
  86. imgUrl: this.headSrc, // 分享图标
  87. // type: 'link', // 分享类型:music | video | link,默认为:link
  88. // dataUrl: '', // 如果type为:music | video,则要提供数据,默认为:空
  89. success: function(){
  90. alert('share success')
  91. this.startCount--;
  92. if(this.startCount === 0){
  93. this.isShareFlag = false;
  94. }
  95. },
  96. cancel: function(){
  97. console.log('share cancel')
  98. },
  99. })
  100. })
  101. }
  102. },
  103. subStrUrlCode: function () {
  104. let weChatCodeUrl = location.search; //获取url中"?"符后的字符串
  105. let theRequest = {};
  106. if (weChatCodeUrl.indexOf("?") !== -1) {
  107. let str = weChatCodeUrl.substr(1);
  108. let strS = str.split("&");
  109. for(let i = 0; i < strS.length; i ++) {
  110. theRequest[strS[i].split("=")[0]]=(strS[i].split("=")[1]);
  111. }
  112. }
  113. console.log(theRequest);
  114. return theRequest.code;
  115. },
  116. closeShareModal(){
  117. this.isShareFlag = false;
  118. },
  119. judgeLogin(){
  120. axios({
  121. method: 'post', //请求方式 有常用的有get post等
  122. url: apiUrl, //请求地址
  123. data: {
  124. method: 'login',
  125. timestamp: 11111111,
  126. sign:md5('login'+'11111111')
  127. }, //代表传过去的参数对象,
  128. transformRequest: [function(data) {
  129. let ret = '';
  130. for (let it in data) {
  131. ret += encodeURIComponent(it) + '=' +
  132. encodeURIComponent(data[it]) + '&'
  133. }
  134. return ret
  135. }], //将传参修改为formData格式 注释则为JSON格式
  136. }).then(function(rs) {
  137. if(rs.data.code === 200) {
  138. window.location.href = rs.data.msg;
  139. console.log(rs.data)
  140. }else {
  141. alert(rs.data.msg)
  142. }
  143. }).catch(function(e) {
  144. console.log(e);
  145. });
  146. },
  147. setWxConfig(param){
  148. wx.config({
  149. debug: false,
  150. appId: param.appId,
  151. timestamp: param.timestamp ,
  152. nonceStr : param.nonceStr,
  153. signature: param.signature,
  154. jsApiList: [
  155. 'onMenuShareAppMessage'
  156. ]
  157. });
  158. },
  159. sendCodeRequest(){
  160. let that = this , jsUrl = location.href.split('#')[0];
  161. axios({
  162. method: 'post', //请求方式 有常用的有get post等
  163. url: apiUrl, //请求地址
  164. data: {
  165. method: 'wxinfo',
  166. timestamp: 11111111,
  167. code:that.weChatCode,
  168. jsUrl:jsUrl,
  169. sign:md5('wxinfo'+'11111111')
  170. }, //代表传过去的参数对象,
  171. transformRequest: [function(data) {
  172. let ret = '';
  173. for (let it in data) {
  174. ret += encodeURIComponent(it) + '=' +
  175. encodeURIComponent(data[it]) + '&'
  176. }
  177. return ret
  178. }], //将传参修改为formData格式 注释则为JSON格式
  179. }).then(function(rs) {
  180. if(rs.data.code === 200) {
  181. that.setWxConfig(rs.data.msg.js_sign);
  182. that.headSrc = rs.data.msg.headimgurl;
  183. that.isFollow = rs.data.msg.subscribe;
  184. that.openId = rs.data.msg.openid;
  185. }else {
  186. alert(rs.data.msg)
  187. }
  188. }).catch(function(e) {
  189. console.log(e);
  190. });
  191. },
  192. addCountRequest(){
  193. axios({
  194. method: 'post', //请求方式 有常用的有get post等
  195. url: apiUrl, //请求地址
  196. data: {
  197. method: 'addcount',
  198. timestamp: 11111111,
  199. openid:this.openId,
  200. sign:md5('addcount'+'11111111')
  201. }, //代表传过去的参数对象,
  202. transformRequest: [function(data) {
  203. let ret = '';
  204. for (let it in data) {
  205. ret += encodeURIComponent(it) + '=' +
  206. encodeURIComponent(data[it]) + '&'
  207. }
  208. return ret
  209. }], //将传参修改为formData格式 注释则为JSON格式
  210. }).then(function(rs) {
  211. if(rs.data.code === 200) {
  212. this.shareCount = Number(rs.data.msg.count)
  213. }else {
  214. alert(rs.data.msg)
  215. }
  216. }).catch(function(e) {
  217. console.log(e);
  218. });
  219. },
  220. },
  221. mounted(){
  222. this.weChatCode = this.subStrUrlCode();
  223. this.weChatCode ? this.sendCodeRequest() : this.judgeLogin()
  224. }
  225. })
  226. </script>
  227. <style>
  228. .bg-box{
  229. width: 100%;
  230. height: 100%;
  231. background-image: url(./image/bg.jpg);
  232. background-size: 100% 100%;
  233. background-repeat: no-repeat;
  234. display: flex;
  235. flex-direction: column;
  236. align-items: center;
  237. }
  238. .content-box {
  239. width: 90%;
  240. height: 60%;
  241. background-color: #ffffff;
  242. border-radius: 10px;
  243. z-index: 99;
  244. margin-top: 15%;
  245. position: relative;
  246. }
  247. .content-box img {
  248. margin-top: 10%;
  249. width: 100%;
  250. }
  251. .headImg-box {
  252. width: 80px;
  253. height: 80px;
  254. border-radius: 40px;
  255. position: absolute;
  256. top: 15px;
  257. z-index: 100;
  258. }
  259. .num-box {
  260. font-size: 1rem;
  261. font-family: fantasy
  262. }
  263. .get-btn-box {
  264. width: 65%;
  265. border-radius: 3%;
  266. }
  267. .download-box {
  268. display: flex;
  269. justify-content: center;
  270. }
  271. .modal-share {
  272. width: 100%;
  273. height: 100%;
  274. background-color: rgba(0,0,0,.8);
  275. z-index: 108;
  276. display: flex;
  277. flex-direction: column;
  278. justify-content: space-around;
  279. align-items: center;
  280. position: absolute;
  281. }
  282. .modal-share img {
  283. position: absolute;
  284. top: 15px;
  285. right: 0;
  286. }
  287. .share-content {
  288. text-align: center;
  289. color: #F3F3F3;
  290. border: 1px dashed;
  291. padding: 25px;
  292. border-radius: 25px;
  293. margin-top: 30px;
  294. letter-spacing: 2px;
  295. font-family: fantasy;
  296. }
  297. .share-footer {
  298. border: 1px dotted #f1f1f1;
  299. color: #F3F3F3;
  300. width: 120px;
  301. height: 35px;
  302. text-align: center;
  303. line-height: 35px;
  304. border-radius: 5px;
  305. }
  306. .share-font {
  307. color: rgba(166,44,53,1);
  308. }
  309. </style>
  310. </html>