人人商城

front-download.html 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. {template 'common/header'}
  2. <ul class="we7-page-tab">
  3. <li class="{if $do == 'front_download'}active{/if}"><a
  4. href="./index.php?c=phoneapp&a=front-download&do=front_download&version_id={$version_id}">APP设置</a></li>
  5. <li class="{if $do == 'domainset'}active{/if}"><a
  6. href="./index.php?c=phoneapp&a=front-download&do=getpackage&version_id={$version_id}&type=apk">下载AndroidAPP</a></li>
  7. <li class="{if $do == 'domainset'}active{/if}"><a
  8. href="./index.php?c=phoneapp&a=front-download&do=getpackage&version_id={$version_id}&type=ipa">下载IOSAPP</a></li>
  9. </ul>
  10. <div class="panel we7-panel">
  11. <div class="panel-heading">APP配置</div>
  12. <div class="panel-body we7-padding">
  13. <div class="form-group">
  14. <label class="control-label col-sm-2">选择Android apk文件</label>
  15. <div class="col-sm-10">
  16. <input type="file" class="form-control" accept=".apk" onchange="onApkSelect(event)"
  17. name="file" value="" placeholder="没有可不传"/>
  18. </div>
  19. </div>
  20. </div>
  21. </div>
  22. <script>
  23. var siteinfo = '{php echo json_encode($siteinfo)}';
  24. function onApkSelect(event) {
  25. var file = event.target.files[0];
  26. require(['jszip', 'fileSaver'], function(JSZip, fileSaver){
  27. JSZip.loadAsync(file).then(function(zip){
  28. console.log(zip.comment);
  29. zip.generateAsync({comment: siteinfo,type:"blob"})
  30. .then(function (blob) {
  31. saveAs(blob, "配置.apk");
  32. });
  33. });
  34. });
  35. }
  36. </script>
  37. {template 'common/footer'}