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

122 lines
3.6 KiB
Vue

<template>
<view class="pkg-join-index">
<image class="img-banner" :src="images.topImage" mode="scaleToFill"/>
<!-- <view class="box flex flex-col ai-center">-->
<!-- <image class="img-title" :src="webUrl+'/20230413103123003753.png'" mode="scaleToFill"/>-->
<!-- </view>-->
<image class="img-item" mode="widthFix" :src="images.goodSupplierImage"
@click="goto('goods_supplier')" v-show="partnerType==='province_partner'||partnerType===''"/>
<image class="img-item" mode="widthFix" :src="images.wenwanSupplierImage"
@click="goto('wenwan_supplier')" v-show="partnerType==='pioneer'||partnerType===''"/>
<image class="img-item" mode="widthFix" :src="images.hotelImage"
@click="goto('shop')" v-show="partnerType==='pioneer'||partnerType===''"/>
<image class="img-item" mode="widthFix" :src="images.wholesalerImage" @click="goto('wholesaler')"/>
</view>
</template>
<script>
import {getImages, getShopData} from "@/api/join";
export default {
name: "pkgJoinIndex",
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
partnerId: "",
partnerType: "",
hotelId: null,
hasHotel: null,
hasSupplier: null,
hasWholesaler: null,
images: null
}
},
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();
// uni.showToast({
// title: "您已成为供应商/员工,无需重复申请",
// icon: "none"
// })
} 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();
// uni.showToast({
// title: "您已成为供应商/员工,无需重复申请",
// icon: "none"
// })
} else {
this.$yrouter.push(`/pkg_join/views/supplier?type=wenwan_supplier&partnerId=${this.partnerId}`)
}
break;
case "shop":
if (this.hasHotel === 1) {
// uni.showToast({
// title: "您已开通店铺,无需重复申请",
// icon: "none"
// })
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();
// uni.showToast({
// title: "您已成为采购批发商,无需重复申请",
// icon: "none"
// })
} 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>