Explorar el Código

零售端优化所有花材列表

jf hace 5 años
padre
commit
76bc023bea

+ 53 - 29
hdApp/src/admin/billing/index.vue

@@ -2,13 +2,16 @@
 <template>
 	<view class="billing_box_bg">
 		<app-tabs :tabs="tabs" :currentTab="tabIndex" @change="change" itemWidth="33.3%" />
-		<view class="input-wrap" v-if="tabIndex == 1 || tabIndex == 0">
-			<app-search-module v-model="py" placeholder="请输入关键词,支持拼音首字母搜索" @search="searchFn" />
+		<view class="input-wrap" v-show="tabIndex == 1">
+			<app-search-module v-model="py" placeholder="请输入关键词,支持拼音首字母搜索" @input="searchFn" />
+		</view>
+		<view class="input-wrap" v-show="tabIndex == 0">
+			<app-search-module v-model="py" placeholder="请输入关键词,支持拼音首字母搜索" @input="suitSearchFn" />
 		</view>
 		<view class="scroll-middle_bx">
-
-			<scroll-view scroll-y scroll-with-animation class="tab-view" :scroll-top="scrollTop" v-if="tabIndex == 0">
-				<div v-for="(item, index) in suitFilterProductInfo" :key="index" class="tab-bar-item" :class="[suitClassIndex == index ? 'active' : '']" :data-current="index" @tap.stop="suitSwichClass">
+			<!--成品-->
+			<scroll-view scroll-y scroll-with-animation class="tab-view" :scroll-top="scrollTop" v-show="tabIndex == 0">
+				<div v-for="(item, index) in suitFilterProductInfo" :key="index" class="tab-bar-item" :class="[suitClassIndex == index ? 'active' : '']" :data-current="index" @tap.stop="suitSwichClass(index)">
 					<text>{{ item.className || "" }}</text>
 					<text class="tag" v-if=" getSuitSelectClassById(item.classId).bigCount > 0">
 						<text v-if=" getSuitSelectClassById(item.classId).bigCount > 0 ">
@@ -17,10 +20,14 @@
 					</text>
 				</div>
 			</scroll-view>
-			<scroll-view scroll-y class="right-box" v-if="tabIndex == 0" :scroll-into-view="suitScrollClassId">
+<!--			<scroll-view scroll-y class="right-box" v-if="tabIndex == 0" :scroll-into-view="suitScrollClassId">-->
+				<scroll-view scroll-y class="right-box" v-show="tabIndex == 0" :scroll-into-view="suit_scroll_into_view" scroll-with-animation="true"
+																	@scroll="suit_scroll_detail"
+																	lower-threshold="100"
+																	@scrolltolower="suit_scroll_bottom">
 				<!--内容部分 start -->
 				<block v-if="!$util.isEmpty(suitFilterProductInfo)">
-					<view class="item_list_bx" v-for="(res,i) in suitFilterProductInfo" :key="i" :id="`class_${res.classId}`">
+					<view class="item_list_bx suitSelectAll" v-for="(res,i) in suitFilterProductInfo" :key="i" :id="`class_${i}`">
 						<view class="item_list_title">{{ res.className }}</view>
 						<template v-for="(data,j) in res.child">
 							<view :id="`class_${res.classId}_${data.id}`" :key="j" >
@@ -41,16 +48,13 @@
 					</view>
 				</block>
 				<block v-else>
-					<app-wrapper-empty
-						title="暂无数据"
-						:is-empty="$util.isEmpty(filterProductInfo)"
-					/>
+					<app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(filterProductInfo)" />
 				</block>
 				<!--内容部分 end -->
 			</scroll-view>
-
-			<scroll-view scroll-y scroll-with-animation class="tab-view" :scroll-top="scrollTop" v-if="tabIndex == 1">
-				<div v-for="(item, index) in filterProductInfo" :key="index" class="tab-bar-item" :class="[classIndex == index ? 'active' : '']" :data-current="index" @tap.stop="swichClass">
+			<!--花材-->
+			<scroll-view scroll-y scroll-with-animation class="tab-view" :scroll-top="scrollTop" v-show="tabIndex == 1">
+				<div v-for="(item, index) in filterProductInfo" :key="index" class="tab-bar-item" :class="[classIndex == index ? 'active' : '']" :data-current="index" @tap.stop="swichClass(index)">
 					<text>{{ item.className || "" }}</text>
 					<text class="tag" v-if=" getSelectClassById(item.classId).bigCount > 0 || getSelectClassById(item.classId).smallCount > 0">
 						<text v-if=" getSelectClassById(item.classId).bigCount > 0 || getSelectClassById(item.classId).smallCount > 0 ">
@@ -63,23 +67,19 @@
 				<view style="height: 240rpx"></view>
 				<view class="switchover-unit" @tap="isSmallCount = !isSmallCount">{{isSmallCount?'支':'扎'}}</view>
 			</scroll-view>
-			<scroll-view scroll-y class="right-box" v-if="tabIndex == 1" :scroll-into-view="scrollClassId">
+<!--			<scroll-view scroll-y class="right-box" v-if="tabIndex == 1" :scroll-into-view="scrollClassId">-->
+				<scroll-view scroll-y class="right-box" v-show="tabIndex == 1" :scroll-into-view="scroll_into_view" scroll-with-animation="true"
+																	@scroll="scroll_detail"
+																	lower-threshold="100"
+																	@scrolltolower="scroll_bottom">
 				<!--内容部分 start -->
 				<block v-if="!$util.isEmpty(filterProductInfo)">
-					<view
-						class="item_list_bx"
-						v-for="(classItem, classIndex) in filterProductInfo"
-						:key="classIndex"
-						:id="`class_${classItem.classId}`"
-					>
+					<view class="item_list_bx selectAll" v-for="(classItem, classIndex) in filterProductInfo" :key="classIndex" :id="`class_${classIndex}`">
 						<view class="item_list_title">
 							{{ classItem.className }}
 						</view>
 						<template v-for="(productItem, productIndex) in classItem.child">
-							<view
-								:id="`class_${classItem.classId}_${productItem.id}`"
-								:key="productIndex"
-							>
+							<view :id="`class_${classItem.classId}_${productItem.id}`" :key="productIndex">
 								<Commondity
 									:info="productItem"
 									:bigCount="
@@ -111,8 +111,13 @@
 			</scroll-view>
 
 			<!-- 课程 -->
-			<scroll-view scroll-y scroll-with-animation v-if="tabIndex == 2" class="PxClass-box">
-				<PxClassCommondity  :info="pxClassInfo"></PxClassCommondity>
+			<scroll-view scroll-y scroll-with-animation v-show="tabIndex == 2" class="PxClass-box">
+				<block v-if="!$util.isEmpty(pxClassInfo)">
+					<PxClassCommondity  :info="pxClassInfo"></PxClassCommondity>
+				</block>
+				<block v-else>
+					<app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(pxClassInfo)" />
+				</block>
 			</scroll-view>
 		</view>
 		<!-- :maskClosable="false" -->
@@ -175,7 +180,7 @@ export default {
 	data() {
 		return {
 			COMMODITY_TYPE,
-			tabIndex: 0,
+			tabIndex: null,
 			tabs: [
 				{	name: "成品"	},
 				{	name: "花材"	},
@@ -200,7 +205,9 @@ export default {
 			return content;
 		}
 	},
-
+	onShow(){
+		this.change({index:0});
+	},
 	onUnload() {
 		this.resetSelectInfoByType(this.pageType);
 	},
@@ -271,6 +278,23 @@ export default {
 				return false;
 			} else {
 				this.tabIndex = e.index;
+				switch (e.index){
+					case 0:
+						if(this.$util.isEmpty(this.suitInfo)){
+							this.initGoodsData();//成品
+						}
+					break;
+					case 1:
+						if(this.$util.isEmpty(this.productInfo)){
+							this.initData();//组合
+						}
+						break;
+					case 2:
+						if(this.$util.isEmpty(this.pxClassInfo)){
+							this.initPxClassData();//课程
+						}
+						break;
+				}
 			}
 		},
 		scrollTop() {}

+ 5 - 4
hdApp/src/components/module/app-goods-commodity.vue

@@ -1,6 +1,6 @@
 <!--姜枫 2021.04.11-->
 <template>
-	<view class="item-cmd_bx">
+	<view class="item-cmd_bx" @click="addEvents">
 		<view class="img_bx" @click="addEvents">
 			<app-img  :src="info.smallImgList[0]" alt="商品图" mode="aspectFit" :height="160" />
 		</view>
@@ -8,14 +8,15 @@
 			<view class="tit" @click="addEvents">{{ info.goodsName || "" }}</view>
 <!--			<view class="kc" @click="addEvents">库存 {{ info.stock }}</view>-->
 			<view class="num-open_bx">
-				<view class="price">¥{{ showPrice }}</view>
+<!--				<view class="price">¥{{ showPrice }}</view>-->
+				<view class="price">¥{{ info.price }}</view>
 				<view class="open-bx" >
-					<i class="iconfont iconjianqu" :class="delAnimationData?'animation':''" @click="delEvent" v-if="bigCount > 0"></i>
+					<i class="iconfont iconjianqu" :class="delAnimationData?'animation':''" @click.stop="delEvent" v-if="bigCount > 0"></i>
 					<text class="num" >
 						<text v-if="bigCount > 0">{{ bigCount }}</text>
 					</text>
 					<i class="iconfont icontianjia" v-if="info.goodsStyle>0" :class="addAnimationData?'animation':''" @click="isGoodsStyle = true"></i>
-					<i class="iconfont icontianjia" v-else :class="addAnimationData?'animation':''" @click="addEvents"></i>
+					<i class="iconfont icontianjia" v-else :class="addAnimationData?'animation':''" @click.stop="addEvents"></i>
 				</view>
 			</view>
 		</view>

+ 5 - 3
hdApp/src/components/module/app-search.vue

@@ -1,12 +1,12 @@
 <template>
 	<div class="app-search-module" :style="{ height: height + 'rpx' }">
-		<div class="map-search" :style="{ backgroundColor: backColor }">
+		<div class="map-search" :style="{ backgroundColor: backColor }" style="height: 100rpx">
 			<div class="icon-wrap" v-if="isIcon">
 				<i class="iconfont" :class="[icon]"></i>
 			</div>
 			<div class="input-wrap">
 				<input
-					type="text"
+					type="text" placeholder-style="color:#ccc"
 					ref="searchInput"
 					v-model="search"
 					:focus="focus"
@@ -132,9 +132,11 @@ export default {
 		}
 		.input-wrap {
 			width: calc(100% - 90px);
+			height: 80rpx;
 			margin-left: 14px;
 			input {
-				font-size: 26px;
+				height: 100%;
+				font-size: 30px !important;
 				text-align: left;
 			}
 			.placeholder {

+ 8 - 8
hdApp/src/mixins/animation.js

@@ -12,16 +12,16 @@ export default {
 		animationFun(type){
 			if(type=='add'){
 				this.addAnimationData = true;
-				this.$nextTick(()=>{
-					this.addAnimationData = false;
-				})
-				// setTimeout(()=>{this.addAnimationData = false;},100)
+				// this.$nextTick(()=>{
+				// 	this.addAnimationData = false;
+				// })
+				setTimeout(()=>{this.addAnimationData = false;},300)
 			}else{
 				this.delAnimationData = true;
-				this.$nextTick(()=>{
-					this.delAnimationData = false;
-				})
-				// setTimeout(()=>{this.delAnimationData = false;},100)
+				// this.$nextTick(()=>{
+				// 	this.delAnimationData = false;
+				// })
+				setTimeout(()=>{this.delAnimationData = false;},300)
 			}
 
 		},

+ 360 - 75
hdApp/src/mixins/product.js

@@ -17,7 +17,19 @@ export default {
 			py: "", //拼音搜索条件
 			type: "", //库存预警时,固定为waring,其他情况不传或者传空
 			autoLoad: true, //自动获取商品信息
-			isLimit: true //选择数量不能大于库存限制
+			isLimit: true, //选择数量不能大于库存限制
+
+			//成品开单
+			suit_scroll_into_view:"",
+			suit_top_list:'',
+			suitTimeFun:"",
+			suitFilterProductInfo:'',
+			//组合开单
+			scroll_into_view:"",
+			top_list:'',
+			timeFun:"",
+			filterProductInfo:'',
+
 		};
 	},
 	onLoad(options) {
@@ -35,16 +47,18 @@ export default {
 			if(this.isGhsProduct){
 				// this.initGhsData(id,shopId);//采购-进店下单
 			}else{
-				this.initGoodsData();//成品
-				this.initData();//组合
-				this.initPxClassData();//课程
+				if(!this.$util.isEmpty(this.tabIndex)){
+					this.initData();//组合
+				}
+				// this.initGoodsData();//成品
+				// this.initPxClassData();//课程
 			}
 		}
 	},
 	onUnload() {},
 	computed: {
 		...mapGetters(["getSelectInfo"]),
-		filterProductInfo() {
+		filterProductInfoxxxx() {
 			let list = copyObject(this.productInfo);
 			if (this.py) {
 				let commonChildList = [];
@@ -82,7 +96,7 @@ export default {
 		/**
 			* 搜索、初始化数据
 			* */
-		suitFilterProductInfo() {
+		suitFilterProductInfoxxx() {
 			let list = copyObject(this.suitInfo);
 			if (this.py) {
 				let commonChildList = [];
@@ -254,6 +268,7 @@ export default {
 				});
 				this.productInfo = data;
 				this.classIndex = 0;
+				this.scrollPushList();
 			} catch (error) {
 			} finally {
 				uni.hideLoading();
@@ -279,11 +294,94 @@ export default {
 				});
 				this.productInfo = data;
 				this.classIndex = 0;
+				this.scrollPushList();
 			} catch (error) {
 			} finally {
 				uni.hideLoading();
 			}
 		},
+		/**
+			* 滚动或切换分类 获取更多数据
+			* **/
+		scrollPushList(){
+			let list = copyObject(this.productInfo);
+
+			if(this.$util.isEmpty(this.filterProductInfo)){	//第一次进入无数据
+				let classList = [];
+				list.forEach(ele=>{
+					classList = [...classList,{child:[],classId:ele.classId,className:ele.className}]
+				})
+				classList[this.classIndex].child = list[this.classIndex].child;
+				this.filterProductInfo = classList;
+				let classIndex = 1;
+				this.timeFun = setInterval(()=>{
+					if(classIndex<this.filterProductInfo.length){
+						classList[classIndex].child = list[classIndex].child;
+						this.filterProductInfo = classList;
+						classIndex++
+					}else{
+						clearInterval(this.timeFun)
+					}
+				},600)
+			}else{//获取更多数据
+				if(this.$util.isEmpty(this.filterProductInfo[this.classIndex].child)){
+					this.filterProductInfo[this.classIndex].child = list[this.classIndex].child;
+				}
+				if(this.classIndex+1<this.filterProductInfo.length-1){
+					if(this.$util.isEmpty(this.filterProductInfo[this.classIndex+1].child)){
+						this.filterProductInfo[this.classIndex+1].child = list[this.classIndex+1].child;
+					}
+				}
+			}
+
+
+
+		},
+		/**
+			* 滚动商品监听
+			* **/
+		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);
+				});
+				this.async_detail_msg(options);
+			}).exec();
+		},
+		async_detail_msg(options){
+			//options  为滚动信息。  options.detail.scrollTop  值为相对于scroll-view。
+			let top_page = options.detail.scrollTop + this.top_list[0];
+
+			for(let i = 0;i < this.top_list.length; i++){
+				let node1 = this.top_list[i];
+				let node2 = this.top_list[i+1];
+				if(node2 && top_page >= node1 && top_page < node2){
+					this.classIndex = i;
+					this.scrollPushList();
+					break;
+				}else if(node2 && top_page === node2){
+					this.classIndex = i + 1;
+					this.scrollPushList();
+					break;
+				}
+			}
+		},
+		scroll_bottom(){
+			this.classIndex = this.filterProductInfo.length-1
+			this.scrollPushList();
+		},
 		/**
 			* 获取当前选中商品总价
 			*/
@@ -319,12 +417,49 @@ export default {
 				});
 				this.suitInfo = data;
 				this.suitClassIndex = 0;
+				this.suitScrollPushList();
 			} catch (error) {
 			} finally {
 				uni.hideLoading();
 			}
 		},
