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.4KB

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