This commit is contained in:
zmj 2024-02-24 11:51:53 +08:00
commit bffef94202
5 changed files with 81 additions and 38 deletions

View File

@ -28,11 +28,11 @@
</div> </div>
</div> </div>
</div> </div>
<areaChose v-else channel="user-breed-datav" @handTown="handTown"></areaChose> <areaChose v-else channel="user-breed-datav" @handTown="handTown" @handArea="handArea"></areaChose>
<div class="area" @click="flag = !flag"> <div class="area" @click="flag = !flag">
<div class="area-top"> <div class="area-top">
<div class="town">江陽區</div> <div class="town">{{ chooseInfo.area.name || '未选择' }}</div>
<div class="town">江陽區</div> <div class="town">{{ chooseInfo.town.name || '未选择' }}</div>
</div> </div>
<div class="area-bottom"></div> <div class="area-bottom"></div>
</div> </div>
@ -110,10 +110,23 @@ const changeTown = (e) => {
} }
const farmList = ref([]); const farmList = ref([]);
const handTown = (a, s)=>{ const chooseInfo = ref({
area: {
code: '510521',
name: '泸县'
},
town: {}
});
const handArea = (e)=>{
chooseInfo.value.area = e;
chooseInfo.value.town = {};
}
const handTown = (e)=>{
chooseInfo.value.town = e;
breedFarmCount({ breedFarmCount({
areaCode: a, areaCode: chooseInfo.value?.area?.code,
streetCode: s streetCode: e.code
}).then(res=>{ }).then(res=>{
farmList.value = res.data.farmList || []; farmList.value = res.data.farmList || [];
flag.value = true; flag.value = true;

View File

@ -55,19 +55,14 @@ const handChose = (index) => {
actIndex.value = index; actIndex.value = index;
getTownListsFn(options[index].value); getTownListsFn(options[index].value);
sendFn('choserArea', { name: options[index].label, code: options[index].value }) sendFn('choserArea', { name: options[index].label, code: options[index].value })
emit('handArea', {name:options[actIndex.value].label,code:options[actIndex.value].value},) emit('handArea', { name: options[index].label, code: options[index].value })
} }
const handTown = (index) => { const handTown = (index) => {
// townLists.value.forEach(item => {
// if (item.value == townLists[index].value) {
// sendFn('choseTown', { name: item.label, code: item.value })
// }
// })
townLists.value.forEach(item => { townLists.value.forEach(item => {
if (item.code == townLists.value[index].code) { if (item.code == townLists.value[index].code) {
sendFn('choseTown', { name: item.name, code: item.code }) sendFn('choseTown', { name: item.name, code: item.code })
emit('handTown', {name:item.name,code:item.code}) emit('handTown', { name: item.name, code: item.code})
} }
}) })
} }
@ -77,7 +72,7 @@ const getTownListsFn = async (area_code = 510521) => {
townLists.value = res.data; townLists.value = res.data;
} }
getTownListsFn() getTownListsFn(options[0].value)
const props = defineProps({ const props = defineProps({
channel: { channel: {

View File

@ -19,21 +19,25 @@
<img src="/static/img/tradeScreen/FH.png" @click="router.go(-1)" class="back-btn" alt=""> <img src="/static/img/tradeScreen/FH.png" @click="router.go(-1)" class="back-btn" alt="">
<div class="cont" v-if="flag"> <div class="cont" v-if="flag">
<div class="card" v-for="(item, index) in farmList" :key="index"> <div class="title">三轮车配送</div>
<div class="card-tit"> <div class="card-list">
{{ item.farm_name }} <div class="card" v-for="(item, index) in vehicleList" :key="index" @click="sendFn('c_car_index', item)">
</div> <div class="card-tit">
<div class="card-cotnet">
<div>商户姓名: {{ item.master }}</div> </div>
<div class="login" @click="lookFarmDetail(item)">查看详情</div> <div class="card-cotnet">
<div>{{ item.courier_name }}</div>
<div>{{ item.license }}</div>
</div>
<div>查看详情</div>
</div> </div>
</div> </div>
</div> </div>
<areaChose v-else channel="user-logistics-datav" @handTown="handTown"></areaChose> <areaChose v-else channel="user-logistics-datav" @handTown="handTown" @handArea="handArea"></areaChose>
<div class="area" @click="flag = !flag"> <div class="area" @click="flag = !flag">
<div class="area-top"> <div class="area-top">
<div class="town">江陽區</div> <div class="town">{{ chooseInfo.area.name || '未选择' }}</div>
<div class="town">江陽區</div> <div class="town">{{ chooseInfo.town.name || '未选择' }}</div>
</div> </div>
<div class="area-bottom"></div> <div class="area-bottom"></div>
</div> </div>
@ -86,10 +90,6 @@ const options = [
// //
const townOptions = [] const townOptions = []
const areaCode = ref('510521')
const townCode = ref("")
const changeArea = (e) => { const changeArea = (e) => {
townCode.value = '' townCode.value = ''
getTownList() getTownList()
@ -110,13 +110,27 @@ const changeTown = (e) => {
} }
const handTown = (a, s)=>{ const chooseInfo = ref({
area: {
code: '510521',
name: '泸县'
},
town: {}
});
const handArea = (e)=>{
chooseInfo.value.area = e;
chooseInfo.value.town = {};
getLandList();
}
const handTown = (e)=>{
chooseInfo.value.town = e;
getLandList();
} }
const getTownList = () => { const getTownList = () => {
townOptions.splice(0, 99999999) townOptions.splice(0, 99999999)
axios.get(`https://crmeb-test.shop.lihaink.cn/api/city/get_street?area_code=${areaCode.value}`) axios.get(`https://crmeb-test.shop.lihaink.cn/api/city/get_street?area_code=${chooseInfo.value.area.code}`)
.then(function (res) { .then(function (res) {
res.data.data.forEach(item => { res.data.data.forEach(item => {
townOptions.push({ townOptions.push({
@ -131,13 +145,11 @@ const getTownList = () => {
const vehicleList=ref([]) const vehicleList=ref([])
const getLandList = async () => { const getLandList = async () => {
let res = await vehicleListApi({ let res = await vehicleListApi({
areaCode: areaCode.value, areaCode: chooseInfo.value.area.code,
streetCode: townCode.value streetCode: chooseInfo.value.town.code
}) })
vehicleList.value=res.data.list vehicleList.value=res.data.list
} }
@ -163,17 +175,39 @@ const sendFn = (event, data = '') => {
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-between; justify-content: space-between;
overflow-y: auto; overflow-y: auto;
background-image: url('/static/img/breedScreen/vebg.webp');
.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 {
width: 378px; width: 190px;
height: 223px; height: 260px;
margin-bottom: 10px; margin-bottom: 10px;
background-image: url('/static/img/breedScreen/bg.png'); background-image: url('/static/img/breedScreen/item.webp');
background-size: 100% 100%; background-size: 100% 100%;
font-size: 16px; font-size: 16px;
padding: 10px; padding: 10px;
color: white; color: white;
position: relative; position: relative;
display: flex;
flex-direction: column;
justify-content: space-between;
text-align: center;
.card-tit { .card-tit {
color: #00D6DD; color: #00D6DD;
@ -203,7 +237,8 @@ const sendFn = (event, data = '') => {
} }
// background-color: red;
} }
.cont::-webkit-scrollbar { .cont::-webkit-scrollbar {

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB