chengkun
2025-04-18 1bb985f32f2efe0f9dd69f3cf29a1c809b1cf96d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
{yun:}include file="$comstyle/header.htm"{/yun}
<link rel="stylesheet" href="{yun:}$config.sy_weburl{/yun}/js/imgareaselect/imgareaselect.css?v={yun:}$config.cachecode{/yun}" type="text/css"/>
<script type="text/javascript" src="{yun:}$config.sy_weburl{/yun}/js/imgareaselect/jquery.imgareaselect.js?v={yun:}$config.cachecode{/yun}"></script>  
<script type="text/javascript" src="{yun:}$config.sy_weburl{/yun}/js/imgareaselect/ajaxfileupload.js?v={yun:}$config.cachecode{/yun}"></script>  
<div class="w1000">
  <div class="admin_mainbody"> 
  {yun:}include file="$comstyle/left.htm"{/yun}
        <div class="com_tit"><span class="com_tit_span">企业资料</span> <div class="com_topbth_box">
            <a  href="{yun:}url m=company c=show id='`$uid`'{/yun}" target="_blank"class="com_ylbth">预览主页</a>
        
        </div></div>
 <div class=right_box>
             <div class=vip_boxshow>
                 <div class="vip_boxshow_c">
 <div class="zllist ">
                 <div class="report_uaer_list_h1">编辑公司信息</div>
                 <div class="report_uaer_list_p">能获得更多求职者的青睐</div>
                 <ul>
                         <li><a href="index.php?c=info">基本信息</a></li>
                         <li><a href="index.php?c=info&act=side">补充信息</a></li>
                     
                         <li> <a href="index.php?c=show"> 公司相册</a></li>
                         <li class="zlcur"><a href="index.php?c=uppic"> 公司LOGO</a></li>
     <li><a href="index.php?c=product">产品介绍</a></li>
     <li><a href="index.php?c=news">公司资讯</a></li>
     <li><a href="index.php?c=map">公司地图</a></li>
    <li><a href="index.php?c=comtpl">个性化模板</a></li>
                 </ul>
             </div>
             <div class="vip_box" style="margin-top: 0px; padding-top: 10px;;">
     
<div class="uppic_box">
      <div class="com_new_tip"> 
          <span class="com_new_tip_h">温馨小提示</span>有时因页面缓存问题,上传后照片不能及时更新请击刷新页面即可 </div>
 
  <div  style="padding-left:100px; padding-top:30px; position: relative;">
    <div class="uppic_left">
            <div class="uppic_tip">方式一:选择本地LOGO,上传编辑企业LOGO</div>
            <div class="uppic_tip_bth">
             <a class="uppic_tip_bthupload" href="javascript:;">选择LOGO</a>
               <input id="image" class="uppic_tip_bthfile" type="file" name="image" onchange="ajaxfile();">
             </div>
             <div class="uppic_tip_gs">最大{yun:}$config.file_maxsize{/yun}M,支持{yun:}$config.pic_type{/yun}格式</div>    
             <div class="clear"></div>
             <div class="uppic_tit">
                LOGO预览
                {yun:}if $company.logo_n{/yun}
                {yun:}if $company.logo_status=='1'{/yun}
                    <font color="#f00">审核中</font>
                {yun:}else if $company.logo_status=='2'{/yun}
                    <font color="#f00">未通过</font>
                {yun:}else{/yun}
                    <font color="#f00">已审核</font>
                {yun:}/if{/yun}
                {yun:}/if{/yun}
            </div>
            
             
              <div class="oppic_img_big">
              <div class="oppic_img_big_img" style="width:140px;height:140px;"><img src="{yun:}$company.logo{/yun}" width='140' height='140' /></div>
              <div class="oppic_img_big_p" style="width:140px;">标准LOGO尺寸 140×140</div>
            </div>
            
            
              <div class="clear"></div>  
          <div class="uppic_flash" style="display:none;" id='uppic_flash'> 
            <div class="uppic_big_zx">
                <img src="" style="float: left; margin-right: 10px;" id="thumbnail" />
               </div>
               <div style="width:200px; float:left"> 
                <div id="preview1" class="uppic_previ1">
                    <img id="preview1_img" src="" style="position: relative;"/>
                </div>
            </div>       
            <div class="uppic_pb">
            <form name="form1" id="form1">
                <input name="sizeit" id="sizeit" type="submit" value="保存LOGO"  class="uppic_pb_bth"/>    
            </form>
          </div> 
          </div>
             </div>
        
           <div class="uppic_right" style="position: absolute;right:30px;top:30px">
          
            <div class="uppic_right_tit">方式二:手机拍照上传</div>
            <div class="uppic_ewm">
             <img src="{yun:}url m=upload c=qrcode type=4{/yun}" alt="手机扫码拍照上传" width="130" height="130" />
             </div>
            <div class="uppic_ewm_p"> 扫描二维码 </div>
            <div class="">  手机拍照上传后,请刷新此页面 </div>
        </div>
         
          
        
      </div>
      
    </div>
  </div>
