Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

Userinsightinto.vue 12 KiB

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