+		/**
+			* 成品-滚动或切换分类 获取更多数据
+			* **/
+		suitScrollPushList(){
+			let list = copyObject(this.suitInfo);
 
+			if(this.$util.isEmpty(this.suitFilterProductInfo)){	//第一次进入无数据
+				let classList = [];
+				list.forEach(ele=>{
+					classList = [...classList,{child:[],classId:ele.classId,className:ele.className}]
+				})
+				classList[this.suitClassIndex].child = list[this.suitClassIndex].child;
+				this.suitFilterProductInfo = classList;
+				let classIndex = 1;
+				this.suitTimeFun = setInterval(()=>{
+					if(classIndex<this.suitFilterProductInfo.length){
+						classList[classIndex].child = list[classIndex].child;
+						this.suitFilterProductInfo = classList;
+						classIndex++
+					}else{
+						clearInterval(this.suitTimeFun)
+					}
+				},600)
+			}else{//获取更多数据
+				if(this.$util.isEmpty(this.suitFilterProductInfo[this.suitClassIndex].child)){
+					this.suitFilterProductInfo[this.suitClassIndex].child = list[this.suitClassIndex].child;
+				}
+				if(this.suitClassIndex+1<this.suitFilterProductInfo.length-1){
+					if(this.$util.isEmpty(this.suitFilterProductInfo[this.suitClassIndex+1].child)){
+						this.suitFilterProductInfo[this.suitClassIndex+1].child = list[this.suitClassIndex+1].child;
+					}
+				}
+			}
+
+
+
+		},
 		/**
 			* 获取当前选中商品总价
 			*/
@@ -508,77 +643,97 @@ export default {
 			* 减去商品
 			*/
 		delEvent(item) {
-			const list = this.selectList;
+			const list = copyObject(this.selectList);
 			let has = false;
 			for (let index = 0; index < list.length; index++) {
-				const element = list[index];
+				let element = list[index];
 				if (element.id == item.id && element.classId == item.classId) {
 					has = true;
-
 					if (element.bigCount > 0) {
 						if(!this.isSmallCount){list[index] = { ...element, bigCount: --element.bigCount };}
 					}
 					if (element.smallCount > 0) {
 						if(this.isSmallCount){list[index] = { ...element, smallCount: --element.smallCount };}
 					}
-
-					if (this.isLimit) {
-						const { bigCount, smallCount } = list[index];
-						//超过库存时 设置为库存最大值
-						const ratio = Number(item.ratio);
-						if (
-							Number(bigCount) * ratio + Number(smallCount) >
-							Number(item.bigNum) * ratio + Number(item.smallNum)
-						) {
-							list[index].bigCount = Number(item.bigNum);
-							list[index].smallCount = Number(item.smallNum);
-						}
-					}
 					if (element.bigCount == 0 && element.smallCount == 0) {
 						list.splice(index, 1);
 					}
-
-					break;
-				}
-			}
-			if (!has) {
-				let info = { classId: item.classId, id: item.id };
-
-				const classInfo =
-					this.productInfo &&
-					this.productInfo.find(element => {
-						return element.classId == item.classId && element.child;
-					});
-				if (classInfo) {
-					info = classInfo.child.find(ele => {
-						return ele.id == item.id;
-					});
 				}
-				let params = {
-					...info,
-					bigCount: 1, //扎数
-					smallCount: 0, //支数
-					autoPrice: 0 //调价价格
-				};
-
-				list.push(params);
+				break;
 			}
 			this.setSelectInfoByType({ type: this.pageType, info: list });
-			// this.$forceUpdate();
-		},
-		//减去所有商品
-		delAllEvent(item) {
-			const list = this.selectList;
-			for (let index = 0; index < list.length; index++) {
-				const element = list[index];
-				if (element.id == item.id ) {
 
-					list.splice(index, 1);
-
-					break;
-				}
-			}
-			this.setSelectInfoByType({ type: this.pageType, info: list });
+		// 	const list = this.selectList;
+		// 	let has = false;
+		// 	for (let index = 0; index < list.length; index++) {
+		// 		const element = list[index];
+		// 		if (element.id == item.id && element.classId == item.classId) {
+		// 			has = true;
+		//
+		// 			if (element.bigCount > 0) {
+		// 				if(!this.isSmallCount){list[index] = { ...element, bigCount: --element.bigCount };}
+		// 			}
+		// 			if (element.smallCount > 0) {
+		// 				if(this.isSmallCount){list[index] = { ...element, smallCount: --element.smallCount };}
+		// 			}
+		//
+		// 			if (this.isLimit) {
+		// 				const { bigCount, smallCount } = list[index];
+		// 				//超过库存时 设置为库存最大值
+		// 				const ratio = Number(item.ratio);
+		// 				if (
+		// 					Number(bigCount) * ratio + Number(smallCount) >
+		// 					Number(item.bigNum) * ratio + Number(item.smallNum)
+		// 				) {
+		// 					list[index].bigCount = Number(item.bigNum);
+		// 					list[index].smallCount = Number(item.smallNum);
+		// 				}
+		// 			}
+		// 			if (element.bigCount == 0 && element.smallCount == 0) {
+		// 				list.splice(index, 1);
+		// 			}
+		//
+		// 			break;
+		// 		}
+		// 	}
+		// 	if (!has) {
+		// 		let info = { classId: item.classId, id: item.id };
+		//
+		// 		const classInfo =
+		// 			this.productInfo &&
+		// 			this.productInfo.find(element => {
+		// 				return element.classId == item.classId && element.child;
+		// 			});
+		// 		if (classInfo) {
+		// 			info = classInfo.child.find(ele => {
+		// 				return ele.id == item.id;
+		// 			});
+		// 		}
+		// 		let params = {
+		// 			...info,
+		// 			bigCount: 1, //扎数
+		// 			smallCount: 0, //支数
+		// 			autoPrice: 0 //调价价格
+		// 		};
+		//
+		// 		list.push(params);
+		// 	}
+		// 	this.setSelectInfoByType({ type: this.pageType, info: list });
+		// 	// this.$forceUpdate();
+		// },
+		// //减去所有商品
+		// delAllEvent(item) {
+		// 	const list = this.selectList;
+		// 	for (let index = 0; index < list.length; index++) {
+		// 		const element = list[index];
+		// 		if (element.id == item.id ) {
+		//
+		// 			list.splice(index, 1);
+		//
+		// 			break;
+		// 		}
+		// 	}
+		// 	this.setSelectInfoByType({ type: this.pageType, info: list });
 		},
 		/**
 			* 通过id获取当前选中的商品类别信息  左边菜单角标  当前选中该类别商品多少件
@@ -747,29 +902,159 @@ export default {
 		/**
 			* 切换左侧商品类别
 			*/
-		swichClass(e) {
-			let cur = e.currentTarget.dataset.current;
-			if (this.classIndex == cur) {
-				return false;
-			} else {
-				this.classIndex = cur;
-			}
+		swichClass(cur) {
+			this.classIndex = cur;
+			this.scroll_into_view = 'class_'+cur;
+			this.scrollPushList();
+			//解决最后一个 ***来回*** 问题 (由于点击左侧导航,右侧锚点位置信息变化,此时滚动事件也随之滚动。)
+			uni.setStorageSync("resolve","last");
+			setTimeout(()=>{
+				uni.removeStorageSync("resolve")
+			},400);
 		},
+
 		/**
-			* 多风格-切换左侧商品类别
+			* 成品(多风格-切换左侧商品类别
 			*/
-		suitSwichClass(e) {
-			let cur = e.currentTarget.dataset.current;
-			if (this.suitClassIndex == cur) {
-				return false;
-			} else {
-				this.suitClassIndex = cur;
+		suitSwichClass(cur) {
+			this.suitClassIndex = cur;
+			this.suit_scroll_into_view = 'class_'+cur;
+			this.suitScrollPushList();
+			// this.scrollPushList();
+			//解决最后一个 ***来回*** 问题 (由于点击左侧导航,右侧锚点位置信息变化,此时滚动事件也随之滚动。)
+			uni.setStorageSync("resolve","last");
+			setTimeout(()=>{
+				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);
+				});
+				this.suit_async_detail_msg(options);
+			}).exec();
+		},
+		suit_async_detail_msg(options){
+			//options  为滚动信息。  options.detail.scrollTop  值为相对于scroll-view。
+			let top_page = options.detail.scrollTop + this.suit_top_list[0];
+
+			for(let i = 0;i < this.suit_top_list.length; i++){
+				let node1 = this.suit_top_list[i];
+				let node2 = this.suit_top_list[i+1];
+				if(node2 && top_page >= node1 && top_page < node2){
+					this.suitClassIndex = i;
+					this.suitScrollPushList();
+					break;
+				}else if(node2 && top_page === node2){
+					this.suitClassIndex = i + 1;
+					this.suitScrollPushList();
+					break;
+				}
 			}
 		},
+		suit_scroll_bottom(){
+			this.suitClassIndex = this.suitFilterProductInfo.length-1
+			this.suitScrollPushList();
+		},
 		/**
 			* 搜索对应花材
 			*/
-		searchFn() {},
+		suitSearchFn() {
+			let list = copyObject(this.suitFilterProductInfo);
+			if(!this.$util.isEmpty(this.py)){
+				clearInterval(this.suitTimeFun)
+				let commonChildList = [];
+				list.forEach(ele => {
+					//过滤常用
+					if(ele.classId != -2){
+						if (!this.$util.isEmpty(ele.child)) {
+							ele.child.forEach(obj => {
+								let hasName = obj.goodsName && obj.goodsName.indexOf(this.py) >= 0;
+								let elePy = (obj.py && obj.py.toLocaleUpperCase()) || "";
+								let hasPy = elePy.indexOf(this.py.toLocaleUpperCase()) >= 0;
+								if (hasName || hasPy) {
+									if(this.$util.isEmpty(commonChildList)){
+										commonChildList = [...commonChildList,{classId: ele.classId, className: ele.className,child:[obj]}];
+									}else{
+										commonChildList.forEach(res => {
+											if(res.classId==ele.classId){
+												res.child.push(obj)
+											}else{
+												commonChildList.push({classId: ele.classId, className: ele.className,child:[obj]});
+											}
+										})
+									}
+								}
+							});
+						}
+
+					}
+				});
+				list = this.$util.unique(commonChildList)
+				this.suitFilterProductInfo = list;
+				this.suitClassIndex = 0;
+			}else{
+				this.suitFilterProductInfo = '';
+				this.suitClassIndex = 0;
+				this.suitScrollPushList();
+			}
+		},
+		searchFn() {
+			let list = copyObject(this.productInfo);
+			if(!this.$util.isEmpty(this.py)){
+				clearInterval(this.timeFun)
+				let commonChildList = [];
+				list.forEach(ele => {
+					//过滤常用
+					if(ele.classId != -2){
+						if (!this.$util.isEmpty(ele.child)) {
+							ele.child.forEach(obj => {
+								let hasName = obj.itemName && obj.itemName.indexOf(this.py) >= 0;
+								let elePy = (obj.py && obj.py.toLocaleUpperCase()) || "";
+								let hasPy = elePy.indexOf(this.py.toLocaleUpperCase()) >= 0;
+								if (hasName || hasPy) {
+									if(this.$util.isEmpty(commonChildList)){
+										commonChildList = [...commonChildList,{classId: ele.classId, className: ele.className,child:[obj]}];
+									}else{
+										commonChildList.forEach(res => {
+											if(res.classId==ele.classId){
+												res.child.push(obj)
+											}else{
+												commonChildList.push({classId: ele.classId, className: ele.className,child:[obj]});
+											}
+										})
+									}
+								}
+							});
+						}
+
+					}
+				});
+				list = this.$util.unique(commonChildList)
+				this.filterProductInfo = list;
+				this.suitClassIndex = 0;
+			}else{
+				this.filterProductInfo = '';
+				this.classIndex = 0;
+				this.scrollPushList();
+			}
+		},
 
 
 		/**

+ 56 - 333
hdApp/src/mixins/productContrapose.js

@@ -1,5 +1,6 @@
 // import { getProductDataApi } from "@/api/product/index";
 import { getProductDataApi,getAllProductDataApi } from "@/api/product/index";
+import { STOCK_TYPE } from "@/utils/declare";
 import { mapGetters, mapActions } from "vuex";
 import { copyObject } from "@/utils/util";
 export default {
@@ -12,7 +13,11 @@ export default {
 			py: "", //拼音搜索条件
 			type: "", //库存预警时,固定为waring,其他情况不传或者传空
 			autoLoad: true, //自动获取商品信息
-			isLimit: true //选择数量不能大于库存限制
+			isLimit: true, //选择数量不能大于库存限制
+			filterProductInfoContrapose:[],
+			allFilterProductInfoContrapose:[],
+			isMore:true,
+			page:1,
 		};
 	},
 	onLoad(options) {
@@ -27,356 +32,74 @@ export default {
 	},
 	onUnload() {},
 	computed: {
-		...mapGetters(["getSelectInfo"]),
-		filterProductInfoContrapose() {
-			let list = copyObject(this.productInfo);
-			return list;
-		},
-		/**
-		 * 当前页面选中的商品列表
-		 */
-		selectList() {
-			return this.getSelectInfo[this.pageType] || [];
-		},
-		scrollClassId() {
-			const curClass = this.productInfo[this.classIndex];
-			if (curClass) {
-				return `class_${curClass.classId}`;
-			}
-
-			return "";
-		},
-		//选择商品总价
-		allPrice() {
-			let price = 0;
-
-			if (this.selectList) {
-				for (const item of this.selectList) {
-					const itemInfo = this.getSelectItemById(item.id, item.classId);
-					if (
-						itemInfo &&
-						!this.$util.isEmpty(itemInfo.bigPrice) &&
-						!this.$util.isEmpty(itemInfo.smallPrice)
-					) {
-						price += item.bigCount * Number(itemInfo.bigPrice);
-						price += item.smallCount * Number(itemInfo.smallPrice);
-					}
-				}
-			}
-
-			return Math.round(price * 100) / 100;
-		},
-		//选择商品总数
-		allCount() {
-			// console.log(444444, this.selectList);
-			return this.selectList.length;
-		},
-		/**
-		 * 当前选中商品列表中是否有没有库存的商品
-		 */
-		hasNoStock() {
-			let has = false;
-			if (this.selectList) {
-				for (const item of this.selectList) {
-					const {
-						bigCount,
-						smallCount,
-						bigNum,
-						bigUnit,
-						smallNum,
-						smallUnit,
-						ratio
-					} = item;
-					const ratioNum = Number(ratio);
-					if (
-						Number(bigCount) * ratioNum + Number(smallCount) >
-						Number(bigNum) * ratioNum + Number(smallNum)
-					) {
-						has = true;
-						break;
-					}
-				}
-			}
-			return has;
-		}
+		...mapGetters(["getSelectInfo","getMyShopInfo"]),
 	},
 	methods: {
 		...mapActions(["setSelectInfoByType", "resetSelectInfoByType"]),
 		/**
-		 * 请求商品数据
-		 */
-		async initDataContrapose(extendInfo) {
-			//extendInfo调用时的扩展参数  如  shopId
-			try {
-				let params = {
-					py: this.py,
-					type: this.type
-				};
-				if (extendInfo) {
-					params = { ...params, ...extendInfo };
+			* 请求商品数据
+			*/
+		loadMore(){
+			if(this.isMore){
+				this.page++;
+				let type = this.tabs[this.tabIndex].key == STOCK_TYPE.WARN ? "waring" : "";
+				if(type=="waring"){
+					this.initDataContrapose({ type,shopId: this.shopId});
 				}
-				// const { data } = await getProductDataApi(params);
-				const { data } = await getAllProductDataApi(params);
-				// data.forEach(element => {
-				// 	element.child && element.child.forEach(child => {
-				// 			child.classId = element.classId;
-				// 			child.className = element.className;
-				// 		});
-				// });
-				this.productInfo = data.list;
-				this.classIndex = 0;
-				uni.stopPullDownRefresh();
-			} catch (error) {
-			} finally {
-				uni.hideLoading();
 			}
-		},
-		/**
-		 * 获取当前选中商品总价
-		 */
-		getSelectItemPrice(item) {
-			let price = 0;
-			const { bigCount, smallCount, bigPrice, smallPrice } = item;
-			let sum =
-				Number(bigCount) * Number(bigPrice) +
-				Number(smallCount) * Number(smallPrice);
-			price = Math.round(sum * 100) / 100;
-			return price;
-		},
-		/**
-		 * 通过id获取当前选中的商品信息
-		 */
-		getSelectItemById(id) {
-			let info = {
-				bigCount: 0, //扎数
-				smallCount: 0, //支数
-				autoPrice: 0 //调价价格
-			};
-			const item =
-				this.selectList && this.selectList.find(ele => {
-					return ele.id == id;
-				});
-			if (item) {
-				info = {
-					...item,
-					bigCount: Number(item.bigCount),
-					smallCount: Number(item.smallCount),
-					autoPrice: Number(item.autoPrice)
-				};
-			}
-			return info;
-		},
-		/**
-		 * 通过id获取当前选中的商品类别信息  左边菜单角标  当前选中该类别商品多少件
-		 */
-		getSelectClassById(classId) {
-			let info = {
-				bigCount: 0, //扎数
-				smallCount: 0 //支数
-			};
 
-			const productItem =
-				this.productInfo &&
-				this.productInfo.find(ele => {
-					return ele.classId == classId;
-				});
-			if (productItem && productItem.child) {
-				for (const item of productItem.child) {
-					for (const selectItem of this.selectList) {
-						if (item.id == selectItem.id && item.classId == selectItem.classId) {
-							info.bigCount += Number(selectItem.bigCount);
-							info.smallCount += Number(selectItem.smallCount);
-						}
-					}
-				}
-			}
-			return info;
 		},
-
-		/**
-		 * 添加商品
-		 */
-		addEvent(item) {
-			const list = this.selectList;
-			let has = false;
-			for (let index = 0; index < list.length; index++) {
-				const element = list[index];
-				if (element.id == item.id) {
-					has = true;
-					if (this.isLimit) {
-						if (element.bigCount < item.bigNum) {
-							list[index] = { ...element, bigCount: ++element.bigCount };
-						}
-						//  else if (element.smallCount < item.smallNum) {
-						// 	list[index] = { ...element, smallCount: ++element.smallCount };
-						// }
-					} else {
-						list[index] = { ...element, bigCount: ++element.bigCount };
-					}
-
-					if (this.isLimit) {
-						const { bigCount, smallCount } = list[index];
-						//超过库存时 设置为库存最大值
-						const ratio = Number(item.ratio);
-						if (
-							Number(bigCount) * ratio + Number(smallCount) >
-							Number(item.bigNum) * ratio + Number(item.smallNum)
-						) {
-							list[index].bigCount = Number(item.bigNum);
-							list[index].smallCount = Number(item.smallNum);
-							this.$msg("库存不足");
-						}
-					}
-
-					break;
-				}
-			}
-			if (!has) {
-				let info = {};
-
-				info =
-					this.productInfo && this.productInfo.find(element => {
-						return element.id == item.id;
-					});
-				let params = {
-					...info,
-					bigCount: 1, //扎数
-					smallCount: 0, //支数
-					autoPrice: 0 //调价价格
-				};
-				if (info.bigNum && info.bigNum > 0) {
-					list.push(params);
-				} else {
-					this.$msg("库存不足");
-				}
+		// async initDataContrapose(extendInfo) {
+		async initDataContrapose(extendInfo) {
+			//extendInfo调用时的扩展参数  如  shopId
+			let params = {
+				py: this.py,
+				type: this.type,
+				// showPage: this.offShowPage?'':1,
+				showPage: 1,
+				page: this.page,
+			};
+			if (extendInfo) {
+				params = { ...params, ...extendInfo };
 			}
-
-			this.setSelectInfoByType({ type: this.pageType, info: list });
+			const { data } = await getAllProductDataApi(params);
+			data.list.forEach((ele)=>{
+				this.filterProductInfoContrapose.push(ele);
+			})
+			this.allFilterProductInfoContrapose = this.filterProductInfoContrapose;
+			if(this.filterProductInfoContrapose.length==data.totalNum){this.isMore = false;}
+			this.productInfo = data.list;
+			uni.stopPullDownRefresh();
+			uni.hideLoading();
 		},
-		/**
-		 * 减去商品
-		 */
-		delEvent(item) {
-			const list = this.selectList;
-			let has = false;
-			for (let index = 0; index < list.length; index++) {
-				const element = list[index];
-				if (element.id == item.id && element.classId == item.classId) {
-					has = true;
 
-					if (element.bigCount > 0) {
-						list[index] = { ...element, bigCount: --element.bigCount };
-					} else if (element.smallCount > 0) {
-						list[index] = { ...element, smallCount: 0 };
-					}
 
-					if (this.isLimit) {
-						const { bigCount, smallCount } = list[index];
-						//超过库存时 设置为库存最大值
-						const ratio = Number(item.ratio);
-						if (
-							Number(bigCount) * ratio + Number(smallCount) >
-							Number(item.bigNum) * ratio + Number(item.smallNum)
-						) {
-							list[index].bigCount = Number(item.bigNum);
-							list[index].smallCount = Number(item.smallNum);
-						}
-					}
-					if (element.bigCount == 0 && element.smallCount == 0) {
-						list.splice(index, 1);
-					}
 
-					break;
-				}
-			}
-			if (!has) {
-				let info = { classId: item.classId, id: item.id };
 
-				const classInfo =
-					this.productInfo &&
-					this.productInfo.find(element => {
-						return element.classId == item.classId && element.child;
-					});
-				if (classInfo) {
-					info = classInfo.child.find(ele => {
-						return ele.id == item.id;
-					});
-				}
-				let params = {
-					...info,
-					bigCount: 1, //扎数
-					smallCount: 0, //支数
-					autoPrice: 0 //调价价格
-				};
 
-				list.push(params);
-			}
-			this.setSelectInfoByType({ type: this.pageType, info: list });
-			// this.$forceUpdate();
-		},
-		// /**
-		//  * 删除商品
-		//  */
-		// removeEvent(item) {
-		// 	const list = this.selectList;
-		// 	for (let index = list.length - 1; index >= 0; index--) {
-		// 		const element = list[index];
-		// 		if (element.id == item.id && element.classId == item.classId) {
-		// 			list.splice(index, 1);
-		// 			break;
-		// 		}
-		// 	}
-		// 	this.setSelectInfoByType({ type: this.pageType, info: list });
-		// 	// this.$forceUpdate();
-		// },
 		/**
-		 * 更新商品
-		 */
-		updateItemEvent(item) {
-			const list = this.selectList;
-			for (let index = 0; index < list.length; index++) {
-				const element = list[index];
-				if (element.id == item.id && element.classId == item.classId) {
-					const { bigCount, smallCount } = list[index];
-					//超过库存时 设置为库存最大值
-					const ratio = Number(item.ratio);
-					if (this.isLimit) {
-						if (
-							Number(bigCount) * ratio + Number(smallCount) >
-							Number(item.bigNum) * ratio + Number(item.smallNum)
-						) {
-							list[index].bigCount = Number(item.bigNum);
-							list[index].smallCount = Number(item.smallNum);
-						}
+			* 搜索对应花材
+			*/
+		searchFnContrapose() {
+			let list = copyObject(this.allFilterProductInfoContrapose);
+			if(!this.$util.isEmpty(this.py)){
+				let commonChildList = [];
+				console.log(this.py)
+				list.forEach(ele => {
+					let hasName = ele.itemName && ele.itemName.indexOf(this.py) >= 0;
+					let elePy = (ele.py && ele.py.toLocaleUpperCase()) || "";
+					let hasPy = elePy.indexOf(this.py.toLocaleUpperCase()) >= 0;
+					if (hasName || hasPy) {
+						console.log(ele)
+						commonChildList.push(ele)
 					}
 
-					list[index] = {
-						...element,
-						bigCount: Number(item.bigCount),
-						smallCount: Number(item.smallCount)
-					};
-
-					break;
-				}
-			}
-
-			this.setSelectInfoByType({ type: this.pageType, info: list });
-			// this.$forceUpdate();
-		},
-		/**
-		 * 切换左侧商品类别
-		 */
-		swichClass(e) {
-			let cur = e.currentTarget.dataset.current;
-			if (this.classIndex == cur) {
-				return false;
-			} else {
-				this.classIndex = cur;
+				});
+				// list = this.$util.unique(commonChildList)
+				this.filterProductInfoContrapose = commonChildList;
+			}else{
+				this.filterProductInfoContrapose = this.allFilterProductInfoContrapose;
 			}
-		},
-		/**
-		 * 搜索对应花材
-		 */
-		searchFn() {}
+		}
 	}
 };

+ 20 - 10
hdApp/src/pagesPurchase/ghsProduct.vue

@@ -13,11 +13,11 @@
       </view>
     </view>
 		<view class="input-wrap" >
-			<app-search-module v-model="py" placeholder="请输入关键词,支持拼音首字母搜索" @search="searchFn" />
+			<app-search-module v-model="py" placeholder="请输入关键词,支持拼音首字母搜索" @input="searchFn" />
 		</view>
 		<view class="scroll-middle_bx">
 			<scroll-view scroll-y scroll-with-animation class="tab-view" :scroll-top="scrollTop" >
-				<div v-for="(item, index) in filterProductInfo" :key="index" class="tab-bar-item" :class="[classIndex == index ? 'active' : '']" :data-current="index" @tap.stop="swichClass">
+				<div v-for="(item, index) in filterProductInfo" :key="index" class="tab-bar-item" :class="[classIndex == index ? 'active' : '']" :data-current="index" @tap.stop="swichClass(index)">
 					<text>{{ item.className || "" }}</text>
 					<text class="tag" v-if=" getSelectClassById(item.classId).bigCount > 0 || getSelectClassById(item.classId).smallCount > 0">
 						<text v-if=" getSelectClassById(item.classId).bigCount > 0 || getSelectClassById(item.classId).smallCount > 0 ">
@@ -30,15 +30,14 @@
 				<view style="height: 240rpx"></view>
 				<view class="switchover-unit" @tap="isSmallCount = !isSmallCount">{{isSmallCount?'支':'扎'}}</view>
 			</scroll-view>
-			<scroll-view scroll-y class="right-box" :scroll-into-view="scrollClassId" @scroll="rightScroll">
+<!--			<scroll-view scroll-y class="right-box" :scroll-into-view="scrollClassId" @scroll="rightScroll">-->
+			<scroll-view scroll-y class="right-box" :scroll-into-view="scroll_into_view" scroll-with-animation="true"
+																@scroll="scroll_detail"
+																lower-threshold="100"
+																@scrolltolower="scroll_bottom">
 				<!--内容部分 start -->
 				<block v-if="!$util.isEmpty(filterProductInfo)">
-					<view
-						class="item_list_bx"
-						v-for="(classItem, classIndex) in filterProductInfo"
-						:key="classIndex"
-						:id="`class_${classItem.classId}`"
-					>
+					<view class="item_list_bx selectAll" v-for="(classItem, classIndex) in filterProductInfo" :key="classIndex" :id="`class_${classIndex}`">
 						<view class="item_list_title">
 							{{ classItem.className }}
 						</view>
@@ -191,7 +190,7 @@ export default {
 	onShareAppMessage(res) {
 
 		let ghsShopAdminId = this.option.ghsShopAdminId ? this.option.ghsShopAdminId : 0
-		
+
 		if(this.option.shopId){
 			this.shopId = this.option.shopId
 		}
@@ -227,6 +226,17 @@ export default {
 				}).catch(err => {})
 			}
 		},
+		scroll_detail(options){
+			if(options.detail.scrollTop > 20) {
+				this.myClass = 'fadeOut'
+			} else {
+				this.myClass = 'fadeIn'
+			}
+			//options  为滚动信息。  options.detail.scrollTop  值为相对于scroll-view。
+			if(!uni.getStorageSync("resolve")){
+				this.get_node_details(options);
+			};
+		},
 		rightScroll(e) {
 			if(e.detail.scrollTop > 20) {
 				this.myClass = 'fadeOut'

+ 8 - 18
hdApp/src/pagesStorehouse/inventory/select.vue

@@ -1,16 +1,12 @@
 <template>
 	<view class="billing_box_bg">
 		<view class="input-wrap">
-			<app-search-module
-				v-model="py"
-				placeholder="请输入关键词,支持拼音首字母搜索"
-				@search="searchFn"
-			/>
+			<app-search-module v-model="py" placeholder="请输入关键词,支持拼音首字母搜索" @input="searchFn"/>
 		</view>
 <!--		<app-tabs :tabs="tabs" :currentTab="tabIndex" @change="change" itemWidth="50%" />-->
 		<view class="scroll-middle_bx">
 			<scroll-view scroll-y scroll-with-animation class="tab-view" :scroll-top="scrollTop">
-				<div v-for="(item, index) in filterProductInfo" :key="index" class="tab-bar-item" :class="[classIndex == index ? 'active' : '']" :data-current="index" @tap.stop="swichClass">
+				<div v-for="(item, index) in filterProductInfo" :key="index" class="tab-bar-item" :class="[classIndex == index ? 'active' : '']" :data-current="index" @tap.stop="swichClass(index)">
 					<text>{{ item.className || "" }}</text>
 					<text class="tag" v-if="getSelectClassById(item.classId).bigCount > 0 || getSelectClassById(item.classId).smallCount > 0">
 						<text v-if="getSelectClassById(item.classId).bigCount > 0 || getSelectClassById(item.classId).smallCount > 0">
@@ -24,20 +20,14 @@
 				<view class="switchover-unit" @tap="isSmallCount = !isSmallCount">{{isSmallCount?'支':'扎'}}</view>
 			</scroll-view>
 
-			<scroll-view
-				scroll-y
-				class="right-box"
-				v-if="tabIndex == 0"
-				:scroll-into-view="scrollClassId"
-			>
+<!--			<scroll-view scroll-y class="right-box" v-if="tabIndex == 0" :scroll-into-view="scrollClassId">-->
+				<scroll-view scroll-y class="right-box" v-if="tabIndex == 0" :scroll-into-view="scroll_into_view" scroll-with-animation="true"
+																	@scroll="scroll_detail"
+																	lower-threshold="100"
+																	@scrolltolower="scroll_bottom">
 				<!--内容部分 start -->
 				<block v-if="!$util.isEmpty(filterProductInfo)">
-					<view
-						class="item_list_bx"
-						v-for="(classItem, classIndex) in filterProductInfo"
-						:key="classIndex"
-						:id="`class_${classItem.classId}`"
-					>
+					<view class="item_list_bx selectAll" v-for="(classItem, classIndex) in filterProductInfo" :key="classIndex" :id="`class_${classIndex}`">
 						<view class="item_list_title">
 							{{ classItem.className }}
 						</view>

+ 54 - 44
hdApp/src/pagesStorehouse/stockWarn/manage.vue

@@ -1,26 +1,24 @@
 <template>
 	<view class="billing_box_bg">
-    <app-tabs :tabs="tabs" :currentTab="tabIndex" @change="change" itemWidth="50%"/>
-    <view class="input-wrap">
+		<app-tabs :tabs="tabs" :currentTab="tabIndex" @change="change" itemWidth="50%"/>
+		<view class="input-wrap">
 			<view class="search-bar">
-				<app-search-module
-					v-model="py"
-					placeholder="输入商品名拼音首字母查询"
-					@search="searchFn"
-				/>
+				<app-search-module v-if="tabs[tabIndex].name=='库存预警'" v-model="py" placeholder="输入商品名拼音首字母查询" @input="searchFnContrapose"/>
+				<app-search-module v-else v-model="py" placeholder="输入商品名拼音首字母查询" @input="searchFn"/>
 			</view>
-      <view v-if="loginInfo.switchShop" class="city-select text-line">
+			<view v-if="loginInfo.super" class="city-select text-line">
 				<DorpdownSelect :menuObj.sync="menuObj" :selectItemId.sync="shopId" top="0" @selectSussess="selectSussess"></DorpdownSelect>
 			</view>
 		</view>
+
 		<view v-if="tabs[tabIndex].name=='库存预警'" class="scroll-middle_bx">
 			<!--内容部分 start -->
 			<!--内容部分 start -->
 			<block v-if="!$util.isEmpty(filterProductInfoContrapose)">
-<!--				<view class="item_list_bx" v-for="(classItem, classIndex) in filterProductInfoContrapose" :key="classIndex" :id="`class_${classItem.classId}`">-->
-<!--				</view>-->
-					<!--					<text v-else>当前库存充足</text>-->
-				<view class="item_list_bx" style="width: 100%">
+				<!--				<view class="item_list_bx" v-for="(classItem, classIndex) in filterProductInfoContrapose" :key="classIndex" :id="`class_${classItem.classId}`">-->
+				<!--				</view>-->
+				<!--					<text v-else>当前库存充足</text>-->
+				<scroll-view scroll-y class="item_list_bx" @scrolltolower="loadMore" lower-threshold="100" style="width: 100%">
 					<template v-for="(productItem, productIndex) in filterProductInfoContrapose">
 						<CommodityStock
 							:isPrice="false"
@@ -29,26 +27,32 @@
 							:info="productItem"
 						></CommodityStock>
 					</template>
-				</view>
+				</scroll-view>
 			</block>
+
 			<block v-else>
 				<view style="width: 100%">
-					<app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(filterProductInfoContrapose)"/>
-				</view>
-
+					<app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(filterProductInfoContrapose)"/></view>
 			</block>
 		</view>
+
+
+
 		<view v-else class="scroll-middle_bx">
 			<scroll-view scroll-y scroll-with-animation class="tab-view" :scroll-top="scrollTop">
-				<div v-for="(item, index) in filterProductInfo" :key="index" class="tab-bar-item" :class="[classIndex == index ? 'active' : '']" :data-current="index" @tap.stop="swichClass">
+				<div v-for="(item, index) in filterProductInfo" :key="index" class="tab-bar-item" :class="[classIndex == index ? 'active' : '']" :data-current="index" @tap.stop="swichClass(index)">
 					<text>{{ item.className || "" }}</text>
 				</div>
 			</scroll-view>
-			<scroll-view scroll-y class="right-box" v-if="currentTab == index" :scroll-into-view="scrollClassId">
+			<!--			<scroll-view scroll-y class="right-box" v-if="currentTab == index" :scroll-into-view="scrollClassId">-->
+			<scroll-view scroll-y class="right-box" :scroll-into-view="scroll_into_view" scroll-with-animation="true"
+																@scroll="scroll_detail"
+																lower-threshold="100"
+																@scrolltolower="scroll_bottom">
 				<!--内容部分 start -->
 				<!--内容部分 start -->
 				<block v-if="!$util.isEmpty(filterProductInfo)">
-					<view class="item_list_bx" v-for="(classItem, classIndex) in filterProductInfo" :key="classIndex" :id="`class_${classItem.classId}`">
+					<view class="item_list_bx selectAll" v-for="(classItem, classIndex) in filterProductInfo" :key="classIndex" :id="`class_${classIndex}`">
 						<view class="item_list_title" v-if="!$util.isEmpty(classItem.child)"> {{ classItem.className }}</view>
 						<text v-if="tabs[tabIndex].name=='库存预警'&&$util.isEmpty(classItem.child)">当前库存充足</text>
 						<template v-for="(productItem, productIndex) in classItem.child">
@@ -62,16 +66,15 @@
 					</view>
 				</block>
 				<block v-else>
-					<app-wrapper-empty
-						title="暂无数据"
-						:is-empty="$util.isEmpty(filterProductInfo)"
-					/>
+					<view style="width: 100%">
+						<app-wrapper-empty  title="暂无数据" :is-empty="$util.isEmpty(filterProductInfo)"/>
+					</view>
 				</block>
 				<!--内容部分 end -->
 			</scroll-view>
 		</view>
 		<!-- :maskClosable="false" -->
-    <kd-entrance></kd-entrance>
+		<kd-entrance></kd-entrance>
 	</view>
 </template>
 
@@ -115,13 +118,12 @@ export default {
 		};
 	},
 	computed:{
-		...mapGetters(["getMyShopInfo"]),
+		...mapGetters(["getMyShopInfo","getLoginInfo"]),
 	},
 	onLoad() {
 		let type = this.tabs[this.tabIndex].key == STOCK_TYPE.WARN ? "waring" : "";
 		// 当前门店
 		// this.shopId = this.userInfo.id;
-		console.log('this.getMyShopInfo',this.getMyShopInfo)
 		this.shopId = this.getMyShopInfo.id;
 		if(type=="waring"){
 			this.initDataContrapose({ type, shopId: this.shopId });
@@ -149,28 +151,36 @@ export default {
 				this.tabs[this.tabIndex].key;
 				let type = this.tabs[this.tabIndex].key == STOCK_TYPE.WARN ? "waring" : "";
 				if(type=="waring"){
-					this.initDataContrapose({ type, shopId: this.shopId });
+					this.filterProductInfoContrapose = this.allFilterProductInfoContrapose;
+					uni.hideLoading();
+					// this.initDataContrapose({ type, shopId: this.shopId });
 				}else{
 					this.initData({ type, shopId: this.shopId });
 				}
 			}
 		},
-		searchFn() {
-			uni.showLoading({
-				title: "加载中"
-			});
-			if(type=="waring"){
-				this.initDataContrapose({ type, shopId: this.shopId });
-			}else{
-				this.initData({ type, shopId: this.shopId });
-			}
-			// this.initData({ shopId: this.shopId });
-		},
+		// searchFn() {
+		// 	// uni.showLoading({
+		// 	// 	title: "加载中"
+		// 	// });
+		// 	// if(type=="waring"){
+		// 	// 	this.initDataContrapose({ type, shopId: this.shopId });
+		// 	// }else{
+		// 	// 	this.initData({ type, shopId: this.shopId });
+		// 	// }
+		// 	// this.initData({ shopId: this.shopId });
+		// },
 		scrollTop() {},
+		initProductInfo() {
+			this.filterProductInfoContrapose = [];
+			this.page = 1;
+			this.isMore = true;
+		},
 		selectSussess(val) {
 			uni.showLoading({
 				title: "加载中"
 			});
+			this.initProductInfo();
 			let type = this.tabs[this.tabIndex].key == STOCK_TYPE.WARN ? "waring" : "";
 			this.shopId = val.selectItem.id;
 			// this.initData({ type, shopId: this.shopId });
@@ -244,9 +254,9 @@ export default {
 				color: #fff;
 				font-size: 20px;
 			}
-      &:last-child{
-        margin-bottom: 110upx;
-      }
+			&:last-child{
+				margin-bottom: 110upx;
+			}
 		}
 
 		.active {
@@ -271,9 +281,9 @@ export default {
 	}
 	.item_list_bx {
 		padding: 40px 16px;
-    &:last-child{
-      margin-bottom: 70upx;
-    }
+		//&:last-child{
+		//  margin-bottom: 70upx;
+		//}
 	}
 	.item_list_title {
 		margin-bottom: 20px;