Authored by 姜敏

Merge branch 'feature/feature_v4.6_20160525' of http://git.yoho.cn/fe/yohobuy-po…

…rtal-fe into feature/feature_v4.6_20160525
@@ -86,7 +86,9 @@ components.prototype={ @@ -86,7 +86,9 @@ components.prototype={
86 $("input[type=file]", that.el).each(function() { 86 $("input[type=file]", that.el).each(function() {
87 var value = $.trim($(this).attr("value")); 87 var value = $.trim($(this).attr("value"));
88 if ($(this).attr("required") && !value) { 88 if ($(this).attr("required") && !value) {
89 - err.push("<p>请上传文件</p>"); 89 + var prompt = $.trim($(this).attr("prompt"));
  90 + if(!prompt) err.push("<p>请上传文件</p>");
  91 + else err.push("<p>请上传"+ prompt +"</p>");
90 return false; 92 return false;
91 } 93 }
92 }); 94 });
@@ -81,14 +81,19 @@ $(document).on("click", "#addUrl", function () { @@ -81,14 +81,19 @@ $(document).on("click", "#addUrl", function () {
81 }); 81 });
82 82
83 $(document).on("click", "#saveBtn", function () { 83 $(document).on("click", "#saveBtn", function () {
  84 + if(!edit.validate()) {
  85 + return false;
  86 + }
84 var isNew = $("#isNew").val(); 87 var isNew = $("#isNew").val();
85 var isHot = $("#isHot").val(); 88 var isHot = $("#isHot").val();
86 var separativeSign = $("#separativeSign").val(); 89 var separativeSign = $("#separativeSign").val();
87 var isNewPage = $("#isNewPage").val(); 90 var isNewPage = $("#isNewPage").val();
  91 + var platform = $("#platform").val();
88 Category.isNew = !!isNew ? isNew : Category.isNew; 92 Category.isNew = !!isNew ? isNew : Category.isNew;
89 Category.isHot = !!isHot ? isHot : Category.isHot; 93 Category.isHot = !!isHot ? isHot : Category.isHot;
90 Category.separativeSign = !!separativeSign ? separativeSign : Category.separativeSign; 94 Category.separativeSign = !!separativeSign ? separativeSign : Category.separativeSign;
91 Category.isNewPage = !!isNewPage ? isNewPage : Category.isNewPage; 95 Category.isNewPage = !!isNewPage ? isNewPage : Category.isNewPage;
  96 + Category.platform = platform.replace(/\|/g, ",");
92 delete Category.categories; 97 delete Category.categories;
93 //console.log(Category); 98 //console.log(Category);
94 99
@@ -539,7 +539,7 @@ li.sortable-placeholder { @@ -539,7 +539,7 @@ li.sortable-placeholder {
539 } 539 }
540 .dd-handle:hover {background: #fff; } 540 .dd-handle:hover {background: #fff; }
541 541
542 -.dd-item > button { display: block; position: relative; cursor: pointer; float: left; width: 25px; height: 20px; margin: 5px 0; padding: 0; text-indent: 100%; white-space: nowrap; overflow: hidden; border: 0; background: transparent; font-size: 12px; line-height: 1; text-align: center; font-weight: bold; } 542 +.dd-item > button { display: block; position: relative; cursor: pointer; float: left; width: 25px; height: 20px; margin: 16px 0; padding: 0; text-indent: 100%; white-space: nowrap; overflow: hidden; border: 0; background: transparent; font-size: 12px; line-height: 1; text-align: center; font-weight: bold;font-size: 20px; }
543 .dd-item > button:before { content: '+'; display: block; position: absolute; width: 100%; text-align: center; text-indent: 0; } 543 .dd-item > button:before { content: '+'; display: block; position: absolute; width: 100%; text-align: center; text-indent: 0; }
544 .dd-item > button[data-action="collapse"]:before { content: '-'; } 544 .dd-item > button[data-action="collapse"]:before { content: '-'; }
545 545
@@ -2,11 +2,11 @@ @@ -2,11 +2,11 @@
2 * Created by ty on 2016/5/26. 2 * Created by ty on 2016/5/26.
3 * 分类管理路由 3 * 分类管理路由
4 */ 4 */
5 -exports.domain = require('../config/common.js').domain; 5 +//exports.domain = require('../config/common.js').domain;
6 //exports.domain = 'http://172.16.6.115:8080/platform';//王伟 6 //exports.domain = 'http://172.16.6.115:8080/platform';//王伟
7 //exports.domain = 'http://192.168.102.216:8180/platform'; //测试环境 7 //exports.domain = 'http://192.168.102.216:8180/platform'; //测试环境
8 //exports.domain = 'http://172.16.6.231:8080/platform'; 8 //exports.domain = 'http://172.16.6.231:8080/platform';
9 -//exports.domain = 'http://172.16.6.225:8080/platform'; 9 +exports.domain = 'http://172.16.6.225:8080/platform';
10 //exports.domain = 'http://192.168.102.216:8086/platform'; 10 //exports.domain = 'http://192.168.102.216:8086/platform';
11 11
12 exports.res = [ 12 exports.res = [
@@ -75,7 +75,7 @@ @@ -75,7 +75,7 @@
75 <div class="form-group"> 75 <div class="form-group">
76 <label class="col-sm-1 control-label">分类图标</label> 76 <label class="col-sm-1 control-label">分类图标</label>
77 <div class="col-sm-9"> 77 <div class="col-sm-9">
78 - <input type="file" name="file" prompt="分类图标" value="[[sortIco]]" class="observe" data-field="sortIco"> 78 + <input type="file" name="file" prompt="分类图标" value="[[sortIco]]" class="observe" data-field="sortIco" required>
79 </div> 79 </div>
80 </div> 80 </div>
81 81
@@ -136,15 +136,15 @@ @@ -136,15 +136,15 @@
136 <div class="form-group"> 136 <div class="form-group">
137 <label class="col-sm-1 control-label">显示平台</label> 137 <label class="col-sm-1 control-label">显示平台</label>
138 <div class="col-sm-8"> 138 <div class="col-sm-8">
139 - <input type="checkbox" value="iphone" style="width:18px;height:18px;margin-left:5px;" name="platform" id="checkboxiphone"> IOS手机  
140 - <input type="checkbox" value="ipad" style="width:18px;height:18px;margin-left:5px;" name="platform" id="checkboxipad"> IOS Pad  
141 - <input type="checkbox" value="android" style="width:18px;height:18px;margin-left:5px;" name="platform" id="checkboxandroid"> 安卓手机  
142 - <input type="checkbox" value="androidpad" style="width:18px;height:18px;margin-left:5px;" name="platform" id="checkboxandroidpad"> 安卓Pad  
143 - <input type="checkbox" value="h5" style="width:18px;height:18px;margin-left:5px;" name="platform" id="checkboxh5"> 手机网站  
144 - <input type="checkbox" value="web" style="width:18px;height:18px;margin-left:5px;" name="platform" id="checkboxweb"> 网站  
145 - <input type="checkbox" value="platform" style="width:18px;height:18px;margin-left:5px;" name="platform" id="checkboxplatform"> 平台  
146 - </div>  
147 - <input type="hidden" id="platform" for="radio" value="[[platform]]"> 139 + <input type="checkbox" value="iphone" style="width:18px;height:18px;margin-left:5px;" name="platform"> IOS手机
  140 + <input type="checkbox" value="ipad" style="width:18px;height:18px;margin-left:5px;" name="platform"> IOS Pad
  141 + <input type="checkbox" value="android" style="width:18px;height:18px;margin-left:5px;" name="platform"> 安卓手机
  142 + <input type="checkbox" value="androidpad" style="width:18px;height:18px;margin-left:5px;" name="platform"> 安卓Pad
  143 + <input type="checkbox" value="h5" style="width:18px;height:18px;margin-left:5px;" name="platform"> 手机网站
  144 + <input type="checkbox" value="web" style="width:18px;height:18px;margin-left:5px;" name="platform"> 网站
  145 + <input type="checkbox" value="platform" style="width:18px;height:18px;margin-left:5px;" name="platform"> 平台
  146 + </div>
  147 + <input type="hidden" id="platform" for="checkbox" value="[[platform]]">
148 </div><!-- form-group --> 148 </div><!-- form-group -->
149 <div class="form-group"> 149 <div class="form-group">
150 <label class="col-sm-1 control-label">排序</label> 150 <label class="col-sm-1 control-label">排序</label>