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

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