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.
 
 
 
 

488 lines
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">{{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. onPullDownRefresh(){
  112. this.gitinit()
  113. setTimeout(function () {
  114. uni.stopPullDownRefresh();
  115. }, 1000);
  116. },
  117. methods: {
  118. anclick(i){
  119. console.log(i)
  120. this.Afolding=!this.Afolding;
  121. this.numlist.forEach((citem,index)=>{
  122. if(index<6){
  123. citem.isshow=true;
  124. }else{
  125. citem.isshow=!citem.isshow;
  126. }
  127. })
  128. this.$forceUpdate()
  129. },
  130. //获取数据
  131. gitinit(){
  132. this.objlist=[];
  133. this.numlist=[];
  134. var dateType='';
  135. if(this.activeTotal==3){
  136. dateType=null;
  137. }else{
  138. dateType=this.activeTotal;
  139. }
  140. let parames={
  141. dateType:dateType,
  142. statDateStart:this.timeobj.statDateStart,
  143. statDateEnd:this.timeobj.statDateEnd,
  144. houseId:this.buildingID
  145. }
  146. this.$u.post("/matchKeywords/findmatchdata", parames).then(data => {
  147. this.numlist.push({
  148. name:"客户数量",
  149. num:data.total
  150. })
  151. data.list.forEach((item,index)=>{
  152. this.numlist.push({
  153. name:item.name,
  154. num:item.total
  155. })
  156. item.activeTab=0;
  157. item.opts={
  158. "title": {
  159. "name": item.total,
  160. "color": '#666666',
  161. "fontSize": 20
  162. },
  163. "subtitle": {
  164. "name": '总触达次数',
  165. "color": '#32363D',
  166. "fontSize": 12,
  167. "offsetY": 4
  168. }
  169. }
  170. item.chartData={
  171. "categories": [],
  172. "series": [{
  173. "data": []
  174. }],
  175. };
  176. item.matchKeywords.forEach(chend=>{
  177. item.chartData.series[0].data.push({
  178. "name":chend.name,
  179. "value": chend.proportion
  180. })
  181. })
  182. if (item.chartData.series[0].data.length > 0) {
  183. item.chartDataShow = true
  184. } else {
  185. item.chartDataShow = false
  186. }
  187. })
  188. data.list.forEach(item=>{
  189. item.matchKeywords.forEach(chend=>{
  190. if(chend.isInterval==0){
  191. chend.name=chend.name+chend.unit+'-'+chend.endName+chend.unit
  192. }else{
  193. chend.name=chend.name
  194. }
  195. })
  196. })
  197. this.objlist=data.list;
  198. this.Afolding=true;
  199. this.numlist.forEach((citem,index)=>{
  200. if(index<6){
  201. citem.isshow=true
  202. }else{
  203. citem.isshow=false
  204. }
  205. })
  206. })
  207. },
  208. //查看
  209. Toview(item,i){
  210. uni.navigateTo({
  211. url: '/pages/center/Piabodata/Customerportrait/Receivingrecords?datatype='+this.activeTotal+"&keywordsId="+item.matchKeywords[i].keywordsId+"&starttime="+this.timeobj.statDateStart+"&endoftime="+this.timeobj.statDateEnd
  212. })
  213. },
  214. //时间切换
  215. tabtimetap(index) {
  216. if (index == 3) {
  217. this.totalTimeShow = true;
  218. } else {
  219. this.activeTotal = index;
  220. this.gitinit()
  221. }
  222. },
  223. //自定义时间
  224. totalTimeChange(e) {
  225. this.timeobj.statDateStart = e.startDate;
  226. this.timeobj.statDateEnd = e.endDate;
  227. this.activeTotal=3;
  228. this.gitinit()
  229. },
  230. charttoswitch(index,num) {
  231. this.objlist[index].activeTab=num
  232. }
  233. }
  234. };
  235. </script>
  236. <style lang="scss" scoped>
  237. .anclack{
  238. width: 100%;
  239. height: 78rpx;
  240. text-align: center;
  241. line-height: 78rpx;
  242. font-size: 30rpx;
  243. border: 1rpx solid #E0E0E0;
  244. font-weight: 400;
  245. color: #666666;
  246. }
  247. .box {
  248. width: 100%;
  249. height: 100%;
  250. background: #FAFAFA;
  251. padding-bottom: 60rpx;
  252. }
  253. .boxtittab {
  254. position: sticky;
  255. top: var(--window-top);
  256. z-index: 999;
  257. width: 100;
  258. height: 92rpx;
  259. background: #FFFFFF;
  260. border: 1px solid #E0E0E0;
  261. display: flex;
  262. align-items: center;
  263. .tabbox {
  264. flex: 1;
  265. height: 100%;
  266. text-align: center;
  267. line-height: 92rpx;
  268. color: #666666;
  269. font-size: 28rpx;
  270. display: flex;
  271. justify-content: center;
  272. .activecllasscet {
  273. width: 96rpx;
  274. border-bottom: 2px solid #2671E2;
  275. }
  276. }
  277. }
  278. .tabtime {
  279. width: 100%;
  280. height: 50rpx;
  281. text-align: center;
  282. line-height: 50rpx;
  283. font-size: 24rpx;
  284. color: #666666;
  285. }
  286. .boxzonglan {
  287. width: 100%;
  288. min-height: 496rpx;
  289. background: #FFFFFF;
  290. padding: 30rpx 30rpx 30rpx 30rpx;
  291. .zonglantit {
  292. font-size: 30rpx;
  293. color: #333333;
  294. font-family: PingFangSC-Semibold, PingFang SC;
  295. font-weight: 600;
  296. }
  297. .zonglanbox {
  298. width: 100%;
  299. display: flex;
  300. flex-wrap: wrap;
  301. margin-top: 24rpx;
  302. .grid {
  303. width: 50%;
  304. height: 128rpx;
  305. border: 1px solid #E0E0E0;
  306. .audonum {
  307. color: #666666;
  308. text-indent: 40rpx;
  309. font-size: 26rpx;
  310. margin-top: 20rpx;
  311. }
  312. .num {
  313. color: #333333;
  314. text-indent: 40rpx;
  315. font-size: 32rpx;
  316. font-weight: 600;
  317. margin-top: 10rpx;
  318. }
  319. }
  320. }
  321. }
  322. .centerfor {
  323. width: 100%;
  324. height: 686rpx;
  325. background: #FFFFFF;
  326. padding-left: 30rpx;
  327. padding-right: 30rpx;
  328. margin-top: 20rpx;
  329. .fortit {
  330. width: 100%;
  331. height: 86rpx;
  332. display: flex;
  333. border-bottom: 1px solid #E0E0E0;
  334. .left {
  335. width: 70%;
  336. height: 100%;
  337. display: flex;
  338. align-items: center;
  339. .lefti {
  340. width: 6rpx;
  341. height: 30rpx;
  342. background: #2671E2;
  343. }
  344. .lefttext {
  345. font-size: 30rpx;
  346. font-family: PingFangSC-Semibold, PingFang SC;
  347. font-weight: 600;
  348. color: #333333;
  349. margin-left: 10rpx;
  350. }
  351. }
  352. .right {
  353. width: 30%;
  354. height: 70rpx;
  355. display: flex;
  356. font-size: 28rpx;
  357. align-items: center;
  358. margin-top: 16rpx;
  359. }
  360. .right view {
  361. width: 92rpx;
  362. height: 50rpx;
  363. text-align: center;
  364. }
  365. }
  366. }
  367. .activeclass {
  368. color: #2671E2;
  369. border-bottom: 2px solid #2671E2;
  370. }
  371. .tabdada {
  372. width: 100%;
  373. height: 580rpx;
  374. overflow-y: auto;
  375. padding-bottom: 20rpx;
  376. }
  377. .tabth {
  378. width: 100%;
  379. height: 28rpx;
  380. display: flex;
  381. font-size: 28rpx;
  382. line-height: 28rpx;
  383. color: #666666;
  384. margin-top: 28rpx;
  385. }
  386. .tabth>view:nth-of-type(1) {
  387. width: 10%;
  388. text-align: center;
  389. }
  390. .tabth>view:nth-of-type(2) {
  391. width: 46%;
  392. text-align: center;
  393. }
  394. .tabth>view:nth-of-type(3) {
  395. width: 22%;
  396. text-align: center;
  397. }
  398. .tabth>view:nth-of-type(4) {
  399. width: 22%;
  400. text-align: center;
  401. }
  402. .tabtd {
  403. width: 100%;
  404. height: 30rpx;
  405. display: flex;
  406. font-size: 26rpx;
  407. line-height: 30rpx;
  408. margin-top: 32rpx;
  409. }
  410. .tabtd>view:nth-of-type(1) {
  411. width: 10%;
  412. text-align: center;
  413. line-height: 30rpx;
  414. }
  415. .tabtd>view:nth-of-type(2) {
  416. width: 46%;
  417. text-align: center;
  418. color: #333333;
  419. }
  420. .tabtd>view:nth-of-type(3) {
  421. width: 22%;
  422. text-align: center;
  423. color: #333333;
  424. }
  425. .tabtd>view:nth-of-type(4) {
  426. width: 22%;
  427. text-align: center;
  428. color: #2671E2;
  429. }
  430. .ranking {
  431. width: 34rpx;
  432. height: 34rpx;
  433. }
  434. .ranking1 {
  435. width: 30rpx;
  436. height: 30rpx;
  437. background: #ECF1FF;
  438. color: #424D64;
  439. font-size: 18rpx;
  440. text-align: center;
  441. line-height: 30rpx;
  442. border-radius: 50%;
  443. margin: 0 auto;
  444. }
  445. .tabech {
  446. width: 100%;
  447. height: 600rpx;
  448. }
  449. </style>