fission-page.html 11 KB

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