Commit dff9ac99 authored by shirlyn.guo's avatar shirlyn.guo 👌🏻

chore: 应用上架有时获取不到参数

parent 66b7ec12
......@@ -335,7 +335,7 @@ function handleToApplicationSquare() {
<SaleApplicationsConfigurationModal
v-model="isShowSaleApplicationsConfigurationModal"
:data="saleApplicationsInfo"
:category-id="applicationMallInfo.categoryId"
:application-mall-info="applicationMallInfo"
@update="(newValue: string) => (applicationMallInfo.isSale = newValue)"
@trigger-get-application-mall-info="handleGetApplicationMallInfo"
/>
......
......@@ -11,11 +11,20 @@ interface MallCategory {
categoryName: string
}
interface ApplicationMallInfo {
agentId: string
agentPublishId: number
categoryId: number
isCopy: string
isSale: string
launchTime: string
}
const isShowSaleApplicationsConfigurationModal = defineModel<boolean>()
const props = defineProps<{
data: PersonalAppConfigState
categoryId?: number
applicationMallInfo?: ApplicationMallInfo
}>()
const emit = defineEmits<{
update: [value: string]
......@@ -23,12 +32,10 @@ const emit = defineEmits<{
}>()
const { t } = useI18n()
const checkedClassifyValue = ref<number | null>(props.applicationMallInfo?.categoryId ?? 0)
const checkedClassifyValue = ref<number | null>(props.categoryId!)
const isCopy = ref(props.data.isCopy === 'Y')
const saleApplicationsId = ref(props.data.agentPublishId)
const isClassifyError = ref(false)
const applicationsClassify = ref<MallCategory[]>([])
;(function () {
......@@ -42,21 +49,6 @@ watch(
},
)
watch(
() => props.categoryId,
(newValue) => {
checkedClassifyValue.value = newValue!
},
)
watch(
() => props.data,
(newVal) => {
saleApplicationsId.value = newVal.agentPublishId
isCopy.value = newVal.isCopy === 'Y'
},
)
function handleApplicationsSaleSettingModalClose() {
isShowSaleApplicationsConfigurationModal.value = false
checkedClassifyValue.value = null
......@@ -64,13 +56,18 @@ function handleApplicationsSaleSettingModalClose() {
}
function handleApplicationReleaseBtn() {
const agentPublishId = ref(props.data.agentPublishId)
if (!checkedClassifyValue.value) {
isClassifyError.value = true
return
}
if (props.applicationMallInfo?.agentPublishId) {
agentPublishId.value = props.applicationMallInfo.agentPublishId
}
const payload = {
agentPublishId: props.data.agentPublishId,
agentPublishId: agentPublishId.value,
categoryId: checkedClassifyValue.value,
isCopy: isCopy.value ? 'Y' : 'N',
isSale: 'Y',
......@@ -107,7 +104,7 @@ function handleGetMallCategoryList() {
function handleModalOpenAfter() {
if (props.data.isCopy) isCopy.value = props.data.isCopy === 'Y'
if (props.data.isSale === 'Y') {
checkedClassifyValue.value = props.categoryId!
checkedClassifyValue.value = props.applicationMallInfo!.categoryId
} else {
checkedClassifyValue.value = 0
}
......@@ -141,6 +138,7 @@ function handleModalOpenAfter() {
@click="handleApplicationsSaleSettingModalClose"
/>
</div>
<div class="items-center justify-center rounded-[4px]">
<div class="mb-[16px] flex items-center text-[14px] text-[#151B26]">
<div class="bg-theme-color mr-[8px] h-[20px] w-[20px] rounded-2xl text-center text-[#fff]">1</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment