Commit 7790957f authored by youjie's avatar youjie

no message

parent 6774c60a
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
</view> </view>
<view class="statisticName">总共课时</view> <view class="statisticName">总共课时</view>
</view> </view>
<view class="statisticItem"> <view class="statisticItem" style="display: none;">
<view class="time">{{ pageData.CourseInfo.CompleteHours||0 }} <view class="time">{{ pageData.CourseInfo.CompleteHours||0 }}
</view> </view>
<view class="statisticName">已学课时</view> <view class="statisticName">已学课时</view>
......
<template> <template>
<swiper class="image-container" previous-margin="45rpx" next-margin="45rpx" :indicator-dots="true" :current="currentIndex" indicator-active-color='#4C50E7' @change="swiperChange"> <swiper class="image-container" previous-margin="45rpx" next-margin="45rpx" :indicator-dots="true" :current="currentIndex" indicator-active-color='#4C50E7' @change="swiperChange">
<swiper-item :class="currentIndex == index ? 'swiper-item' : 'swiper-item-side'" v-for="(item, index) in imgList" :key="item[urlKey]"> <swiper-item :class="currentIndex == index ? 'swiper-item' : 'swiper-item-side'" v-for="(item, index) in imgList" :key="item[urlKey]">
<!-- <image @click="clickImg(item)" :class="currentIndex == index ? 'item-img' : 'item-img-side'" :src="item[urlKey]" lazy-load :style="dontFirstAnimation ? 'animation: none;' : ''" mode="aspectFill"></image> --> <!-- <image @click="clickImg(item)" :class="currentIndex == index ? 'item-img' : 'item-img-side'" :src="item[urlKey]" lazy-load :style="dontFirstAnimation ? 'animation: none;' : ''" mode="aspectFill"></image> -->
<view class="box" :class="currentIndex == index ? 'item-img' : 'item-img-side'" :style="{background:item.B2BBackground ? getOpacityColor(item.B2BBackground,0.3):'#FFF',}"> <view class="box" :class="currentIndex == index ? 'item-img' : 'item-img-side'" :style="{background:item.B2BBackground ? getOpacityColor(item.B2BBackground,0.3):'#FFF',}">
<view class="box-state"> <view class="box-state">
<span v-if="item.ClassStatus==1">未开班</span> <span v-if="item.ClassStatus==1">未开班</span>
<span v-if="item.ClassStatus==2">学习中</span> <span v-if="item.ClassStatus==2">学习中</span>
<span v-if="item.ClassStatus==3">已结课</span> <span v-if="item.ClassStatus==3">已结课</span>
</view> </view>
<view class="box-center"> <view class="box-center">
<view class="box-center-l" :style="{background:item.B2BBackground ? getOpacityColor(item.B2BBackground,0.7):'#FFF',}"> <view class="box-center-l" :style="{background:item.B2BBackground ? getOpacityColor(item.B2BBackground,0.7):'#FFF',}">
<image mode='widthFix' :src="item.B2BIcon"></image> <image mode='widthFix' :src="item.B2BIcon"></image>
</view> </view>
<view class="box-center-r"> <view class="box-center-r">
<view> <view>
<view style="font-size: 15px;font-weight: bold;">{{item.CourseName}}</view> <view style="font-size: 15px;font-weight: bold;">{{item.CourseName}}</view>
<view style="font-size: 12px;font-weight: 500;margin-top: 5px;">{{item.ClassName}}</view> <view style="font-size: 12px;font-weight: 500;margin-top: 5px;">{{item.ClassName}}</view>
<view class="row" style="font-size: 12px;margin-top: 5px;"> <view class="row" style="font-size: 12px;margin-top: 5px;">
<view class="row">总计<span style="color: #4C50E7;margin:0 3px;font-weight: bold;">{{item.TotalHours}}</span>课时</view> <view class="row">总计<span style="color: #4C50E7;margin:0 3px;font-weight: bold;">{{item.TotalHours}}</span>课时</view>
<view style="width: 1px;height: 15px;background-color:#999999;margin: 0 10px;"></view> <view style="width: 1px;height: 15px;background-color:#999999;margin: 0 10px;"></view>
<view class="row">剩余<span style="color: #4C50E7;margin:0 3px;font-weight: bold;">{{item.SurplusHours}}</span>课时</view> <view class="row">剩余<span style="color: #4C50E7;margin:0 3px;font-weight: bold;">{{item.SurplusHours}}</span>课时</view>
</view> </view>
</view> </view>
<view> <view style="display: none;">
<view class="row" style="justify-content: space-between;font-size: 11px;margin-bottom:10rpx;"> <view class="row" style="justify-content: space-between;font-size: 11px;margin-bottom:10rpx;">
<span>已学课程</span> <span>已学课程</span>
<span>{{item.CompleteHours}}/{{item.TotalHours}}</span> <span>{{item.CompleteHours}}/{{item.TotalHours}}</span>
</view> </view>
<van-progress :percentage="(item.CompleteHours/item.TotalHours)*100" :showPivot='false'/> <van-progress :percentage="(item.CompleteHours/item.TotalHours)*100" :showPivot='false'/>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>
...@@ -62,34 +62,34 @@ ...@@ -62,34 +62,34 @@
methods: { methods: {
swiperChange(e) { swiperChange(e) {
this.dontFirstAnimation = false this.dontFirstAnimation = false
this.currentIndex = e.detail.current; this.currentIndex = e.detail.current;
this.$emit('selected', this.currentIndex) this.$emit('selected', this.currentIndex)
}, },
clickImg(item) { clickImg(item) {
this.$emit('selected', item, this.currentIndex) this.$emit('selected', item, this.currentIndex)
}, },
getOpacityColor(thisColor, thisOpacity){ getOpacityColor(thisColor, thisOpacity){
var theColor = thisColor.toLowerCase(); var theColor = thisColor.toLowerCase();
//十六进制颜色值的正则表达式 //十六进制颜色值的正则表达式
var r = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; var r = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
// 如果是16进制颜色 // 如果是16进制颜色
if (theColor && r.test(theColor)) { if (theColor && r.test(theColor)) {
if (theColor.length === 4) { if (theColor.length === 4) {
var sColorNew = "#"; var sColorNew = "#";
for (var i = 1; i < 4; i += 1) { for (var i = 1; i < 4; i += 1) {
sColorNew += theColor.slice(i, i + 1).concat(theColor.slice(i, i + 1)); sColorNew += theColor.slice(i, i + 1).concat(theColor.slice(i, i + 1));
} }
theColor = sColorNew; theColor = sColorNew;
} }
//处理六位的颜色值 //处理六位的颜色值
var sColorChange = []; var sColorChange = [];
for (var i = 1; i < 7; i += 2) { for (var i = 1; i < 7; i += 2) {
sColorChange.push(parseInt("0x" + theColor.slice(i, i + 2))); sColorChange.push(parseInt("0x" + theColor.slice(i, i + 2)));
} }
return "rgba(" + sColorChange.join(",") + "," + thisOpacity + ")"; return "rgba(" + sColorChange.join(",") + "," + thisOpacity + ")";
// return "rgba(" + sColorChange.join(",") + ", 0.7)"; // return "rgba(" + sColorChange.join(",") + ", 0.7)";
} }
return theColor; return theColor;
} }
}, },
mounted() { mounted() {
...@@ -144,58 +144,58 @@ ...@@ -144,58 +144,58 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.box{ .box{
position: relative; position: relative;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
/* padding: 0 20rpx; */ /* padding: 0 20rpx; */
} }
.box-center{ .box-center{
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
width: calc(100% - 36rpx); width: calc(100% - 36rpx);
} }
.box-center-l{ .box-center-l{
width: 162rpx; width: 162rpx;
height: 208rpx; height: 208rpx;
border-radius: 6px; border-radius: 6px;
position: relative; position: relative;
} }
.box-center-l image{ .box-center-l image{
position: absolute; position: absolute;
bottom: 10rpx; bottom: 10rpx;
right: 10rpx; right: 10rpx;
max-width: 100rpx; max-width: 100rpx;
height: auto; height: auto;
} }
.box-center-r{ .box-center-r{
flex:1; flex:1;
margin-left: 12px; margin-left: 12px;
min-height: 208rpx; min-height: 208rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
} }
.row{ .row{
display: flex;align-items: center; display: flex;align-items: center;
} }
.box-state{ .box-state{
width: 38rpx; width: 38rpx;
height: 88rpx; height: 88rpx;
position: absolute; position: absolute;
right:17px ; right:17px ;
top: 0; top: 0;
background: #5DE3A6; background: #5DE3A6;
font-size: 20rpx; font-size: 20rpx;
color: #333333; color: #333333;
text-align: center; text-align: center;
box-sizing: border-box; box-sizing: border-box;
padding: 5rpx 8rpx; padding: 5rpx 8rpx;
} }
@keyframes to-mini @keyframes to-mini
{ {
......
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 to comment