Commit 7f4d7812 authored by shilei's avatar shilei

feat: 走进园区筛选

parent 624172b8
......@@ -26,4 +26,6 @@ export default {
queryInvestInfos: '/postcard/api/investClueInfo/page',
// 联系我们列表
queryContacts: '/postcard/api/scSourceInfo/contact',
// 获取查询条件列表
queryFiltersList: '/postcard/api/sysDictData/listByCodes'
}
......@@ -135,7 +135,7 @@ export default {
deep: true,
immediate: true,
handler(obj) {
if (obj.itemList1) {
if (obj?.itemList1) {
this.canChoose = true;
}
},
......@@ -253,7 +253,7 @@ export default {
newList.forEach((res) => {
res.child.forEach((item) => {
item.child.forEach((e) => {
arr.push(e.description);
arr.push(e.dictLabel);
});
});
});
......@@ -267,7 +267,7 @@ export default {
if (newList.length > 0) {
let arr = [];
newList.forEach((item) => {
arr.push(item.description);
arr.push(item.dictLabel);
});
this.menuList[this.selectIndex].showName = arr.toString();
} else {
......
......@@ -12,7 +12,7 @@
: ''
"
@click.stop="selectLeft(index)"
>{{ item.description }}
>{{ item.dictLabel }}
</view>
</scroll-view>
<scroll-view class="item-middle" scroll-y="true">
......@@ -34,7 +34,7 @@
@click.stop="selectMiddle(inx)"
>
<view class="item-middle-list-name">
{{ mess.description }}
{{ mess.dictLabel }}
</view>
<!-- <image
v-if="mess.chooseState"
......@@ -63,7 +63,7 @@
@click.stop="selectRight(mess)"
>
<view class="item-right-list-name">
{{ mess.description }}
{{ mess.dictLabel }}
</view>
<image
v-if="mess.chooseState"
......
......@@ -14,7 +14,7 @@
: ''
"
@click.stop="chooseLeft(index)"
>{{ item.name }}
>{{ item.dictLabel }}
</view>
</scroll-view>
<scroll-view
......@@ -41,7 +41,7 @@
class="item-right-list-name-info"
:style="mess.chooseState ? 'color:' + themeColor : ''"
>
{{ mess.name }}
{{ mess.dictLabel }}
</view>
<image
v-if="mess.chooseState"
......
......@@ -9,7 +9,7 @@
@click.stop="selectRight(item)"
:style="item.chooseState ? 'background: #F2F2F2' : ''"
>
<view class="item-right-list-name">{{ item.description }} </view>
<view class="item-right-list-name">{{ item.dictLabel }} </view>
<image
v-if="item.chooseState"
class="item-right-list-img"
......
<template>
<media-card
:img="areaInfo.imgUrl"
:title="areaInfo.name"
:img="areaInfo.imgUrl || ''"
:title="areaInfo.name || ''"
:cardId="areaInfo.id"
@click="toDetail"
>
......
<template>
<media-card
:img="detail.imgUrl"
:title="detail.name"
:img="detail.imgUrl || ''"
:title="detail.name || ''"
:keyWords="keyWords"
:cardId="detail.id"
@click="toDetail"
......@@ -26,13 +26,16 @@
<script>
import mediaCard from "./card.vue";
export default {
name: "AreaCard",
components: {mediaCard},
props: {
detail: {
type: Object,
default: () => ({}),
},
keyWords: {
type: String,
default: "",
},
},
methods: {
toDetail() {
......
<template>
<media-card
:img="parkInfo.imgUrl"
:title="parkInfo.name"
:img="parkInfo.imgUrl || ''"
:title="parkInfo.name || ''"
:keyWords="keyWords"
:cardId="parkInfo.id"
@click="toDetail"
......@@ -40,20 +40,6 @@ export default {
type: String,
default: "",
},
hideCollect: {
default: false,
},
showUpdateTime: {
default: false,
},
showBtn: {
type: Boolean,
default: false,
},
from: {
type: String,
default: '',
},
},
data() {
return {
......
......@@ -13,7 +13,6 @@
<span class="line" v-if="activeBar === index"></span>
</view>
</view>
<div style="height: 60rpx"></div>
<div
class="flex align-center justify-between"
style="padding: 25rpx 23rpx;background: #fff;position: fixed;top: 60rpx;width: 100vw "
......@@ -24,6 +23,9 @@
<input
placeholder="请输入搜索关键词"
placeholder-style="color: #333"
v-model="searchKey"
@confirm="handleSearch"
confirm-type="search"
/>
</div>
<div
......@@ -46,15 +48,14 @@
</div>
</div>
<dropdown-vue
v-if="activeBar != 1"
ref="dropDown"
:menuList="menuList"
:dataObj="dataObj"
:menuList="$u.deepClone(menuList[activeBar])"
:dataObj="$u.deepClone(filterList[activeBar])"
@change="change"
themeColor="#4374EF"
:top="166"
></dropdown-vue>
<div style="height: 172rpx" :style="{height: activeBar === 1 ? '112rpx': '186rpx'}"></div>
<div style="height: 246rpx"></div>
<view class="tab-contant">
<view
class="media-card"
......@@ -62,22 +63,22 @@
:key="cardInfo.id"
@click="toDetail(cardInfo)"
>
<park-card-vue :detail="cardInfo" v-if="activeBar == 0"></park-card-vue>
<land-card-vue :detail="cardInfo" v-if="activeBar == 1"></land-card-vue>
<carrier-card-vue :detail="cardInfo" v-if="activeBar == 2"></carrier-card-vue>
<park-card-vue :key-words="keyWords" :detail="cardInfo" v-if="activeBar == 0"></park-card-vue>
<land-card-vue :key-words="keyword" :detail="cardInfo" v-if="activeBar == 1"></land-card-vue>
<carrier-card-vue :key-words="keyword" :detail="cardInfo" v-if="activeBar == 2"></carrier-card-vue>
</view>
</view>
<!-- <u-empty
icon="/static/img/no-search-result.png"
<u-empty
icon="/static/img/empty_list.png"
v-if="dataList.length === 0"
width="300"
height="300"
textSize="26"
text="暂无收藏内容"
text="暂无查询内容"
textColor="#BDBDBD"
marginTop="120"
>
</u-empty> -->
</u-empty>
</view>
</template>
......@@ -106,22 +107,58 @@ export default {
isLoading: true,
//筛选菜单列表
menuList: [
{
id: 1,
name: "主导产业",
isMultiple: false, //是否多选
showType: 3, //下拉框类型(1、2、3、4)
},
{
id: 2,
name: "面积",
isMultiple: false, //是否多选
showType: 3, //下拉框类型(1、2、3、4)
isSingle: true,
},
[
{
id: 1,
name: "级别",
isMultiple: false, //是否多选
showType: 3, //下拉框类型(1、2、3、4)
},
{
id: 2,
name: "面积",
isMultiple: false, //是否多选
showType: 3, //下拉框类型(1、2、3、4)
isSingle: true,
},
],
[
{
id: 1,
name: "土地类型",
isMultiple: false, //是否多选
showType: 3, //下拉框类型(1、2、3、4)
},
{
id: 2,
name: "面积",
isMultiple: false, //是否多选
showType: 3, //下拉框类型(1、2、3、4)
},
],
[
{
id: 1,
name: "载体类型",
isMultiple: false, //是否多选
showType: 3, //下拉框类型(1、2、3、4)
},
{
id: 2,
name: "建筑结构",
isMultiple: false, //是否多选
showType: 1, //下拉框类型(1、2、3、4)
},
{
id: 3,
name: "面积",
isMultiple: false, //是否多选
showType: 3, //下拉框类型(1、2、3、4)
},
]
],
// 筛选项数据
dataObj: {
filterList: {
itemList1: [],
itemList2: [
],
......@@ -137,22 +174,46 @@ export default {
itemList3: [],
itemList4: [],
},
item1: {},
item2: {},
item3: {},
searchKey: '',
keyWords: ''
};
},
mounted() {
this.getList();
// this.getFilterList("都市圈");
// this.getFilterList("开发区");
// this.getFilterList("产业园");
store.dispatch('getFilterEnum').then(() => {
this.filterList = [
{
itemList1: this.filterEnum.park_level,
itemList2: this.filterEnum.park_area,
},
{
itemList1: this.filterEnum.land_type,
itemList2: this.filterEnum.land_area,
},
{
itemList1: this.filterEnum.carrier_type,
itemList2: this.filterEnum.carrier_construction,
itemList3: this.filterEnum.carrier_area,
}
]
})
},
methods: {
getList() {
if (!this.haveMore) return;
this.isLoading = true;
let searchKey = {};
let searchCondition = {};
this.keyWords = this.searchKey;
// this.filterChoice.map(item => {
// searchCondition[item.dictType] = item.dictValue;
// })
for(const key in this.filterChoice) {
console.log(key, this.filterChoice, this.filterChoice[key])
if(this.filterChoice[key].length){
searchCondition[this.filterChoice[key][0].dictType] = this.filterChoice[key][0].dictValue;
}
}
searchCondition.name = this.searchKey
this.$fetch({
url: this.api,
methods: "post",
......@@ -162,7 +223,7 @@ export default {
data: {
current: this.pageNum,
size: 20,
condition: {}
condition: searchCondition
},
success: (res) => {
this.isLoading = false;
......@@ -199,6 +260,8 @@ export default {
this.activeBar = tab;
this.pageNum = 1;
this.haveMore = true;
this.searchKey = '';
this.keyWords = ''
this.filterChoice = {
itemList1: [],
itemList2: [],
......@@ -208,162 +271,16 @@ export default {
switch (tab) {
case 0:
this.api = API.parkList;
this.menuList = [
{
id: 1,
name: "主导产业",
isMultiple: false, //是否多选
showType: 3, //下拉框类型(1、2、3、4)
},
{
id: 2,
name: "面积",
isMultiple: false, //是否多选
showType: 3, //下拉框类型(1、2、3、4)
isSingle: true,
},
// {
// id: 3,
// name: "人口",
// isMultiple: false, //是否多选
// showType: 3, //下拉框类型(1、2、3、4)
// isSingle: true,
// },
// {
// id: 3,
// name: "GDP",
// isMultiple: false, //是否多选
// showType: 3, //下拉框类型(1、2、3、4)
// isSingle: true,
// },
];
this.dataObj = uni.$u.deepClone(this.item1);
break;
case 1:
this.api = API.landList;
// this.menuList = [
// {
// id: 1,
// name: "级别",
// isMultiple: false, //是否多选
// showType: 3, //下拉框类型(1、2、3、4)
// },
// {
// id: 2,
// name: "类型",
// isMultiple: false, //是否多选
// showType: 3, //下拉框类型(1、2、3、4)
// },
// {
// id: 3,
// name: "面积",
// isMultiple: false, //是否多选
// showType: 3, //下拉框类型(1、2、3、4)
// },
// ];
this.dataObj = uni.$u.deepClone(this.item2);
break;
case 2:
this.api = API.carrierList;
this.menuList = [
{
id: 1,
name: "载体类型",
isMultiple: false, //是否多选
showType: 3, //下拉框类型(1、2、3、4)
},
{
id: 2,
name: "建筑结构",
isMultiple: false, //是否多选
showType: 1, //下拉框类型(1、2、3、4)
},
{
id: 3,
name: "面积",
isMultiple: false, //是否多选
showType: 3, //下拉框类型(1、2、3、4)
},
];
this.dataObj = uni.$u.deepClone(this.item3);
break;
}
this.getList();
},
getFilterList(name) {
this.$fetch({
url: API.filterList + "/" + name,
methods: "get",
success: (res) => {
if (name == "都市圈") {
this.item1.itemList1 = res.industry;
this.item1.itemList2 = [
{
name: "默认排序",
description: "默认排序",
value: "",
},
{
name: "面积由大到小排序",
description: "面积由大到小排序",
value: "desc",
},
{
name: "面积由小到大排序",
description: "面积由小到大排序",
value: "asc",
},
];
this.item1.itemList3 = [
{
name: "默认排序",
description: "默认排序",
value: "",
},
{
name: "人口由多到少排序",
description: "人口由多到少排序",
value: "desc",
},
{
name: "人口由少到多排序",
description: "人口由少到多排序",
value: "asc",
},
];
this.item1.itemList4 = [
{
name: "默认排序",
description: "默认排序",
value: "",
},
{
name: "GDP由大到小排序",
description: "GDP由大到小排序",
value: "desc",
},
{
name: "GDP由小到大排序",
description: "GDP由小到大排序",
value: "asc",
},
];
this.dataObj = uni.$u.deepClone(this.item1);
}
if (name == "开发区") {
this.item2.itemList1 = res.level;
this.item2.itemList2 = res.type;
this.item2.itemList3 = res.area;
}
if (name == "产业园") {
this.item3.itemList1 = res.level;
this.item3.itemList2 = res.industry;
this.item3.itemList3 = res.area;
}
},
});
},
change(e) {
console.log("所有选择的条件:", e.chooseInfo);
this.filterChoice = e.chooseInfo;
......@@ -372,10 +289,16 @@ export default {
this.haveMore = true;
this.getList();
},
handleSearch() {
this.dataList = [];
this.pageNum = 1;
this.haveMore = true;
this.getList();
}
},
computed: {
refreshCollectionPage() {
return store.state.refreshCollection;
filterEnum() {
return store.state.filterEnum;
},
},
watch: {
......
src/static/img/icon-tab_1.png

749 Bytes | W: | H:

src/static/img/icon-tab_1.png

1.63 KB | W: | H:

src/static/img/icon-tab_1.png
src/static/img/icon-tab_1.png
src/static/img/icon-tab_1.png
src/static/img/icon-tab_1.png
  • 2-up
  • Swipe
  • Onion skin
src/static/img/icon-tab_1_active.png

1.86 KB | W: | H:

src/static/img/icon-tab_1_active.png

1.37 KB | W: | H:

src/static/img/icon-tab_1_active.png
src/static/img/icon-tab_1_active.png
src/static/img/icon-tab_1_active.png
src/static/img/icon-tab_1_active.png
  • 2-up
  • Swipe
  • Onion skin
src/static/img/icon-tab_2.png

845 Bytes | W: | H:

src/static/img/icon-tab_2.png

1.73 KB | W: | H:

src/static/img/icon-tab_2.png
src/static/img/icon-tab_2.png
src/static/img/icon-tab_2.png
src/static/img/icon-tab_2.png
  • 2-up
  • Swipe
  • Onion skin
src/static/img/icon-tab_2_active.png

1.13 KB | W: | H:

src/static/img/icon-tab_2_active.png

1.52 KB | W: | H:

src/static/img/icon-tab_2_active.png
src/static/img/icon-tab_2_active.png
src/static/img/icon-tab_2_active.png
src/static/img/icon-tab_2_active.png
  • 2-up
  • Swipe
  • Onion skin
src/static/img/icon-tab_3.png

1.44 KB | W: | H:

src/static/img/icon-tab_3.png

2.85 KB | W: | H:

src/static/img/icon-tab_3.png
src/static/img/icon-tab_3.png
src/static/img/icon-tab_3.png
src/static/img/icon-tab_3.png
  • 2-up
  • Swipe
  • Onion skin
src/static/img/icon-tab_3_active.png

1.49 KB | W: | H:

src/static/img/icon-tab_3_active.png

2.54 KB | W: | H:

src/static/img/icon-tab_3_active.png
src/static/img/icon-tab_3_active.png
src/static/img/icon-tab_3_active.png
src/static/img/icon-tab_3_active.png
  • 2-up
  • Swipe
  • Onion skin
src/static/img/icon-tab_4.png

1.32 KB | W: | H:

src/static/img/icon-tab_4.png

2.62 KB | W: | H:

src/static/img/icon-tab_4.png
src/static/img/icon-tab_4.png
src/static/img/icon-tab_4.png
src/static/img/icon-tab_4.png
  • 2-up
  • Swipe
  • Onion skin
src/static/img/icon-tab_4_active.png

1.35 KB | W: | H:

src/static/img/icon-tab_4_active.png

2.03 KB | W: | H:

src/static/img/icon-tab_4_active.png
src/static/img/icon-tab_4_active.png
src/static/img/icon-tab_4_active.png
src/static/img/icon-tab_4_active.png
  • 2-up
  • Swipe
  • Onion skin
import Vue from 'vue'
import Vuex from 'vuex'
import fetch from '@/utils/request.js'
import API from "@/api/url";
Vue.use(Vuex)
const store = new Vuex.Store({
state: {
policyList: [],
primaryIndustryList: []
primaryIndustryList: [],
filterEnum: []
},
actions: {
getFilterEnum({commit}) {
const queryStr =
'park_level,park_direction,park_area,park_resources,land_price,industry_policy,development_level,development_type,development_direction,development_area,industry_policy,land_type,land_area,carrier_area,carrier_type,carrier_construction,floor_height,load_bearing,pillar_distance';
return new Promise((resolve, reject) => {
fetch({
url: API.queryFiltersList,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
data: {
code: queryStr
},
success: res => {
commit('setFilterEnum', res)
resolve(res)
}
})
})
}
},
mutations: {
setPolicyList(state, provider) {
......@@ -14,6 +39,9 @@ const store = new Vuex.Store({
},
setPrimaryIndustryList(state, provider) {
state.primaryIndustryList = provider
},
setFilterEnum(state, provider) {
state.filterEnum = provider;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment