Authored by dongjunjie

店铺装修bug

@@ -47,7 +47,7 @@ var g = new common.grid({ @@ -47,7 +47,7 @@ var g = new common.grid({
47 display: "包含品牌", 47 display: "包含品牌",
48 name: "brands", 48 name: "brands",
49 render: function(item) { 49 render: function(item) {
50 - //console.log(item); 50 + console.log(item);
51 if (item.brands instanceof Array && item.brands.length > 0) { 51 if (item.brands instanceof Array && item.brands.length > 0) {
52 var html = ''; 52 var html = '';
53 $.each(item.brands, function(i, value) { 53 $.each(item.brands, function(i, value) {
@@ -94,12 +94,22 @@ var g = new common.grid({ @@ -94,12 +94,22 @@ var g = new common.grid({
94 render: function(item) { 94 render: function(item) {
95 var HtmArr = []; 95 var HtmArr = [];
96 96
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-success btn-xs">装修编辑</a>');
101 } 101 }
102 - if (item.checkStatus == 900) { 102 +
  103 + if(+item.checkStatus == 300){
  104 + if(+item.shopStatus == 1){
  105 + // 1开启 0 关闭
  106 + HtmArr.push('<a data-index="'+item.__index+'" href="javascript:void(0);" class="closeshops btn btn-danger btn-xs">关店</a>');
  107 + }else{
  108 + HtmArr.push('<a data-index="'+item.__index+'" href="javascript:void(0);" class=" openshops btn btn-success btn-xs">开店</a>');
  109 + }
  110 + }
  111 +
  112 + if (+item.checkStatus == 900) {
103 HtmArr.push('<a href="javascript:void(0)" class="btn btn-warning btn-xs commentBtn" data-comment="'+item.comment+'">驳回理由</a>'); 113 HtmArr.push('<a href="javascript:void(0)" class="btn btn-warning btn-xs commentBtn" data-comment="'+item.comment+'">驳回理由</a>');
104 } 114 }
105 115
@@ -125,3 +135,28 @@ $(document).on('click', ".commentBtn", function() { @@ -125,3 +135,28 @@ $(document).on('click', ".commentBtn", function() {
125 function(){} 135 function(){}
126 ); 136 );
127 }); 137 });
  138 +
  139 +var Bll={
  140 + toast:function(content,url,id){
  141 + common.dialog.confirm("温馨提示",content,function(){
  142 + common.util.__ajax({
  143 + url:url,
  144 + data:{shopsId:id}
  145 + },function(){
  146 + g.reload();
  147 + });
  148 + });
  149 + }
  150 +}
  151 +
  152 +//关闭店铺
  153 +$('#basicTable').on('click', '.closeshops', function() {
  154 + var item=g.rows[$(this).data("index")];
  155 + Bll.toast("确定要关闭此店铺吗?","/supplier/store/closeShops",item.shopsId);
  156 +});
  157 +
  158 +//开启店铺
  159 +$('#basicTable').on('click', '.openshops', function() {
  160 + var item=g.rows[$(this).data("index")];
  161 + Bll.toast("确定要开启此店铺吗?","/supplier/store/openShops",item.shopsId);
  162 +});
@@ -107,6 +107,7 @@ var t = new common.tab({ @@ -107,6 +107,7 @@ var t = new common.tab({
107 if(+item.checkStatus!=200){ 107 if(+item.checkStatus!=200){
108 HtmArr.push('<a href="/supplier/store/update/'+item.shopsId+'" href="javascript:void(0);" class="btn btn-success btn-xs">编辑</a>'); 108 HtmArr.push('<a href="/supplier/store/update/'+item.shopsId+'" href="javascript:void(0);" class="btn btn-success btn-xs">编辑</a>');
109 } 109 }
  110 + /* 开关店放到店铺装修列表里面
110 if(+item.checkStatus!=900){ 111 if(+item.checkStatus!=900){
111 if(+item.status){ 112 if(+item.status){
112 // 1开启 0 关闭 113 // 1开启 0 关闭
@@ -114,7 +115,7 @@ var t = new common.tab({ @@ -114,7 +115,7 @@ var t = new common.tab({
114 }else{ 115 }else{
115 HtmArr.push('<a data-index="'+item.__index+'" href="javascript:void(0);" class=" openshops btn btn-success btn-xs">开店</a>'); 116 HtmArr.push('<a data-index="'+item.__index+'" href="javascript:void(0);" class=" openshops btn btn-success btn-xs">开店</a>');
116 } 117 }
117 - } 118 + }*/
118 } 119 }
119 return HtmArr.join(''); 120 return HtmArr.join('');
120 }} 121 }}
@@ -24,7 +24,7 @@ var ENUM = { @@ -24,7 +24,7 @@ var ENUM = {
24 var resourcesNew = { 24 var resourcesNew = {
25 "shopTopBanner":{ 25 "shopTopBanner":{
26 "id":"", 26 "id":"",
27 - "data": [{"shopSrc": "", "detailSrc": "", "isShowShopName": "Y"}] 27 + "data": [{"shopSrc": "","shopSrc0":"", "detailSrc": "", "isShowShopName": "Y"}]
28 }, 28 },
29 "navigationBar":{ 29 "navigationBar":{
30 "id":"", 30 "id":"",
@@ -170,7 +170,7 @@ function findDecoration(){ @@ -170,7 +170,7 @@ function findDecoration(){
170 } 170 }
171 }, 171 },
172 function(rs) { 172 function(rs) {
173 - //console.log(rs.data); 173 + console.log(rs.data);
174 if(rs.data){ 174 if(rs.data){
175 jsonMain = rs.data; 175 jsonMain = rs.data;
176 } 176 }
@@ -289,7 +289,11 @@ function gridInit(id){ @@ -289,7 +289,11 @@ function gridInit(id){
289 el:"#"+id, 289 el:"#"+id,
290 columns:[ 290 columns:[
291 {display:"店铺banner图片", render:function(item){ 291 {display:"店铺banner图片", render:function(item){
  292 + if(curTemplateType == "2"){
292 return "<input type=file name='shopBannerImage' id='shopBannerImage_"+item.__index+"' value='"+item.shopSrc+"' />"; 293 return "<input type=file name='shopBannerImage' id='shopBannerImage_"+item.__index+"' value='"+item.shopSrc+"' />";
  294 + }else{
  295 + return "<input type=file name='shopBannerImage' id='shopBannerImage_"+item.__index+"' value='"+item.shopSrc0+"' />";
  296 + }
293 }}, 297 }},
294 {display:"是否显示店铺名称", render:function(item){ 298 {display:"是否显示店铺名称", render:function(item){
295 if(item.isShowShopName == "Y"){ 299 if(item.isShowShopName == "Y"){
@@ -986,7 +990,11 @@ function untilEditorEvent(id){ @@ -986,7 +990,11 @@ function untilEditorEvent(id){
986 e.on("callback",function(obj){ 990 e.on("callback",function(obj){
987 if(/^file_onComplete_shopBannerImage_/.test(obj.key)){ 991 if(/^file_onComplete_shopBannerImage_/.test(obj.key)){
988 var _index = obj.key.replace(/^file_onComplete_shopBannerImage_/,''); 992 var _index = obj.key.replace(/^file_onComplete_shopBannerImage_/,'');
  993 + if(curTemplateType == "2"){
989 g.__rows[_index].shopSrc = obj.data; 994 g.__rows[_index].shopSrc = obj.data;
  995 + }else{
  996 + g.__rows[_index].shopSrc0 = obj.data;
  997 + }
990 } 998 }
991 if(/^file_onComplete_DetailbannerImage_/.test(obj.key)){ 999 if(/^file_onComplete_DetailbannerImage_/.test(obj.key)){
992 var _index = obj.key.replace(/^file_onComplete_DetailbannerImage_/,''); 1000 var _index = obj.key.replace(/^file_onComplete_DetailbannerImage_/,'');
@@ -65,7 +65,7 @@ @@ -65,7 +65,7 @@
65 <div class="model-wrap contentpanel-pc"> 65 <div class="model-wrap contentpanel-pc">
66 <!--banner--> 66 <!--banner-->
67 <div class="model-banner model-editor" data-toggle="editor-banner" data-title="顶部图片编辑"> 67 <div class="model-banner model-editor" data-toggle="editor-banner" data-title="顶部图片编辑">
68 - <img src="[[resources.shopTopBanner.data[0].shopSrc]]"> 68 + <img src="[[resources.shopTopBanner.data[0].shopSrc0]]">
69 [[if resources.shopTopBanner.data[0].isShowShopName == "Y"]] 69 [[if resources.shopTopBanner.data[0].isShowShopName == "Y"]]
70 <h1>[[shopName]]</h1> 70 <h1>[[shopName]]</h1>
71 [[/if]] 71 [[/if]]