|
|
@@ -6,13 +6,14 @@
|
|
|
<app-search-module v-model="py" placeholder="输入英文字母搜索" @input="searchFn" />
|
|
|
</view>
|
|
|
<view style="float:right">
|
|
|
+ <button class="admin-button-com middle blue" style="margin-right:10upx;" @click="selectFlowerNumFn()">支数</button>
|
|
|
<button class="admin-button-com middle blue" style="margin-right:10upx;" @click="clearSelect()">清除已选</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<view class="app-middle">
|
|
|
<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="changeCat($event ,item)" >
|
|
|
<text>{{item.categoryName || ''}}</text>
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
@@ -50,6 +51,18 @@
|
|
|
|
|
|
<FooterCart :price="allPrice" :count="allCount" @confirm="confirmToSave" :showPrice="false" ></FooterCart>
|
|
|
|
|
|
+ <!--选择支数 -->
|
|
|
+ <uni-popup ref="selectFlowerNumRef" background-color="#fff" type="center" :animation="false">
|
|
|
+ <view style="display:flex;padding:20upx;height:25vh;justify-content: space-between;align-items:center;flex-wrap:wrap;">
|
|
|
+
|
|
|
+ <text v-for="(item, index) in flowerNumList" :key="index" @click="selectFlowerNum(item.num)"
|
|
|
+ style="margin-left:25upx;border:1upx solid #999999;width:100upx;height:100upx;border-radius:20upx;justify-content:center;align-items:center;display:flex;">
|
|
|
+ {{item.name}}
|
|
|
+ </text>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ </uni-popup>
|
|
|
+
|
|
|
</view>
|
|
|
</template>
|
|
|
<script>
|
|
|
@@ -58,7 +71,7 @@ import OperateModule from "@/admin/home/components/module/operate";
|
|
|
import AppWrapperEmpty from "@/components/app-wrapper-empty";
|
|
|
import ModalModule from "@/components/plugin/modal";
|
|
|
import flowerItem from "./components/flower-item";
|
|
|
-import {categoryListB,getCategoryGoodsB,changeStatusB} from "@/api/goods";
|
|
|
+import {categoryListB,getCategoryGoodsB} from "@/api/goods";
|
|
|
import FooterCart from "@/components/module/app-footer-cg-plant-cart";
|
|
|
import { list } from "@/mixins";
|
|
|
import productMins from "@/mixins/cgPlantProduct";
|
|
|
@@ -80,15 +93,15 @@ export default {
|
|
|
height: 0,
|
|
|
currentTab: 0,
|
|
|
scrollTop: 0,
|
|
|
- form: {
|
|
|
- catId: ""
|
|
|
- },
|
|
|
+ catId: "",
|
|
|
delModal: false,
|
|
|
operateData: {},
|
|
|
operateShow: false,
|
|
|
operateIndex: null,
|
|
|
operateTop: 0,
|
|
|
- checkStock:false
|
|
|
+ checkStock:false,
|
|
|
+ flowerNum:0,
|
|
|
+ flowerNumList:[{num:6,name:6},{num:9,name:9},{num:11,name:11},{num:19,name:19},{num:33,name:33},{num:52,name:52},{num:66,name:66},{num:99,name:99},{num:0,name:'取消'}]
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -97,6 +110,15 @@ export default {
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
+ selectFlowerNumFn(){
|
|
|
+ this.$refs.selectFlowerNumRef.open('top')
|
|
|
+ },
|
|
|
+ selectFlowerNum(num){
|
|
|
+ this.$refs.selectFlowerNumRef.close()
|
|
|
+ this.flowerNum = num
|
|
|
+ this.resetList()
|
|
|
+ this.getPlantList()
|
|
|
+ },
|
|
|
clearSelect(){
|
|
|
let that = this
|
|
|
that.$util.confirmModal({content:'确认清除?'},() => {
|
|
|
@@ -129,35 +151,26 @@ export default {
|
|
|
categoryListB({flower:1}).then(res => {
|
|
|
this.tabbar = res.data;
|
|
|
if(this.tabbar && this.tabbar[0] && this.tabbar[0].id){
|
|
|
- this.form.catId = this.tabbar[0].id
|
|
|
+ this.catId = this.tabbar[0].id
|
|
|
this.getPlantList()
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
getPlantList() {
|
|
|
- return getCategoryGoodsB({status:1,page:this.list.page,...this.form,flower:1}).then(res => {
|
|
|
+ return getCategoryGoodsB({status:1,page:this.list.page,catId:this.catId,flower:1,flowerNum:this.flowerNum}).then(res => {
|
|
|
this.completes(res)
|
|
|
})
|
|
|
},
|
|
|
- swichTab(e, item) {
|
|
|
+ changeCat(e, item) {
|
|
|
let cur = e.currentTarget.dataset.current;
|
|
|
if (this.currentTab == cur) {
|
|
|
return false;
|
|
|
} else {
|
|
|
this.currentTab = cur;
|
|
|
- this.form.catId = item.id;
|
|
|
+ this.catId = item.id;
|
|
|
this.resetList();
|
|
|
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
|
|
|
- }
|
|
|
- });
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
@@ -253,7 +266,7 @@ page {
|
|
|
padding: 22upx 20upx 22upx 30upx;
|
|
|
.search-bar {
|
|
|
display:inline-block;
|
|
|
- width:520upx;
|
|
|
+ width:416upx;
|
|
|
}
|
|
|
}
|
|
|
.select-cmd_bx {
|