</div>
</div>
</div> 
 
<script>
function ajaxfile() {
    if($("#image").val() != '') {
        layer.load('图片上传中,请稍候....', 0);
        $.ajaxFileUpload({
            url: 'index.php?c=uppic&act=ajaxfileupload',
            secureuri: false, //是否需要安全协议,一般设置为false
            fileElementId: 'image', //文件上传域的ID
            dataType: 'json', //返回值类型 一般设置为json
            success: function (data, status){  //服务器成功响应处理函数
                layer.closeAll('loading');
                if (data.s_thumb) {
                    layer.msg(data.s_thumb, 2, 8);
                } else {
                    hideLoading(data.url);
                }
           }
        })
    }
}
var size1={
    width:140,
    height:140
}
$('#preview1').width(size1.width);
$('#preview1').height(size1.height);
function hideLoading(pic) {
    $("#thumbnail").attr({ 'src': pic });
    $("#preview1_img").attr({ 'src': pic }); 
    $('#uppic_flash').show();
    var ias = $('#thumbnail').imgAreaSelect({
        aspectRatio: '140:140', //长宽1:1的比例,在等待剪裁的图像上呈现出正方形的选择框
        onSelectChange: lis, //把用户当前的选择状态传给lis函数
        onInit: function () {
            var _opt = ias.getOptions();
            render($('#preview1_img'), $("#thumbnail")[0], {
                height: _opt.y2 - _opt.y1,
                width: _opt.x2 - _opt.x1,
                x1: _opt.x1,
                x2: _opt.x2,
                y1: _opt.y1,
                y2: _opt.y2
            }, size1);
        },
        instance: true,
        keys: true,
        x1: 37, //选择框在图片里的初始位置,这里默认是图片左上角,宽度和高度都是200px,符合size1
        y1: 15,
        x2: size1.width,
        y2: size1.height
    });
}
function lis(img, sel) {
    render($('#preview1 img'), img, sel, size1); 
}
function render(target, img, sel, size) {
    var scale = size.width / sel.width;
    target.css({
        width: Math.round(scale * $(img).width()),
        height: Math.round(scale * $(img).height())
    });
    target.css({
        marginLeft: '-' + Math.round(scale * sel.x1) + 'px',
        marginTop: '-' + Math.round(scale * sel.y1) + 'px'
    });
    target.data('scale', scale);
    target.data('width', sel.width);
    target.data('height', sel.height);
    target.data('x', sel.x1);
    target.data('y', sel.y1);
}
//ajax提交表单
$(function () {
    $('#form1').submit(function (e) {
        e.preventDefault();
        e.stopPropagation();
        var preview1 = $('#preview1 img'); 
        loadlayer();
        $.post("index.php?c=uppic&act=savethumb", {
            sizeit: true,
            count: 1,
            width: preview1.data('width'),
            height: preview1.data('height'),
            x: preview1.data('x'),
            y: preview1.data('y'),
            img1: $('#preview1_img').attr('src'),
            scale: preview1.data('scale') 
        }, function (res) {
            layer.closeAll('loading');
            if(res){
                var res = eval('('+res+')');
                layer.msg(res.msg, 2, res.st,function(){location.reload();}); 
            }
        });
    });
});
</script> 
{yun:}include file="$comstyle/footer.htm"{/yun}