修改搜索公寓全局变量的指向问题

This commit is contained in:
A1300399510
2024-04-29 18:07:03 +08:00
parent 4bc572173b
commit 31075ddd87
21 changed files with 37 additions and 28 deletions

View File

@@ -71,9 +71,9 @@
<div class="option-box flexflex flex1">
<div class="item flexcenter" :class="{ 'pitch': 0 == pitchValue['school'] }"
@click="selectOption('nearSchool', 0)">不限</div>
<div class="item flexcenter" v-for="item in nearSchoolList"
<div class="item flexcenter" v-for="(item,index) in nearSchoolList"
:class="{ 'pitch': item['id'] == pitchValue['school'] }"
@click="selectOption('nearSchool', item.id)">{{ item['name']
@click="selectOption('nearSchool', item.id)" :key="index">{{ item['name']
}}</div>
</div>
</div>

View File

@@ -92,7 +92,7 @@
<div class="option-item flexflex" style="padding-bottom: 10px;">
<div class="option-title">学校附近</div>
<div class="option-box flexflex flex1">
<div class="item flexcenter" :class="{ pitch: 0 == pitchValue['school'] }" @click="selectOption('nearSchool', 0)">不限</div>
<!-- <div class="item flexcenter" :class="{ pitch: 0 == pitchValue['school'] }" @click="selectOption('nearSchool', 0)">不限</div> -->
<div class="item flexcenter" v-for="(item, index) in nearSchoolList" :key="index" :class="{ pitch: item['id'] == pitchValue['school'] }" @click="selectOption('nearSchool', item.id)">{{ item["name"] }}</div>
</div>
</div>
@@ -290,6 +290,7 @@ let pitchValue = ref({
watchEffect(() => {
// nearSchoolList = store.state.apartment.school || []
nearSchoolList = store.state.schoolList || []
console.log("nearSchoolList",nearSchoolList);
roomTypeList = store.state.apartment.roomtype || []
roomTypeKey = store.state.roomTypeKey || {}
roomlistingsList = store.state.apartment.roomlistings || []

View File

@@ -13,7 +13,7 @@
<div class="location flexacenter" v-if="item['address']">
<img class="location-icon" src="@/assets/img/publicImage/location-icon.png" />
<div class="ellipsis">{{ item["address"] }}</div>
<span class="area-distance" v-if="pitchValue['school'] && item['distance']">{{ Math.round(item["distance"] * 10) / 10 }}km</span>
<span class="area-distance" v-if="pitchValue?.school && item['distance']">{{ Math.round(item["distance"] * 10) / 10 }}km</span>
</div>
<div class="type-list" v-if="item['roomlist']">

View File

@@ -381,7 +381,7 @@ let schoolSelectObj = reactive({ id: '', title: '不限', page: '' })
let schoolPages = ref(0) //页数
let shcoolData = shallowReactive([])
let setSchoolData = () => {
let arr = routePath.value === '/' ? store.state.seachTypeData[0] && store.state.seachTypeData[0].where : store.state.schoolList
let arr = routePath.value === '/' ? store.state.seachTypeData[0] && store.state.seachTypeData[0].where : JSON.parse(JSON.stringify(store.state.schoolList))
if (arr[0] && arr[0].id) arr.unshift({ name: '不限', id: '' })
let num = 0

View File

@@ -5,7 +5,6 @@ import { showFullScreenLoading, tryHideFullScreenLoading } from "./loading"
import store from "@/store/index"
axios.defaults.baseURL = "https://app.gter.net"
// axios.defaults.baseURL = '/index'
axios.defaults.emulateJSON = true
axios.defaults.withCredentials = true
@@ -21,7 +20,7 @@ axios.interceptors.request.use(
if (config.url != "/tenement/pc/api/user/operation" && !noMask) showFullScreenLoading()
// 开发时登录用的,可以直接替换小程序的 authorization
// if (process.env.NODE_ENV == "development") config['headers']['authorization'] = "x2mmnl9grt51bpplj2k6ioiuummzhnw3"
if (process.env.NODE_ENV == "development") config["headers"]["authorization"] = "mx25rp0q99x3sis8hidugttty80c5qum"
if (process.env.NODE_ENV == "development") config["headers"]["authorization"] = "b56e234d748d4203e3ce4caa0aedf70a"
// 当 noMask == true 和 confing.method == 'get' 时,删除 config.params['noMask']
if (noMask && config.method == "get") delete config.params["noMask"]

View File

@@ -38,7 +38,7 @@
</div>
</template>
<div class="one-list" v-if="!typeValue">
<div class="item flexacenter" v-for="(item, index) in typeData">
<div class="item flexacenter" v-for="(item, index) in typeData" :key="index">
<div class="dot"></div>
<div class="content flex1 flexacenter" @click="handleType(index)">
<div class="text">{{ item['name'] }}</div>
@@ -49,7 +49,7 @@
<div class="two-list flexflex" v-else>
<div class="left">
<div class="item flexacenter" v-for="(item, index) in typeData">
<div class="item flexacenter" v-for="(item, index) in typeData" :key="index">
<div class="dot"></div>
<div class="content flexacenter" :class="{ 'pitch': index == typeValue }"
@click="handleType(index)">
@@ -63,7 +63,7 @@
<div class="right flex1" v-if="typeData[typeValue]">
<div class="item flexacenter" :class="{ 'pitch': item.key == info['type'] }"
v-for="(item, index) in typeData[typeValue].data"
@click="handleType(item.key, item.value), typePopState = false">
@click="handleType(item.key, item.value), typePopState = false" :key="index">
<div class="value">{{ item['value'] }}</div>
<img class="icom" src="@/assets/img/edit/blue-tick.svg" />
</div>
@@ -127,7 +127,7 @@
<div class="right flex1 scrollbar" style="max-height: 360px;overflow: auto;">
<div class="item flexacenter" :class="{ 'pitch': item.key == info['rentalduration'] }"
v-for="(item, index) in item.choices"
@click="setValue('rentalduration', item['key']), rentaldurationPopState = false">
@click="setValue('rentalduration', item['key']), rentaldurationPopState = false" :key="index">
<div class="value">{{ item['value'] }}</div>
<img class="icom" src="@/assets/img/edit/blue-tick.svg" />
</div>
@@ -931,6 +931,8 @@ export default {
loading: null, // 加载
uploadData:"", // 上传时 加入的
}
},
mounted() {
@@ -941,7 +943,6 @@ export default {
this.token = urlParams.get('token');
this.intermediary = urlParams.get('intermediary') || 3; // 默认写房东吧
// this.verified = urlParams.get('verified') || 0;
console.log("urlParams.get('intermediary')",urlParams.get('intermediary'));
this.userIntermediary = this.$store.state.user['intermediary']
this.init();
@@ -979,7 +980,6 @@ console.log("urlParams.get('intermediary')",urlParams.get('intermediary'));
let data = res.data
let fieldinfo = data.fieldinfo
let typeData = []
let locationData = []
let rentaldurationData = []
@@ -1089,7 +1089,7 @@ console.log("urlParams.get('intermediary')",urlParams.get('intermediary'));
this.fieldinfoUpload = fieldinfo.upload
this.fieldinfoContact = fieldinfo.contact
this.fieldinfoInfo = fieldinfo.info
this.uploadData = data.uploadData
this.fieldinfoBasic.forEach(element => {
if (element['field'] == "type" && info['type']) {
@@ -1181,6 +1181,8 @@ console.log("urlParams.get('intermediary')",urlParams.get('intermediary'));
this.$message.error("请大小小于10M");
return
}
event.target.value = '' // 去除值 使用户可以选中同一个
const reader = new FileReader();
reader.onload = () => {
@@ -1221,6 +1223,8 @@ console.log("urlParams.get('intermediary')",urlParams.get('intermediary'));
this.info['wechatdata'] = res.data
this.$message.success("上传成功!!!");
}).catch(()=>{
this.loading.close();
})
},
@@ -1230,6 +1234,7 @@ console.log("urlParams.get('intermediary')",urlParams.get('intermediary'));
this.selectedFiles = files
this.mediaUploadIndex = 0
this.combingMedia(type)
event.target.value = '' // 去除值 使用户可以选中同一个
},
// 梳理媒体的 格式
@@ -1281,8 +1286,9 @@ console.log("urlParams.get('intermediary')",urlParams.get('intermediary'));
formData.append('files', target); // 文件数据
formData.append('name', target.name); // 文件名
formData.append('type', type); // 文件名
this.$axios.post('/tenement/pc/api/publish/upload', formData).then(res => {
formData.append('data', this.uploadData); // 文件名
// this.$axios.post('/tenement/pc/api/publish/upload', formData).then(res => {
this.$axios.post('https://oss.gter.net/upload', formData).then(res => {
res = res['data']
if (res.code != 200) {

View File

@@ -77,7 +77,9 @@ let setInitial = () => {
//获取搜索数据
let getDataList = (data, type = true) => {
console.log("11414");
// console.log(data,type)
console.log(type);
if (!type) {
//是否继续搜索
seachSelectData.data.tabType !== "apartment" ? (pageList.value = []) : (listApartment.value = [])
@@ -100,6 +102,7 @@ let getDataList = (data, type = true) => {
} else {
seachApi = api.apartment(postData)
}
console.log("555");
seachApi.then(res => {
if (res.code === 200) {
// console.log(res.data)