126 lines
3.1 KiB
Vue
126 lines
3.1 KiB
Vue
<template>
|
|
<view class="pkg-join-index">
|
|
<image
|
|
:src="images.topImage"
|
|
class="img-banner"
|
|
mode="scaleToFill"
|
|
/>
|
|
<image
|
|
v-show="partnerType === 'province_partner' || partnerType === ''"
|
|
:src="images.goodSupplierImage"
|
|
class="img-item"
|
|
mode="widthFix"
|
|
@click="goto('goods_supplier')"
|
|
/>
|
|
<image
|
|
v-show="partnerType === 'pioneer' || partnerType === ''"
|
|
:src="images.wenwanSupplierImage"
|
|
class="img-item"
|
|
mode="widthFix"
|
|
@click="goto('wenwan_supplier')"
|
|
/>
|
|
<image
|
|
v-show="partnerType === 'pioneer' || partnerType === ''"
|
|
:src="images.hotelImage"
|
|
class="img-item"
|
|
mode="widthFix"
|
|
@click="goto('shop')"
|
|
/>
|
|
<image
|
|
:src="images.wholesalerImage"
|
|
class="img-item"
|
|
mode="widthFix"
|
|
@click="goto('wholesaler')"
|
|
/>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import { getImages, getShopData } from '@/api/join'
|
|
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
|
export default {
|
|
name: 'PkgJoinIndex',
|
|
mixins: [pageListenMixins],
|
|
data() {
|
|
return {
|
|
webUrl: this.$VUE_APP_RESOURCES_URL,
|
|
partnerId: '',
|
|
partnerType: '',
|
|
hotelId: null,
|
|
hasHotel: null,
|
|
hasSupplier: null,
|
|
hasWholesaler: null,
|
|
images: null,
|
|
pageKeyId: Object.freeze('merchantApplyIndex')
|
|
}
|
|
},
|
|
onLoad(options) {
|
|
this.partnerId = options.partnerId || ''
|
|
getImages().then(({data}) => this.images = data)
|
|
getShopData(this.partnerId).then(({data}) => {
|
|
this.partnerType = data.partnerType
|
|
this.hotelId = data.hotelId
|
|
this.hasHotel = data.hasHotel
|
|
this.hasSupplier = data.hasSupplier
|
|
this.hasWholesaler = data.hasWholesaler
|
|
})
|
|
},
|
|
methods: {
|
|
goto(target) {
|
|
switch (target) {
|
|
case 'goods_supplier':
|
|
if (this.hasSupplier === 1) {
|
|
this.$global.goSupplierMini()
|
|
} else {
|
|
this.$yrouter.push(`/pkg_join/views/supplier?type=goods_supplier&partnerId=${this.partnerId}`)
|
|
}
|
|
break
|
|
case 'wenwan_supplier':
|
|
if (this.hasSupplier === 1) {
|
|
this.$global.goSupplierMini()
|
|
} else {
|
|
this.$yrouter.push(`/pkg_join/views/supplier?type=wenwan_supplier&partnerId=${this.partnerId}`)
|
|
}
|
|
break
|
|
case 'shop':
|
|
if (this.hasHotel === 1) {
|
|
this.$yrouter.push('/pagesInn/inn/innHome?id='+this.hotelId)
|
|
} else {
|
|
this.$yrouter.push('/pkg_join/views/shop?partnerId=' + this.partnerId)
|
|
}
|
|
break
|
|
case 'wholesaler':
|
|
if (this.hasWholesaler === 1) {
|
|
this.$global.goSupplierMini()
|
|
} else {
|
|
this.$yrouter.push(`/pkg_join/views/wholesaler`)
|
|
}
|
|
break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="less">
|
|
.pkg-join-index {
|
|
padding-bottom: 46rpx;
|
|
|
|
image {
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.img-banner {
|
|
width: 750rpx;
|
|
height: 378rpx;
|
|
}
|
|
|
|
.img-item {
|
|
width: 682rpx;
|
|
height: auto;
|
|
margin: 40rpx 34rpx 0;
|
|
border-radius: 20px;
|
|
}
|
|
}
|
|
</style>
|