Commit 644c074c authored by guoyou's avatar guoyou

友情链接bug修复

parent 5d6a7ec3
This diff is collapsed.
......@@ -3,22 +3,21 @@
<div class="foot-content">
<div class="footer">
<div>
<p class="links-title">
<p class="links-title" v-if="linkShow">
<span>LINK</span>
<span>友情链接</span>
</p>
<!-- <ul class="link-list">
<li v-for="(item,index) in list" :key="index">
<a :href="item.linkUrl" :title="item.brief">{{ item.name }}</a>
</li>
</ul> -->
<vue-seamless-scroll :data="list" :class-option="optionLeft" class="seamless-warp2" style="width:864px;">
<ul class="item" style="overflow: hidden;">
<li v-for="(item,index) in list" :key="index">
<a target="_blank" style="color:#fff" :href="item.linkUrl" v-text="item.name"></a>
</li>
</ul>
</vue-seamless-scroll>
<div class="my-outbox">
<div class="my-inbox" ref="box">
<div class="my-list" v-for="(item,index) in list" :key="index">
<a class="my-uname" :href='item.linkUrl' @mouseenter="enter(index)" @mouseleave="leave()">{{item.name}}</a>
</div>
<div class="my-list" v-for="(item,index) in list" :key="(index+1)*100">
<a class="my-uname" :href='item.linkUrl' @mouseenter="enter(index)" @mouseleave="leave()">{{item.name}}</a>
</div>
</div>
</div>
</div>
</div>
</div>
......@@ -45,67 +44,74 @@
<script>
import axios from '../plugins/axios'
import Swiper from 'swiper'
import 'swiper/dist/css/swiper.min.css'
export default {
transition: 'bounce',
name: 'footerModal',
props: [],
data() {
return {
list: [],
listShow: false,
newsList: [
{
title: '11111111111'
},
{
title: '2222222'
}
]
start: true,
linkShow:true
}
},
computed: {
optionLeft() {
return {
direction: 2,
limitMoveNum: 6
created() {
axios.get('/api/uccn/app/unauth/friend_link/list').then(data => {
this.list = data.data.data
if (this.list.length < 5) this.start = false
if(this.list.length == 0) this.linkShow = false
})
},
mounted: function() {
var that = this
var target = this.$refs.box
var initLeft = 0
let demo = setInterval(function() {
if (that.start) {
initLeft++
if (initLeft >= target.offsetWidth / 2) {
initLeft = 0
}
target.style = 'transform: translateX(-' + initLeft + 'px)'
}
},
created() {
this.getAll()
}, 16)
},
methods: {
async getAll() {
let {
data: { data }
} = await axios.get('/api/uccn/app/unauth/friend_link/list')
if (data.length == 0) {
this.listShow = false
} else {
this.listShow = true
}
this.list = data
enter() {
this.start = false
},
leave() {
this.start = true
}
}
}
</script>
<style>
.seamless-warp2 {
overflow: hidden;
height: 25px;
width: 870px;
.my-outbox {
width: 800px;
display: inline-block;
margin-left:80px;
color: #fff;
overflow: hidden;
height: 35px;
position: relative;
left: 40px;
}
.seamless-warp2 ul.item {
/* width: 580px; */
.my-inbox {
white-space: nowrap;
position: absolute;
font-size: 0;
top: 4px;
}
.seamless-warp2 ul.item li {
float: left;
.my-list {
margin-right: 95px;
display: inline-block;
font-size: 16px;
height: 35px;
line-height: 35px;
}
.my-uname {
color: #ccc;
transition: all 0.2s linear;
}
.my-uname:hover {
color: #1bbb9f;
}
.footer {
display: block;
......@@ -130,26 +136,6 @@ export default {
top: -8px;
left: 4px;
}
.link-list {
margin-top: 15px;
display: inline-block;
position: relative;
top: -27px;
left: 80px;
}
.link-list li {
float: left;
width: 200px;
margin-right: 95px;
line-height: 25px;
}
.link-list li a {
font-size: 16px;
color: #cccccc;
}
.link-list li a:hover {
color: #1bbb9f;
}
.bottom-main {
width: 1120px;
margin: 0 auto;
......
......@@ -394,7 +394,7 @@ export default {
this.campsiteType = campsite.data.data
const child = await axios.get('/vehicle/cata/app/unauth/types')
this.vehicleType = child.data.data
console.log(this.childType)
// console.log(this.childType)
},
enter() {
var test = window.location.pathname
......
......@@ -8,19 +8,19 @@
<span>联系我们</span>
<div class="clearfix" style="margin-top:22px">
<div style="float:left;width:526px;margin-right:69px;">
<div
style="font-size:20px;font-weight:Bold;text-align:center;margin-bottom:30px"
>欣新房车全国分布图</div>
<div style="font-size:20px;font-weight:Bold;text-align:center;margin-bottom:30px">欣新房车全国分布图</div>
<viewer>
<img id="image" src="https://mgmt.dfangche.com/xxfccn/image/contact/map.jpg" alt style="width:526px;height:430px" />
<img
id="image"
src="https://mgmt.dfangche.com/xxfccn/image/contact/map.jpg"
alt
style="width:526px;height:430px"
/>
</viewer>
</div>
<div style="float:left;width:500px">
<div
style="font-size:20px;font-weight:Bold;text-align:center;margin-bottom:30px"
>欣新房车集团总部</div>
<div style="font-size:20px;font-weight:Bold;text-align:center;margin-bottom:30px">欣新房车集团总部</div>
<img
src="https://mgmt.dfangche.com/xxfccn/image/contact/xxfc.jpg"
alt
......@@ -45,33 +45,23 @@
<span>全国子公司</span>
</div>
<!-- 省份 -->
<div class="province-city" >
<div class="province-city">
<span style="margin-right:14px">省份</span>
<el-select v-model="province" placeholder="请选择省份" @change="provinceChanged">
<el-option :key="''" :label="'全部'" :value="''"></el-option>
<el-option
v-for="item in provinces"
:key="item.code+100"
:label="item.name"
:value="item.code"
></el-option>
<el-option v-for="item in provinces" :key="item.code" :label="item.name" :value="item.code"></el-option>
</el-select>
<span style="margin:0 14px 0 35px">城市</span>
<el-select
v-model="city"
:loading="loadingCity"
@change="cityChanged"
placeholder="请选择城市"
>
<el-select v-model="city" :loading="loadingCity" @change="cityChanged" placeholder="请选择城市">
<el-option :key="''" :label="'全部'" :value="''"></el-option>
<el-option
v-for="item in cities"
:key="item.code"
:label="item.name"
:value="item.code"
></el-option>
<el-option v-for="item in cities" :key="item.code" :label="item.name" :value="item.code"></el-option>
</el-select>
<el-button plain @click="chooseCity()" style="margin-left:35px;width:104px;height:38px" icon="el-icon-search">筛选</el-button>
<el-button
plain
@click="chooseCity()"
style="margin-left:35px;width:104px;height:38px"
icon="el-icon-search"
>筛选</el-button>
</div>
<!-- 公司 -->
<div style="margin-top: 31px;" v-if="this.visibility">该城市暂时没有分公司信息</div>
......@@ -116,15 +106,15 @@
// return image.src.replace('thumb_', '');
// },
// });
import axios from "../plugins/axios";
import menuModal from "../components/menu";
import footerModal from "../components/footer";
import vehicleBanner from "../components/vehicleBanner";
import GoTop from "../components/goTop";
import provinceCity from "../assets/code.json";
import axios from '../plugins/axios'
import menuModal from '../components/menu'
import footerModal from '../components/footer'
import vehicleBanner from '../components/vehicleBanner'
import GoTop from '../components/goTop'
import provinceCity from '../assets/code.json'
// import Viewer from 'viewerjs';
export default {
transition: "bounce",
transition: 'bounce',
components: {
GoTop,
menuModal,
......@@ -132,136 +122,148 @@ export default {
vehicleBanner
},
created() {
this.getAll();
this.provinces = provinceCity.provinces;
this.getAll()
this.provinces = provinceCity.provinces
},
mounted() {
this.province = this.provinceCode;
this.provinceChanged(this.provinceCode);
this.city = this.cityCode;
this.province = this.provinceCode
this.provinceChanged(this.provinceCode)
this.city = this.cityCode
},
data() {
return {
visibility:false,
visibility: false,
childDetail: [],
listQuery: {
addrCity: "",
addrProvince: "",
addrCity: '',
addrProvince: '',
page: 1,
limit: 10
},
totalCount: 0,
loadingCity: false,
province: "",
city: "",
province: '',
city: '',
provinces: [],
cities: []
};
}
},
methods: {
async getAll() {
let {
data: { data }
} = await axios.post("api/uccn/app/unauth/branch_company/page", {
} = await axios.post('api/uccn/app/unauth/branch_company/page', {
page: this.listQuery.page,
limit: this.listQuery.limit,
addrCity:this.listQuery.addrCity,
addrProvince:this.listQuery.addrProvince
});
addrCity: this.listQuery.addrCity,
addrProvince: this.listQuery.addrProvince
})
this.childDetail = data.data;
if(this.childDetail == undefined){
this.childDetail = data.data
if (this.childDetail == undefined) {
this.visibility = true
}else{
} else {
this.visibility = false
}
this.totalCount = data.totalCount;
console.log(this.childDetail);
this.listQuery.addrCity = "";
this.listQuery.addrProvince = ""
this.totalCount = data.totalCount
console.log(this.childDetail)
this.listQuery.addrCity = ''
this.listQuery.addrProvince = ''
},
handleCurrentChange(val) {
this.listQuery.page = val;
this.getAll();
console.log(this.listQuery)
this.listQuery.page = val
this.getAll()
},
handleSizeChange(val) {
this.listQuery.limit = val;
this.listQuery.page = 1;
this.getAll();
this.listQuery.limit = val
this.listQuery.page = 1
this.getAll()
},
provinceChanged(value) {
if (value !== "") {
this.loadingCity = true;
if (value !== '') {
this.loadingCity = true
for (var item of this.provinces) {
if (item.code === value) {
this.cities = item.cities;
this.city = "";
this.loadingCity = false;
break;
this.cities = item.cities
this.city = ''
this.loadingCity = false
break
} else {
continue;
continue
}
}
} else {
this.cities = [];
this.city = "";
this.cities = []
this.city = ''
}
this.$emit("selectChange", this.province, this.city);
this.$emit('selectChange', this.province, this.city)
},
cityChanged(value) {
this.$emit("selectChange", this.province, this.city);
this.$emit('selectChange', this.province, this.city)
},
chooseCity(){
if(this.city == undefined && this.province == undefined){ // 没选
console.log(1);
chooseCity() {
if (this.city == undefined && this.province == undefined) {
// 没选
console.log(1)
return
}if(this.city == "" && this.province == ""){ //全选
this.getAll();
console.log(2);
}if(this.city == "" && this.province != ""){ //选省没选市
this.listQuery.addrProvince = this.province+'00';
this.getAll();
console.log(3);
}if(this.city != "" && this.province != ""){ //选省选市
this.listQuery.addrProvince = this.province+'00';
this.listQuery.addrCity = this.city+'00';
this.getAll();
console.log(4);
}
if (this.city == '' && this.province == '') {
//全选
this.getAll()
console.log(2)
}
if (this.city == '' && this.province != '') {
//选省没选市
this.listQuery.addrProvince = this.province
this.getAll()
console.log(3)
}
if (this.city != '' && this.province != '') {
//选省选市
this.listQuery.addrProvince = this.province
this.listQuery.addrCity = this.city
this.getAll()
console.log(4)
}
}
},
head() {
return {
title: this.headList.title,
meta: [
{ hid: "keywords", name: "keywords", content: this.headList.keywords },
{
hid: "description",
name: "description",
hid: 'keywords',
name: 'keywords',
content: this.headList.keywords
},
{
hid: 'description',
name: 'description',
content: this.headList.description
}
]
};
}
},
async asyncData() {
const { data } = await axios.get(
"/api/app/banner/app/unauth/findBannerlist?type=1&platform=1"
);
let cc = data.data;
'/api/app/banner/app/unauth/findBannerlist?type=1&platform=1'
)
let cc = data.data
let headData = await axios.get(
"/api/uccn/seo/app/unauth/officialWebsite/3"
);
let head = headData.data.data;
return { bannerList: cc, headList: head };
'/api/uccn/seo/app/unauth/officialWebsite/3'
)
let head = headData.data.data
return { bannerList: cc, headList: head }
}
};
}
</script>
<style scoped>
.clearfix:after {
/*伪元素是行内元素 正常浏览器清除浮动方法*/
content: "";
content: '';
display: block;
height: 0;
clear: both;
......@@ -300,8 +302,8 @@ export default {
.v-ul li:nth-child(odd) {
margin-right: 40px;
}
.province-city{
.province-city {
text-align: center;
margin-top:40px
margin-top: 40px;
}
</style>
......@@ -587,7 +587,6 @@
</nuxt-link>
</div>
<div style="padding:15px">
<div style="overflow: hidden;display:inline-block" class="head-img">
<img src="./../assets/images/headquarters.png" alt />
<!-- <img :src="companyList[0].cover" alt style="width:336px;height:124px" /> -->
......@@ -700,7 +699,6 @@ export default {
preIndex: 0 //当前轮播选中图
}
},
mounted: function() {},
created() {
if (typeof window !== 'undefined') {
window.addEventListener('scroll', this.handleScroll)
......@@ -831,6 +829,7 @@ export default {
)
let tour = fourth.data.data
params.fourth = tour
return {
hotlist: params,
companyList: company,
......
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