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.
 
 
 
 

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