|
|
@@ -23,14 +23,15 @@
|
|
|
|
|
|
<view class="input-wrap">
|
|
|
<view>
|
|
|
- <button class="admin-button-com middle " :class="[searchType == 0 ? 'blue' : 'default']" style="width:100upx;margin-right:8upx;" @click="changeSearchType(0)">名称</button>
|
|
|
- <button class="admin-button-com middle " :class="[searchType == 1 ? 'blue' : 'default']" style="width:100upx;margin-right:8upx;" @click="changeSearchType(1)">编号</button>
|
|
|
+ <button class="admin-button-com middle " :class="[searchType == 0 ? 'blue' : 'default']" style="width:100upx;margin-right:7upx;" @click="changeSearchType(0)">名称</button>
|
|
|
+ <button class="admin-button-com middle " :class="[searchType == 1 ? 'blue' : 'default']" style="width:100upx;margin-right:7upx;" @click="changeSearchType(1)">编号</button>
|
|
|
</view>
|
|
|
<view class="search-bar">
|
|
|
<app-search-module v-model="searchText" placeholder="输入内容" @input="searchFn" />
|
|
|
</view>
|
|
|
<view>
|
|
|
- <button class="admin-button-com middle blue" style="margin-right:8upx;margin-left:8upx;width:100upx;" @click="openFilterPanel">筛选</button>
|
|
|
+ <button class="admin-button-com middle blue" style="margin-right:7upx;margin-left:7upx;width:100upx;" @click="openFilterPanel">筛选</button>
|
|
|
+ <button class="admin-button-com middle blue" style="margin-right:7upx;width:100upx;" @click="rank">排序</button>
|
|
|
<button class="admin-button-com middle blue" style="width:100upx;" @click="addGoods()">新增</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -200,6 +201,7 @@ export default {
|
|
|
currentTab: 0,
|
|
|
scrollTop: 0,
|
|
|
catId: "",
|
|
|
+ catName:"",
|
|
|
flowerNum:0,
|
|
|
searchText:'',
|
|
|
searchType:0,
|
|
|
@@ -261,7 +263,11 @@ export default {
|
|
|
init(){
|
|
|
this.getCategoryData()
|
|
|
},
|
|
|
-
|
|
|
+ rank(){
|
|
|
+ if(Number(this.catId)>0){
|
|
|
+ this.$util.pageTo({url: "/admin/goods/goodsSort?id="+this.catId+"&name="+this.catName})
|
|
|
+ }
|
|
|
+ },
|
|
|
// 新的筛选相关方法
|
|
|
openFilterPanel() {
|
|
|
this.showFilterPanel = true;
|
|
|
@@ -367,10 +373,11 @@ export default {
|
|
|
this.$util.pageTo({ url: "/admin/goods/detail", query: { id: id } })
|
|
|
},
|
|
|
getCategoryData() {
|
|
|
- categoryListInfo({flower:1}).then(res => {
|
|
|
+ categoryListInfo().then(res => {
|
|
|
this.tabbar = res.data;
|
|
|
if(this.tabbar && this.tabbar[0] && this.tabbar[0].id){
|
|
|
this.catId = this.tabbar[0].id
|
|
|
+ this.catName = this.tabbar[0].categoryName
|
|
|
this.getGoodsList()
|
|
|
}
|
|
|
})
|
|
|
@@ -409,6 +416,7 @@ export default {
|
|
|
this.searchTimer = setTimeout(() => {
|
|
|
this.lastSearchText = this.searchText;
|
|
|
this.catId = 0
|
|
|
+ this.catName = ""
|
|
|
this.currentTab = 0
|
|
|
this.resetList()
|
|
|
this.getGoodsList()
|
|
|
@@ -427,6 +435,7 @@ export default {
|
|
|
} else {
|
|
|
this.currentTab = cur;
|
|
|
this.catId = item.id;
|
|
|
+ this.catName = item.categoryName
|
|
|
this.resetList();
|
|
|
this.getGoodsList();
|
|
|
}
|