Commit 96a37c69ea3cde802f6cba0866b09b89b0c70fe1

Authored by zhiyangdu
1 parent 1ef8b16f

第一次超出库存后自动改成最大库存

src/pages/goodDetails/goodDetails.vue
@@ -354,10 +354,10 @@ export default { @@ -354,10 +354,10 @@ export default {
354 // (判断app内是否有该方法)type=2为积分加现金模式 354 // (判断app内是否有该方法)type=2为积分加现金模式
355 if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.jumpOrderDes) { 355 if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.jumpOrderDes) {
356 // 跳转到原生的任务列表 356 // 跳转到原生的任务列表
357 - window.webkit.messageHandlers.jumpOrderDes.postMessage({ body: { orderId: item.id, type: 2} }) 357 + window.webkit.messageHandlers.jumpOrderDes.postMessage({ body: { orderId: item.id, type: 2 } })
358 } else if (window.obj && window.obj.jumpOrderDes) { 358 } else if (window.obj && window.obj.jumpOrderDes) {
359 // 跳转到原生的任务列表 359 // 跳转到原生的任务列表
360 - window.obj.jumpOrderDes(JSON.stringify({ orderId: item.id, type: 2})); 360 + window.obj.jumpOrderDes(JSON.stringify({ orderId: item.id, type: 2 }));
361 } 361 }
362 } 362 }
363 }, 363 },
@@ -368,7 +368,10 @@ export default { @@ -368,7 +368,10 @@ export default {
368 this.stepperValue = 1; 368 this.stepperValue = 1;
369 } 369 }
370 if ((parseInt(this.goodsInfo.stock) > -1 && parseInt(this.stepperValue) > parseInt(this.goodsInfo.stock)) || parseInt(this.stepperValue) > 999) { 370 if ((parseInt(this.goodsInfo.stock) > -1 && parseInt(this.stepperValue) > parseInt(this.goodsInfo.stock)) || parseInt(this.stepperValue) > 999) {
371 - Toast("数量超出库存范围~") 371 + Toast("数量超出库存范围~");
  372 + if (parseInt(this.stepperValue) > 999) {
  373 + this.stepperValue = 999;
  374 + }
372 } else { 375 } else {
373 // 判断APP内 376 // 判断APP内
374 if (this.isCNLive.value) { 377 if (this.isCNLive.value) {
@@ -466,7 +469,7 @@ export default { @@ -466,7 +469,7 @@ export default {
466 469
467 // 传渠道码给原生 470 // 传渠道码给原生
468 this.$parent.gotoDetail(params, { 471 this.$parent.gotoDetail(params, {
469 - activityCode: "ds_jfsc" // 添加页面渠道码 472 + activityCode: "ds_jfsc" // 添加页面渠道码
470 }); 473 });
471 } 474 }
472 } else { 475 } else {
@@ -579,7 +582,7 @@ export default { @@ -579,7 +582,7 @@ export default {
579 toShare () { 582 toShare () {
580 // 判断分享 583 // 判断分享
581 if (typeof this.$parent.toShare === 'function') { 584 if (typeof this.$parent.toShare === 'function') {
582 - this.$parent.toShare(71,(this.$route.query.goodsId || 1)); 585 + this.$parent.toShare(71, (this.$route.query.goodsId || 1));
583 } 586 }
584 }, 587 },
585 /** 588 /**
@@ -897,14 +900,14 @@ export default { @@ -897,14 +900,14 @@ export default {
897 if (typeof this.$parent.getOpenApp === "function") { 900 if (typeof this.$parent.getOpenApp === "function") {
898 this.$parent.getOpenApp({ 901 this.$parent.getOpenApp({
899 type: 71, 902 type: 71,
900 - id:(this.$route.query.goodsId || 1), 903 + id: (this.$route.query.goodsId || 1),
901 url: "" 904 url: ""
902 }); 905 });
903 } 906 }
904 if (typeof this.$parent.getShareData === "function") { 907 if (typeof this.$parent.getShareData === "function") {
905 this.$parent.getShareData({ 908 this.$parent.getShareData({
906 type: 71, 909 type: 71,
907 - id:(this.$route.query.goodsId || 1), 910 + id: (this.$route.query.goodsId || 1),
908 url: "" 911 url: ""
909 }); 912 });
910 } 913 }