This commit is contained in:
weipengfei 2024-01-24 18:52:50 +08:00
parent db2e8fb6e5
commit 88632945e8
2 changed files with 29 additions and 12 deletions

View File

@ -24,6 +24,11 @@ const instacneTrade = axios.create({
timeout: 30000, timeout: 30000,
}); });
const instacneTrike = axios.create({
baseURL: "https://crmeb-test.shop.lihaink.cn/",
timeout: 30000,
});
const configInstacne=(ins)=>{ const configInstacne=(ins)=>{
ins.interceptors.request.use( ins.interceptors.request.use(
(config) => { (config) => {
@ -62,6 +67,7 @@ const configInstacne=(ins)=>{
configInstacne(instacne) configInstacne(instacne)
configInstacne(instacnePlant) configInstacne(instacnePlant)
configInstacne(instacneTrade) configInstacne(instacneTrade)
configInstacne(instacneTrike)
export function sendMsg(params) { export function sendMsg(params) {
@ -72,7 +78,9 @@ export function landListApi(params) {
return instacnePlant.get('/api/dataview.land/landList', { params }) return instacnePlant.get('/api/dataview.land/landList', { params })
} }
export function vehicleListApi(params) {
return instacneTrike.get('/api/dataview/vehicle_list', { params })
}
// //

View File

@ -6,20 +6,28 @@
<el-select v-model="townCode" class="m-2" @change="changeTown" placeholder="Select" size="large"> <el-select v-model="townCode" class="m-2" @change="changeTown" placeholder="Select" size="large">
<el-option v-for="item in townOptions" :key="item.value" :label="item.label" :value="item.value" /> <el-option v-for="item in townOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select> </el-select>
<button @click="sendFn('back', { name: '泸县' }), townCode = ''">返回首页</button>
<button @click="sendFn('refresh'), townCode = ''">刷新</button> <button @click="sendFn('refresh'), townCode = ''">刷新</button>
<button @click="sendFn('choseLand', { landName: item.title,id:item.id })" v-for="item in landList"> {{ item.title }}</button> <div v-if="nowPages=='index'">
<button @click="sendFn('backHome', { name: '泸县' }), townCode = ''">返回首页</button> <button @click="sendFn('more_order_index')">更多订单</button>
<button @click="sendFn('detail', { name: item.title,id:item.id })" v-for="item in landList"> {{ item.title }}</button> <button @click="sendFn('c_car_index', { index: index })" v-for="(item, index) in vehicleList" :key="'car'+index"> {{ item.license }}</button>
</div>
<div v-else>
<button @click="sendFn('back', { name: '泸县' }), townCode = ''">返回首页</button>
<button @click="sendFn('more_order')">更多订单</button>
</div>
<p>地块</p>
</template> </template>
<script setup scoped> <script setup scoped>
import { ref, reactive } from "vue" import { ref, reactive } from "vue"
import { sendMsg } from "@/api.js" import { sendMsg } from "@/api.js"
import axios from "axios" import axios from "axios"
import { landListApi } from "@/api.js" import { vehicleListApi } from "@/api.js"
const nowPages = ref('index');
// //
const options = [ const options = [
@ -77,7 +85,6 @@ const changeTown = (e) => {
} }
}) })
getLandList()
} }
const getTownList = () => { const getTownList = () => {
@ -94,19 +101,21 @@ const getTownList = () => {
}) })
} }
const landList=ref([]) const vehicleList=ref([])
const getLandList = async () => { const getLandList = async () => {
let res = await landListApi({ let res = await vehicleListApi({
areaCode: areaCode.value, areaCode: areaCode.value,
streetCode: townCode.value streetCode: townCode.value
}) })
landList.value=res.data.list vehicleList.value=res.data.list
} }
getTownList() getTownList()
getLandList()
// //
const page = ref(1) const page = ref(1)
const sendFn = (event, data = '') => { const sendFn = (event, data = '') => {