Files
xdd-uniapp-new/pkg_join/views/index.vue
T

172 lines
4.4 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')"
/> -->
<image
:src="images.travelImage"
class="img-item"
mode="widthFix"
@click="toTravelResidence"
/>
<image
<<<<<<< HEAD
=======
v-show="partnerType === 'province_partner' || partnerType === ''"
>>>>>>> 320bda6ed8582fd2c81f73c272076e2b218418ab
:src="images.experienceStoreImage"
class="img-item"
mode="widthFix"
@click="goto('experience_store')"
/>
</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,
hasExperienceStore: null,
hasTravel: null,
images: null,
pageKeyId: Object.freeze('merchantApplyIndex'),
canApplyHotel: false
}
},
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
this.canApplyHotel = data.canApplyHotel
this.hasTravel = data.hasTravel
this.hasExperienceStore = data.hasExperienceStore
})
},
methods: {
/**
* 跳转旅游 residences
*/
toTravelResidence() {
if (this.hasTravel === 1) {
this.$global.goSupplierMini()
} else {
this.$yrouter.push('/pkg_join/views/travelResidence?partnerId=' + this.partnerId)
}
},
/**
* 跳转
* @param {string} target - 目标页面
*/
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.canApplyHotel) {
uni.showToast({ // 使用uni-app官方提示API
title: '您的店铺数量已到达上限,不能继续申请店铺',
icon: 'none'
})
return
}
this.$yrouter.push('/pkg_join/views/shop?partnerId=' + this.partnerId)
break
case 'experience_store':
if(this.hasExperienceStore === 1) {
this.$global.goSupplierMini()
return
}
this.$yrouter.push('/pkg_join/views/experienceStore?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>