Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

trajectory-map.vue 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <view class="charts-box">
  3. <!-- <qiun-data-charts
  4. type="map"
  5. :opts="state.opts"
  6. :chartData="state.chartData"
  7. /> -->
  8. <qiun
  9. type="map"
  10. :chartData="state.chartData"
  11. :opts="state.opts"
  12. :canvas2d="true"
  13. canvasId="pVNxVgTQDlKlgMCPbMtJrifnZlluhrNf"
  14. />
  15. </view>
  16. <view class="describe">
  17. <view>
  18. <view class="all">您共到访过<text class="num">5</text>个城市</view>
  19. <view>您的足迹已踏遍1500%的国土超过了99%的九州ETC用户</view>
  20. </view>
  21. <image class="car" src="../../../static/image/home-on.png" mode="aspectFit"></image>
  22. </view>
  23. </template>
  24. <script lang="ts" setup>
  25. import { reactive } from "vue";
  26. import {request} from "@/utils/network/request.js";
  27. import {stringToJson} from "@/utils/network/encryption.js";
  28. import { onLoad,onMounted} from "@dcloudio/uni-app";
  29. import mapChina from "@/datas/mapChina.json";
  30. // import qiun from "/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue"
  31. import qiun from "./qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue";
  32. const state = reactive({
  33. chartData: {},
  34. opts: { //["贵州省","海南省"]
  35. color: ["#EE6666","#1890FF","#1890FF","#1890FF","#1890FF",
  36. "#1890FF","#1890FF","#1890FF","#1890FF","#1890FF",
  37. "#1890FF","#1890FF","#1890FF","#1890FF","#1890FF",
  38. "#1890FF","#1890FF","#1890FF","#1890FF","#1890FF",
  39. "#1890FF","#1890FF","#1890FF","#1890FF","#EE6666",
  40. "#1890FF","#1890FF","#1890FF","#1890FF","#1890FF",
  41. "#1890FF","#1890FF","#1890FF","#1890FF","#1890FF"],
  42. padding: [0,0,0,0],
  43. dataLabel: true,
  44. fontSize:9,
  45. enableScroll: false,
  46. extra: {
  47. map: {
  48. active:false,
  49. border: true,
  50. borderWidth: 1,
  51. borderColor: "#666666",
  52. fillOpacity: 0.6,
  53. activeBorderColor: "#F04864",
  54. activeFillColor: "#FACC14",
  55. activeFillOpacity: 1
  56. }
  57. }
  58. }
  59. })
  60. onLoad((option : any) => {
  61. getServerData();
  62. })
  63. const getServerData=()=>{
  64. console.log("111")
  65. //模拟从服务器获取数据时的延时
  66. setTimeout(() => {
  67. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  68. let res = {series:mapChina.features};
  69. console.log("111")
  70. state.chartData = JSON.parse(JSON.stringify(res));
  71. console.log("state.chartData",state.chartData)
  72. }, 500);
  73. }
  74. </script>
  75. <style scoped>
  76. .charts-box {
  77. width: 100%;
  78. height: 300px;
  79. }
  80. .describe{
  81. display: flex;
  82. width: 90%;
  83. margin: 20rpx auto;
  84. padding: 30rpx 30rpx 60rpx 30rpx;
  85. box-sizing: border-box;
  86. background-color: #f6f6f6;
  87. border-radius: 20rpx;
  88. font-size: 30rpx;
  89. }
  90. .describe>view{
  91. flex: 5;
  92. }
  93. .describe>image{
  94. flex: 3;
  95. }
  96. .car{
  97. width: 150rpx;
  98. height: 150rpx;
  99. display: inline-block;
  100. }
  101. .all{
  102. font-size: 36rpx;
  103. margin-bottom: 20rpx;
  104. margin-left: 20rpx;
  105. }
  106. .num{
  107. font-size: 38rpx;
  108. font-weight: bold;
  109. }
  110. </style>