mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-07 07:46:43 +08:00
数据看板页面以及产品列表页面和编辑客户信息页面基础代码编写
This commit is contained in:
@@ -1,213 +0,0 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user