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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
{yun:}include file="$wapstyle/header_cont.htm"{/yun}
<style>body{ background:#fff}</style>
<div class="">
    <div class="fk_box_lx">
    <div class="fk_box_tit">反馈你的问题</div>
        <span class="advice_list_fs" data-code="1">建议</span> 
        <span class="advice_list_fs" data-code="2">意见</span>
        <span class="advice_list_fs" data-code="3">求助</span> 
        <span class="advice_list_fs" data-code="4">投诉</span> 
        <input type="hidden" name="infotype" />
    <div class="fk_textarea"><textarea class="advice_list_textarea" id="content" name="content" data-id="{yun:}$id{/yun}" placeholder="留下您的意见或反馈,我们会不断改进~"></textarea></div>
        </div>
    <div class="advice_list_c">
    <div class="advice_list">
        <span class="advice_list_s">联系人</span>
        <input class="advice_list_text" name="username" id="username" type="text" placeholder="请输入您的姓名" value="{yun:}$advice_name{/yun}">
    </div>
    
    <div class="advice_list ">
        <span class="advice_list_s">联系手机</span>
        <input class="advice_list_text" name="moblie" id="moblie" type="text" placeholder="请输入手机号" value="{yun:}$advice_mobile{/yun}">
    </div>
    {yun:}if strpos($config.code_web,"意见反馈")!==false{/yun} 
        {yun:}if $config.code_kind>2{/yun}
        <div class="gtdx-captcha">
            <div id="bind-captcha" data-id='' data-type=''></div>
            <input type='hidden' id="verify_token"  name="verify_token" value="">
            <input type='hidden' id="popup-submit">
            <input type='hidden' id="bind-submit">
        </div>
        {yun:}else{/yun}
        <div class="advice_list ">
            <span class="advice_list_s">验证码</span>
            <div class="advice_list_yz">
                <input class="zx_yx_input" id="msg_CheckCode" type="text" placeholder="请输入验证码" value="" maxlength="6" name="authcode">
            </div>
            <img class="advice_list_yzm" id="vcode_imgs" src="{yun:}$config.sy_wapdomain{/yun}/authcode.inc.php" onclick="checkCode('vcode_imgs');">
        </div>
        {yun:}/if{/yun} 
    {yun:}/if{/yun}
    {yun:}if $config.sy_msg_isopen==1 && $config.sy_msg_cert==1 && $config.sy_advice_mobilecode==1{/yun}
        <!--手机验证码输入框-->
        <div class="advice_list advice_list_hq">
            <span class="advice_list_s">短信验证</span>
            <div class="advice_list_yz">
                <input class="zx_yx_input" name="advice_code" id="advice_code" type="text" maxlength='6'  placeholder="输入短信验证码">
            </div>
            <div class="advice_list_hqbth" id="send_msg_tip" onclick="send_advice_msg('{yun:}$config_wapdomain{/yun}/index.php?c=advice&a=sendmsg');"> 短信验证码
            </div>
        </div>
        
    
    {yun:}/if{/yun}
    
 
    </div>
    <div class="advice_list_but mt15">
        <input class="" type="submit" id="submit" name="submit" value="提交" onclick="advice('vcode_imgs');">
    </div>
</div>
 
<div class="advice_list_p">
    尊敬的用户您好!<br>我们将在第一时间及时回复您的反馈,如您的问题比较紧急,请致电服务热线!
    <div>客服热线:{yun:}$config.sy_freewebtel{/yun}</div>
</div>
{yun:}include file="$wapstyle/publichtm/public_js.htm"{/yun}
{yun:}include file="$wapstyle/verify_js.htm"{/yun}
<script src="{yun:}$wap_style{/yun}/js/prefixfree.min.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<script>
    var sy_advice_mobilecode = '{yun:}$config.sy_advice_mobilecode{/yun}',
        code_web = '{yun:}$config.code_web{/yun}',
        code_kind = '{yun:}$config.code_kind{/yun}';
    var Timer;
    var smsTimer_time = 90; //倒数 90
    var smsTimer_flag = 90; //倒数 90
    var smsTime_speed = 1000; //速度 1秒钟
 
    //发送手机短信
    function send_advice_msg(url) {
        var moblie = $('#moblie').val();
        var code;
        
        var verify_token;
        if(moblie == "" || moblie == "请输入手机号码") {
 
            showToast("请输入手机号码!");
            return false;
        } else {
 
            if(!isjsMobile(moblie)) {
                showToast('手机格式错误!');
                return false;
            }
        }
        var codesear = new RegExp('意见反馈');
        if(codesear.test(code_web)) {
            if(code_kind == 1) {
                code = $.trim($("#msg_CheckCode").val());
                if(!code) {
                    showToast('请填写图片验证码!');
                    return false;
                }
            } else if(code_kind > 2) {
 
                $("#bind-captcha").attr('data-id','send_msg_tip');
                $("#bind-captcha").attr('data-type','click');
                verify_token = $('input[name="verify_token"]').val();
 
                if(verify_token == '') {
                    $("#bind-submit").trigger("click");
                    return false; 
                }
            }
        }
 
        if(smsTimer_time == smsTimer_flag) {
            Timer = setInterval("smsTimer($('#send_msg_tip'))", smsTime_speed);
            showLoading();
            $.post(url, {
                moblie: moblie,
                authcode: code,
                verify_token:verify_token
            }, function(data) {
                hideLoading();
                if(data){
                    var res = JSON.parse(data);
                    if(res.error != 1){
                        clearInterval(Timer);
                    }
                    showToast(res.msg, 2, function(){
                        if(res.error != 1){
                            if(code_kind == 1) {
                                checkCode('vcode_img');
                                
                            } else if(code_kind >2) {
                                $("#popup-submit").trigger("click");
                            }
                        }
                    });
                }
            })
        } else {
            showToast('请勿重复发送!', 2);
            return false;
        }
    }
    //倒计时
    function smsTimer(obj) {
        if(smsTimer_flag > 0) {
            $(obj).html('重新发送(' + smsTimer_flag + 's)');
            $(obj).attr({
                'style': 'background:#eaebed;'
            });
            smsTimer_flag--;
        } else {
            $(obj).html('重新发送');
            $(obj).attr({
                'style': 'background:#eaebed;'
            });
            smsTimer_flag = smsTimer_time;
            clearInterval(Timer);
        }
    }
 
    $(document).ready(function() {
 
        $('.advice_list_fs').click(function(event) {
        
            $('.advice_list_fs').each(function(index, el) {
                $(this).removeClass('advice_list_fs_cur');
            });
            $(this).addClass('advice_list_fs_cur');
            $('input[name="infotype"]').val($(this).data('code'));
        });
    });
    
    function advice(img) {
        var infotype     =     $.trim($('input[name="infotype"]').val());
        var content     =     $.trim($("#content").val());
        var username     =     $.trim($("#username").val());
        var moblie         =     $.trim($("#moblie").val());
        var advice_code = '';
        
        if (infotype == '') {
            showToast("请选择意见类型", 2);
            return false;
        }
        
        if (username == "") {
            showToast('联系人不能空!', 2);
            return false;
        }
 
        if (moblie == "") {
            showToast('联系手机不能为空!', 2);
            return false;
        } else if (!isjsMobile(moblie)) {
            showToast('手机格式错误!', 2);
            return false
        }
 
        if (content == "") {
            showToast('反馈内容不能为空!', 2);
            return false;
        }
        
        if(sy_advice_mobilecode=='1'){
            var advice_code = $('#advice_code').val();
            if(advice_code==''){
                showToast('请填写手机验证码!', 2);
                return false;
            }
        }
        //验证码验证
        var verify_token = '';
        var authcode = '';
        if(sy_advice_mobilecode!='1'){
            var codesear = new RegExp('意见反馈');
            if(codesear.test(code_web)) {
                if(code_kind == 1) {
                    code = $.trim($("#msg_CheckCode").val());
                    if(!code) {
                        showToast('请填写图片验证码!');
                        return false;
                    }
                } else if(code_kind > 2) {
 
                    $("#bind-captcha").attr('data-id','submit');
                    $("#bind-captcha").attr('data-type','click');
                    verify_token = $('input[name="verify_token"]').val();
 
                    if(verify_token == '') {
                        $("#bind-submit").trigger("click");
                        return false; 
                    }
                }
            }
        }
        
        showLoading();
        
        $.post(wapurl + "/index.php?c=advice&a=saveadd", {
            infotype : infotype,
            content : content,
            username : username,
            moblie : moblie,
            authcode : authcode,
            advice_code:advice_code,
            verify_token:verify_token
        }, function(data) {
            hideLoading();
            var data = eval('(' + data + ')');
            
            if (data.errcode == "8" && !data.url) {
                showToast(data.msg, 2, function() {
                    checkCode(img)
                });
                return false;
            } else if (data.errcode == 9) {
                showToast(data.msg, 2, function() {
                    window.location.href = data.url
                });
                return false;
            } else {
                showToast(data.msg, 2, function() {
                    window.location.href = data.url
                });
                return false;
            }
        });
    }
</script>
</body>
</html>