代码优化

This commit is contained in:
GaoHao
2025-03-26 14:35:59 +08:00
parent 413222a5f0
commit 656793dae2
47 changed files with 142 additions and 4103 deletions

View File

@@ -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()