Browse Source

专家行业领域的字数限制改为15字

XMTT 7 years ago
parent
commit
1c7d726e16
2 changed files with 5 additions and 51 deletions
  1. 1 1
      html/model/sys/userInfo/details.html
  2. 4 50
      js/model/sys/userInfo/details.js

+ 1 - 1
html/model/sys/userInfo/details.html

@ -113,7 +113,7 @@
113 113
        <div class="row">
114 114
            <div class="col-2 item-caption">行业领域</div>
115 115
            <div class="col-4">
116
                <div class="form-item text" placeholder="添加内容不能超过10个字" name="newIndustry"></div>
116
                <div class="form-item text" placeholder="添加内容不能超过15个字" name="newIndustry"></div>
117 117
            </div>
118 118
            <div class="col-2">
119 119
                <div class="btn pull-right opt-industry">

+ 4 - 50
js/model/sys/userInfo/details.js

@ -103,6 +103,7 @@ spa_define(function () {
103 103
                            util.alert("手机或邮箱至少输入一项");
104 104
                        }
105 105
                    };
106
106 107
                var part = function (one, list) {
107 108
                    oValue = one;
108 109
                    oJudge = list || [];
@ -112,8 +113,8 @@ spa_define(function () {
112 113
                        util.alert('提示', '请先填写内容');
113 114
                        return;
114 115
                    }
115
                    if (oValue.length > 10) {
116
                        util.alert('提示', '添加内容不能超过10个字');
116
                    if (oValue.length > 15) {
117
                        util.alert('提示', '添加内容不能超过15个字');
117 118
                        return;
118 119
                    } else {
119 120
                        var oValueList = oValue.split(","),
@ -198,53 +199,6 @@ spa_define(function () {
198 199
                    }
199 200
                };
200 201
201
                var part3 = function (one, list) {
202
                    oValue = one;
203
                    oJudge = list || [];
204
                    var repeat,
205
                        b;
206
                    if (!oValue) {
207
                        util.alert('提示', '请先填写内容');
208
                        return;
209
                    }
210
                    if (oValue.length > 15) {
211
                        util.alert('提示', '添加内容不能超过15个字');
212
                        return;
213
                    } else {
214
                        var oValueList = oValue.split(","),
215
                            length = oValueList.length;
216
                        for (var j = 0; j < length; j++) {
217
                            for (var n = j + 1; n < oValueList.length + 1;) {
218
                                if (oValueList[j] == oValueList[n]) {
219
                                    oValueList.remove(n);
220
                                    repeat = false;
221
                                } else {
222
                                    n++;
223
                                }
224
                            }
225
                        }
226
                        for (var j = 0; j < oValueList.length;) {
227
                            for (var i = 0; i < oJudge.length; i++) {
228
                                if (oValueList[j] == oJudge[i]) {
229
                                    oValueList.remove(j);
230
                                    repeat = false;
231
                                    b = true;
232
                                }
233
                            }
234
                            if (b) {
235
                                b = false
236
                            } else j++;
237
                        }
238
                        if (repeat == false) {
239
                            util.alert('提示', '添加内容不能重复');
240
                        }
241
                        for (var m = 0; m < oValueList.length; m++) {
242
                            ca.items.push({code: oValueList[m], caption: oValueList[m]});
243
                            oJudge.push(oValueList[m]);
244
                        }
245
                    }
246
                };
247
248 202
                var split = function (data) {
249 203
                    var index = data.split(",");
250 204
                    var arr = [];
@ -304,7 +258,7 @@ spa_define(function () {
304 258
                    form.val({newIndustry: "", industryList: oJudge});
305 259
                });
306 260
                root.find(".opt-subject").on("click", function () {
307
                    part3(form.val().newSubject, form.val().subjectList);
261
                    part(form.val().newSubject, form.val().subjectList);
308 262
                    form.val({newSubject: "", subjectList: oJudge});
309 263
                });
310 264
                root.find(".opt-ra").on("click", function () {