修改删除分类弹窗
This commit is contained in:
@@ -207,14 +207,15 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
<uni-forms-item label="分类名称" required name="name">
|
<uni-forms-item label="分类名称" required name="name">
|
||||||
<uni-easyinput padding-none :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
<uni-easyinput padding-none :placeholderStyle="placeholderStyle"
|
||||||
v-model="categoryChild.name" placeholder="输入分类名称" />
|
:inputBorder="inputBorder" v-model="categoryChild.name" placeholder="输入分类名称" />
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
</view>
|
</view>
|
||||||
<template v-if="option.type==='edit'">
|
<template v-if="option.type==='edit'">
|
||||||
<uni-forms-item label="排序" required name="sort">
|
<uni-forms-item label="排序" required name="sort">
|
||||||
<uni-easyinput padding-none :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
<uni-easyinput padding-none :placeholderStyle="placeholderStyle"
|
||||||
v-model="categoryChild.sort" type="number" placeholder="排序越小越靠前" />
|
:inputBorder="inputBorder" v-model="categoryChild.sort" type="number"
|
||||||
|
placeholder="排序越小越靠前" />
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
</template>
|
</template>
|
||||||
<uni-forms-item label="">
|
<uni-forms-item label="">
|
||||||
@@ -241,9 +242,11 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</my-model>
|
</my-model>
|
||||||
|
|
||||||
|
<up-modal title="提示" content="确认删除该分类吗?" :show="modal.del" showCancelButton closeOnClickOverlay
|
||||||
|
@confirm="confirmModelConfirm" @cancel="setModalShow('del',false)" @close="setModalShow('del',false)"
|
||||||
|
width="300px"></up-modal>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@@ -269,7 +272,28 @@
|
|||||||
onBeforeMount,
|
onBeforeMount,
|
||||||
watch
|
watch
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
|
const modal = reactive({
|
||||||
|
key: '',
|
||||||
|
del: false
|
||||||
|
})
|
||||||
|
|
||||||
|
function confirmModelConfirm() {
|
||||||
|
if (modal.key == 'del') {
|
||||||
|
$productCategory.del([selItem.data.id]).then(res => {
|
||||||
|
category.childrenList.splice(selItem.index, 1)
|
||||||
|
infoBox.showToast('删除成功')
|
||||||
|
uni.setStorageSync('cateItem', category)
|
||||||
|
})
|
||||||
|
modal.del=false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function setModalShow(key = 'show', show = true) {
|
||||||
|
modal.key = key
|
||||||
|
modal[key] = show
|
||||||
|
console.log(modal);
|
||||||
|
}
|
||||||
|
|
||||||
const refAddChilCate = ref(null)
|
const refAddChilCate = ref(null)
|
||||||
const refAddChilCateTitle = ref('添加子分类')
|
const refAddChilCateTitle = ref('添加子分类')
|
||||||
@@ -339,19 +363,21 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (index === 1) {
|
if (index === 1) {
|
||||||
return uni.showModal({
|
setModalShow('del', true)
|
||||||
title: '提示',
|
return
|
||||||
content: '确认删除该分类吗?',
|
// return uni.showModal({
|
||||||
success(res) {
|
// title: '提示',
|
||||||
if (res.confirm) {
|
// content: '确认删除该分类吗?',
|
||||||
$productCategory.del([selItem.data.id]).then(res => {
|
// success(res) {
|
||||||
category.childrenList.splice(selItem.index, 1)
|
// if (res.confirm) {
|
||||||
infoBox.showToast('删除成功')
|
// $productCategory.del([selItem.data.id]).then(res => {
|
||||||
uni.setStorageSync('cateItem', category)
|
// category.childrenList.splice(selItem.index, 1)
|
||||||
})
|
// infoBox.showToast('删除成功')
|
||||||
}
|
// uni.setStorageSync('cateItem', category)
|
||||||
}
|
// })
|
||||||
})
|
// }
|
||||||
|
// }
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -676,13 +702,16 @@
|
|||||||
$icon-line-width: 20rpx;
|
$icon-line-width: 20rpx;
|
||||||
$icon-line-height: 4rpx;
|
$icon-line-height: 4rpx;
|
||||||
@import '@/commons/style/reset-uni-form.scss';
|
@import '@/commons/style/reset-uni-form.scss';
|
||||||
::v-deep .uni-forms-item--border{
|
|
||||||
padding-top: 24rpx ;
|
::v-deep .uni-forms-item--border {
|
||||||
padding-bottom: 24rpx ;
|
padding-top: 24rpx;
|
||||||
|
padding-bottom: 24rpx;
|
||||||
}
|
}
|
||||||
::v-deep .uni-forms-item.is-direction-top .uni-forms-item__label{
|
|
||||||
|
::v-deep .uni-forms-item.is-direction-top .uni-forms-item__label {
|
||||||
padding-bottom: 16rpx;
|
padding-bottom: 16rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.category-icon {
|
.category-icon {
|
||||||
width: 60rpx;
|
width: 60rpx;
|
||||||
height: 60rpx;
|
height: 60rpx;
|
||||||
@@ -697,9 +726,11 @@
|
|||||||
.my-switch {
|
.my-switch {
|
||||||
transform: scale(0.7);
|
transform: scale(0.7);
|
||||||
}
|
}
|
||||||
::v-deep .uni-forms-item__content{
|
|
||||||
|
::v-deep .uni-forms-item__content {
|
||||||
min-height: inherit;
|
min-height: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep .uni-forms-item__error {
|
::v-deep .uni-forms-item__error {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user