Authored by zhangwenxue

商品详情: 取消出售和变现前的下单

@@ -287,46 +287,48 @@ export default { @@ -287,46 +287,48 @@ export default {
287 this.showSizeSelectSheet = true; 287 this.showSizeSelectSheet = true;
288 }, 288 },
289 async onSelectTradeProduct(tradeProduct) { 289 async onSelectTradeProduct(tradeProduct) {
290 - try {  
291 - const info = await this.payment({  
292 - skup: tradeProduct.skup,  
293 - });  
294 -  
295 - /**  
296 - * {  
297 - * "message": "您有未支付的订单,支付或取消后可提交新的订单",  
298 - * "code": 512  
299 - * }  
300 - */  
301 - if (info.code === 512) {  
302 - return this.$createDialog({  
303 - type: 'confirm',  
304 - content: info.message,  
305 - confirmBtn: {  
306 - text: '查看订单',  
307 - active: true,  
308 - disabled: false,  
309 - href: 'javascript:;'  
310 - },  
311 - cancelBtn: {  
312 - text: '取消',  
313 - active: false,  
314 - disabled: false,  
315 - href: 'javascript:;'  
316 - },  
317 - onConfirm: () => {  
318 - this.$router.push({  
319 - name: this.selectSizeConfig.type === 'buy' ? 'OrderList' : 'InSaleOrderList',  
320 - params: {  
321 - owner: this.selectSizeConfig.type,  
322 - },  
323 - });  
324 - this.showSizeSelectSheet = false;  
325 - },  
326 - }).show(); 290 + if (this.selectSizeConfig.type === 'buy') {
  291 + try {
  292 + const info = await this.payment({
  293 + skup: tradeProduct.skup,
  294 + });
  295 +
  296 + /**
  297 + * {
  298 + * "message": "您有未支付的订单,支付或取消后可提交新的订单",
  299 + * "code": 512
  300 + * }
  301 + */
  302 + if (info.code === 512) {
  303 + return this.$createDialog({
  304 + type: 'confirm',
  305 + content: info.message,
  306 + confirmBtn: {
  307 + text: '查看订单',
  308 + active: true,
  309 + disabled: false,
  310 + href: 'javascript:;'
  311 + },
  312 + cancelBtn: {
  313 + text: '取消',
  314 + active: false,
  315 + disabled: false,
  316 + href: 'javascript:;'
  317 + },
  318 + onConfirm: () => {
  319 + this.$router.push({
  320 + name: 'OrderList',
  321 + params: {
  322 + owner: this.selectSizeConfig.type,
  323 + },
  324 + });
  325 + this.showSizeSelectSheet = false;
  326 + },
  327 + }).show();
  328 + }
  329 + } catch (e) {
  330 + // e
327 } 331 }
328 - } catch (e) {  
329 - // e  
330 } 332 }
331 333
332 this.$router.push({ 334 this.$router.push({