提交
This commit is contained in:
parent
8cc4549dca
commit
d5c86e2038
10
src/App.vue
10
src/App.vue
@ -1,10 +1,14 @@
|
||||
<template>
|
||||
<<<<<<< HEAD
|
||||
<router-view/>
|
||||
=======
|
||||
<router-view />
|
||||
<login></login>
|
||||
>>>>>>> 542e853 (提交)
|
||||
</template>
|
||||
<script setup>
|
||||
import { useRouter } from 'vue-router'
|
||||
const router = useRouter()
|
||||
// router.push(`/edit-choosing`)
|
||||
import login from '@/components/public/login.vue'
|
||||
|
||||
</script>
|
||||
<style lang="less">
|
||||
* {
|
||||
|
@ -44,22 +44,38 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-popover>
|
||||
<div class="seach-btn dis-f al-item jus-x" @click="seachList">
|
||||
<div class="seach-btn dis-f al-item jus-x" @click="handleKeyword">
|
||||
<img src="../../assets/homeImage/seachImg.svg" class="img" alt="">
|
||||
搜索
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="tool-btn dis-f jus-x al-item add-btn">
|
||||
<img src="../../assets/homeImage/addBtn.png" class="img" alt="">
|
||||
发布房源
|
||||
</div>
|
||||
|
||||
<div class="tool-btn consult-btn flexcenter">
|
||||
<img class="consult-icon" src="@/assets/img/publicImage/consult-icon.png">
|
||||
咨询小助手
|
||||
</div>
|
||||
<el-popover placement="bottom-end" popper-class="consult-popover flexcenter" :width="300"
|
||||
trigger="click" :show-arrow="false"
|
||||
popper-style="background-color:transparent;border: none;box-shadow: none;padding:0;">
|
||||
<template #reference>
|
||||
<div class="tool-btn consult-btn flexcenter">
|
||||
<img class="consult-icon" src="@/assets/img/publicImage/consult-icon.png">
|
||||
咨询小助手
|
||||
</div>
|
||||
</template>
|
||||
<div class="consult-pop flexacenter">
|
||||
<div class="consult-title flexacenter">欢迎联系 <b>{{ wechat['nickname'] }}</b> 咨询房源</div>
|
||||
<div class="consult-QRcode flexcenter">
|
||||
<img class="consult-QRcode-img" :src="wechat['wechatqrcode']" />
|
||||
</div>
|
||||
<div class="consult-hint">微信扫码添加好友</div>
|
||||
<div class="consult-remark flexacenter">备注:<b>寄托租房</b></div>
|
||||
</div>
|
||||
<!-- <img class="QR-code" :src="wechat['wechatqrcode']" alt=""> -->
|
||||
</el-popover>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 展示的 展开和隐藏按钮 -->
|
||||
@ -151,7 +167,6 @@
|
||||
<div class="quantity flexacenter">
|
||||
共 <b class="b">{{ count }}</b> 个品牌公寓
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -160,8 +175,14 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watchEffect, reactive, defineProps, nextTick } from 'vue';
|
||||
import { ref, toRefs, watchEffect, reactive, defineProps, nextTick } from 'vue';
|
||||
import { useStore } from 'vuex';
|
||||
import store from '../../store/index';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
const usestore = useStore();
|
||||
const { wechat } = toRefs(usestore.state);
|
||||
const router = useRouter()
|
||||
|
||||
const props = defineProps({
|
||||
count: {
|
||||
@ -234,13 +255,17 @@ const rentInput = () => clearingAmountState = false
|
||||
|
||||
// 点击历史搜索和热门推荐
|
||||
const handleKeyword = value => {
|
||||
pitchValue.value['keyword'] = value
|
||||
seachList()
|
||||
// pitchValue.value['keyword'] = value
|
||||
|
||||
if (!value) value = pitchValue.value['keyword']
|
||||
|
||||
router.push(`/seachPage?keyword=${value}`)
|
||||
// seachList()
|
||||
}
|
||||
|
||||
//搜索数据
|
||||
let seachList = () => {
|
||||
if (historyArr.value.indexOf(pitchValue.value['keyword']) == -1) {
|
||||
if (historyArr.value.indexOf(pitchValue.value['keyword'] && pitchValue.value['keyword']) == -1) {
|
||||
historyArr.value.unshift(pitchValue.value['keyword'])
|
||||
storingHistory()
|
||||
}
|
||||
@ -661,5 +686,66 @@ const selectOption = (type, value) => {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.el-popover.el-popper.consult-popover {
|
||||
.consult-pop {
|
||||
width: 300px;
|
||||
height: 300px;
|
||||
border-radius: 10px;
|
||||
padding-top: 45px;
|
||||
font-family: 'PingFangSC-Regular', 'PingFang SC', sans-serif;
|
||||
-moz-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.101960784313725);
|
||||
-webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.101960784313725);
|
||||
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.101960784313725);
|
||||
background-color: #fff;
|
||||
flex-direction: column;
|
||||
|
||||
.consult-title {
|
||||
font-size: 15px;
|
||||
color: #555555;
|
||||
margin-bottom: 24px;
|
||||
|
||||
b {
|
||||
color: #000;
|
||||
font-weight: 650;
|
||||
margin: 0 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.consult-QRcode {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
border-radius: 20px;
|
||||
-moz-box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.101960784313725);
|
||||
-webkit-box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.101960784313725);
|
||||
box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.101960784313725);
|
||||
margin-bottom: 20px;
|
||||
background: #fff;
|
||||
|
||||
.consult-QRcode-img {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
}
|
||||
|
||||
.consult-hint {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.consult-hint,
|
||||
.consult-remark {
|
||||
font-size: 13px;
|
||||
color: #555555;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.consult-remark {
|
||||
b {
|
||||
font-weight: 650;
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="item flexflex">
|
||||
<div class="item flexflex" @click="goapArtmentDetails">
|
||||
<img class="img" :src="item['image']">
|
||||
<div class="title">{{ item['title'] }}</div>
|
||||
<div class="hint">{{ item['propaganda'] }}</div>
|
||||
@ -31,11 +31,16 @@
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const props = defineProps({
|
||||
item: Object,
|
||||
});
|
||||
|
||||
const goapArtmentDetails = () => router.push(`/apartmentDetail?uniqid=${props['item'].uniqid}`)
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@ -51,6 +56,7 @@ const props = defineProps({
|
||||
margin-bottom: 20px;
|
||||
position: relative;
|
||||
height: fit-content;
|
||||
cursor: pointer;
|
||||
|
||||
.img {
|
||||
width: 366px;
|
||||
|
126
src/components/public/login.vue
Normal file
126
src/components/public/login.vue
Normal file
@ -0,0 +1,126 @@
|
||||
<template>
|
||||
<div v-if="store.state.showloginmodal" class="htmlCode flexcenter" v-html="htmlCode" ref="htmlRef"></div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { goTologin } from '@/utils/util';
|
||||
import { ref, watch, onMounted, getCurrentInstance, nextTick, createApp } from 'vue'
|
||||
import store from '@/store/index';
|
||||
|
||||
|
||||
console.log("store", store);
|
||||
let showLoginModal = ref(false);
|
||||
|
||||
watch(() => store.state.showloginmodal, (newValue) => {
|
||||
console.log("newValue", newValue);
|
||||
// store.state.showloginmodal = false
|
||||
if (newValue) init1()
|
||||
});
|
||||
|
||||
|
||||
store.state.showloginmodal ? init1() : ''
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
let htmlCode = ref("")
|
||||
let htmlRef = ref(null)
|
||||
|
||||
const init1 = () => {
|
||||
|
||||
if (document.documentElement.clientHeight <= 724) {
|
||||
goTologin()
|
||||
return
|
||||
}
|
||||
|
||||
let url = encodeURIComponent(location.href);
|
||||
proxy.$get(`https://passport.gter.net/login/ajax?inajax=1&referer=${url}`).then(res => {
|
||||
htmlCode.value = res
|
||||
nextTick(() => {
|
||||
executeScripts()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const aaa = () => {
|
||||
clearInterval(timer1);
|
||||
clearInterval(timer);
|
||||
clearInterval(timee)
|
||||
dragValidationState = false
|
||||
isSuccess = false
|
||||
store.state.showloginmodal = false
|
||||
};
|
||||
|
||||
const scriptTags = []; // 存储创建的 script 标签
|
||||
|
||||
let scripts = ""
|
||||
const executeScripts = () => {
|
||||
const closeEleent = htmlRef.value.querySelector("#registerNewApp #app"); // 使用 querySelector 获取元素
|
||||
|
||||
const customElement = document.createElement('div'); // 创建一个真实的 DOM 节点
|
||||
customElement.className = 'qwe'; // 设置节点的类名为 "qwe"
|
||||
customElement.addEventListener('click', aaa); // 绑定事件 "poi"
|
||||
closeEleent.appendChild(customElement); // 将真实的 DOM 节点添加到具有 ref="aa" 的元素中
|
||||
|
||||
scripts = htmlRef.value.querySelectorAll('script');
|
||||
|
||||
scripts.forEach((script, index) => {
|
||||
if (script.src) {
|
||||
// 创建一个新的script标签来加载外部脚本
|
||||
const newScript = document.createElement('script');
|
||||
newScript.src = script.src;
|
||||
newScript.onload = () => {
|
||||
console.log('外部脚本已加载');
|
||||
// 可以在这里使用外部脚本提供的功能
|
||||
};
|
||||
document.body.appendChild(newScript);
|
||||
} else {
|
||||
if (typeof openWin != undefined) {
|
||||
// 创建一个新的script标签并将其中的JavaScript代码执行
|
||||
const newScript = document.createElement('script');
|
||||
newScript.innerHTML = script.innerHTML;
|
||||
newScript.setAttribute('data-name', `script-${index}`); // 为每个 script 标签设置一个名称
|
||||
if (typeof openWin === 'undefined') {
|
||||
document.body.appendChild(newScript);
|
||||
scriptTags.push(newScript)
|
||||
} else init()
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.htmlCode {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
z-index: 1111;
|
||||
}
|
||||
|
||||
.htmlCode * {
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.htmlCode .register .box,
|
||||
.htmlCode .register .box {
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.qwe {
|
||||
position: absolute;
|
||||
top: -48px;
|
||||
right: -48px;
|
||||
height: 35px;
|
||||
width: 35px;
|
||||
overflow: hidden;
|
||||
z-index: 1000;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
@ -31,8 +31,8 @@ import 'element-plus/dist/index.css'
|
||||
import 'element-plus/theme-chalk/index.css'
|
||||
import locale from 'element-plus/lib/locale/lang/zh-cn';
|
||||
|
||||
// import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
// import zhCn from 'element-plus/lib/locale/lang/zh-cn'
|
||||
import api from "./utils/api";
|
||||
|
||||
//引入封装Axios请求
|
||||
@ -74,7 +74,6 @@ app.use(ElSkeletonItem)
|
||||
app.use(ElMessage)
|
||||
app.use(ElBreadcrumb)
|
||||
|
||||
|
||||
app.use(store).use(router).use(Axios).mount('#app')
|
||||
// app.use(store).use(router).use(Axios).use(ElementPlus, {
|
||||
// locale: zhCn
|
||||
|
@ -98,6 +98,7 @@ const router = createRouter({
|
||||
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
<<<<<<< HEAD
|
||||
//导航数据
|
||||
if(/['seachPage','needHousing','intermediaryHousing','personHousing']/.test(from.path)){
|
||||
store.state.routeList.secondaryIndex.title=from.meta.title
|
||||
@ -105,6 +106,9 @@ router.beforeEach((to, from, next) => {
|
||||
}
|
||||
|
||||
//
|
||||
=======
|
||||
console.log(to, from);
|
||||
>>>>>>> 542e853 (提交)
|
||||
next()
|
||||
let meta = to['meta'] || {}
|
||||
let title = meta['title']
|
||||
|
@ -9,6 +9,7 @@ export default createStore({
|
||||
wechat: {}, // 微信号 二维码等数据
|
||||
nav: [], // 顶部的导航数据
|
||||
apartment: {}, // 公寓筛选的字段
|
||||
// <<<<<<< HEAD
|
||||
routeList:{
|
||||
index:{
|
||||
path:'/',
|
||||
@ -19,6 +20,9 @@ export default createStore({
|
||||
title:'',
|
||||
}
|
||||
},//导航路由列表
|
||||
// =======
|
||||
showloginmodal: false, // 是否需要登录状态
|
||||
// >>>>>>> 542e853 (提交)
|
||||
},
|
||||
getters: {
|
||||
|
||||
|
@ -1,7 +1,11 @@
|
||||
import axios from 'axios';
|
||||
import QS from 'qs';
|
||||
import { goTologin } from '@/utils/util.js'
|
||||
<<<<<<< HEAD
|
||||
import {showFullScreenLoading,tryHideFullScreenLoading} from './loading'
|
||||
=======
|
||||
import store from '@/store/index';
|
||||
>>>>>>> 542e853 (提交)
|
||||
|
||||
axios.defaults.baseURL = 'https://app.gter.net'
|
||||
// axios.defaults.baseURL = '/index'
|
||||
@ -32,7 +36,8 @@ axios.interceptors.response.use(
|
||||
switch (error.response.status) {
|
||||
// 401: 未登录
|
||||
case 401:
|
||||
goTologin() // 跳转登录页面
|
||||
// goTologin() // 跳转登录页面
|
||||
store.state.showloginmodal = true
|
||||
break
|
||||
case 403:
|
||||
// router.push('/login')
|
||||
@ -74,7 +79,11 @@ const $post = (url, params) => {
|
||||
axios.post(url, QS.stringify(params)).then(res => {
|
||||
resolve(res.data);
|
||||
}).catch(err => {
|
||||
reject(err.data)
|
||||
console.log("err", err.data);
|
||||
if (err.data.code == 401) {
|
||||
|
||||
} else reject(err.data)
|
||||
|
||||
})
|
||||
});
|
||||
}
|
||||
|
@ -1,7 +1,9 @@
|
||||
<template>
|
||||
<page-top-bar></page-top-bar>
|
||||
|
||||
asgdaskhjdkhsk jkhkhkjhkjhjhjjjjjhjkhh
|
||||
<div class="content"></div>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
@ -771,10 +771,6 @@ export default {
|
||||
this.intermediary = urlParams.get('intermediary') || 3; // 默认写房东吧
|
||||
// this.verified = urlParams.get('verified') || 0;
|
||||
|
||||
setTimeout(() => {
|
||||
console.log(this.$store.state.user, "state");
|
||||
}, 1000)
|
||||
|
||||
this.init();
|
||||
},
|
||||
components: {
|
||||
@ -792,8 +788,6 @@ export default {
|
||||
return require(url)
|
||||
},
|
||||
init() {
|
||||
|
||||
|
||||
this.loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
@ -852,19 +846,17 @@ export default {
|
||||
|
||||
if (info['type']) this.typeValue = info['type'] >>> 0
|
||||
|
||||
// if (!info['leasetime']) info['leasetime'] = null
|
||||
|
||||
let intermediary = data.intermediary
|
||||
|
||||
if (intermediary == 6) {
|
||||
if (info["rent"].length != 0) {
|
||||
this.rent_min = Number(info["rent"][0])
|
||||
this.rent_max = Number(info["rent"][1])
|
||||
this.rent_min = info["rent"][0] ? Number(info["rent"][0]) : null
|
||||
this.rent_max = info["rent"][1] ? Number(info["rent"][1]) : null
|
||||
}
|
||||
|
||||
if (info["acreage"].length != 0) {
|
||||
this.acreage_min = Number(info["acreage"][0])
|
||||
this.acreage_max = Number(info["acreage"][1])
|
||||
this.acreage_min = info["acreage"][0] ? Number(info["acreage"][0]) : null
|
||||
this.acreage_max = info["acreage"][0] ? Number(info["acreage"][1]) : null
|
||||
}
|
||||
|
||||
if (info["rentalduration"]) info['rentalduration'] = Number(info['rentalduration'])
|
||||
|
@ -8,12 +8,14 @@
|
||||
<div class="list wid1200 flexflex" ref="gridContainer">
|
||||
<apartment-item v-if="list.length != 0" v-for="item in list" :item="item"></apartment-item>
|
||||
</div>
|
||||
|
||||
<div v-if="list.length == 0" class="empty-box wid1200 flexcenter">
|
||||
<empty-duck :hintTextTwo="'建议放宽筛选条件'"></empty-duck>
|
||||
</div>
|
||||
|
||||
<have-questions></have-questions>
|
||||
|
||||
<!-- 页尾 -->
|
||||
<page-footer></page-footer>
|
||||
|
||||
<!-- 右下角咨询 -->
|
||||
@ -24,7 +26,6 @@
|
||||
<script setup>
|
||||
import pageTopBar from '../../components/pageTopBar/pageTopBar.vue';
|
||||
import seachModule from "@/components/apartment/seachModule.vue";
|
||||
import biserialItem from '../../components/biserialListItem/biserialListItem.vue'
|
||||
import apartmentItem from '@/components/public/apartment-item.vue';
|
||||
import haveQuestions from '@/components/public/have-questions.vue'
|
||||
import pageFooter from '@/components/footer/footer.vue'
|
||||
@ -118,8 +119,6 @@ const handleTransfer = (data) => {
|
||||
getData()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -97,18 +97,18 @@
|
||||
|
||||
<script setup>
|
||||
import pageTopBar from '../components/pageTopBar/pageTopBar.vue';
|
||||
import headerNav from '@/components/public/head.vue'
|
||||
import systematicNotificationPop from '@/components/user/systematic-notification-pop.vue'
|
||||
import haveQuestions from '@/components/public/have-questions.vue'
|
||||
import pageFooter from '@/components/footer/footer.vue'
|
||||
import biserialListItem from '@/components/biserialListItem/biserialListItem.vue'
|
||||
import publicListItem from '@/components/public/public-list-item.vue'
|
||||
import emptyDuck from '@/components/public/empty-duck.vue'
|
||||
import { ref, reactive, onMounted, onUnmounted, getCurrentInstance, nextTick } from 'vue'
|
||||
const { proxy } = getCurrentInstance()
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
import { ElLoading, ElMessage } from 'element-plus'
|
||||
import Masonry from 'masonry-layout';
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
|
||||
const gridContainer = ref(null);
|
||||
@ -145,7 +145,7 @@ const identityObj = {
|
||||
}
|
||||
|
||||
const init = () => {
|
||||
proxy.$post("/tenement/v2/api/user").then(res => {
|
||||
proxy.$post("/tenement/pc/api/user").then(res => {
|
||||
if (res.code != 200) return
|
||||
let data = res.data
|
||||
|
||||
@ -164,6 +164,7 @@ const init = () => {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
let loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
@ -243,7 +244,7 @@ const cutTab = (value) => {
|
||||
|
||||
// 取消收藏
|
||||
let cancelCollection = data => {
|
||||
proxy.$post("/tenement/relation/operation", {
|
||||
proxy.$post("/tenement/pc/api/user/operation", {
|
||||
token: data['token']
|
||||
}).then(res => {
|
||||
if (res.code != 200) return
|
||||
@ -521,4 +522,5 @@ onUnmounted(() => {
|
||||
align-items: center;
|
||||
border-radius: 16px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
Loading…
x
Reference in New Issue
Block a user