Authored by baoss

公告滚动及数据接入

... ... @@ -20,11 +20,7 @@ export default {
},
data() {
return {
// lists:[
// {name:'公告1'},
// {name:'公告2'}
// ],
};
},
computed: {
... ... @@ -34,15 +30,16 @@ export default {
})
},
mounted() {
this.fetchRollBoardList()
},
created(){
if(this.lists.length > 1) {
this.fetchRollBoardList().then((data) => {
if(data.length > 1) {
setInterval(this.showMarquee, 3000)
}
},
}
})
},
methods: {
...mapActions(['fetchRollBoardList',' showMarquee']),
...mapActions(['fetchRollBoardList','showMarquee']),
}
}
</script>
... ... @@ -60,6 +57,7 @@ export default {
position: absolute;
top: 0;
left: 0;
right: 0;
}
.marquee_top {
... ... @@ -69,9 +67,13 @@ export default {
.marquee_list li {
height: 90px;
width: 100%;
line-height: 90px;
font-size: 24px;
color: #D0021B;
padding-left: 20px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
</style>
... ...
... ... @@ -25,13 +25,13 @@ export default function() {
if (result.code === 200) {
commit('addList', { list: result.data });
}
return result.data || [];
},
showMarquee({ commit }) {
console.log('fff');
async showMarquee({ commit }) {
commit('startAnimate');
setTimeout(() => {
commit('animateHandler');
}, 800);
}, 500);
},
},
};
... ...
... ... @@ -6,7 +6,6 @@ import storeOrder,{ buyerOderList } from './order';
import storeList from './list';
import storeProduct from './product';
import storeHome from './home';
import storeNotice from '/No'
Vue.use(Vuex);
... ... @@ -20,8 +19,7 @@ export function createStore(context) {
produt: storeProduct(),
home: storeHome(),
// 买家订单列表
buyerOderList: buyerOderList(),
notice: storeNotice()
buyerOderList: buyerOderList()
},
strict: process.env.NODE_ENV !== 'production',
... ...