Changeset 2368477
- Timestamp:
- 08/25/2020 09:24:19 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wechat-shop-download/trunk/add-ons/download/init.php
r2368461 r2368477 429 429 }); 430 430 </script> 431 <?php }else{ ?> 432 <script type="text/javascript"> 433 (function ($) { 434 $("#wshop_download_link_<?php echo $context;?>").click(function () { 435 let url="<?php echo esc_url_raw(WShop::instance()->ajax_url(array('action' => 'wshop_'.$this->id, 'tab' => 'download_link'), true, true))?>"; 436 let data={post_ID:<?php echo $post_ID;?>,context:'<?php echo $context;?>'}; 437 var newWindow = window.open(); 438 $.ajax({ 439 type:'post', 440 url:url, 441 cache: false, 442 data:data, 443 dataType:'json', 444 success:function(info){ 445 if(typeof info==='string')info=JSON.parse(info); 446 if(info.code==='00000'){ 447 //location.href=info.data.download_link;//本窗口打开 448 //window.open(info.data.download_link,'top');//新窗口打开 449 newWindow.location.href = info.data.download_link; 450 }else { 451 alert(info.msg); 452 } 453 }, 454 error:function(){ 455 alert('获取下载链接失败'); 456 } 457 }); 458 }); 459 })(jQuery); 460 </script> 431 461 <?php } 432 462 return ob_get_clean();
Note: See TracChangeset
for help on using the changeset viewer.