Commit 6927701f authored by Mac's avatar Mac

1

parent c8415ac4
......@@ -65,6 +65,85 @@
<h-parse :content="teacher.teacherResult.Introduction" @navigate="clickDescription"></h-parse>
</view>
<view class="tiaoti" style="justify-content: space-between;">
<view style="display: flex;flex-direction: row;align-items: center;">
<view class="tiaoti-l"></view>
<text style="font-size: 16px;color: #1B1D1E;margin-left: 5px;">老师动态</text>
</view>
<view style="margin-right: 12px;color: #666666;font-weight: 100;" @click="seeMore" v-if="teacher.teacherResult.DynamicStatus!=2">
查看更多
</view>
</view>
<view class="ftBox" v-for="(x, i) in teacher.teacherResult.DynamicList" :key="i" @click="godetails(x,i)">
<view class="jiazu" v-if="x.YearTime!=''">{{x.YearTime}}</view>
<view class="interDList">
<view class="interDList-left">
<text class="jiazu">{{x.DayTime}}</text>
<text style="font-size: 14px;color: #333333;margin-left: 5px;">{{x.MonthTime}}</text>
</view>
<view class="interDList-right">
<view class="inter-r-o" v-if="x.fileType==0">
{{x.content}}
</view>
<view class="inter-r-t wrap" v-if="x.fileType==1" >
<view class="inter-r-t-l" @click.stop="previewImage(0,x.files)">
<image :src="x.files[0]" v-if="x.files.length==1" mode='aspectFill' style="width: 100%;height: 100%;"></image>
<view v-if="x.files.length==2" v-for="(item, iq) in x.files" :key="iq" :style="{'margin-right':(iq%2 ==0)?'2px':'0',width:'34px','height':'100%'}">
<image :src="item" mode='aspectFill' style="width: 100%;height: 100%;"></image>
</view>
<view style="width: 100%;height: 100%;display: flex;flex-direction: row;" v-if="x.files.length==3">
<image :src="x.files[0]" mode='aspectFill' style="width: 34px;height: 100%;margin-right: 2px;"></image>
<view style="width: 34px;height: 100%;display: flex;flex-direction: column;justify-content: space-between;">
<view v-if="iq!=0" v-for="(item, iq) in x.files" :key="iq" style="width: 34px;height: 34px;">
<image :src="item" mode='aspectFill' style="width: 100%;height: 100%;"></image>
</view>
</view>
</view>
<view v-if="x.files.length>3" v-for="(item, iq) in x.files" :key="iq" :style="{'margin-right':(iq%2 ==0)?'2px':'0',width:'34px','height':'34px','margin-bottom':(iq==0||iq==1)?'2px':'0'}">
<image :src="item" mode='aspectFill' style="width: 100%;height: 100%;"></image>
</view>
</view>
<view class="inter-r-t-r">
<view class="inter-r-t-text">
{{x.content}}
</view>
<text style="font-size: 11px;color: #BEBEBE;">{{x.files.length}}</text>
</view>
</view>
<view class="inter-r-t" v-if="x.fileType==2">
<view class="inter-r-t-l" style="position: relative;">
<video :id="'myVideo'+i" :src="x.files[0]" style="width: 70px;height: 70px;"
:controls='controls'
:show-center-play-btn='false'
:show-fullscreen-btn='false'
@fullscreenchange='videoControl'></video>
<view style="width: 100%;height: 100%;position: absolute;left: 0;top: 0;display: flex;align-items: center;justify-content: center;"
@click.stop="enlarge(x.files[0],i)">
<u-icon name="play-circle-o" :size="50" color="#FFF"></u-icon>
</view>
</view>
<view class="inter-r-t-r">
<view class="inter-r-t-text">
{{x.content}}
</view>
</view>
</view>
<view class="inter-r-o" v-if="x.fileType==3">
<view>
{{x.content}}
</view>
<view class="andiostyle" @click.stop="playVoice(x,i)">
<image v-if="x.playshow==false" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/Sound.png" mode="widthFix" style="width: 19px;height: auto;"></image>
<image v-if="x.playshow==true" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/bofanggif.gif" mode="widthFix" style="width: 19px;height: auto;"></image>
</view>
</view>
</view>
</view>
</view>
<view class="tiaoti">
<view class="tiaoti-l"></view>
<text style="font-size: 16px;color: #1B1D1E;margin-left: 5px;">课程目录</text>
......@@ -84,7 +163,7 @@
</view>
<u-empty text="暂无课程" v-if='g.length==0' font-size="36" mode="list" ></u-empty>
<u-loadmore :status="status" :load-text="loadText" :font-size="24" :margin-top="20"
:margin-bottom="20" bg-color="#FFF" />
:margin-bottom="20" bg-color="#FFF" v-if="g.length>0"/>
</view>
<view class="goback" @click="goback" :style="{'padding-top':paddingHTop}">
<u-icon name="arrow-left" size="48" color="#121212"></u-icon>
......@@ -96,6 +175,7 @@
</template>
<script>
const innerAudioContext = uni.createInnerAudioContext();
import hParse from "@/components/u-parse/parse.vue";
import auth from "../../components/auth/index.vue";
export default {
......@@ -128,12 +208,20 @@
loading: "努力加载中",
nomore: "没有更多课程了",
},
playshow:false,
controls:false,//显示默认控件
nowbofo: false,
playindex:0,
}
},
components: {
hParse,
auth
},
onUnload(){
innerAudioContext.stop();
},
onLoad(options) {
console.log(options,'options')
if(options && options.ID){
......@@ -190,6 +278,11 @@
},
res => {
this.teacher= res.data;
if(this.teacher.teacherResult.DynamicList && this.teacher.teacherResult.DynamicList.length>0){
this.teacher.teacherResult.DynamicList.forEach(x=>{
x.playshow = false;
})
}
this.pageTitle = res.data.teacherResult.Name
}
);
......@@ -226,17 +319,24 @@
}
},
res => {
this.request2({
let that =this
uni.requestSubscribeMessage({
tmplIds: res.data,
complete(res) {
that.request2({
url: '/api/AppletSchool/GetTeacherModel',
data: {ID: this.id,UserId:this.UserId }
data: {ID: that.id,UserId:that.UserId }
},
res2 => {
this.teacher.teacherResult.Followteacher = res2.data.teacherResult.Followteacher
this.teacher.teacherResult.FollowteacherNum = res2.data.teacherResult.FollowteacherNum
that.teacher.teacherResult.DynamicStatus = res2.data.teacherResult.DynamicStatus
that.teacher.teacherResult.Followteacher = res2.data.teacherResult.Followteacher
that.teacher.teacherResult.FollowteacherNum = res2.data.teacherResult.FollowteacherNum
}
);
}
})
uni.showToast({
title: res.message,
icon: 'none',
......@@ -263,6 +363,72 @@
this.status = "nomore";
}
},
//图片预览
previewImage(index, images) {
uni.previewImage({
urls: images,
current: index,
});
},
enlarge(file,i) {
// 全屏
innerAudioContext.stop();
this.videoContext = uni.createVideoContext('myVideo'+i);
this.videoContext.requestFullScreen({
direction:0
})
},
videoControl(e){
if(e.detail.fullScreen==false){
this.videoContext.stop()
this.controls=false
}else{
this.videoContext.play()
this.controls=true
}
},
//语音播放
playVoice(x,i) {
let g = this.teacher.teacherResult.DynamicList
if (innerAudioContext.src != x.files[0]) { //如果切换听其他的语音
innerAudioContext.stop();
this.nowbofo = false;
g[this.playindex].playshow=false;
this.playindex= i
}else{
this.playindex= i
}
innerAudioContext.src = x.files[0];
if (this.nowbofo == false) {
innerAudioContext.play()
this.nowbofo = true
g[i].playshow=true
innerAudioContext.onEnded(()=>{
innerAudioContext.stop()
this.nowbofo == false
this.g[this.playindex].playshow=false
})
} else {
innerAudioContext.pause();
this.nowbofo = false
g[i].playshow=false
}
},
godetails(x,i){//跳入详情
uni.navigateTo({
url: '/pages/friendcircle/mydetails?ID=' + x.id+'&index='+i
})
innerAudioContext.stop();
},
seeMore(){//查看更多
let DynamicStatus = this.teacher.teacherResult.DynamicStatus;
if(DynamicStatus==1 || DynamicStatus==3){
uni.navigateTo({
url: '/pages/friendcircle/friendcircle?ID=' + x.id+'&index='+i
})
}
},
}
}
......@@ -434,4 +600,94 @@
.teacherDetails .u-empty{
padding-top: 20px!important;
}
.teacherDetails .ftBox {
width: 100%;
padding: 0 15px;
margin-top: 25px;
}
.teacherDetails .interDList {
width: 100%;
display: flex;
flex-direction: row;
align-items: flex-start;
}
.teacherDetails .interDList-left {
width: 80px;
display: flex;
flex-direction: row;
align-items: flex-end;
}
.teacherDetails .interDList-right {
width: 1;
flex: 1;
font-size: 14px;
color: #333333;
}
.teacherDetails .jiazu {
font-size: 25px;
color: #333333;
}
.teacherDetails .inter-r-o {
width: 100%;
padding: 10px;
background: #F5F5F5;
border-radius: 4px;
}
.teacherDetails .inter-r-t {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
flex-wrap: wrap;
}
.teacherDetails .inter-r-t-l {
width: 70px;
height: 70px;
border-radius: 4px;
margin-right: 15px;
overflow: hidden;
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.teacherDetails .inter-r-t-r {
width: 1;
flex: 1;
height: 70px;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.teacherDetails .inter-r-t-text {
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.teacherDetails .andiostyle {
width: 100%;
height: 27px;
border-radius: 4px;
padding: 0 15px;
display: flex;
background: #FFF;
flex-direction: row;
align-items: center;
margin-top: 10px;
justify-content: space-between;
}
</style>
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