mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-16 01:46:45 +08:00
Merge branch 'feature/开门红首页业绩表格' into dev
# Conflicts: # src/assets/js/utils/request.js
This commit is contained in:
@@ -6,6 +6,7 @@ import dateUtil from '@/assets/js/utils/date-utils'
|
||||
import MD5 from 'js-md5'
|
||||
import CacheUtils from '@/assets/js/utils/cacheUtils'
|
||||
|
||||
import { device } from '@/assets/js/business-common.js'
|
||||
let proposal = [
|
||||
'/proposal/proposal/list',
|
||||
'/proposal/proposal/toInsurance',
|
||||
@@ -117,7 +118,7 @@ const service = axios.create({
|
||||
|
||||
// request拦截器
|
||||
service.interceptors.request.use(
|
||||
config => {
|
||||
async config => {
|
||||
let relativePath = config.url && config.url.split(configApp.API_VERSION)[1]
|
||||
console.log(config.url.split(configApp.API_VERSION)[0])
|
||||
if (whiteList.includes(relativePath)) {
|
||||
@@ -142,12 +143,27 @@ service.interceptors.request.use(
|
||||
console.log('[调用请求加密服务][请求地址:' + config.url + '][加密后报文:]', config.data)
|
||||
}
|
||||
}
|
||||
config.headers['token'] = CacheUtils.getLocItem('token')
|
||||
let token = CacheUtils.getLocItem('token')
|
||||
/**
|
||||
* 在HomeProduct页面获取代理人信息时, 客户端可能还未将token存储在本地
|
||||
* 此时如果token为空, 调用客户端方法获取token并放入localstorage中
|
||||
*/
|
||||
if (relativePath === '/customer/agent/info' && !token) {
|
||||
// 设备类型
|
||||
const target = device()
|
||||
// 安卓or苹果
|
||||
if (target.isAndroid || target.isIphone) {
|
||||
// eslint-disable-next-line no-undef
|
||||
const res = await EWebBridge.webCallAppInJs('getToken')
|
||||
const token = JSON.parse(res).token
|
||||
CacheUtils.setLocItem('token', token)
|
||||
}
|
||||
}
|
||||
config.headers['token'] = token
|
||||
// 添加请时间戳
|
||||
let timeStr = new Date().getTime() + ''
|
||||
config.headers['timeStr'] = timeStr
|
||||
config.headers['signature'] = MD5(timeStr + CacheUtils.getLocItem('token'))
|
||||
// config.headers['token'] = `f0003a753d1d492083248f723ab1b6e9`//TEST测试专用
|
||||
return config
|
||||
},
|
||||
error => {
|
||||
|
||||
@@ -55,31 +55,40 @@
|
||||
<!-- 个险 -->
|
||||
<template v-if="isGoodStart">
|
||||
<div class="home-product-content">
|
||||
<!-- 产品中心 -->
|
||||
<!-- 机构排名/业绩排名 -->
|
||||
<div class="pcenter-title flex pt10 pb10 mr15 justify-content-s align-items-c" style="height: 30px;">
|
||||
<img class="title-img" :src="performance" />
|
||||
<img v-if="isInner" class="title-img" :src="$assetsUrl + 'images/goodStart/organizationTitle.png'" />
|
||||
<img v-else class="title-img" :src="$assetsUrl + 'images/goodStart/performanceTitle.png'" />
|
||||
</div>
|
||||
<div class="home-product-pcenter performance">
|
||||
<div class="pcenter-list">
|
||||
<table class="myTable" style="min-width: 140vw;" cellspacing="0" cellpadding="0">
|
||||
<table class="myTable" style="min-width: 160vw;" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<th>产品名称</th>
|
||||
<th>承保标保(万元)</th>
|
||||
<th>承保件数(件)</th>
|
||||
<th>保费占比(%)</th>
|
||||
<th v-for="(thead, index) in theads" :key="index">{{ thead }}</th>
|
||||
</tr>
|
||||
<tr v-for="i in 5" :key="i * 100">
|
||||
<td>六六大顺营销 服务部门</td>
|
||||
<td>5000</td>
|
||||
<td>200</td>
|
||||
<td>20</td>
|
||||
<template v-if="isInner">
|
||||
<tr v-for="(org, i) in organizationData" :key="i" :class="{ hidden: i >= 5 && !idMoreDataShow }">
|
||||
<td>{{ i + 1 }}</td>
|
||||
<td class="org-name">{{ org.name | blankFilter }}</td>
|
||||
<td>{{ org.ysbfDay | blankFilter }}</td>
|
||||
<td>{{ org.ysbfMon | blankFilter }}</td>
|
||||
<td>{{ org.cbbfDay | blankFilter }}</td>
|
||||
<td>{{ org.cbbfMon | blankFilter }}</td>
|
||||
</tr>
|
||||
<template v-for="i in 20">
|
||||
<tr v-if="idMoreDataShow" :key="i">
|
||||
<td>六六大顺营销 服务部门</td>
|
||||
<td>5000</td>
|
||||
<td>200</td>
|
||||
<td>20</td>
|
||||
<tr v-if="organizationData.length === 0">
|
||||
<td :colspan="theads.length">暂无数据</td>
|
||||
</tr>
|
||||
</template>
|
||||
<template v-else>
|
||||
<tr v-for="(org, i) in performanceData" :key="i" :class="{ hidden: i >= 5 && !idMoreDataShow }">
|
||||
<td>{{ org.rank | blankFilter }}</td>
|
||||
<td>{{ org.name | blankFilter }}</td>
|
||||
<td class="org-name">{{ org.comName | blankFilter }}</td>
|
||||
<td>{{ org.ysbb | blankFilter }}</td>
|
||||
<td>{{ org.bzbf | blankFilter }}</td>
|
||||
</tr>
|
||||
<tr v-if="performanceData.length === 0">
|
||||
<td :colspan="theads.length" style="text-align: left; padding-left: 22%;">暂无数据</td>
|
||||
</tr>
|
||||
</template>
|
||||
</table>
|
||||
@@ -116,21 +125,49 @@
|
||||
import performance from '@/assets/images/goodStart/performanceIcon.png'
|
||||
import product from '@/assets/images/goodStart/product.png'
|
||||
import { getAgentInfo } from '@/api/ebiz/my/my'
|
||||
import { getCongratulationList } from '@/api/ebiz/congratulation/congratulation.js'
|
||||
import dateUtil from '@/assets/js/utils/date-utils.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
idMoreDataShow: false,
|
||||
performance,
|
||||
product,
|
||||
isGoodStart: false
|
||||
isGoodStart: true,
|
||||
isInner: false,
|
||||
organizationTheads: ['排名', '机构', '当日预收(标保)', '月预收标保', '日承保标保', '月承保标保'],
|
||||
performanceTheads: ['排名', '姓名', '营销服务部', '预收标保', '承保标保'],
|
||||
organizationData: [],
|
||||
performanceData: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
theads() {
|
||||
if (this.isInner) {
|
||||
return this.organizationTheads
|
||||
} else {
|
||||
return this.performanceTheads
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getAgentInfo()
|
||||
this.getTableData()
|
||||
},
|
||||
methods: {
|
||||
async getTableData() {
|
||||
let currMonth = dateUtil.formatDate(new Date(), 'yyyy-MM-dd')
|
||||
let data = await getCongratulationList({ date: currMonth, queryType: 'm', type: 'kmh' })
|
||||
if (this.isInner) {
|
||||
this.organizationData = data.content
|
||||
} else {
|
||||
this.performanceData = data.content.list
|
||||
}
|
||||
},
|
||||
async getAgentInfo() {
|
||||
const result = await getAgentInfo({})
|
||||
let reg = /^N.*/
|
||||
this.isInner = reg.test(result.branchType)
|
||||
this.isGoodStart = result.showTemplate === 'KMH'
|
||||
},
|
||||
showMore() {
|
||||
@@ -157,10 +194,8 @@ export default {
|
||||
},
|
||||
//查看详情
|
||||
goDetail(code) {
|
||||
console.log(code)
|
||||
//将产品 code 存起来
|
||||
localStorage.productDetailCode = code
|
||||
console.log(`/product/productDetail${code}`)
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
@@ -197,6 +232,15 @@ export default {
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
blankFilter(val) {
|
||||
if (val) {
|
||||
return val
|
||||
} else {
|
||||
return '-'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -254,7 +298,7 @@ export default {
|
||||
border-collapse: collapse;
|
||||
td,
|
||||
th {
|
||||
padding: 10px 0;
|
||||
padding: 10px 5px;
|
||||
background-color: #fff3f1;
|
||||
color: #d84535;
|
||||
}
|
||||
@@ -313,4 +357,8 @@ span,
|
||||
i {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.org-name {
|
||||
width: 8em;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user