Authored by yyq

notice 复填

@@ -735,7 +735,7 @@ class AdminModel extends global.yoho.BaseModel { @@ -735,7 +735,7 @@ class AdminModel extends global.yoho.BaseModel {
735 } 735 }
736 736
737 editZerobuyNotice(params) { 737 editZerobuyNotice(params) {
738 - if (!params.id || !params.notice) { 738 + if (!params.id) {
739 return Promise.resolve({ 739 return Promise.resolve({
740 code: 400, 740 code: 400,
741 message: '缺少参数' 741 message: '缺少参数'
@@ -56,7 +56,7 @@ @@ -56,7 +56,7 @@
56 <td class="text-center"> 56 <td class="text-center">
57 <image src="{{cover_img}}" class="cover-img"> 57 <image src="{{cover_img}}" class="cover-img">
58 </td> 58 </td>
59 - <td class="text-center"> 59 + <td class="text-center" data-notice="{{notice}}">
60 {{# btns}} 60 {{# btns}}
61 <button class="btn btn-{{color}} btn-{{type}}" data-id="{{../id}}" data-channel="{{../channel}}">{{name}}</button> 61 <button class="btn btn-{{color}} btn-{{type}}" data-id="{{../id}}" data-channel="{{../channel}}">{{name}}</button>
62 {{/ btns}} 62 {{/ btns}}
@@ -108,12 +108,7 @@ function bindListPageEvent() { @@ -108,12 +108,7 @@ function bindListPageEvent() {
108 }; 108 };
109 109
110 const noticeFn = function() { 110 const noticeFn = function() {
111 - let noticeVal = $noticeInput.val();  
112 -  
113 - if (!noticeVal) {  
114 - alert('请填写悬浮内容');  
115 - return;  
116 - } 111 + let noticeVal = $noticeInput.val() || '';
117 112
118 $.ajax({ 113 $.ajax({
119 method: 'post', 114 method: 'post',
@@ -161,7 +156,7 @@ function bindListPageEvent() { @@ -161,7 +156,7 @@ function bindListPageEvent() {
161 $confirm.modal('show'); 156 $confirm.modal('show');
162 }); 157 });
163 $('.btn-notice').on('click', function() { 158 $('.btn-notice').on('click', function() {
164 - $noticeInput.text(''); 159 + $noticeInput.val($(this).parent().data('notice') || '');
165 $noticeModal.data('id', $(this).data('id')); 160 $noticeModal.data('id', $(this).data('id'));
166 $noticeModal.modal('show'); 161 $noticeModal.modal('show');
167 }); 162 });