shish 2 ani în urmă
părinte
comite
96d451bf9e

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

@@ -21,7 +21,7 @@
 				</div>
 				</div>
 				<view style="height: 120upx"></view>
 				<view style="height: 120upx"></view>
 			</scroll-view>
 			</scroll-view>
-			<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">
+			<scroll-view scroll-y class="right-box" :scroll-top="globalScrollTopPlace" @scroll="globalGetScroll" :scroll-into-view="scroll_into_view" scroll-with-animation="true" lower-threshold="100" @scrolltolower="globalScrollBottom">
 				<!--花材列表-->
 				<!--花材列表-->
 				<block v-if="!$util.isEmpty(globalItemData)">
 				<block v-if="!$util.isEmpty(globalItemData)">
 					<view class="item_list_bx selectAll">
 					<view class="item_list_bx selectAll">

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

@@ -18,7 +18,7 @@
 						<text style="text-align: center;">{{ item.name || "" }}</text>
 						<text style="text-align: center;">{{ item.name || "" }}</text>
 					</div>
 					</div>
 				</scroll-view>
 				</scroll-view>
-				<scroll-view scroll-y class="right-box" :scroll-top="globalScrollTopPlace" :scroll-into-view="scroll_into_view" scroll-with-animation="true"
+				<scroll-view scroll-y class="right-box" :scroll-top="globalScrollTopPlace" @scroll="globalGetScroll" :scroll-into-view="scroll_into_view" scroll-with-animation="true"
 					lower-threshold="100" @scrolltolower="globalScrollBottom">
 					lower-threshold="100" @scrolltolower="globalScrollBottom">
 					<block v-if="!$util.isEmpty(globalItemData)">
 					<block v-if="!$util.isEmpty(globalItemData)">
 						<view class="item_list_bx selectAll">
 						<view class="item_list_bx selectAll">

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

@@ -198,11 +198,11 @@ export default {
 			}
 			}
 		},
 		},
 		globalSwitchClass(cur,item) {
 		globalSwitchClass(cur,item) {
+			this.globalGoToTop()
 			this.globalClassIndex = cur
 			this.globalClassIndex = cur
             this.globalPage = 1
             this.globalPage = 1
 			this.globalPy = ''
 			this.globalPy = ''
 			this.$refs.globalSearchRef.search = ''
 			this.$refs.globalSearchRef.search = ''
-			this.globalScrollTopPlace = 0
             this.globalClassId = item.id
             this.globalClassId = item.id
             this.globalFinishGetItem = 0
             this.globalFinishGetItem = 0
             this.getGlobalProductList()
             this.getGlobalProductList()
@@ -240,18 +240,24 @@ export default {
 			}
 			}
 		},
 		},
         globalSearch(){
         globalSearch(){
-			this.globalScrollTopPlace = 0
 			this.globalPage = 1
 			this.globalPage = 1
             if(!this.$util.isEmpty(this.globalPy)){
             if(!this.$util.isEmpty(this.globalPy)){
+				this.globalGoToTop()
                 this.globalClassIndex = -1
                 this.globalClassIndex = -1
                 this.globalFinishGetItem = 0
                 this.globalFinishGetItem = 0
                 this.getGlobalProductList()
                 this.getGlobalProductList()
-            }else{
-                // this.globalClassIndex = 0
-                // this.globalFinishGetItem = 0
-                // this.getGlobalProductList()
             }
             }
         },
         },
+		globalGoToTop(){
+			let that = this
+			this.globalScrollTopPlace = this.globalScrollTopOldPlace
+			this.$nextTick(()=>{
+				that.globalScrollTopPlace = 0
+			})
+		},
+		globalGetScroll(event){
+			this.globalScrollTopOldPlace = event.detail.scrollTop
+		},
 		globalScrollBottom(){
 		globalScrollBottom(){
             this.getGlobalProductList()
             this.getGlobalProductList()
         },
         },