fission-page.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  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. 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. wx.ready(function () {
  83. wx.updateAppMessageShareData({
  84. title: '语言训练认知图片大全AAAA', // 分享标题
  85. desc: '已有239218领取成功语言训练认知图片大全AAAA', // 分享描述
  86. link: thisUrl, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
  87. imgUrl: this.headSrc, // 分享图标
  88. // type: 'link', // 分享类型:music | video | link,默认为:link
  89. // dataUrl: '', // 如果type为:music | video,则要提供数据,默认为:空
  90. success: function(){
  91. alert('share success')
  92. this.startCount--;
  93. if(this.startCount === 0){
  94. this.isShareFlag = false;
  95. }
  96. },
  97. })
  98. })
  99. }
  100. },
  101. subStrUrlCode: function () {
  102. let weChatCodeUrl = location.search; //获取url中"?"符后的字符串
  103. let theRequest = {};
  104. if (weChatCodeUrl.indexOf("?") !== -1) {
  105. let str = weChatCodeUrl.substr(1);
  106. let strS = str.split("&");
  107. for(let i = 0; i < strS.length; i ++) {
  108. theRequest[strS[i].split("=")[0]]=(strS[i].split("=")[1]);
  109. }
  110. }
  111. console.log(theRequest);
  112. return theRequest.code;
  113. },
  114. closeShareModal(){
  115. this.isShareFlag = false;
  116. },
  117. judgeLogin(){
  118. axios({
  119. method: 'post', //请求方式 有常用的有get post等
  120. url: apiUrl, //请求地址
  121. data: {
  122. method: 'login',
  123. timestamp: 11111111,
  124. sign:md5('login'+'11111111')
  125. }, //代表传过去的参数对象,
  126. transformRequest: [function(data) {
  127. let ret = '';
  128. for (let it in data) {
  129. ret += encodeURIComponent(it) + '=' +
  130. encodeURIComponent(data[it]) + '&'
  131. }
  132. return ret
  133. }], //将传参修改为formData格式 注释则为JSON格式
  134. }).then(function(rs) {
  135. if(rs.data.code === 200) {
  136. window.location.href = rs.data.msg;
  137. console.log(rs.data)
  138. }else {
  139. alert(rs.data.msg)
  140. }
  141. }).catch(function(e) {
  142. console.log(e);
  143. });
  144. },
  145. setWxConfig(param){
  146. wx.config({
  147. debug: false,
  148. appId: param.appId,
  149. timestamp: param.timestamp ,
  150. nonceStr : param.nonceStr,
  151. signature: param.signature,
  152. jsApiList: [
  153. 'updateAppMessageShareData'
  154. ]
  155. });
  156. },
  157. sendCodeRequest(){
  158. let that = this , jsUrl = location.href.split('#')[0];
  159. axios({
  160. method: 'post', //请求方式 有常用的有get post等
  161. url: apiUrl, //请求地址
  162. data: {
  163. method: 'wxinfo',
  164. timestamp: 11111111,
  165. code:that.weChatCode,
  166. jsUrl:jsUrl,
  167. sign:md5('wxinfo'+'11111111')
  168. }, //代表传过去的参数对象,
  169. transformRequest: [function(data) {
  170. let ret = '';
  171. for (let it in data) {
  172. ret += encodeURIComponent(it) + '=' +
  173. encodeURIComponent(data[it]) + '&'
  174. }
  175. return ret
  176. }], //将传参修改为formData格式 注释则为JSON格式
  177. }).then(function(rs) {
  178. if(rs.data.code === 200) {
  179. that.setWxConfig(rs.data.msg.js_sign);
  180. that.headSrc = rs.data.msg.headimgurl;
  181. that.isFollow = rs.data.msg.subscribe;
  182. that.openId = rs.data.msg.openid;
  183. }else {
  184. alert(rs.data.msg)
  185. }
  186. }).catch(function(e) {
  187. console.log(e);
  188. });
  189. },
  190. addCountRequest(){
  191. axios({
  192. method: 'post', //请求方式 有常用的有get post等
  193. url: apiUrl, //请求地址
  194. data: {
  195. method: 'addcount',
  196. timestamp: 11111111,
  197. openid:this.openId,
  198. sign:md5('addcount'+'11111111')
  199. }, //代表传过去的参数对象,
  200. transformRequest: [function(data) {
  201. let ret = '';
  202. for (let it in data) {
  203. ret += encodeURIComponent(it) + '=' +
  204. encodeURIComponent(data[it]) + '&'
  205. }
  206. return ret
  207. }], //将传参修改为formData格式 注释则为JSON格式
  208. }).then(function(rs) {
  209. if(rs.data.code === 200) {
  210. this.shareCount = Number(rs.data.msg.count)
  211. }else {
  212. alert(rs.data.msg)
  213. }
  214. }).catch(function(e) {
  215. console.log(e);
  216. });
  217. },
  218. },
  219. mounted(){
  220. this.weChatCode = this.subStrUrlCode();
  221. this.weChatCode ? this.sendCodeRequest() : this.judgeLogin()
  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>