|
@@ -1,10 +1,10 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
- <view style="background-color: #FFFFFF;">
|
|
|
+ <view class="videoBox" >
|
|
|
<view >
|
|
|
- <image :src="$method.splitImgHost(detail.coverUrl)" style="height: 461rpx;width: 100%;"></image>
|
|
|
- <view style="padding:20rpx">
|
|
|
- <view style="display: flex;margin-top: 13rpx;">
|
|
|
+ <image :src="$method.splitImgHost(detail.coverUrl)" style="height: 460rpx;width: 100%;"></image>
|
|
|
+ <view style="padding:20rpx;height: 120rpx;">
|
|
|
+ <view style="display: flex;">
|
|
|
<view class="yearTag">{{detail.year}}</view>
|
|
|
<view class="titleTag">{{detail.goodsName}}</view>
|
|
|
</view>
|
|
@@ -16,29 +16,37 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<u-line color="#D6D6DB" />
|
|
|
- <view>
|
|
|
+ <view style="height: 80rpx;">
|
|
|
<view style="width: 160px;margin: 0 auto;"><u-tabs :list="list" item-width="150" font-size="24" bar-width="110" :current="current" @change="change" active-color="#007AFF"></u-tabs></view>
|
|
|
</view>
|
|
|
- <u-line color="#D6D6DB" />
|
|
|
+
|
|
|
</view>
|
|
|
- <view style="padding: 20rpx;" v-show="current==0">
|
|
|
+ <view style="padding: 20rpx;position: relative;top: 680rpx;" v-show="current==0">
|
|
|
<view class="content">
|
|
|
<view v-html="detail.mobileDetailHtml"></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view style="padding: 20rpx;" v-show="current==1">
|
|
|
+ <view style="padding: 20rpx;padding-bottom: 100rpx;position: relative;top: 680rpx;" v-show="current==1">
|
|
|
<view >
|
|
|
<view v-for="(item,index) in courseList" >
|
|
|
- <view class="courseItem" @click="openCourse(item)">
|
|
|
- <view>{{item.courseName}}</view>
|
|
|
- <view>
|
|
|
- <u-icon name="arrow-down" v-if="item.down"></u-icon>
|
|
|
- <u-icon name="arrow-up" v-if="!item.down"></u-icon>
|
|
|
+ <view class="courseItemBox" >
|
|
|
+ <view class="courseItem" @click="openCourse(item)">
|
|
|
+ <view class="courseName">{{item.courseName}}</view>
|
|
|
+ <view>
|
|
|
+ <image src="/static/icon/up.png" class="icon_up" v-if="item.down"></image>
|
|
|
+ <image src="/static/icon/down.png" class="icon_up" v-if="!item.down"></image>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view v-show="!item.down">
|
|
|
+ <view v-for="(itemM,indexM) in menuList" >
|
|
|
+ <courseModule v-if="itemM.type==1" :menuItem="itemM"></courseModule>
|
|
|
+ <courseChapter v-if="itemM.type==2" :menuItem="itemM"></courseChapter>
|
|
|
+ <courseSection v-if="itemM.type==3" :menuItem="itemM"></courseSection>
|
|
|
+ <u-line></u-line>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view v-if="item.down">
|
|
|
-
|
|
|
- </view>
|
|
|
+
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -46,15 +54,23 @@
|
|
|
<view class="priceTag">¥ {{detail.standPrice}}</view>
|
|
|
<view style="display: flex;color: #FFFFFF;align-items: center;">
|
|
|
<view class="btn1" @click="addCart">加购物车</view>
|
|
|
- <view class="btn2" @click="buy">立即购买</view>
|
|
|
+ <view class="btn2" @click="buy">立即购买 </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import courseModule from '@/pages2/components/course/courseModule.vue';
|
|
|
+import courseChapter from '@/pages2/components/course/courseChapter.vue';
|
|
|
+import courseSection from '@/pages2/components/course/courseSection.vue';
|
|
|
import { mapGetters } from 'vuex';
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ courseModule,
|
|
|
+ courseChapter,
|
|
|
+ courseSection
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
id:0,
|
|
@@ -68,13 +84,14 @@ export default {
|
|
|
],
|
|
|
current:0,
|
|
|
detail:{},
|
|
|
- courseList:[]
|
|
|
+ courseList:[],
|
|
|
+ menuList:[]
|
|
|
};
|
|
|
},
|
|
|
onUnload() {
|
|
|
|
|
|
},
|
|
|
- computed: { ...mapGetters(['userInfo']) },
|
|
|
+ computed: { ...mapGetters(['userInfo','goodsAuditionConfigIdList']) },
|
|
|
onLoad(option) {
|
|
|
this.id = option.id;
|
|
|
this.getDetail()
|
|
@@ -86,8 +103,8 @@ export default {
|
|
|
methods: {
|
|
|
openCourse(item){
|
|
|
item.down = !item.down
|
|
|
- if(!item.down){
|
|
|
- this.menuList(item.courseId)
|
|
|
+ if(!item.down&&this.menuList.length==0){
|
|
|
+ this.getMenuList(item.courseId)
|
|
|
}
|
|
|
|
|
|
},
|
|
@@ -108,7 +125,6 @@ export default {
|
|
|
let self = this
|
|
|
this.$api.goodsCourseList(this.id).then(res => {
|
|
|
if(res.data.code==200){
|
|
|
-
|
|
|
for(let i=0;i<res.data.rows.length;i++){
|
|
|
let item = res.data.rows[i]
|
|
|
item.down = true
|
|
@@ -117,21 +133,41 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- menuList(courseId) {
|
|
|
+ getMenuList(courseId) {
|
|
|
let self = this
|
|
|
this.$api.menuList({courseId:courseId}).then(res => {
|
|
|
if(res.data.code==200){
|
|
|
-
|
|
|
- console.log(res.data)
|
|
|
+ for(let i=0;i<res.data.rows.length;i++){
|
|
|
+ let item = res.data.rows[i]
|
|
|
+ item.down = true
|
|
|
+ item.id = item.menuId
|
|
|
+ item.name = item.menuName
|
|
|
+
|
|
|
+ if(item.type==3){
|
|
|
+ //判断是否试听
|
|
|
+ item.tryListen = false
|
|
|
+ if(self.goodsAuditionConfigIdList.indexOf(item.id)!==-1){
|
|
|
+ item.tryListen = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ self.menuList = res.data.rows
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
getDetail() {
|
|
|
let self = this
|
|
|
+ let sectionIdList = []
|
|
|
this.$api.goodsDetail(this.id).then(res => {
|
|
|
if(res.data.code==200){
|
|
|
self.detail = res.data.data
|
|
|
- console.log(self.detail.mobileDetailHtml)
|
|
|
+ if(self.detail.goodsAuditionConfig){
|
|
|
+ let configList = JSON.parse(self.detail.goodsAuditionConfig)
|
|
|
+ for (var itemChild of configList) {
|
|
|
+ sectionIdList.push(itemChild.sectionId)//存储试听节ID
|
|
|
+ }
|
|
|
+ self.$store.commit('setGoodsAuditionConfigIdList', {goodsAuditionConfigIdList:sectionIdList});
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -139,7 +175,7 @@ export default {
|
|
|
if(this.$method.isGoLogin()){
|
|
|
return
|
|
|
}
|
|
|
- this.$navTo.togo('/pages2/order/confirm_list');
|
|
|
+ this.$navTo.togo('/pages2/order/confirm_list?id='+this.id);
|
|
|
},
|
|
|
addCart(){
|
|
|
if(this.$method.isGoLogin()){
|
|
@@ -162,21 +198,40 @@ export default {
|
|
|
}
|
|
|
</style>
|
|
|
<style scope>
|
|
|
+ .courseName{
|
|
|
+ white-space:nowrap;
|
|
|
+ overflow:hidden;
|
|
|
+ text-overflow:ellipsis;
|
|
|
+ }
|
|
|
+ .videoBox{
|
|
|
+ position: fixed;
|
|
|
+ background-color: #FFFFFF;
|
|
|
+ width: 100%;
|
|
|
+ height: 680rpx;
|
|
|
+ z-index: 999;
|
|
|
+ }
|
|
|
+ .icon_up{
|
|
|
+ width: 32rpx;
|
|
|
+ height: 32rpx;
|
|
|
+ }
|
|
|
.contentBox{
|
|
|
|
|
|
}
|
|
|
- .courseItem{
|
|
|
- width: 100%;
|
|
|
- height: 80rpx;
|
|
|
+ .courseItemBox{
|
|
|
background: #FFFFFF;
|
|
|
border-radius: 16rpx;
|
|
|
+ padding: 0 10rpx;
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+ }
|
|
|
+ .courseItem{
|
|
|
+ height: 80rpx;
|
|
|
color: #333333;
|
|
|
font-size: 32rpx;
|
|
|
line-height: 80rpx;
|
|
|
font-weight: bold;
|
|
|
- padding: 0 10rpx;
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
+
|
|
|
}
|
|
|
.content{
|
|
|
background-color: #FFFFFF;
|