chengkun
2025-05-23 a6f7b382623096b6a00924f418447cf5204e825e
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
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
        <meta http-equiv="Cache-Control" content="no-cache" />
        <title>{yun:}$config.sy_webname{/yun}</title>
        <meta name="keywords" content="人才招聘,网络招聘,wap" />
        <meta name="description" content="人才招聘网wap网站" />
        <meta content="width=device-width, initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport" />
        <meta name="MobileOptimized" content="240" />
        <meta http-equiv="Expires" content="0" />
        <meta http-equiv="Cache-Control" content="no-cache" />
        <meta http-equiv="Pragma" content="no-cache" />
        <meta content="yes" name="apple-mobile-web-app-capable" />
        <meta content="black" name="apple-mobile-web-app-status-bar-style" />
        <script src="{yun:}$wap_style{/yun}/js/flexible.js?v={yun:}$config.cachecode{/yun}"></script>
        <link rel="stylesheet" href="{yun:}$config.sy_weburl{/yun}/app/template/wap/css/lt/yun_wap_member.css?v={yun:}$config.cachecode{/yun}" type="text/css" />
        <link rel="stylesheet" href="{yun:}$config.sy_weburl{/yun}/app/template/wap/css/base.css?v={yun:}$config.cachecode{/yun}" type="text/css" />
        <link rel="stylesheet" href="{yun:}$config.sy_weburl{/yun}/app/template/wap/css/css.css?v={yun:}$config.cachecode{/yun}" type="text/css" />
        <link rel="stylesheet" type="text/css" href="{yun:}$wap_style{/yun}/js/webapppic/cropper.css?v={yun:}$config.cachecode{/yun}" />
        <link href="{yun:}$config_wapdomain{/yun}/js/vant/lib/index.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" />
    </head>
 
    <body>
        
        <div class="body_wap">
            <header>
                <div class="header_bg {yun:}if $tplmoblie.color{/yun}bg{yun:}$tplmoblie.color{/yun}{yun:}/if{/yun}">
                    <div class="header_h1">上传头像</div>
                </div>
            </header>
            <section class="resume_mangage">
                <div class="clear"></div>
                <div class="verify">
                    <div class="photo_i_box_v">
                        <div class="photo_i_box_v_c">
                            <div id="showResult">
                                <div id="changeAvatar" class="photo_i_box">
                                    <img src="{yun:}$photo{/yun}" width="120" height="120">
                                </div>
                                <div class="clear"></div>
                                <div class="photo_xz">
                                    <input id="image" type="file" accept="image/*" />选择上传头像
                                </div>
                                <div class="yunset_identity_msg"><i class="yunset_identity_msg_icon"></i>选择上传头像点击提交按钮即可上传</div>
                            </div>
                            
                            <input type="hidden" value=""  id="preview">
                        </div>
                        <div class="photo_tj">
                            <input type='hidden' name="txt" id="uimage" value="">
                            <input name="submit" type="button" onclick="photo()" value="提交" class="yunset_bth" />
                        </div>
                    </div>
                </div>
            </section>
        </div>
        <script src="{yun:}$wap_style{/yun}/js/jquery.min.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
        <script src="{yun:}$wap_style{/yun}/js/vue.min.js?v={yun:}$config.cachecode{/yun}"></script> 
        <script src="{yun:}$config_wapdomain{/yun}/js/vant/lib/vant.min.js?v={yun:}$config.cachecode{/yun}"></script> 
        <script src="{yun:}$config_wapdomain{/yun}/js/vant/phpyun_vant.js?v={yun:}$config.cachecode{/yun}"></script> 
        <script src="{yun:}$wap_style{/yun}/js/public.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
        <script src="{yun:}$wap_style{/yun}/js/alloy/transform.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
        <script src="{yun:}$wap_style{/yun}/js/alloy/alloy-finger.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
        <script src="{yun:}$wap_style{/yun}/js/alloy-crop.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
        <script src="{yun:}$wap_style{/yun}/js/compress.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
        <script src="{yun:}$wap_style{/yun}/js/exif.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
        <script>
         $(function() {
            $('#image').on('change', function() {
                cutImg();
            });
 
            var $inputImage = $('#image'),
                URL = window.URL || window.webkitURL;
            if (URL) {
                $inputImage.change(function() {
                    var files = this.files,
                        file;
                    previewImage(this,'preview');
                    if(files && files.length) {
                        file = files[0];
 
                        if(/^image\/\w+$/.test(file.type)) {
                            setTimeout(function(){
 
                                toAlloyCrop($('#preview').val());
                            },1000);
                            $inputImage.val('');
                        } else {
                            showMessage('请上传图片');
                        }
                    }
                });
            } else {
                $inputImage.parent().remove();
            }
        });
        function cutImg() {
            $('#showResult').fadeOut();
        }
        function toAlloyCrop(pic){
            var mAlloyCrop;
            
            mAlloyCrop = new AlloyCrop({
                image_src: pic,
                width: 200,
                height: 200,
                output: 1,
                ok: function(base64, canvas) {
                    $("#changeAvatar > img").attr("src", base64);
                    document.getElementById('uimage').value = base64;
                    $('#showResult').fadeIn();
                },
                cancel: function() {
                    $('#showResult').fadeIn();
                },
                ok_text: '确定',
                cancel_text: '取消'
            });
        }
        function photo() {
            var uimage = $("#uimage").val();
            if(uimage == '') {
                showToast('头像未改变,无需修改');
                return false;
            }else{
                var token = '{yun:}$token{/yun}';
                var regS = new RegExp("\\+", "gi");
                uimage = uimage.replace(regS, "#");
                showLoading();
                $.ajax({
                    type: 'POST',
                    url: "index.php?c=upload&a=uploadimg_save",
                    cache: false,
                    dataType: 'json',
                    data: {
                        token: token,
                        uimage: uimage,
                        submit: 1
                    },
                    success: function(arr) {
                        hideLoading();
                        if(arr.errcode == 9) {
                            $('#submit').attr('onclick','');
                            $('#submit').val(arr.msg);
                        }
                        showToast(arr.msg);
                        return false;
                    }
                });
            }
        }
    </script>
</body>
</html>