|
@@ -4,11 +4,14 @@
|
|
|
<block v-if="!$util.isEmpty(list.data)">
|
|
<block v-if="!$util.isEmpty(list.data)">
|
|
|
<view class="list" v-for="(item, index) in list.data" :key="index">
|
|
<view class="list" v-for="(item, index) in list.data" :key="index">
|
|
|
<view class="list-img">
|
|
<view class="list-img">
|
|
|
- <image :src="item.img" mode="aspectFit" ></image>
|
|
|
|
|
|
|
+ <image :src="`${constant.imgUrl}/default-img.png`" mode="aspectFit" ></image>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="list-det" @click="edit(item)">
|
|
<view class="list-det" @click="edit(item)">
|
|
|
- <view class="app-size-28 app-color-0">{{ item.name}}</view>
|
|
|
|
|
- <view><text style="color:green;" v-if="item.status == 1">启用</text><text v-else>停用</text></view>
|
|
|
|
|
|
|
+ <view class="app-size-28 app-color-0" style="font-size:35upx;">{{ item.name}}</view>
|
|
|
|
|
+ <view style="color:green;position:relative;">
|
|
|
|
|
+ <text v-if="item.status == 1" style="position:absolute;top:20upx;">启用</text>
|
|
|
|
|
+ <text v-else style="position:absolute;top:20upx;">停用</text>
|
|
|
|
|
+ </view>
|
|
|
<view class="list-operate">
|
|
<view class="list-operate">
|
|
|
<view class="operate-det">
|
|
<view class="operate-det">
|
|
|
<span @click.stop="delKind(item.id)">删除</span>
|
|
<span @click.stop="delKind(item.id)">删除</span>
|
|
@@ -33,7 +36,7 @@
|
|
|
<view class="inp-list-line">
|
|
<view class="inp-list-line">
|
|
|
<view class="line-label">名称</view>
|
|
<view class="line-label">名称</view>
|
|
|
<view class="line-input">
|
|
<view class="line-input">
|
|
|
- <input type="text" v-model="modifyForm.categoryName" :adjust-position="false" class="inp-input" placeholder="请填写" />
|
|
|
|
|
|
|
+ <input type="text" v-model="modifyForm.name" :adjust-position="false" class="inp-input" placeholder="请填写" />
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="inp-list-line">
|
|
<view class="inp-list-line">
|
|
@@ -48,7 +51,7 @@
|
|
|
<view class="line-input">
|
|
<view class="line-input">
|
|
|
|
|
|
|
|
<radio-group @change="radioChange">
|
|
<radio-group @change="radioChange">
|
|
|
- <label style="display:inline-block;font-size:28upx;" :for="item.flag" v-for="(item, index) in catItem" :key="index">
|
|
|
|
|
|
|
+ <label style="display:inline-block;font-size:30upx;" :for="item.flag" v-for="(item, index) in catItem" :key="index">
|
|
|
<radio :id="item.flag" :value="item.value" :checked="Number(item.value) == Number(flower)" :disabled="catDisabled" style="transform: scale(0.7,0.7);" />{{item.name}}
|
|
<radio :id="item.flag" :value="item.value" :checked="Number(item.value) == Number(flower)" :disabled="catDisabled" style="transform: scale(0.7,0.7);" />{{item.name}}
|
|
|
</label>
|
|
</label>
|
|
|
</radio-group>
|
|
</radio-group>
|
|
@@ -66,7 +69,7 @@ import AppUploader from '@/components/app-uploader'
|
|
|
import OperateModule from '@/admin/home/components/module/operate'
|
|
import OperateModule from '@/admin/home/components/module/operate'
|
|
|
import AppWrapperEmpty from '@/components/app-wrapper-empty'
|
|
import AppWrapperEmpty from '@/components/app-wrapper-empty'
|
|
|
import { list } from '@/mixins'
|
|
import { list } from '@/mixins'
|
|
|
-import { categoryStatusB, categoryAddB, categoryUpdateB, categoryDelB } from '@/api/goods'
|
|
|
|
|
|
|
+import { categoryStatusB, addKind, updateKind, categoryDelB } from '@/api/goods'
|
|
|
import { getKindList } from '@/api/kind'
|
|
import { getKindList } from '@/api/kind'
|
|
|
export default {
|
|
export default {
|
|
|
name: 'kind',
|
|
name: 'kind',
|
|
@@ -82,8 +85,8 @@ export default {
|
|
|
modifyModal: false,
|
|
modifyModal: false,
|
|
|
modifyTitle: '添加',
|
|
modifyTitle: '添加',
|
|
|
modifyForm: {
|
|
modifyForm: {
|
|
|
- categoryId:0,
|
|
|
|
|
- categoryName: '',
|
|
|
|
|
|
|
+ kindId:0,
|
|
|
|
|
+ name: '',
|
|
|
inTurn: '',
|
|
inTurn: '',
|
|
|
status: 1
|
|
status: 1
|
|
|
},
|
|
},
|
|
@@ -139,7 +142,7 @@ export default {
|
|
|
edit(item){
|
|
edit(item){
|
|
|
this.modifyModal = true
|
|
this.modifyModal = true
|
|
|
this.modifyTitle = '编辑'
|
|
this.modifyTitle = '编辑'
|
|
|
- this.modifyForm = { categoryId:item.id, categoryName: item.categoryName, inTurn: item.inTurn }
|
|
|
|
|
|
|
+ this.modifyForm = { kindId:item.id, name: item.name, inTurn: item.inTurn }
|
|
|
this.flower = parseInt(item.flower)
|
|
this.flower = parseInt(item.flower)
|
|
|
this.catDisabled = true
|
|
this.catDisabled = true
|
|
|
},
|
|
},
|
|
@@ -150,7 +153,7 @@ export default {
|
|
|
this.catDisabled = false
|
|
this.catDisabled = false
|
|
|
},
|
|
},
|
|
|
resetForm() {
|
|
resetForm() {
|
|
|
- this.modifyForm = {categoryId:0, categoryName: '', inTurn: '', status: 1 }
|
|
|
|
|
|
|
+ this.modifyForm = {kindId:0, name: '', inTurn: '', status: 1 }
|
|
|
this.flower = 2
|
|
this.flower = 2
|
|
|
},
|
|
},
|
|
|
async init() {
|
|
async init() {
|
|
@@ -163,14 +166,14 @@ export default {
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
kindAddOrEdit() {
|
|
kindAddOrEdit() {
|
|
|
- if (!this.modifyForm.categoryName) {
|
|
|
|
|
|
|
+ if (!this.modifyForm.name) {
|
|
|
this.$msg('请输入种类名称')
|
|
this.$msg('请输入种类名称')
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
let form = JSON.parse(JSON.stringify(this.modifyForm))
|
|
let form = JSON.parse(JSON.stringify(this.modifyForm))
|
|
|
- let host = categoryAddB
|
|
|
|
|
- if(form.categoryId && form.categoryId > 0){
|
|
|
|
|
- host = categoryUpdateB
|
|
|
|
|
|
|
+ let host = addKind
|
|
|
|
|
+ if(form.kindId && Number(form.kindId) > 0){
|
|
|
|
|
+ host = updateKind
|
|
|
}
|
|
}
|
|
|
if(Number(this.flower) == 2){
|
|
if(Number(this.flower) == 2){
|
|
|
this.$msg('请选择属性')
|
|
this.$msg('请选择属性')
|
|
@@ -250,14 +253,14 @@ export default {
|
|
|
width:480upx;
|
|
width:480upx;
|
|
|
@include disFlex(center, space-between);
|
|
@include disFlex(center, space-between);
|
|
|
.operate-det {
|
|
.operate-det {
|
|
|
- width:480upx;
|
|
|
|
|
- padding-left:100upx;
|
|
|
|
|
|
|
+ width:auto;
|
|
|
|
|
+ padding-left:150upx;
|
|
|
& > span {
|
|
& > span {
|
|
|
border:1px solid #ccc;
|
|
border:1px solid #ccc;
|
|
|
border-radius:25upx;
|
|
border-radius:25upx;
|
|
|
padding:5upx 20upx 5upx 20upx;
|
|
padding:5upx 20upx 5upx 20upx;
|
|
|
font-size:25upx;
|
|
font-size:25upx;
|
|
|
- margin-left:35upx;
|
|
|
|
|
|
|
+ margin-left:70upx;
|
|
|
&:first-child {
|
|
&:first-child {
|
|
|
margin-left: 0;
|
|
margin-left: 0;
|
|
|
}
|
|
}
|