Compare commits

..

2 Commits

Author SHA1 Message Date
zmj bffef94202 add 2024-02-24 11:51:53 +08:00
zmj 9a4e2b08e1 add 2024-02-24 11:47:39 +08:00
3 changed files with 132 additions and 33 deletions

View File

@ -67,7 +67,7 @@ const handTown = (index) => {
}) })
} }
const getTownListsFn = async (area_code = 510502) => { const getTownListsFn = async (area_code = 510521) => {
let res = await apigetTownLists({ area_code }) let res = await apigetTownLists({ area_code })
townLists.value = res.data; townLists.value = res.data;
} }
@ -83,7 +83,6 @@ const props = defineProps({
// //
const page = ref(1) const page = ref(1)
const sendFn = (event, data = '') => { const sendFn = (event, data = '') => {
if (data.page) page.value = data.page;
sendMsg({ channel: props.channel, event, data }) sendMsg({ channel: props.channel, event, data })
} }

View File

@ -1,12 +1,28 @@
<template> <template>
<div class="content" v-if="flag"> <!-- <div class="content" v-if="flag">
<div class="plant-li" v-for="item in landList" :key="item.id" @click="handClick(item)"> <div class="plant-li" v-for="item in landList" :key="item.id" @click="handClick(item)">
{{ item.title }} {{ item.title }}
</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="card" v-for="(item, index) in landList" :key="index" @click="handClick(item)">
<div class="card-tit">
{{ item.town_name }}
</div>
<div class="card-cotnet">
<div>
{{ item.title }}
</div>
<div class="login" @click="lookFarmDetail(item)">查看详情</div>
</div>
</div>
</div> </div>
<areaChose v-else channel="user-plant" @handTown="handTown" @handArea="handArea"></areaChose> <areaChose v-else channel="user-plant" @handTown="handTown" @handArea="handArea"></areaChose>
<div class="area" @click="flag = !flag"> <div class="area"
@click="handArea1">
<div class="area-top"> <div class="area-top">
<div class="town">{{ area }}</div> <div class="town">{{ area }}</div>
<div class="town">{{ town }}</div> <div class="town">{{ town }}</div>
@ -19,7 +35,8 @@ import { ref, reactive } from "vue"
import { sendMsg } from "@/api.js" import { sendMsg } from "@/api.js"
import { landListApi } from "@/api.js" import { landListApi } from "@/api.js"
import areaChose from "../components/areaChose.vue" import areaChose from "../components/areaChose.vue"
import { useRouter } from "vue-router"
const router = useRouter()
const flag = ref(true) const flag = ref(true)
const town = ref("") const town = ref("")
const area = ref("泸县") const area = ref("泸县")
@ -27,48 +44,76 @@ let areaCode = 0
const handTown = (e) => { const handTown = (e) => {
town.value = e.name town.value = e.name
getLandList(areaCode ,e.code) getLandList(areaCode, e.code)
} }
const handArea = (e) => { const handArea = (e) => {
area.value = e.name area.value = e.name
areaCode=e.code areaCode = e.code
town.value = '' town.value = ''
getLandList(e.code) getLandList(e.code)
} }
const landList=ref([]) const landList = ref([])
const getLandList = async (areaCode=510521,streetCode='') => { const getLandList = async (areaCode = 510521, streetCode = '') => {
let res = await landListApi({ let res = await landListApi({
areaCode, areaCode,
streetCode, streetCode,
}) })
landList.value=res.data.list landList.value = res.data.list
console.log(landList.value) console.log(landList.value)
} }
getLandList() getLandList()
const handClick=(item)=>{ const handClick = (item) => {
let data={ let data = {
id:item.id, id: item.id,
landName:item.title, landName: item.title,
areaCode:item.county_code, areaCode: item.county_code,
townCode:item.town_code, townCode: item.town_code,
town_name:item.town_name town_name: item.town_name
} }
sendMsg({ channel: 'user-plant', event:'choseLand', data }) sendMsg({ channel: 'user-plant', event: 'choseLand', data })
// sendFn('choseLand', {id:item.id,landName:item.title,townCode:item.town_code} ) // sendFn('choseLand', {id:item.id,landName:item.title,townCode:item.town_code} )
} }
// //
const sendFn = (event, data = '') => { const sendFn = (event, data = '') => {
if (data.page) page.value = data.page; sendMsg({ channel:'user-plant', event, data })
sendMsg({ channel: 'user-plant', event, data }) }
const handArea1=()=>{
flag.value=!flag.value
if(!flag.value){
sendFn('choserArea', { name: '泸县', code:510521 })
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.content { // .content {
// 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: center;
// overflow-y: auto;
// .plant-li {
// width: 165.9px;
// height: 190.48px;
// background-image: url('/static/img/plantScreen/A.png');
// text-align: center;
// line-height: 190.48px;
// color: white;
// }
// }
.cont {
height: 500px; height: 500px;
width: 90vw; width: 90vw;
position: absolute; position: absolute;
@ -78,17 +123,74 @@ const sendFn = (event, data = '') => {
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: center; justify-content: space-between;
align-items: center;
overflow-y: auto; overflow-y: auto;
.plant-li { .card {
width: 165.9px; width: 378px;
height: 190.48px; height: 223px;
background-image: url('/static/img/plantScreen/A.png'); margin-bottom: 10px;
text-align: center; background-image: url('/static/img/breedScreen/bg.png');
line-height: 190.48px; background-size: 100% 100%;
font-size: 16px;
padding: 10px;
color: white; color: white;
position: relative;
.card-tit {
color: #00D6DD;
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 10px;
}
.card-cotnet {
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%);
}
}
} }
// background-color: red;
}
.cont::-webkit-scrollbar {
width: 10px;
background-color: #153041;
}
.cont::-webkit-scrollbar-track {
background-color: #153041;
}
::-webkit-scrollbar-thumb {
background-color: #084D89;
border-radius: 5px;
}
.back-btn {
width: 86.21px;
height: 31px;
position: absolute;
top: 70px;
left: 60.96px;
z-index: 9;
} }
.area { .area {
@ -121,5 +223,4 @@ const sendFn = (event, data = '') => {
height: 57px; height: 57px;
background-size: 100% 100%; background-size: 100% 100%;
transform: translateY(-20px); transform: translateY(-20px);
} }</style>
</style>

View File

@ -1,7 +1,7 @@
<template> <template>
<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 in merchant_list" :key="item.id"> <div class="card" v-for="item in merchant_list" :key="item.id" @click="sendFn('header3-3',{id:item.mer_id})">
<div class="card-tit"> <div class="card-tit">
{{ item.mer_name }} {{ item.mer_name }}
<span style="font-size: 14px;color: white;">{{ item.create_time.substring(0,10) }}</span> <span style="font-size: 14px;color: white;">{{ item.create_time.substring(0,10) }}</span>
@ -10,7 +10,7 @@
<div>商户姓名: {{ item.real_name }}</div> <div>商户姓名: {{ item.real_name }}</div>
<div style="margin: 20px 0;">商户属地: {{ item.mer_address }}</div> <div style="margin: 20px 0;">商户属地: {{ item.mer_address }}</div>
<div>商户分类: {{ item.merchantCategory?.category_name }}</div> <div>商户分类: {{ item.merchantCategory?.category_name }}</div>
<div class="login" @click="sendFn('header3-3',{id:item.mer_id})">登录</div> <div class="login" >登录</div>
</div> </div>
</div> </div>
</div> </div>
@ -153,7 +153,6 @@ const getmerchant_list = async () => {
limit: 50 limit: 50
}) })
merchant_list.value=res.data.list merchant_list.value=res.data.list
console.log(merchant_list.value)
} }
const sendFn = (event, data = '') => { const sendFn = (event, data = '') => {