人人商城

install.html 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <!DOCTYPE html>
  2. <html lang="zh-cn">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>授权安装</title>
  8. <link rel="shortcut icon" href="{$_W['siteroot']}{$_W['config']['upload']['attachdir']}/{if !empty($_W['setting']['copyright']['icon'])}{$_W['setting']['copyright']['icon']}{else}images/global/wechat.jpg{/if}" />
  9. <link href="{php echo EWEI_SHOPV2_LOCAL}static/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
  10. <link href="{php echo EWEI_SHOPV2_LOCAL}static/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
  11. <link href="{php echo EWEI_SHOPV2_LOCAL}static/css/animate.css" rel="stylesheet">
  12. <link href="{php echo EWEI_SHOPV2_LOCAL}static/css/v2.css?v=4.1.0" rel="stylesheet">
  13. <link href="{php echo EWEI_SHOPV2_LOCAL}static/css/common.css?v=2.0.0" rel="stylesheet">
  14. <link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/font_1460799380_9653542.css">
  15. <script src="./resource/js/lib/jquery-1.11.1.min.js"></script>
  16. <script src="{php echo EWEI_SHOPV2_LOCAL}static/js/dist/jquery/jquery.gcjs.js"></script>
  17. <script src="./resource/js/app/util.js"></script>
  18. <script src="{php echo EWEI_SHOPV2_LOCAL}static/js/require.js"></script>
  19. <script src="./resource/js/app/config.js"></script>
  20. <script src="{php echo EWEI_SHOPV2_LOCAL}static/js/myconfig.js"></script>
  21. <script type="text/javascript">
  22. if (navigator.appName == 'Microsoft Internet Explorer') {
  23. if (navigator.userAgent.indexOf("MSIE 5.0") > 0 || navigator.userAgent.indexOf("MSIE 6.0") > 0 || navigator.userAgent.indexOf("MSIE 7.0") > 0) {
  24. alert('您使用的 IE 浏览器版本过低, 推荐使用 Chrome 浏览器或 IE8 及以上版本浏览器.');
  25. }
  26. }
  27. myrequire.path = "{$_W['siteroot']}addons/ewei_shopv2/static/js/";
  28. </script>
  29. </head>
  30. <body class="white-bg ">
  31. <div class='wrapper main-wrapper wrapper-content '>
  32. <div class="page-content" style="width:1000px">
  33. <div class="page-heading"><h2>系统安装 </h2></div>
  34. {if empty($result['status'])}
  35. <form action="" method="post" class="form-horizontal form-validate" enctype="multipart/form-data" >
  36. <div class="form-group">
  37. <label class="col-sm-2 control-label">域名</label>
  38. <div class="col-sm-9 col-xs-12">
  39. <input type="text" name="domain" class="form-control" value="{$domain}" readonly/>
  40. <span class="help-block">服务器域名</span>
  41. </div>
  42. </div>
  43. <div class="form-group">
  44. <label class="col-sm-2 control-label">站点IP</label>
  45. <div class="col-sm-9 col-xs-12">
  46. <input type="text" name="ip" class="form-control" value="{$ip}" readonly/>
  47. <span class="help-block">站点IP</span>
  48. </div>
  49. </div>
  50. <div class="form-group">
  51. <label class="col-sm-2 control-label">站点ID</label>
  52. <div class="col-sm-9 col-xs-12">
  53. <input type="text" name="id" class="form-control" value="{$id}" readonly />
  54. <span class="help-block">站点ID,如果为空,请到 <a href='{php echo url('cloud/profile')}'>站点注册</a> 绑定您的服务器</span>
  55. </div>
  56. </div>
  57. <div class="form-group">
  58. <label class="col-sm-2 control-label">授权码</label>
  59. <div class="col-sm-9 col-xs-12">
  60. <input type="text" name="code" class="form-control" value="{$auth['code']}" data-rule-required='true' data-msg-required='请填写授权码' />
  61. <span class="help-block">请联系客服将IP及站点ID提交给客服, 索取授权码,保护好您的授权码,避免泄漏</span>
  62. </div>
  63. </div>
  64. <div class="form-group">
  65. <label class="col-sm-2 control-label">官方网站</label>
  66. <div class="col-sm-9 col-xs-12">
  67. <div class='form-control-static'><a href='http://www.we7shop.cn' target='_blank'>http://www.we7shop.cn</a></div>
  68. {if empty($result['status'])}
  69. <span class='help-block'>如果您正在使用非正版授权,请您尊重我们的劳动成果,谢谢您~</span>
  70. <span class='help-block'>盗版有风险,请谨慎使用!</span>
  71. {else}
  72. {/if}
  73. </div>
  74. </div>
  75. <div class="form-group">
  76. <label class="col-sm-2 control-label"></label>
  77. <div class="col-sm-9 col-xs-12">
  78. <div class='form-control-static'>
  79. <input type="submit" value="验证授权并安装人人商城V2" class="btn btn-primary" />
  80. </div>
  81. </div>
  82. </div>
  83. </form>
  84. {else}
  85. <form action="" method="post" class="form-horizontal form" enctype="multipart/form-data" >
  86. <div class="form-group">
  87. <label class="col-sm-2 control-label">当前版本</label>
  88. <div class="col-sm-9 col-xs-12">
  89. <div class="input-group">
  90. <div class="input-group-addon" style="background:#f2f2f2">{$version}</div>
  91. <input type='text' class='form-control' value="RELEASE {$release}" readonly style="background:#fff;"/>
  92. <div class="input-group-btn">
  93. <a class='btn btn-default' href="{php echo webUrl('system/auth/upgrade/checkversion')}" >降级版本更新</a>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. <div class="form-group" >
  99. <label class="col-sm-2 control-label">最新版本</label>
  100. <div class="col-sm-9 col-xs-12">
  101. <div class="form-control-static" id="check">等待检测...</div>
  102. </div>
  103. </div>
  104. <div class="form-group" id="upgrade" style="display:none">
  105. <label class="col-sm-2 control-label"></label>
  106. <div class="col-sm-9 col-xs-12">
  107. <div class='form-control-static'>
  108. <input type="button" id="upgradebtn" value="立即更新" class="btn btn-primary" />
  109. </div>
  110. </div>
  111. </div>
  112. </form>
  113. <script language='javascript'>
  114. function process(action) {
  115. $.ajax({
  116. url: "{php echo webUrl('system/auth/upgrade/process')}",
  117. data: {action: action},
  118. type: 'post',
  119. dataType: 'json',
  120. success: function (ret) {
  121. var status = ret.status;
  122. var result = ret.result;
  123. var act = result.action;
  124. if (act == 'database') {
  125. if (status == 1) {
  126. $('#upgradebtn').val("已更新 " + result.success + " 个数据 / 共 " + result.total + " 个数据");
  127. process('database');
  128. } else {
  129. $('#upgradebtn').val("已成功更新 " + result.total + " 个数据");
  130. process('file');
  131. }
  132. } else if (act == 'file') {
  133. if (status == 1) {
  134. $('#upgradebtn').val("已更新 " + result.success + " 个文件 / 共 " + result.total + " 个文件");
  135. process('file');
  136. } else {
  137. $('#upgradebtn').val("已成功更新 " + result.total + " 个文件");
  138. process('upgrade');
  139. }
  140. } else if (act== 'upgrade') {
  141. if (status == 1) {
  142. $('#upgradebtn').val("已更新 " + result.success + " 个补丁 / 共 " + result.total + " 个补丁");
  143. process('upgrade');
  144. } else {
  145. $('#upgradebtn').val('更新成功').removeAttr('updating');
  146. tip.alert('更新成功!', function () {
  147. location.href = "./index.php?c=site&a=entry&m=ewei_shopv2&do=web&r=system.auth.upgrade";
  148. });
  149. }
  150. }
  151. }
  152. });
  153. }
  154. $(function () {
  155. $.ajax({
  156. url: "{php echo webUrl('system/auth/upgrade/check')}",
  157. type: 'post',
  158. dataType: 'json',
  159. success: function (ret) {
  160. var result = ret.result;
  161. if (ret.status == 1) {
  162. var html = "";
  163. if (result.filecount <= 0 && !result.database && !result.upgrades) {
  164. html += "恭喜您,您现在是最新版本!"
  165. } else {
  166. html += "最新版本: <span style='color:red'>" + result.version + "</span> RELEASE " + result.release +"<br/>";
  167. if (result.filecount > 0) {
  168. html += "共检测到有 <span style='color:red'>" + result.filecount + "</span> 个文件需要更新.<br/>";
  169. }
  170. if (result.database || result.upgrades) {
  171. html += "此次有数据变动.<br/>";
  172. }
  173. if(result.templatefiles!=''){
  174. html += "<br/><b>模板更新</b><br/>";
  175. html += "<div style='height:150px;width:700px;overflow:auto;border:1px solid #f2f2f2;padding:5px;margin-top:10px;'>" + result.templatefiles + "</div><br/>";
  176. }
  177. if (result.log != '') {
  178. html += "<br/><b>更新日志:</b><br/>";
  179. html += "<div style='height:150px;width:700px;overflow:auto;border:1px solid #f2f2f2;padding:5px;margin-top:10px;'>" + result.log + "</div><br/>";
  180. }
  181. html += "<br/><b style='color:red'>更新之前请注意数据备份!</b><br/><br/>";
  182. }
  183. html += "<div id='process'></div>";
  184. $("#check").html(html);
  185. if (result.filecount > 0 || result.database || result.upgrades) {
  186. $('#upgrade').show();
  187. $("#upgradebtn").unbind('click').click(function () {
  188. if ($(this).attr('updating') == '1') {
  189. return;
  190. }
  191. tip.confirm('确认已备份,并进行更新吗?', function () {
  192. $(this).attr('updating', 1).val('正在更新中...');
  193. if( result.database){
  194. process('database');
  195. } else if(result.filecount>0){
  196. process('file');
  197. }else if(result.upgrades){
  198. process('upgrade');
  199. }
  200. });
  201. });
  202. }
  203. } else {
  204. $("#check").html(result.message);
  205. }
  206. }
  207. })
  208. })
  209. </script>
  210. {/if}
  211. </div>
  212. <script language='javascript'>
  213. $(function () {
  214. $('.page-content').show();
  215. });
  216. </script>
  217. <script language="javascript">myrequire(['web/init']);</script>
  218. </body>
  219. </html>