Commit 3d5d04bf authored by liyadong's avatar liyadong

update 上传图片

parent d181afab
This diff is collapsed.
......@@ -439,14 +439,20 @@
background: url("../images/content8.png") no-repeat center top;
background-size: 100% auto;
text-align: center;
text-align: center;
overflow: hidden;
span {
.fs(.58rem, #feee64);
padding-top: .2rem;
.fs(.32rem, #feee64);
display: inline-block;
width: 2.8rem;
}
.img-container{
.pr();
width: 7.4rem;
height: 4.1rem;
overflow: hidden;
margin: 2.05rem auto 0;
}
#file {
.pa();
left: 1.5rem;
......@@ -460,9 +466,11 @@
}
img {
width: 7.4rem;
height: 4.1rem;
margin: 2rem 0 0 0;
.pa();
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
max-width: 7.5rem;
}
}
......
......@@ -129,12 +129,18 @@
<!--高光时刻-->
<div class="ggsk-container">
@if($userImgStatus == -1) <img src="{{ asset('postcard/images/img_add.jpg') }}" class="img img-add" alt="">
<input type="file" id="file"> @endif
@if($userImgStatus == 0) <img src="{{ asset('postcard/images/img_sh.jpg') }}" class="img img-sh" alt=""> @endif
@if($userImgStatus == 1) <img src="{{ $userImg }}" class="img img-sh" alt=""> @endif
@if($userImgStatus == 2) <img src="{{ asset('postcard/images/sh_fail.jpg') }}" class="img img-sh" alt="">
<input type="file" id="file"> @endif
<div class="img-container">
@if($userImgStatus == -1) <img src="{{ asset('postcard/images/img_add.jpg') }}" class="img img-add" alt="">
<input type="file" id="file"> @endif
@if($userImgStatus == 0) <img src="{{ asset('postcard/images/img_sh.jpg') }}" class="img img-sh" alt=""> @endif
@if($userImgStatus == 1) <img src="{{ $userImg }}" class="img img-sh" alt=""> @endif
@if($userImgStatus == 2) <img src="{{ asset('postcard/images/sh_fail.jpg') }}" class="img img-sh" alt="">
<input type="file" id="file"> @endif
</div>
@if($userImgStatus != 1)
<span>建议尺寸(710*414px)</span>
@endif
</div>
<div class="bottom-container">
<!--分享-->
......@@ -200,6 +206,7 @@
$(document).on('change', '#file', function (e) {
var formData = new FormData();
var file = $("#file")[0].files[0];
console.log(file)
var acceptFileTypes = /^image\/(gif|jpe?g|png)$/i;
var roleId = getQueryString('roleId');
var serverId = getQueryString('serverId');
......@@ -227,7 +234,7 @@
dataType: "json",
success: function (data) {
$('.img-add').hide();
$('.ggsk-container').html('<img src="{{ asset('postcard/images/img_sh.jpg') }}" class="img img-sh" alt="">');
$('.img-container').html('<img src="{{ asset('postcard/images/img_sh.jpg') }}" class="img img-sh" alt="">');
},
error: function (data) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment