|
|
@@ -1,7 +1,8 @@
|
|
|
<template>
|
|
|
<view class="shop-listType_box">
|
|
|
<view class="cat-list-area">
|
|
|
- <view v-for="item in allCategory" :key="item.id" :class="[currentCategory.id===item.id?'active':'']" @click="changeCategory(item)" > {{item.categoryName}} </view>
|
|
|
+ <view :class="[flower==0?'active':'']" @click="changeKind(0)">绿植花瓶</view>
|
|
|
+ <view :class="[flower==1?'active':'']" @click="changeKind(1)">花束花篮</view>
|
|
|
</view>
|
|
|
<view class="num-area">
|
|
|
<view v-for="info in flowerNumList" :class="[flowerNum===info.num?'selected':'']" @click="setNum(info)" :key="info.num">{{info.name}}</view>
|
|
|
@@ -47,15 +48,12 @@ export default {
|
|
|
mixins: [productMins,list],
|
|
|
data(){
|
|
|
return {
|
|
|
- allCategory:[],
|
|
|
- categoryId: '',
|
|
|
- currentCategory:{},
|
|
|
currentJobType:'bill',
|
|
|
currentJobId:0,
|
|
|
flowerNum:0,
|
|
|
- flower:'',
|
|
|
+ flower:0,
|
|
|
checkStock:true,
|
|
|
- flowerNumList:[{num:0,name:'支数'},{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}]
|
|
|
+ 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}]
|
|
|
}
|
|
|
},
|
|
|
props: {
|
|
|
@@ -74,10 +72,6 @@ export default {
|
|
|
changeCheckStock:{
|
|
|
type:Boolean,
|
|
|
default:true
|
|
|
- },
|
|
|
- changeFlower:{
|
|
|
- type:Number,
|
|
|
- default:1
|
|
|
}
|
|
|
},
|
|
|
created(){
|
|
|
@@ -107,16 +101,6 @@ export default {
|
|
|
this.checkStock = bool
|
|
|
},
|
|
|
immediate:true
|
|
|
- },
|
|
|
- changeFlower:{
|
|
|
- handler(val){
|
|
|
- if(Number(val) == 2){
|
|
|
- this.flower = ''
|
|
|
- }else{
|
|
|
- this.flower = val
|
|
|
- }
|
|
|
- },
|
|
|
- immediate:true
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
@@ -138,16 +122,10 @@ export default {
|
|
|
this.showAddModelFn({ ...info, currentNum: 1, unitPrice: info.price,unitType:0})
|
|
|
},
|
|
|
init(){
|
|
|
- getClass({flower:this.flower}).then(res=>{
|
|
|
- if(res.code == 1){
|
|
|
- this.allCategory = res.data
|
|
|
- this.currentCategory = this.allCategory[0]
|
|
|
- this.getGoodsData()
|
|
|
- }
|
|
|
- })
|
|
|
+ this.getGoodsData()
|
|
|
},
|
|
|
getGoodsData(){
|
|
|
- getGoodsList({cId:this.currentCategory.id,page:this.list.page,pageSize:30,flowerNum:this.flowerNum}).then(res=>{
|
|
|
+ getGoodsList({page:this.list.page,pageSize:30,flowerNum:this.flowerNum,hasStock:1,flower:this.flower}).then(res=>{
|
|
|
if(res.code == 1){
|
|
|
this.completes(res)
|
|
|
}
|
|
|
@@ -158,13 +136,13 @@ export default {
|
|
|
this.getGoodsData()
|
|
|
}
|
|
|
},
|
|
|
- changeCategory(item){
|
|
|
+ changeKind(flower){
|
|
|
this.$util.hitVoice()
|
|
|
+ this.flower = flower
|
|
|
this.list.data=[]
|
|
|
this.list.page = 1
|
|
|
this.list.finished = false
|
|
|
this.flowerNum = 0
|
|
|
- this.currentCategory = item
|
|
|
this.getGoodsData()
|
|
|
}
|
|
|
}
|