chengkun
2025-05-26 8f3df543230cd4403368b39b9bbe5726d11a0284
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
 UM.getEditor('content', {
    toolbar: false,
    elementPathEnabled: false,
    wordCount: false,
    autoHeightEnabled: false
});
 
 UM.getEditor('services', {
    toolbar: true,
    elementPathEnabled: true,
    wordCount: true,
    autoHeightEnabled: true
});
 
/*mui.init();
var viewApi = mui('#app').view({
    defaultPage: '#main'
});
 
var view = viewApi.view;
(function($) {
    //初始化单页的区域滚动
    mui('.mui-scroll-wrapper').scroll({
        scrollY: true, //是否竖向滚动
        scrollX: false, //是否横向滚动
        startX: 0, //初始化时滚动至x
        startY: 0, //初始化时滚动至y
        indicators: true, //是否显示滚动条
        deceleration: 0.0006, //阻尼系数,系数越小滑动越灵敏
        // bounce: true //是否启用回弹
    });
    //处理view的后退与webview后退
    var oldBack = $.back;
    $.back = function() {
        if(viewApi.canBack()) { //如果view可以后退,则执行view的后退
            viewApi.back();
        } else { //执行webview后退
            oldBack();
        }
    };
})(mui);
view.addEventListener('pageBeforeBack', function(e) {
        var content = '',
                showid = '',
                textid = '';
            if(e.detail.page.id == 'contenthtml') {
                showid = 'contentshow';
                textid = 'contenttext';
                content = UM.getEditor('content').getContent();
            } else if(e.detail.page.id == 'serviceshtml') {
                showid = 'servicesshow';
                textid = 'servicestext';
                content = UM.getEditor('services').getContent();
            }
            if(content != "") {
                document.getElementById(showid).innerText = content.replace(/<\/?.+?>/g, "").replace(/ /g, "");
                document.getElementById(textid).innerText = content;
            }
});*/
    var infosubmitBtn = document.getElementById('infosubmit');
    if(infosubmitBtn) {
   
        infosubmitBtn.addEventListener('tap', checkinfo, false)
    }
  
  function checkinfo(){
    var name = $.trim(document.getElementById('name').value),
        sex = $.trim(document.getElementById('sex').value),
        provinceid = $.trim(document.getElementById('provinceid').value),
        cityid = $.trim(document.getElementById('cityid').value),
        three_cityid = $.trim(document.getElementById('three_cityid').value),
        services = $.trim(document.getElementById('servicestext').value),
        speciality = $.trim(document.getElementById('speciality').value),
        salary = $.trim(document.getElementById('salary').value),
        content = $.trim(document.getElementById('contenttext').value),
        moblie = $.trim(document.getElementById('moblie').value);
        if(name ==  ''){
            showToast('请填写姓名');return false;
        }
        if(sex  ==  ''){
            showToast('请选择性别');return false;
        }
        var cionly='';
        if(ct.length<=0 || ct=='new Array()'){
          cionly = '1';
        }
        if(cionly=='1'){
          if(provinceid == '' || provinceid == '0') {
             showToast('请选择所在地!');return false;
          }
        }else{
          if(cityid == '' || cityid == '0') {
             showToast('请选择所在地!');return false;
          }
        }
        
        if(services==''){
           showToast('请填写提供服务!');return false;
        }
        if(speciality==''){
          showToast('请填写技能特长!');return false;
        }
        if(salary==''){
          showToast('请填写工作薪资');return false;
        }
        if(content==''){
          showToast('请填写个人简介!');return false;
        }
        if(moblie==''){
          showToast('请填写联系电话!');return false;
        }
        if(moblie != '' && !isjsMobile(moblie)) {  
            showToast('请填写正确联系电话格式!');
            return false;
        }else{
            $.post('index.php?c=free&a=freemoblie',{moblie:moblie},function(data){
                if(data==1){
                   showToast('手机号码已存在,请重新输入!');return false;
                }else{
                    formData.append('name',name);
                    formData.append('sex',sex);
                    formData.append('provinceid',provinceid);
                    formData.append('cityid',cityid);
                    formData.append('three_cityid',three_cityid);
                    formData.append('services',services);
                    formData.append('speciality',speciality);
                    formData.append('salary',salary);
                    formData.append('content',content);
                    formData.append('moblie',moblie);
                    formData.append('submit', 'submit');
                    showLoading()
                    $.ajax({
                      url:  "index.php?c=free&a=info",
                      type: 'post',
                      data :formData,
                      contentType: false,
                      processData: false,
                      dataType: 'json',
                      success: function(res) {
                        hideLoading();
                        var res = JSON.stringify(res);
                        var data = JSON.parse(res);
                        if(data.url){
                          showToast(data.msg, 2, function() {location.href = data.url;});
                        }else{
                          showToast(data.msg, 2);return false;
                        }
                    }
          
                  });
                }
                
            });
        }
  }
  
function photo() {
    var uimage = $("#uimage").val();
    if(uimage == '') {
        showToast('图片未改变,无需修改');
        return false;
    }else{
        var regS = new RegExp("\\+", "gi");
        uimage = uimage.replace(regS, "#");
        showLoading()
        $.ajax({
            type: 'POST',
            url: "index.php?c=free&a=photo",
            cache: false,
            dataType: 'json',
            data: {
                uimage: uimage,
                submit: 1
            },
            success: function(res) {
                hideLoading();
        if(res==9){
          showToast('供求头像更新成功', 2, function() {
          window.location.href = wapurl + "index.php?c=free&a=info";});
        }else{
          showToast('供求头像更新失败');
        }
            }
        });
    }
}