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.
 
 
 
 

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