Authored by hongyong.zhao

求购产品不对bugfix

@@ -134,7 +134,7 @@ export default { @@ -134,7 +134,7 @@ export default {
134 134
135 }, 135 },
136 136
137 - beforeRouteEnter (to, from, next) { 137 + beforeRouteEnter(to, from, next) {
138 138
139 next(vm => { 139 next(vm => {
140 // 通过 `vm` 访问组件实例 140 // 通过 `vm` 访问组件实例
@@ -161,12 +161,12 @@ export default { @@ -161,12 +161,12 @@ export default {
161 this.showToast(); 161 this.showToast();
162 } 162 }
163 }, 163 },
164 - isShowDialog(val) {  
165 164
166 - if (val) {  
167 - this.showDialog();  
168 - }  
169 - }, 165 + // isShowDialog(val) {
  166 + // if (val) {
  167 + // this.showDialog();
  168 + // }
  169 + // },
170 170
171 addressInfo(val) { 171 addressInfo(val) {
172 172
@@ -174,6 +174,10 @@ export default { @@ -174,6 +174,10 @@ export default {
174 this.computePrice(); 174 this.computePrice();
175 } 175 }
176 176
  177 + },
  178 +
  179 + inputPrice(val) {
  180 + console.log(val);
177 } 181 }
178 }, 182 },
179 183
@@ -245,6 +249,7 @@ export default { @@ -245,6 +249,7 @@ export default {
245 249
246 showDialog() { 250 showDialog() {
247 this.BUYER_ASK_SET_SHOWDIALOG(false); 251 this.BUYER_ASK_SET_SHOWDIALOG(false);
  252 + let that = this;
248 253
249 if (this.preTip) { 254 if (this.preTip) {
250 this.$createDialog({ 255 this.$createDialog({
@@ -265,7 +270,7 @@ export default { @@ -265,7 +270,7 @@ export default {
265 }, 270 },
266 271
267 onConfirm: () => { 272 onConfirm: () => {
268 - this.publishProduct(); 273 + that.publishProduct();
269 }, 274 },
270 275
271 onCancel: () => { 276 onCancel: () => {
@@ -274,13 +279,16 @@ export default { @@ -274,13 +279,16 @@ export default {
274 279
275 }).show(); 280 }).show();
276 } else { 281 } else {
277 - this.publishProduct(); 282 + that.publishProduct();
278 } 283 }
279 284
280 }, 285 },
281 286
282 submitClick() { 287 submitClick() {
283 - this.buyerPrePublish({price: this.inputPrice, storage_id: this.storageId, address_id: this.addressInfo.address_id}); 288 + this.buyerPrePublish({price: this.inputPrice, storage_id: this.storageId, address_id: this.addressInfo.address_id})
  289 + .then(() => {
  290 + this.showDialog();
  291 + });
284 }, 292 },
285 293
286 publishProduct() { 294 publishProduct() {
@@ -291,7 +299,7 @@ export default { @@ -291,7 +299,7 @@ export default {
291 299
292 computePrice() { 300 computePrice() {
293 if (!this.inputPrice) { 301 if (!this.inputPrice) {
294 - console.log('inputPrice is null') 302 + console.log('inputPrice is null');
295 return; 303 return;
296 } 304 }
297 this.buyerCompute({price: this.inputPrice, storage_id: this.storageId, address_id: this.addressInfo.address_id || '' }); 305 this.buyerCompute({price: this.inputPrice, storage_id: this.storageId, address_id: this.addressInfo.address_id || '' });
@@ -31,6 +31,7 @@ export default { @@ -31,6 +31,7 @@ export default {
31 <style lang="scss" scoped> 31 <style lang="scss" scoped>
32 .product-wrapper { 32 .product-wrapper {
33 height: 240px; 33 height: 240px;
  34 + overflow: hidden;
34 } 35 }
35 36
36 .product-price { 37 .product-price {
@@ -366,20 +366,24 @@ export default function() { @@ -366,20 +366,24 @@ export default function() {
366 366
367 buyerPrePublish({commit, dispatch}, {price = 0, storage_id = 0, uid, address_id = ''} = {}) { 367 buyerPrePublish({commit, dispatch}, {price = 0, storage_id = 0, uid, address_id = ''} = {}) {
368 commit(BUYER_ASK_PREPUBLISH_REQUEST); 368 commit(BUYER_ASK_PREPUBLISH_REQUEST);
369 - this.$api.get('/api/order/buyeraskprepublish', { 369 + return this.$api.get('/api/order/buyeraskprepublish', {
370 price, 370 price,
371 storage_id, 371 storage_id,
372 uid, 372 uid,
373 address_id, 373 address_id,
374 }).then(result => { 374 }).then(result => {
375 if (result.code === 200) { 375 if (result.code === 200) {
376 - commit(BUYER_ASK_PREPUBLISH_SUCCESS, get(result, ['data', 'dialog'], null)); 376 + let payload = get(result, ['data', 'dialog'], null)
  377 + commit(BUYER_ASK_PREPUBLISH_SUCCESS, payload);
  378 + return payload;
377 } else { 379 } else {
378 commit(BUYER_ASK_PREPUBLISH_FAILURE, result.message); 380 commit(BUYER_ASK_PREPUBLISH_FAILURE, result.message);
  381 + return null;
379 } 382 }
380 }, error => { 383 }, error => {
381 console.log(error); 384 console.log(error);
382 commit(BUYER_ASK_PREPUBLISH_FAILURE, TIP); 385 commit(BUYER_ASK_PREPUBLISH_FAILURE, TIP);
  386 + return null;
383 }); 387 });
384 }, 388 },
385 389
@@ -55,6 +55,7 @@ export default function() { @@ -55,6 +55,7 @@ export default function() {
55 computeTip: null, 55 computeTip: null,
56 addressInfo: null, 56 addressInfo: null,
57 publishinfo: null, 57 publishinfo: null,
  58 + toastMessage: '',
58 59
59 }, 60 },
60 getter: { 61 getter: {