chart.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /**
  2. * Created by xw on 2023/10/31.
  3. */
  4. const chartContent = new Vue({
  5. el:"#chartContent",
  6. mixins: [jsonMixin,chartMixin],
  7. data: {
  8. shopId:0,
  9. volumeList:[],
  10. bannerList:[],
  11. shopInfo:{},
  12. summarize:'',
  13. summarize1:'',
  14. summarize2:'',
  15. isLoading:false
  16. },
  17. computed: {
  18. },
  19. methods: {
  20. openFullScreen2(shopId) {
  21. const _this = this
  22. const loading = this.$loading({
  23. lock: true,
  24. text: 'Loading',
  25. spinner: 'el-icon-loading',
  26. background: 'rgba(0, 0, 0, 0.4)'
  27. });
  28. setTimeout(() => {
  29. _this.isLoading = true
  30. loading.close();
  31. }, 100);
  32. setTimeout(() => {
  33. _this.chartInit(shopId)
  34. }, 200);
  35. },
  36. chartInit(shopId){
  37. console.log('shopId',shopId)
  38. this.volumeList = this.chartData[shopId].volumeList
  39. this.bannerList = this.chartData[shopId].bannerList
  40. this.shopInfo = this.chartData[shopId].shopInfo
  41. this.summarize = this.chartData[shopId].summarize
  42. this.summarize1 = this.chartData[shopId].summarize1
  43. this.summarize2 = this.chartData[shopId].summarize2
  44. this.chartWordCloud(this.chartData[shopId].keywords)
  45. this.chartWechats(this.chartData[shopId].wechats)
  46. this.chartIntention(this.chartData[shopId].intention)
  47. this.chartAllVisits(this.chartData[shopId].allVisits)
  48. this.chartProportion(this.chartData[shopId].proportion)
  49. this.chartStationVisits(this.chartData[shopId].stationVisits)
  50. this.chartVisitTimes(this.chartData[shopId].visitTimes)
  51. this.chartLeadUserMonthly(this.chartData[shopId].leadUserMonthly)
  52. this.chartChannels(this.chartData[shopId].channels)
  53. this.chartUrbanize(this.chartData[shopId].urbanize)
  54. this.chartUserIdentity(this.chartData[shopId].userIdentity)
  55. this.chartIntentions(this.chartData[shopId].intentions)
  56. $('.chart-main-top-mids-li').find('a').on('click', function () {
  57. const id = '#' + $(this).attr('data-id');
  58. const scrollTop = innerWidth > 768 ? $(id).offset().top : $(id).offset().top ;
  59. $("html, body").animate({
  60. scrollTop: scrollTop
  61. }, {duration: 500, easing: "swing"});
  62. return false;
  63. })
  64. }
  65. },
  66. created: function () {
  67. },
  68. mounted: function () {
  69. this.shopId = getUrlParam("shopId");
  70. this.openFullScreen2(this.shopId)
  71. }
  72. });