123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194 |
- <template>
- <div class="school">
- <div class="top">
- <div class="search">
- <image src="@/static/images/search.png" mode="" class="search_icon"></image>
- <div class="s_input"><u-input v-model="value" type="text" :border="false" /></div>
- <div class="searh_btn">查询</div>
- </div>
- </div>
- <view class="CoursePage">
- <scroll-view :scroll-y="!detail.vis" class="CourseScrollBody">
- <!-- 悬浮窗 -->
- <view v-if="!detail.vis && showfu&&img" class="showfu" @click.stop="appectData($event)">
- <view class="imgBox">
- <image :src="img" mode="widthFix" style="width: 88rpx;height: 88rpx;"></image>
- </view>
- <image src="@/static/images/school/start.png" mode="widthFix" style="width: 40rpx;"></image>
- <image src="@/static/images/school/xx.png" mode="widthFix" style="width: 40rpx;margin-right: 28rpx;"
- @click.stop="clearSave"></image>
- </view>
- <div class="tabs">
- <u-tabs ref="tabs" :list="tabList" active-color="#F5222D" :show-bar="false"></u-tabs>
- </div>
- <view class="CourseBody">
- <view class="CourseList">
- <template>
- <view class="CourseList-item" v-for="(item, i) in courseList" :key="item.id">
- <view class="ItemInfo">
- <image :src="item.cover" mode="aspectFill" class="ItemInfo-teamcher">
- <view class="Info-right">
- <view class="Right-title">{{item.name}}</view>
- <view class="Right-teacher">{{item.day}} 首席导师·{{item.author}}</view>
- <view class="Right-play no_open">
- <image v-if="play.ing && play.index === i"
- src="@/static/images/school/pause2.png" class="Play-icon"
- @click.stop="playSelf($event,item, i)" />
- <image v-else src="@/static/images/school/play2.png" class="Play-icon"
- @click.stop="playSelf($event,item, i)" />
- <view class="Play-Sound">
- <view class="SoundWave">
- <view v-for="ni in 20" :key="i + '_' + ni" class="Wave-line"
- :class="play.ing && play.index === i ? 'active' : ''" />
- </view>
- </view>
- <view class="Play-time">{{ item.seconds | mediaTimeFormatter }}
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- <view class="CourseList-item">
- <view class="ItemInfo">
- <image src="@/static/images/school/teacher.png" mode="aspectFill"
- class="ItemInfo-teamcher">
- <view class="Info-right">
- <view class="Right-title">不得不听的学位争霸赛赛前课</view>
- <view class="Right-teacher">2024-10-20 首席导师·李老师</view>
- <view class="Right-play">
- <template>
- <image src="@/static/images/school/play2.png" class="Play-icon" />
- </template>
- <view class="Play-Sound">
- <view class="SoundWave">
- <view v-for="ni in 20" :key="i + '_' + ni" class="Wave-line"
- :class="play.ing && play.index === i ? 'active' : ''" />
- </view>
- </view>
- <view class="Play-time">120分钟
- </view>
- </view>
- </view>
- </view>
- </view> -->
- </template>
- <!-- <template v-if="courseList.length > 0">
- <view v-for="(item, i) in courseList" :key="item.id" class="CourseList-item"
- @click="toInfo(item, i)">
- <view class="ItemInfo">
- <image :src="item.cover" mode="aspectFill" class="ItemInfo-teamcher">
- <view class="Info-right">
- <view class="Right-title">{{ item.name }}</view>
- <view class="Right-teacher">{{ item.teacher_name }}</view>
- <view class="Right-play" :class="item.status ? '' : 'no_open'">
- <template v-if="item.status">
- <image v-if="play.ing && play.index === i"
- src="@/static/images/school/pause2.png" class="Play-icon"
- @click.stop="playSelf($event,item, i)" />
- <image v-else src="@/static/images/school/play2.png"
- class="Play-icon" @click.stop="playSelf($event,item, i)" />
- </template>
- <template v-else>
- <image src="@/static/images/school/play1.png" class="Play-icon" />
- </template>
- <view class="Play-Sound">
- <view class="SoundWave">
- <view v-for="ni in 20" :key="i + '_' + ni" class="Wave-line"
- :class="play.ing && play.index === i ? 'active' : ''" />
- </view>
- </view>
- <view class="Play-time">{{ item.seconds | mediaTimeFormatter }}
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <template v-else>
- <view class="noTip">暂无相关课程</view>
- </template> -->
- </view>
- </view>
- </scroll-view>
- <view v-if="detail.vis" class="CourseAudioDetail">
- <view class="CoursePlay">
- <view class="PlayTitle">{{ detail.info.title }}</view>
- <view class="PlayTeacher">{{ detail.info.teacher_name }}</view>
- <view class="PlayCover">
- <image class="CoverImg" mode="aspectFill" :src="detail.info.teacher_img"
- :class="play.ing ? 'start' : 'start paused'" />
- </view>
- <view class="AudioProgress">
- <view class="Progress-left">
- <audio-slide class="Audio-slide" :allTime="Number(detail.info.course_length)"
- :playTime.sync="play.time" @update:progress="moveAudioPlay" @touchStart="audioTouch" />
- </view>
- <image v-show="params.season > 33" src="@/static/images/school/xia.png" mode="widthFix"
- style="width: 60rpx;margin-left: 26rpx;"
- @click="goXia(detail.info.title,detail.info.down_link)"></image>
- <!-- <view class="Progress-right">倍数</view> -->
- </view>
- <view class="AudioControl">
- <image src="@/static/images/school/prev_15.png" mode="widthFix" @click="prevTime"></image>
- <image src="@/static/images/school/prev.png" mode="widthFix" @click="toPrev"></image>
- <image v-if="!play.ing" src="@/static/images/school/play.png" mode="widthFix"
- @click="detailPlay" />
- <image v-else src="@/static/images/school/pause.png" mode="widthFix" @click="detailPlay" />
- <image src="@/static/images/school/next.png" mode="widthFix" @click="toNext"></image>
- <image src="@/static/images/school/next_15.png" mode="widthFix" @click="nextTime"></image>
- </view>
- </view>
- </view>
- </view>
- </div>
- </template>
- <script>
- import {
- AudioSlide
- } from "@/components/audio-slide.vue"
- // import {
- // GetSeason
- // } from '../../api.js'
- import {
- mapState
- } from "vuex"
- export default {
- components: {
- AudioSlide
- },
- data() {
- return {
- typd: 0,
- saveData: {},
- showfu: false,
- title_list: [],
- title: '赛季点击此处选择',
- params: {
- page: 1,
- page_size: 15,
- week: 1,
- season: ''
- },
- courseList: [],
- tabList: [{
- name: '全部'
- }, {
- name: '认知课程'
- }, {
- name: '卖货课程',
- }, {
- name: '团队管理',
- }],
- img: '',
- play: {
- self: null,
- index: -1,
- all: false,
- ing: false,
- time: 0,
- img: ''
- },
- detail: {
- vis: false,
- info: {}
- }
- }
- },
- computed: {
- ...mapState(['userServerInfo'])
- },
- watch: {
- 'params.week'(a) {
- if (this.tyed != 1) {
- this.toPause()
- this.play.ing = false
- this.play.index = -1
- this.params.page = 1
- this.getCourseList()
- console.log(0)
- } else {
- console.log(1)
- this.getCourseList()
- this.tyed = 0
- }
- },
- "play.all"(a) {
- if (a) {
- this.play.self.onEnded(() => {
- let len = this.courseList.length - 1
- if (this.play.index >= len) {
- this.play.index = 0
- this.play.all = false
- this.play.ing = false
- return false
- }
- let _i = this.play.index + 1
- if (!this.courseList[_i].status) {
- return false
- }
- this.toPlay(this.courseList[_i].course_link, this.courseList[_i].title, this.courseList[_i]
- .cover_url, () => {
- this.play.index = _i
- })
- if (this.detail.vis) {
- this.detail.info = this.courseList[_i]
- }
- })
- } else {
- this.play.self ? this.play.self.offEnded() : null
- }
- },
- "play.ing"(a) {
- if (a) {
- this.play.self.onTimeUpdate(() => {
- this.play.time = this.play.self.currentTime
- })
- this.play.self.onEnded(() => {
- if (!this.play.all) {
- this.toPause()
- this.play.time = 0
- }
- })
- } else {
- // this.play.self.offTimeUpdate()
- }
- },
- "detail.info": {
- handler(a) {
- if (a.course_link) {
- this.play.self.onTimeUpdate(() => {
- this.play.time = this.play.self.currentTime
- })
- }
- },
- deep: true,
- immediate: true
- }
- },
- filters: {
- dateFormatter: (timestamp, fmt) => {
- fmt = fmt || "yyyy-MM-dd";
- if (typeof timestamp === 'string') {
- timestamp = timestamp.replace(/-/g, '/')
- }
- const $this = new Date(timestamp);
- const o = {
- "M+": $this.getMonth() + 1,
- "d+": $this.getDate(),
- "h+": $this.getHours(),
- "m+": $this.getMinutes(),
- "s+": $this.getSeconds(),
- "q+": Math.floor(($this.getMonth() + 3) / 3),
- S: $this.getMilliseconds()
- };
- if (/(y+)/.test(fmt)) {
- fmt = fmt.replace(
- RegExp.$1,
- ($this.getFullYear() + "").substr(4 - RegExp.$1.length)
- );
- }
- for (var k in o) {
- if (new RegExp("(" + k + ")").test(fmt)) {
- fmt = fmt.replace(
- RegExp.$1,
- RegExp.$1.length === 1 ?
- o[k] :
- ("00" + o[k]).substr(("" + o[k]).length)
- );
- }
- }
- return fmt;
- },
- dateWeek(time) {
- if (typeof time === 'string') {
- time = time.replace(/-/g, '/')
- }
- let _d = new Date(time).getDay()
- let _a = ['日', '一', '二', '三', '四', '五', '六']
- return _a[_d]
- },
- mediaTimeFormatter: num => {
- if (!num) return "00:00";
- num = Math.floor(num);
- let hour = Math.floor(num / 3600);
- let minutes = Math.floor((num - hour * 3600) / 60);
- let second = num - hour * 3600 - minutes * 60;
- if (hour > 0) {
- return `${hour > 9 ? hour : "0" + hour}:${
- minutes > 9 ? minutes : "0" + minutes
- }:${second > 9 ? second : "0" + second}`;
- } else {
- return `${minutes > 9 ? minutes : "0" + minutes}:${
- second > 9 ? second : "0" + second
- }`;
- }
- }
- },
- onBackPress() {
- return false
- },
- onShow() {
- // 从聊天页面回来
- if (this.play.self && this.play.ing) { // 正在播放
- this.play.self.seek(this.play.time)
- this.play.self.play()
- } else if (this.play.self && !this.play.ing) { // 暂停播放,显示悬浮窗
- if (uni.getStorageSync('saveData')) {
- console.log(121212121)
- this.getSave();
- // this.showfu = true
- // const obj = uni.getStorageSync('saveData')
- // this.img = obj.data.teacher_img
- }
- }
- },
- onHide() {
- // 离开小程序,去聊天
- if (this.play.self && !this.play.ing) { // 暂停播放,存储数据
- console.log(1121215)
- this.saveData.params = this.params
- this.saveData.play = this.play
- uni.setStorageSync('saveData', this.saveData)
- console.log(console.log('存储的saveData', uni.getStorageSync('saveData')))
- this.showfu = true
- }
- },
- destroyed() {
- // this.toPause()
- },
- onLoad(e) {
- // 从首页进入小程序
- // this.getSeasonList()
- console.log(uni.getStorageSync('saveData'), 'onload中的saveDate')
- this.getSave();
- if (e.week) {
- this.params.week = Number(e.week)
- }
- this.getCategoryLlist()
- this.getCourseList()
- },
- onUnload() {
- console.log('onunload')
- // 返回首页,存储数据
- if (this.play.index != -1) {
- this.saveData.params = this.params
- this.saveData.play = this.play
- uni.setStorageSync('saveData', this.saveData)
- console.log(console.log('跳转页面存储的saveData', uni.getStorageSync('saveData')))
- }
- },
- methods: {
- // 获取缓存的数据
- getSave() {
- if (uni.getStorageSync('saveData')) {
- this.showfu = true
- const obj = uni.getStorageSync('saveData')
- if (obj.play && obj.data) {
- const {
- index,
- ing,
- time
- } = obj.play
- this.play.index = index
- this.play.ing = ing
- const {
- course_link,
- cover_url,
- title,
- teacher_img
- } = obj.data
- this.play.self.src = course_link
- this.play.self.coverImgUrl = cover_url
- this.play.self.title = title
- this.img = obj.data.teacher_img
- }
- }
- },
- //下载音频文件
- goXia(title, url) {
- let that = this
- const filePath = wx.env.USER_DATA_PATH + '/' + title + '.mp4'
- const downloadTask = uni.downloadFile({
- url: url,
- filePath: filePath,
- success: (res) => {
- if (res.statusCode === 200) {
- wx.saveVideoToPhotosAlbum({
- filePath: filePath,
- success: function(red) {
- uni.showToast({
- title: '下载成功',
- icon: 'none'
- })
- },
- fail: function(err) {
- uni.showToast({
- title: '下载失败',
- icon: 'none'
- })
- }
- })
- } else {
- uni.showToast({
- title: '保存失败',
- icon: 'none'
- })
- }
- }
- })
- downloadTask.onProgressUpdate((res) => {
- // console.log('下载进度' + res.progress);
- uni.showToast({
- title: '下载进度' + res.progress + '%',
- icon: 'none'
- })
- // console.log('已经下载的数据长度' + res.totalBytesWritten);
- // console.log('预期需要下载的数据总长度' + res.totalBytesExpectedToWrite);
- })
- },
- clearSave() {
- uni.removeStorageSync('saveData')
- this.showfu = false
- },
- appectData(e) {
- const data = uni.getStorageSync('saveData')
- if (data.params.week === this.params.week) {
- this.tyed = 0
- } else {
- this.tyed = 1
- }
- this.params = data.params
- this.getSeason(this.params.season)
- console.log(this.title_list)
- this.play.index = data.play.index
- this.play.self.src = data.data.course_link
- this.play.time = data.play.time
- console.log('play.time', this.play.time)
- this.playSelfd(e, data.data, this.play.index) //列表播放
- uni.removeStorageSync('saveData')
- this.showfu = false
- this.toInfo(data.data, this.play.index)
- },
- // 列表里的暂停播放按钮
- playSelfd(e, data, i) {
- this.saveData.data = data
- uni.removeStorageSync('saveData')
- e.stopPropagation()
- this.toPlayd(data.course_link, data.title, data.cover_url, () => {
- console.log(1, this.play)
- this.play.index = i
- })
- },
- toPlayd(src, cb) {
- this.play.ing ? this.play.self.pause() : null
- this.play.self.src = src;
- this.play.self.seek(this.play.time)
- this.play.self.play()
- this.play.ing = true
- cb && cb()
- },
- getSeason(e) {
- // if (e === this.params.season) {
- // this.tyed = 0
- // } else {
- // this.tyed = 1
- // }
- let i = this.title_list.findIndex(item => item.season == e)
- this.title = this.title_list[i].name
- this.season = this.title_list[i].season
- this.getCourseList()
- },
- getSeasonList() {
- this.$ajax.get(`${GetSeason}`).then(([, {
- data: res
- }]) => {
- if (res.code === 200) {
- var arr = res.data
- arr.forEach((item, i) => {
- item.name = '第' + item.season + '届培训课程表'
- })
- this.title_list = arr
- this.title = this.title_list[0].name
- this.season = res.data[0].season
- uni.hideLoading()
- this.getCourseList()
- this.init()
- }
- })
- },
- titlePicker(e) {
- console.log(e.target.value)
- this.title = this.title_list[e.target.value].name
- this.season = this.title_list[e.target.value].season
- this.toPause()
- this.play.ing = false
- this.play.index = -1
- this.params.page = 1
- this.getCourseList()
- },
- audioTouch() {
- this.toPause()
- },
- mockend() {
- this.play.self.seek(212)
- },
- toBack() {
- if (this.detail.vis) {
- this.detail.time = 0
- this.detail.info = {}
- this.detail.vis = false
- if (!this.play.ing) { //暂停状态返回列表,显示悬浮窗
- this.saveData.params = this.params
- this.saveData.play = this.play
- uni.setStorageSync('saveData', this.saveData)
- this.img = this.saveData.data.teacher_img
- console.log(console.log('11存储的saveData1', uni.getStorageSync('saveData')))
- this.showfu = true
- }
- } else {
- // console.log(111,this.play.self)
- // uni.setStorageSync('floating', this.play)
- uni.navigateBack()
- }
- },
- init() {
- // this.play.self = uni.createInnerAudioContext()
- this.play.self = uni.getBackgroundAudioManager()
- },
- toPlay(src, title, cover_rul, cb) {
- this.play.ing ? this.play.self.pause() : null
- this.play.self = uni.getBackgroundAudioManager();
- this.play.self.title = title;
- this.play.self.coverImgUrl = cover_rul;
- this.play.self.src = encodeURI(src)
- this.play.ing = true
- wx.setInnerAudioOption({
- obeyMuteSwitch: false,
- success: function(e) {
- console.log('play success')
- },
- fail: function(e) {
- console.log(e)
- console.log('play fail')
- }
- })
- cb && cb()
- },
- toPause() {
- if (!this.play.ing) {
- return false
- }
- this.play.ing = false
- this.play.self.pause()
- },
- playAll() {
- if (this.courseList.length === 0) {
- uni.showModal({
- content: "没有可播放的课程",
- showCancel: false
- })
- return false
- }
- let _this = this
- if (this.play.ing) {
- if (this.play.all) {
- this.toPause()
- } else {
- if (this.play.index === -1) {
- this.toPause()
- } else {
- this.play.all = true
- }
- }
- return false
- }
- if (this.play.index === -1) {
- this.toPlay(this.courseList[0].course_link, this.courseList[0].title, this.courseList[0].cover_url,
- () => {
- this.play.all = true
- this.play.index = 0
- })
- } else {
- this.play.ing = true;
- this.play.self.play()
- }
- },
- // 列表里的暂停播放按钮
- playSelf(e, data, i) {
- this.saveData.data = data
- uni.removeStorageSync('saveData')
- this.showfu = false
- e.stopPropagation()
- if (this.play.ing && this.play.index === i) {
- this.toPause()
- return false
- }
- this.toPlay(data.course_link, data.title, data.cover_url, () => {
- console.log(1, this.play)
- this.play.index = i
- })
- },
- getCategoryLlist() {
- this.$u.get('/dwbs/business/category/select-options').then(res => {
- console.log(res)
- this.tabList = [{
- id: 0,
- name: '全部'
- }].concat(res.data)
- })
- },
- getCourseList() {
- this.$u.get('/dwbs/business/schools').then(res => {
- let data = res.data.data
- if (this.page > 1 && data.length == 0) {
- uni.showToast({
- title: '暂无更多',
- icon: 'none'
- })
- this.last = true
- } else {
- this.courseList = this.courseList.concat(data)
- }
- })
- },
- toPrev() {
- if (this.play.index === 0) {
- uni.showModal({
- content: "前面没有课程了",
- showCancel: false
- })
- return false
- }
- let _i = this.play.index - 1
- if (!this.courseList[_i].status) {
- uni.showModal({
- content: "上一个课程还未开始",
- showCancel: false
- })
- return false
- }
- this.play.time = 0
- this.toPlay(this.courseList[_i].course_link, this.courseList[_i].title, this.courseList[_i].cover_url,
- () => {
- this.play.index = _i
- })
- this.detail.info = Object.assign({}, this.courseList[_i])
- },
- toNext() {
- let max = this.courseList.length - 1
- if (this.play.index >= max) {
- uni.showModal({
- content: "后面没有课程了",
- showCancel: false
- })
- return false
- }
- let _i = this.play.index + 1
- if (!this.courseList[_i].status) {
- uni.showModal({
- content: "下一个课程还未开始",
- showCancel: false
- })
- return false
- }
- this.play.time = 0
- this.toPlay(this.courseList[_i].course_link, this.courseList[_i].title, this.courseList[_i].cover_url,
- () => {
- this.play.index = _i
- })
- this.detail.info = Object.assign({}, this.courseList[_i])
- },
- toInfo(data, i) {
- uni.removeStorageSync('saveData')
- console.log(uni.getStorageInfo('saveData'), '点击详情的save')
- console.log(data, 'data')
- this.saveData.data = data
- this.showfu = false
- if (!data.status) {
- uni.showModal({
- content: '课程还未开始',
- showCancel: false
- })
- return false
- }
- if (i !== this.play.index) {
- // this.play.self.src = data.course_link
- this.play.ing ? this.toPause() : null
- this.play.index = i
- this.play.time = 0
- this.play.self.seek(this.play.time)
- }
- this.detail.info = data
- this.detail.vis = true
- },
- moveAudioPlay({
- value
- }) {
- this.play.time = value
- this.play.self.seek(value)
- this.toPlay()
- },
- // 倒退15秒
- prevTime() {
- this.play.time = this.play.time > 15 ? this.play.time - 15 : 0
- this.play.self.seek(this.play.time)
- },
- // 快进15秒
- nextTime() {
- let max = Number(this.detail.info.course_length)
- this.play.time = this.play.time < max ? this.play.time + 15 : max
- this.play.self.seek(this.play.time)
- },
- // 播放详情里的 播放和暂停
- detailPlay() {
- if (this.play.ing) { // 暂停
- this.toPause()
- } else { // 播放
- const {
- title,
- cover_rul,
- course_link
- } = this.detail.info
- this.play.self = uni.getBackgroundAudioManager();
- this.play.self.title = title;
- this.play.self.coverImgUrl = cover_rul;
- this.play.self.src = course_link
- // this.play.self.play();
- this.play.ing = true;
- wx.setInnerAudioOption({
- obeyMuteSwitch: false,
- success: function(e) {
- console.log(e)
- console.log('play success')
- },
- fail: function(e) {
- console.log(e)
- console.log('play fail')
- }
- })
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- page {
- background-color: #f5f5f5;
- }
- .top {
- padding: 12px;
- background-color: #FFFFFF;
- }
- .search {
- background: #F9F9FB;
- height: 40px;
- line-height: 40px;
- border-radius: 20px;
- display: flex;
- align-items: center;
- padding: 0 12px;
- .search_icon {
- width: 24px;
- height: 24px;
- margin-right: 5px;
- }
- .s_input {
- flex: 1
- }
- .searh_btn {
- background: linear-gradient(91deg, #FF232C 0%, #FF571B 99%);
- border-radius: 20px;
- text-align: center;
- height: 32px;
- width: 66px;
- line-height: 32px;
- font-size: 14px;
- color: #FFFFFF;
- }
- }
- .showfu {
- width: 268rpx;
- height: 96rpx;
- background: #5B5B5B;
- box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.16);
- border-radius: 50rpx;
- position: fixed;
- right: 44rpx;
- bottom: 80rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- .imgBox {
- width: 96rpx;
- height: 96rpx;
- border: 6rpx solid #FFFFFF;
- border-radius: 50%;
- overflow: hidden;
- }
- }
- .select {
- margin-top: 20rpx;
- padding-left: 30rpx;
- font-size: 34rpx;
- }
- .noTip {
- padding: 20rpx;
- text-align: center;
- width: 100%;
- color: #999999;
- }
- $rotate: 0deg;
- .CoursePage {
- background-color: #FFFFFF;
- margin-top: 10px;
- border-radius: 10px 10px 0px 0px;
- @include page();
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- .CourseAudioDetail {
- @include page();
- position: fixed;
- height: 100%;
- bottom: 0;
- left: 0;
- right: 0;
- background-color: #FFFFFF;
- overflow: hidden;
- .CoursePlay {
- padding: 30rpx;
- width: 100%;
- box-sizing: border-box;
- display: flex;
- align-items: center;
- justify-content: flex-start;
- flex-direction: column;
- .PlayTitle {
- width: 100%;
- color: #333333;
- font-size: 40rpx;
- line-height: 60rpx;
- text-align: center;
- margin-bottom: 40rpx;
- }
- .PlayTeacher {
- color: #999999;
- font-size: 32rpx;
- line-height: 60rpx;
- text-align: center;
- margin-bottom: 40rpx;
- }
- .PlayCover {
- width: 496rpx;
- height: 496rpx;
- border-radius: 50%;
- background-color: #333333;
- padding: 26rpx;
- box-sizing: border-box;
- .CoverImg {
- display: block;
- width: 100%;
- height: 100%;
- border-radius: 50%;
- &.start {
- animation: rotate 10s 0s infinite linear;
- }
- &.paused {
- animation-play-state: paused;
- }
- }
- margin-bottom: 150rpx;
- }
- .AudioProgress {
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 50rpx;
- .Progress-right {
- color: #EA4A41;
- font-size: 24rpx;
- margin-left: 30px;
- }
- .Progress-left {
- flex: 1;
- min-width: 0;
- .Audio-slide {
- margin: 0;
- }
- }
- }
- .AudioControl {
- display: flex;
- align-items: center;
- justify-content: space-between;
- width: 100%;
- image {
- &:nth-of-type(1),
- &:nth-last-of-type(1) {
- width: 43rpx;
- height: 38rpx;
- }
- &:nth-of-type(2),
- &:nth-last-of-type(2) {
- width: 38rpx;
- height: 46rpx;
- }
- &:nth-of-type(3) {
- width: 124rpx;
- height: 124rpx;
- }
- }
- }
- }
- }
- .CourseScrollBody {
- width: 100%;
- flex: 1;
- overflow: hidden;
- position: relative;
- }
- }
- .CourseBody {
- width: 100%;
- padding: 0 30rpx 30rpx;
- box-sizing: border-box;
- .CourseWeek {
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 60rpx;
- .week {
- // width: 192rpx;
- padding: 0 30rpx;
- height: 68rpx;
- border-radius: 68rpx;
- text-align: center;
- line-height: 68rpx;
- background: #F8F8F8;
- color: #999999;
- font-size: 28rpx;
- &.active {
- color: #FFFFFF !important;
- background: linear-gradient(to right, #F97C55, #F44545) !important;
- }
- }
- }
- .CourseList {
- &-item {
- margin-bottom: 40rpx;
- background: #F6F6F6;
- border-radius: 5px;
- &:nth-last-of-type(1) {
- margin-bottom: 0;
- }
- .ItemTitle {
- color: #333333;
- font-size: 32rpx;
- line-height: 44rpx;
- margin-bottom: 30rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- &-status {
- height: 44rpx;
- line-height: 44rpx;
- width: 118rpx;
- border: 2rpx solid #999999;
- color: #999999;
- text-align: center;
- font-size: 28rpx;
- box-sizing: border-box;
- &.active {
- border-color: #EA4A41 !important;
- color: #EA4A41 !important;
- }
- }
- }
- .ItemInfo {
- width: 100%;
- display: flex;
- align-items: stretch;
- justify-content: space-between;
- .ItemInfo-teamcher {
- display: block;
- width: 180rpx;
- height: 234rpx;
- }
- .Info-right {
- flex: 1;
- overflow: hidden;
- margin-left: 16rpx;
- display: flex;
- justify-content: space-between;
- flex-direction: column;
- align-items: flex-start;
- padding-top: 4px;
- .Right-title {
- color: #333333;
- font-size: 32rpx;
- line-height: 44rpx;
- }
- .Right-teacher {
- color: #999999;
- font-size: 28rpx;
- line-height: 40rpx;
- }
- .Right-play {
- width: 422rpx;
- height: 60rpx;
- padding: 12rpx 14rpx;
- box-sizing: border-box;
- display: flex;
- align-items: center;
- background: linear-gradient(to right, #F97C55, #F44545);
- border-radius: 60rpx;
- margin-bottom: 22rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- &.no_open {
- background: #F8F8F8 !important;
- .Play-time {
- color: #999999 !important;
- }
- /deep/ .Wave-line {
- background: #999999 !important;
- }
- }
- .Play-icon {
- display: block;
- width: 36rpx;
- height: 36rpx;
- }
- .Play-time {
- color: #FFFFFF;
- font-size: 28rpx;
- }
- .Play-Sound {
- flex: 1;
- height: 100%;
- overflow: hidden;
- margin: 0 20rpx;
- }
- }
- }
- }
- }
- }
- }
- .SoundWave {
- width: 100%;
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: space-between;
- .Wave-line {
- width: 4rpx;
- background: #FFFFFF;
- border-radius: 4rpx;
- @for $i from 1 through 20 {
- &:nth-of-type(#{$i}) {
- height: #{random(40)}rpx;
- }
- }
- &.active {
- @for $i from 1 through 20 {
- &:nth-of-type(#{$i}) {
- animation: load 2.5s #{(random(10)*0.2)+ 1}s infinite linear;
- }
- }
- }
- }
- }
- @keyframes load {
- 0% {
- height: 100%;
- }
- 30% {
- height: 20%;
- }
- 60% {
- height: 60%;
- }
- 100% {
- height: 10%;
- }
- }
- @keyframes rotate {
- 100% {
- transform: rotate(360deg);
- }
- }
- </style>
|