|
|
@@ -46,9 +46,29 @@
|
|
|
<button type="button" class="layui-btn layui-btn-small" id="up-avatar">
|
|
|
<i class="layui-icon"></i>上传图片</button>
|
|
|
</div>
|
|
|
+
|
|
|
+ <button type="button" class="layui-btn layui-btn-small" onclick="checkImage()">选择图片</button>
|
|
|
+ <div class="layui-layer-shade" id="all_blank_img" style="display: none"></div>
|
|
|
+ <div class="layui-layer layui-layer-dialog" id="check_image" style="display: none">
|
|
|
+ <div class="layui-layer-title" style="cursor: move;">请选择图片</div>
|
|
|
+ <div id="images" class="layui-layer-content layui-layer-padding" style="height: 70vh;">
|
|
|
+ {volist name="material" id="vo"}
|
|
|
+ <div style="width: 23%;height:120px;float: left;text-align: center;background-color: #DCDCDC;margin: 1%;position: relative;">
|
|
|
+ <div style="height:23px;line-height: 23px;">{$vo.name}</div>
|
|
|
+ <img onclick="onCheckImage(`{$vo.url}`)" src="{$vo.url}" style="margin-top: 0px;height: 90px;">
|
|
|
+ </div>
|
|
|
+ {/volist}
|
|
|
+ </div>
|
|
|
+ <span class="layui-layer-setwin"></span>
|
|
|
+ <div class="layui-layer-btn layui-layer-btn-">
|
|
|
+ <a class="layui-layer-btn0" onclick="closeCheckImage()">取消</a>
|
|
|
+ </div>
|
|
|
+ <span class="layui-layer-resize"></span>
|
|
|
+ </div>
|
|
|
+
|
|
|
<span>建议上传420px*700px</span>
|
|
|
<div class="input-group col-sm-3" id="avatar">
|
|
|
- <img src="{$advertisement['advertisement_img']}" height="40px"/>
|
|
|
+ <img src="{$advertisement['advertisement_img']}" id="ChoiceImg" height="40px"/>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
@@ -79,9 +99,29 @@
|
|
|
<button type="button" class="layui-btn layui-btn-small" id="up-logo">
|
|
|
<i class="layui-icon"></i>上传logo</button>
|
|
|
</div>
|
|
|
+
|
|
|
+ <button type="button" class="layui-btn layui-btn-small" id="" onclick="checkImg()">选择图片</button>
|
|
|
+ <div class="layui-layer-shade" id="all_blank" style="display: none"></div>
|
|
|
+ <div class="layui-layer layui-layer-dialog" id="check_img" style="display: none">
|
|
|
+ <div class="layui-layer-title" style="cursor: move;">请选择图片</div>
|
|
|
+ <div id="imgs" class="layui-layer-content layui-layer-padding" style="height: 70vh;">
|
|
|
+ {volist name="material" id="vo"}
|
|
|
+ <div style="width: 23%;height:120px;float: left;text-align: center;background-color: #DCDCDC;margin: 1%;position: relative;">
|
|
|
+ <div style="height:23px;line-height: 23px;">{$vo.name}</div>
|
|
|
+ <img onclick="onCheckImg(`{$vo.url}`)" src="{$vo.url}" style="margin-top: 0px;height: 90px;">
|
|
|
+ </div>
|
|
|
+ {/volist}
|
|
|
+ </div>
|
|
|
+ <span class="layui-layer-setwin"></span>
|
|
|
+ <div class="layui-layer-btn layui-layer-btn-">
|
|
|
+ <a class="layui-layer-btn0" onclick="closeCheckImg()">取消</a>
|
|
|
+ </div>
|
|
|
+ <span class="layui-layer-resize"></span>
|
|
|
+ </div>
|
|
|
+
|
|
|
<span>建议上传48px*48px</span>
|
|
|
<div class="input-group col-sm-3" id="logo">
|
|
|
- <img src="{$settings['logo']}" height="40px"/>
|
|
|
+ <img src="{$settings['logo']}" id="onChoiceImg" height="40px"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -106,6 +146,37 @@
|
|
|
<script src="__JS__/plugins/layer/layer.min.js"></script>
|
|
|
<script src="__JS__/layui/layui.js"></script>
|
|
|
<script src="__JS__/jquery.form.js"></script>
|
|
|
+<script>
|
|
|
+ function checkImage() {
|
|
|
+ $("#all_blank_img").css({"z-index": "19991015", "background-color": "rgb(0, 0, 0)", "opacity": "0.3", "display": "block"});
|
|
|
+ $("#check_image").css({"z-index": "19991016", "top": "50px", "left": "217px", "width": "70vw", "display": "block"});
|
|
|
+ }
|
|
|
+ function closeCheckImage() {
|
|
|
+ $("#all_blank_img").css({"display": "none"});
|
|
|
+ $("#check_image").css({"display": "none"});
|
|
|
+ }
|
|
|
+ function onCheckImage(path) {
|
|
|
+ $("#all_blank_img").css({"display": "none"});
|
|
|
+ $("#check_image").css({"display": "none"});
|
|
|
+ $("#ChoiceImg").attr('src',path);
|
|
|
+ $("#advertisement_img").val(path);
|
|
|
+ }
|
|
|
+
|
|
|
+ function checkImg() {
|
|
|
+ $("#all_blank").css({"z-index": "19991015", "background-color": "rgb(0, 0, 0)", "opacity": "0.3", "display": "block"});
|
|
|
+ $("#check_img").css({"z-index": "19991016", "top": "50px", "left": "217px", "width": "70vw", "display": "block"});
|
|
|
+ }
|
|
|
+ function closeCheckImg() {
|
|
|
+ $("#all_blank").css({"display": "none"});
|
|
|
+ $("#check_img").css({"display": "none"});
|
|
|
+ }
|
|
|
+ function onCheckImg(path) {
|
|
|
+ $("#all_blank").css({"display": "none"});
|
|
|
+ $("#check_img").css({"display": "none"});
|
|
|
+ $("#onChoiceImg").attr('src',path);
|
|
|
+ $("#logo_img").val(path);
|
|
|
+ }
|
|
|
+</script>
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
layui.use(['form', 'upload'], function(){
|
|
|
@@ -119,7 +190,7 @@
|
|
|
,done: function(res){
|
|
|
//上传完毕回调
|
|
|
if(0 == res.code){
|
|
|
- $("#avatar").html('<img src="' + res.data.src + '" height="40px">');
|
|
|
+ $("#avatar").html('<img src="' + res.data.src + '" id="ChoiceImg" height="40px">');
|
|
|
$("#advertisement_img").val(res.data.src);
|
|
|
}else{
|
|
|
layer.msg(res.msg);
|
|
|
@@ -137,7 +208,7 @@
|
|
|
,done: function(res){
|
|
|
//上传完毕回调
|
|
|
if(0 == res.code){
|
|
|
- $("#logo").html('<img src="' + res.data.src + '" height="40px">');
|
|
|
+ $("#logo").html('<img src="' + res.data.src + '" id="onChoiceImg" height="40px">');
|
|
|
$("#logo_img").val(res.data.src);
|
|
|
}else{
|
|
|
layer.msg(res.msg);
|