|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680 |
- <template>
- <view class="box">
- <view class="boxtittabs">
- <div class="items" @tap="screenShow = true">{{ showTimeText }}
- <u-icon name="arrow-down" size="24" style="padding-left: 12rpx"></u-icon>
- </div>
- <div class="items" @tap="showTemplate = true">{{ showBeText }}
- <u-icon name="arrow-down" size="24" style="padding-left: 12rpx"></u-icon>
- </div>
- </view>
- <view class="info">
- <view class="item" @click="goTo(1)">
- <text class="num">{{efficient||0}}</text>
- <text class="tit">有效接待</text>
- </view>
- <view class="item" @click="goTo(2)">
- <text class="num">{{markCount||0}}</text>
- <text class="tit">已标顾问</text>
- </view>
- <view class="item" @click="goTo(3)">
- <text class="num">{{noMarkCount||0}}</text>
- <text class="tit">未标顾问</text>
- </view>
- </view>
- <view class="boxzonglan">
- <view class="zonglantit">客群特征总览</view>
- <view class="zonglanbox">
- <view class="grid" v-for="(item,index) in numlist" :key="index" v-if="item.isshow">
- <view class="audonum">
- <view class="circle"></view>
- {{item.name}} {{index!=0?'触达次数':''}}
- </view>
- <view class="num">{{item.num}}</view>
- </view>
- </view>
- <view v-if="Afolding==true" class="anclack" @click="anclick(1)">展开 <u-icon style="margin-left: 8rpx;"
- label-color='#666666' name="arrow-down"></u-icon>
- </view>
- <view v-if="Afolding==false" class="anclack" @click="anclick(2)">收起 <u-icon style="margin-left: 8rpx;"
- label-color='#666666' name="arrow-up"></u-icon>
- </view>
- </view>
- <view class="centerfor" v-for="(item,index) in objlist" :key="index">
- <view class="fortit">
- <view class="left">
- <view class="lefti"></view>
- <view class="lefttext">{{item.name}}触达排名</view>
- </view>
- <view class="right">
- <view :class="{ activeclass: item.activeTab == 0 }" @click="charttoswitch(index,0)">表格</view>
- <view style="margin-left: 16rpx;" :class="{ activeclass: item.activeTab == 1 }"
- @click="charttoswitch(index,1)">饼状图</view>
- </view>
- </view>
- <view v-if="item.activeTab==0" class="tabdada">
- <view class="tabth">
- <view>排名</view>
- <view>画像语意词/触达客户</view>
- <view>触达占比</view>
- <view>沟通记录</view>
- </view>
- <view v-if="item.total==0"
- style="color: #666;font-size:28rpx;width: 100%;height: 500rpx;line-height: 500rpx;text-align: center;">
- 暂无数据</view>
- <view class="tabtd" v-if="item.total" v-for="(chend,i) in item.matchKeywords" :key="i">
- <view>
- <image v-if="i==0" class="ranking" src="../../../static/images/top1.png" mode=""></image>
- <image v-else-if="i==1" class="ranking" src="../../../static/images/top2.png" mode=""></image>
- <image v-else-if="i==2" class="ranking" src="../../../static/images/top3.png" mode=""></image>
- <view class="ranking1" v-else>{{i+1}}</view>
- </view>
- <view>{{chend.name}}({{chend.total}})</view>
- <view>{{chend.proportion}}%</view>
- <view @click="Toview(item,i)">查看</view>
- </view>
- </view>
- <view v-if="item.activeTab==1" class="tabech">
- <template v-if="item.chartDataShow">
- <qiun-data-charts :key="item.id" type="ring" :chartData="item.chartData" :canvas2d="true"
- :canvasId="'wangxiaohuahahahahaha'+item.id" :opts='item.opts' background="none" />
- </template>
- <template v-else>
- <view>
- <view
- style="color: #666;font-size:28rpx;width: 100%;height: 500rpx;line-height: 500rpx;text-align: center;">
- 暂无数据</view>
- </view>
- </template>
- </view>
- </view>
-
- <u-calendar v-model="totalTimeShow" mode="range" @change="totalTimeChange"></u-calendar>
- <u-back-top :scroll-top="scrollTop"></u-back-top>
-
-
-
-
- <!-- 更多筛选 -->
- <u-popup v-model="screenShow" mode="bottom" height="368">
- <view class="screen">
- <view class="boxtittab">
- <view class="tabbox">
- <view :class="{ activecllasscet: activeTotal == 0 }" @click="tabtimetap(0, '今日')">今日</view>
- </view>
- <view class="tabbox">
- <view :class="{ activecllasscet: activeTotal == 1 }" @click="tabtimetap(1, '昨日')">昨日</view>
- </view>
- <view class="tabbox">
- <view :class="{ activecllasscet: activeTotal == 2 }" @click="tabtimetap(2, '近一周')">近一周
- </view>
- </view>
- <view class="tabbox">
- <view :class="{ activecllasscet: activeTotal == 3 }" @click="tabtimetap(3, '自定义')">自定义
- </view>
- </view>
- </view>
- </view>
- </u-popup>
-
- <!-- 销讲业务 -->
- <u-select :mask-close-able="false" label-name="templateName" value-name="id" v-model="showTemplate"
- mode="single-column" :list="templateList" @cancel="templateCancel" @confirm="templateConfirm"></u-select>
-
- </view>
- </template>
-
- <script>
- var app = getApp();
- var util = require("../../../utils/util.js");
- var config = require("../../../config");
- export default {
- data() {
- return {
- scrollTop: 0,
- activeTotal: 2,
- timeobj: {
- statDateStart: '',
- statDateEnd: ''
- },
- buildingID: '',
- totalTimeShow: false,
- activeTab: 0,
- numlist: [],
- objlist: [],
- Afolding: true,
- efficient: "",
- markCount: "",
- noMarkCount: "",
-
-
- screenShow: false, // 时间筛选弹窗
- showTimeText: '近一周', // 展示文字
- showBeText: '全部业务', //
- templateList: [], // 销讲业务
- showTemplate: false, // 展示选择销讲业务弹窗
- marketingBusiness: '', // 选择的业务id
- };
- },
- onPageScroll(e) {
- this.scrollTop = e.scrollTop;
- },
- onLoad() {
- this.buildingID = uni.getStorageSync('buildingID').id;
- this.gitinit()
- this.getMarketingBusiness()
- },
- onPullDownRefresh() {
- this.gitinit()
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 1000);
- },
- methods: { // 销讲业务方法
- templateCancel() {
- this.showTemplate = false;
- },
-
- // 确认选择销讲业务
- templateConfirm(e) {
- this.showTemplate = false;
- this.marketingBusiness = e[0].value
- this.showBeText = e[0].label
- this.gitinit()
- },
-
-
- // 获取销讲业务
- getMarketingBusiness() {
- this.$u.get('/customer/marketingBusiness', {
- houseId: uni.getStorageSync('buildingID').id,
- }).then(res => {
- this.templateList = res
- this.templateList.unshift({
- templateName: '全部业务',
- id: ''
- })
- })
- },
-
- goTo(i) {
- if (i == 1) {
- uni.navigateTo({
- url: '/pages/center/records/index?refresh=' + 'refresh' + '&activeTotal=' + this
- .activeTotal + '&validInvalid=0' + '&staTime=' + this.timeobj.statDateStart +
- '&endtime=' + this.timeobj.statDateEnd
- });
- } else if (i == 2) {
- uni.navigateTo({
- url: '/pages/center/records/index?refresh=' + 'refresh' + '&activeTotal=' + this
- .activeTotal + '&markAdvisor=1&validInvalid=0' + '&staTime=' + this.timeobj
- .statDateStart + '&endtime=' + this.timeobj.statDateEnd
- });
- } else {
- uni.navigateTo({
- url: '/pages/center/records/index?refresh=' + 'refresh' + '&activeTotal=' + this
- .activeTotal + '&markAdvisor=0&validInvalid=0' + '&staTime=' + this.timeobj
- .statDateStart + '&endtime=' + this.timeobj.statDateEnd
- });
- }
- },
- anclick(i) {
- console.log(i)
- this.Afolding = !this.Afolding;
- this.numlist.forEach((citem, index) => {
- if (index < 6) {
- citem.isshow = true;
- } else {
- citem.isshow = !citem.isshow;
- }
- })
- this.$forceUpdate()
-
- },
- //获取数据
- gitinit() {
- this.objlist = [];
- this.numlist = [];
- var dateType = '';
- if (this.activeTotal == 3) {
- dateType = null;
- } else {
- dateType = this.activeTotal;
- }
- let parames = {
- dateType: dateType,
- statDateStart: this.timeobj.statDateStart,
- statDateEnd: this.timeobj.statDateEnd,
- houseId: this.buildingID,
- marketingBusiness: this.marketingBusiness,
- }
- this.$u.post("/matchKeywords/findmatchdata", parames).then(data => {
- // this.numlist.push({
- // name:"有效接待",
- // num:data.total
- // })
- data.list.forEach((item, index) => {
- this.numlist.push({
- name: item.name,
- num: item.total
- })
-
- this.efficient = data.total
- this.markCount = data.markCount
- this.noMarkCount = data.noMarkCount
-
-
- item.activeTab = 0;
- item.opts = {
- "title": {
- "name": item.total,
- "color": '#666666',
- "fontSize": 20
- },
- "subtitle": {
- "name": '总触达次数',
- "color": '#32363D',
- "fontSize": 12,
- "offsetY": 4
- }
- }
- item.chartData = {
- "categories": [],
- "series": [{
- "data": []
- }],
- };
- item.matchKeywords.forEach(chend => {
- item.chartData.series[0].data.push({
- "name": chend.name,
- "value": chend.proportion
- })
- })
- if (item.chartData.series[0].data.length > 0) {
- item.chartDataShow = true
- } else {
- item.chartDataShow = false
- }
- })
- data.list.forEach(item => {
- item.matchKeywords.forEach(chend => {
- if (chend.isInterval == 0) {
- chend.name = chend.name + chend.unit + '-' + chend.endName + chend
- .unit
- } else {
- chend.name = chend.name
- }
- })
- })
- this.objlist = data.list;
- this.Afolding = true;
- this.numlist.forEach((citem, index) => {
- if (index < 6) {
- citem.isshow = true
- } else {
- citem.isshow = false
- }
- })
- })
- },
- //查看
- Toview(item, i) {
- uni.navigateTo({
- url: '/pages/center/Piabodata/Customerportrait/Receivingrecords?datatype=' + this.activeTotal +
- "&keywordsId=" + item.matchKeywords[i].keywordsId + "&starttime=" + this.timeobj
- .statDateStart + "&endoftime=" + this.timeobj.statDateEnd+'&marketingBusiness='+this.marketingBusiness
- })
- },
- //时间切换
- tabtimetap(index, text) {
- if (index == 3) {
- this.totalTimeShow = true;
- this.screenShow = false
- } else {
- this.screenShow = false
- this.showTimeText = text
- this.activeTotal = index;
- this.gitinit()
- }
- },
- //自定义时间
- totalTimeChange(e) {
- this.screenShow = false
- this.showTimeText = `${e.startDate}-${e.endDate}`
- this.timeobj.statDateStart = e.startDate;
- this.timeobj.statDateEnd = e.endDate;
- this.activeTotal = 3;
- this.gitinit()
- },
- charttoswitch(index, num) {
- this.objlist[index].activeTab = num
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .boxtittabs {
- width: 100%;
- height: 92rpx;
- background: #FFFFFF;
- display: flex;
- align-items: center;
-
- .items {
- padding: 0 24rpx;
- width: 50%;
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- }
- .screen {
- width: 100%;
-
- .boxtittab {
- width: 100%;
- flex-direction: column;
- border: none;
- .tabbox {
- width: 100%;
- }
- }
- }
- .info {
- display: flex;
- justify-content: space-between;
- background: #fff;
- padding: 20rpx 40rpx;
-
- .item {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
-
- text {
- font-size: 32rpx;
- }
-
- .num {
- font-weight: bold;
- }
-
- .tit {
- margin-top: 20rpx;
- }
- }
- }
-
- .anclack {
- width: 100%;
- height: 78rpx;
- text-align: center;
- line-height: 78rpx;
- font-size: 30rpx;
- // border: 1rpx solid #E0E0E0;
- font-weight: 400;
- color: #666666;
- }
-
- .box {
- width: 100%;
- height: 100%;
- background: #FAFAFA;
- }
-
- .boxtittab {
- position: sticky;
- top: var(--window-top);
- z-index: 999;
- width: 100;
- height: 92rpx;
- background: #FFFFFF;
- border: 1px solid #E0E0E0;
- display: flex;
- align-items: center;
-
- .tabbox {
- flex: 1;
- height: 100%;
- text-align: center;
- line-height: 92rpx;
- color: #666666;
- font-size: 28rpx;
- display: flex;
- justify-content: center;
-
- .activecllasscet {
- width: 96rpx;
- color: #2671E2;
- border-bottom: 4rpx solid #2671E2;
- }
- }
- }
-
- .tabtime {
- width: 100%;
- height: 50rpx;
- text-align: center;
- line-height: 50rpx;
- font-size: 24rpx;
- color: #666666;
- }
-
- .boxzonglan {
- margin-top: 20rpx;
- border-radius: 12rpx;
- width: 100%;
- min-height: 496rpx;
- background: #FFFFFF;
- padding: 30rpx 30rpx 30rpx 30rpx;
-
- .zonglantit {
- font-size: 30rpx;
- color: #333333;
- font-family: PingFangSC-Semibold, PingFang SC;
- font-weight: 600;
- }
-
- .zonglanbox {
- width: 100%;
- display: flex;
- flex-wrap: wrap;
- margin-top: 24rpx;
-
- .grid {
- width: 50%;
- padding-left: 10rpx;
-
- &:nth-child(odd) {
- border-bottom: 1rpx solid #E0E0E0;
- border-right: 1rpx solid #E0E0E0;
- }
-
- &:nth-child(even) {
- border-bottom: 1rpx solid #E0E0E0;
- // border-right: 1rpx solid #E0E0E0;
- }
-
- .audonum {
- color: #666666;
- text-indent: 40rpx;
- font-size: 28rpx;
- margin: 20rpx 0 18rpx;
- line-height: 40rpx;
- display: flex;
- align-items: center;
-
- .circle {
- margin-right: 12rpx;
- width: 20rpx;
- height: 20rpx;
- background: #FFFFFF;
- border-radius: 50%;
- border: 6rpx solid #2671E2;
- }
- }
-
- .num {
- color: #333333;
- font-size: 44rpx;
- font-weight: bold;
- margin: 18rpx 0 0;
- }
- }
- }
- }
-
- .centerfor {
- width: 100%;
- height: 686rpx;
- background: #FFFFFF;
- padding-left: 30rpx;
- padding-right: 30rpx;
- margin-top: 20rpx;
-
- .fortit {
- width: 100%;
- height: 86rpx;
- display: flex;
-
- .left {
- width: 70%;
- height: 100%;
- display: flex;
- align-items: center;
-
- .lefti {
- width: 6rpx;
- height: 30rpx;
- background: #2671E2;
- }
-
- .lefttext {
- font-size: 30rpx;
- font-family: PingFangSC-Semibold, PingFang SC;
- font-weight: 600;
- color: #333333;
- margin-left: 10rpx;
- }
- }
-
- .right {
- width: 30%;
- height: 70rpx;
- display: flex;
- font-size: 28rpx;
- align-items: center;
- margin-top: 16rpx;
-
- }
-
- .right view {
- width: 92rpx;
- height: 50rpx;
- text-align: center;
- }
- }
- }
-
- .activeclass {
- color: #2671E2;
- border-bottom: 4rpx solid #2671E2;
- }
-
- .tabdada {
- width: 100%;
- height: 580rpx;
- overflow-y: auto;
- padding-bottom: 20rpx;
- }
-
- .tabth {
- width: 100%;
- height: 40rpx;
- display: flex;
- font-size: 28rpx;
- line-height: 40rpx;
- color: #666666;
- margin-top: 20rpx;
- }
-
- .tabth>view:nth-of-type(1) {
- width: 10%;
- text-align: center;
- }
-
- .tabth>view:nth-of-type(2) {
- width: 46%;
- text-align: center;
- }
-
- .tabth>view:nth-of-type(3) {
- width: 22%;
- text-align: center;
- }
-
- .tabth>view:nth-of-type(4) {
- width: 22%;
- text-align: center;
- }
-
- .tabtd {
- width: 100%;
- height: 30rpx;
- display: flex;
- font-size: 26rpx;
- line-height: 30rpx;
- margin-top: 32rpx;
- }
-
- .tabtd>view:nth-of-type(1) {
- width: 10%;
- text-align: center;
- line-height: 30rpx;
- }
-
- .tabtd>view:nth-of-type(2) {
- width: 46%;
- text-align: center;
- color: #333333;
- }
-
- .tabtd>view:nth-of-type(3) {
- width: 22%;
- text-align: center;
- color: #333333;
- }
-
- .tabtd>view:nth-of-type(4) {
- width: 22%;
- text-align: center;
- color: #2671E2;
- }
-
- .ranking {
- width: 44rpx;
- height: 44rpx;
- }
-
- .ranking1 {
- width: 40rpx;
- height: 40rpx;
- background: #E5F0FF;
- color: #333;
- font-size: 24rpx;
- text-align: center;
- line-height: 40rpx;
- border-radius: 50%;
- margin: 0 auto;
- }
-
- .tabech {
- width: 100%;
- height: 600rpx;
- }
- </style>
|