PC-20180523CIYM\Administrator vor 6 Jahren
Ursprung
Commit
bb1e72a966

+ 4 - 1
2018专题/1812超梦西游/src/_wap.html

@@ -20,7 +20,7 @@
 <body>
     <div class="page-wap">
         <div class="mod-download">
-            <a href="#" target="_blank" class="btn-download">下载游戏</a>
+            <a href="javascript:;" target="_blank" class="btn-download">下载游戏</a>
         </div>
         <div class="mod-banner">
             <img src="/src/img/mp/bg-banner1.jpg" alt="" />
@@ -118,5 +118,8 @@
         </div>
     </div>
     <script src="lib/mod.js"></script>
+    <script>
+        require('modules/page/wap.js');
+    </script>
 </body>
 </html>

+ 19 - 0
2018专题/1812超梦西游/src/modules/page/wap.js

@@ -0,0 +1,19 @@
+$(function(){
+ 	var type = 1;
+    if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
+    	type = 2;
+	}
+	$('.btn-download').click(function(){
+		$.ajax({
+	        type: 'GET',
+	        url: 'http://sy.duowan.com/game/download/',
+	        data: {
+	        	game_id: '73208',
+	        	type: type
+	        },
+	        success: function(ret){
+	        	document.location.href = ret.data.download_url;
+	        }
+	    })
+	});
+})