Commit 96a37c69ea3cde802f6cba0866b09b89b0c70fe1

Authored by zhiyangdu
1 parent 1ef8b16f

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

src/pages/goodDetails/goodDetails.vue
... ... @@ -354,10 +354,10 @@ export default {
354 354 // (判断app内是否有该方法)type=2为积分加现金模式
355 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 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 368 this.stepperValue = 1;
369 369 }
370 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 375 } else {
373 376 // 判断APP内
374 377 if (this.isCNLive.value) {
... ... @@ -466,7 +469,7 @@ export default {
466 469  
467 470 // 传渠道码给原生
468 471 this.$parent.gotoDetail(params, {
469   - activityCode: "ds_jfsc" // 添加页面渠道码
  472 + activityCode: "ds_jfsc" // 添加页面渠道码
470 473 });
471 474 }
472 475 } else {
... ... @@ -579,7 +582,7 @@ export default {
579 582 toShare () {
580 583 // 判断分享
581 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 900 if (typeof this.$parent.getOpenApp === "function") {
898 901 this.$parent.getOpenApp({
899 902 type: 71,
900   - id:(this.$route.query.goodsId || 1),
  903 + id: (this.$route.query.goodsId || 1),
901 904 url: ""
902 905 });
903 906 }
904 907 if (typeof this.$parent.getShareData === "function") {
905 908 this.$parent.getShareData({
906 909 type: 71,
907   - id:(this.$route.query.goodsId || 1),
  910 + id: (this.$route.query.goodsId || 1),
908 911 url: ""
909 912 });
910 913 }
... ...