|
|
|
@ -2,7 +2,9 @@
|
|
|
|
|
<view class="course-detail-index"> |
|
|
|
|
<view v-if="$store.getters.token || userInfo.uid"> |
|
|
|
|
<view class="swiper-box"> |
|
|
|
|
<view class="swiper-item"><image :src="item" mode="aspectFill" v-for="(item,index) in detail.imageArr"></image></view> |
|
|
|
|
<view class="swiper-item"> |
|
|
|
|
<image :src="item" mode="aspectFill" v-for="(item,index) in detail.imageArr" :key="index"></image> |
|
|
|
|
</view> |
|
|
|
|
<!-- <swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000"> |
|
|
|
|
<swiper-item v-for="(item,index) in detail.imageArr" :key="index"> |
|
|
|
|
<view class="swiper-item"><image :src="item" mode="aspectFill"></image></view> |
|
|
|
@ -186,6 +188,7 @@
|
|
|
|
|
<script> |
|
|
|
|
// import WucTab from '@/components/wuc-tab/wuc-tab.vue'; |
|
|
|
|
import { mapState, mapGetters, mapMutations, mapActions } from 'vuex' |
|
|
|
|
import dayjs from 'dayjs' |
|
|
|
|
import { getUserInfo, bindingPhone, wxappBindingPhone } from '@/api/user' |
|
|
|
|
import { getCourseDetail ,enterCourse } from '@/api/knowledge'; |
|
|
|
|
import Authorization from '@/pages/authorization/index' |
|
|
|
@ -226,12 +229,16 @@
|
|
|
|
|
} else{ |
|
|
|
|
this.courseId = this.$yroute.query.id; |
|
|
|
|
} |
|
|
|
|
if(this.userInfo.uid){ |
|
|
|
|
this.getDetail() |
|
|
|
|
this.$nextTick(()=>{ |
|
|
|
|
this.getHeightArr() |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
this.getDetail() |
|
|
|
|
this.$nextTick(()=>{ |
|
|
|
|
this.getHeightArr() |
|
|
|
|
}) |
|
|
|
|
// if(this.userInfo.uid){ |
|
|
|
|
// this.getDetail() |
|
|
|
|
// this.$nextTick(()=>{ |
|
|
|
|
// this.getHeightArr() |
|
|
|
|
// }) |
|
|
|
|
// } |
|
|
|
|
}, |
|
|
|
|
computed:{ |
|
|
|
|
userInfo(){ |
|
|
|
@ -260,7 +267,8 @@
|
|
|
|
|
}) |
|
|
|
|
.then(res => { |
|
|
|
|
if(res.success){ |
|
|
|
|
thit.$store.dispatch('userInfo', true) |
|
|
|
|
thit.$store.commit('login', res.data.token, dayjs(res.data.expires_time)) |
|
|
|
|
thit.$store.dispatch('userInfo', true) |
|
|
|
|
uni.hideLoading() |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: res.msg, |
|
|
|
|