Files
xdd-uniapp-new/pkg_join/views/index.vue
T
2023-09-20 21:49:33 +08:00

154 lines
3.9 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 class="content flex ai-center">-->
<!-- <image class="img-fire" :src="webUrl+'/20230413103130660107.png'" mode="scaleToFill"/>-->
<!-- <view class="txt flex ai-center">目前已有-->
<!-- <text>{{ count }}</text>-->
<!-- 人参加活动-->
<!-- </view>-->
<!-- </view>-->
</view>
<image class="img-item" :src="images.goodSupplierImage"
@click="goto('goods_supplier')" v-show="partnerType==='province_partner'||partnerType===''"/>
<image class="img-item" :src="images.wenwanSupplierImage"
@click="goto('wenwan_supplier')" v-show="partnerType==='pioneer'||partnerType===''"/>
<image class="img-item" :src="images.hotelImage"
@click="goto('shop')" v-show="partnerType==='pioneer'||partnerType===''"/>
</view>
</template>
<script>
import {getCount, getImages, getShopData} from "@/api/join";
export default {
name: "pkgJoinIndex",
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
partnerId: "",
partnerType: "",
count: 0,
hasHotel: null,
hasSupplier: null,
images: null
}
},
onLoad(options) {
this.partnerId = options.partnerId || "";
getCount().then(({data}) => this.count = data.count);
getImages().then(({data}) => this.images = data);
getShopData(this.partnerId).then(({data}) => {
this.partnerType = data.partnerType;
this.hasHotel = data.hasHotel;
this.hasSupplier = data.hasSupplier;
})
},
methods: {
goto(target) {
switch (target) {
case "goods_supplier":
if (this.hasSupplier === 1) {
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) {
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"
})
} else {
this.$yrouter.push('/pkg_join/views/shop?partnerId=' + this.partnerId)
}
break;
}
}
}
}
</script>
<style scoped lang="less">
.pkg-join-index {
image {
vertical-align: middle;
}
.img-banner {
width: 750rpx;
height: 378rpx;
}
.img-title {
width: 556rpx;
height: 104rpx;
margin: 20rpx 0;
}
.img-fire {
width: 56rpx;
height: 56rpx;
margin-right: 4rpx;
}
.img-item {
width: 682rpx;
height: 320rpx;
margin: 0 34rpx 46rpx;
}
.box {
width: 682rpx;
//height: 240rpx;
margin: 24rpx auto 30rpx;
border-radius: 40rpx;
background: rgba(255, 0, 85, 0.02);
}
.content {
width: 516rpx;
height: 64rpx;
box-sizing: border-box;
padding: 0 28rpx;
border-radius: 36rpx;
background: rgba(255, 86, 74, 0.08);
}
.txt {
color: #FF564A;
font-size: 32rpx;
font-weight: bold;
text {
display: inline-flex;
align-items: center;
height: 40rpx;
margin: 0 8rpx;
padding: 0 18rpx;
border-radius: 8rpx;
background: #FF0055;
color: #FFFFFF;
font-size: 28rpx;
}
}
}
</style>