Authored by 陶雨

Merge branch 'release/1.6' of http://git.dev.yoho.cn/platform/yohobuy-portal-fe into release/1.6

@@ -21,23 +21,36 @@ var jQuery = require('jquery'); @@ -21,23 +21,36 @@ var jQuery = require('jquery');
21 console.log(dataArray); 21 console.log(dataArray);
22 for(var i=0; i<items.length; i++){ 22 for(var i=0; i<items.length; i++){
23 $(items[i]).attr("drag-index", i); 23 $(items[i]).attr("drag-index", i);
  24 + items[i]._index = i;
24 } 25 }
25 26
26 var placeholder = $('<' + items[0].tagName + ' class="sortable-placeholder">'); 27 var placeholder = $('<' + items[0].tagName + ' class="sortable-placeholder">');
27 placeholder.css("border","2px dashed red"); 28 placeholder.css("border","2px dashed red");
  29 +
28 var handle = options.handle, isHandle; 30 var handle = options.handle, isHandle;
29 items.find(handle).mousedown(function() { 31 items.find(handle).mousedown(function() {
30 isHandle = true; 32 isHandle = true;
31 }).mouseup(function() { 33 }).mouseup(function() {
32 isHandle = false; 34 isHandle = false;
33 }); 35 });
  36 +
  37 + var isInput = false;
  38 + items.find("input").mousedown(function(){
  39 + isInput = true
  40 + }).mouseup(function() {
  41 + isInput = false;
  42 + });
  43 +
34 $(this).data('items', options.items) 44 $(this).data('items', options.items)
35 placeholders = placeholders.add(placeholder); 45 placeholders = placeholders.add(placeholder);
36 if (connectWith) { 46 if (connectWith) {
37 $(connectWith).add(this).data('connectWith', connectWith); 47 $(connectWith).add(this).data('connectWith', connectWith);
38 } 48 }
39 items.attr('draggable', 'true').bind('dragstart.h5s', function(e) { 49 items.attr('draggable', 'true').bind('dragstart.h5s', function(e) {
40 - if (handle && !isHandle) { 50 + if(handle && !isHandle) {
  51 + return false;
  52 + }
  53 + if(isInput){
41 return false; 54 return false;
42 } 55 }
43 isHandle = false; 56 isHandle = false;
@@ -56,7 +69,7 @@ var jQuery = require('jquery'); @@ -56,7 +69,7 @@ var jQuery = require('jquery');
56 var Array = [], sortArray = []; 69 var Array = [], sortArray = [];
57 var itemsUpdate = _self.children(options.items); 70 var itemsUpdate = _self.children(options.items);
58 for(var i=0; i<itemsUpdate.length; i++){ 71 for(var i=0; i<itemsUpdate.length; i++){
59 - Array.push($(itemsUpdate[i]).attr("drag-index")); 72 + Array.push(itemsUpdate[i]._index);
60 } 73 }
61 for(var i=0; i<Array.length; i++){ 74 for(var i=0; i<Array.length; i++){
62 sortArray.push(dataArray[Array[i]]); 75 sortArray.push(dataArray[Array[i]]);
@@ -106,7 +106,7 @@ var Bll = { @@ -106,7 +106,7 @@ var Bll = {
106 } else { 106 } else {
107 data = datacall && datacall(Bll.getNewPics(Bll.clonePics), Bll.selectedBoId); 107 data = datacall && datacall(Bll.getNewPics(Bll.clonePics), Bll.selectedBoId);
108 } 108 }
109 - console.log("最终提交数据data", data); 109 + //console.log("最终提交数据data", data);
110 common.util.__ajax({ 110 common.util.__ajax({
111 url: url, 111 url: url,
112 data: data 112 data: data
@@ -143,10 +143,10 @@ var Bll = { @@ -143,10 +143,10 @@ var Bll = {
143 if (response.status && response.code == 200) { 143 if (response.status && response.code == 200) {
144 for (var i = 0; i < response.datas.length; i++) { 144 for (var i = 0; i < response.datas.length; i++) {
145 var name=response.names[i]; 145 var name=response.names[i];
146 - if((/[\u4e00-\u9fa5]/).test(name)){  
147 - common.util.__tip("图片应以sku命名","warning");  
148 - }  
149 - else{ 146 + var index=name.indexOf('.');
  147 + var name1=name.substr(0,index);
  148 + //判断图片名称是否符合标准
  149 + if((/^[0-9]+[_][0-9]+$/).test(name1)||(/^[1-9]\d*$/).test(name1)){
150 Bll.pictureBoList.push({ 150 Bll.pictureBoList.push({
151 "fileName": response.datas[i], 151 "fileName": response.datas[i],
152 "originalName": response.names[i] 152 "originalName": response.names[i]
@@ -156,7 +156,9 @@ var Bll = { @@ -156,7 +156,9 @@ var Bll = {
156 "originalName": response.names[i] 156 "originalName": response.names[i]
157 }) 157 })
158 } 158 }
159 - 159 + else{
  160 + common.util.__tip("图片应以sku命名","warning");
  161 + }
160 } 162 }
161 Bll.rendBoList(Bll.clonePics); 163 Bll.rendBoList(Bll.clonePics);
162 } 164 }
@@ -97,7 +97,7 @@ var g = new common.grid({ @@ -97,7 +97,7 @@ var g = new common.grid({
97 if(+item.checkStatus == 200){ 97 if(+item.checkStatus == 200){
98 HtmArr.push('<a href="/supplier/store/decorationDetail/'+item.shopsId+'/'+item.shopsType+'/view/'+item.id+'/" class="btn btn-info btn-xs">装修查看</a>'); 98 HtmArr.push('<a href="/supplier/store/decorationDetail/'+item.shopsId+'/'+item.shopsType+'/view/'+item.id+'/" class="btn btn-info btn-xs">装修查看</a>');
99 }else { 99 }else {
100 - HtmArr.push('<a href="/supplier/store/decorationDetail/'+item.shopsId+'/'+item.shopsType+'/editor/'+item.id+'/" class="btn btn-success btn-xs">装修编辑</a>'); 100 + HtmArr.push('<a href="/supplier/store/decorationDetail/'+item.shopsId+'/'+item.shopsType+'/editor/'+item.id+'/" class="btn btn-primary btn-xs">装修编辑</a>');
101 } 101 }
102 102
103 if(item.passStatus && +item.passStatus == 1){ 103 if(item.passStatus && +item.passStatus == 1){