Commit 388b3d25 by mamingqun

替换了公共banner

parent 2dfcffc2
import Vue from 'vue'
import Vuex from 'vuex'
import Axios from 'axios';
Vue.use(Vuex);
......@@ -11,7 +12,9 @@ export default new Vuex.Store({
huojiangBoxScroll:0,
userBoxScroll: 0,
activeInfo:'',
ruweiBoxScroll: 0
ruweiBoxScroll: 0,
publicActiveInfo: null,
publicShareInfo: null
},
mutations: {
changeLastBoxScrollY(state, num) {
......@@ -31,6 +34,24 @@ export default new Vuex.Store({
},
changeRuweiBoxScrollY(state,num){
state.ruweiBoxScroll = num;
},
getPublicActiveInfo(state,num){
axios.get('http://web-comment.canskj.cn/wandah5/activity/info').then((result) => {
console.log('公共数据');
console.log(result.data.data);
state.publicActiveInfo = result.data.data
}).catch((err) => {
console.log(err);
});
},
getPublicShareInfo(state,num){
axios.get('http://web-comment.canskj.cn/wandah5/share/info').then((result) => {
console.log('公共数据');
console.log(result.data.data);
state.publicShareInfo = result.data.data
}).catch((err) => {
console.log(err);
});
}
}
})
\ No newline at end of file
......@@ -38,7 +38,8 @@ export default {
}
},
created() {
// this.hiddenBar();
store.commit('getPublicActiveInfo');
store.commit('getPublicShareInfo');
},
mounted() {
// var tar_userinfo = localStorage.getItem('tar_userinfo');
......
......@@ -2,6 +2,7 @@
<div id="app1">
<div class="topBox5686">
<div class="activityButton" @click="activityOnoff"></div>
<img v-if="bannerImg" :src="bannerImg" alt="">
</div>
<div class="middlebox">
<div class="tabBoxWrap">
......@@ -197,6 +198,13 @@ export default {
return arr;
}
},
bannerImg() {
if (store.state.publicActiveInfo) {
return store.state.publicActiveInfo.banner
}else{
return null
}
}
},
created() {
......@@ -218,6 +226,12 @@ export default {
this.getRuweiList();
// this.hiddenBar();
setTimeout(() => {
console.log('store的数据');
console.log(store.state.publicActiveInfo);
}, 500);
},
mounted() {
// MessageBox('提示', '“眼遇丹寨万人长桌宴摄影大赛”已经截止,谢谢大家关注');
......@@ -872,9 +886,15 @@ export default {
.topBox5686 {
// height: 400px;
height: 310px;
background: url("~@/pages/index/assets/images/indexBanner.jpg") no-repeat;
// background: url("~@/pages/index/assets/images/indexBanner.jpg") no-repeat;
background-size: 100% auto;
position: relative;
overflow: hidden;
img {
width: 100%;
height: auto;
}
.activityButton {
width: 170px;
......
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 sign in to comment