|
@@ -105,11 +105,11 @@ var entType="企业"
|
|
|
<div class="two"><script>document.write(entType)</script>LOGO:</div>
|
|
|
<div class="three" id="logoArea">
|
|
|
{{if .T.entinfo.s_avatar}}
|
|
|
- <img class='ent-LOGO cursor-pointer' src='{{.T.entinfo.s_avatar}}' onerror="$(this).next().removeClass('hide');$(this).remove();" onclick="document.getElementById('upload').click();">
|
|
|
+ <img class='ent-LOGO cursor-pointer' src='{{.T.entinfo.s_avatar}}' onerror="$(this).next().removeClass('hide');$(this).remove();" onclick="document.getElementById('upload').click();uploadType=0;">
|
|
|
{{end}}
|
|
|
<div{{if .T.entinfo.s_avatar}} class="hide"{{end}}>
|
|
|
- <img src="/images/services/default.png" style="width: 90px; height: 90px;cursor: pointer;" onclick="document.getElementById('upload').click();">
|
|
|
- <div id="tips" style="cursor: pointer;text-align: center; width: 90px; position: absolute; color: #fff; top: 64px; background-color: #cccccc;" onclick="document.getElementById('upload').click();">上传logo</div>
|
|
|
+ <img src="/images/services/default.png" style="width: 90px; height: 90px;cursor: pointer;" onclick="document.getElementById('upload').click();uploadType=0;">
|
|
|
+ <div id="tips" style="cursor: pointer;text-align: center; width: 90px; position: absolute; color: #fff; top: 64px; background-color: #cccccc;" onclick="document.getElementById('upload').click();uploadType=0;">上传logo</div>
|
|
|
<span class="margin-l-10" style="position: relative;top: 33px;">上传一张不超过10M的图片,支持jpg、png、bmp格式。建议尺寸260*260像素</span>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -132,14 +132,8 @@ var entType="企业"
|
|
|
<div class="one"><span class="glyphicon weixinhao icon_gray"></span></div>
|
|
|
<div class="two" style="letter-spacing: 4.5px;">微信号 :</div>
|
|
|
<div class="three" id="mblocation"><input type="text" name="s_weixin" class="form-control" id="s_weixin" value="{{.T.entinfo.s_weixin}}" maxlength="20">
|
|
|
- <a href="#" class="text-primary " onClick="uploadBarCode();">上传二维码</a>
|
|
|
- <img class="imgs barcode" alt="预览" name="imgurl" style="margin-left:10px;width:35px;height:35px;" src="{{Msg "seo" "cdn"}}{{.T.entinfo.s_weixinbarcode}}">
|
|
|
- <div style="display:none;">
|
|
|
- <div class="mupload"></div>
|
|
|
- <ul class="pic">
|
|
|
- </ul>
|
|
|
- <input type="hidden" value="" class="imgs" name="imgurl"/>
|
|
|
- </div>
|
|
|
+ <a href="#" class="text-primary " onClick="document.getElementById('upload').click();uploadType=1;">上传二维码</a>
|
|
|
+ <img class="imgs barcode" style="margin-left:10px;width:35px;height:35px;{{if not .T.entinfo.s_qrcode}}display:none;{{end}}" src="{{Msg "seo" "cdn"}}{{.T.entinfo.s_qrcode}}" onerror="$(this).hide();">
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -210,30 +204,51 @@ var entType="企业"
|
|
|
</body>
|
|
|
|
|
|
<script>
|
|
|
+var uploadType = 0;
|
|
|
//
|
|
|
var option={
|
|
|
btnname:"",
|
|
|
action:"/filemanage/upload",
|
|
|
btnClass:"",
|
|
|
afterError:function(data,e){
|
|
|
- alert("上传LOGO失败,请重新上传。");
|
|
|
+ if(uploadType == 1){
|
|
|
+ alert("上传二维码失败,请重新上传。");
|
|
|
+ }else{
|
|
|
+ alert("上传LOGO失败,请重新上传。");
|
|
|
+ }
|
|
|
},
|
|
|
afterUpload:function(data){ //此处可以重写,上传后的处理
|
|
|
if(data.flag == true){
|
|
|
+ var field = "s_avatar";
|
|
|
+ if(uploadType == 1){
|
|
|
+ field = "s_qrcode";
|
|
|
+ }
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
|
- url: "/member/yellowpage/updateEntLogo",
|
|
|
- data: "url="+data.url,
|
|
|
+ url: "/member/yellowpage/upLoadEntImg",
|
|
|
+ data: "field="+field+"&url="+data.url,
|
|
|
dataType: "text",
|
|
|
success: function(result){
|
|
|
if (result == "y"){
|
|
|
- $("#logoArea").html('<img class="ent-LOGO cursor-pointer" src="'+data.url+'" onclick="document.getElementById(\'upload\').click();">');
|
|
|
+ if(uploadType == 1){
|
|
|
+ $(".barcode").attr("src",data.url).show();
|
|
|
+ }else{
|
|
|
+ $("#logoArea").html('<img class="ent-LOGO cursor-pointer" src="'+data.url+'" onclick="document.getElementById(\'upload\').click();uploadType=0;">');
|
|
|
+ }
|
|
|
}else{
|
|
|
- alert("上传LOGO失败,请重新上传。");
|
|
|
+ if(uploadType == 1){
|
|
|
+ alert("上传二维码失败,请重新上传。");
|
|
|
+ }else{
|
|
|
+ alert("上传LOGO失败,请重新上传。");
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
error: function(){
|
|
|
- alert("上传LOGO失败,请重新上传。");
|
|
|
+ if(uploadType == 1){
|
|
|
+ alert("上传二维码失败,请重新上传。");
|
|
|
+ }else{
|
|
|
+ alert("上传LOGO失败,请重新上传。");
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
}else{
|
|
@@ -245,6 +260,9 @@ try{
|
|
|
$("#uploadLogo").upload(option);
|
|
|
}catch(e){}
|
|
|
//
|
|
|
+function uploadProcess(url,field){
|
|
|
+
|
|
|
+}
|
|
|
$("#s_persion").blur(function(){
|
|
|
var str = $("#s_persion").val();
|
|
|
if (str == ""){
|