修改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",
|
||||
"sass-loader": "^8.0.0",
|
||||
"vue": "^3.2.13",
|
||||
"vue-meta": "^3.0.0-alpha.2",
|
||||
"vue-router": "^4.0.3",
|
||||
"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>
|
||||
import { useRouter } from 'vue-router'
|
||||
const router = useRouter()
|
||||
|
||||
// router.push(`/edit-choosing`)
|
||||
|
||||
</script>
|
||||
<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-head flexcenter">状态</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 class="housing-info-item flexacenter" v-if="status > 0">
|
||||
<div class="housing-info-head flexcenter">发布</div>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<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="">
|
||||
</div>
|
||||
<div class="btn-s other-bg mg-t-15">
|
||||
|
@ -1,11 +1,15 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
import HomeView from '../views/HomeView.vue'
|
||||
import { setSeoTitle } from '@/utils/util.js'
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: '/',
|
||||
name: 'home',
|
||||
component: HomeView
|
||||
component: HomeView,
|
||||
meta: {
|
||||
title: "首页"
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/about',
|
||||
@ -13,27 +17,44 @@ const routes = [
|
||||
component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
|
||||
}, {
|
||||
path: '/choosing-identity',
|
||||
name: 'edit-choosing',
|
||||
component: () => import(/* webpackChunkName: "edit-choosing" */ '@/views/edit-choosing.vue')
|
||||
name: 'choosing-identity',
|
||||
component: () => import(/* webpackChunkName: "choosing-identity" */ '@/views/choosing-identity.vue'),
|
||||
meta: {
|
||||
title: "选择发布者身份"
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/edit',
|
||||
name: 'edit',
|
||||
component: () => import(/* webpackChunkName: "edit" */ '@/views/edit.vue')
|
||||
component: () => import(/* webpackChunkName: "edit" */ '@/views/edit.vue'),
|
||||
},
|
||||
{
|
||||
path: '/user',
|
||||
name: 'user',
|
||||
component: () => import(/* webpackChunkName: "user" */ '@/views/user.vue')
|
||||
component: () => import(/* webpackChunkName: "user" */ '@/views/user.vue'),
|
||||
meta: {
|
||||
title: "我的"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(process.env.BASE_URL),
|
||||
// history: createWebHistory("/"),
|
||||
mode: "history",
|
||||
// base: process.env.BASE_URL,
|
||||
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
|
||||
|
@ -1,6 +1,7 @@
|
||||
import axios from 'axios';
|
||||
import QS from 'qs';
|
||||
import router from '../router/index'
|
||||
import { redirectToExternalWebsite } from '@/utils/util.js'
|
||||
//qs.stringify()是将对象 序列化成URL的形式,以&进行拼接
|
||||
// let protocol = window.location.protocol; //协议
|
||||
// let host = window.location.host; //主机
|
||||
@ -44,6 +45,7 @@ axios.interceptors.response.use(
|
||||
// 跳转登录页面
|
||||
case 403:
|
||||
// router.push('/login')
|
||||
redirectToExternalWebsite()
|
||||
break
|
||||
// 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>
|
||||
<!-- 提交失败 -->
|
||||
<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>
|
||||
<!-- 页面底部 -->
|
||||
@ -669,9 +669,27 @@ import how from '@/components/edit/how-pop.vue'
|
||||
import failPop from '@/components/edit/fail-pop.vue'
|
||||
import headerNav from '@/components/public/head.vue'
|
||||
import userBox from '@/components/edit/user-box.vue'
|
||||
import { setSeoTitle } from '@/utils/util.js'
|
||||
|
||||
export default {
|
||||
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() {
|
||||
return {
|
||||
value: '',
|
||||
@ -771,17 +789,19 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 判断 求房源的 同住人性别要求应不应该显示
|
||||
judgeGenderCohabitantsShow() {
|
||||
return function (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
|
||||
}
|
||||
// // 判断 求房源的 同住人性别要求应不应该显示
|
||||
// judgeGenderCohabitantsShow() {
|
||||
// /
|
||||
// / return function (field) {
|
||||
// console.log("info", this, this.info);
|
||||
// // 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
|
||||
// }
|
||||
// },
|
||||
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
// 访问URL中的查询参数
|
||||
@ -790,7 +810,7 @@ export default {
|
||||
this.uniqid = urlParams.get('uniqid');
|
||||
this.token = urlParams.get('token');
|
||||
this.intermediary = urlParams.get('intermediary') || 3; // 默认写房东吧
|
||||
this.verified = urlParams.get('verified') || 0;
|
||||
// this.verified = urlParams.get('verified') || 0;
|
||||
|
||||
this.init();
|
||||
},
|
||||
@ -804,7 +824,6 @@ export default {
|
||||
userBox,
|
||||
},
|
||||
methods: {
|
||||
|
||||
updateMap(evtModel) {
|
||||
console.log("evtModel", evtModel);
|
||||
},
|
||||
@ -912,7 +931,6 @@ export default {
|
||||
this.locationData = locationData
|
||||
this.fieldinfoBasic = fieldinfo.basic
|
||||
this.fieldinfoAddress = fieldinfo.address
|
||||
this.fieldinfoIdentity = fieldinfo.identity
|
||||
this.fieldinfoIntroduce = fieldinfo.introduce
|
||||
this.fieldinfoUpload = fieldinfo.upload
|
||||
this.fieldinfoContact = fieldinfo.contact
|
||||
@ -928,6 +946,8 @@ export default {
|
||||
})
|
||||
|
||||
this.info = info
|
||||
this.verified = data.verified
|
||||
this.fieldinfoIdentity = fieldinfo.identity
|
||||
this.intermediary = intermediary
|
||||
this.status = data.status
|
||||
this.token = data.token
|
||||
@ -940,6 +960,16 @@ export default {
|
||||
this.offshelftime = data.offshelftime
|
||||
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(() => {
|
||||
this.loading.close()
|
||||
})
|
||||
@ -1183,21 +1213,20 @@ export default {
|
||||
info,
|
||||
status,
|
||||
}).then(res => {
|
||||
let data = res.data || []
|
||||
if (res.code != 200) {
|
||||
let data = res.data || []
|
||||
let rule = data['rule'] || 0
|
||||
this.$message.error(res.message);
|
||||
if (rule == 3) {
|
||||
this.failPopState = true
|
||||
return
|
||||
}
|
||||
this.$message.error(res.message);
|
||||
|
||||
this.handleSubmitFailure(data)
|
||||
|
||||
return
|
||||
} else {
|
||||
if (status == 0) return
|
||||
let data = res.data
|
||||
this.qrcodeBase64 = data['qrcode']
|
||||
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