Przeglądaj źródła

优化花店从批发店买花

shizhongqi 10 miesięcy temu
rodzic
commit
742b7bd60e

+ 11 - 15
hdApp/src/admin/ghsProduct/detail.vue

@@ -135,36 +135,32 @@ export default {
           ghsInfo({shopId: shopId}).then(res => {
             let ghsId = res.data.id
             that.option.ghsId = ghsId
-            that.productDetail(id,shopId)
+            that.productDetail(id,shopId,ghsId)
           })
         }else{
           that.$msg('二维码有问题')
         }
 			}else{
-        if(this.option.ghsId){
+        let id = this.option.id ? parseInt(this.option.id) : 0
+        let ghsId = this.option.ghsId ? parseInt(this.option.ghsId) : 0
+        let shopId = this.option.shopId ? parseInt(this.option.shopId) : 0
+        if(shopId > 0){
+          that.productDetail(id, shopId, ghsId)
+        } else if(ghsId > 0 && shopId == 0){
           this.isShare = false
-          getGhsDataApi({id: this.option.ghsId}).then(res => {
+          getGhsDataApi({id: ghsId}).then(res => {
             if(res.code == 1){
               let shopId = res.data.shopId ? res.data.shopId : 0
-              that.productDetail(this.option.id,shopId)
+              that.productDetail(id, shopId, ghsId)
             }
           })
         }
-        if(this.option.shopId){
-          ghsInfo({shopId: this.option.shopId}).then(res => {
-            let ghsId = res.data.id;
-            that.option.ghsId = ghsId
-            that.productDetail(this.option.id,this.option.shopId)
-          })
-        }
       }
     },
-    productDetail(id,shopId){
+    productDetail(id, shopId, ghsId){
       let that = this
-      let ghsId = this.option.ghsId ? this.option.ghsId : 0
-      getGhsProductDetail({ id: id,ghsId:ghsId}).then(res => {
+      getGhsProductDetail({ id: id, ghsId:ghsId}).then(res => {
         if (!this.$util.isEmpty(res.data)){
-
           this.productInfo = res.data
 
           let newArr = [];

+ 1 - 1
hdApp/src/pagesPurchase/ghsProduct.vue

@@ -515,7 +515,7 @@ export default {
 	      this.popupShow = false;
 	    },
 		showBigCover(item){
-			this.$util.pageTo({url: "/admin/ghsProduct/detail",query: {id: item.id,ghsId:this.option.id}})
+			this.$util.pageTo({url: "/admin/ghsProduct/detail",query: {id: item.id, ghsId:this.option.id, shopId:this.shopId}})
 		},
 		toRefresh(){
 			this.init()