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

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