|
@@ -47,6 +47,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import {mapState} from 'vuex'
|
|
|
import {
|
|
|
request
|
|
|
} from '../../common/request/request'
|
|
@@ -76,22 +77,27 @@
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- uni.showLoading({
|
|
|
- title: '加载中...'
|
|
|
- });
|
|
|
- axios.all([this.getBanners(), this.getTiceList()])
|
|
|
- .then(axios.spread((one, two) => {
|
|
|
- this.bannersList = one.data.data.map(t => t.imgPath)
|
|
|
- console.log(this.bannersList)
|
|
|
- this.noticebarList = two.data.data.map(t => t.msgContent)
|
|
|
- }))
|
|
|
- .catch(err => {
|
|
|
- console.log(err)
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- this.loading = false;
|
|
|
- uni.hideLoading();
|
|
|
+ if (this.hasLogin) {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中...'
|
|
|
+ });
|
|
|
+ axios.all([this.getBanners(), this.getTiceList()])
|
|
|
+ .then(axios.spread((one, two) => {
|
|
|
+ this.bannersList = one.data.data.map(t => t.imgPath)
|
|
|
+ console.log(this.bannersList)
|
|
|
+ this.noticebarList = two.data.data.map(t => t.msgContent)
|
|
|
+ }))
|
|
|
+ .catch(err => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.loading = false;
|
|
|
+ uni.hideLoading();
|
|
|
})
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['hasLogin'])
|
|
|
},
|
|
|
methods: {
|
|
|
//轮播图
|