|
@@ -3,7 +3,8 @@
|
|
|
<view v-if="!loginShow" class="container" :style="{ height : `${loginShow ? '100vh' : 'auto' }`,
|
|
|
overflow: `${loginShow ? 'hidden' : 'auto' }` }">
|
|
|
<view class="container-poster" style="width: 100%;padding: 0 20rpx;">
|
|
|
- <image show-menu-by-longpress :src="courseDetail.poster?courseDetail.poster:''" mode="widthFix"
|
|
|
+ <channel-live v-if="feedShow" :feed-id="feedId" :finder-user-name="finderId"></channel-live>
|
|
|
+ <image v-else show-menu-by-longpress :src="courseDetail.poster?courseDetail.poster:''" mode="widthFix"
|
|
|
style="width: 100%;"></image>
|
|
|
</view>
|
|
|
<view class="course-tab-list">
|
|
@@ -12,8 +13,13 @@
|
|
|
{{ data }}
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="content" v-if="currentTab === 0">
|
|
|
- <view class="content-text">
|
|
|
+ <view class="content" v-if="currentTab === 0" style="overflow: hidden;">
|
|
|
+ <view class="content-text"
|
|
|
+ :style="{
|
|
|
+ marginBottom: `${videoShow?'140rpx':'0'}`,
|
|
|
+ paddingBottom: `${videoShow?'150rpx':'0'}`
|
|
|
+ }"
|
|
|
+ style="height: 100%;overflow: scroll;padding-left: 20rpx;padding-right: 20rpx;">
|
|
|
<view class="text-title">{{courseDetail.courseName}}</view>
|
|
|
<view class="text-title">课程概述</view>
|
|
|
<view class="text-content">{{courseDetail.summary}}</view>
|
|
@@ -22,6 +28,10 @@
|
|
|
<view class="text-title">培训地点</view>
|
|
|
<view class="text-content">{{courseDetail.loc}}</view>
|
|
|
<view class="text-tip" v-if="!isMember">个人会员或单位会员免费,点击现在入会></view>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ <view class="section-bottom" @click="toVideo" v-show="videoShow">
|
|
|
+ <text>预约课程</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="content" v-if="currentTab === 1" style="overflow: hidden;">
|
|
@@ -78,7 +88,7 @@
|
|
|
} from '@/store/authStore'
|
|
|
const authStore = useAuthStore();
|
|
|
// const isMember = ref(false)
|
|
|
-
|
|
|
+ const feedShow = ref(false)
|
|
|
import {
|
|
|
ref,
|
|
|
computed
|
|
@@ -96,6 +106,8 @@
|
|
|
const items = ref(['课程简介', '观看评论']);
|
|
|
const currentTab = ref(0);
|
|
|
const comment = ref("");
|
|
|
+ const feedId = ref(null);
|
|
|
+ const finderId = "sphIfs9sYiL5RB3"
|
|
|
// 评论发送按钮样式
|
|
|
const customStyle = ref({
|
|
|
backgroundColor: '#e6e6e6',
|
|
@@ -132,6 +144,10 @@
|
|
|
if (res?.data) {
|
|
|
courseDetail.value = res.data;
|
|
|
showBuy.value = showBuyAction()
|
|
|
+ if(courseDetail.value.loc === '微信视频号' && new Date(formatDateS(courseDetail.value.courseDate)) < new Date()){
|
|
|
+ // console.log(123456)
|
|
|
+ getVideo()
|
|
|
+ }
|
|
|
// console.log(courseDetail, "课程详情")
|
|
|
}
|
|
|
})
|
|
@@ -310,6 +326,7 @@
|
|
|
} else {
|
|
|
loginShow.value = true
|
|
|
}
|
|
|
+ // toVideo()
|
|
|
// loginShow.value = true
|
|
|
})
|
|
|
onShow(() => {
|
|
@@ -366,6 +383,72 @@
|
|
|
imageUrl: courseDetail.value.cover
|
|
|
};
|
|
|
})
|
|
|
+
|
|
|
+
|
|
|
+ // 跳转预告
|
|
|
+ function toVideo(){
|
|
|
+ wx.getChannelsLiveNoticeInfo({
|
|
|
+ 'finderUserName': 'sphIfs9sYiL5RB3',
|
|
|
+ success: (res)=>{
|
|
|
+ let noticeId = null;
|
|
|
+ if(res.otherInfos.length > 0){
|
|
|
+ let date1 = new Date(formatDateS(courseDetail.value.courseDate))
|
|
|
+ res.otherInfos.forEach(item=>{
|
|
|
+ let date = new Date(item.startTime*1000);
|
|
|
+ // console.log(item,date1, date)
|
|
|
+ if(date1.getTime()===date.getTime()){
|
|
|
+ noticeId = item.noticeId;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // console.log(noticeId)
|
|
|
+ if(!noticeId){
|
|
|
+ noticeId = res.noticeId
|
|
|
+ }
|
|
|
+ // console.log(res)
|
|
|
+ wx.reserveChannelsLive({
|
|
|
+ "noticeId": noticeId,
|
|
|
+ success: (resp)=>{
|
|
|
+ console.log(resp)
|
|
|
+ },
|
|
|
+ fail: (err)=>{
|
|
|
+ console.log(err)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ function getVideo(){
|
|
|
+ const startDate = new Date(formatDateS(courseDetail.value.courseDate));
|
|
|
+ // 计算 endTime(startDate 加一天)
|
|
|
+ const endDate = new Date(startDate);
|
|
|
+ endDate.setDate(startDate.getDate() + 1);
|
|
|
+ // 获取时间戳
|
|
|
+ const startTime = startDate.getTime();
|
|
|
+ const endTime = endDate.getTime();
|
|
|
+ wx.getChannelsLiveInfo({
|
|
|
+ 'finderUserName': 'sphIfs9sYiL5RB3',
|
|
|
+ 'startTime': startTime,
|
|
|
+ 'endTime': endTime,
|
|
|
+ success: (res)=>{
|
|
|
+ feedId.value = res.feedId;
|
|
|
+ console.log("直播信息", res.feedId)
|
|
|
+ feedShow.value = true
|
|
|
+ // wx.openChannelsLive({
|
|
|
+ // finderUserName: 'sphIfs9sYiL5RB3',
|
|
|
+ // feedId: res.feedId,
|
|
|
+ // nonceId: res.nonceId,
|
|
|
+ // success: (resp)=>{
|
|
|
+ // console.log(resp)
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ const videoShow = computed(()=>{
|
|
|
+ return courseDetail.value?.loc==='微信视频号' && !feedShow.value
|
|
|
+ })
|
|
|
</script>
|
|
|
<style lang="scss">
|
|
|
.u-drawer-bottom {
|
|
@@ -408,12 +491,14 @@
|
|
|
position: relative;
|
|
|
|
|
|
.content-text {
|
|
|
- padding: 0 20rpx env(safe-area-inset-bottom, 0);
|
|
|
+ // env(safe-area-inset-bottom, 0)
|
|
|
+ // padding: 0 20rpx 0;
|
|
|
font-size: 38rpx;
|
|
|
|
|
|
.text-title {
|
|
|
font-weight: bold;
|
|
|
margin-bottom: 15rpx;
|
|
|
+ margin-top: 15rpx;
|
|
|
}
|
|
|
|
|
|
.text-content {
|
|
@@ -427,6 +512,21 @@
|
|
|
margin-bottom: env(safe-area-inset-bottom, 0);
|
|
|
}
|
|
|
}
|
|
|
+ .content-button-hold{
|
|
|
+ width: 100%;
|
|
|
+ height: 120rpx;
|
|
|
+ }
|
|
|
+ .content-button{
|
|
|
+ width: 100%;
|
|
|
+ // height: 100rpx;
|
|
|
+ // line-height: 100rpx;
|
|
|
+ text-align: center;
|
|
|
+ background-color: #fe0000;
|
|
|
+ color: #fff;
|
|
|
+ // position: absolute;
|
|
|
+ // bottom: 0;
|
|
|
+ padding:20rpx 0 calc(20rpx + env(safe-area-inset-bottom, 0));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.section-bottom {
|