This commit is contained in:
weipengfei 2024-02-24 14:47:49 +08:00
parent 7e5b2a5e19
commit 14d7b60982
4 changed files with 235 additions and 218 deletions

View File

@ -22,8 +22,8 @@
<div class="card-tit">
{{ item.farm_name }}
</div>
<div class="card-text">养殖户: {{ item.master }}</div>
<div class="card-cotnet">
<div>商户姓名: {{ item.master }}</div>
<div class="login" @click="lookFarmDetail(item)">查看详情</div>
</div>
</div>
@ -129,6 +129,9 @@ const handTown = (e)=>{
streetCode: e.code
}).then(res=>{
farmList.value = res.data.farmList || [];
// for(let i=0;i<10;i++){
// farmList.value = [...farmList.value, ...res.data.farmList]
// }
flag.value = true;
})
}
@ -188,13 +191,13 @@ const sendFn = (event, data = '') => {
overflow-y: auto;
.card {
width: 378px;
height: 223px;
width: 370px;
height: 148px;
margin-bottom: 10px;
background-image: url('/static/img/breedScreen/bg.png');
background-image: url('/static/img/breedScreen/bg.webp');
background-size: 100% 100%;
font-size: 16px;
padding: 10px;
padding: 10px 20px;
color: white;
position: relative;
@ -206,6 +209,11 @@ const sendFn = (event, data = '') => {
margin-top: 10px;
}
.card-text{
white-space: nowrap;
margin-top: 10px;
}
.card-cotnet {
margin-top: 50px;

View File

@ -1,5 +1,5 @@
<template>
<!-- <div style="text-align: center;">物流溯源可视化大屏</div>
<!-- <div style="text-align: center;">物流溯源可视化大屏</div>
<el-select v-model="areaCode" class="m-2" @change="changeArea" placeholder="Select" size="large">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
@ -15,190 +15,204 @@
<button @click="sendFn('back', { name: '泸县' }), townCode = ''">返回首页</button>
<button @click="sendFn('more_order')">更多订单</button>
</div> -->
<img src="/static/img/tradeScreen/FH.png" @click="router.go(-1)" class="back-btn" alt="">
<div class="cont" v-if="flag">
<div class="title">三轮车配送</div>
<div class="card-list">
<div class="card" v-for="(item, index) in vehicleList" :key="index" @click="sendFn('c_car_index', item)">
<div class="card-tit">
</div>
<div class="card-cotnet">
<div>{{ item.courier_name }}</div>
<div>{{ item.license }}</div>
</div>
<div>查看详情</div>
</div>
<img
src="/static/img/tradeScreen/FH.png"
@click="router.go(-1)"
class="back-btn"
alt=""
/>
<div class="cont" v-if="flag">
<div class="title">三轮车配送</div>
<div class="card-list">
<div class="scorll">
<div
class="card"
v-for="(item, index) in vehicleList"
:key="index"
@click="sendFn('c_car_index', item)"
>
<div class="card-tit"></div>
<div class="card-cotnet">
<div>{{ item.courier_name }}</div>
<div>{{ item.license }}</div>
</div>
<div>查看详情</div>
</div>
</div>
</div>
<areaChose v-else channel="user-logistics-datav" @handTown="handTown" @handArea="handArea"></areaChose>
<div class="area" @click="flag = !flag">
<div class="area-top">
<div class="town">{{ chooseInfo.area.name || '未选择' }}</div>
<div class="town">{{ chooseInfo.town.name || '未选择' }}</div>
</div>
<div class="area-bottom"></div>
</div>
<areaChose
v-else
channel="user-logistics-datav"
@handTown="handTown"
@handArea="handArea"
></areaChose>
<div class="area" @click="flag = !flag">
<div class="area-top">
<div class="town">{{ chooseInfo.area.name || "未选择" }}</div>
<div class="town">{{ chooseInfo.town.name || "未选择" }}</div>
</div>
<div class="area-bottom"></div>
</div>
</template>
<script setup scoped>
import { ref, reactive } from "vue"
import { sendMsg } from "@/api.js"
import axios from "axios"
import areaChose from "@/view/components/areaChose.vue"
import { vehicleListApi } from "@/api.js"
import {useRouter} from "vue-router"
const router = useRouter()
import { ref, reactive } from "vue";
import { sendMsg } from "@/api.js";
import axios from "axios";
import areaChose from "@/view/components/areaChose.vue";
import { vehicleListApi } from "@/api.js";
import { useRouter } from "vue-router";
const router = useRouter();
const nowPages = ref('index');
const nowPages = ref("index");
const flag = ref(true);
//
const options = [
{
value: '510502',
label: '江阳区',
},
{
value: '510503',
label: '纳溪区',
},
{
value: '510504',
label: '龙马潭区',
},
{
value: '510521',
label: '泸县',
},
{
value: '510522',
label: '合江县 ',
},
{
value: '510524',
label: '叙永县 ',
},
{
value: '510525',
label: '古蔺县 ',
},
]
{
value: "510502",
label: "江阳区",
},
{
value: "510503",
label: "纳溪区",
},
{
value: "510504",
label: "龙马潭区",
},
{
value: "510521",
label: "泸县",
},
{
value: "510522",
label: "合江县 ",
},
{
value: "510524",
label: "叙永县 ",
},
{
value: "510525",
label: "古蔺县 ",
},
];
//
const townOptions = []
const townOptions = [];
const changeArea = (e) => {
townCode.value = ''
getTownList()
options.forEach(item => {
if (item.value == e) {
sendFn('choserArea', { name: item.label, code: item.value })
}
})
}
townCode.value = "";
getTownList();
options.forEach((item) => {
if (item.value == e) {
sendFn("choserArea", { name: item.label, code: item.value });
}
});
};
const changeTown = (e) => {
console.log(e)
townOptions.forEach(item => {
if (item.value == e) {
sendFn('choseTown', { name: item.label })
}
})
}
console.log(e);
townOptions.forEach((item) => {
if (item.value == e) {
sendFn("choseTown", { name: item.label });
}
});
};
const chooseInfo = ref({
area: {
code: '510521',
name: '泸县'
},
town: {}
area: {
code: "510521",
name: "泸县",
},
town: {},
});
const handArea = (e)=>{
chooseInfo.value.area = e;
chooseInfo.value.town = {};
getLandList();
}
const handArea = (e) => {
chooseInfo.value.area = e;
chooseInfo.value.town = {};
getLandList();
};
const handTown = (e)=>{
chooseInfo.value.town = e;
getLandList();
}
const handTown = (e) => {
chooseInfo.value.town = e;
getLandList();
};
const getTownList = () => {
townOptions.splice(0, 99999999)
axios.get(`https://crmeb-test.shop.lihaink.cn/api/city/get_street?area_code=${chooseInfo.value.area.code}`)
.then(function (res) {
res.data.data.forEach(item => {
townOptions.push({
value: item.code,
label: item.name
})
})
townOptions.splice(0, 99999999);
axios
.get(
`https://crmeb-test.shop.lihaink.cn/api/city/get_street?area_code=${chooseInfo.value.area.code}`
)
.then(function (res) {
res.data.data.forEach((item) => {
townOptions.push({
value: item.code,
label: item.name,
});
});
});
};
})
}
const vehicleList=ref([])
const vehicleList = ref([]);
const getLandList = async () => {
let res = await vehicleListApi({
areaCode: chooseInfo.value.area.code,
streetCode: chooseInfo.value.town.code
})
vehicleList.value=res.data.list
let res = await vehicleListApi({
areaCode: chooseInfo.value.area.code,
streetCode: chooseInfo.value.town.code,
});
vehicleList.value = res.data.list;
}
// for (let i = 0; i < 10; i++) {
// vehicleList.value = [...vehicleList.value, ...res.data.list];
// }
};
getTownList()
getLandList()
getTownList();
getLandList();
//
const page = ref(1)
const sendFn = (event, data = '') => {
if (data.page) page.value = data.page;
sendMsg({ channel: 'user-logistics-datav', event, data })
}
const page = ref(1);
const sendFn = (event, data = "") => {
if (data.page) page.value = data.page;
sendMsg({ channel: "user-logistics-datav", event, data });
};
</script>
<style lang="scss" scoped>
.cont {
height: 500px;
width: 90vw;
height: 500px;
width: 90vw;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
box-sizing: border-box;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
background-image: url("/static/img/breedScreen/vebg.webp");
.title {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
box-sizing: border-box;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
overflow-y: auto;
background-image: url('/static/img/breedScreen/vebg.webp');
left: 80px;
top: 14%;
color: #fff;
}
.title{
position: absolute;
left: 80px;
top: 14%;
color: #fff;
}
.card-list{
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
padding: 120px 70px;
}
.card {
.card-list {
position: absolute;
top: 110px;
left: 70px;
bottom: 100px;
right: 70px;
overflow-x: auto;
.scorll {
display: flex;
.card {
flex-shrink: 0;
width: 190px;
height: 260px;
margin-bottom: 10px;
background-image: url('/static/img/breedScreen/item.webp');
background-image: url("/static/img/breedScreen/item.webp");
background-size: 100% 100%;
font-size: 16px;
padding: 10px;
@ -210,92 +224,87 @@ const sendFn = (event, data = '') => {
text-align: center;
.card-tit {
color: #00D6DD;
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 10px;
color: #00d6dd;
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 10px;
}
.card-cotnet {
margin-top: 50px;
margin-top: 50px;
.login {
width: 170px;
height: 34px;
text-align: center;
line-height: 34px;
background-image: url('/static/img/tradeScreen/DL.png');
background-size: 100% 100%;
margin-top: 20px;
position: absolute;
bottom: 10px;
left: 50%;
transform: translateX(-50%);
}
.login {
width: 170px;
height: 34px;
text-align: center;
line-height: 34px;
background-image: url("/static/img/tradeScreen/DL.png");
background-size: 100% 100%;
margin-top: 20px;
position: absolute;
bottom: 10px;
left: 50%;
transform: translateX(-50%);
}
}
}
}
}
}
.cont::-webkit-scrollbar {
width: 10px;
background-color: #153041;
.card-list::-webkit-scrollbar {
width: 10px;
background-color: #153041;
}
.cont::-webkit-scrollbar-track {
background-color: #153041;
.card-list::-webkit-scrollbar-track {
background-color: #153041;
}
::-webkit-scrollbar-thumb {
background-color: #084D89;
border-radius: 5px;
background-color: #084d89;
border-radius: 5px;
}
.back-btn {
width: 86.21px;
height: 31px;
position: absolute;
top: 70px;
left: 60.96px;
z-index: 9;
width: 86.21px;
height: 31px;
position: absolute;
top: 70px;
left: 60.96px;
z-index: 9;
}
.area {
position: absolute;
font-size: 20px;
color: white;
bottom: 0px;
left: 50%;
transform: translateX(-50%);
width: 558px;
.area-top {
display: flex;
justify-content: space-around;
.town {
background-image: url('/static/img/tradeScreen/areaA.png');
background-size: 100% 100%;
width: 160.12px;
height: 30.94px;
text-align: center;
line-height: 10px;
}
position: absolute;
font-size: 20px;
color: white;
bottom: 0px;
left: 50%;
transform: translateX(-50%);
width: 558px;
.area-top {
display: flex;
justify-content: space-around;
.town {
background-image: url("/static/img/tradeScreen/areaA.png");
background-size: 100% 100%;
width: 160.12px;
height: 30.94px;
text-align: center;
line-height: 10px;
}
}
}
.area-bottom {
background-image: url('/static/img/tradeScreen/areaB.png');
width: 558px;
height: 57px;
background-size: 100% 100%;
transform: translateY(-20px);
background-image: url("/static/img/tradeScreen/areaB.png");
width: 558px;
height: 57px;
background-size: 100% 100%;
transform: translateY(-20px);
}
</style>
</style>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB