Files
pupil/packageReport/certifiedCjDetail/certifiedCjDetail.vue

225 lines
4.9 KiB
Vue

<template>
<view>
<u-image :src="imgUrl+detailList.cover" width="750rpx" height="290rpx">
</u-image>
<view class="feature">
<text class="one_title">经营范围及特色</text>
<view class="green_block">
<text class="green_features">{{detailList.desc}}</text>
</view>
</view>
<view class="introduce">
<view class="introduce_title">企业介绍</view>
<text class="business_introduce">{{detailList.content}}</text>
</view>
<view class="show">
<view class="introduce_title">企业展示</view>
<u-grid :border="false" col="4">
<u-grid-item v-for="(listItem,listIndex) in detailList.images" :key="listIndex">
<u--image :src="imgUrl+listItem" width="170rpx" height="170rpx" :lazy-load="true">
</u--image>
</u-grid-item>
</u-grid>
</view>
<view class="footer" @click="showModal()">
<u-icon name="kefu-ermai" color="#fff" size="30rpx"></u-icon>
<text>联系客服</text>
</view>
<u-modal :show="showCall" showCancelButton closeOnClickOverlay="false" confirmText="是" cancelText="否"
@confirm="confirmCall" @cancel="cancelCall">
<view>
<view style="text-indent: 25rpx;">{{mobile}}</view>
<text>是否拨打客服电话</text>
</view>
</u-modal>
<view style="margin:0 20rpx;">
<u-overlay :show="!isLoad">
<login @success="reOnLoad()" @fail="failToLoad()"></login>
</u-overlay>
</view>
</view>
</template>
<script>
import login from 'pages/my/login/login'
export default {
components: {
login
},
data() {
return {
id: '',
detailList: [],
imgUrl: '',
isLoad: true,
showCall: false,
mobile: '',
}
},
onLoad(option) {
this.imgUrl = uni.getStorageSync('img_url')
this.id = option.id
this.getCertifiedCjDetail()
this.getCsTel()
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.isLoad = false
return
}
this.isLoad = true
},
methods: {
//获取客服电话
getCsTel() {
this.$apiServe.getCsTel().then(res => {
this.mobile = res.data.data.cs_tel
}).finally(_ => {})
},
//获取认证厂家详情
getCertifiedCjDetail() {
this.$apiServe.getCertifiedCjDetail(this.id).then(res => {
// console.log('认证厂家详情页', res.data)
if (res.data.data) {
let data = res.data.data
data.images = data.images.split(';')
this.detailList = data
} else {
this.$toast.warn('没有更多详情了')
}
}).finally(_ => {})
},
reOnLoad() {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.$toast.warn('登录失败请重试')
this.isLoad = false
return
}
this.isLoad = true
this.getCertifiedCjDetail()
},
failToLoad() {
uni.reLaunch({
url: '/pages/index/index'
})
},
// 联系客服模态框
showModal() {
this.showCall = true
},
confirmCall() {
this.showCall = false
let phone = this.mobile
phone = phone.toString()
uni.makePhoneCall({
phoneNumber: phone,
success: function() {
console.log('拨打电话成功');
},
fail() {
console.log('打电话失败了');
}
})
},
cancelCall() {
this.showCall = false
}
}
}
</script>
<style lang="scss">
.u-modal__content {
padding: 43rpx 104rpx !important;
text-indent: 25rpx;
}
.feature {
padding: 20rpx 16rpx;
background-color: #fff;
margin-bottom: 30rpx;
.one_title {
font-size: 28rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: bold;
color: #3E3E3E;
line-height: 40rpx;
}
.green_block {
background-color: #16CA65;
margin-top: 20rpx;
height: 139rpx;
border-radius: 6rpx;
.green_features {
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
line-height: 33rpx;
margin-left: 20rpx;
margin-top: 14rpx;
}
}
}
.introduce {
padding: 20rpx 16rpx;
background-color: #fff;
margin-bottom: 30rpx;
.introduce_title {
font-size: 28rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: bold;
color: #3E3E3E;
line-height: 40rpx;
margin-bottom: 10rpx;
}
.business_introduce {
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
line-height: 33rpx;
}
}
.show {
padding: 20rpx 16rpx;
background-color: #fff;
margin-bottom: 78rpx;
.u-grid {
padding-top: 22rpx !important;
}
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
height: 100rpx;
background: #0EBB5B;
display: flex;
flex-direction: column;
justify-content: center;
align-content: center;
text-align: center;
.u-icon {
justify-content: center;
}
text {
font-size: 20rpx;
font-family: MicrosoftYaHei-Bold, MicrosoftYaHei;
font-weight: bold;
color: #FFFFFF;
line-height: 26rpx;
}
}
</style>