This commit is contained in:
weipengfei 2024-02-24 11:45:18 +08:00
parent 6ee2b7bb36
commit 9233478364
5 changed files with 82 additions and 40 deletions

View File

@ -28,11 +28,11 @@
</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-top">
<div class="town">江陽區</div>
<div class="town">江陽區</div>
<div class="town">{{ chooseInfo.area.name || '未选择' }}</div>
<div class="town">{{ chooseInfo.town.name || '未选择' }}</div>
</div>
<div class="area-bottom"></div>
</div>
@ -110,10 +110,23 @@ const changeTown = (e) => {
}
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({
areaCode: a,
streetCode: s
areaCode: chooseInfo.value?.area?.code,
streetCode: e.code
}).then(res=>{
farmList.value = res.data.farmList || [];
flag.value = true;

View File

@ -55,16 +55,10 @@ const handChose = (index) => {
actIndex.value = index;
getTownListsFn(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) => {
// townLists.value.forEach(item => {
// if (item.value == townLists[index].value) {
// sendFn('choseTown', { name: item.label, code: item.value })
// }
// })
townLists.value.forEach(item => {
if (item.code == townLists.value[index].code) {
sendFn('choseTown', { name: item.name, code: item.code })
@ -78,7 +72,7 @@ const getTownListsFn = async (area_code = 510502) => {
townLists.value = res.data;
}
getTownListsFn()
getTownListsFn(options[0].value)
const props = defineProps({
channel: {

View File

@ -19,21 +19,25 @@
<img src="/static/img/tradeScreen/FH.png" @click="router.go(-1)" class="back-btn" alt="">
<div class="cont" v-if="flag">
<div class="card" v-for="(item, index) in farmList" :key="index">
<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">
{{ item.farm_name }}
</div>
<div class="card-cotnet">
<div>商户姓名: {{ item.master }}</div>
<div class="login" @click="lookFarmDetail(item)">查看详情</div>
<div>{{ item.courier_name }}</div>
<div>{{ item.license }}</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-top">
<div class="town">江陽區</div>
<div class="town">江陽區</div>
<div class="town">{{ chooseInfo.area.name || '未选择' }}</div>
<div class="town">{{ chooseInfo.town.name || '未选择' }}</div>
</div>
<div class="area-bottom"></div>
</div>
@ -86,10 +90,6 @@ const options = [
//
const townOptions = []
const areaCode = ref('510521')
const townCode = ref("")
const changeArea = (e) => {
townCode.value = ''
getTownList()
@ -110,13 +110,27 @@ const changeTown = (e) => {
}
const handTown = (a, s)=>{
console.log(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 = () => {
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) {
res.data.data.forEach(item => {
townOptions.push({
@ -131,13 +145,11 @@ const getTownList = () => {
const vehicleList=ref([])
const getLandList = async () => {
let res = await vehicleListApi({
areaCode: areaCode.value,
streetCode: townCode.value
areaCode: chooseInfo.value.area.code,
streetCode: chooseInfo.value.town.code
})
vehicleList.value=res.data.list
}
@ -163,17 +175,39 @@ const sendFn = (event, data = '') => {
flex-wrap: wrap;
justify-content: space-between;
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 {
width: 378px;
height: 223px;
width: 190px;
height: 260px;
margin-bottom: 10px;
background-image: url('/static/img/breedScreen/bg.png');
background-image: url('/static/img/breedScreen/item.webp');
background-size: 100% 100%;
font-size: 16px;
padding: 10px;
color: white;
position: relative;
display: flex;
flex-direction: column;
justify-content: space-between;
text-align: center;
.card-tit {
color: #00D6DD;
@ -203,7 +237,8 @@ const sendFn = (event, data = '') => {
}
// background-color: red;
}
.cont::-webkit-scrollbar {

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB