Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

490 linhas
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. <qiun-data-charts
  63. :key="item.id"
  64. type="ring"
  65. :chartData="item.chartData"
  66. :canvas2d="true"
  67. :canvasId="'wangxiaohuahahahahaha'+item.id"
  68. :opts='item.opts'
  69. background="none" />
  70. </view>
  71. </view>
  72. <u-calendar v-model="totalTimeShow" mode="range" @change="totalTimeChange"></u-calendar>
  73. <u-back-top :scroll-top="scrollTop"></u-back-top>
  74. </view>
  75. </template>
  76. <script>
  77. var app = getApp();
  78. var util = require("../../../utils/util.js");
  79. var config = require("../../../config");
  80. export default {
  81. data() {
  82. return {
  83. scrollTop: 0,
  84. activeTotal: 2,
  85. timeobj:{
  86. statDateStart:'',
  87. statDateEnd:''
  88. },
  89. buildingID:'',
  90. totalTimeShow: false,
  91. activeTab: 0,
  92. numlist:[],
  93. objlist:[],
  94. Afolding:true
  95. };
  96. },
  97. onPageScroll(e) {
  98. this.scrollTop = e.scrollTop;
  99. },
  100. onLoad(e) {
  101. this.buildingID=uni.getStorageSync('buildingID').id;
  102. if (e.activeTotal) {
  103. this.activeTotal = e.activeTotal
  104. }
  105. if (e.staTime) {
  106. this.timeobj = {
  107. statDateStart: e.staTime,
  108. statDateEnd: e.endtime
  109. }
  110. }
  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. })
  185. data.list.forEach(item=>{
  186. item.matchKeywords.forEach(chend=>{
  187. if(chend.isInterval==0){
  188. chend.name=chend.name+chend.unit+'-'+chend.endName+chend.unit
  189. }else{
  190. chend.name=chend.name
  191. }
  192. })
  193. })
  194. this.objlist=data.list;
  195. this.Afolding=true;
  196. this.numlist.forEach((citem,index)=>{
  197. if(index<6){
  198. citem.isshow=true
  199. }else{
  200. citem.isshow=false
  201. }
  202. })
  203. })
  204. },
  205. //查看
  206. Toview(item,i){
  207. console.log(item)
  208. let keywordsid = 0
  209. if (item.matchKeywords[i].children && item.matchKeywords[i].children.length > 0) {
  210. keywordsid = item.matchKeywords[i].children[0].keywordsId
  211. } else {
  212. keywordsid = item.matchKeywords[i].keywordsId
  213. }
  214. uni.navigateTo({
  215. url: '/pages/center/Piabodata/Customerportrait/Receivingrecords?datatype='+this.activeTotal+"&keywordsId="+keywordsid+"&starttime="+this.timeobj.statDateStart+"&endoftime="+this.timeobj.statDateEnd
  216. })
  217. },
  218. //时间切换
  219. tabtimetap(index) {
  220. if (index == 3) {
  221. this.totalTimeShow = true;
  222. } else {
  223. this.activeTotal = index;
  224. this.gitinit()
  225. }
  226. },
  227. //自定义时间
  228. totalTimeChange(e) {
  229. this.timeobj.statDateStart = e.startDate;
  230. this.timeobj.statDateEnd = e.endDate;
  231. this.activeTotal=3;
  232. this.gitinit()
  233. },
  234. charttoswitch(index,num) {
  235. this.objlist[index].activeTab=num
  236. }
  237. }
  238. };
  239. </script>
  240. <style lang="scss" scoped>
  241. .anclack{
  242. width: 100%;
  243. height: 78rpx;
  244. text-align: center;
  245. line-height: 78rpx;
  246. font-size: 30rpx;
  247. border: 1rpx solid #E0E0E0;
  248. font-weight: 400;
  249. color: #666666;
  250. }
  251. .box {
  252. width: 100%;
  253. height: 100%;
  254. background: #FAFAFA;
  255. padding-bottom: 60rpx;
  256. }
  257. .boxtittab {
  258. width: 100;
  259. height: 92rpx;
  260. background: #FFFFFF;
  261. border: 1px solid #E0E0E0;
  262. display: flex;
  263. align-items: center;
  264. .tabbox {
  265. flex: 1;
  266. height: 100%;
  267. text-align: center;
  268. line-height: 92rpx;
  269. color: #666666;
  270. font-size: 28rpx;
  271. display: flex;
  272. justify-content: center;
  273. .activecllasscet {
  274. width: 96rpx;
  275. border-bottom: 2px solid #2671E2;
  276. }
  277. }
  278. }
  279. .tabtime {
  280. width: 100%;
  281. height: 50rpx;
  282. text-align: center;
  283. line-height: 50rpx;
  284. font-size: 24rpx;
  285. color: #666666;
  286. }
  287. .boxzonglan {
  288. width: 100%;
  289. min-height: 496rpx;
  290. background: #FFFFFF;
  291. padding: 30rpx 30rpx 30rpx 30rpx;
  292. .zonglantit {
  293. font-size: 30rpx;
  294. color: #333333;
  295. font-family: PingFangSC-Semibold, PingFang SC;
  296. font-weight: 600;
  297. }
  298. .zonglanbox {
  299. width: 100%;
  300. display: flex;
  301. flex-wrap: wrap;
  302. margin-top: 24rpx;
  303. .grid {
  304. width: 50%;
  305. height: 128rpx;
  306. border: 1px solid #E0E0E0;
  307. .audonum {
  308. color: #666666;
  309. text-indent: 40rpx;
  310. font-size: 26rpx;
  311. margin-top: 20rpx;
  312. }
  313. .num {
  314. color: #333333;
  315. text-indent: 40rpx;
  316. font-size: 32rpx;
  317. font-weight: 600;
  318. margin-top: 10rpx;
  319. }
  320. }
  321. }
  322. }
  323. .centerfor {
  324. width: 100%;
  325. height: 686rpx;
  326. background: #FFFFFF;
  327. padding-left: 30rpx;
  328. padding-right: 30rpx;
  329. margin-top: 20rpx;
  330. .fortit {
  331. width: 100%;
  332. height: 86rpx;
  333. display: flex;
  334. border-bottom: 1px solid #E0E0E0;
  335. .left {
  336. width: 70%;
  337. height: 100%;
  338. display: flex;
  339. align-items: center;
  340. .lefti {
  341. width: 6rpx;
  342. height: 30rpx;
  343. background: #2671E2;
  344. }
  345. .lefttext {
  346. font-size: 30rpx;
  347. font-family: PingFangSC-Semibold, PingFang SC;
  348. font-weight: 600;
  349. color: #333333;
  350. margin-left: 10rpx;
  351. }
  352. }
  353. .right {
  354. width: 30%;
  355. height: 70rpx;
  356. display: flex;
  357. font-size: 28rpx;
  358. align-items: center;
  359. margin-top: 16rpx;
  360. }
  361. .right view {
  362. width: 92rpx;
  363. height: 50rpx;
  364. text-align: center;
  365. }
  366. }
  367. }
  368. .activeclass {
  369. color: #2671E2;
  370. border-bottom: 2px solid #2671E2;
  371. }
  372. .tabdada {
  373. width: 100%;
  374. height: 580rpx;
  375. overflow-y: auto;
  376. padding-bottom: 20rpx;
  377. }
  378. .tabth {
  379. width: 100%;
  380. height: 28rpx;
  381. display: flex;
  382. font-size: 28rpx;
  383. line-height: 28rpx;
  384. color: #666666;
  385. margin-top: 28rpx;
  386. }
  387. .tabth>view:nth-of-type(1) {
  388. width: 10%;
  389. text-align: center;
  390. }
  391. .tabth>view:nth-of-type(2) {
  392. width: 46%;
  393. text-align: center;
  394. }
  395. .tabth>view:nth-of-type(3) {
  396. width: 22%;
  397. text-align: center;
  398. }
  399. .tabth>view:nth-of-type(4) {
  400. width: 22%;
  401. text-align: center;
  402. }
  403. .tabtd {
  404. width: 100%;
  405. height: 30rpx;
  406. display: flex;
  407. font-size: 26rpx;
  408. line-height: 30rpx;
  409. margin-top: 32rpx;
  410. }
  411. .tabtd>view:nth-of-type(1) {
  412. width: 10%;
  413. text-align: center;
  414. line-height: 30rpx;
  415. }
  416. .tabtd>view:nth-of-type(2) {
  417. width: 46%;
  418. text-align: center;
  419. color: #333333;
  420. }
  421. .tabtd>view:nth-of-type(3) {
  422. width: 22%;
  423. text-align: center;
  424. color: #333333;
  425. }
  426. .tabtd>view:nth-of-type(4) {
  427. width: 22%;
  428. text-align: center;
  429. color: #2671E2;
  430. }
  431. .ranking {
  432. width: 34rpx;
  433. height: 34rpx;
  434. }
  435. .ranking1 {
  436. width: 30rpx;
  437. height: 30rpx;
  438. background: #ECF1FF;
  439. color: #424D64;
  440. font-size: 18rpx;
  441. text-align: center;
  442. line-height: 30rpx;
  443. border-radius: 50%;
  444. margin: 0 auto;
  445. }
  446. .tabech {
  447. width: 100%;
  448. height: 600rpx;
  449. }
  450. </style>