This commit is contained in:
A1300399510 2023-07-20 19:27:46 +08:00
parent 8cc4549dca
commit d5c86e2038
12 changed files with 274 additions and 41 deletions

View File

@ -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">
* {

View File

@ -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>

View File

@ -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;

View 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) {
// scriptJavaScript
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>

View File

@ -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

View File

@ -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']

View File

@ -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: {

View File

@ -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)
})
});
}

View File

@ -1,7 +1,9 @@
<template>
<page-top-bar></page-top-bar>
asgdaskhjdkhsk jkhkhkjhkjhjhjjjjjhjkhh
<div class="content"></div>
</template>
<script setup>

View File

@ -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'])

View File

@ -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>

View File

@ -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>