25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

538 lines
12 KiB

  1. <template>
  2. <view class="box">
  3. <view class="boxtittab">
  4. <view class="tabbox">
  5. <view :class="{ activecllasscet: activeTotal == 0 }" @click="tabtimetap(0)">今日</view>
  6. </view>
  7. <view class="tabbox">
  8. <view :class="{ activecllasscet: activeTotal == 1 }" @click="tabtimetap(1)">昨日</view>
  9. </view>
  10. <view class="tabbox">
  11. <view :class="{ activecllasscet: activeTotal == 2 }" @click="tabtimetap(2)">近一周</view>
  12. </view>
  13. <view class="tabbox">
  14. <view :class="{ activecllasscet: activeTotal == 3 }" @click="tabtimetap(3)">自定义</view>
  15. </view>
  16. </view>
  17. <view class="info">
  18. <view class="item" @click="goTo(1)">
  19. <text class="num">{{efficient}}</text>
  20. <text class="tit">有效接待</text>
  21. </view>
  22. <view class="item" @click="goTo(2)">
  23. <text class="num">{{markCount}}</text>
  24. <text class="tit">已标顾问</text>
  25. </view>
  26. <view class="item" @click="goTo(3)">
  27. <text class="num">{{noMarkCount}}</text>
  28. <text class="tit">未标顾问</text>
  29. </view>
  30. </view>
  31. <view class="boxzonglan">
  32. <view class="zonglantit">客群特征总览</view>
  33. <view class="zonglanbox">
  34. <view class="grid" v-for="(item,index) in numlist" :key="index" v-if="item.isshow">
  35. <view class="audonum">{{item.name}}<text v-if="index!=0">触达次数</text></view>
  36. <view class="num">{{item.num}}</view>
  37. </view>
  38. </view>
  39. <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>
  40. <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>
  41. </view>
  42. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  43. <view class="centerfor" v-for="(item,index) in objlist" :key="index">
  44. <view class="fortit">
  45. <view class="left">
  46. <view class="lefti"></view>
  47. <view class="lefttext">{{item.name}}触达排名</view>
  48. </view>
  49. <view class="right">
  50. <view :class="{ activeclass: item.activeTab == 0 }" @click="charttoswitch(index,0)">表格</view>
  51. <view style="margin-left: 16rpx;" :class="{ activeclass: item.activeTab == 1 }"
  52. @click="charttoswitch(index,1)">饼状图</view>
  53. </view>
  54. </view>
  55. <view v-if="item.activeTab==0" class="tabdada">
  56. <view class="tabth">
  57. <view>排名</view>
  58. <view>画像语意词/触达客户</view>
  59. <view>触达占比</view>
  60. <view>沟通记录</view>
  61. </view>
  62. <view v-if="item.total==0" style="color: #999999;width: 100%;height: 500rpx;line-height: 500rpx;text-align: center;" >暂无数据</view>
  63. <view class="tabtd" v-if="item.total!=0" v-for="(chend,i) in item.matchKeywords" :key="i">
  64. <view>
  65. <image v-if="i==0" class="ranking" src="../../../static/images/ranking1.png" mode=""></image>
  66. <image v-else-if="i==1" class="ranking" src="../../../static/images/ranking2.png" mode=""></image>
  67. <image v-else-if="i==2" class="ranking" src="../../../static/images/ranking3.png" mode=""></image>
  68. <view class="ranking1" v-else>{{i+1}}</view>
  69. </view>
  70. <view>{{chend.name}}({{chend.total}})</view>
  71. <view>{{chend.proportion}}%</view>
  72. <view @click="Toview(item,i)">查看</view>
  73. </view>
  74. </view>
  75. <view v-if="item.activeTab==1" class="tabech">
  76. <qiun-data-charts
  77. :key="item.id"
  78. type="ring"
  79. :chartData="item.chartData"
  80. :canvas2d="true"
  81. :canvasId="'wangxiaohuahahahahaha'+item.id"
  82. :opts='item.opts'
  83. background="none" />
  84. </view>
  85. </view>
  86. <u-calendar v-model="totalTimeShow" mode="range" @change="totalTimeChange"></u-calendar>
  87. <u-back-top :scroll-top="scrollTop"></u-back-top>
  88. </view>
  89. </template>
  90. <script>
  91. var app = getApp();
  92. var util = require("../../../utils/util.js");
  93. var config = require("../../../config");
  94. export default {
  95. data() {
  96. return {
  97. scrollTop: 0,
  98. activeTotal: 2,
  99. timeobj:{
  100. statDateStart:'',
  101. statDateEnd:''
  102. },
  103. buildingID:'',
  104. totalTimeShow: false,
  105. activeTab: 0,
  106. numlist:[],
  107. objlist:[],
  108. Afolding:true,
  109. efficient:"",
  110. markCount:"",
  111. noMarkCount:""
  112. };
  113. },
  114. onPageScroll(e) {
  115. this.scrollTop = e.scrollTop;
  116. },
  117. onLoad() {
  118. this.buildingID=uni.getStorageSync('buildingID').id;
  119. this.gitinit()
  120. },
  121. onPullDownRefresh() {
  122. this.gitinit()
  123. setTimeout(function () {
  124. uni.stopPullDownRefresh();
  125. }, 1000);
  126. },
  127. methods: {
  128. goTo(i){
  129. if(i==1){
  130. uni.navigateTo({
  131. url: '/pages/center/records/index?refresh='+'refresh'+'&activeTotal='+this.activeTotal+'&validInvalid=0'+'&staTime='+this.timeobj.statDateStart+'&endtime='+this.timeobj.statDateEnd
  132. });
  133. }else if(i==2){
  134. uni.navigateTo({
  135. url: '/pages/center/records/index?refresh='+'refresh'+'&activeTotal='+this.activeTotal+'&markAdvisor=1'+'&staTime='+this.timeobj.statDateStart+'&endtime='+this.timeobj.statDateEnd
  136. });
  137. }else{
  138. uni.navigateTo({
  139. url: '/pages/center/records/index?refresh='+'refresh'+'&activeTotal='+this.activeTotal+'&markAdvisor=0'+'&staTime='+this.timeobj.statDateStart+'&endtime='+this.timeobj.statDateEnd
  140. });
  141. }
  142. },
  143. anclick(i){
  144. console.log(i)
  145. this.Afolding=!this.Afolding;
  146. this.numlist.forEach((citem,index)=>{
  147. if(index<6){
  148. citem.isshow=true;
  149. }else{
  150. citem.isshow=!citem.isshow;
  151. }
  152. })
  153. this.$forceUpdate()
  154. },
  155. //获取数据
  156. gitinit(){
  157. this.objlist=[];
  158. this.numlist=[];
  159. var dateType='';
  160. if(this.activeTotal==3){
  161. dateType=null;
  162. }else{
  163. dateType=this.activeTotal;
  164. }
  165. let parames={
  166. dateType:dateType,
  167. statDateStart:this.timeobj.statDateStart,
  168. statDateEnd:this.timeobj.statDateEnd,
  169. houseId:this.buildingID
  170. }
  171. this.$u.post("/matchKeywords/findmatchdata", parames).then(data => {
  172. this.numlist.push({
  173. name:"有效接待",
  174. num:data.total
  175. })
  176. this.efficient = data.total
  177. this.markCount = data.markCount
  178. this.noMarkCount = data.noMarkCount
  179. data.list.forEach((item,index)=>{
  180. this.numlist.push({
  181. name:item.name,
  182. num:item.total
  183. })
  184. item.activeTab=0;
  185. item.opts={
  186. "title": {
  187. "name": item.total,
  188. "color": '#666666',
  189. "fontSize": 20
  190. },
  191. "subtitle": {
  192. "name": '总触达次数',
  193. "color": '#32363D',
  194. "fontSize": 12,
  195. "offsetY": 4
  196. }
  197. }
  198. item.chartData={
  199. "categories": [],
  200. "series": [{
  201. "data": []
  202. }],
  203. };
  204. item.matchKeywords.forEach(chend=>{
  205. item.chartData.series[0].data.push({
  206. "name":chend.name,
  207. "value": chend.proportion
  208. })
  209. })
  210. })
  211. data.list.forEach(item=>{
  212. item.matchKeywords.forEach(chend=>{
  213. if(chend.isInterval==0){
  214. chend.name=chend.name+chend.unit+'-'+chend.endName+chend.unit
  215. }else{
  216. chend.name=chend.name
  217. }
  218. })
  219. })
  220. this.objlist=data.list;
  221. this.Afolding=true;
  222. this.numlist.forEach((citem,index)=>{
  223. if(index<6){
  224. citem.isshow=true
  225. }else{
  226. citem.isshow=false
  227. }
  228. })
  229. })
  230. },
  231. //查看
  232. Toview(item,i){
  233. console.log(item)
  234. let keywordsid = 0
  235. if (item.matchKeywords[i].children && item.matchKeywords[i].children.length > 0) {
  236. keywordsid = item.matchKeywords[i].children[0].keywordsId
  237. } else {
  238. keywordsid = item.matchKeywords[i].keywordsId
  239. }
  240. uni.navigateTo({
  241. url: '/pages/center/Piabodata/Customerportrait/Receivingrecords?datatype='+this.activeTotal+"&keywordsId="+keywordsid+"&starttime="+this.timeobj.statDateStart+"&endoftime="+this.timeobj.statDateEnd
  242. })
  243. },
  244. //时间切换
  245. tabtimetap(index) {
  246. if (index == 3) {
  247. this.totalTimeShow = true;
  248. } else {
  249. this.activeTotal = index;
  250. this.gitinit()
  251. }
  252. },
  253. //自定义时间
  254. totalTimeChange(e) {
  255. this.timeobj.statDateStart = e.startDate;
  256. this.timeobj.statDateEnd = e.endDate;
  257. this.activeTotal=3;
  258. this.gitinit()
  259. },
  260. charttoswitch(index,num) {
  261. this.objlist[index].activeTab=num
  262. }
  263. }
  264. };
  265. </script>
  266. <style lang="scss" scoped>
  267. .info{
  268. display: flex;
  269. justify-content: space-between;
  270. background: #fff;
  271. padding: 10px 20px;
  272. .item{
  273. display: flex;
  274. flex-direction: column;
  275. justify-content: center;
  276. align-items: center;
  277. text{
  278. font-size: 32rpx;
  279. }
  280. .num{
  281. font-weight: bold;
  282. }
  283. .tit{
  284. margin-top: 20rpx;
  285. }
  286. }
  287. }
  288. .anclack{
  289. width: 100%;
  290. height: 78rpx;
  291. text-align: center;
  292. line-height: 78rpx;
  293. font-size: 30rpx;
  294. border: 1rpx solid #E0E0E0;
  295. font-weight: 400;
  296. color: #666666;
  297. }
  298. .box {
  299. width: 100%;
  300. height: 100%;
  301. background: #FAFAFA;
  302. padding-bottom: 60rpx;
  303. }
  304. .boxtittab {
  305. width: 100;
  306. height: 92rpx;
  307. background: #FFFFFF;
  308. border: 1px solid #E0E0E0;
  309. display: flex;
  310. align-items: center;
  311. .tabbox {
  312. flex: 1;
  313. height: 100%;
  314. text-align: center;
  315. line-height: 92rpx;
  316. color: #666666;
  317. font-size: 28rpx;
  318. display: flex;
  319. justify-content: center;
  320. .activecllasscet {
  321. width: 96rpx;
  322. border-bottom: 2px solid #2671E2;
  323. }
  324. }
  325. }
  326. .tabtime {
  327. width: 100%;
  328. height: 50rpx;
  329. text-align: center;
  330. line-height: 50rpx;
  331. font-size: 24rpx;
  332. color: #666666;
  333. }
  334. .boxzonglan {
  335. width: 100%;
  336. min-height: 496rpx;
  337. background: #FFFFFF;
  338. padding: 30rpx 30rpx 30rpx 30rpx;
  339. .zonglantit {
  340. font-size: 30rpx;
  341. color: #333333;
  342. font-family: PingFangSC-Semibold, PingFang SC;
  343. font-weight: 600;
  344. }
  345. .zonglanbox {
  346. width: 100%;
  347. display: flex;
  348. flex-wrap: wrap;
  349. margin-top: 24rpx;
  350. .grid {
  351. width: 50%;
  352. height: 128rpx;
  353. border: 1px solid #E0E0E0;
  354. .audonum {
  355. color: #666666;
  356. text-indent: 40rpx;
  357. font-size: 26rpx;
  358. margin-top: 20rpx;
  359. }
  360. .num {
  361. color: #333333;
  362. text-indent: 40rpx;
  363. font-size: 32rpx;
  364. font-weight: 600;
  365. margin-top: 10rpx;
  366. }
  367. }
  368. }
  369. }
  370. .centerfor {
  371. width: 100%;
  372. height: 686rpx;
  373. background: #FFFFFF;
  374. padding-left: 30rpx;
  375. padding-right: 30rpx;
  376. margin-top: 20rpx;
  377. .fortit {
  378. width: 100%;
  379. height: 86rpx;
  380. display: flex;
  381. border-bottom: 1px solid #E0E0E0;
  382. .left {
  383. width: 70%;
  384. height: 100%;
  385. display: flex;
  386. align-items: center;
  387. .lefti {
  388. width: 6rpx;
  389. height: 30rpx;
  390. background: #2671E2;
  391. }
  392. .lefttext {
  393. font-size: 30rpx;
  394. font-family: PingFangSC-Semibold, PingFang SC;
  395. font-weight: 600;
  396. color: #333333;
  397. margin-left: 10rpx;
  398. }
  399. }
  400. .right {
  401. width: 30%;
  402. height: 70rpx;
  403. display: flex;
  404. font-size: 28rpx;
  405. align-items: center;
  406. margin-top: 16rpx;
  407. }
  408. .right view {
  409. width: 92rpx;
  410. height: 50rpx;
  411. text-align: center;
  412. }
  413. }
  414. }
  415. .activeclass {
  416. color: #2671E2;
  417. border-bottom: 2px solid #2671E2;
  418. }
  419. .tabdada {
  420. width: 100%;
  421. height: 580rpx;
  422. overflow-y: auto;
  423. padding-bottom: 20rpx;
  424. }
  425. .tabth {
  426. width: 100%;
  427. height: 28rpx;
  428. display: flex;
  429. font-size: 28rpx;
  430. line-height: 28rpx;
  431. color: #666666;
  432. margin-top: 28rpx;
  433. }
  434. .tabth>view:nth-of-type(1) {
  435. width: 10%;
  436. text-align: center;
  437. }
  438. .tabth>view:nth-of-type(2) {
  439. width: 46%;
  440. text-align: center;
  441. }
  442. .tabth>view:nth-of-type(3) {
  443. width: 22%;
  444. text-align: center;
  445. }
  446. .tabth>view:nth-of-type(4) {
  447. width: 22%;
  448. text-align: center;
  449. }
  450. .tabtd {
  451. width: 100%;
  452. height: 30rpx;
  453. display: flex;
  454. font-size: 26rpx;
  455. line-height: 30rpx;
  456. margin-top: 32rpx;
  457. }
  458. .tabtd>view:nth-of-type(1) {
  459. width: 10%;
  460. text-align: center;
  461. line-height: 30rpx;
  462. }
  463. .tabtd>view:nth-of-type(2) {
  464. width: 46%;
  465. text-align: center;
  466. color: #333333;
  467. }
  468. .tabtd>view:nth-of-type(3) {
  469. width: 22%;
  470. text-align: center;
  471. color: #333333;
  472. }
  473. .tabtd>view:nth-of-type(4) {
  474. width: 22%;
  475. text-align: center;
  476. color: #2671E2;
  477. }
  478. .ranking {
  479. width: 34rpx;
  480. height: 34rpx;
  481. }
  482. .ranking1 {
  483. width: 30rpx;
  484. height: 30rpx;
  485. background: #ECF1FF;
  486. color: #424D64;
  487. font-size: 18rpx;
  488. text-align: center;
  489. line-height: 30rpx;
  490. border-radius: 50%;
  491. margin: 0 auto;
  492. }
  493. .tabech {
  494. width: 100%;
  495. height: 600rpx;
  496. }
  497. </style>