代码优化
This commit is contained in:
@@ -77,38 +77,11 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import tColorPicker from '@/components/t-color-picker/t-color-picker'
|
||||
import { reactive, ref, } from 'vue';
|
||||
import { onLoad, onReady } from '@dcloudio/uni-app';
|
||||
import go from '@/commons/utils/go.js';
|
||||
import infoBox from '@/commons/utils/infoBox.js';
|
||||
import {
|
||||
onLoad,
|
||||
onReady
|
||||
} from '@dcloudio/uni-app';
|
||||
import {
|
||||
onMounted,
|
||||
reactive,
|
||||
nextTick,
|
||||
ref,
|
||||
onBeforeMount,
|
||||
watch
|
||||
} from 'vue';
|
||||
import {
|
||||
tbProductGroupGet,
|
||||
tbProductGroupDelete,
|
||||
tbProductGroupPut,
|
||||
upGroupSort,
|
||||
tbProductGroupPost
|
||||
} from '@/http/yskApi/shop.js'
|
||||
|
||||
import { addProdGroup, updateProdGroup } from '@/http/api/product.js'
|
||||
|
||||
const $productCategory = {
|
||||
add: tbProductGroupPost,
|
||||
del: tbProductGroupDelete,
|
||||
update: tbProductGroupPut,
|
||||
get: tbProductGroupGet
|
||||
}
|
||||
|
||||
const option = reactive({
|
||||
type: ''
|
||||
})
|
||||
@@ -237,7 +210,7 @@
|
||||
result.push(...returnValidateResult(category))
|
||||
|
||||
if (result.length) {
|
||||
return infoBox.showToast(result[0].errMeessage)
|
||||
return uni.$utils.showToast(result[0].errMeessage)
|
||||
}
|
||||
|
||||
if (option.type === 'edit') {
|
||||
@@ -252,7 +225,7 @@
|
||||
})
|
||||
}
|
||||
|
||||
infoBox.showToast(option.type === 'edit' ? '修改成功' : '添加成功')
|
||||
uni.$utils.showToast(option.type === 'edit' ? '修改成功' : '添加成功')
|
||||
timer = setTimeout(() => {
|
||||
clearTimeout(timer)
|
||||
go.back()
|
||||
|
||||
Reference in New Issue
Block a user