AI销管
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

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