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

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

parent 66b7ec12
...@@ -335,7 +335,7 @@ function handleToApplicationSquare() { ...@@ -335,7 +335,7 @@ function handleToApplicationSquare() {
<SaleApplicationsConfigurationModal <SaleApplicationsConfigurationModal
v-model="isShowSaleApplicationsConfigurationModal" v-model="isShowSaleApplicationsConfigurationModal"
:data="saleApplicationsInfo" :data="saleApplicationsInfo"
:category-id="applicationMallInfo.categoryId" :application-mall-info="applicationMallInfo"
@update="(newValue: string) => (applicationMallInfo.isSale = newValue)" @update="(newValue: string) => (applicationMallInfo.isSale = newValue)"
@trigger-get-application-mall-info="handleGetApplicationMallInfo" @trigger-get-application-mall-info="handleGetApplicationMallInfo"
/> />
......
...@@ -11,11 +11,20 @@ interface MallCategory { ...@@ -11,11 +11,20 @@ interface MallCategory {
categoryName: string categoryName: string
} }
interface ApplicationMallInfo {
agentId: string
agentPublishId: number
categoryId: number
isCopy: string
isSale: string
launchTime: string
}
const isShowSaleApplicationsConfigurationModal = defineModel<boolean>() const isShowSaleApplicationsConfigurationModal = defineModel<boolean>()
const props = defineProps<{ const props = defineProps<{
data: PersonalAppConfigState data: PersonalAppConfigState
categoryId?: number applicationMallInfo?: ApplicationMallInfo
}>() }>()
const emit = defineEmits<{ const emit = defineEmits<{
update: [value: string] update: [value: string]
...@@ -23,12 +32,10 @@ const emit = defineEmits<{ ...@@ -23,12 +32,10 @@ const emit = defineEmits<{
}>() }>()
const { t } = useI18n() 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 isCopy = ref(props.data.isCopy === 'Y')
const saleApplicationsId = ref(props.data.agentPublishId)
const isClassifyError = ref(false) const isClassifyError = ref(false)
const applicationsClassify = ref<MallCategory[]>([]) const applicationsClassify = ref<MallCategory[]>([])
;(function () { ;(function () {
...@@ -42,21 +49,6 @@ watch( ...@@ -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() { function handleApplicationsSaleSettingModalClose() {
isShowSaleApplicationsConfigurationModal.value = false isShowSaleApplicationsConfigurationModal.value = false
checkedClassifyValue.value = null checkedClassifyValue.value = null
...@@ -64,13 +56,18 @@ function handleApplicationsSaleSettingModalClose() { ...@@ -64,13 +56,18 @@ function handleApplicationsSaleSettingModalClose() {
} }
function handleApplicationReleaseBtn() { function handleApplicationReleaseBtn() {
const agentPublishId = ref(props.data.agentPublishId)
if (!checkedClassifyValue.value) { if (!checkedClassifyValue.value) {
isClassifyError.value = true isClassifyError.value = true
return return
} }
if (props.applicationMallInfo?.agentPublishId) {
agentPublishId.value = props.applicationMallInfo.agentPublishId
}
const payload = { const payload = {
agentPublishId: props.data.agentPublishId, agentPublishId: agentPublishId.value,
categoryId: checkedClassifyValue.value, categoryId: checkedClassifyValue.value,
isCopy: isCopy.value ? 'Y' : 'N', isCopy: isCopy.value ? 'Y' : 'N',
isSale: 'Y', isSale: 'Y',
...@@ -107,7 +104,7 @@ function handleGetMallCategoryList() { ...@@ -107,7 +104,7 @@ function handleGetMallCategoryList() {
function handleModalOpenAfter() { function handleModalOpenAfter() {
if (props.data.isCopy) isCopy.value = props.data.isCopy === 'Y' if (props.data.isCopy) isCopy.value = props.data.isCopy === 'Y'
if (props.data.isSale === 'Y') { if (props.data.isSale === 'Y') {
checkedClassifyValue.value = props.categoryId! checkedClassifyValue.value = props.applicationMallInfo!.categoryId
} else { } else {
checkedClassifyValue.value = 0 checkedClassifyValue.value = 0
} }
...@@ -141,6 +138,7 @@ function handleModalOpenAfter() { ...@@ -141,6 +138,7 @@ function handleModalOpenAfter() {
@click="handleApplicationsSaleSettingModalClose" @click="handleApplicationsSaleSettingModalClose"
/> />
</div> </div>
<div class="items-center justify-center rounded-[4px]"> <div class="items-center justify-center rounded-[4px]">
<div class="mb-[16px] flex items-center text-[14px] text-[#151B26]"> <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> <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