Просмотр исходного кода

采购页面搜索功能、改价页面搜索功能优化

jf 5 лет назад
Родитель
Сommit
7912b43cb1
2 измененных файлов с 15 добавлено и 47 удалено
  1. 2 1
      ghsApp/src/mixins/productContrapose.js
  2. 13 46
      ghsApp/src/pagesPurchase/add.vue

+ 2 - 1
ghsApp/src/mixins/productContrapose.js

@@ -81,9 +81,10 @@ export default {
 		 * 搜索对应花材
 		 */
 		searchFnContrapose() {
-			let list = copyObject(this.filterProductInfoContrapose);
+			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()) || "";

+ 13 - 46
ghsApp/src/pagesPurchase/add.vue

@@ -1,62 +1,30 @@
 <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>
 
 		<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"
-				>
+			<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(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
-							"
-						>
+					<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">
 							{{ `${getSelectClassById(item.classId).bigCount}` }}
 						</text>
-						<text v-if="getSelectClassById(item.classId).smallCount > 0">
-							/
-						</text>
-						<text v-if="getSelectClassById(item.classId).smallCount > 0">{{
-							getSelectClassById(item.classId).smallCount
-						}}</text>
+						<text v-if="getSelectClassById(item.classId).smallCount > 0">/</text>
+						<text v-if="getSelectClassById(item.classId).smallCount > 0">{{getSelectClassById(item.classId).smallCount}}</text>
 					</text>
 				</div>
 			</scroll-view>
-			<scroll-view scroll-y class="right-box" :scroll-into-view="scrollClassId">
+<!--			<scroll-view scroll-y class="right-box" :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 -->
 				<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>
@@ -279,7 +247,6 @@ export default {
 			}
 		},
 
-		searchFn() {},
 		scrollTop() {}
 	}
 };