|
|
@@ -1,5 +1,10 @@
|
|
|
<template>
|
|
|
<view class="ghs_list_page flex-col">
|
|
|
+ <view class="search-wrap">
|
|
|
+ <view class="search-inner">
|
|
|
+ <AppSearchModule placeholder="搜索批发店" @input="searchFn" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
<template v-if="!$util.isEmpty(list.data)">
|
|
|
<view class="ghs_list_area flex-col justify-end">
|
|
|
|
|
|
@@ -42,16 +47,19 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import emptyComponent from "@/components/empty";
|
|
|
+import AppSearchModule from "@/components/module/app-search";
|
|
|
import { ghsList } from "@/api/purchase";
|
|
|
import { changeDelStatus } from "@/api/ghs";
|
|
|
import { list } from "@/mixins";
|
|
|
export default {
|
|
|
components: {
|
|
|
- emptyComponent
|
|
|
+ emptyComponent,
|
|
|
+ AppSearchModule
|
|
|
},
|
|
|
mixins: [list],
|
|
|
data () {
|
|
|
return {
|
|
|
+ seekVal: ''
|
|
|
}
|
|
|
},
|
|
|
onReachBottom () {
|
|
|
@@ -64,6 +72,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
onPullDownRefresh() {
|
|
|
+ this.resetList()
|
|
|
this.getGhsList().then(res => {
|
|
|
uni.stopPullDownRefresh();
|
|
|
})
|
|
|
@@ -96,8 +105,20 @@ export default {
|
|
|
init() {
|
|
|
this.getGhsList()
|
|
|
},
|
|
|
+ searchFn(e) {
|
|
|
+ const keyword = (e || '').trim()
|
|
|
+ if (!keyword) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (keyword === this.seekVal) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.seekVal = keyword
|
|
|
+ this.resetList()
|
|
|
+ this.getGhsList()
|
|
|
+ },
|
|
|
getGhsList () {
|
|
|
- return ghsList({delStatus:1,page: this.list.page}).then(res => {
|
|
|
+ return ghsList({ delStatus: 1, page: this.list.page, name: this.seekVal || '' }).then(res => {
|
|
|
this.completes(res)
|
|
|
})
|
|
|
},
|
|
|
@@ -114,8 +135,33 @@ export default {
|
|
|
.ghs_list_page {
|
|
|
background-color: rgba(255, 255, 255, 1);
|
|
|
position: relative;
|
|
|
- width: 750upx;
|
|
|
+ width: 750upx;
|
|
|
+ padding-top: 100upx;
|
|
|
overflow: hidden;
|
|
|
+
|
|
|
+ .search-wrap {
|
|
|
+ position: fixed;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ z-index: 10;
|
|
|
+ width: 750upx;
|
|
|
+ height: 100upx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding: 0 24upx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ background: #fff;
|
|
|
+ box-shadow: 0 2upx 8upx rgba(0, 0, 0, 0.06);
|
|
|
+ }
|
|
|
+
|
|
|
+ .search-inner {
|
|
|
+ width: 100%;
|
|
|
+ flex: 1;
|
|
|
+
|
|
|
+ ::v-deep .app-search-module {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
.flex-col {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|