修改首页底部、合作伙伴轮播
This commit is contained in:
@ -446,7 +446,7 @@
|
||||
>
|
||||
<ul class="ul-item">
|
||||
<li class="li-item" v-for="(item, index) in listData" :key="index">
|
||||
<img :src="item" alt="" />
|
||||
<img :src="item.img" alt="" />
|
||||
</li>
|
||||
</ul>
|
||||
</vue-seamless-scroll>
|
||||
@ -457,7 +457,7 @@
|
||||
>
|
||||
<ul class="ul-item">
|
||||
<li class="li-item" v-for="(item, index) in listData2" :key="index">
|
||||
<img :src="item" alt="" />
|
||||
<img :src="item.img" alt="" />
|
||||
</li>
|
||||
</ul>
|
||||
</vue-seamless-scroll>
|
||||
@ -471,33 +471,18 @@ import {
|
||||
getPolicy,
|
||||
getPolicyRead,
|
||||
getInformation,
|
||||
getAboutUs
|
||||
getAboutUs,
|
||||
getPartner
|
||||
} from '@/api/home/home';
|
||||
import vueSeamlessScroll from 'vue-seamless-scroll';
|
||||
import img1 from '@/assets/cooperation/1.png';
|
||||
import img2 from '@/assets/cooperation/2.png';
|
||||
import img3 from '@/assets/cooperation/3.png';
|
||||
import img4 from '@/assets/cooperation/4.png';
|
||||
import img5 from '@/assets/cooperation/5.png';
|
||||
import img6 from '@/assets/cooperation/6.png';
|
||||
import img7 from '@/assets/cooperation/7.png';
|
||||
import img8 from '@/assets/cooperation/8.png';
|
||||
import img9 from '@/assets/cooperation/9.png';
|
||||
import img10 from '@/assets/cooperation/10.png';
|
||||
import img11 from '@/assets/cooperation/11.png';
|
||||
import img12 from '@/assets/cooperation/12.png';
|
||||
import img13 from '@/assets/cooperation/13.png';
|
||||
import img14 from '@/assets/cooperation/14.png';
|
||||
import img15 from '@/assets/cooperation/15.png';
|
||||
import img16 from '@/assets/cooperation/16.png';
|
||||
export default {
|
||||
components: {
|
||||
vueSeamlessScroll
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
listData: [img1, img3, img5, img7, img9, img11, img13, img15, img1],
|
||||
listData2: [img2, img4, img6, img8, img10, img12, img14, img16, img1],
|
||||
listData: [],
|
||||
listData2: [],
|
||||
classOption: {
|
||||
step: 1,
|
||||
limitMoveNum: 8,
|
||||
@ -566,6 +551,22 @@ export default {
|
||||
getAboutUs().then(res => {
|
||||
this.aboutInfo = res.data;
|
||||
});
|
||||
getPartner().then(({ data }) => {
|
||||
data = data.filter(item => {
|
||||
return item.status == 1;
|
||||
});
|
||||
if (data.length < 16)
|
||||
return this.msgError('请至后台添加并且显示至少16个合作伙伴');
|
||||
if (data.length % 2 != 0) {
|
||||
data.pop();
|
||||
}
|
||||
const middleIndex = Math.ceil(data.length / 2);
|
||||
this.listData = data.slice().splice(0, middleIndex);
|
||||
this.listData2 = data.slice().splice(-middleIndex);
|
||||
console.log(this.listData);
|
||||
console.log(this.listData2);
|
||||
console.log(data);
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user