|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="my-swipe" v-show='canShowModule'>
|
|
|
+ <div class="my-swipe" v-show="canShowModule">
|
|
|
<van-skeleton avatar :loading="this.getImages.length === 0">
|
|
|
<van-swipe
|
|
|
:id="'ad-' + (ad || 'swipe')"
|
|
@@ -80,6 +80,10 @@ export default {
|
|
|
type: String,
|
|
|
default: ''
|
|
|
},
|
|
|
+ width: {
|
|
|
+ type: String,
|
|
|
+ default: '359px'
|
|
|
+ },
|
|
|
images: {
|
|
|
type: Array,
|
|
|
default() {
|
|
@@ -94,12 +98,12 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
getItemWidth() {
|
|
|
- return px2viewport('359px')
|
|
|
+ return px2viewport(this.width)
|
|
|
},
|
|
|
getImages() {
|
|
|
return this.ad ? this.list : this.images
|
|
|
},
|
|
|
- canShowModule () {
|
|
|
+ canShowModule() {
|
|
|
if (this.skeleton) {
|
|
|
return true
|
|
|
} else {
|
|
@@ -123,7 +127,9 @@ export default {
|
|
|
})
|
|
|
.then((res) => {
|
|
|
if (res?.error_code === 0 && typeof res?.data === 'object') {
|
|
|
- const temp = Object.values(res.data).flat().filter(v => v)
|
|
|
+ const temp = Object.values(res.data)
|
|
|
+ .flat()
|
|
|
+ .filter((v) => v)
|
|
|
if (Array.isArray(temp)) {
|
|
|
this.list = temp.map(adConfigFormatter)
|
|
|
}
|