|
@@ -2,16 +2,16 @@
|
|
|
<view class="app-content">
|
|
<view class="app-content">
|
|
|
<view class="input-wrap" >
|
|
<view class="input-wrap" >
|
|
|
<view class="search-bar">
|
|
<view class="search-bar">
|
|
|
- <app-search-module v-model="py" placeholder="输入拼音首字母搜索" @input="searchFn" />
|
|
|
|
|
|
|
+ <app-search-module v-model="searchText" placeholder="输入拼音首字母搜索" @input="searchFn()" />
|
|
|
</view>
|
|
</view>
|
|
|
<view style="padding:0 0upx 0 15upx;" >
|
|
<view style="padding:0 0upx 0 15upx;" >
|
|
|
- <button class="admin-button-com middle blue" style="margin-right:10upx;" @click="clearSelect()">清除已选</button>
|
|
|
|
|
|
|
+ <button class="admin-button-com middle blue" @click="clearSelect()">清除已选</button>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="app-middle">
|
|
<view class="app-middle">
|
|
|
<scroll-view scroll-y scroll-with-animation class="tab-view" :scroll-top="scrollTop">
|
|
<scroll-view scroll-y scroll-with-animation class="tab-view" :scroll-top="scrollTop">
|
|
|
- <view v-for="(item,index) in tabbar" :key="index" class="tab-bar-item" :class="[currentTab==index ? 'active' : '']" :data-current="index" @tap.stop="swichTab($event ,item)" >
|
|
|
|
|
|
|
+ <view v-for="(item,index) in tabbar" :key="index" class="tab-bar-item" :class="[currentTab==index ? 'active' : '']" :data-current="index" @tap.stop="changeClass($event ,item)" >
|
|
|
<text>{{item.categoryName || ''}}</text>
|
|
<text>{{item.categoryName || ''}}</text>
|
|
|
</view>
|
|
</view>
|
|
|
</scroll-view>
|
|
</scroll-view>
|
|
@@ -63,7 +63,7 @@ import OperateModule from "@/admin/home/components/module/operate";
|
|
|
import AppWrapperEmpty from "@/components/app-wrapper-empty";
|
|
import AppWrapperEmpty from "@/components/app-wrapper-empty";
|
|
|
import ModalModule from "@/components/plugin/modal";
|
|
import ModalModule from "@/components/plugin/modal";
|
|
|
import PlantItem from "./components/plant-item";
|
|
import PlantItem from "./components/plant-item";
|
|
|
-import {categoryListB,getCategoryGoodsB,changeStatusB} from "@/api/goods";
|
|
|
|
|
|
|
+import {categoryListInfo,getCategoryToGoods} from "@/api/goods";
|
|
|
import FooterCart from "@/components/module/app-footer-cg-plant-cart";
|
|
import FooterCart from "@/components/module/app-footer-cg-plant-cart";
|
|
|
import { list } from "@/mixins";
|
|
import { list } from "@/mixins";
|
|
|
import productMins from "@/mixins/cgPlantProduct";
|
|
import productMins from "@/mixins/cgPlantProduct";
|
|
@@ -93,7 +93,8 @@ export default {
|
|
|
operateShow: false,
|
|
operateShow: false,
|
|
|
operateIndex: null,
|
|
operateIndex: null,
|
|
|
operateTop: 0,
|
|
operateTop: 0,
|
|
|
- checkStock:false
|
|
|
|
|
|
|
+ checkStock:false,
|
|
|
|
|
+ searchText:''
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
@@ -110,6 +111,16 @@ export default {
|
|
|
}
|
|
}
|
|
|
this.$util.pageTo({url:"/admin/goods/plantConfirm",type:2})
|
|
this.$util.pageTo({url:"/admin/goods/plantConfirm",type:2})
|
|
|
},
|
|
},
|
|
|
|
|
+ searchFn(){
|
|
|
|
|
+ if (this.$util.isEmpty(this.searchText)){
|
|
|
|
|
+
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.form.catId = 0
|
|
|
|
|
+ getCategoryToGoods({status:'',page:this.list.page,...this.form,flower:0,searchText:this.searchText}).then(res => {
|
|
|
|
|
+ this.completes(res)
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
goBottom(){
|
|
goBottom(){
|
|
|
if (!this.list.finished) {
|
|
if (!this.list.finished) {
|
|
|
this.getPlantList().then((res) => {
|
|
this.getPlantList().then((res) => {
|
|
@@ -126,7 +137,7 @@ export default {
|
|
|
this.getPlantClass()
|
|
this.getPlantClass()
|
|
|
},
|
|
},
|
|
|
getPlantClass() {
|
|
getPlantClass() {
|
|
|
- categoryListB({flower:0}).then(res => {
|
|
|
|
|
|
|
+ categoryListInfo({flower:0}).then(res => {
|
|
|
this.tabbar = res.data;
|
|
this.tabbar = res.data;
|
|
|
if(this.tabbar && this.tabbar[0] && this.tabbar[0].id){
|
|
if(this.tabbar && this.tabbar[0] && this.tabbar[0].id){
|
|
|
this.form.catId = this.tabbar[0].id
|
|
this.form.catId = this.tabbar[0].id
|
|
@@ -135,29 +146,18 @@ export default {
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
getPlantList() {
|
|
getPlantList() {
|
|
|
- return getCategoryGoodsB({status:'',page:this.list.page,...this.form,flower:0}).then(res => {
|
|
|
|
|
|
|
+ return getCategoryToGoods({status:'',page:this.list.page,...this.form,flower:0,searchText:this.searchText}).then(res => {
|
|
|
this.completes(res)
|
|
this.completes(res)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- swichTab(e, item) {
|
|
|
|
|
|
|
+ changeClass(e, item) {
|
|
|
let cur = e.currentTarget.dataset.current;
|
|
let cur = e.currentTarget.dataset.current;
|
|
|
- if (this.currentTab == cur) {
|
|
|
|
|
- return false;
|
|
|
|
|
- } else {
|
|
|
|
|
|
|
+ if (this.currentTab != cur) {
|
|
|
this.currentTab = cur;
|
|
this.currentTab = cur;
|
|
|
this.form.catId = item.id;
|
|
this.form.catId = item.id;
|
|
|
this.resetList();
|
|
this.resetList();
|
|
|
this.getPlantList();
|
|
this.getPlantList();
|
|
|
}
|
|
}
|
|
|
- },
|
|
|
|
|
- changeStatus(item) {
|
|
|
|
|
- let status = item.status == 0 ? 1 : 0
|
|
|
|
|
- changeStatusB({id: item.id,status: status}).then(res => {
|
|
|
|
|
- if(res.code == 1){
|
|
|
|
|
- this.$msg("修改成功")
|
|
|
|
|
- item.status = status
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
@@ -251,7 +251,7 @@ page {
|
|
|
}
|
|
}
|
|
|
.input-wrap {
|
|
.input-wrap {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
- padding: 22upx 20upx 22upx 13upx;
|
|
|
|
|
|
|
+ padding: 22upx 20upx 10upx 13upx;
|
|
|
.search-bar {
|
|
.search-bar {
|
|
|
flex: 1;
|
|
flex: 1;
|
|
|
}
|
|
}
|