fission-page.html 11 KB

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