修改title和ico
This commit is contained in:
parent
093c8e3383
commit
fdec30ad9c
515
package-lock.json
generated
515
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -12,6 +12,7 @@
|
|||||||
"element-plus": "^2.3.7",
|
"element-plus": "^2.3.7",
|
||||||
"sass-loader": "^8.0.0",
|
"sass-loader": "^8.0.0",
|
||||||
"vue": "^3.2.13",
|
"vue": "^3.2.13",
|
||||||
|
"vue-meta": "^3.0.0-alpha.2",
|
||||||
"vue-router": "^4.0.3",
|
"vue-router": "^4.0.3",
|
||||||
"vuex": "^4.0.0"
|
"vuex": "^4.0.0"
|
||||||
},
|
},
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 2.2 KiB |
@ -4,9 +4,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
// router.push(`/edit-choosing`)
|
// router.push(`/edit-choosing`)
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
* {
|
* {
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 6.7 KiB |
@ -21,7 +21,7 @@
|
|||||||
<div class="housing-info-item flexacenter">
|
<div class="housing-info-item flexacenter">
|
||||||
<div class="housing-info-head flexcenter">状态</div>
|
<div class="housing-info-head flexcenter">状态</div>
|
||||||
<div class="longString"></div>
|
<div class="longString"></div>
|
||||||
<div class="housing-info-trail">{{ stateObj[status] }}</div>
|
<div class="housing-info-trail">{{ stateObj[status < 0 ? -1 : status] }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="housing-info-item flexacenter" v-if="status > 0">
|
<div class="housing-info-item flexacenter" v-if="status > 0">
|
||||||
<div class="housing-info-head flexcenter">发布</div>
|
<div class="housing-info-head flexcenter">发布</div>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="regular-box">
|
<div class="regular-box">
|
||||||
<div class="btn-s first-bg">
|
<div class="btn-s first-bg" @click="">
|
||||||
<img src="../../assets/homeImage/indexRegularFirst.png" class="first" alt="">
|
<img src="../../assets/homeImage/indexRegularFirst.png" class="first" alt="">
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-s other-bg mg-t-15">
|
<div class="btn-s other-bg mg-t-15">
|
||||||
|
@ -1,11 +1,15 @@
|
|||||||
import { createRouter, createWebHistory } from 'vue-router'
|
import { createRouter, createWebHistory } from 'vue-router'
|
||||||
import HomeView from '../views/HomeView.vue'
|
import HomeView from '../views/HomeView.vue'
|
||||||
|
import { setSeoTitle } from '@/utils/util.js'
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
{
|
{
|
||||||
path: '/',
|
path: '/',
|
||||||
name: 'home',
|
name: 'home',
|
||||||
component: HomeView
|
component: HomeView,
|
||||||
|
meta: {
|
||||||
|
title: "首页"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/about',
|
path: '/about',
|
||||||
@ -13,27 +17,44 @@ const routes = [
|
|||||||
component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
|
component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
|
||||||
}, {
|
}, {
|
||||||
path: '/choosing-identity',
|
path: '/choosing-identity',
|
||||||
name: 'edit-choosing',
|
name: 'choosing-identity',
|
||||||
component: () => import(/* webpackChunkName: "edit-choosing" */ '@/views/edit-choosing.vue')
|
component: () => import(/* webpackChunkName: "choosing-identity" */ '@/views/choosing-identity.vue'),
|
||||||
|
meta: {
|
||||||
|
title: "选择发布者身份"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/edit',
|
path: '/edit',
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
component: () => import(/* webpackChunkName: "edit" */ '@/views/edit.vue')
|
component: () => import(/* webpackChunkName: "edit" */ '@/views/edit.vue'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/user',
|
path: '/user',
|
||||||
name: 'user',
|
name: 'user',
|
||||||
component: () => import(/* webpackChunkName: "user" */ '@/views/user.vue')
|
component: () => import(/* webpackChunkName: "user" */ '@/views/user.vue'),
|
||||||
|
meta: {
|
||||||
|
title: "我的"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(process.env.BASE_URL),
|
history: createWebHistory(process.env.BASE_URL),
|
||||||
// history: createWebHistory("/"),
|
|
||||||
mode: "history",
|
mode: "history",
|
||||||
// base: process.env.BASE_URL,
|
|
||||||
routes
|
routes
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
router.beforeEach((to, from, next) => {
|
||||||
|
console.log(to);
|
||||||
|
next()
|
||||||
|
|
||||||
|
let meta = to['meta'] || {}
|
||||||
|
let title = meta['title']
|
||||||
|
console.log("title", title);
|
||||||
|
if (title) setSeoTitle(title)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
export default router
|
export default router
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import QS from 'qs';
|
import QS from 'qs';
|
||||||
import router from '../router/index'
|
import router from '../router/index'
|
||||||
|
import { redirectToExternalWebsite } from '@/utils/util.js'
|
||||||
//qs.stringify()是将对象 序列化成URL的形式,以&进行拼接
|
//qs.stringify()是将对象 序列化成URL的形式,以&进行拼接
|
||||||
// let protocol = window.location.protocol; //协议
|
// let protocol = window.location.protocol; //协议
|
||||||
// let host = window.location.host; //主机
|
// let host = window.location.host; //主机
|
||||||
@ -44,6 +45,7 @@ axios.interceptors.response.use(
|
|||||||
// 跳转登录页面
|
// 跳转登录页面
|
||||||
case 403:
|
case 403:
|
||||||
// router.push('/login')
|
// router.push('/login')
|
||||||
|
redirectToExternalWebsite()
|
||||||
break
|
break
|
||||||
// 404请求不存在
|
// 404请求不存在
|
||||||
case 404:
|
case 404:
|
||||||
|
15
src/utils/util.js
Normal file
15
src/utils/util.js
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
function setSeoTitle(title) {
|
||||||
|
document.title = '港校租房-' + title
|
||||||
|
}
|
||||||
|
|
||||||
|
function redirectToExternalWebsite(url) {
|
||||||
|
const link = document.createElement('a');
|
||||||
|
link.href = url;
|
||||||
|
link.target = '_blank';
|
||||||
|
link.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
setSeoTitle,
|
||||||
|
redirectToExternalWebsite,
|
||||||
|
}
|
@ -653,7 +653,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 提交失败 -->
|
<!-- 提交失败 -->
|
||||||
<fail-pop :close="failPopState = false"></fail-pop>
|
<fail-pop @close="failPopState = false" :failPopState="failPopState"></fail-pop>
|
||||||
<!-- 了解更多弹窗 -->
|
<!-- 了解更多弹窗 -->
|
||||||
<about-pop :popState="aboutPopState" :intermediary="intermediary" @close="handleAboutPopState"></about-pop>
|
<about-pop :popState="aboutPopState" :intermediary="intermediary" @close="handleAboutPopState"></about-pop>
|
||||||
<!-- 页面底部 -->
|
<!-- 页面底部 -->
|
||||||
@ -669,9 +669,27 @@ import how from '@/components/edit/how-pop.vue'
|
|||||||
import failPop from '@/components/edit/fail-pop.vue'
|
import failPop from '@/components/edit/fail-pop.vue'
|
||||||
import headerNav from '@/components/public/head.vue'
|
import headerNav from '@/components/public/head.vue'
|
||||||
import userBox from '@/components/edit/user-box.vue'
|
import userBox from '@/components/edit/user-box.vue'
|
||||||
|
import { setSeoTitle } from '@/utils/util.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ZufangEdit',
|
name: 'ZufangEdit',
|
||||||
|
metaInfo() {
|
||||||
|
return {
|
||||||
|
title: 'My Page Title',
|
||||||
|
meta: [
|
||||||
|
{
|
||||||
|
name: 'description',
|
||||||
|
content: 'This is a description of my page'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
link: [
|
||||||
|
{
|
||||||
|
rel: 'canonical',
|
||||||
|
href: 'https://example.com/my-page'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
value: '',
|
value: '',
|
||||||
@ -771,17 +789,19 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 判断 求房源的 同住人性别要求应不应该显示
|
// // 判断 求房源的 同住人性别要求应不应该显示
|
||||||
judgeGenderCohabitantsShow() {
|
// judgeGenderCohabitantsShow() {
|
||||||
return function (field) {
|
// /
|
||||||
let type = this.info['type']
|
// / return function (field) {
|
||||||
let intermediary = this.intermediary
|
// console.log("info", this, this.info);
|
||||||
if (intermediary != 6 || field != 'gender') return true
|
// // let type = this.info['type']
|
||||||
if (type >>> 0 == 1 && field == 'gender') return true
|
// // let intermediary = this.intermediary
|
||||||
return false
|
// // if (intermediary != 6 || field != 'gender') return true
|
||||||
}
|
// // if (type >>> 0 == 1 && field == 'gender') return true
|
||||||
|
// return false
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// 访问URL中的查询参数
|
// 访问URL中的查询参数
|
||||||
@ -790,7 +810,7 @@ export default {
|
|||||||
this.uniqid = urlParams.get('uniqid');
|
this.uniqid = urlParams.get('uniqid');
|
||||||
this.token = urlParams.get('token');
|
this.token = urlParams.get('token');
|
||||||
this.intermediary = urlParams.get('intermediary') || 3; // 默认写房东吧
|
this.intermediary = urlParams.get('intermediary') || 3; // 默认写房东吧
|
||||||
this.verified = urlParams.get('verified') || 0;
|
// this.verified = urlParams.get('verified') || 0;
|
||||||
|
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
@ -804,7 +824,6 @@ export default {
|
|||||||
userBox,
|
userBox,
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
updateMap(evtModel) {
|
updateMap(evtModel) {
|
||||||
console.log("evtModel", evtModel);
|
console.log("evtModel", evtModel);
|
||||||
},
|
},
|
||||||
@ -912,7 +931,6 @@ export default {
|
|||||||
this.locationData = locationData
|
this.locationData = locationData
|
||||||
this.fieldinfoBasic = fieldinfo.basic
|
this.fieldinfoBasic = fieldinfo.basic
|
||||||
this.fieldinfoAddress = fieldinfo.address
|
this.fieldinfoAddress = fieldinfo.address
|
||||||
this.fieldinfoIdentity = fieldinfo.identity
|
|
||||||
this.fieldinfoIntroduce = fieldinfo.introduce
|
this.fieldinfoIntroduce = fieldinfo.introduce
|
||||||
this.fieldinfoUpload = fieldinfo.upload
|
this.fieldinfoUpload = fieldinfo.upload
|
||||||
this.fieldinfoContact = fieldinfo.contact
|
this.fieldinfoContact = fieldinfo.contact
|
||||||
@ -928,6 +946,8 @@ export default {
|
|||||||
})
|
})
|
||||||
|
|
||||||
this.info = info
|
this.info = info
|
||||||
|
this.verified = data.verified
|
||||||
|
this.fieldinfoIdentity = fieldinfo.identity
|
||||||
this.intermediary = intermediary
|
this.intermediary = intermediary
|
||||||
this.status = data.status
|
this.status = data.status
|
||||||
this.token = data.token
|
this.token = data.token
|
||||||
@ -940,6 +960,16 @@ export default {
|
|||||||
this.offshelftime = data.offshelftime
|
this.offshelftime = data.offshelftime
|
||||||
this.updatetime = data.updatetime
|
this.updatetime = data.updatetime
|
||||||
|
|
||||||
|
|
||||||
|
let title = ""
|
||||||
|
if (data['type'] == 'edit') title += '编辑'
|
||||||
|
else title += '发布'
|
||||||
|
if (intermediary == 6) title += '求房源'
|
||||||
|
else if (intermediary == 1) title += '中介房源'
|
||||||
|
else title += '个人房源'
|
||||||
|
setSeoTitle(title)
|
||||||
|
|
||||||
|
console.log();
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.loading.close()
|
this.loading.close()
|
||||||
})
|
})
|
||||||
@ -1183,21 +1213,20 @@ export default {
|
|||||||
info,
|
info,
|
||||||
status,
|
status,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
let data = res.data || []
|
||||||
if (res.code != 200) {
|
if (res.code != 200) {
|
||||||
let data = res.data || []
|
|
||||||
let rule = data['rule'] || 0
|
let rule = data['rule'] || 0
|
||||||
|
this.$message.error(res.message);
|
||||||
if (rule == 3) {
|
if (rule == 3) {
|
||||||
this.failPopState = true
|
this.failPopState = true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.$message.error(res.message);
|
|
||||||
|
|
||||||
this.handleSubmitFailure(data)
|
this.handleSubmitFailure(data)
|
||||||
|
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
if (status == 0) return
|
if (status == 0) return
|
||||||
let data = res.data
|
|
||||||
this.qrcodeBase64 = data['qrcode']
|
this.qrcodeBase64 = data['qrcode']
|
||||||
this.skipUrl = data['url']
|
this.skipUrl = data['url']
|
||||||
|
|
||||||
@ -1365,6 +1394,16 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 判断 求房源的 同住人性别要求应不应该显示
|
||||||
|
judgeGenderCohabitantsShow(field) {
|
||||||
|
let type = this.info['type']
|
||||||
|
let intermediary = this.intermediary
|
||||||
|
if (intermediary != 6 || field != 'gender') return true
|
||||||
|
if (type >>> 0 == 1 && field == 'gender') return true
|
||||||
|
return false
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user