shish před 2 roky
rodič
revize
10aaf40883

+ 4 - 0
hdApp/src/api/product/index.js

@@ -106,6 +106,10 @@ export const  pxClassDel = data => {
 	return https.get('/product/ghs-item', data)
 }
 
+export const getGhsProductListV2 = data => {
+	return https.get('/product/ghs-item-v2', data)
+}
+
 export const getProductDetail = data => {
 	return https.get("/product/detail", data);
 };

+ 25 - 2
hdApp/src/mixins/cgProduct.js

@@ -1,4 +1,4 @@
-import { getGoodsDataApi,getProductDataApi,getPxClassDataApi,getGhsProductList } from "@/api/product";
+import { getGoodsDataApi,getProductDataApi,getPxClassDataApi,getGhsProductList,getGhsProductListV2 } from "@/api/product";
 import { mapGetters, mapActions } from "vuex";
 import { copyObject } from "@/utils/util";
 export default {
@@ -236,7 +236,30 @@ export default {
 				this.customData.smallCount = null
 			}
 		},
-		//采购时请求供货商花材
+		async initGhsDataV2(id,shopId,showAll) {
+			try {
+				let params = { py: this.py, id:id, shopId:shopId, showAll:showAll }
+				const { data } = await getGhsProductListV2(params);
+				this.productInfo = data;
+				if(this.pageType == 'cg' || this.pageType == 'bookCg'){
+					let targetId = this.option.id ? this.option.id : 0
+					let currentInfo = uni.getStorageSync('selectList'+this.pageType+'_ghs_'+targetId)
+					if(!this.$util.isEmpty(currentInfo)){
+						this.setSelectInfoByType({ type: this.pageType, info: currentInfo })
+					}else{
+						//临时解决方案
+						this.resetSelectInfoByType(this.pageType);
+					}
+				}
+				this.classIndex = 0;
+				this.scroll_into_view = 'class_0';
+				this.scrollPushList();
+			} catch (error) {
+				uni.hideLoading()
+			} finally {
+				uni.hideLoading()
+			}
+		},
 		async initGhsData(id,shopId,showAll) {
 			//extendInfo调用时的扩展参数,如shopId
 			try {

+ 2 - 2
hdApp/src/pagesPurchase/bookProduct.vue

@@ -454,7 +454,7 @@ export default {
 					//获取供货商花材
 					if(id>0){
 						this.visitMall(id)
-						this.initGhsData(id,shopId,1)
+						this.initGhsDataV2(id,shopId,1)
 						//不是新人或者已经下过单的或者活动没有开启不显示新人红包
 						if(this.ghsInfo.hasCg == 1 || this.ghsInfo.new == 0 || this.ghsInfo.xrFl == 0 || this.ghsInfo.sendNewGift == 1){
 							this.isNewCustom = false
@@ -469,7 +469,7 @@ export default {
 			} else {
 				this.ghsId = this.option.id
 				//获取供货商花材
-				this.initGhsData(id,shopId,1)
+				this.initGhsDataV2(id,shopId,1)
 				getGhsDataApi({id: this.option.id}).then(res => {
 					this.ghsInfo = res.data
 					this.shopId = res.data.shopId