Skip to content

Commit

Permalink
Merge pull request #737 from Support-pl/dev-fixes
Browse files Browse the repository at this point in the history
dev fixes
  • Loading branch information
639852 authored Aug 6, 2024
2 parents 2bd08f0 + 95355e9 commit 4588722
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions src/components/services/custom/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,14 @@ export default {
},
sizes (value) {
const { keys } = value?.at(0) ?? {}
const data = JSON.parse(this.$route.query.data ?? '{}')

if (data.productSize) {
const { group } = this.products[data.productSize] ?? {}

this.checkedType = group
this.options.size = data.productSize
} else return

if (keys && this.options.period) {
this.options.size = keys[this.options.period]
Expand Down Expand Up @@ -541,8 +549,17 @@ export default {
const [key, product] = Object.entries(this.products).find(([, product]) =>
product.title === title && +product.period === value
)
const data = JSON.parse(this.$route.query.data ?? '{}')

if (data.productSize) {
const { group } = this.products[data.productSize] ?? {}

this.checkedType = group
this.options.size = data.productSize
} else {
this.options.size = key
}

this.options.size = key
this.plan = this.cachedPlans[this.provider].find(
({ uuid }) => uuid === product.planId
)?.uuid
Expand Down Expand Up @@ -630,8 +647,12 @@ export default {

const data = JSON.parse(this.$route.query.data ?? '{}')

if (data.productSize) this.options.size = data.productSize
else if (this.typesOptions.length < 2) {
if (data.productSize) {
const { group } = this.products[data.productSize] ?? {}

this.checkedType = group
this.options.size = data.productSize
} else if (this.typesOptions.length < 2) {
nextTick(() => {
this.options.size = Object.values(this.sizes[0]?.keys ?? {})[0] ?? ''
})
Expand Down

0 comments on commit 4588722

Please sign in to comment.