Commit 4cc546f7 by xuyl

解决分群针对不同屏幕尺寸展示个数

1 parent bc8f87b4
......@@ -283,7 +283,7 @@
</span>
<span class="setting" v-if="(userType == 2 && isMerchantStaffAdmin == true) || (userType == 1 && accountLevel == 4)" @click="goToGrouping()">设置</span>
</div>
<div class="itembox">
<div :class="{ fourItemBox: isFourDisplay, fiveItemBox: isFiveDisplay }">
<template v-for="(item, index) in customerSegmentation">
<!-- fn="人群客户列表" mode="div" -->
<div class="item" @click="goToGroupOperating(item)" :key="index" v-if="index < displayNum">
......@@ -397,6 +397,9 @@ export default {
},
data() {
return {
isFourDisplay: '',
isFiveDisplay: '',
screenWidth: null,
displayNum: 4, //展示的数目
closeFlag: false, //展开收起
isAddScrm: true,
......@@ -421,56 +424,6 @@ export default {
silenceCustomerCount: 0
},
customerSegmentation: [], //客户分群展示列表
// titles: [
// {
// name: '新车客户数',
// subName: '购车时间3个月的客户',
// num: 0,
// add: obj => {
// return obj.newCarCustomerAddCount
// },
// noAdd: obj => {
// return obj.newCarCustomerNAddCount
// },
// id: 7
// },
// {
// name: '车险待续保客户数',
// subName: '近一个月内车险即将到期的客户',
// num: 0,
// add: obj => {
// return obj.needRenewalCustomerAddCount
// },
// noAdd: obj => {
// return obj.needRenewalCustomerNAddCount
// },
// id: 8
// },
// {
// name: '新车待首保客户数',
// subName: '购车时间5~7个月内,且无保养记录的客户',
// num: 0,
// add: obj => {
// return obj.burseholderCustomerAddCount
// },
// noAdd: obj => {
// return obj.burseholderCustomerNAddCount
// },
// id: 9
// },
// {
// name: '沉默客户数',
// subName: '超过180天未到店的客户',
// num: 0,
// add: obj => {
// return obj.silenceCustomerAddCount
// },
// noAdd: obj => {
// return obj.silenceCustomerNAddCount
// },
// id: 10
// }
// ],
isNoBuyUp: 0, //默认环比为增
isBuyUp: 0,
bottomDataObj: {},
......@@ -489,8 +442,10 @@ export default {
mounted() {
document.body.style.overflow = 'hidden'
this.screenWidth = document.body.clientWidth
var that = this
window.addEventListener('resize', () => {
that.screenWidth = document.body.clientWidth
that.isReload = false
that.$nextTick(() => {
that.isReload = true
......@@ -503,6 +458,23 @@ export default {
return 0
}
},
watch: {
screenWidth: {
handler: function(val) {
if (val >= 1440) {
this.backupNum = this.displayNum = 5
this.isFourDisplay = false
this.isFiveDisplay = true
} else {
this.backupNum = this.displayNum = 4
this.isFourDisplay = true
this.isFiveDisplay = false
}
},
deep: true
}
},
computed: {
isEmptyObj() {
if (Object.keys(this.topDataObj).length == 0) {
......@@ -549,7 +521,7 @@ export default {
this.displayNum = this.customerSegmentation.length || ''
} else {
this.closeFlag = false
this.displayNum = 4
this.displayNum = this.backupNum
}
},
goToGrouping() {
......@@ -1222,7 +1194,7 @@ export default {
color: #5850ff;
margin-bottom: 20px;
}
.itembox {
.fourItemBox {
margin: 20px 20px 0 20px;
// display: flex;
// justify-content: space-between;
......@@ -1290,6 +1262,74 @@ export default {
}
}
}
.fiveItemBox {
margin: 20px 20px 0 20px;
// display: flex;
// justify-content: space-between;
display: grid;
grid-template-columns: 20% 20% 20% 20% 20%;
.item {
cursor: pointer;
margin-right: 16px;
margin-bottom: 16px;
// width: 25%;
&:nth-child(5n) {
margin-right: 0;
}
.itemTitle {
height: 54px;
background: #f4f6fc;
display: flex;
align-items: center;
.itemName {
font-size: 16px;
font-weight: 600;
padding-left: 16px;
}
}
.itemBottom {
padding-bottom: 20px;
border-left: 1px solid #e5e5e5;
border-right: 1px solid #e5e5e5;
border-bottom: 1px solid #e5e5e5;
.totalNum {
font-size: 26px;
color: #333333;
line-height: 26px;
font-weight: 700;
padding: 24px 0 32px 16px;
.enum {
font-size: 18px;
font-weight: 400;
color: #333333;
vertical-align: middle;
}
}
.middlemsg-qiwei-total {
display: flex;
justify-content: space-between;
.qiwei-describe {
padding: 0px 16px;
.inWechat {
color: #666666;
font-size: 14px;
}
.num {
margin-top: 4px;
font-size: 16px;
color: #333333;
font-weight: 600;
.person-text {
font-size: 14px;
color: #333333;
font-weight: 400;
}
}
}
}
}
}
}
}
.bottommsg {
position: relative;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!