GBC新增首页路由和文件

This commit is contained in:
liu.xiaofeng@ebiz-digits.com
2023-12-08 20:13:22 +08:00
parent 181b7c017e
commit 1de8b046b3
4 changed files with 415 additions and 0 deletions

14
src/router/GBC/index.js Normal file
View File

@@ -0,0 +1,14 @@
//数据报表 定义相关组件
const GBC_home = () => import('@/views/GBC/home')
export default [
{
path: '/GBC/home',
name: 'GBC_home',
component: GBC_home,
meta: {
title: '首页',
index: 1
}
},
]

View File

@@ -49,6 +49,8 @@ import allowance from './allowance'
import cooperativeUnit from './cooperativeUnit'
// YB_APP
import YB_APP from '../YB_APP/index'
// GBC
import GBC from '../GBC/index'
//健康险续保
import healthInsuranceRenewal from './healthInsuranceRenewal'
export default [
@@ -89,5 +91,6 @@ export default [
...allowance,
...cooperativeUnit,
...YB_APP,
...GBC,
...healthInsuranceRenewal
] //根据需要进行删减

View File

@@ -0,0 +1,213 @@
<template>
<div class="product-detail-container">
<!-- tab -->
<van-sticky>
<van-tabs v-model="active" color="#E9332EFF" title-active-color="#E9332EFF" class="">
<van-tab title="产品特色" class="mt10"> </van-tab>
<van-tab title="产品资料" class="mt10"> </van-tab>
</van-tabs>
</van-sticky>
<div v-show="active == '0'" class="pt10 pb45 clearfix">
<img class="product-detail-introduct-image fl" :src="item" alt="" v-for="(item, index) in introductImages" :key="index" />
</div>
<van-list v-show="active == '1'">
<van-cell
class="product-detail-list-item p10 fs12 fw400 bg-white"
:title="item.name"
is-link
v-for="(item, index) in docuList"
:key="index"
@click="goDocu(item.url, item.type, item.name)"
/>
</van-list>
<!-- 底部按钮 -->
<div class="bottom-area bottom-btn" v-if="branchType != 3">
<van-button class="m-btn fl green" color="#FEEFD8" @click="goProposal">制作建议书</van-button>
<van-button class="m-btn fr" type="danger" @click="goInsure">立即投保</van-button>
</div>
</div>
</template>
<script>
import { Tab, Tabs, List, Row, Col, Icon, Cell, Sticky } from 'vant'
import { getProductInfo } from '@/api/ebiz/product/product.js'
import { funcPermCheck } from '@/api/ebiz/common/common'
import riskRules from '@/views/common/risk-rules.js'
import { getAgentInfo } from '@/api/ebiz/my/my.js'
export default {
components: {
[Tab.name]: Tab,
[Tabs.name]: Tabs,
[List.name]: List,
[Row.name]: Row,
[Col.name]: Col,
[Icon.name]: Icon,
[Cell.name]: Cell,
[Sticky.name]: Sticky
},
data() {
return {
isCheck: 0, //查看是否有权限
active: 2,
docuList: [], // 产品资料文件
introductImages: [], // 产品特色图片
itemProductDTOS: [], // 产品信息
branchType:'3',
}
},
created() {
//获取展示的产品的 code
// let code = localStorage.productDetailCode
let code = this.$route.params.productDetailCode
console.log(code)
this.getProductDetail(code)
funcPermCheck({}).then(res => {
this.isCheck = res.result
})
},
mounted(){
this.getAgentInfo()
},
methods: {
getAgentInfo(){
getAgentInfo({}).then(res=>{
if(res.result == 0){
console.log('getAgentInfo',res)
this.branchType = res.branchType
}
})
},
goDocu(url, type, name) {
let pdfUrl = encodeURIComponent(url)
this.$jump({
flag: 'h5',
extra: {
title: name,
// url: 'http://47.96.143.111/pdfjs/web/viewer.html?file=' + url //测试代码
url: this.$mainUrl + '/pdfjs/web/viewer.html?file=' + pdfUrl
}
})
// 跳转到产品资料详情
// 保存url
// window.localStorage.setItem('documentInfo', JSON.stringify({ documentUrl: url, documentType: type }))
// // 保存文件类型
// // 0-图片, 1-pdf, 2-word, 3-excel
// window.localStorage.setItem('documentType', type)
// this.$jump({
// flag: 'h5',
// extra: {
// url: location.origin + '/#/product/productDocument'
// },
// routerInfo: {
// path: `/product/productDocument`
// }
// })
},
goProposal() {
this.$CacheUtils.removeLocItem('orderNo')
// 跳转到制作建议书( 投保人信息 )
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/proposal/appnt'
},
routerInfo: {
path: `/proposal/appnt`
}
})
},
async goInsure() {
if (this.isCheck == '1') {
//校验该代理人是否有该产品的售卖权限
return this.$toast('您暂无使用权限!如有问题咨询,请联系个险业务部。')
}
localStorage.orderNo = ''
localStorage.chooseProductCodes = '' //置空所选险种
let path = `/sale/insuredInfo`
let flagPermission = {
flag:true
}
if (this.$route.params.productDetailCode == 'GFRSPRO_M0024' || this.$route.params.productDetailCode == 'GFRSPRO_M0040') {
flagPermission = await riskRules.getProductSellPermissionList('GFRS_M0040', this)
let specilFlag = '1'
path = `${path}?specilFlag=${specilFlag}`
} else if (this.$route.params.productDetailCode == 'GFRSPRO_M0044') {
flagPermission = await riskRules.getProductSellPermissionList('GFRS_M0044', this)
let specilFlag = '1'
path = `${path}?specilFlag=${specilFlag}`
}else if (this.$route.params.productDetailCode == 'GFRSPRO_M0051') {
flagPermission = await riskRules.getProductSellPermissionList('GFRS_M0051', this)
let specilFlag = '1'
path = `${path}?specilFlag=${specilFlag}`
} else {
flagPermission.flag = false
}
if (flagPermission.flag) {
//校验该代理人是否有该产品的售卖权限
return this.$toast(flagPermission.resultMessage)
}
// 从产品列表进入时存储所选产品的code--如果是选择产品, 进入电子投保, 在主险列表能默认选中我在产品列表选择的产品
localStorage.productCodeChooseFromList = this.itemProductDTOS[0].productCode // 跳转到投保建议
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#' + path
},
routerInfo: {
path: path
}
})
},
async getProductDetail(code) {
// 获取产品详情数据
console.log(code)
const res = await getProductInfo({
itemCode: code,
platform: 'app'
})
console.log(res)
if (res.result == 0) {
// 获取产品特色图片
this.introductImages = res.productShowInfo.introductImages
// 获取产品资料文件
this.docuList = res.productShowInfo.documents
this.itemProductDTOS = res.productShowInfo.itemProductDTOS
}
}
},
beforeRouteLeave(to, from, next) {
document.body.style.backgroundColor = ''
next()
}
}
</script>
<style lang="scss" scoped>
.product-detail-container {
/deep/.van-sticky {
background: #fff;
}
.product-detail-introduct-image {
width: 100%;
}
// /deep/.van-tabs__content {
// margin-bottom: 45px;
// }
// /deep/.van-tabs__content::after {
// content: '';
// display: table;
// clear: both;
// }
}
.bottom-area {
/deep/.m-btn {
width: 50%;
border-color: transparent;
}
/deep/.van-button--default {
background-color: #feefd8;
color: #e9332e;
}
}
</style>

