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.

trajectory-map.vue 2.5KB

пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 "../../service/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue"
  31. // import qiun from "/service/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue";
  32. const state = reactive({
  33. chartData: {},
  34. opts: {
  35. color: ["#1890FF","#91CB74","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"],
  36. padding: [0,0,0,0],
  37. dataLabel: true,
  38. enableScroll: false,
  39. extra: {
  40. map: {
  41. border: true,
  42. borderWidth: 1,
  43. borderColor: "#666666",
  44. fillOpacity: 0.6,
  45. activeBorderColor: "#F04864",
  46. activeFillColor: "#FACC14",
  47. activeFillOpacity: 1
  48. }
  49. }
  50. }
  51. })
  52. onLoad((option : any) => {
  53. getServerData();
  54. })
  55. const getServerData=()=>{
  56. console.log("111")
  57. //模拟从服务器获取数据时的延时
  58. setTimeout(() => {
  59. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  60. let res = {series:mapChina.features};
  61. console.log("111")
  62. state.chartData = JSON.parse(JSON.stringify(res));
  63. console.log("state.chartData",state.chartData)
  64. }, 500);
  65. }
  66. </script>
  67. <style scoped>
  68. .charts-box {
  69. width: 100%;
  70. height: 300px;
  71. }
  72. .describe{
  73. display: flex;
  74. width: 90%;
  75. margin: 20rpx auto;
  76. padding: 30rpx 30rpx 60rpx 30rpx;
  77. box-sizing: border-box;
  78. background-color: #f6f6f6;
  79. border-radius: 20rpx;
  80. font-size: 30rpx;
  81. }
  82. .describe>view{
  83. flex: 5;
  84. }
  85. .describe>image{
  86. flex: 3;
  87. }
  88. .car{
  89. width: 150rpx;
  90. height: 150rpx;
  91. display: inline-block;
  92. }
  93. .all{
  94. font-size: 36rpx;
  95. margin-bottom: 20rpx;
  96. margin-left: 20rpx;
  97. }
  98. .num{
  99. font-size: 38rpx;
  100. font-weight: bold;
  101. }
  102. </style>