shish 2 лет назад
Родитель
Сommit
f047ae0de1

+ 2 - 2
ghsApp/src/admin/billing/index2.vue

@@ -6,7 +6,7 @@
 				<button class="admin-button-com middle blue" @click="selectFlowerNumFn()">图片分类</button>
 			</view>
 			<view class="search-bar">
-				<app-search-module v-model="globalPy" placeholder="这里搜索" @input="globalSearch" />
+				<app-search-module ref="globalSearchRef" v-model="globalPy" placeholder="这里搜索" @input="globalSearch" />
 			</view>
 			<view style="float:right;">
 				<button class="admin-button-com middle blue" @click="removeFromSave(option.customId)">清除花材</button>
@@ -21,7 +21,7 @@
 				</div>
 				<view style="height: 120upx"></view>
 			</scroll-view>
-			<scroll-view scroll-y class="right-box" :scroll-into-view="scroll_into_view" scroll-with-animation="true" lower-threshold="100" @scrolltolower="globalScrollBottom">
+			<scroll-view scroll-y class="right-box" :scroll-top="globalScrollTopPlace" :scroll-into-view="scroll_into_view" scroll-with-animation="true" lower-threshold="100" @scrolltolower="globalScrollBottom">
 				<!--花材列表-->
 				<block v-if="!$util.isEmpty(globalItemData)">
 					<view class="item_list_bx selectAll">

+ 2 - 2
ghsApp/src/admin/item/list2.vue

@@ -6,7 +6,7 @@
 					<button class="admin-button-com middle blue" @click="selectFlowerNumFn()">图片分类</button>
 				</view>
 				<view class="search-bar">
-					<app-search-module v-model="globalPy" placeholder="这里搜索" @input="globalSearch"/>
+					<app-search-module v-model="globalPy" ref="globalSearchRef" placeholder="这里搜索" @input="globalSearch"/>
 				</view>
 				<view style="padding:0 0upx 0 15upx;" >
 					<button class="admin-button-com middle blue" @click="pageTo({ url: '/admin/ptItem/itemList' })">添花材</button>
@@ -18,7 +18,7 @@
 						<text style="text-align: center;">{{ item.name || "" }}</text>
 					</div>
 				</scroll-view>
-				<scroll-view scroll-y class="right-box" :scroll-into-view="scroll_into_view" scroll-with-animation="true"
+				<scroll-view scroll-y class="right-box" :scroll-top="globalScrollTopPlace" :scroll-into-view="scroll_into_view" scroll-with-animation="true"
 					lower-threshold="100" @scrolltolower="globalScrollBottom">
 					<block v-if="!$util.isEmpty(globalItemData)">
 						<view class="item_list_bx selectAll">

+ 11 - 6
ghsApp/src/mixins/product2.js

@@ -35,7 +35,9 @@ export default {
 			globalFinishGetItem:0,
 			globalPage:1,
 			globalPy:'',
-			globalItemData:[]
+			globalItemData:[],
+			globalScrollTopPlace:0,
+			globalScrollTopOldPlace:0
 		};
 	},
 	onLoad(options) {
@@ -198,6 +200,9 @@ export default {
 		globalSwitchClass(cur,item) {
 			this.globalClassIndex = cur
             this.globalPage = 1
+			this.globalPy = ''
+			this.$refs.globalSearchRef.search = ''
+			this.globalScrollTopPlace = 0
             this.globalClassId = item.id
             this.globalFinishGetItem = 0
             this.getGlobalProductList()
@@ -235,16 +240,16 @@ export default {
 			}
 		},
         globalSearch(){
+			this.globalScrollTopPlace = 0
+			this.globalPage = 1
             if(!this.$util.isEmpty(this.globalPy)){
-                this.globalPage = 1
                 this.globalClassIndex = -1
                 this.globalFinishGetItem = 0
                 this.getGlobalProductList()
             }else{
-                this.globalPage = 1
-                this.globalClassIndex = 0
-                this.globalFinishGetItem = 0
-                this.getGlobalProductList()
+                // this.globalClassIndex = 0
+                // this.globalFinishGetItem = 0
+                // this.getGlobalProductList()
             }
         },
 		globalScrollBottom(){