diff --git a/src/api/index.js b/src/api/index.js index c33feec..31cd4aa 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1,9 +1,26 @@ import axios from "@/utils/axios.js"; +export const getStreet = (data) => { + return axios.get('city/get_street', { params: data }); +} + export const orderList = (data) => { return axios.get('dataview/curr_order_info', { params: data }); } export const orderRanking = (data) => { return axios.get('dataview/order_ranking', { params: data }); +} + + +export const deliveredProductRanking = (data) => { + return axios.get('dataview/delivered_product_ranking', { params: data }); +} + +export const vehicleList = (data) => { + return axios.get('dataview/vehicle_list', { params: data }); +} + +export const latestLogistics = (data) => { + return axios.get('dataview/latest_logistics', { params: data }); } \ No newline at end of file diff --git a/src/components/areaList.vue b/src/components/areaList.vue index 97ec0fb..ded2601 100644 --- a/src/components/areaList.vue +++ b/src/components/areaList.vue @@ -1,48 +1,67 @@ diff --git a/src/components/headView.vue b/src/components/headView.vue index 03f5dc5..0d28040 100644 --- a/src/components/headView.vue +++ b/src/components/headView.vue @@ -3,12 +3,16 @@ import { reactive, ref, provide, nextTick, onMounted } from "vue"; import areaList from "./areaList.vue"; import { useRoute, useRouter } from "vue-router"; import mitt from "@/utils/mitt"; +import { getStreet } from "@/api/index.js" +import { useAppStore } from "@/store/app.js"; const info = reactive({ address: '泸县', pinyin: 'luxian' }) +const appStore = useAppStore(); + const areaListRef = ref(null); // 选择镇 @@ -27,11 +31,29 @@ const offAreaList = (e) => { mitt.emit('map_info', info); } +const list = ref([]) +const initList = () => { + getStreet({ + area_code: appStore.address.areaCode + }).then(res => { + list.value = res.data; + appStore.setAddress({ + areaCode: appStore.address.appStore, + streetCode: res.data[0].code + }) + info.address = res.data[0].name + }) +} + + const router = useRouter() const route = useRoute() const navToDelivery = () => { - if (route.path == '/') router.push('/delivery'); + if (route.path == '/') { + // router.push('/delivery'); + return; + } else router.back(); } @@ -57,6 +79,8 @@ onMounted(() => { mitt.emit('map_info', info); + initList(); + // 每秒钟更新一次时间 setInterval(updateClock, 1000); }) @@ -81,6 +105,7 @@ onMounted(() => { {{ info.address }}   { const map_info = ref(localStorage.getItem('map_info') || 'luxian'); + const address = ref(JSON.parse(localStorage.getItem('address') || '{}')); + if (!address.value.areaCode) { + address.value = { areaCode: 510521, streetCode: 510521100 }; + } + const setMapInfo = (e) => { map_info.value = e; localStorage.setItem('map_info', e); } + const setAddress = (e) => { + address.value.areaCode = e.areaCode; + address.value.streetCode = e.streetCode; + localStorage.setItem('address', JSON.stringify(e)); + } + return { map_info, - setMapInfo + address, + setMapInfo, + setAddress } }) \ No newline at end of file diff --git a/src/view/delivery/components/bottom.vue b/src/view/delivery/components/bottom.vue index 91f2c97..61ed804 100644 --- a/src/view/delivery/components/bottom.vue +++ b/src/view/delivery/components/bottom.vue @@ -192,7 +192,7 @@ const initEcahrts = () => { seriesData.push(obj3); } }); - console.log(seriesData); + // console.log(seriesData); const option = { backgroundColor: "rgba(0,0,0,0)", grid: { diff --git a/src/view/delivery/components/left.vue b/src/view/delivery/components/left.vue index 712cc6a..4fe1c70 100644 --- a/src/view/delivery/components/left.vue +++ b/src/view/delivery/components/left.vue @@ -3,18 +3,19 @@ import { onMounted, reactive, ref } from "vue" import border from "@/components/border.vue"; import AMapLeft from "./AMapLeft.vue"; import * as echarts from 'echarts'; +import { useRoute } from "vue-router" +import { latestLogistics } from "@/api/index.js"; +const route = useRoute(); -var fontColor = "#000"; -var seriesName = ""; let noramlSize = 16; var datas = { textValue: "100%", colors: ["#31829d", "#009cff", "#4b5fdb"], - legendArr: ["待取货", "待配送", "已送达"], + legendArr: ["待取货", "配送中", "已送达"], dataArr: [ { value: 335, name: "待取货" }, - { value: 210, name: "待配送" }, + { value: 210, name: "配送中" }, { value: 410, name: "已送达" }, ], company: "个" @@ -121,8 +122,20 @@ const initEcahrts = () => { chart.setOption(option); } +const info = ref({}); + +const loadInfo = () => { + latestLogistics({ + areaCode: 510524, + streetCode: 510524100, + }).then(res => { + info.value = res.data; + }) +} + onMounted(() => { - initEcahrts() + loadInfo(); + initEcahrts(); }) @@ -136,11 +149,9 @@ onMounted(() => {
订单编号 - bzj20230923163643650ea39ba256c + {{ info.order_sn }}
-
23-11-20
+
{{ info.create_time?.split(" ")[0] }}
@@ -156,7 +167,7 @@ onMounted(() => {
商户名称
-
天天超市
+
{{ info.mer_name }}
@@ -164,7 +175,7 @@ onMounted(() => {
商品名称
-
山花纯牛奶100ml
+
{{ info.store_name || "-" }}
@@ -183,7 +194,7 @@ onMounted(() => {
收件人
-
王**
+
{{ info.real_name }}
@@ -191,7 +202,7 @@ onMounted(() => {
收件人电话
-
159****3366
+
{{ info.user_phone }}
@@ -209,7 +220,7 @@ onMounted(() => {
收件地址
-
泸县草芥幸福小区一号楼10-22
+
{{ info.user_address }}
@@ -217,7 +228,7 @@ onMounted(() => {
当前状态
-
订单已完成
+
{{ info.status }}
diff --git a/src/view/delivery/components/right.vue b/src/view/delivery/components/right.vue index 7852e03..4a644aa 100644 --- a/src/view/delivery/components/right.vue +++ b/src/view/delivery/components/right.vue @@ -151,6 +151,7 @@ onUnmounted(() => { height: 0.8rem; background-color: #0a385b; border-radius: 0.8rem; + overflow: hidden; .line-body { height: 100%; border-radius: 0.8rem; diff --git a/src/view/index/components/centerMap.vue b/src/view/index/components/centerMap.vue index 96167c8..4ac7a02 100644 --- a/src/view/index/components/centerMap.vue +++ b/src/view/index/components/centerMap.vue @@ -186,8 +186,13 @@ const initMap = () => { { type: "map", map: mapType.name, + label: { + emphasis: { + show: false + } + }, emphasis: { - disabled: true + disabled: false, }, select: { disabled: true diff --git a/src/view/index/components/leftItme2.vue b/src/view/index/components/leftItme2.vue index 412e90e..3584b5c 100644 --- a/src/view/index/components/leftItme2.vue +++ b/src/view/index/components/leftItme2.vue @@ -145,6 +145,7 @@ onUnmounted(() => { height: 0.8rem; background-color: #0a385b; border-radius: 0.8rem; + overflow: hidden; .line-body { height: 100%; border-radius: 0.8rem; diff --git a/src/view/index/components/rightItem1.vue b/src/view/index/components/rightItem1.vue index e71fed5..ab581f1 100644 --- a/src/view/index/components/rightItem1.vue +++ b/src/view/index/components/rightItem1.vue @@ -1,6 +1,42 @@