Commit 0ca7451b authored by 赵啸非's avatar 赵啸非

修改配置文件

parent 966a179c
...@@ -8,20 +8,20 @@ ...@@ -8,20 +8,20 @@
<div class="header-item"> <div class="header-item">
<i style="color:#7c6aa6" class="contact-icon am-icon-phone"></i> <i style="color:#7c6aa6" class="contact-icon am-icon-phone"></i>
<div class="item"> <div class="item">
<strong>15284734573</strong> <strong>{{ companyInfo.name }}</strong>
<span>周一 ~ 周五, 8:30 - 17:30</span> <span>周一 ~ 周五, 8:30 - 17:30</span>
</div> </div>
</div> </div>
<div class="header-item"> <div class="header-item">
<i style="color:#7c6aa6" class="contact-icon am-icon-map-marker"></i> <i style="color:#7c6aa6" class="contact-icon am-icon-map-marker"></i>
<div class="item"> <div class="item">
<strong>四川省成都市高新区</strong> <strong>{{companyInfo.address}}</strong>
<span>四川XXXX有限公司</span> <span>{{companyInfo.name}}</span>
</div> </div>
</div> </div>
</div> </div>
<div class="header-right"> <div class="header-right">
<a href="tel:+18583266628" class=""> <a :href="'tel:'+companyInfo.phone" class="">
<button type="button" >联系我们</button> <button type="button" >联系我们</button>
</a> </a>
</div> </div>
...@@ -48,11 +48,27 @@ export default { ...@@ -48,11 +48,27 @@ export default {
components: {}, components: {},
data(){ data(){
return{ return{
companyInfo: {},
AppFunctions, AppFunctions,
} }
}, },
methods: { methods: {
getCompanyInfo() {
//获取公司信息,默认第一个
this.$post("/company/interlist", {})
.then((res) => {
if (res.code == 1) {
console.log(res)
if (res.data.data.length > 0) {
this.companyInfo = res.data.data[0]
}
}
})
.catch((error) => {
this.$message.error(error.message);
});
},
toggleStickyHeader() { toggleStickyHeader() {
const scrolled = document.documentElement.scrollTop; const scrolled = document.documentElement.scrollTop;
if (scrolled > 100) { if (scrolled > 100) {
...@@ -66,6 +82,7 @@ export default { ...@@ -66,6 +82,7 @@ export default {
window.addEventListener('scroll', this.toggleStickyHeader); window.addEventListener('scroll', this.toggleStickyHeader);
}, },
mounted() { mounted() {
this.getCompanyInfo()
this.toggleStickyHeader(); this.toggleStickyHeader();
}, },
beforeDestroy() { beforeDestroy() {
......
...@@ -19,6 +19,7 @@ Router.prototype.push = function push(location, onResolve, onReject) { ...@@ -19,6 +19,7 @@ Router.prototype.push = function push(location, onResolve, onReject) {
const router = new Router({ const router = new Router({
routes: [ routes: [
//不需要鉴权的页面 //不需要鉴权的页面
builder("/", "portal/IndexView"),
builder("/index", "portal/IndexView"), builder("/index", "portal/IndexView"),
builder("/product", "portal/ProductView"), builder("/product", "portal/ProductView"),
builder("/product/productId/:productId", "portal/ProductDetailsView"), builder("/product/productId/:productId", "portal/ProductDetailsView"),
......
...@@ -130,15 +130,15 @@ export default { ...@@ -130,15 +130,15 @@ export default {
let date = new Date(Number(time)); let date = new Date(Number(time));
let Y = date.getFullYear() + '-'; let Y = date.getFullYear() + '-';
let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
let D = panLeft(date.getDate()) + ' '; let D = this.panLeft(date.getDate()) + ' ';
let h = panLeft(date.getHours()) + ':'; let h = this.panLeft(date.getHours()) + ':';
let m = panLeft(date.getMinutes()) + ':'; let m = this.panLeft(date.getMinutes()) + ':';
let s = panLeft(date.getSeconds()); let s = this.panLeft(date.getSeconds());
return Y + M + D + h + m + s; return Y + M + D + h + m + s;
}, },
panLeft(num) { panLeft(num) {
return num < 10 ? '0' + num : num; return num < 10 ? '0' + num : num;
} }
} }
} }
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment