fission-page.html 12 KB

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