shish 3 лет назад
Родитель
Сommit
7db0b94cf4
1 измененных файлов с 17 добавлено и 65 удалено
  1. 17 65
      mallApp/src/mixins/cgProduct.js

+ 17 - 65
mallApp/src/mixins/cgProduct.js

@@ -29,7 +29,6 @@ export default {
 		};
 	},
 	onLoad(options) {
-		console.log(options)
 		this.options = options;
 		const { pageType,shopId,id,name } = options;
 		if (pageType) {
@@ -126,9 +125,7 @@ export default {
 			}
 			return {bigLength:bigLength,smallLength:smallLength,};
 		},
-		/**
-			* 描点-定位分类
-			* */
+		//描点-定位分类
 		suitScrollClassId() {
 			const curClass = this.suitInfo[this.suitClassIndex];
 			if (curClass) {
@@ -137,9 +134,7 @@ export default {
 
 			return "";
 		},
-		/**
-			* 多风格-选择商品总价
-			* */
+		//多风格-选择商品总价
 		allGoodsPrice() {
 			let price = 0;
 			if (this.selectList) {
@@ -155,9 +150,7 @@ export default {
 			}
 			return Math.round(price * 100) / 100;
 		},
-		/**
-			* 多风格-选择商品总数
-			* */
+		//多风格-选择商品总数
 		allGoodsCount() {
 			let length = 0;
 			this.selectList.forEach(element => {
@@ -165,9 +158,7 @@ export default {
 			})
 			return length;
 		},
-		/**
-			* 当前选中商品列表中是否有没有库存的商品
-			*/
+		//当前选中商品列表中是否有没有库存的商品
 		hasNoStock() {
 			let has = false;
 			if (this.selectList) {
@@ -229,19 +220,10 @@ export default {
 		},
 		//进入鲜花时请求花材接口
 		async initGhsData(id,shopId) {
-			console.log(555)
-			//extendInfo调用时的扩展参数,如shopId
 			try {
-				let params = {
-					py: this.py,
-					id:id,
-					shopId:shopId,
-					account:shopId
-				};
-				console.log(params)
+				let params = { py: this.py, id:id, shopId:shopId, account:shopId }
 				let directList = [];
 				const { data } = await getItemList(params);
-				console.log(data)
 
 				data.forEach(element => {
 					element.child &&
@@ -256,9 +238,9 @@ export default {
 				});
 				this.productInfo = data;
 
-				if(this.pageType == 'cg' && !this.$util.isEmpty(this.option.id)){
-					if(uni.getStorageSync('selectList'+this.pageType+'_hd_'+this.option.id)){
-						let currentInfo = uni.getStorageSync('selectList'+this.pageType+'_hd_'+this.option.id)
+				if(this.pageType == 'cg' && !this.$util.isEmpty(this.option.account)){
+					if(uni.getStorageSync('selectList'+this.pageType+'_hd_'+this.option.account)){
+						let currentInfo = uni.getStorageSync('selectList'+this.pageType+'_hd_'+this.option.account)
 						if(!this.$util.isEmpty(currentInfo)){
 							currentInfo.forEach((currentItem,currentIndex,currentArray)=>{
 								let currentId = currentItem.id
@@ -282,8 +264,6 @@ export default {
 			}
 		},
 		async initData(extendInfo) {
-			console.log(333)
-			//extendInfo调用时的扩展参数  如  shopId
 			try {
 				let params = {
 					py: this.py,
@@ -309,9 +289,7 @@ export default {
 				uni.hideLoading()
 			}
 		},
-		/**
-			* 滚动或切换分类 获取更多数据
-			* **/
+		//滚动或切换分类 获取更多数据
 		scrollPushList(){
 			let list = copyObject(this.productInfo);
 			let classList = [];
@@ -323,26 +301,20 @@ export default {
 				}
 			}
 			this.filterProductInfo = classList
-			console.log(444)
 			return
 		},
-		/**
-			* 滚动商品监听
-			* **/
+		//滚动商品监听
 		scroll_detail(options){
 			//options  为滚动信息。  options.detail.scrollTop  值为相对于scroll-view。
 			if(!uni.getStorageSync("resolve")){
 				this.get_node_details(options);
 			};
 		},
-		/**
-			* 获取商品节点信息
-			* **/
+		//获取商品节点信息
 		get_node_details(options){
 			const query = uni.createSelectorQuery().in(this); //获得实力
 			//获取多个节点方式
 			query.selectAll(".selectAll").boundingClientRect(data=>{
-				// console.log(data); //得到class类名为  selectAll的数组集合
 				this.top_list = data.map(item=>{
 					return Math.ceil(item.top);
 				});
@@ -390,9 +362,7 @@ export default {
 			price = Math.round(sum * 100) / 100;
 			return price;
 		},
-		/**
-			* 成品-请求商品数据
-			*/
+		//成品-请求商品数据
 		async initGoodsData(extendInfo) {
 			//extendInfo调用时的扩展参数  如  shopId
 			try {
@@ -495,8 +465,6 @@ export default {
 		//添加商品
 		addEvent(item) {
 			const list = this.selectList;
-			console.log(list)
-			console.log(item)
 			let hasItem = false;
 			for (let index = 0; index < list.length; index++) {
 				const element = list[index];
@@ -553,7 +521,6 @@ export default {
 			this.rememberProduct()
 
 		},
-
 		addCustomNumEvent(item,params1,type) {
 			const list = this.selectList;
 			let info = { classId: item.classId, id: item.id };
@@ -624,9 +591,7 @@ export default {
 			//记忆已经选择的花材
 			this.rememberProduct()
 		},
-		/**
-			* 通过id获取当前选中的商品类别信息  左边菜单角标  当前选中该类别商品多少件
-			*/
+		//通过id获取当前选中的商品类别信息  左边菜单角标  当前选中该类别商品多少件
 		getSuitSelectClassById(classId) {
 			let info = {
 				bigCount: 0, //扎数
@@ -653,10 +618,8 @@ export default {
 		},
 		//多风格-添加商品
 		addGoodsEvent(item) {
-			console.log(item,'itemitem')
 			const list = this.selectList;
 			//过滤空数据
-			// if(item.bigCount==0||!item.bigCount){return}
 			let has = false;
 			for (let index = 0; index < list.length; index++) {
 				const element = list[index];
@@ -816,7 +779,6 @@ export default {
 		//切换左侧商品类别
 		swichClass(cur) {
 			// clearInterval(this.timeFun)
-			console.log(cur,'---',this.filterProductInfo)
 			this.classIndex = cur;
 			this.filterProductInfo[cur].isActive = true;
 			if(cur==this.filterProductInfo.length-1){
@@ -838,10 +800,7 @@ export default {
 				uni.removeStorageSync("resolve")
 			},400);
 		},
-
-		/**
-			* 成品(多风格)-切换左侧商品类别
-			*/
+		//成品(多风格)-切换左侧商品类别
 		suitSwichClass(cur) {
 
 
@@ -865,23 +824,18 @@ export default {
 				uni.removeStorageSync("resolve")
 			},400);
 		},
-		/**
-			* 滚动商品监听
-			* **/
+		//滚动商品监听
 		suit_scroll_detail(options){
 			//options  为滚动信息。  options.detail.scrollTop  值为相对于scroll-view。
 			if(!uni.getStorageSync("resolve")){
 				this.suit_get_node_details(options);
 			};
 		},
-		/**
-			* 获取商品节点信息
-			* **/
+		//获取商品节点信息
 		suit_get_node_details(options){
 			const query = uni.createSelectorQuery().in(this); //获得实力
 			//获取多个节点方式
 			query.selectAll(".suitSelectAll").boundingClientRect(data=>{
-				// console.log(data); //得到class类名为  selectAll的数组集合
 				this.suit_top_list = data.map(item=>{
 					return Math.ceil(item.top);
 				});
@@ -915,9 +869,7 @@ export default {
 			this.suitFilterProductInfo[this.suitClassIndex].isActive = true;
 			// this.suitScrollPushList();
 		},
-		/**
-			* 搜索对应花材
-			*/
+		//搜索对应花材
 		suitSearchFn() {
 			let list = copyObject(this.suitFilterProductInfo);
 			if(!this.$util.isEmpty(this.py)){