185
src/views/GBC/home.vue Normal file
View File

@@ -0,0 +1,185 @@
<template>
<div class="public_container" :style="{paddingTop:marginTop+'px'}">
<van-pull-refresh v-model="isLoading" @refresh="onRefresh">
<div class="head">
<van-swipe :autoplay="3000" style="width: 100%;">
<van-swipe-item v-for="(item, index) in activity" :key="index" @touchstart="touchstart" @touchmove="touchmove" @touchend="touchend(item)">
<!-- <img :src="config.assetsUrl + item.img + '?v=' + thisGetTime" /> -->
<img :src="item.img">
</van-swipe-item>
</van-swipe>
</div>
<div class="iconPart1">
<van-notice-bar
:left-icon="png8"
:text='getCodeValue'
/>
</div>
<div class="top">
<div class="menu" v-for="(item, ind) in homePageIcon" :key="ind" @click="goDetail(item)">
<div class="menuImg">
<img :src="item.img">
</div>
<span class="menuName">{{ item.title }}</span>
</div>
</div>
</van-pull-refresh>
</div>
</template>
<script>
import { homeConfigYB } from '@/api/YB_APP/index'
import { Swipe, SwipeItem, NoticeBar, Icon, Popup, PullRefresh ,Toast } from 'vant'
import config from '@/config'
import png8 from '@/assets/YB_APP/images/8.png';
export default {
name: 'Home',
components: {
[Swipe.name]: Swipe,
[SwipeItem.name]: SwipeItem,
[NoticeBar.name]: NoticeBar,
[Icon.name]: Icon,
[Popup.name]: Popup,
[PullRefresh.name]:PullRefresh,
[Toast.name]:Toast ,
},
data() {
return {
config,
marginTop:'80',
getCodeValue:'',
png8,
activity: [],
homePageIcon:[],
isLoading: false,
}
},
mounted(){
this.getHomeConfigYB()
this.setMarginTop()
},
methods:{
setMarginTop(){
EWebBridge.webCallAppInJs("top_bar_height").then(data => {
console.log(data,'top_bar_height')
if(data){
// 获取高度成功
let height = data.height
// 设置高度
this.marginTop = height + 10
}
})
},
getHomeConfigYB(){
let params = {
}
homeConfigYB(params).then(res=>{
if(res.result == 0){
this.activity = res.content.activity
if(res.content.getCodeValue.length!=0){
res.content.getCodeValue.forEach(item=>{
this.getCodeValue += item + ' '
})
}
this.homePageIcon = res.content.icon.homePageIcon
}else{
this.$toast(res.resultMessage)
}
})
},
touchstart(){
this.clickFlag = true
},
touchmove(){
this.clickFlag = false
},
touchend(data){
if(this.clickFlag){
let dataURL = JSON.parse(data.route).extra.url
if(dataURL){
let thisRoute = dataURL.substring(dataURL.lastIndexOf("/#")+2)
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#' + thisRoute,
},
routerInfo: {
path: thisRoute,
},
})
}
}
},
// 下拉刷新
onRefresh() {
setTimeout(() => {
Toast('刷新成功');
this.isLoading = false;
location. reload()
}, 1000);
},
},
}
</script>
<style lang="scss" scoped>
.public_container{
font-size: 12px;
height: 100vh;
width: 100vw;
background-image: url("../../assets/YB_APP/images/2-1.png");
background-repeat: no-repeat;
background-size: contain;
}
.head {
position: relative;
margin: 10px;border-radius: 5px;
/*box-shadow: 0px 5px 8px 0px #7a6fc1;*/
img {
width: 100%;
height: 100%;
border-radius: 5px;
}
/deep/ .van-swipe-item{
height: auto;
}
}
/deep/ .van-notice-bar{
border-radius: 5px;
}
.menuImg{
width:100%;display: flex;justify-content: center;margin-bottom: 5px;
/deep/ img{
width: 30px;
height: 30px;
}
}
/deep/ .van-notice-bar{
background: linear-gradient(#f4f6ff,#fff);
color: #333;
letter-spacing: 1px;
}
/deep/ .van-icon__image{
width: 100%;
}
/deep/ .van-notice-bar__left-icon{
width: 50px;
}
/deep/ .van-notice-bar__wrap{
margin-left: 10px;
}
/deep/ .van-swipe-item{
img{
height:145px;
}
}
.iconPart1{
margin: 10px;border-radius: 5px;
}
.top{
display:flex;justify-content: space-between;margin: 10px;background: #fff;border-radius: 5px;align-items: center;padding: 15px;
}
</style>