Authored by weiqingting

Merge branch 'yohobuy_portal_dev_v4.5_20160601' of http://git.yoho.cn/fe/yohobuy…

…-portal-fe into yohobuy_portal_dev_v4.5_20160601
@@ -92,54 +92,72 @@ var Bll = { @@ -92,54 +92,72 @@ var Bll = {
92 //bucket: "goodsimg"//测试 92 //bucket: "goodsimg"//测试
93 }); 93 });
94 //验证英文名 94 //验证英文名
95 - e.on("validate", function () {  
96 - var englishName = $.trim($("#englishName").val());  
97 - var a = (/^([A-Za-z]+\s?)*[A-Za-z]$/).test(englishName);  
98 - if (!a) {  
99 - return "英文名有误"  
100 - }  
101 - return true;  
102 - }); 95 + if($("#englishName").val()){
  96 + e.on("validate", function () {
  97 + var englishName = $.trim($("#englishName").val());
  98 + var a = (/^([A-Za-z]+\s?)*[A-Za-z]$/).test(englishName);
  99 + if (!a) {
  100 + return "英文名有误"
  101 + }
  102 + return true;
  103 + });
  104 + }
  105 +
103 //验证身高 106 //验证身高
104 - e.on("validate", function () {  
105 - var height = $.trim($("#height").val());  
106 - if (height>250||height<100) {  
107 - return "身高值范围为100~250"  
108 - }  
109 - return true;  
110 - }); 107 + if($("#height").val()){
  108 + e.on("validate", function () {
  109 + var height = $.trim($("#height").val());
  110 + if (height>250||height<100) {
  111 + return "身高值范围为100~250"
  112 + }
  113 + return true;
  114 + });
  115 + }
  116 +
111 //验证体重 117 //验证体重
112 - e.on("validate", function () {  
113 - var weight = $.trim($("#weight").val());  
114 - if (weight>200||weight<10) {  
115 - return "体重值范围为10~200"  
116 - }  
117 - return true;  
118 - }); 118 + if($("#weight").val()){
  119 + e.on("validate", function () {
  120 + var weight = $.trim($("#weight").val());
  121 + if (weight>200||weight<10) {
  122 + return "体重值范围为10~200"
  123 + }
  124 + return true;
  125 + });
  126 + }
  127 +
119 //验证胸围 128 //验证胸围
120 - e.on("validate", function () {  
121 - var Bust = $.trim($("#Bust").val());  
122 - if (Bust>200) {  
123 - return "胸围值应小于200"  
124 - }  
125 - return true;  
126 - }); 129 + if($("#Bust").val()){
  130 + e.on("validate", function () {
  131 + var Bust = $.trim($("#Bust").val());
  132 + if (Bust>200) {
  133 + return "胸围值应小于200"
  134 + }
  135 + return true;
  136 + });
  137 + }
  138 +
127 //验证腰围 139 //验证腰围
128 - e.on("validate", function () {  
129 - var waist = $.trim($("#waist").val());  
130 - if (waist>200) {  
131 - return "腰围值应小于200"  
132 - }  
133 - return true;  
134 - }); 140 + if($("#waist").val()){
  141 + e.on("validate", function () {
  142 + var waist = $.trim($("#waist").val());
  143 + if (waist>200) {
  144 + return "腰围值应小于200"
  145 + }
  146 + return true;
  147 + });
  148 + }
  149 +
135 //验证臀围 150 //验证臀围
136 - e.on("validate", function () {  
137 - var hips = $.trim($("#hips").val());  
138 - if (hips>200) {  
139 - return "臀围值应小于200"  
140 - }  
141 - return true;  
142 - }); 151 + if($("#hips").val()){
  152 + e.on("validate", function () {
  153 + var hips = $.trim($("#hips").val());
  154 + if (hips>200) {
  155 + return "臀围值应小于200"
  156 + }
  157 + return true;
  158 + });
  159 + }
  160 +
