AI销管
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

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