提交 8eaabadd 编写于 作者: D Devil

应用在线安装优化

上级 fc64f124
...@@ -434,7 +434,7 @@ ...@@ -434,7 +434,7 @@
{{/if}} {{/if}}
<!-- 购买导航 --> <!-- 购买导航 -->
<div class="buy-nav"> <div class="buy-nav {{if $goods['is_exist_many_spec'] eq 0}}buy-nav-not-many-spec{{/if}}">
<div class="buy-nav-opt {{if !empty($buy_button) and isset($buy_button['count'])}}buy-nav-opt-button-number-{{$buy_button.count}}{{/if}}"> <div class="buy-nav-opt {{if !empty($buy_button) and isset($buy_button['count'])}}buy-nav-opt-button-number-{{$buy_button.count}}{{/if}}">
<!-- 商品页面基础信息购买小导航内部前面钩子 开始 --> <!-- 商品页面基础信息购买小导航内部前面钩子 开始 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
......
...@@ -162,9 +162,6 @@ class AppMiniService ...@@ -162,9 +162,6 @@ class AppMiniService
*/ */
public static function ThemeUpload($params = []) public static function ThemeUpload($params = [])
{ {
// 初始化
self::Init($params);
// 文件上传校验 // 文件上传校验
$error = FileUploadError('theme'); $error = FileUploadError('theme');
if($error !== true) if($error !== true)
...@@ -179,6 +176,24 @@ class AppMiniService ...@@ -179,6 +176,24 @@ class AppMiniService
return DataReturn('文件格式有误,请上传zip压缩包', -2); return DataReturn('文件格式有误,请上传zip压缩包', -2);
} }
// 上传处理
return self::ThemeUploadHandle($_FILES['file']['tmp_name'], $params);
}
/**
* 模板上传处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2018-12-19T00:53:45+0800
* @param [string] $package_file [软件包地址]
* @param [array] $params [输入参数]
*/
public static function ThemeUploadHandle($package_file, $params = [])
{
// 初始化
self::Init($params);
// 主题目录 // 主题目录
$dir = self::$old_path.DS; $dir = self::$old_path.DS;
...@@ -189,7 +204,7 @@ class AppMiniService ...@@ -189,7 +204,7 @@ class AppMiniService
} }
// 开始解压文件 // 开始解压文件
$resource = zip_open($_FILES['theme']['tmp_name']); $resource = zip_open($package_file);
while(($temp_resource = zip_read($resource)) !== false) while(($temp_resource = zip_read($resource)) !== false)
{ {
if(zip_entry_open($resource, $temp_resource)) if(zip_entry_open($resource, $temp_resource))
......
...@@ -14,6 +14,7 @@ use think\Db; ...@@ -14,6 +14,7 @@ use think\Db;
use app\service\PluginsAdminService; use app\service\PluginsAdminService;
use app\service\PaymentService; use app\service\PaymentService;
use app\service\ThemeService; use app\service\ThemeService;
use app\service\AppMiniService;
/** /**
* 软件安装服务层 * 软件安装服务层
...@@ -163,9 +164,12 @@ class PackageInstallService ...@@ -163,9 +164,12 @@ class PackageInstallService
// 小程序主题 // 小程序主题
case 'minitheme' : case 'minitheme' :
echo '<pre>'; if(empty($params['terminal']))
print_r($res); {
print_r($params);die; return DataReturn('未指定小程序终端类型', -1);
}
$params['application_name'] = $params['terminal'];
$ret = AppMiniService::ThemeUploadHandle($res['url'], $params);
break; break;
// 默认 // 默认
......
...@@ -14,25 +14,41 @@ var dialog = dialog || {}; ...@@ -14,25 +14,41 @@ var dialog = dialog || {};
dialog.alert = function(options) { dialog.alert = function(options) {
options = options || {}; options = options || {};
options.class_name = options.class_name || '';
options.title = options.title || null; options.title = options.title || null;
options.content = options.content || '提示内容'; options.content = options.content || '提示内容';
options.isClose = options.isClose || false;
options.isBtn = options.isBtn || false;
options.config = options.config || {};
options.onConfirm = options.onConfirm || function() { options.onConfirm = options.onConfirm || function() {
}; };
var html = []; var html = [];
html.push('<div class="am-modal am-modal-alert" tabindex="-1">'); html.push('<div class="am-modal am-modal-alert '+options.class_name+'" tabindex="-1">');
html.push('<div class="am-modal-dialog">'); html.push('<div class="am-modal-dialog">');
if(options.title !== null) if(options.title !== null || options.isClose === true)
{ {
html.push('<div class="am-modal-hd">' + options.title + '</div>'); html.push('<div class="am-modal-hd">');
if(options.title !== null)
{
html.push('<span>'+options.title+'</span>');
}
if(options.isClose === true)
{
html.push('<a href="javascript: void(0)" class="am-close" data-am-modal-close>&times;</a>');
}
html.push('</div>');
} }
html.push('<div class="am-modal-bd">' + options.content + '</div>'); html.push('<div class="am-modal-bd">' + options.content + '</div>');
html.push('<div class="am-modal-footer"><span class="am-modal-btn">确定</span></div>'); if(options.isBtn)
{
html.push('<div class="am-modal-footer"><span class="am-modal-btn">确定</span></div>');
}
html.push('</div>'); html.push('</div>');
html.push('</div>'); html.push('</div>');
return $(html.join('')) return $(html.join(''))
.appendTo('body') .appendTo('body')
.modal() .modal(options.config)
.on('closed.modal.amui', function() { .on('closed.modal.amui', function() {
options.onConfirm(); options.onConfirm();
var $this = $(this); var $this = $(this);
......
...@@ -306,6 +306,10 @@ flex: 1 1 0%;line-height: 16px;cursor: pointer;} ...@@ -306,6 +306,10 @@ flex: 1 1 0%;line-height: 16px;cursor: pointer;}
padding-left: 65px; padding-left: 65px;
margin-top: 10px !important; margin-top: 10px !important;
} }
.buy-nav-not-many-spec {
padding-left: 0px !important;
margin-top: 20px !important;
}
} }
@media only screen and (max-width:641px) { @media only screen and (max-width:641px) {
.buy-nav .buy-submit-container, .buy-nav .buy-submit-container,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册