fission-page.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  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. <script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
  17. </head>
  18. <body>
  19. <div id="myApp" class="bg-box">
  20. <img alt="" class="headImg-box" :src=headSrc>
  21. <div class="content-box">
  22. <img alt="" :src=contentSrc />
  23. </div>
  24. <div class="num-box">
  25. 已有 <span style="color: #A4404E">{{num}}</span> 人领取成功
  26. </div>
  27. <!--<img class="get-btn-box" src="image/get-free.gif" alt="" onclick="isfollowqr('http://open.weixin.qq.com/qr/code?username=hszuqiu')" />-->
  28. <div class="download-box">
  29. <img class="get-btn-box" src="image/get-free.gif" alt="free" @click="goWeChat" v-if="startCount > 1"/>
  30. <div class="download-content" v-else>
  31. <div>
  32. <span>第一步.</span>
  33. <span>复制提取码</span>
  34. <span>qaki</span>
  35. <button>复制</button>
  36. </div>
  37. <div>
  38. <span>第二步.</span>
  39. <span>下载地址:</span>
  40. <span>qaki</span>
  41. </div>
  42. <div>
  43. 【温馨提示】不建议购买网盘会员,由于文件过大,请保存后在电脑上打开网盘,先下载到本地电脑,再解压!
  44. </div>
  45. </div>
  46. </div>
  47. <div class="modal-share" v-show="isShareFlag">
  48. <img src="./image/share-arrow.png" alt="">
  49. <div class="share-content">
  50. <p>为了帮助更多的家庭</p>
  51. <p>点击菜单<span class="share-font">“发送给朋友”</span></p>
  52. <p>分享到<span class="share-font" style="text-decoration: underline;">{{this.startCount}}个</span>家长群或特教群</p>
  53. <p class="share-font">分享成功后即可学习!</p>
  54. </div>
  55. <footer class="share-footer" @click="closeShareModal">知道了</footer>
  56. </div>
  57. </div>
  58. </body>
  59. <script>
  60. const apiUrl = 'http://fission.xazhima.com/api/api.php';
  61. const thisUrl = 'http://fission.xazhima.com/front-page/fission-page.html';
  62. new Vue({
  63. el:'#myApp',
  64. data:{
  65. num:52255,
  66. headSrc:'image/headImg.png',
  67. contentSrc:"image/content-bg.png",
  68. weChatCode:'',
  69. isFollow:'0',
  70. openId:'',
  71. shareCount:0,
  72. startCount:3,
  73. isShareFlag:false
  74. },
  75. methods:{
  76. goWeChat(){
  77. if(this.isFollow === '0'){
  78. location.href = 'http://mp.weixin.qq.com/mp/getmasssendmsg?__biz=MzUzOTcwMjM0OQ==#wechat_webview_type=1&wechat_redirect'
  79. }
  80. else {
  81. console.log('show share modal');
  82. this.isShareFlag = true;
  83. }
  84. },
  85. subStrUrlCode: function () {
  86. let weChatCodeUrl = location.search; //获取url中"?"符后的字符串
  87. let theRequest = {};
  88. if (weChatCodeUrl.indexOf("?") !== -1) {
  89. let str = weChatCodeUrl.substr(1);
  90. let strS = str.split("&");
  91. for(let i = 0; i < strS.length; i ++) {
  92. theRequest[strS[i].split("=")[0]]=(strS[i].split("=")[1]);
  93. }
  94. }
  95. console.log(theRequest);
  96. return theRequest.code;
  97. },
  98. closeShareModal(){
  99. this.isShareFlag = false;
  100. },
  101. judgeLogin(){
  102. axios({
  103. method: 'post', //请求方式 有常用的有get post等
  104. url: apiUrl, //请求地址
  105. data: {
  106. method: 'login',
  107. timestamp: 11111111,
  108. sign:md5('login'+'11111111')
  109. }, //代表传过去的参数对象,
  110. transformRequest: [function(data) {
  111. let ret = '';
  112. for (let it in data) {
  113. ret += encodeURIComponent(it) + '=' +
  114. encodeURIComponent(data[it]) + '&'
  115. }
  116. return ret
  117. }], //将传参修改为formData格式 注释则为JSON格式
  118. }).then(function(rs) {
  119. if(rs.data.code === 200) {
  120. window.location.href = rs.data.msg;
  121. console.log(rs.data)
  122. }else {
  123. alert(rs.data.msg)
  124. }
  125. }).catch(function(e) {
  126. console.log(e);
  127. });
  128. },
  129. setWxConfig(param){
  130. wx.config({
  131. debug: false,
  132. appId: param.appId,
  133. timestamp: param.timestamp ,
  134. nonceStr : param.nonceStr,
  135. signature: param.signature,
  136. jsApiList: [
  137. 'onMenuShareAppMessage','updateAppMessageShareData'
  138. ]
  139. });
  140. },
  141. sendCodeRequest(){
  142. let that = this , jsUrl = location.href.split('#')[0];
  143. axios({
  144. method: 'post', //请求方式 有常用的有get post等
  145. url: apiUrl, //请求地址
  146. data: {
  147. method: 'wxinfo',
  148. timestamp: 11111111,
  149. code:that.weChatCode,
  150. jsUrl:jsUrl,
  151. sign:md5('wxinfo'+'11111111')
  152. }, //代表传过去的参数对象,
  153. transformRequest: [function(data) {
  154. let ret = '';
  155. for (let it in data) {
  156. ret += encodeURIComponent(it) + '=' +
  157. encodeURIComponent(data[it]) + '&'
  158. }
  159. return ret
  160. }], //将传参修改为formData格式 注释则为JSON格式
  161. }).then(function(rs) {
  162. if(rs.data.code === 200) {
  163. that.setWxConfig(rs.data.msg.js_sign);
  164. that.headSrc = rs.data.msg.headimgurl;
  165. that.isFollow = rs.data.msg.subscribe;
  166. that.openId = rs.data.msg.openid;
  167. }else {
  168. alert(rs.data.msg)
  169. }
  170. }).catch(function(e) {
  171. console.log(e);
  172. });
  173. },
  174. addCountRequest(){
  175. axios({
  176. method: 'post', //请求方式 有常用的有get post等
  177. url: apiUrl, //请求地址
  178. data: {
  179. method: 'addcount',
  180. timestamp: 11111111,
  181. openid:this.openId,
  182. sign:md5('addcount'+'11111111')
  183. }, //代表传过去的参数对象,
  184. transformRequest: [function(data) {
  185. let ret = '';
  186. for (let it in data) {
  187. ret += encodeURIComponent(it) + '=' +
  188. encodeURIComponent(data[it]) + '&'
  189. }
  190. return ret
  191. }], //将传参修改为formData格式 注释则为JSON格式
  192. }).then(function(rs) {
  193. if(rs.data.code === 200) {
  194. this.shareCount = Number(rs.data.msg.count)
  195. }else {
  196. alert(rs.data.msg)
  197. }
  198. }).catch(function(e) {
  199. console.log(e);
  200. });
  201. },
  202. },
  203. mounted(){
  204. this.weChatCode = this.subStrUrlCode();
  205. this.weChatCode ? this.sendCodeRequest() : this.judgeLogin()
  206. }
  207. })
  208. wx.ready(function () {
  209. wx.onMenuShareAppMessage({
  210. title: '语言训练认知图片大全AAAA', // 分享标题
  211. desc: '已有239218领取成功语言训练认知图片大全AAAA', // 分享描述
  212. link: thisUrl, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
  213. imgUrl: 'image/headImg.png', // 分享图标
  214. type: 'link', // 分享类型:music | video | link,默认为:link
  215. dataUrl: '', // 如果type为:music | video,则要提供数据,默认为:空
  216. success: function(){
  217. alert('share success')
  218. this.startCount--;
  219. if(this.startCount === 0){
  220. this.isShareFlag = false;
  221. }
  222. },
  223. })
  224. })
  225. </script>
  226. <style>
  227. .bg-box{
  228. width: 100%;
  229. height: 100%;
  230. background-image: url(./image/bg.jpg);
  231. background-size: 100% 100%;
  232. background-repeat: no-repeat;
  233. display: flex;
  234. flex-direction: column;
  235. align-items: center;
  236. }
  237. .content-box {
  238. width: 90%;
  239. height: 60%;
  240. background-color: #ffffff;
  241. border-radius: 10px;
  242. z-index: 99;
  243. margin-top: 15%;
  244. position: relative;
  245. }
  246. .content-box img {
  247. margin-top: 10%;
  248. width: 100%;
  249. }
  250. .headImg-box {
  251. width: 80px;
  252. height: 80px;
  253. border-radius: 40px;
  254. position: absolute;
  255. top: 15px;
  256. z-index: 100;
  257. }
  258. .num-box {
  259. font-size: 1rem;
  260. font-family: fantasy
  261. }
  262. .get-btn-box {
  263. width: 65%;
  264. border-radius: 3%;
  265. }
  266. .download-box {
  267. display: flex;
  268. justify-content: center;
  269. }
  270. .modal-share {
  271. width: 100%;
  272. height: 100%;
  273. background-color: rgba(0,0,0,.8);
  274. z-index: 108;
  275. display: flex;
  276. flex-direction: column;
  277. justify-content: space-around;
  278. align-items: center;
  279. position: absolute;
  280. }
  281. .modal-share img {
  282. position: absolute;
  283. top: 15px;
  284. right: 0;
  285. }
  286. .share-content {
  287. text-align: center;
  288. color: #F3F3F3;
  289. border: 1px dashed;
  290. padding: 25px;
  291. border-radius: 25px;
  292. margin-top: 30px;
  293. letter-spacing: 2px;
  294. font-family: fantasy;
  295. }
  296. .share-footer {
  297. border: 1px dotted #f1f1f1;
  298. color: #F3F3F3;
  299. width: 120px;
  300. height: 35px;
  301. text-align: center;
  302. line-height: 35px;
  303. border-radius: 5px;
  304. }
  305. .share-font {
  306. color: rgba(166,44,53,1);
  307. }
  308. </style>
  309. </html>