143 var a = common.dialog.confirm(hint, 161 var a = common.dialog.confirm(hint,
144 common.util.__template2($("#template").html(), item), 162 common.util.__template2($("#template").html(), item),
145 function () { 163 function () {
@@ -58,20 +58,20 @@ @@ -58,20 +58,20 @@
58 <input type="hidden" value="[[id]]" id="id"/> 58 <input type="hidden" value="[[id]]" id="id"/>
59 59
60 <div class="col-sm-6"> 60 <div class="col-sm-6">
61 - <input type="file" value="[[avatar]]" class="form-control avatar" id="avatar" name="avatar" placeholder="头像" required="required"/> 61 + <input type="file" value="[[avatar]]" class="form-control avatar" id="avatar" name="avatar" placeholder="头像" />
62 </div> 62 </div>
63 </div> 63 </div>
64 <div class="form-group"> 64 <div class="form-group">
65 <label class="col-sm-2 control-label" for="modelName">姓名</label> 65 <label class="col-sm-2 control-label" for="modelName">姓名</label>
66 66
67 <div class="col-sm-3"> 67 <div class="col-sm-3">
68 - <input type="text" value="[[modelName]]" class="form-control" id="modelName" placeholder="姓名" required="required"/> 68 + <input type="text" value="[[modelName]]" class="form-control" id="modelName" placeholder="姓名" />
69 </div> 69 </div>
70 70
71 <label class="col-sm-2 control-label" for="englishName">英文名</label> 71 <label class="col-sm-2 control-label" for="englishName">英文名</label>
72 72
73 <div class="col-sm-3"> 73 <div class="col-sm-3">
74 - <input type="text" value="[[englishName]]" class="form-control" id="englishName" placeholder="英文名" required="required"/> 74 + <input type="text" value="[[englishName]]" class="form-control" id="englishName" placeholder="英文名" />
75 </div> 75 </div>
76 76
77 77
@@ -81,7 +81,7 @@ @@ -81,7 +81,7 @@
81 <label class="col-sm-2 control-label" for="nationality">国籍</label> 81 <label class="col-sm-2 control-label" for="nationality">国籍</label>
82 82
83 <div class="col-sm-3"> 83 <div class="col-sm-3">
84 - <input type="text" value="[[nationality]]" class="form-control" id="nationality" placeholder="国籍" required="required"/> 84 + <input type="text" value="[[nationality]]" class="form-control" id="nationality" placeholder="国籍" />
85 </div> 85 </div>
86 86
87 </div> 87 </div>
@@ -91,13 +91,13 @@ @@ -91,13 +91,13 @@
91 91
92 <div class="col-sm-3"> 92 <div class="col-sm-3">
93 <input type="number" value="[[height]]" class="form-control" id="height" 93 <input type="number" value="[[height]]" class="form-control" id="height"
94 - match="numbers" placeholder="身高(cm)" required="required"/> 94 + match="numbers" placeholder="身高(cm)" />
95 </div> 95 </div>
96 <label class="col-sm-2 control-label" for="weight">体重</label> 96 <label class="col-sm-2 control-label" for="weight">体重</label>
97 97
98 <div class="col-sm-3"> 98 <div class="col-sm-3">
99 <input type="number" value="[[weight]]" class="form-control" id="weight" 99 <input type="number" value="[[weight]]" class="form-control" id="weight"
100 - match="numbers" placeholder="体重(kg)" required="required"/> 100 + match="numbers" placeholder="体重(kg)" />
101 </div> 101 </div>
102 102
103 </div> 103 </div>
@@ -106,12 +106,12 @@ @@ -106,12 +106,12 @@
106 <label class="col-sm-2 control-label" for="dressSize">穿衣尺码</label> 106 <label class="col-sm-2 control-label" for="dressSize">穿衣尺码</label>
107 107
108 <div class="col-sm-3"> 108 <div class="col-sm-3">
109 - <input type="text" value="[[dressSize]]" class="form-control" id="dressSize" placeholder="穿衣尺码" required="required"/> 109 + <input type="text" value="[[dressSize]]" class="form-control" id="dressSize" placeholder="穿衣尺码" />
110 </div> 110 </div>
111 <label class="col-sm-2 control-label" for="shoeSize">鞋码</label> 111 <label class="col-sm-2 control-label" for="shoeSize">鞋码</label>
112 112
113 <div class="col-sm-3"> 113 <div class="col-sm-3">
114 - <input type="text" value="[[shoeSize]]" class="form-control" id="shoeSize" placeholder="鞋码" required="required"/> 114 + <input type="text" value="[[shoeSize]]" class="form-control" id="shoeSize" placeholder="鞋码" />
115 </div> 115 </div>
116 </div> 116 </div>
117 <div class="form-group"> 117 <div class="form-group">
@@ -119,22 +119,22 @@ @@ -119,22 +119,22 @@
119 119
120 <div class="col-sm-3"> 120 <div class="col-sm-3">
121 <input type="number" value="[[Bust]]" class="form-control" id="Bust" 121 <input type="number" value="[[Bust]]" class="form-control" id="Bust"
122 - match="numbers" placeholder="胸围(cm)" required="required"/> 122 + match="numbers" placeholder="胸围(cm)" />
123 </div> 123 </div>
124 <div class="col-sm-3"> 124 <div class="col-sm-3">
125 <input type="number" value="[[waist]]" class="form-control" id="waist" 125 <input type="number" value="[[waist]]" class="form-control" id="waist"
126 - match="numbers" placeholder="腰围(cm)" required="required"/> 126 + match="numbers" placeholder="腰围(cm)" />
127 </div> 127 </div>
128 <div class="col-sm-3"> 128 <div class="col-sm-3">
129 <input type="number" value="[[hips]]" class="form-control" id="hips" 129 <input type="number" value="[[hips]]" class="form-control" id="hips"
130 - match="numbers" placeholder="臀围(cm)" required="required"/> 130 + match="numbers" placeholder="臀围(cm)" />
131 </div> 131 </div>
132 </div> 132 </div>
133 <div class="form-group"> 133 <div class="form-group">
134 <label class="col-sm-2 control-label" for="modelCard">模特卡</label> 134 <label class="col-sm-2 control-label" for="modelCard">模特卡</label>
135 135
136 <div class="col-sm-10"> 136 <div class="col-sm-10">
137 - <input type="file" value="[[modelCard]]" class="form-control modelCard" id="modelCard" name="modelCard" placeholder="模特卡" required="required"/> 137 + <input type="file" value="[[modelCard]]" class="form-control modelCard" id="modelCard" name="modelCard" placeholder="模特卡" />
138 </div> 138 </div>
139 </div> 139 </div>
140 140
@@ -144,7 +144,7 @@ @@ -144,7 +144,7 @@
144 <label style="cursor: pointer;"><input type="radio" name="status" checked value="1">启用</label> 144 <label style="cursor: pointer;"><input type="radio" name="status" checked value="1">启用</label>
145 <label style="cursor: pointer;"><input type="radio" name="status" value="0">禁用</label> 145 <label style="cursor: pointer;"><input type="radio" name="status" value="0">禁用</label>
146 </div> 146 </div>
147 - <input type="hidden" id="status" value="[[status||1]]" for="radio" required> 147 + <input type="hidden" id="status" value="[[status||1]]" for="radio" >
148 </div> 148 </div>
149 149
150 </div> 150 </div>