提交 ade1ff50 authored 作者: GOD_ZYX's avatar GOD_ZYX

修改 所有内容 追加semester_id确保课程的唯一性

上级 bc21a074
const util = require('../utils/util.js') const util = require('../utils/util.js')
/**
* 本API中全部用于 音视频 播放相关接口
*/
/* 获取章节列表信息 */ /* 获取章节列表信息 */
// 测试 用 cur_course_id:6438232736871219200 cur_video_id:6290435412296990720 // 测试 用 cur_course_id:6438232736871219200 cur_video_id:6290435412296990720
const getChapterList = (cur_course_id, cur_video_id, callback) => { const getChapterList = (cur_course_id, cur_semester_id, cur_video_id, callback) => {
util.requestApi({ util.requestApi({
url: util.config.URL_PATH + '/tenant/v1/education/courses/' + cur_course_id, url: util.config.URL_PATH + '/tenant/v2/education/courses/' + cur_semester_id + '/' + cur_course_id,
callback: function (res) { callback: function (res) {
let i = 0, j = 0, nextVideo = {}, prevVideo = {}; let i = 0, j = 0, nextVideo = {}, prevVideo = {};
/* 计算上一章 和 下一章 */ /* 计算上一章 和 下一章 */
...@@ -51,10 +54,18 @@ const getChapterList = (cur_course_id, cur_video_id, callback) => { ...@@ -51,10 +54,18 @@ const getChapterList = (cur_course_id, cur_video_id, callback) => {
return { return {
title: _.name, title: _.name,
chapters: _.children.map(function (__, j) { chapters: _.children.map(function (__, j) {
let _homework = __.type == 3 && __.homework && __.homework.work_type == 1 && __.homework || ''
if (_homework) {
_homework.course_id = res.data.course_id
_homework.chapter_id = __.id
_homework.work_id = __.resource_id
_homework.semester_id = res.data.semester_id
}
return { return {
id: __.resource_id, id: __.resource_id,
time: __.video && util.durationToTimeString(__.video.video_length) || '', time: __.video && util.durationToTimeString(__.video.video_length) || '',
name: __.name name: __.name,
homework: _homework
} }
}) })
} }
...@@ -69,7 +80,7 @@ const getChapterList = (cur_course_id, cur_video_id, callback) => { ...@@ -69,7 +80,7 @@ const getChapterList = (cur_course_id, cur_video_id, callback) => {
/* 获取对应某个章节的详细信息 */ /* 获取对应某个章节的详细信息 */
const getCurrentChapterDetail = (vid, callback) => { const getCurrentChapterDetail = (vid, callback) => {
util.requestApi({ util.requestApi({
url: util.config.URL_PATH + '/tenant/v1/education/video-streaming', url: util.config.URL_PATH + '/tenant/v2/education/video-streaming',
method: 'POST', method: 'POST',
data: { data: {
vid: vid vid: vid
...@@ -97,9 +108,9 @@ const getCurrentChapterDetail = (vid, callback) => { ...@@ -97,9 +108,9 @@ const getCurrentChapterDetail = (vid, callback) => {
} }
/* 获取进度信息 */ /* 获取进度信息 */
// 测试 用 device_id : jjhz92fn0.le2a6c06c9g0.thhg7ekb1f8 // 测试 用 device_id : jjhz92fn0.le2a6c06c9g0.thhg7ekb1f8
const getProgress = (vid, did, callback) => { const getProgress = (vid, did, sid, callback) => {
util.requestApi({ util.requestApi({
url: util.config.URL_PATH + '/tenant/v1/education/video/' + vid + '/device', url: util.config.URL_PATH + '/tenant/v2/education/video/' + sid + '/' + vid + '/device',
data: { data: {
device_id: did device_id: did
}, },
...@@ -111,11 +122,12 @@ const getProgress = (vid, did, callback) => { ...@@ -111,11 +122,12 @@ const getProgress = (vid, did, callback) => {
/* 提交进度信息 */ /* 提交进度信息 */
const updateProgress = (obj) => { const updateProgress = (obj) => {
util.requestApi({ util.requestApi({
url: util.config.URL_PATH + '/tenant/v1/analytics/upload-video', url: util.config.URL_PATH + '/tenant/v2/analytics/upload-video',
data: { data: {
d: obj.did, d: obj.did,
i: obj.did, i: obj.did,
c: obj.cid, c: obj.cid,
s: obj.sid,
v: obj.vid, v: obj.vid,
_p: obj.pt, // 累计时间 _p: obj.pt, // 累计时间
_m: obj.mpt, // 当前播放最大时间 _m: obj.mpt, // 当前播放最大时间
......
const util = require('../utils/util.js')
/**
* 本API中全部用于 选课、我的课程、课程详情、讨论 相关接口
*/
/* 获取学期分类信息 */
const getlearnFindList = (callback) => {
util.requestApi({
url: util.config.URL_PATH + '/tenant/v2/education/semesters',
callback: function (res) {
let json = [{ val: '-1', name: '全部' }]
for (let i = 0; i < res.data.length; i++) {
let _list = res.data
json.push({
val: _list[i].id,
name: _list[i].semester_name
})
}
callback(json)
}
})
}
/* 获取所有课程列表 - 选课广场 和 我的课程 共用同一个,通过 isMy判断 */
const getCourseList = (isMy, param, callback) => {
util.requestApi({
url: util.config.URL_PATH + '/tenant/v2/education/courses' + (isMy ? '/my' : '' ),
data: param, // json格式
callback: function (res) {
let json = [];
for(let i = 0; i < res.data.length; i++) {
let cur = res.data[i], _cur = res.data[i].curriculum
/* 课程类型 */
let _type = _cur.curriculum_elective_type, str1 = _type == 1 ? '必修课' : (_type == 2 ? '选修课' : (_type == 3 ? '重修课' : ''))
json.push({
id: cur.course_id,
sid: cur.semester_id,
src: _cur && _cur.curriculum_picture || '../icons/home/default.jpg',
title: cur.course_name,
arrTab: [((_cur && _cur.curriculum_credit || 0) + '学分'), str1, cur.semester_name],
status: _cur.is_enabled ? '已发布' : '未发布',
time: cur.begin_date.split(' ')[0] + ' 至 ' + cur.end_date.split(' ')[0],
myStatus: cur.selected != 0 ? (cur.score ? ('总成绩:' + cur.score) : '已选修') : '未选修',
progress: cur.course_progress + '%'
})
}
callback(json)
}
})
}
/* 获取某个课程详细信息 - 课程考核 和 课程讨论单独获取 */
const getCourseDetail = (id, sid, callback) => {
util.requestApi({
url: util.config.URL_PATH + '/tenant/v2/education/courses/' + sid + '/' + id,
callback: function (res) {
let cur = res.data, _cur = cur.curriculum
/* 课程类型 */
let _type = _cur.curriculum_elective_type, str1 = _type == 1 ? '必修课' : (_type == 2 ? '选修课' : (_type == 3 ? '重修课' : ''))
let json = {
headerInfo: {
isStart: !!cur.selected, // 是否为开始学习按钮 或者 选课按钮
id: cur.course_id,
sid: cur.semester_id,
bgSrc: _cur && _cur.curriculum_picture || '../icons/home/default.jpg',
title: cur.course_name,
arrTab: [((_cur && _cur.curriculum_credit || 0) + '学分'), str1, cur.semester_name],
status: _cur.is_enabled ? '已发布' : '未发布',
time: cur.begin_date.split(' ')[0] + ' 至 ' + cur.end_date.split(' ')[0],
progress: cur.course_progress + '%'
},
tabs0Content: {},
tabs1ChapterList: {}
}
/* 课程简介 */
json.tabs0Content = {
text: _cur && _cur.curriculum_represent,
teachers: []
}
for (let i = 0; i < cur.lecturers.length; i++) {
let item = cur.lecturers[i]
json.tabs0Content.teachers.push({
src: item.lecturer_avatar,
name: item.lecturer_name,
edu: item.lecturer_education || '',
job: item.lecturer_office || '',
unit: item.lecturer_title || ''
})
}
/* 课程内容 */
json.tabs1ChapterList = {
currentChapterId: cur.latest_play || '',
course: cur.chapters.map(function (_, i) {
return {
title: _.name,
isUp: true,
chapters: _.children.map(function (__, j) {
let _homework = __.type == 3 && __.homework && __.homework.work_type == 1 && __.homework || ''
if (_homework) {
_homework.course_id = res.data.course_id
_homework.chapter_id = __.id
_homework.work_id = __.resource_id
_homework.semester_id = res.data.semester_id
}
return {
cid: cur.course_id,
sid: cur.semester_id,
vid: __.resource_id,
time: __.video && util.durationToTimeString(__.video.video_length) || '',
name: __.name,
homework: _homework
}
})
}
})
}
json.tabs1ChapterList.course.push({
title: '课程大作业',
isUp: true,
chapters: []
})
json.tabs1ChapterList.course.push({
title: '课程资料',
isUp: true,
chapters: []
})
callback(json)
}
})
}
/* 获取课程考核信息 */
const getCourseAssess = (cid, sid, callback) => {
util.requestApi({
url: util.config.URL_PATH + '/tenant/v2/analytics/courses/' + sid + '/' + cid + '/evaluation',
callback: function (res) {
let cur = res.data
let video = [];
for (let i in cur.video_evaluation) {
let _ = cur.video_evaluation[i]
let tempArr = []
for (let j in _.sections) {
let __ = _.sections[j]
tempArr.push({
name: __.title,
time: __.duration && util.durationToTimeString(__.duration) || '00:00',
progress: __.progress && (__.progress + '%') || '0%'
})
}
video.push({
title: _.title,
arr: tempArr
})
}
let homewrok = [];
for (let i in cur.homework_evaluation) {
let _ = cur.homework_evaluation[i]
let tempArr = []
for (let j in _.sections) {
let __ = _.sections[j]
tempArr.push({
name: __.title,
score: __.score || '0'
})
}
homewrok.push({
title: _.title,
arr: tempArr
})
}
let json = {
score: cur.course_score,
duration: util.durationToTimeString(cur.course_duration || 0),
progress: cur.course_progress,
video: video,
homewrok: homewrok,
essay: {
status: cur.essay_evaluation.status || '暂无',
score: cur.essay_evaluation.score || '暂无'
}
}
callback(json)
}
})
}
/* 获取试题信息 */
const getExamDetail = (eid, sid, callback) => {
util.requestApi({
url: util.config.URL_PATH + '/tenant/v2/education/homeworks/' + sid + '/' + eid,
callback: function (res) {
callback(res)
}
})
}
/* 提交考试信息 */
const submitExamDetail = (param, callback) => {
util.requestApi({
url: util.config.URL_PATH + '/tenant/v2/education/homeworks',
method: 'POST',
data: param,
callback: function (res) {
callback(res)
}
})
}
/* 选课 */
const selectCourse = (cid, sid, callback) => {
util.requestApi({
url: util.config.URL_PATH + '/tenant/v2/education/courses/major',
data: { course_id: cid, semester_id: sid },
method: 'POST',
callback: function (res) {
callback(res)
}
})
}
/* 退课 */
const outSelectCourse = (cid, sid, callback) => {
util.requestApi({
url: util.config.URL_PATH + '/tenant/v2/education/courses/drop',
data: { course_id: cid, semester_id: sid },
method: 'POST',
callback: function (res) {
callback(res)
}
})
}
module.exports = {
getlearnFindList: getlearnFindList,
getCourseList: getCourseList,
getCourseDetail: getCourseDetail,
getCourseAssess: getCourseAssess,
getExamDetail: getExamDetail,
submitExamDetail: submitExamDetail,
selectCourse: selectCourse,
outSelectCourse: outSelectCourse
}
\ No newline at end of file
const util = require('../utils/util.js')
/**
* 本API中全部用于 讨论 相关接口
*/
/* 获取讨论题目列表,“我提出的问题”和“我参与的问题”信息 */
/**
* dataJson.limit - 获取数量
* dataJson.offset - 偏移量
*/
const getDiscussList = (path, dataJson, callback) => {
util.requestApi({
url: util.config.URL_PATH + '/tenant/v2/qa/questions' + path,
data: dataJson,
callback: function (res) {
let _data = res.data
let json = _data.map(function (_, i) {
return {
id: _.id,
sid: _.semester_id,
user: {
url: _.questioner.avatar || '../icons/my/default.jpg',
name: _.questioner.nickname,
time: _.created_time
},
title: _.title,
text: _.contents,
askCnt: _.answer_count,
TouCnt: _.tag_total_count,
courseName: '在线学习课程',
comments: _.comments,
mine: _.mine
}
})
callback(json)
}
})
}
/* 获取讨论题目列表,“课程的问题”信息 */
/**
* dataJson.limit - 获取数量
* dataJson.offset - 偏移量
* dataJson.sort - 排序类型
*/
const getCourseDiscussList = (cid, sid, dataJson, callback) => {
util.requestApi({
url: util.config.URL_PATH + '/tenant/v2/qa/questions/course/' + sid + '/' + cid,
data: dataJson,
callback: function (res) {
let _data = res.data
let json = _data.map(function (_, i) {
return {
id: _.id,
sid: _.semester_id,
user: {
url: _.questioner.avatar || './icons/default.jpg',
name: _.questioner.nickname,
time: _.created_time
},
title: _.title,
text: _.contents,
askCnt: _.answer_count,
TouCnt: _.tag_total_count,
courseName: '在线学习课程',
comments: _.comments,
mine: _.mine
}
})
callback(json)
}
})
}
/* 获取问题详情 */
const getDiscussDetail = (qid, callback) => {
util.requestApi({
url: util.config.URL_PATH + '/tenant/v2/qa/questions/' + qid,
callback: function (res) {
let _data = res.data
let json = {
ques: {
qid: _data.id,
sid: _data.semester_id,
user: {
url: _data.questioner.avatar || './icons/default.jpg',
name: _data.questioner.nickname,
time: _data.created_time
},
title: _data.title,
text: _data.contents,
askCnt: _data.answer_count || 0,
TouCnt: _data.tag_total_count || 0,
likeCnt: _data.tag_count || 0,
comCnt: _data.comments.length,
mine: _data.mine,
isShowComment: false,
has_tag: _data.has_tag,
tag_id: _data.tag && _data.tag.id || '',
comments: _data.comments.map(function (_, i) {
return {
cid: _.id,
user: {
url: _.observer.avatar || './icons/default.jpg',
name: _.observer.nickname,
time: _.created_time
},
text: _.comments,
mine: _.mine
}
})
},
answer: _data.answers && _data.answers.map(function (_, i) {
return {
aid: _.id,
user: {
url: _.replier.avatar || './icons/default.jpg',
name: _.replier.nickname,
time: _.created_time
},
text: _.contents,
likeCnt: _.tag_count,
comCnt: _.comments.length,
mine: _.mine,
isShowComment: false,
has_tag: _.has_tag,
tag_id: _.tag && _.tag.id || '',
comments: _.comments.map(function (__, i) {
return {
cid: __.id,
user: {
url: __.observer.avatar || './icons/default.jpg',
name: __.observer.nickname,
time: __.created_time
},
text: __.comments,
mine: __.mine
}
})
}
}) || []
}
callback(json)
}
})
}
/* 删除提问 */
const deleteDiscuss = (qid, callback) => {
util.requestApi({
url: util.config.URL_PATH + '/tenant/v2/qa/questions/' + qid,
method: 'DELETE',
callback: function (res) {
let _data = res.data
if (_data.success) {
callback(res)
}
}
})
}
/* 提出问题 */
const publishQues = (param, callback) => {
util.requestApi({
url: util.config.URL_PATH + '/tenant/v2/qa/questions',
method: 'POST',
data: param,
callback: function (res) {
let _data = res.data
callback(res)
}
})
}
/* 回答问题 */
const answerQues = (param, callback) => {
util.requestApi({
url: util.config.URL_PATH + '/tenant/v2/qa/answers',
method: 'POST',
data: param,
callback: function (res) {
let _data = res.data
if (_data.success) {
callback(res)
}
}
})
}
/* 删除回答 */
const deleteAnswer = (aid, callback) => {
util.requestApi({
url: util.config.URL_PATH + '/tenant/v2/qa/answers/' + aid,
method: 'DELETE',
callback: function (res) {
let _data = res.data
if (_data.success) {
callback(res)
}
}
})
}
/* 回复评论 */
const callbackComment = (param, callback) => {
util.requestApi({
url: util.config.URL_PATH + '/tenant/v2/qa/comments',
method: 'POST',
data: param,
callback: function (res) {
let _data = res.data
if (_data.success) {
callback(res)
}
}
})
}
/* 删除评论 */
const deleteComment = (cid, callback) => {
util.requestApi({
url: util.config.URL_PATH + '/tenant/v2/qa/comments/' + cid,
method: 'DELETE',
callback: function (res) {
let _data = res.data
if (_data.success) {
callback(res)
}
}
})
}
/* 点赞 */
const like = (param, callback) => {
util.requestApi({
url: util.config.URL_PATH + '/tenant/v2/qa/tags',
method: 'POST',
data: param,
callback: function (res) {
let _data = res.data
if (_data.success) {
callback(res)
}
}
})
}
/* 取消点赞 */
const unlike = (tagid, callback) => {
util.requestApi({
url: util.config.URL_PATH + '/tenant/v2/qa/tags/' + tagid,
method: 'DELETE',
callback: function (res) {
let _data = res.data
if (_data.success) {
callback(res)
}
}
})
}
module.exports = {
getDiscussList: getDiscussList,
getCourseDiscussList: getCourseDiscussList,
getDiscussDetail: getDiscussDetail,
publishQues: publishQues,
deleteDiscuss: deleteDiscuss,
callbackComment: callbackComment,
deleteComment: deleteComment,
answerQues: answerQues,
deleteAnswer: deleteAnswer,
like: like,
unlike: unlike
}
\ No newline at end of file
const util = require('../utils/util.js')
/**
* 本API中全部用于 消息 相关接口
*/
/* 获取我的学分信息 */
const getMyMsg = (callback) => {
util.requestApi({
url: util.config.URL_PATH + '/tenant/v2/education/message/my',
callback: function (res) {
let json = res.data.map(function (_, i) {
return {
isRead: false,
id: _.id,
text: _.message,
time: _.created_time,
isShow: false // 该字段用来做 每条信息的打开、关闭
}
})
callback(json)
}
})
}
module.exports = {
getMyMsg: getMyMsg
}
\ No newline at end of file
const util = require('../utils/util.js')
/**
* 本API中全部用于 我的学分等 相关接口
*/
/* 获取我的学分信息 */
const getMyScore = (callback) => {
util.requestApi({
url: util.config.URL_PATH + '/tenant/v2/education/credits',
callback: function (res) {
let _data = res.data
let json = {
total: _data.total_credits,
myTotal: _data.my_total_credits,
myTotalStr: _data.total_credits && ((_data.my_total_credits * 1.0 / _data.total_credits * 100).toFixed(1) + '%') || '0%',
must: _data.required_credits,
myMust: _data.my_required_credits,
myMustStr: _data.required_credits && ((_data.my_required_credits * 1.0 / _data.required_credits * 100).toFixed(1) + '%') || '0%',
unmust: _data.optional_credits,
myUnmust: _data.my_optional_credits,
myUnmustStr: _data.optional_credits && ((_data.my_optional_credits * 1.0 / _data.optional_credits * 100).toFixed(1) + '%') || '0%'
}
callback(json)
}
})
}
module.exports = {
getMyScore: getMyScore
}
\ No newline at end of file
差异被折叠。
//app.js //app.js
App({ App({
onLaunch: function () {} onLaunch: function () {
wx.showLoading({ title: '页面启动中...', mask: true });
// wx.redirectTo({ url: '/pages/index/index' });
}
}) })
\ No newline at end of file
{ {
"pages": [ "pages": [
"pages/outSite/outSite",
"pages/index/index", "pages/index/index",
"pages/outSite/outSite",
"pages/videoPlayer/show", "pages/videoPlayer/show",
"pages/learnSystem/home/home", "pages/learnSystem/home/home",
"pages/learnSystem/courseSquare/courseSquare",
"pages/learnSystem/courseContent/courseContent",
"pages/learnSystem/courseContent/courseDiscuss/courseDiscuss",
"pages/learnSystem/courseContent/publishDiscuss/publishDiscuss",
"pages/learnSystem/courseContent/examDetail/examDetail",
"pages/learnSystem/message/message", "pages/learnSystem/message/message",
"pages/learnSystem/my/my", "pages/learnSystem/my/my",
"pages/learnSystem/myScore/myScore",
"pages/learnSystem/myDiscuss/myDiscuss",
"pages/learnSystem/discussDetail/discussDetail",
"pages/videoPlayer/AllBugPages/bugPage1/bugPage1", "pages/videoPlayer/AllBugPages/bugPage1/bugPage1",
"pages/videoPlayer/AllBugPages/test" "pages/videoPlayer/AllBugPages/test"
], ],
"window": { "window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff", "navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "WeChat", "navigationBarTextStyle": "black",
"navigationBarTextStyle": "black" "navigationBarTitleText": "MBA学习系统"
}, },
"tabBar": { "tabBar": {
"borderStyle": "#dcdcdc", "borderStyle": "#dcdcdc",
......
learnOnline/pages/index/icons/bg.png

54.4 KB | W: | H:

learnOnline/pages/index/icons/bg.png

43.6 KB | W: | H:

learnOnline/pages/index/icons/bg.png
learnOnline/pages/index/icons/bg.png
learnOnline/pages/index/icons/bg.png
learnOnline/pages/index/icons/bg.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -14,18 +14,18 @@ Page({ ...@@ -14,18 +14,18 @@ Page({
bindphone: { isShow: '', getCode: true, countDown: 60, phone: '', code: '' } bindphone: { isShow: '', getCode: true, countDown: 60, phone: '', code: '' }
}, },
goOutSite: function () { goOutSite: function () {
wx.navigateTo({ // wx.navigateTo({
url: '/pages/outSite/outSite' // url: '/pages/outSite/outSite'
})
// wx.switchTab({
// url: '/pages/learnSystem/home/home'
// }) // })
wx.switchTab({
url: '/pages/learnSystem/home/home'
})
}, },
/* 进入页面,先判断是否获取用户信息 */ /* 进入页面,先判断是否获取用户信息 */
onReady: function () {}, onReady: function () { wx.hideLoading() },
// e.detail.userInfo, // e.detail.userInfo,
/* 按键授权,微信新版 - 获取用户信息 - 授权方式 */ /* 按键授权,微信新版 - 获取用户信息 - 授权方式 */
getUserInfo: function (e) { this.getInfo(); }, getUserInfo: function (e) { this.getInfo() },
/* 获取用户信息 并 判别是否跟紫荆账号绑定 */ /* 获取用户信息 并 判别是否跟紫荆账号绑定 */
getInfo: function () { getInfo: function () {
wx.showLoading({ title: '信息获取中...', mask: true }) wx.showLoading({ title: '信息获取中...', mask: true })
......
<template name='courseAssess'>
<view class='course-assess'>
<view class='title'>最终成绩:{{item.assess.score && (item.assess.score + '分') || '暂无'}}</view>
<view class='topic'>
<view class='line'></view>
<view class='tit'>课程考核标准</view>
</view>
<view class='detail'>
<view class='h1'>一、最终成绩计算</view>
<view class='p'>课程表现得分*30%+每章试题得分*30%+结业大作业得分*40%=该门课程总得分,满分100分,低于60分为不及格,需重修此门课程。</view>
<image class='b1' src='../icons/courseContent/b1.png' mode='aspectFill'></image>
<view class='h1'>二、具体细则</view>
<view class='h2'>课程表现:总分100分(占科目总成绩的30%)</view>
<view class='p'>1、每个视频观看完成度50分:以后台数据统计为准,全部看完视频满分50分,其它酌情给分。</view>
<view class='em'>注:视频观看考核的是实际播放时长,不是进度条的显示状态,进度条满格并不一定表示观看完这个视频。以下方每日学习时长为准。</view>
<view class='p'>2、课程讨论及反馈建设性问题50分:课程讨论以后台数据为准,反馈问题以教务老师问题统计为准,满分50分,酌情给分。</view>
<view class='h2'>每章试题:总分100分(占科目总成绩的30%)</view>
<view class='p'>本课程所有试题的平均正确率*100分*占总成绩30%=此项得分。(比如正确度为80%,则此项得分:80%*100*30%=24分)</view>
<view class='h2'>结业大作业:总分100分(占科目总成绩的40%)</view>
<view class='p'>结业大作业满分为100分,以助教老师给分为准。</view>
</view>
<view class='topic'>
<view class='line'></view>
<view class='tit'>学习进度及成绩</view>
</view>
<view class='table-title'>课程“音视频”观看统计( 累计学习时长:{{item.assess.duration}},完成率:{{item.assess.progress}} )</view>
<view class='table'>
<view class='th'>
<view class='col3-td1'>章节</view>
<view class='col3-td2'>学习时长</view>
<view class='col3-td3'>百分比</view>
</view>
<block wx:for='{{item.assess.video}}' wx:key='{{index}}' wx:for-item='item1'>
<view class='tb'>
<view class='tt'>{{item1.title}}</view>
<block wx:for='{{item1.arr}}' wx:key='{{index}}' wx:for-item='item2'>
<view class='rd'>
<view class='col3-td1'>{{item2.name}}</view>
<view class='col3-td2'>{{item2.time}}</view>
<view class='col3-td3'>{{item2.progress}}</view>
</view>
</block>
</view>
</block>
<block wx:if='{{!item.assess.video.length}}'>
<view style='width: 100%; font-size: 30rpx; margin: 40rpx auto 10rpx auto; text-align: center;'>暂无数据</view>
</block>
</view>
<view class='table-title'>试题及主观题</view>
<view class='table'>
<view class='th'>
<view class='col2-td1'>章节</view>
<view class='col2-td2'>得分</view>
</view>
<block wx:for='{{item.assess.homewrok}}' wx:key='{{index}}' wx:for-item='item1'>
<view class='tb'>
<view class='tt'>{{item1.title}}</view>
<block wx:for='{{item1.arr}}' wx:key='{{index}}' wx:for-item='item2'>
<view class='rd'>
<view class='col2-td1'>{{item2.name}}</view>
<view class='col2-td2'>{{item2.score}}</view>
</view>
</block>
</view>
</block>
<block wx:if='{{!item.assess.homewrok.length}}'>
<view style='width: 100%; font-size: 30rpx; margin: 40rpx auto 10rpx auto; text-align: center;'>暂无数据</view>
</block>
</view>
<view class='table-title'>大作业</view>
<view class='status-text'>状 态:{{item.assess.essay.status}}</view>
<view class='status-text'>得 分:{{item.assess.essay.score}}</view>
</view>
</template>
\ No newline at end of file
.course-assess { margin-bottom: 100rpx; overflow: hidden; }
.course-assess .title { color: #313131; font-size: 32rpx; margin: 70rpx auto 50rpx auto; text-align: center; }
.course-assess .topic { position: relative; width: 100%; height: 50rpx; overflow: hidden; }
.course-assess .topic .line { width: 300rpx; height: 1rpx; margin: 24rpx auto 0 auto; background: #313131; }
.course-assess .topic .tit { position: absolute; top: 50%; left: 50%; padding: 10rpx 22rpx; font-size: 28rpx; font-weight: 700; color: #313131; background: #fff; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); }
.course-assess .detail { margin-bottom: 110rpx; padding: 0 26rpx; }
.course-assess .detail .b1 { display: block; margin: 50rpx auto; width: 635rpx; height: 283rpx; }
.course-assess .detail .h1 { font-size: 28rpx; font-weight: 700; color: #313131; line-height: 68rpx; }
.course-assess .detail .h2 { font-size: 26rpx; font-weight: 700; color: #313131; line-height: 60rpx; }
.course-assess .detail .p { font-size: 26rpx; color: #313131; line-height: 40rpx; text-align: justify; }
.course-assess .detail .em { font-size: 24rpx; color: #b49441; line-height: 34rpx; text-align: justify; }
/* 统计表格 */
.course-assess .table-title { font-size: 30rpx; font-weight: 700; margin: 40rpx 26rpx 20rpx 26rpx; text-align: justify; color: #b49441; }
.course-assess .table { color: #313131; padding-bottom: 30rpx; border-bottom: 2rpx solid #c9c9c9; }
.course-assess .table .col3-td1 { float: left; padding-left: 15rpx; width: 449rpx; text-align: left; box-sizing: border-box; -webkit-box-sizing: border-box; }
.course-assess .table .col3-td2 { float: left; width: 140rpx; text-align: center; }
.course-assess .table .col3-td3 { float: left; width: 94rpx; text-align: right; box-sizing: border-box; -webkit-box-sizing: border-box; }
.course-assess .table .col2-td1 { float: left; padding-left: 15rpx; width: 589rpx; text-align: left; box-sizing: border-box; -webkit-box-sizing: border-box; }
.course-assess .table .col2-td2 { float: left; width: 94rpx; text-align: right; box-sizing: border-box; -webkit-box-sizing: border-box; }
.course-assess .table .th { padding: 0 26rpx; font-size: 28rpx; overflow: hidden; border-bottom: 2rpx solid #e5e5e5; line-height: 58rpx; font-weight: 700; }
.course-assess .table .tb { padding: 0 26rpx; font-size: 26rpx; overflow: hidden; }
.course-assess .table .tb .tt { padding: 30rpx 0 8rpx 0; line-height: 36rpx; font-weight: 700; }
.course-assess .table .tb .rd { overflow: hidden; /* border-bottom: 1rpx solid #e5e5e5; */ line-height: 40rpx; /* padding: 10rpx 0; */ }
/* .course-assess .table .tb .rd:last-child { border-bottom: none; } */
.course-assess .status-text { padding-left: 26rpx; font-size: 24rpx; color: #000000; line-height: 36rpx; }
\ No newline at end of file
// pages/learnSystem/courseContent/courseContent.js
const CourseApi = require('../../../apiService/CourseApi.js')
Page({
/**
* 页面的初始数据
*/
data: {
headerInfo: {
id: '',
sid: '',
bgSrc: '../icons/home/default.jpg',
title: '这里是一条长的标题不要超过25个汉字标题不要超过个汉字25个汉字',
time: '2016-09-10至2017-01-10',
status: '已发布',
arrTab: ['3学分', '必修课', '第一学期'],
isStart: true, // 是否为开始学习按钮 或者 选课按钮
progress: '50%'
},
tabs: [{
title: '课程简介',
isShow: true,
content: {
text: '<p><b>组织心理学</b>是研究组织中人的心理与行为规律的一门科学,是心理学的一个重要分支,也是心理学在管理学方面的一个交叉应用学科。<b>组织心理学</b>通过探讨个体、群体以及结构对组织,<b>组织心理学</b>是研究组织中人的心理与行为规律的一门科学,是心理学的一个重要分支,也是心理学在管理学方面的一个交叉应用学科。<b>组织心理学</b>通过探讨个体、群体以及结构对组织。<p><p><b>组织心理学</b>是研究组织中人的心理与行为规律的一门科学,是心理学的一个重要分支,也是心理学在管理学方面的一个交叉应用学科。<b>组织心理学</b>通过探讨个体、群体以及结构对组织。</p>',
teachers: [{
src: '',
name: '讲师姓名',
edu: '学历',
job: '职称',
unit: '讲师所在单位'
}, {
src: '',
name: '讲师姓名',
edu: '学历',
job: '职称',
unit: '讲师所在单位'
}]
}
}, {
title: '课程内容',
isShow: false,
chapterList: {
currentChapterId: '11', // 当前章节id
course: [{
title: '第一章:重要概念',
isUp: true,
chapters: [
{ id: '11', time: '28:18', name: '1.1 现值(PV)和终值(FV)' },
{ id: '12', time: '19:09', name: '1.2 净现值(NPV)及实际收益率' }
]
}, {
title: '第二章:证券估值',
isUp: true,
chapters: [
{ id: '21', time: '27:49', name: '2.1 债券和股票的现金流贴现估值方法' },
{ id: '22', time: '16:04', name: '2.2 债券评级及债券协议' },
{ id: '23', time: '', name: '公司金融第二周测验' },
{ id: '24', time: '', name: '公司金融第二周作业' }
]
}, {
title: '课程大作业',
isUp: true,
chapters: []
}, {
title: '课程资料',
isUp: true,
chapters: []
}]
}
}, {
title: '课程讨论',
isShow: false,
}, {
title: '课程考核',
isShow: false,
assess: {
score: '20',
duration: '00:01:20',
progress: '0/10',
video: [{
title: '第一章 市场营销原理导论',
arr: [{
name: '1.1 什么是市场营销什么是市场营销市场营销什么是市场营销什么是市场营销',
time: '12:08',
progress: '100%'
}]
}],
homewrok: [{
title: '第一章 市场营销原理导论',
arr: [{
name: '1.1 什么是市场营销什么是市场营销市场营销什么是市场营销什么是市场营销',
score: 20
}]
}],
essay: {
status: '未提交',
score: '暂无'
}
}
}]
},
cid: '',
sid: '',
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.showLoading({ title: '页面加载中...', mask: true })
this.cid = options.id
this.sid = options.sid
CourseApi.getCourseDetail(this.cid, this.sid, (json) => {
this.setData({ 'headerInfo': json.headerInfo })
this.setData({ 'tabs[0].content': json.tabs0Content })
this.setData({ 'tabs[1].chapterList': json.tabs1ChapterList })
CourseApi.getCourseAssess(this.cid, this.sid, (json1) => {
this.setData({ 'tabs[3].assess': json1 })
wx.hideLoading()
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
// 显示顶部刷新图标
wx.showNavigationBarLoading();
wx.showLoading({ title: '更新中...', mask: true })
CourseApi.getCourseDetail(this.cid, this.sid, (json) => {
this.setData({ 'headerInfo': json.headerInfo })
this.setData({ 'tabs[0].content': json.tabs0Content })
this.setData({ 'tabs[1].chapterList': json.tabs1ChapterList })
CourseApi.getCourseAssess(this.cid, this.sid, (json1) => {
this.setData({ 'tabs[3].assess': json1 })
wx.hideLoading()
// 隐藏导航栏加载框
wx.hideNavigationBarLoading()
// 停止下拉动作
wx.stopPullDownRefresh()
})
})
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
/**
* 选课
*/
wantThisCourse: function (e) {
let cid = e.currentTarget.dataset.cid
let sid = e.currentTarget.dataset.sid
wx.showLoading({ title: '请求中...', mask: true })
CourseApi.selectCourse(cid, sid, (json) => {
this.setData({ 'headerInfo.isStart': true })
wx.hideLoading()
wx.showToast({ title: '选课成功', icon: 'none', duration: 1500 })
})
},
/**
* 退课 - 隐藏功能,点击 标题15次,进行退课
*/
passCount: 0,
noWantThisCourse: function (e) {
if (this.passCount < 15) { this.passCount ++; return ; }
let cid = e.currentTarget.dataset.cid
let sid = e.currentTarget.dataset.sid
wx.showLoading({ title: '请求中...', mask: true })
CourseApi.outSelectCourse(cid, sid, (json) => {
this.setData({ 'headerInfo.isStart': false })
wx.hideLoading()
wx.showToast({ title: '退课成功', icon: 'none', duration: 1500 })
this.passCount = 0
})
},
/**
* 开始学习或继续学习 - 跳转到对应音视频播放页
*/
startLearn: function (e) {
let _data = e.target.dataset
let cid = _data.cid, sid = _data.sid, vid = _data.vid
wx.navigateTo({
url: '/pages/videoPlayer/show' + '?cid=' + cid + '&sid=' + sid + '&vid=' + vid
})
},
/**
* 跳转到对应音视频播放页
*/
jumpToOtherVA: function (e) {
/* 如果未选课,不能查看课程内容 */
if (!this.data.headerInfo.isStart) { wx.showToast({ title: '先选课,才能看', icon: 'none', duration: 1500 }); return ; }
let _data = e.target.dataset
let cid = _data.cid, sid = _data.sid, vid = _data.vid
if (!_data.hasva) {
/* 如果存在 - 课后习题类型, type:3、work_type:1 */
let i1 = _data.index, i2 = _data.index1
let _course = this.data.tabs[1].chapterList.course[i1]
if (_course && _course.chapters[i2] && _course.chapters[i2].homework) {
let _hw = _course.chapters[i2].homework
wx.setStorageSync('_homework', _hw)
wx.navigateTo({
url: '/pages/learnSystem/courseContent/examDetail/examDetail'
})
return ;
}
wx.showToast({ title: '请在PC上使用该功能', icon: 'none' }); return ;
}
wx.navigateTo({
url: '/pages/videoPlayer/show' + '?cid=' + cid + '&sid=' + sid + '&vid=' + vid
})
},
/**
* 切换 - tab
*/
tabSelect: function (e) {
let index = e.currentTarget.dataset.index
if (index == 2) {
wx.navigateTo({
url: '/pages/learnSystem/courseContent/courseDiscuss/courseDiscuss?cid=' + e.currentTarget.dataset.cid + '&sid=' + e.currentTarget.dataset.sid
})
return
}
let json = this.data.tabs
for(let i = 0; i < json.length; i++) {
json[i].isShow = false
}
json[index].isShow = true
this.setData({ 'tabs': json })
},
/**
* 课程内容 - 列表展开或者跳转
*/
clickJumpOrStatus: function (e) {
let data = e.currentTarget.dataset;
let flag = data.status;
if (flag) {
let index = data.index;
let json = this.data.tabs;
let temp = json[1].chapterList.course[index];
temp.isUp = !temp.isUp;
this.setData({ 'tabs': json });
} else {
/* 跳转 */
wx.showToast({ title: '请上PC使用该功能', icon: 'none' })
}
}
})
\ No newline at end of file
{
"enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "MBA学习系统"
}
\ No newline at end of file
<!--pages/learnSystem/courseContent/courseContent.wxml-->
<import src='courseIntro/courseIntro.wxml' />
<import src='courseList/courseList.wxml' />
<import src='courseAssess/courseAssess.wxml' />
<view class='co-hd'>
<image class='img' src='{{headerInfo.bgSrc}}' mode='aspectFill'></image>
<view class='tit' bindtap='noWantThisCourse' data-cid='{{headerInfo.id}}' data-sid='{{headerInfo.sid}}'>{{headerInfo.title}}<view class='tit1'>{{headerInfo.time}}<view style='display:inline-block;height:22rpx;width:35rpx;'></view>{{headerInfo.status}}</view></view>
<view class='group'>
<block wx:for='{{headerInfo.arrTab}}' wx:key='{{index}}' wx:for-item='item1'>
<view class='tabs-item'>{{item1}}</view>
</block>
<block wx:if='{{headerInfo.isStart && tabs[1].chapterList.currentChapterId}}'>
<view class='btn' bindtap='startLearn' data-cid='{{headerInfo.id}}' data-sid='{{headerInfo.sid}}' data-vid='{{tabs[1].chapterList.currentChapterId}}'>继续学习</view>
</block>
<block wx:elif='{{headerInfo.isStart}}'>
<view class='btn' bindtap='startLearn' data-cid='{{headerInfo.id}}' data-sid='{{headerInfo.sid}}' data-vid='{{tabs[1].chapterList.course[0].chapters[0].vid}}'>开始学习</view>
</block>
<block wx:else>
<view class='btn' bindtap='wantThisCourse' data-cid='{{headerInfo.id}}' data-sid='{{headerInfo.sid}}'>选课</view>
</block>
</view>
<view class='progress'><view class='cur' style='width: {{headerInfo.progress || 0}};'></view></view>
</view>
<view class='ct-ctr'>
<view class='tab-select'>
<block wx:for='{{tabs}}' wx:key='{{index}}'>
<view class='item {{item.isShow ? "on" : ""}}' bindtap='tabSelect' data-index='{{index}}' data-cid='{{headerInfo.id}}' data-sid='{{headerInfo.sid}}'>{{item.title}}</view>
</block>
</view>
<view class='tab-content'>
<block wx:for='{{tabs}}' wx:key='{{index}}'>
<block wx:if='{{item.isShow && index == 0}}'>
<template is='courseIntro' data='{{item}}'></template>
</block>
<block wx:if='{{item.isShow && index == 1}}'>
<template is='courseList' data='{{item}}'></template>
</block>
<block wx:if='{{item.isShow && index == 2}}'>
<view style='margin: 200rpx auto; text-align: center; font-size: 34rpx; color: #ddd;'>直接跳转到讨论页面</view>
</block>
<block wx:if='{{item.isShow && index == 3}}'>
<template is='courseAssess' data='{{item}}'></template>
</block>
</block>
</view>
</view>
\ No newline at end of file
/* pages/learnSystem/courseContent/courseContent.wxss */
/* 头部 样式 */
.co-hd { position: relative; width: 750rpx; height: 430rpx; background: #112c42; }
.co-hd .img { position: absolute; z-index: 0; width: 750rpx; height: 424rpx; -webkit-filter: blur(20px); -moz-filter: blur(20px); -o-filter: blur(20px); -ms-filter: blur(20px); filter: blur(20px); opacity: 0.5; }
.co-hd .tit { position: absolute; z-index: 1; top: 90rpx; left: 34rpx; right: 34rpx; font-size: 34rpx; line-height: 47rpx; color: #fff; text-align: justify; }
.co-hd .tit .tit1 { margin-top: 15rpx; font-size: 24rpx; text-align: left; }
.co-hd .group { position: absolute; z-index: 1; left: 34rpx; right: 34rpx; bottom: 33rpx; overflow: hidden; }
.co-hd .group .tabs-item { float: left; font-size: 26rpx; color: #fff; margin-top: 25rpx; padding: 0 26rpx; line-height: 20rpx; border-right: 1rpx solid #fff; }
.co-hd .group .tabs-item:first-child { padding-left: 0; }
.co-hd .group .tabs-item:nth-child(3) { padding-right: 0; border-right: none; }
.co-hd .group .btn { float: right; padding: 0 36rpx; line-height: 80rpx; font-size: 28rpx; color: #fff; background: #b49441; border-radius: 8rpx; }
.co-hd .progress { position: absolute; bottom: 0; width: 100%; height: 6rpx; background: #c9c9c9; }
.co-hd .progress .cur { position: absolute; height: 100%; background: #b49441; }
/* 选择切换 */
.ct-ctr { width: 750rpx; overflow: hidden; }
.ct-ctr .tab-select { width: 100%; border: 1rpx solid #c9c9c9; overflow: hidden; }
.ct-ctr .tab-select .item { float: left; width: 25%; font-size: 28rpx; line-height: 80rpx; color: #191919; text-align: center; box-sizing: border-box; -webkit-box-sizing: border-box; }
.ct-ctr .tab-select .item.on { line-height: 80rpx; border-bottom: 4rpx solid #b49441; color: #b49441; }
.ct-ctr .tab-content { width: 100%; overflow: hidden; }
/* 引入模板模块css */
@import "courseIntro/courseIntro.wxss";
@import "courseList/courseList.wxss";
@import "courseAssess/courseAssess.wxss";
\ No newline at end of file
// pages/learnSystem/courseContent/courseDiscuss/courseDiscuss.js
const DiscussApi = require('../../../../apiService/DiscussApi.js')
Page({
/**
* 页面的初始数据
*/
data: {
sort: [
{ isShow: false, str: '' },
{ isShow: false, str: 'tag' }
],
discussList: [
// {
// user: {
// url: '',
// name: '用户名000',
// time: '2018-2-12 15:28:47'
// },
// title: '这是一个一句话问题这是一个一句话问题这是一个一句话问题标题这是一个一句话问题',
// text: '<p>王家有三兄弟甲、乙、丙,丙幼年时送给胡某作养子,丙结婚时,胡某为其盖了新房,后因失火致使该房屋被烧毁。丙的生父母就将自己<p>',
// askCnt: 20,
// TouCnt: 100,
// courseName: '在线学习课程'
// }
]
},
cid: '',
sid: '',
param: {
limit: 10, // 默认每页显示10条
offset: 0, // 偏移量(未考虑传输时,产生新问题情况)
sort: '' // 排序方式
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.cid = options.cid
this.sid = options.sid
wx.showLoading({ title: '页面加载中...', mask: true })
DiscussApi.getCourseDiscussList(this.cid, this.sid, this.param, (json) => {
this.setData({ 'discussList': json })
wx.hideLoading()
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
/* 如果发布新问题,返回到这个页面时,触发重新刷新 */
wx.showLoading({ title: '页面加载中...', mask: true })
DiscussApi.getCourseDiscussList(this.cid, this.sid, this.param, (json) => {
this.setData({ 'discussList': json })
wx.hideLoading()
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
/**
* 发布问题
*/
publishDiscuss: function () {
wx.navigateTo({
url: '/pages/learnSystem/courseContent/publishDiscuss/publishDiscuss?cid=' + this.cid + '&sid=' + this.sid
})
},
/**
* 跳转到对应 问题详情页
*/
goDiscussDetail: function (e) {
let qid = e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/learnSystem/discussDetail/discussDetail?qid=' + qid
})
},
/**
* 排序方式
*/
sortFn: function (e) {
let index = e.currentTarget.dataset.index
let str = e.currentTarget.dataset.str
let cname = 'sort[' + index + '].isShow'
let cname1 = 'sort[' + (parseInt(index)+1)%2 + '].isShow'
this.setData({ [cname]: !this.data.sort[index].isShow })
this.setData({ [cname1]: false })
this.param.sort = this.data.sort[index].isShow ? str : ''
wx.showLoading({ title: '更新中...', mask: true })
this.param.offset = 0
DiscussApi.getCourseDiscussList(this.cid, this.sid, this.param, (json) => {
this.setData({ 'discussList': json })
wx.hideLoading()
wx.showToast({ title: '已更新', icon: 'none' })
})
},
/**
* 上拉加载更多
*/
loadmore: function () {
wx.showLoading({ title: '加载中...', mask: true })
let _data = this.data.discussList
this.param.offset = _data.length
DiscussApi.getCourseDiscussList(this.cid, this.param, (json) => {
Array.prototype.push.apply(_data, json)
json.length && this.setData({ 'discussList': _data })
wx.hideLoading()
!json.length && wx.showToast({ title: '没有更多了', icon: 'none' })
})
},
/**
* 下拉刷新
*/
updatenew: function () {
wx.showLoading({ title: '更新中...', mask: true })
this.param.offset = 0
DiscussApi.getCourseDiscussList(this.cid, this.param, (json) => {
this.setData({ 'discussList': json })
wx.hideLoading()
wx.showToast({ title: '已更新', icon: 'none' })
})
}
})
\ No newline at end of file
{
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "课程讨论"
}
\ No newline at end of file
<!--pages/learnSystem/courseContent/courseDiscuss/courseDiscuss.wxml-->
<view class='pub-ques'>
<view class='ask'>
<image class='img' src='./icons/ask.png' mode='aspectFill'></image>
<view class="txt" bindtap='publishDiscuss'>发布问题 ...</view>
</view>
<view class='item-order {{sort[0].isShow ? "on" : ""}}' bindtap='sortFn' data-index='0' data-str='{{sort[0].str}}'>按时间排序</view>
<view class='item-order {{sort[1].isShow ? "on" : ""}}' bindtap='sortFn' data-index='1' data-str='{{sort[1].str}}'>按投票排序</view>
</view>
<scroll-view class='discuss-scroll' scroll-y bindscrolltolower='loadmore' bindscrolltoupper='updatenew' upper-threshold='0' lower-threshold='0'>
<block wx:for='{{discussList}}' wx:key='{{index}}'>
<view class='item-list' bindtap='goDiscussDetail' data-id='{{item.id}}' data-sid='{{item.sid}}' data-index='{{index}}'>
<view class='user'>
<image class='img' src='{{item.user.url}}'></image>
<view class='right'>
<view class='name'>{{item.user.name}}</view>
<view class='time'>{{item.user.time}}</view>
</view>
</view>
<view class='title'>{{item.title}}</view>
<rich-text class='text {{item.isShow ? "" : "on"}}' nodes="{{item.text}}"></rich-text>
<view class='ellipsis {{item.isShow ? "on" : ""}}' style='display: {{item.title.length > 56 ? "" : "none"}};'>....</view>
<view class='result'>{{item.askCnt}} 回答<view style='display: inline-block; width: 20rpx;'></view>{{item.TouCnt}} 投票</view>
<!-- <view class='course-name'>{{item.courseName}}</view> -->
</view>
</block>
<block wx:if='{{!discussList.length}}'>
<view class='no-data'>暂无相关讨论</view>
</block>
</scroll-view>
\ No newline at end of file
/* pages/learnSystem/courseContent/courseDiscuss/courseDiscuss.wxss */
.pub-ques { position: fixed; top: 0; left: 0; right: 0; height: 100rpx; padding: 0 26rpx; background: #f7f7f7; -webkit-box-sizing: border-box; box-sizing: border-box; }
.pub-ques .ask { position: relative; float: left; margin-top: 22rpx; width: 290rpx; height: 56rpx; border-radius: 28rpx; border: 1rpx solid #dcdcdc; background: #ffffff; -webkit-box-sizing: border-box; box-sizing: border-box; }
.pub-ques .ask .img { position: absolute; left: 24rpx; top: 13rpx; width: 28rpx; height: 26rpx; }
.pub-ques .ask .txt { position: absolute; left: 63rpx; top: 0; height: 54rpx; width: 210rpx; border: none; line-height: 54rpx; font-size: 24rpx; color: #313131; }
.pub-ques .item-order { float: right; margin-top: 22rpx; width: 180rpx; margin-left: 20rpx; font-size: 24rpx; color: #313131; text-align: center; line-height: 56rpx; border-radius: 28rpx; background: #ffffff; }
.pub-ques .item-order.on { background: #b49441; color: #ffffff; }
.discuss-scroll { position: absolute; top: 100rpx; left: 0; right: 0; bottom: 0; background: #f7f7f7; }
.discuss-scroll .item-list { position: relative; padding: 30rpx 26rpx; margin-bottom: 20rpx; background: #fff; box-shadow: 0 2rpx 4rpx rgba(10, 4, 6, 0.1); }
.discuss-scroll .item-list .user { position: relative; overflow: hidden; }
.discuss-scroll .item-list .user .img { float: left; width: 60rpx; height: 60rpx; background: #e5e5e5; border-radius: 50%; }
.discuss-scroll .item-list .user .right { position: absolute; left: 72rpx; top: 50%; -webkit-transform: translateY(-50%); transform: translateY(-50%); }
.discuss-scroll .item-list .user .right .name { font-size: 20rpx; color: #313131; text-overflow: ellipsis; overflow: hidden; word-break:break-all; }
.discuss-scroll .item-list .user .right .time { margin-top: 5rpx; font-size: 18rpx; color: #a0a0a0; }
.discuss-scroll .item-list .title { margin: 15rpx 0; font-size: 28rpx; color: #313131; line-height: 40rpx; text-align: justify; }
.discuss-scroll .item-list .text { font-size: 24rpx; color: #535353; line-height: 36rpx; text-align: justify; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; text-overflow: ellipsis; overflow: hidden; word-break:break-all; }
.discuss-scroll .item-list .ellipsis { position: absolute; right: 30rpx; bottom: 66rpx; padding: 5rpx 15rpx 5rpx 5rpx; color: #535353; background: #fff; font-size: 24rpx; }
.discuss-scroll .item-list .ellipsis.on { display: none; }
.discuss-scroll .item-list .result { margin-top: 15rpx; font-size: 20rpx; color: #313131; }
.discuss-scroll .item-list .course-name { position: absolute; right: 32rpx; bottom: 28rpx; font-size: 20rpx; color: #b49441; }
.discuss-scroll .no-data { position: absolute; top: 50%; left: 50%; font-size: 30rpx; color: #112c42; -webkit-transform: translateX(-50%); transform: translateX(-50%); }
\ No newline at end of file
<template name='courseIntro'>
<view class='course-intro'>
<view class='content'>
<rich-text class='intro' nodes="{{item.content.text}}"></rich-text>
</view>
<block wx:if='{{item.content.teachers.length}}'>
<view class='topic'>
<view class='line'></view>
<view class='tit'>课程讲师</view>
</view>
<block wx:for='{{item.content.teachers}}' wx:key='{{index}}' wx:for-item='item1'>
<view class='list-teacher'>
<image class='img' src='{{item1.src}}' mode='aspectFill'></image>
<view class='ctx'>
<view class='top-ctx'>
<view class='name'>{{item1.name}}</view>
</view>
<view class='bottom-ctx'>
<view class='t1'>{{item1.edu}}</view>
<view class='t2'>{{item1.job}}</view>
<view class='t3'>{{item1.unit}}</view>
</view>
</view>
</view>
</block>
</block>
</view>
</template>
\ No newline at end of file
.course-intro { margin-bottom: 100rpx; }
.course-intro .content { width: 100%; margin: 40rpx 0; padding: 0 26rpx; box-sizing: border-box; -webkit-box-sizing: border-box; }
.course-intro .content .intro { font-size: 28rpx; color: #535353; line-height: 42rpx; text-align: justify; }
.course-intro .topic { position: relative; width: 100%; height: 50rpx; overflow: hidden; }
.course-intro .topic .line { width: 100%; height: 6rpx; margin-top: 20rpx; border-top: 4rpx solid #c9c9c9; border-bottom: 1rpx solid #c9c9c9; }
.course-intro .topic .tit { position: absolute; top: 50%; left: 50%; padding: 10rpx 17rpx; font-size: 28rpx; color: #313131; background: #fff; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); }
.course-intro .list-teacher { margin-top: 50rpx; padding: 0 25rpx; overflow: hidden; }
.course-intro .list-teacher .img { float: left; width: 150rpx; height: 150rpx; background: #c9c9c9; }
.course-intro .list-teacher .ctx { position: relative; margin-left: 170rpx; height: 150rpx; }
.course-intro .list-teacher .ctx .top-ctx { position: absolute; top: -4rpx; width: 100%; overflow: hidden; }
.course-intro .list-teacher .ctx .top-ctx .tit { font-size: 28rpx; color: #313131; line-height: 37rpx; overflow: hidden; word-break: break-all; }
.course-intro .list-teacher .ctx .bottom-ctx { position: absolute; top: 50rpx; width: 100%; overflow: hidden; }
.course-intro .list-teacher .ctx .bottom-ctx .t1 { font-size: 22rpx; line-height: 30rpx; color: #707070; overflow: hidden; word-break: break-all; }
.course-intro .list-teacher .ctx .bottom-ctx .t2 { font-size: 22rpx; line-height: 30rpx; color: #707070; overflow: hidden; word-break: break-all; }
.course-intro .list-teacher .ctx .bottom-ctx .t3 { font-size: 22rpx; color: #707070; text-overflow: ellipsis; overflow: hidden; word-break: break-all; }
\ No newline at end of file
<template name='courseList'>
<view class='course-list'>
<block wx:for='{{item.chapterList.course}}' wx:key='{{index}}' wx:for-item='_item'>
<view class='content-group {{!_item.chapters.length ? "no-child" : ""}} {{_item.isUp ? "up" : ""}}'>
<view class='title' bindtap='clickJumpOrStatus' data-index='{{index}}' data-status='{{!!_item.chapters.length}}'>{{_item.title}}
<image class='side' style='{{!_item.chapters.length ? "display: none;" : ""}} {{_item.isUp ? "display: none;" : ""}}' mode='aspectFill' src='../icons/courseContent/up.png'></image>
<image class='side' style='{{!_item.chapters.length ? "display: none;" : ""}} {{_item.isUp ? "" : "display: none;"}}' mode='aspectFill' src='../icons/courseContent/down.png'></image>
</view>
<block wx:for='{{_item.chapters}}' wx:key='{{index1}}' wx:for-item='item1' wx:for-index='index1'>
<view class='body {{item1.id === item.chapterList.currentChapterId && "on"}}'>
<view class='name' data-vid='{{item1.vid}}' data-cid='{{item1.cid}}' data-sid='{{item1.sid}}' data-hasVA='{{item1.time}}' data-name='{{item1.name}}' bindtap='jumpToOtherVA' data-index='{{index}}' data-index1='{{index1}}'>
{{item1.name}}
<view class='time'>{{item1.time}}</view>
</view>
</view>
</block>
</view>
</block>
</view>
</template>
\ No newline at end of file
.course-list { margin:40rpx 0 100rpx 0; }
.course-list .content-group { padding: 0 26rpx; }
.course-list .content-group.no-child { margin-bottom: 20rpx; }
.course-list .content-group.up { margin-bottom: 20rpx; }
.course-list .content-group.up .body { display: none; }
.course-list .content-group .title { position: relative; padding: 20rpx 54rpx 20rpx 24rpx; color: #313131; font-size: 30rpx; line-height: 40rpx; background: #e5e5e5; }
.course-list .content-group .title .side { position: absolute; top: 32rpx; right: 24rpx; width: 30rpx; height: 17rpx; }
.course-list .content-group .body { position: relative; padding: 0 24rpx; font-size: 30rpx; line-height: 42rpx; color: #505050; }
.course-list .content-group .body.on .name { color: #b2183e; }
.course-list .content-group .body .name { padding: 20rpx 70rpx 20rpx 40rpx; border-left: 2rpx solid #c9c9c9; }
.course-list .content-group .body .name:before { width: 30rpx; height: 30rpx; border-radius: 32rpx; border:4rpx solid #c9c9c9;
background: #e5e5e5; position: absolute; left: 6rpx; top: 20rpx; content: ""; display: block; z-index: 10; }
.course-list .content-group .body .name .time { position: absolute; right: 16rpx; top: 20rpx; }
// pages/learnSystem/courseContent/examDetail/examDetail.js
const CourseApi = require('../../../../apiService/CourseApi.js')
Page({
/**
* 页面的初始数据
*/
data: {
exam: {
id: '',
semester_id: '',
title: '家族财富传承第一章试题',
score: '',
work_contents: '',
group: [{
id: '',
type: 1, // 判别是 单选还是多选
title: '<p>一般延续好几代,采取防御战略维持企业的家族企业类型是( )。</p>',
arr: [
{ id: '', checked: false, option: '闪电型', selected: 0 },
{ id: '', checked: false, option: '不老型', selected: 0 },
{ id: '', checked: false, option: '长存型', selected: 0 },
{ id: '', checked: false, option: '持续创业型', selected: 0 }
],
cur: ''
}]
}
},
// 提交时,传入的参数值
param: {
course_id: '',
chapter_id: '',
work_id: '',
semester_id: '',
work_contents: '',
duration: 0,
score: 0
},
/* 进入页面记录初试时间 */
startTime: '',
/* 记录所有题目是否都答过 */
recordAll: [],
/**
* 将返回值 - 对照到对应 data上
*/
updateData: function (json) {
this.param = {
course_id: json.course_id,
chapter_id: json.chapter_id,
work_id: json.work_id,
semester_id: json.semester_id,
work_contents: '',
duration: 0,
score: 0
}
this.startTime = new Date().getTime()
let _data = {
id: json.id,
semester_id: json.semester_id,
title: json.work_title,
score: json.score || '',
work_contents: json.work_contents || '',
group: json.questions.map(function (_, i) {
let str = '', _json = JSON.parse(_.question_options)
_json.forEach(function (__, j) {
if (__.checked) {
switch(j) {
case 0: str += 'A,'; break;
case 1: str += 'B,'; break;
case 2: str += 'C,'; break;
case 3: str += 'D,'; break;
}
}
})
/* 答过题目时 */
if (json.work_contents) {
let a = JSON.parse(json.work_contents)
for (let i = 0; i < a.length; i++) {
if (a[i].question_id == _.id) {
_json = a[i].options
break
}
}
}
return {
id: _.id,
type: _.question_type,
title: _.question_content,
arr: _json,
cur: json.work_contents && str.substr(0, str.length-1) || ''
}
})
}
return _data
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.showLoading({ title: '页面加载中...', mask: true })
this.setData({ 'exam': this.updateData(wx.getStorageSync('_homework')) })
CourseApi.getExamDetail(this.data.exam.id, this.data.exam.semester_id, (res) => {
let _data = res.data
let json = _data.homework
if (json) {
json.score = _data.score
json.work_contents = _data.work_contents
this.setData({ 'exam': this.updateData(json) })
}
wx.hideLoading()
})
wx.setNavigationBarTitle({ title: this.data.exam.title || '试题' })
},
/**
* radio选择
*/
radioChange: function (e) {
let i = e.currentTarget.dataset.index, arr = this.data.exam.group[i].arr, value = e.detail.value
for (let j = 0; j < arr.length; j++) {
arr[j]['selected'] = 0
}
arr[value].selected = 1
let cname = 'exam.group[' + i + '].arr'
this.setData({ [cname]: arr })
this.recordAll.push(i)
},
/**
* checkbox选择
*/
checkboxChange: function (e) {
let i = e.currentTarget.dataset.index, arr = this.data.exam.group[i].arr, value = e.detail.value
for (let j = 0; j < arr.length; j++) {
arr[j]['selected'] = 0
}
for (let j = 0; j < value.length; j++) {
arr[value[j]].selected = 1
}
let cname = 'exam.group[' + i + '].arr'
this.setData({ [cname]: arr })
if (!value.length) {
this.recordAll = this.recordAll.filter(function (_, m) { return _ != i })
} else {
this.recordAll.push(i)
}
},
/**
* 提交试题
*/
submitExam: function (e) {
if (e.currentTarget.dataset.submit) { wx.showToast({ title: '已做过,不能再提交', icon: 'none' }); return ; }
/* 计算答题时间 */
this.param.duration = Math.floor((new Date().getTime() - this.startTime)/1000)
let group = this.data.exam.group, total = group.length, arr = [], score = 0, correct = 0
for (let m = 0; m < total; m++) {
let n = 0
for (; n < this.recordAll.length; n++) {
if (this.recordAll[n] == m) { break }
}
if (n == this.recordAll.length) { wx.showToast({ title: '还有题目未做,不能提交', icon: 'none' }); return; }
}
/* 重新定义 - 上传字段 并计算分数 */
// is_correct
for (let i = 0; i< group.length; i++) {
correct = 0
if (group[i].type == 1) { // 单选的正确 判断
group[i].arr.forEach(function (_, i) {
if (_.checked && _.selected) { correct = 1; score += 1 }
})
}
if (group[i].type == 2) { // 多选的正确 判断
let flag = true
group[i].arr.forEach(function (_, i) {
if (_.checked != _.selected) { flag = false }
})
if (flag) { correct = 1; score += 1 }
}
arr.push({
question_id: group[i].id,
is_correct: correct,
options: group[i].arr
})
}
this.param.work_contents = JSON.stringify(arr)
this.param.score = (score/total*100).toFixed(1)
wx.showLoading({ title: '提交中...', mask: true })
CourseApi.submitExamDetail(this.param, (res) => {
if (res.data.status) {
CourseApi.getExamDetail(this.data.exam.id, this.data.exam.semester_id, (res) => {
let _data = res.data
let json = _data.homework
if (json) {
json.score = _data.score
json.work_contents = _data.work_contents
this.setData({ 'exam': this.updateData(json) })
}
wx.hideLoading()
})
} else {
wx.showToast({ title: res.data.data.error, icon: 'none' })
wx.hideLoading()
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () { },
/**
* 生命周期函数--监听页面显示
*/
onShow: function () { },
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () { },
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () { },
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () { },
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () { },
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () { }
})
\ No newline at end of file
{
"navigationBarBackgroundColor": "#3f3f3f",
"navigationBarTextStyle": "white",
"navigationBarTitleText": "试题",
"backgroundColor": "#535353"
}
\ No newline at end of file
<!--pages/learnSystem/courseContent/examDetail/examDetail.wxml-->
<view class='exam'>
<view style='text-align: center;'>
<view class='topic'>
<view class='tit'>{{exam.title}}</view>
<block wx:if='{{exam.score}}'><view class='cur'>正确率:{{exam.score}}%</view></block>
</view>
</view>
<view style=''>
<block wx:for='{{exam.group}}' wx:key='{{index}}'>
<block wx:if='{{item.type == 1}}'>
<view class='q-group'>
<view class='q-num'>{{index+1}}.</view><rich-text class='q-title' nodes='{{item.title}}'></rich-text>
<radio-group class='radio-group' bindchange='radioChange' data-index='{{index}}'>
<block wx:for='{{item.arr}}' wx:key='{{index}}' wx:for-item='item1' wx:for-index='index1'>
<label class='radio {{item.cur && item1.checked && "success"}} {{item.cur && !item1.checked && item1.selected && "error"}}'><radio value='{{index1}}' disabled='{{item.cur}}' checked='{{item1.selected}}'/>{{ index1 == 0 ? "A" : (index1 == 1 ? "B" : (index1 == 2 ? "C" : (index1 == 3 ? "D" : (index1 == 4 ? "E" : (index1 == 5 ? "F" : "G"))))) }}. {{item1.option}}</label>
</block>
</radio-group>
<block wx:if='{{item.cur}}'><view class='result'>正确答案:{{item.cur}}</view></block>
</view>
</block>
<block wx:if='{{item.type == 2}}'>
<view class='q-group'>
<view class='q-num'>{{index+1}}.</view><rich-text class='q-title' nodes='{{item.title}}'></rich-text>
<checkbox-group class='checkbox-group' bindchange='checkboxChange' data-index='{{index}}'>
<block wx:for='{{item.arr}}' wx:key='{{index}}' wx:for-item='item1' wx:for-index='index1'>
<label class='checkbox {{item.cur && item1.checked && "success"}} {{item.cur && !item1.checked && item1.selected && "error"}}'><checkbox value='{{index1}}' disabled='{{item.cur}}' checked='{{item1.selected}}'/>{{ index1 == 0 ? "A" : (index1 == 1 ? "B" : (index1 == 2 ? "C" : (index1 == 3 ? "D" : (index1 == 4 ? "E" : (index1 == 5 ? "F" : "G"))))) }}. {{item1.option}}</label>
</block>
</checkbox-group>
<block wx:if='{{item.cur}}'><view class='result'>正确答案:{{item.cur}}</view></block>
</view>
</block>
</block>
</view>
<view class='btn {{exam.work_contents && "on"}}' bindtap='submitExam' data-submit='{{!!exam.work_contents}}'>{{exam.work_contents ? "已提交" : "提交"}}</view>
<view class='care'>(注意:测试只有一次提交机会)</view>
</view>
/* pages/learnSystem/courseContent/examDetail/examDetail.wxss */
.exam { padding: 40rpx 26rpx; }
.exam .topic { display: inline-block; margin-bottom: 20rpx; }
.exam .topic .tit { margin: 0 auto; padding: 0rpx 10rpx; text-align: center; font-size: 40rpx; color: #313131; background: #fff; box-sizing: border-box; -webkit-box-sizing: border-box; }
.exam .topic .cur { text-align: center; font-size: 28rpx; color: #313131; line-height: 50rpx; }
/* 循环 所有选择题 */
.exam .q-group { padding: 20rpx 20rpx; border-bottom: 1rpx solid #c9c9c97a; overflow: hidden; }
.exam .q-group .q-num { float: left; margin-right: 10rpx; font-size: 30rpx; color: #676a6c; }
.exam .q-group .q-title { float: left; width: 620rpx; font-size: 28rpx; color: #676a6c; text-align: justify; }
.exam .q-group .radio-group { float: left; margin-top: 20rpx; width: 100%; }
.exam .q-group .radio-group .radio { display: block; font-size: 28rpx; color: #3f3b3a; line-height: 40rpx; margin-bottom: 10rpx; }
.exam .q-group .checkbox-group { float: left; margin-top: 20rpx; width: 100%; }
.exam .q-group .checkbox-group .checkbox { display: block; font-size: 28rpx; color: #3f3b3a; line-height: 40rpx; margin-bottom: 10rpx; }
.exam .q-group .radio-group .radio.error, .exam .q-group .checkbox-group .checkbox.error { color: #d80000; }
.exam .q-group .radio-group .radio.success, .exam .q-group .checkbox-group .checkbox.success { color: #090; }
.exam .q-group .result { float: right; font-size: 28rpx; color: #3f3b3a; }
.exam .q-group:last-child { border-bottom: none; }
.exam .btn { margin: 30rpx auto; width: 698rpx; height: 80rpx; line-height: 80rpx; font-size: 30rpx; text-align: center; font-weight: 300; color: #fff; border-radius: 10rpx; background: #b49441; }
.exam .btn.on { opacity: 0.5; }
.exam .care { font-size: 20rpx; color: #d80000; text-align: center; }
/* 自定义 radio样式 */
.exam .q-group .radio-group .radio radio { position: relative; height: 40rpx; width: 45rpx; }
.exam .q-group .radio-group .radio radio .wx-radio-input { position: absolute; width: 12px; height: 12px; top: 50%; border-radius: 50%; transform: translateY(-50%); -webkit-transform: translateY(-50%); }
.exam .q-group .radio-group .radio radio .wx-radio-input.wx-radio-input-checked { border-color: #b49441 !important; background: #b49441 !important; }
.exam .q-group .radio-group .radio radio .wx-radio-input-disabled.wx-radio-input-checked { border-color: #a3a3a3 !important; background: #a3a3a3 !important; }
.exam .q-group .radio-group .radio radio .wx-radio-input.wx-radio-input-checked::before { position: absolute;
top: 50%; left: 50%; width: 8rpx; height: 8rpx; background: #fff; border-radius: 50%; text-align: center; font-size:0rpx; transform: translate(-50%, -50%) scale(1); -webkit-transform: translate(-50%, -50%) scale(1); }
/* 自定义 checkbox样式 */
.exam .q-group .checkbox-group .checkbox checkbox { position: relative; height: 40rpx; width: 45rpx; }
.exam .q-group .checkbox-group .checkbox checkbox .wx-checkbox-input { position: absolute; width: 12px; height: 12px; top: 50%; transform: translateY(-50%); -webkit-transform: translateY(-50%); }
.exam .q-group .checkbox-group .checkbox checkbox .wx-checkbox-input.wx-checkbox-input-checked { color: #b49441 !important; }
.exam .q-group .checkbox-group .checkbox checkbox .wx-checkbox-input-disabled.wx-checkbox-input-checked { color: #a3a3a3 !important; }
.exam .q-group .checkbox-group .checkbox checkbox .wx-checkbox-input.wx-checkbox-input-checked::before { font-size: 30rpx; }
// pages/learnSystem/courseContent/publishDiscuss/publishDiscuss.js
const DiscussApi = require('../../../../apiService/DiscussApi.js')
Page({
/**
* 页面的初始数据
*/
data: {
publish: {
course_id: '',
semester_id: '',
title: '',
contents: ''
}
},
/* title输入 离开 input blur事件监听 */
inputTitle: function (e) { this.setData({ 'publish.title': e.detail.value }); },
/* contents输入 离开 input blur事件监听 */
inputContents: function (e) { this.setData({ 'publish.contents': e.detail.value }); },
/* 提交发布问题 */
submitPublish: function () {
let _publish = this.data.publish
if (!_publish.title) { wx.showToast({ title: '请填入问题名称', icon: 'none' }); return; }
if (!_publish.contents) { wx.showToast({ title: '请填入问题描述', icon: 'none' }); return; }
wx.showLoading({ title: '操作中...', mask: true })
DiscussApi.publishQues(this.data.publish, (json) => {
wx.hideLoading()
wx.navigateBack({ delta: 1 })
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) { this.setData({ 'publish.course_id': options.cid, 'publish.semester_id': options.sid }) },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () { },
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () { },
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () { },
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () { },
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () { },
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () { },
})
\ No newline at end of file
{
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "发布问题"
}
\ No newline at end of file
<!--pages/learnSystem/courseContent/publishDiscuss/publishDiscuss.wxml-->
<view class='publish'>
<view class='title'>
<input type='text' placeholder='问题' bindinput="inputTitle" bindblur="inputTitle" value="{{publish.title}}"/>
</view>
<view class='content'>
<textarea placeholder='问题描述' maxlength='-1' bindinput="inputContents" bindblur="inputContents" value="{{publish.contents}}" />
</view>
<view class='btn' bindtap='submitPublish'>发布问题</view>
</view>
/* pages/learnSystem/courseContent/publishDiscuss/publishDiscuss.wxss */
.publish { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: #f7f7f7; overflow: hidden; }
.publish .title { margin: 30rpx 26rpx; padding: 0 10rpx; width: 698rpx; height: 80rpx; border: 1rpx solid #dcdcdc; border-radius: 10rpx; background: #fff; box-sizing: border-box; -webkit-box-sizing: border-box; }
.publish .title input { width: 678rpx; height: 78rpx; font-size: 32rpx; line-height: 78rpx; color: #313131; border: none; }
.publish .content { margin: 30rpx 26rpx; padding: 10rpx; width: 698rpx; height: 400rpx; border: 1rpx solid #dcdcdc; border-radius: 10rpx; background: #fff; box-sizing: border-box; -webkit-box-sizing: border-box; }
.publish .content textarea { width: 100%; height: 100%; font-size: 32rpx; line-height: 50rpx; color: #313131; border: none; }
.publish .btn { margin: 30rpx auto; width: 698rpx; height: 80rpx; line-height: 80rpx; font-size: 30rpx; text-align: center; font-weight: 300; color: #fff; border-radius: 10rpx; background: #b49441; }
\ No newline at end of file
// pages/learnSystem/courseSquare/courseSquare.js
const CourseApi = require('../../../apiService/CourseApi.js')
Page({
/**
* 页面的初始数据
*/
data: {
find: [{
name: '学期',
isShow: false,
selectIndex: 0,
key: 'semester_id',
arrItem: [ // 从后台请求
{ val: '-1', name: '全部' },
{ val: '', name: '第一学期' },
{ val: '', name: '第二学期' },
{ val: '', name: '第三学期' },
{ val: '', name: '第四学期' }
]
}, {
name: '课程类型',
isShow: false,
selectIndex: 0,
key: 'course_type',
arrItem: [
{ val: '-1', name: '全部' },
{ val: '1', name: '必修课' },
{ val: '2', name: '选修课' },
{ val: '3', name: '重修课' }
]
}, {
name: '选修状态',
isShow: false,
selectIndex: 0,
key: 'select_status',
arrItem: [
{ val: '-1', name: '全部' },
{ val: '0', name: '未选修' },
{ val: '1', name: '已选修' }
]
}],
homeList: [
// {
// id: '',
// src: '../icons/home/default.jpg',
// title: '这里是一条长的标题不要超过25个汉字标题不要超过25个汉字',
// arrTab: ['3学分', '必修课', '第一学期'],
// status: '已发布',
// time: '2016-09-10至2017-01-10',
// myStatus: '已选修',
// progress: '50%'
// }
]
},
param: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.showLoading({ title: '页面加载中...', mask: true })
CourseApi.getlearnFindList((_) => {
this.setData({ 'find[0].arrItem': _ })
CourseApi.getCourseList(false, this.param, (json) => {
this.setData({ 'homeList': json })
wx.hideLoading()
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () { },
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () { },
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () { },
/**
* 跳转 - 课程详情页
*/
goCourseContent: function (e) {
let id = e.currentTarget.dataset.id
let sid = e.currentTarget.dataset.sid
wx.navigateTo({
url: '/pages/learnSystem/courseContent/courseContent?id=' + id + '&sid=' + sid
})
},
/**
* 分类选择 - 显示
*/
selFindShow: function (e) {
let index = e.currentTarget.dataset.index
let json = this.data.find
/* 本来就是打开状态,再点击关闭 */
if (json[index].isShow) {
json[index].isShow = false
} else {
for (let i = 0; i < json.length; i++) {
json[i].isShow = false
}
json[index].isShow = true
}
this.setData({ 'find': json })
},
/**
* 分类选择 - 隐藏
*/
selFindHide: function (e) {
let json = this.data.find
for (let i = 0; i < json.length; i++) {
json[i].isShow = false
}
this.setData({ 'find': json })
},
/**
* 分类选择 - 选中某一项
*/
selFindSelect: function (e) {
let _data = e.currentTarget.dataset, index = _data.index
let json = this.data.find
for (let i = 0; i < json.length; i++) {
if (json[i].isShow) {
json[i].selectIndex = index
json[i].isShow = false
if (_data.val == '-1') {
delete this.param[_data.key]
} else {
this.param[_data.key] = _data.val
}
break
}
}
this.setData({ 'find': json })
/* 调用接口 */
wx.showLoading({ title: '加载中...', mask: true })
CourseApi.getCourseList(false, this.param, (json) => {
this.setData({ 'homeList': json })
wx.hideLoading()
})
},
/**
* 上拉加载更多
*/
loadmore: function () {
wx.showLoading({ title: '加载中...', mask: true })
CourseApi.getCourseList(false, this.param, (json) => {
this.setData({ 'homeList': json })
wx.hideLoading()
wx.showToast({ title: '没有更多了', icon: 'none' })
})
},
/**
* 上拉刷新
*/
updatenew: function () {
wx.showLoading({ title: '更新中...', mask: true })
CourseApi.getCourseList(false, this.param, (json) => {
this.setData({ 'homeList': json })
wx.hideLoading()
wx.showToast({ title: '已更新', icon: 'none' })
})
}
})
\ No newline at end of file
{
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "选课广场"
}
\ No newline at end of file
<!--pages/learnSystem/courseSquare/courseSquare.wxml-->
<!-- 分类 -->
<view class='select-find'>
<block wx:for='{{find}}' wx:key='{{index}}'>
<view class='col-3'><view class='sel-item {{item.isShow ? "on" : ""}}' bindtap='selFindShow' data-index='{{index}}'>{{item.name}}</view></view>
<block wx:if='{{item.isShow}}'>
<view class='content'>
<block wx:for='{{item.arrItem}}' wx:key='{{index1}}' wx:for-item="item1" wx:for-index="index1">
<view class='item {{item.selectIndex == index1 ? "on" : ""}}' bindtap='selFindSelect' data-index='{{index1}}' data-key='{{item.key}}' data-val='{{item1.val}}'>{{item1.name}}</view>
</block>
</view>
</block>
</block>
</view>
<block wx:if='{{find[0].isShow || find[1].isShow || find[2].isShow}}'>
<view class='select-find-open' bindtap='selFindHide'></view>
</block>
<scroll-view class='home-scroll' scroll-y bindscrolltolower='loadmore' bindscrolltoupper='updatenew' upper-threshold='0' lower-threshold='5'>
<block wx:for='{{homeList}}' wx:key='{{index}}'>
<view class='item-list' bindtap='goCourseContent' data-id='{{item.id}}' data-sid='{{item.sid}}'>
<image class='img' src='{{item.src}}' mode='aspectFill'></image>
<view class='ctx'>
<view class='top-ctx'>
<view class='tit'>{{item.title}}</view>
<view class='tit1'>
<block wx:for='{{item.arrTab}}' wx:key='{{index}}' wx:for-item='item1'>
<view class='tit1-item'>{{item1}}</view>
</block>
</view>
</view>
<view class='bottom-ctx'>
<view class='info'>
<view class='status'>{{item.status}}</view>
<view class='time'>{{item.time}}</view>
<view class='my-status'>{{item.myStatus}}</view>
</view>
<view class='progress'><view class='cur' style='width: {{item.progress || 0}};'></view></view>
</view>
</view>
</view>
</block>
<block wx:if='{{!homeList.length}}'>
<view class='no-data'>暂无相关课程</view>
</block>
</scroll-view>
\ No newline at end of file
/* pages/learnSystem/courseSquare/courseSquare.wxss */
/* 分类 */
.select-find { position: fixed; top: 0; z-index: 2; width: 750rpx; height: 90rpx; border-bottom: 1rpx solid #dcdcdc; }
.select-find .col-3 { float: left; position: relative; z-index: 2; width: 33.333%; height: 100%; }
.select-find .sel-item { position: absolute; top: 17rpx; left: 50%; width: 200rpx; color: #313131; font-size: 24rpx; line-height: 56rpx; text-align: center; background: #eeeeee; border-radius: 8rpx; -webkit-transform: translateX(-50%); transform: translateX(-50%); }
.select-find .sel-item.on { height: 70rpx; background: #fff; border: 1rpx solid #eeeeee; border-bottom: none; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.select-find .content { position: absolute; z-index: 0; top: 86rpx; width: 750rpx; background: #fff; overflow: hidden; border-top: 1rpx solid #eeeeee; }
.select-find .content .item { float: left; width: 50%; padding-left: 26rpx; font-size: 26rpx; line-height: 100rpx; color: #313131; box-sizing: border-box; -webkit-box-sizing: border-box; }
.select-find .content .item.on { color: #b49441; }
.select-find-open { position: absolute; z-index: 1; top: 180rpx; bottom: 0; left: 0; right: 0; background: rgba(0, 0, 0, 0.3); }
/* 列表 */
.home-scroll { position: fixed; top: 92rpx; bottom: 0; left: 0; right: 0; }
.home-scroll .item-list { padding: 33rpx 25rpx 33rpx 0; border-bottom: 1rpx solid #eeeeee; overflow: hidden; }
.home-scroll .item-list .img { float: left; width: 250rpx; height: 160rpx; }
.home-scroll .item-list .ctx { position: relative; margin-left: 266rpx; height: 160rpx; }
.home-scroll .item-list .ctx .top-ctx { position: absolute; top: -2rpx; width: 100%; overflow: hidden; }
.home-scroll .item-list .ctx .top-ctx .tit { font-size: 28rpx; color: #313131; line-height: 37rpx; }
.home-scroll .item-list .ctx .top-ctx .tit1 { margin-top: 8rpx; overflow: hidden; }
.home-scroll .item-list .ctx .top-ctx .tit1 .tit1-item { float: left; font-size: 20rpx; color: #313131; padding: 0 21rpx; line-height: 20rpx; border-right: 1rpx solid #a0a0a0; }
.home-scroll .item-list .ctx .top-ctx .tit1 .tit1-item:first-child { padding-left: 0; }
.home-scroll .item-list .ctx .top-ctx .tit1 .tit1-item:last-child { border-right: none; }
.home-scroll .item-list .ctx .bottom-ctx { position: absolute; bottom: 0; width: 100%; overflow: hidden; }
.home-scroll .item-list .ctx .bottom-ctx .info { margin-bottom: 10rpx; overflow: hidden; }
.home-scroll .item-list .ctx .bottom-ctx .info .status { float: left; font-size: 18rpx; color: #a0a0a0; margin-right: 25rpx; margin-top: 4rpx; }
.home-scroll .item-list .ctx .bottom-ctx .info .time { float: left; font-size: 18rpx; color: #a0a0a0; margin-top: 4rpx; }
.home-scroll .item-list .ctx .bottom-ctx .info .my-status { float: right; font-size: 22rpx; color: #313131; }
.home-scroll .item-list .ctx .bottom-ctx .progress { position: relative; width: 100%; height: 6rpx; border-radius: 6rpx; background: #c9c9c9; }
.home-scroll .item-list .ctx .bottom-ctx .progress .cur { position: absolute; height: 100%; border-radius: 6rpx; background: #b49441; }
.home-scroll .no-data { position: absolute; top: 50%; left: 50%; font-size: 30rpx; color: #112c42; -webkit-transform: translateX(-50%); transform: translateX(-50%); }
\ No newline at end of file
// pages/learnSystem/discussDetail/discussDetail.js
const DiscussApi = require('../../../apiService/DiscussApi.js')
Page({
/**
* 页面的初始数据
*/
data: {
discussQues: {
// qid: '', user: { url: './icons/default.jpg', name: '用户名000', time: '2018-2-12 15:28:47' },
// title: '这是一个一句话问题这是一个一句话问题这是一个一句话问题标题这是一个一句话问题',
// text: '<p>王家有三兄弟甲、乙、丙,丙幼年时送给胡某作养子,丙结婚时,胡某为其盖了新房,后因失火致使该房屋被烧毁。丙的生父母就将自己<p>',
// askCnt: 20, TouCnt: 100, likeCnt: 100, comCnt: 100, mine: true, isShowComment: false, has_tag: false, tag_id: null,
// comments: [
// { cid: '', user: { url: './icons/default.jpg', name: '用户名000', time: '2018-2-12 15:28:47' }, text: '在线学习课程', mine: true },
// { cid: '', user: { url: './icons/default.jpg', name: '用户名000', time: '2018-2-12 15:28:47' }, text: '在线学习课程', mine: false }
// ]
},
answersList: [
// {
// aid: '', user: { url: './icons/default.jpg', name: '用户名000', time: '2018-2-12 15:28:47' },
// text: '<p>王家有三兄弟甲、乙、丙,丙幼年时送给胡某作养子,丙结婚时,胡某为其盖了新房,后因失火致使该房屋被烧毁。丙的生父母就将自己<p>',
// likeCnt: 100, comCnt: 100, mine: true, isShowComment: false, has_tag: false, tag_id: null,
// comments: [
// { cid: '', user: { url: './icons/default.jpg', name: '用户名000', time: '2018-2-12 15:28:47' }, text: '在线学习课程', mine: true }
// ]
// }
],
/* 存储状态值 的对象, 记录上次用户操作 */
disQus: {
isShowComment: false
},
answers: [ // 数组 跟 上面 answerList数组对应, 存储某些状态值,目前存储讨论打开关闭状态
{ aid: '', isShowComment: false }
],
inputStatus: {
canFocus: false,
placeholder: '回答问题 ...',
input: ''
}
},
qid: '6447416971762860032',
/* 回复内容状态 */
call: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.qid = options.qid
this.sid = options.sid
this.call = { questionId: this.qid, semester_id: '', contents: '', question_id: this.qid, answer: true }
wx.showLoading({ title: '页面加载中...', mask: true })
DiscussApi.getDiscussDetail(this.qid, (json) => {
this.setData({ 'discussQues': json.ques })
this.call.semester_id = this.data.discussQues.sid
this.setData({ 'disQus.isShowComment': json.ques.isShowComment })
let answers = []
for (let i = 0; i < json.answer.length; i++) {
answers.push({
aid: json.answer[i].aid,
isShowComment: json.answer[i].isShowComment
})
}
this.setData({ 'answersList': json.answer })
this.setData({ 'answers': answers })
wx.hideLoading()
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () { },
/**
* 生命周期函数--监听页面显示
*/
onShow: function () { },
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () { },
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () { },
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () { },
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () { },
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () { },
/**
* 打开或关闭 讨论
*/
openOrcloseDis: function (e) {
let key = e.currentTarget.dataset.key
if (key == 'disQus') {
this.setData({ 'disQus.isShowComment': !this.data.disQus.isShowComment })
} else {
let index = e.currentTarget.dataset.index
let cname = 'answers[' + index + '].isShowComment'
this.setData({ [cname]: !this.data.answers[index].isShowComment })
}
},
/**
* 删除评论
*/
deleteComment: function (e) {
let cid = e.currentTarget.dataset.cid
wx.showModal({
title: '提示', content: '确定删除该条评论?',
success: (res) => {
if (res.confirm) {
wx.showLoading({ title: '操作中...', mask: true })
DiscussApi.deleteComment(cid, (json) => {
this.updateList()
})
}
}
})
},
/**
* 删除回答
*/
deleteAnswer: function (e) {
let aid = e.currentTarget.dataset.aid
wx.showModal({
title: '提示', content: '确定删除该条回答?',
success: (res) => {
if (res.confirm) {
wx.showLoading({ title: '操作中...', mask: true })
DiscussApi.deleteAnswer(aid, (json) => {
this.updateList()
})
}
}
})
},
/**
* 点击回复 调起输入框
*/
callbackComment: function (e) {
/* 如果,输入框中,本身已经存在输入内容,那么再点击其他回复时,不给提示,直接清空 */
this.setData({ 'inputStatus.input': '' }) // 这里如果想判断,不能使用 inputStatus.input这个 在blur时存储
let _data = e.currentTarget.dataset
let qid = _data.qid, quesid = _data.quesid, ansid = _data.ansid, to = _data.to, sid = _data.sid
let json = {}
if (qid) { json['questionId'] = qid }
if (to) { json['to'] = to }
if (quesid) { json['question_id'] = quesid }
if (ansid) { json['answer_id'] = ansid }
if (sid) { json['semester_id'] = sid }
this.call = json
if (to) {
this.setData({ 'inputStatus.placeholder': '回复' + to + ':' })
} else {
this.setData({ 'inputStatus.placeholder': '回复:' })
}
this.setData({ 'inputStatus.canFocus': true })
},
/**
* 取消 聚焦状态
*/
blurInput: function (e) {
this.setData({ 'inputStatus.canFocus': false })
if (e && e.detail && e.detail.value) {
// 输入框中存在内容则不做处理 - 这里不能做任何处理,否则会产生 输入框中内容遗留问题
} else {
this.setData({ 'inputStatus.placeholder': '回答问题 ...' })
this.setData({ 'inputStatus.input': '' })
// 回答问题 方式
this.call = {
questionId: this.data.discussQues.qid,
semester_id: this.data.discussQues.sid,
contents: '',
question_id: this.data.discussQues.qid,
answer: true
}
}
},
/**
* 点击 键盘发送按钮时
*/
publishContent: function (e) {
let val = e.detail.value
if (this.call.to) {
this.call['comments'] = '回复' + this.call.to + ':' + val
} else {
this.call['comments'] = val
}
if (this.call.answer) { // 回答问题
wx.showLoading({ title: '操作中...', mask: true })
this.call['contents'] = this.call['comments']
DiscussApi.answerQues(this.call, (json) => {
this.updateList()
wx.hideLoading()
})
} else { // 回复评论
wx.showLoading({ title: '操作中...', mask: true })
DiscussApi.callbackComment(this.call, (json) => {
this.updateList()
wx.hideLoading()
})
}
this.blurInput()
},
/**
* 点赞 或 取消点赞 操作
*/
btnlike: function (e) {
let _data = e.currentTarget.dataset
let quesid = _data.quesid, ansid = _data.ansid, tagid = _data.tagid, sid = _data.sid
let _special = _data.special
if (tagid) { // 取消 点赞操作
wx.showLoading({ title: '操作中...', mask: true })
DiscussApi.unlike(tagid, (json) => {
this.updateList()
wx.hideLoading()
})
} else { // 点赞操作
let param = {}
if (quesid) { param['question_id'] = quesid }
if (ansid) { param['answer_id'] = ansid }
if (sid) { param['semester_id'] = sid }
wx.showLoading({ title: '操作中...', mask: true })
DiscussApi.like(param, (json) => {
this.updateList()
wx.hideLoading()
})
}
},
/**
* 删除问题
*/
deleteDiscuss: function () {
wx.showModal({
title: '提示', content: '确定删除提问吗?',
success: (res) => {
if (res.confirm) {
wx.showLoading({ title: '操作中...', mask: true })
DiscussApi.deleteDiscuss(this.qid, (json) => {
wx.navigateBack({ delta: 1 })
})
}
}
})
},
/* 刷新页面 全部状态 - 目前没有分页可以这么操作,如果存在分页,可能要重写 */
updateList: function () {
DiscussApi.getDiscussDetail(this.qid, (json) => {
this.setData({ 'discussQues': json.ques })
let _answers = this.data.answers
for (let i = 0; i < _answers.length; i++) {
for (let j = 0; j < json.answer.length; j++) {
if (_answers[i].aid == json.answer[j].aid) {
json.answer[j].isShowComment = _answers[i].isShowComment
break
}
}
}
let answers = []
for (let i = 0; i < json.answer.length; i++) {
answers.push({
aid: json.answer[i].aid,
isShowComment: json.answer[i].isShowComment
})
}
this.setData({ 'answersList': json.answer })
this.setData({ 'answers': answers })
wx.hideLoading()
})
}
})
\ No newline at end of file
{
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "问题详情"
}
\ No newline at end of file
<!--pages/learnSystem/discussDetail/discussDetail.wxml-->
<scroll-view class='discuss-detail-scroll' scroll-y>
<view class='ques'>
<view class='title'>{{discussQues.title}}</view>
<rich-text class='text' nodes="{{discussQues.text}}"></rich-text>
<view class='user'>
<view class='name'>{{discussQues.user.name}}</view>
<view class='time'>{{discussQues.user.time}}</view>
<block wx:if='{{discussQues.mine}}'><view class='right-txt' bindtap='deleteDiscuss'>删除</view></block>
<view class='right-txt' bindtap='callbackComment' data-sid='{{discussQues.sid}}' data-qid='{{discussQues.qid}}' data-quesid='{{discussQues.qid}}'>回复</view>
<view class='right-txt' bindtap='openOrcloseDis' data-key='disQus'>讨论({{discussQues.comCnt}})</view>
<view class='right-txt' bindtap='btnlike' data-quesid='{{discussQues.qid}}' data-sid='{{discussQues.sid}}' data-tagid='{{discussQues.tag_id}}'>
<image class='img' src='{{discussQues.has_tag ? "./icons/like-on.png" : "./icons/like.png"}}'></image>
({{discussQues.likeCnt}})</view>
</view>
<block wx:if='{{disQus.isShowComment}}'>
<view class='ask'>
<block wx:for='{{discussQues.comments}}' wx:key='{{index}}'>
<view class='item-list' data-id='{{item.id}}'>
<view class='user'>
<view class='name'>{{item.user.name}}</view>
<view class='time'>{{item.user.time}}</view>
<block wx:if='{{item.mine}}'><view class='right-txt' bindtap='deleteComment' data-cid='{{item.cid}}'>删除</view></block>
<view class='right-txt' bindtap='callbackComment' data-sid='{{discussQues.sid}}' data-qid='{{discussQues.qid}}' data-quesid='{{discussQues.qid}}' data-to='{{item.user.name}}'>回复</view>
</view>
<view class='text'>{{item.text}}</view>
</view>
</block>
</view>
</block>
</view>
<view class='result'>{{discussQues.askCnt}} 回答<view style='display: inline-block; width: 20rpx;'></view>{{discussQues.TouCnt}} 投票</view>
<block wx:for='{{answersList}}' wx:key='{{index}}'>
<view class='ask'>
<view class='user-1'>
<image class='img-1' src='{{item.user.url}}'></image>
<view class='right-1'>
<view class='name-1'>{{item.user.name}}</view>
<view class='time-1'>{{item.user.time}}</view>
</view>
</view>
<rich-text class='text' nodes="{{item.text}}"></rich-text>
<view class='user'>
<block wx:if='{{item.mine}}'><view class='right-txt' bindtap='deleteAnswer' data-aid='{{item.aid}}'>删除</view></block>
<view class='right-txt' bindtap='callbackComment' data-sid='{{discussQues.sid}}' data-sid='{{discussQues.sid}}' data-qid='{{discussQues.qid}}' data-ansid='{{item.aid}}'>回复</view>
<view class='right-txt' bindtap='openOrcloseDis' data-key='answers' data-index='{{index}}'>讨论({{item.comCnt}})</view>
<view class='right-txt' bindtap='btnlike' data-sid='{{discussQues.sid}}' data-quesid='{{discussQues.qid}}' data-ansid='{{item.aid}}' data-tagid='{{item.tag_id}}'>
<image class='img' src='{{item.has_tag ? "./icons/like-on.png" : "./icons/like.png"}}'></image>
({{item.likeCnt}})</view>
</view>
<block wx:if='{{answers[index].isShowComment}}'>
<block wx:for='{{item.comments}}' wx:key='{{index}}' wx:for-item='item1'>
<view class='item-list' data-id='{{item1.id}}'>
<view class='user'>
<view class='name'>{{item1.user.name}}</view>
<view class='time'>{{item1.user.time}}</view>
<block wx:if='{{item1.mine}}'><view class='right-txt' bindtap='deleteComment' data-cid='{{item1.cid}}'>删除</view></block>
<view class='right-txt' bindtap='callbackComment' data-sid='{{discussQues.sid}}' data-qid='{{discussQues.qid}}' data-ansid='{{item.aid}}' data-to='{{item.user.name}}'>回复</view>
</view>
<view class='text'>{{item1.text}}</view>
</view>
</block>
</block>
<block wx:if='{{!item.comments.length || !answers[index].isShowComment}}'><view style='width: 750rpx; height: 20rpx;'></view></block>
</view>
</block>
<block wx:if='{{!answersList.length}}'>
<view class='no-data'>暂无回答</view>
</block>
<view style='width: 750rpx; height: 200rpx;'></view>
</scroll-view>
<view class='input-publish'>
<view class='ask'>
<image class='img' src='./icons/ask.png' mode='aspectFill'></image>
<input type='text' class="txt" placeholder='{{inputStatus.placeholder}}' focus='{{inputStatus.canFocus}}' bindblur='blurInput' confirm-type='send' bindconfirm='publishContent' value='{{inputStatus.input}}' cursor-spacing='20'/>
</view>
</view>
\ No newline at end of file
/* pages/learnSystem/discussDetail/discussDetail.wxss */
.discuss-detail-scroll { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: #f7f7f7; }
.discuss-detail-scroll .ques { padding: 30rpx 26rpx; padding-top: 0; margin-bottom: 20rpx; background: #fff; box-shadow: 0 2rpx 4rpx rgba(10, 4, 6, 0.1); overflow: hidden; }
/* 显示标题、描述、讨论、人等 */
.discuss-detail-scroll .user { margin-top: 15rpx; overflow: hidden; }
.discuss-detail-scroll .user .name { float: left; font-size: 22rpx; color: #313131; line-height: 26rpx; }
.discuss-detail-scroll .user .time { float: left; margin-left: 40rpx; font-size: 20rpx; color: #a0a0a0; line-height: 26rpx; }
.discuss-detail-scroll .user .right-txt { float: right; margin-left: 20rpx; font-size: 20rpx; color: #a27c1b; }
.discuss-detail-scroll .user .right-txt .img { display: inline-block; margin-top: 1rpx; width: 22rpx; height: 20rpx; }
.discuss-detail-scroll .title { margin: 15rpx 0; font-size: 28rpx; color: #313131; line-height: 40rpx; text-align: justify; }
.discuss-detail-scroll .text { font-size: 24rpx; color: #535353; line-height: 36rpx; text-align: justify; }
/* 显示回答和投票 */
.discuss-detail-scroll .result { margin-left: 26rpx; margin-top: 15rpx; font-size: 20rpx; color: #313131; }
.discuss-detail-scroll .ask { position: relative; margin-top: 20rpx; padding: 0 26rpx; background: #fff; overflow: hidden; }
/* 显示回答 和 讨论 */
.discuss-detail-scroll .ask .user-1 { position: relative; overflow: hidden; margin-top: 25rpx; margin-bottom: 15rpx; }
.discuss-detail-scroll .ask .user-1 .img-1 { float: left; width: 60rpx; height: 60rpx; background: #e5e5e5; border-radius: 50%; }
.discuss-detail-scroll .ask .user-1 .right-1 { position: absolute; left: 72rpx; top: 50%; -webkit-transform: translateY(-50%); transform: translateY(-50%); }
.discuss-detail-scroll .ask .user-1 .right-1 .name-1 { font-size: 20rpx; color: #313131; text-overflow: ellipsis; overflow: hidden; word-break:break-all; }
.discuss-detail-scroll .ask .user-1 .right-1 .time-1 { margin-top: 5rpx; font-size: 18rpx; color: #a0a0a0; }
.discuss-detail-scroll .item-list { position: relative; padding: 30rpx 0; border-bottom: 1rpx solid #c9c9c9; }
.discuss-detail-scroll .item-list:last-child { border-bottom: none; }
.discuss-detail-scroll .item-list .user { margin-top: 0; overflow: hidden; }
.discuss-detail-scroll .item-list .user .name { float: left; font-size: 22rpx; color: #313131; line-height: 26rpx; }
.discuss-detail-scroll .item-list .user .time { float: left; margin-left: 40rpx; font-size: 20rpx; color: #a0a0a0; line-height: 26rpx; }
.discuss-detail-scroll .item-list .user .right-txt { float: right; margin-left: 20rpx; font-size: 20rpx; color: #a27c1b; }
.discuss-detail-scroll .item-list .text { margin-top: 15rpx; font-size: 24rpx; color: #535353; }
.discuss-detail-scroll .item-list .text.on { color: #2263d9; }
.discuss-detail-scroll .no-data { padding: 100rpx 0; font-size: 30rpx; color: #c9c9c9; text-align: center; }
.input-publish { position: fixed; z-index: 2; height: 80rpx; left: 0; right: 0; bottom: 0; background: #fff; }
.input-publish .ask { position: relative; margin: 12rpx auto; width: 700rpx; height: 56rpx; border: 1rpx solid #dcdcdc; box-sizing: border-box; -webkit-box-sizing: border-box; }
.input-publish .ask .img { position: absolute; left: 24rpx; top: 13rpx; width: 28rpx; height: 26rpx; }
.input-publish .ask .txt { position: absolute; left: 63rpx; top: 0; height: 54rpx; width: 630rpx; border: none; line-height: 54rpx; font-size: 24rpx; color: #313131; }
\ No newline at end of file
// pages/learnSystem/home/home.js // pages/learnSystem/home/home.js
Page({ const CourseApi = require('../../../apiService/CourseApi.js')
Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
filter: {
studyEarly: 'down',
selectTime: 'down'
}, },
find: [{
name: '学期',
isShow: false,
selectIndex: 0,
key: 'semester_id',
arrItem: [ // 从后台请求
{ val: '-1', name: '全部' },
{ val: '', name: '第一学期' },
{ val: '', name: '第二学期' },
{ val: '', name: '第三学期' },
{ val: '', name: '第四学期' }
]
}, {
name: '课程类型',
isShow: false,
selectIndex: 0,
key: 'course_type',
arrItem: [
{ val: '-1', name: '全部' },
{ val: '1', name: '必修课' },
{ val: '2', name: '选修课' },
{ val: '3', name: '重修课' }
]
}],
homeList: [
// {
// id: '',
// src: '../icons/home/default.jpg',
// title: '这里是一条长的标题不要超过25个汉字标题不要超过25个汉字',
// arrTab: ['3学分', '必修课', '第一学期'],
// status: '已发布',
// time: '2016-09-10至2017-01-10',
// myStatus: '已选修',
// progress: '50%'
// }
]
},
param: {},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
wx.showLoading({ title: '页面加载中...', mask: true })
CourseApi.getlearnFindList((_) => {
this.setData({ 'find[0].arrItem': _ })
CourseApi.getCourseList(true, this.param, (json) => {
this.setData({ 'homeList': json })
wx.hideLoading()
if (!json.length) {
wx.showToast({ title: '请去选课广场选课', icon: 'none', duration: 3500 })
}
})
})
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {},
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () { onHide: function () {},
},
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { onUnload: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
/**
* 筛选 - 最近学习顺序
*/
studyEarlyUpdate: function () {
let na = this.data.filter.studyEarly == 'up' ? 'down' : 'up'
this.setData({ 'filter.studyEarly': na })
if (na == 'down') {
this.param['order_type'] = 'learn_time'
} else if (na == 'up') {
this.param['order_type'] = '-learn_time'
}
wx.showLoading({ title: '加载中...', mask: true })
CourseApi.getCourseList(true, this.param, (json) => {
this.setData({ 'homeList': json })
wx.hideLoading()
})
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 筛选 - 选修时间顺序
*/ */
onPullDownRefresh: function () { selectTimeUpdate: function () {
let na = this.data.filter.selectTime == 'up' ? 'down' : 'up'
this.setData({ 'filter.selectTime': na })
if (na == 'down') {
this.param['order_type'] = 'join_time'
} else if (na == 'up') {
this.param['order_type'] = '-join_time'
}
wx.showLoading({ title: '加载中...', mask: true })
CourseApi.getCourseList(true, this.param, (json) => {
this.setData({ 'homeList': json })
wx.hideLoading()
})
}, },
/** /**
* 页面上拉触底事件的处理函数 * 跳转 - 选课广场
*/ */
onReachBottom: function () { jumpToCourseSquare: function () {
wx.navigateTo({
url: '/pages/learnSystem/courseSquare/courseSquare'
})
}, },
/** /**
* 用户点击右上角分享 * 跳转 - 课程详情页
*/ */
onShareAppMessage: function () { goCourseContent: function (e) {
let id = e.currentTarget.dataset.id
let sid = e.currentTarget.dataset.sid
wx.navigateTo({
url: '/pages/learnSystem/courseContent/courseContent?id=' + id + '&sid=' + sid
})
},
/**
* 分类选择 - 显示
*/
selFindShow: function (e) {
let index = e.currentTarget.dataset.index
let json = this.data.find
/* 本来就是打开状态,再点击关闭 */
if (json[index].isShow) {
json[index].isShow = false
} else {
for(let i=0; i<json.length; i++) {
json[i].isShow = false
}
json[index].isShow = true
}
this.setData({ 'find': json })
},
/**
* 分类选择 - 隐藏
*/
selFindHide: function (e) {
let json = this.data.find
for (let i = 0; i < json.length; i++) {
json[i].isShow = false
}
this.setData({ 'find': json })
},
/**
* 分类选择 - 选中某一项
*/
selFindSelect: function (e) {
let _data = e.currentTarget.dataset, index = _data.index
let json = this.data.find
for (let i = 0; i < json.length; i++) {
if (json[i].isShow) {
json[i].selectIndex = index
json[i].isShow = false
if (_data.val == '-1') {
delete this.param[_data.key]
} else {
this.param[_data.key] = _data.val
}
break
}
}
this.setData({ 'find': json })
/* 调用接口 */
wx.showLoading({ title: '加载中...', mask: true })
CourseApi.getCourseList(true, this.param, (json) => {
this.setData({ 'homeList': json })
wx.hideLoading()
})
},
/**
* 上拉加载更多
*/
loadmore: function () {
wx.showLoading({ title: '加载中...', mask: true })
CourseApi.getCourseList(true, this.param, (json) => {
this.setData({ 'homeList': json })
wx.hideLoading()
wx.showToast({ title: '没有更多了', icon: 'none' })
})
},
/**
* 上拉刷新
*/
updatenew: function () {
wx.showLoading({ title: '更新中...', mask: true })
CourseApi.getCourseList(true, this.param, (json) => {
this.setData({ 'homeList': json })
wx.hideLoading()
wx.showToast({ title: '已更新', icon: 'none' })
})
} }
}) })
\ No newline at end of file
{ {
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "MBA学习系统" "navigationBarTitleText": "MBA学习系统"
} }
\ No newline at end of file
<!--pages/learnSystem/home/home.wxml--> <!--pages/learnSystem/home/home.wxml-->
<view class='left'>已发布 2018-09-23 至 2019-10-21 已选修</view> <!-- 筛选 -->
<view class='select-filter'>
<view class='sel-item' bindtap='studyEarlyUpdate'>最近学习
<image style='{{filter.studyEarly == "down" ? "" : "display: none;"}}' src='../icons/home/down.png' mode='aspectFit'></image>
<image style='{{filter.studyEarly == "up" ? "" : "display: none;"}}' src='../icons/home/up.png' mode='aspectFit'></image>
</view>
<view class='sel-item' bindtap='selectTimeUpdate'>选修时间
<image style='{{filter.selectTime == "down" ? "" : "display: none;"}}' src='../icons/home/down.png' mode='aspectFit'></image>
<image style='{{filter.selectTime == "up" ? "" : "display: none;"}}' src='../icons/home/up.png' mode='aspectFit'></image>
</view>
<view class='sel-item right' bindtap='jumpToCourseSquare'><image src='../icons/home/sel.png' mode='aspectFit'></image>选课广场</view>
</view>
<!-- 分类 -->
<view class='select-find'>
<block wx:for='{{find}}' wx:key='{{index}}'>
<view class='col-5'><view class='sel-item {{item.isShow ? "on" : ""}}' bindtap='selFindShow' data-index='{{index}}'>{{item.name}}</view></view>
<block wx:if='{{item.isShow}}'>
<view class='content'>
<block wx:for='{{item.arrItem}}' wx:key='{{index1}}' wx:for-item="item1" wx:for-index="index1">
<view class='item {{item.selectIndex == index1 ? "on" : ""}}' bindtap='selFindSelect' data-index='{{index1}}' data-key='{{item.key}}' data-val='{{item1.val}}'>{{item1.name}}</view>
</block>
</view>
</block>
</block>
</view>
<block wx:if='{{find[0].isShow || find[1].isShow}}'>
<view class='select-find-open' bindtap='selFindHide'></view>
</block>
<scroll-view class='home-scroll' scroll-y bindscrolltolower='loadmore' bindscrolltoupper='updatenew' upper-threshold='0' lower-threshold='5'>
<block wx:for='{{homeList}}' wx:key='{{index}}'>
<view class='item-list' bindtap='goCourseContent' data-id='{{item.id}}' data-sid='{{item.sid}}'>
<image class='img' src='{{item.src}}' mode='aspectFill'></image>
<view class='ctx'>
<view class='top-ctx'>
<view class='tit'>{{item.title}}</view>
<view class='tit1'>
<block wx:for='{{item.arrTab}}' wx:key='{{index}}' wx:for-item='item1'>
<view class='tit1-item'>{{item1}}</view>
</block>
</view>
</view>
<view class='bottom-ctx'>
<view class='info'>
<view class='status'>{{item.status}}</view>
<view class='time'>{{item.time}}</view>
<view class='my-status'>{{item.myStatus}}</view>
</view>
<view class='progress'><view class='cur' style='width: {{item.progress || 0}};'></view></view>
</view>
</view>
</view>
</block>
<block wx:if='{{!homeList.length}}'>
<view class='no-data'>暂无相关课程</view>
</block>
</scroll-view>
\ No newline at end of file
/* pages/learnSystem/home/home.wxss */ /* pages/learnSystem/home/home.wxss */
.left {margin-left: 270rpx; margin-right: 25rpx; font-size: 18rpx;} /* 筛选 */
\ No newline at end of file .select-filter { position: fixed; width: 698rpx; padding: 0 26rpx; border-bottom: 1rpx solid #eeeeee; overflow: hidden; }
.select-filter .sel-item { float: left; margin-right: 90rpx; font-size: 28rpx; line-height: 90rpx; color: #313131; }
.select-filter .sel-item image { float: right; margin: 35rpx 0 0 5rpx; height: 20rpx; width: 20rpx; }
.select-filter .sel-item.right { float: right; margin-right: 0; color: #b49441; }
.select-filter .sel-item.right image { float: left; margin: 30rpx 5rpx 0 0; height: 26rpx; width: 25rpx; }
/* 分类 */
.select-find { position: fixed; top: 90rpx; z-index: 2; width: 750rpx; height: 90rpx; border-bottom: 1rpx solid #dcdcdc; }
.select-find .col-5 { float: left; position: relative; z-index: 2; width: 50%; height: 100%; }
.select-find .sel-item { position: absolute; top: 17rpx; left: 50%; width: 200rpx; color: #313131; font-size: 24rpx; line-height: 56rpx; text-align: center; background: #eeeeee; border-radius: 8rpx; -webkit-transform: translateX(-50%); transform: translateX(-50%); }
.select-find .sel-item.on { height: 70rpx; background: #fff; border: 1rpx solid #eeeeee; border-bottom: none; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.select-find .content { position: absolute; z-index: 0; top: 86rpx; width: 750rpx; background: #fff; overflow: hidden; border-top: 1rpx solid #eeeeee; }
.select-find .content .item { float: left; width: 50%; padding-left: 26rpx; font-size: 26rpx; line-height: 100rpx; color: #313131; box-sizing: border-box; -webkit-box-sizing: border-box; }
.select-find .content .item.on { color: #b49441; }
.select-find-open { position: absolute; z-index: 1; top: 180rpx; bottom: 0; left: 0; right: 0; background: rgba(0, 0, 0, 0.3); }
/* 列表 */
.home-scroll { position: fixed; top: 182rpx; bottom: 0; left: 0; right: 0; }
.home-scroll .item-list { padding: 33rpx 25rpx 33rpx 0; border-bottom: 1rpx solid #eeeeee; overflow: hidden; }
.home-scroll .item-list .img { float: left; width: 250rpx; height: 160rpx; }
.home-scroll .item-list .ctx { position: relative; margin-left: 266rpx; height: 160rpx; }
.home-scroll .item-list .ctx .top-ctx { position: absolute; top: -2rpx; width: 100%; overflow: hidden; }
.home-scroll .item-list .ctx .top-ctx .tit { font-size: 28rpx; color: #313131; line-height: 37rpx; }
.home-scroll .item-list .ctx .top-ctx .tit1 { margin-top: 8rpx; overflow: hidden; }
.home-scroll .item-list .ctx .top-ctx .tit1 .tit1-item { float: left; font-size: 20rpx; color: #313131; padding: 0 21rpx; line-height: 20rpx; border-right: 1rpx solid #a0a0a0; }
.home-scroll .item-list .ctx .top-ctx .tit1 .tit1-item:first-child { padding-left: 0; }
.home-scroll .item-list .ctx .top-ctx .tit1 .tit1-item:last-child { border-right: none; }
.home-scroll .item-list .ctx .bottom-ctx { position: absolute; bottom: 0; width: 100%; overflow: hidden; }
.home-scroll .item-list .ctx .bottom-ctx .info { margin-bottom: 10rpx; overflow: hidden; }
.home-scroll .item-list .ctx .bottom-ctx .info .status { float: left; font-size: 18rpx; color: #a0a0a0; margin-right: 25rpx; margin-top: 4rpx; }
.home-scroll .item-list .ctx .bottom-ctx .info .time { float: left; font-size: 18rpx; color: #a0a0a0; margin-top: 4rpx; }
.home-scroll .item-list .ctx .bottom-ctx .info .my-status { float: right; font-size: 22rpx; color: #313131; }
.home-scroll .item-list .ctx .bottom-ctx .progress { position: relative; width: 100%; height: 6rpx; border-radius: 6rpx; background: #c9c9c9; }
.home-scroll .item-list .ctx .bottom-ctx .progress .cur { position: absolute; height: 100%; border-radius: 6rpx; background: #b49441; }
.home-scroll .no-data { position: absolute; top: 50%; left: 50%; font-size: 30rpx; color: #112c42; -webkit-transform: translateX(-50%); transform: translateX(-50%); }
\ No newline at end of file
// pages/learnSystem/message/message.js // pages/learnSystem/message/message.js
Page({ const MsgApi = require('../../../apiService/MsgApi.js')
Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
msgList: [
// {
// isRead: false,
// id: '1',
// text: '2017年春季班三期班第三学期课程已经正式开始,作业截止提交时间为2018年1月10日,请三期班同学们合理安排学习时间。2017年春季班三期班第三学期课程已经正式开始,作业截止提交时间为2018年1月10日,请三期班同学们合理安排学习时间。',
// time: '2015-05-22 15:51',
// isShow: false // 该字段用来做 每条信息的打开、关闭
// }
]
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
wx.showLoading({ title: '页面加载中...', mask: true })
MsgApi.getMyMsg((json) => {
this.setData({ 'msgList': json })
wx.hideLoading()
})
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {},
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {},
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () { onHide: function () {},
},
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { onUnload: function () {},
},
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {
// 显示顶部刷新图标
wx.showNavigationBarLoading();
wx.showLoading({ title: '更新中...', mask: true })
MsgApi.getMyMsg((json) => {
this.setData({ 'msgList': json })
wx.hideLoading()
// 隐藏导航栏加载框
wx.hideNavigationBarLoading();
// 停止下拉动作
wx.stopPullDownRefresh();
})
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function () {},
},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {},
/**
* 是否可以打开查看消息
*/
canishow: function (e) {
let i = e.currentTarget.dataset.index
let cname = 'msgList[' + i + '].isShow'
this.setData({ [cname]: !this.data.msgList[i].isShow })
cname = 'msgList[' + i + '].isRead'
this.setData({ [cname]: true })
/* 如果需要,再调用已读接口 */
},
/**
* 滚动到底部,加载更多数据
*/
loadmore: function () {
let _that = this;
wx.showLoading({ title: '数据加载中...', mask: true })
setTimeout(function () {
wx.showToast({ title: '没有更多了', icon: 'none' })
wx.hideLoading()
}, 2000)
} }
}) })
\ No newline at end of file
{ {
"enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "消息" "navigationBarTitleText": "消息"
} }
\ No newline at end of file
<!--pages/learnSystem/message/message.wxml--> <!--pages/learnSystem/message/message.wxml-->
<text>pages/learnSystem/message/message.wxml</text> <scroll-view class='msg-scroll' scroll-y bindscrolltolower="loadmore">
<block wx:for='{{msgList}}' wx:key='{{index}}'>
<view class='item-msg' bindtap='canishow' data-index='{{index}}'>
<view class='flag {{item.isRead ? "read" : ""}}'>{{item.isRead ? '已读' : 'new'}}</view>
<rich-text class='text {{item.isShow ? "" : "on"}}' nodes="{{item.text}}"></rich-text>
<view class='ellipsis {{item.isShow ? "on" : ""}}'>....</view>
<view class='time'>{{item.time}}</view>
</view>
</block>
<block wx:if='{{!msgList.length}}'>
<view class='no-data'>暂无消息</view>
</block>
</scroll-view>
/* pages/learnSystem/message/message.wxss */ /* pages/learnSystem/message/message.wxss */
.msg-scroll { position: absolute; top: 0; bottom: 0; left: 0; right: 0; }
.msg-scroll .item-msg { position: relative; width: 750rpx; padding: 30rpx 26rpx 30rpx 26rpx; border-bottom: 3rpx dashed #c9c9c9; overflow: hidden; -moz-box-sizing: border-box; box-sizing: border-box; }
.msg-scroll .item-msg .flag { float: left; margin-bottom: 10rpx; padding: 0 10rpx; font-size: 22rpx; line-height: 40rpx; color: #fff; background: #d50000; border-radius: 4rpx; }
.msg-scroll .item-msg .flag.read { background: #a0a0a0; }
.msg-scroll .item-msg .text { float: left; width: 100%; color: #535353; font-size: 24rpx; line-height: 34rpx; text-align: justify; }
.msg-scroll .item-msg .text.on { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; text-overflow: ellipsis; overflow: hidden; word-break:break-all; }
.msg-scroll .item-msg .ellipsis { position: absolute; right: 24rpx; bottom: 72rpx; padding: 5rpx 0; color: #535353; background: #fff; font-size: 24rpx; }
.msg-scroll .item-msg .ellipsis.on { display: none; }
.msg-scroll .item-msg .time { float: left; margin-top: 20rpx; color: #a0a0a0; font-size: 20rpx; }
.msg-scroll .no-data { position: absolute; top: 50%; left: 50%; font-size: 30rpx; color: #112c42; -webkit-transform: translateX(-50%); transform: translateX(-50%); }
\ No newline at end of file
// pages/learnSystem/my/my.js // pages/learnSystem/my/my.js
Page({ Page({
/* 页面的初始数据 */
/** data: { userInfo: { nickName: '用户名', avatarUrl: '../icons/my/default.jpg' } },
* 页面的初始数据 /* 生命周期函数--监听页面加载 */
*/ onLoad: function (options) { this.setData({ 'userInfo': wx.getStorageSync('userInfo') }) },
data: { /* 生命周期函数--监听页面初次渲染完成 */
onReady: function () { },
}, /* 我的讨论 */
goMyDiscuss: function () { wx.navigateTo({ url: '/pages/learnSystem/myDiscuss/myDiscuss' }) },
/** /* 我的学分 */
* 生命周期函数--监听页面加载 goMyScore: function () { wx.navigateTo({ url: '/pages/learnSystem/myScore/myScore' }) },
*/ /* 退出系统 */
onLoad: function (options) { outSystem: function () { wx.reLaunch({ url: '/pages/index/index' }) },
/* 输出信息 */
}, printMsg: function (detail) { console.log(detail.status) }
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
}) })
\ No newline at end of file
{ {
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "我的" "navigationBarTitleText": "我的"
} }
\ No newline at end of file
<!--pages/learnSystem/my/my.wxml--> <!--pages/learnSystem/my/my.wxml-->
<text>pages/learnSystem/my/my.wxml</text> <view class='my'>
<view class='my-info'>
<image class='img' src='{{userInfo.avatarUrl}}'></image>
<view class='name'>{{userInfo.nickName}}</view>
</view>
<view class='my-select'>
<view class='item' bindtap='goMyDiscuss'>
<image class='img' src='../icons/my/my-discuss.png' mode='aspectFit'></image>
<view class='text'>我的讨论</view>
</view>
<view class='item' bindtap='goMyScore'>
<image class='img' src='../icons/my/my-credit.png' mode='aspectFit'></image>
<view class='text'>我的学分</view>
</view>
<view class='item' bindtap='outSystem'>
<image class='img' src='../icons/my/out-system.png' mode='aspectFit'></image>
<view class='text'>退出系统</view>
</view>
<view class='item'>
<image class='img' src='../icons/my/my-waiting.png' mode='aspectFit'></image>
<view class='text'>敬请期待</view>
</view>
</view>
<!-- 增加 关联公众号组件 - 模拟器上不显示,真机没问题 -->
<view class='relative-account'>
<official-account class='item' bindload='printMsg'></official-account>
</view>
</view>
/* pages/learnSystem/my/my.wxss */ /* pages/learnSystem/my/my.wxss */
.my { overflow: hidden; }
.my .my-info { position: relative; display: block; width: 100%; height: 320rpx; background: #b49441; }
.my .my-info .img { position: absolute; top: 50%; left: 68rpx; width: 138rpx; height: 138rpx; border-radius: 50%; -webkit-transform: translateY(-50%); transform: translateY(-50%); }
.my .my-info .name { position: absolute; top: 50%; left: 226rpx; padding-right: 25rpx; font-size: 28rpx; line-height: 32rpx; color: #fff; -webkit-transform: translateY(-50%); transform: translateY(-50%); }
.my .my-select { overflow: hidden; }
.my .my-select view { -webkit-box-sizing: border-box; box-sizing: border-box; }
.my .my-select .item { float: left; height: 250rpx; width: 250rpx; border-bottom: 1rpx solid #dcdcdc; border-right: 1px solid #dcdcdc; }
.my .my-select .item:nth-child(3) { border-right-color: #fff; }
.my .my-select .item .img { display: block; margin: 70rpx auto 24rpx auto; width: 73rpx; height: 73rpx; }
.my .my-select .item .text { font-size: 22rpx; color: #313131; text-align: center; }
/* 关联公众号 */
.relative-account { position: relative; margin-top: 50rpx; width: 100%; height: 172rpx; }
.relative-account .item { position: absolute; top: 0; left: 50%; width: 81%; height: 168rpx; border: 1rpx solid #dcdcdc; -webkit-transform: translateX(-50%); transform: translateX(-50%); }
\ No newline at end of file
// pages/learnSystem/myDiscuss/myDiscuss.js
const DiscussApi = require('../../../apiService/DiscussApi.js')
Page({
/**
* 页面的初始数据
*/
data: {
tabs: [{
title: '我提出的问题',
isShow: true,
path: '/my'
}, {
title: '我参与的问题',
isShow: false,
path:'/involved'
}],
discussList: [
// {
// user: {
// url: '',
// name: '用户名000',
// time: '2018-2-12 15:28:47'
// },
// title: '这是一个一句话问题这是一个一句话问题这是一个一句话问题标题这是一个一句话问题',
// text: '<p>王家有三兄弟甲、乙、丙,丙幼年时送给胡某作养子,丙结婚时,胡某为其盖了新房,后因失火致使该房屋被烧毁。丙的生父母就将自己<p>',
// askCnt: 20,
// TouCnt: 100,
// courseName: '在线学习课程'
// }
]
},
param: {
limit: 10, // 默认每页显示10条
offset: 0 // 偏移量(未考虑传输时,产生新问题情况)
},
loadAjax: function () {
wx.showLoading({ title: '页面加载中...', mask: true })
let pathUrl = '';
for (let i = 0; i < this.data.tabs.length; i++) {
if (this.data.tabs[i].isShow) {
pathUrl = this.data.tabs[i].path
}
}
DiscussApi.getDiscussList(pathUrl, this.param, (json) => {
this.setData({ 'discussList': json })
wx.hideLoading()
})
},
/**
* 切换 - tab
*/
tabSelect: function (e) {
let index = e.currentTarget.dataset.index
let json = this.data.tabs
for (let i = 0; i < json.length; i++) {
json[i].isShow = false
}
json[index].isShow = true
this.setData({ 'tabs': json })
this.param.offset = 0
this.loadAjax()
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) { this.loadAjax(); },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () { },
/**
* 生命周期函数--监听页面显示
*/
onShow: function () { this.loadAjax(); },
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () { },
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () { },
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () { },
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () { },
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () { },
/**
* 跳转到对应 问题详情页
*/
goDiscussDetail: function (e) {
let qid = e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/learnSystem/discussDetail/discussDetail?qid=' + qid
})
},
/**
* 上拉加载更多
*/
loadmore: function () {
wx.showLoading({ title: '加载中...', mask: true })
let pathUrl = '';
for (let i = 0; i < this.data.tabs.length; i++) {
if (this.data.tabs[i].isShow) {
pathUrl = this.data.tabs[i].path
}
}
let _data = this.data.discussList
this.param.offset = _data.length
DiscussApi.getDiscussList(pathUrl, this.param, (json) => {
Array.prototype.push.apply(_data, json)
json.length && this.setData({ 'discussList': _data })
wx.hideLoading()
!json.length && wx.showToast({ title: '没有更多了', icon: 'none' })
})
},
/**
* 下拉刷新
*/
updatenew: function () {
wx.showLoading({ title: '更新中...', mask: true })
let pathUrl = '';
for (let i = 0; i < this.data.tabs.length; i++) {
if (this.data.tabs[i].isShow) {
pathUrl = this.data.tabs[i].path
}
}
this.param.offset = 0
DiscussApi.getDiscussList(pathUrl, this.param, (json) => {
this.setData({ 'discussList': json })
wx.hideLoading()
wx.showToast({ title: '已更新', icon: 'none' })
})
}
})
\ No newline at end of file
{
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "我的讨论"
}
\ No newline at end of file
<!--pages/learnSystem/myDiscuss/myDiscuss.wxml-->
<view class='tab-select'>
<block wx:for='{{tabs}}' wx:key='{{index}}'>
<view class='item {{item.isShow ? "on" : ""}}' bindtap='tabSelect' data-index='{{index}}'>{{item.title}}</view>
</block>
</view>
<scroll-view class='discuss-scroll' scroll-y bindscrolltolower='loadmore' bindscrolltoupper='updatenew' upper-threshold='0' lower-threshold='0'>
<block wx:for='{{discussList}}' wx:key='{{index}}'>
<view class='item-list' bindtap='goDiscussDetail' data-id='{{item.id}}' data-index='{{index}}'>
<view class='user'>
<image class='img' src='{{item.user.url}}' mode='scaleToFill'></image>
<view class='right'>
<view class='name'>{{item.user.name}}</view>
<view class='time'>{{item.user.time}}</view>
</view>
</view>
<view class='title'>{{item.title}}</view>
<rich-text class='text {{item.isShow ? "" : "on"}}' nodes="{{item.text}}"></rich-text>
<view class='ellipsis {{item.isShow ? "on" : ""}}' style='display: {{item.title.length > 56 ? "" : "none"}};'>....</view>
<view class='result'>{{item.askCnt}} 回答<view style='display: inline-block; width: 20rpx;'></view>{{item.TouCnt}} 投票</view>
<!-- <view class='course-name'>{{item.courseName}}</view> -->
</view>
</block>
<block wx:if='{{!discussList.length}}'>
<view class='no-data'>暂无相关讨论</view>
</block>
</scroll-view>
\ No newline at end of file
/* pages/learnSystem/myDiscuss/myDiscuss.wxss */
.tab-select { width: 100%; border-bottom: 1rpx solid #c9c9c9; overflow: hidden; background: #fff; }
.tab-select .item { float: left; padding: 0 30rpx; font-size: 28rpx; line-height: 60rpx; color: #191919; text-align: center; box-sizing: border-box; -webkit-box-sizing: border-box; }
.tab-select .item.on { line-height: 60rpx; border-bottom: 4rpx solid #b49441; color: #b49441; }
.discuss-scroll { position: absolute; top: 67rpx; left: 0; right: 0; bottom: 0; background: #f7f7f7; }
.discuss-scroll .item-list:first-child { margin-top: 42rpx; }
.discuss-scroll .item-list { position: relative; padding: 30rpx 26rpx; margin-bottom: 20rpx; background: #fff; box-shadow: 0 2rpx 4rpx rgba(10, 4, 6, 0.1); }
.discuss-scroll .item-list .user { position: relative; overflow: hidden; }
.discuss-scroll .item-list .user .img { float: left; width: 60rpx; height: 60rpx; background: #e5e5e5; border-radius: 50%; }
.discuss-scroll .item-list .user .right { position: absolute; left: 72rpx; top: 50%; -webkit-transform: translateY(-50%); transform: translateY(-50%); }
.discuss-scroll .item-list .user .right .name { font-size: 20rpx; color: #313131; text-overflow: ellipsis; overflow: hidden; word-break:break-all; }
.discuss-scroll .item-list .user .right .time { margin-top: 5rpx; font-size: 18rpx; color: #a0a0a0; }
.discuss-scroll .item-list .title { margin: 15rpx 0; font-size: 28rpx; color: #313131; line-height: 40rpx; text-align: justify; }
.discuss-scroll .item-list .text { font-size: 24rpx; color: #535353; line-height: 36rpx; text-align: justify; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; text-overflow: ellipsis; overflow: hidden; word-break:break-all; }
.discuss-scroll .item-list .ellipsis { position: absolute; right: 30rpx; bottom: 66rpx; padding: 5rpx 15rpx 5rpx 5rpx; color: #535353; background: #fff; font-size: 24rpx; }
.discuss-scroll .item-list .ellipsis.on { display: none; }
.discuss-scroll .item-list .result { margin-top: 15rpx; font-size: 20rpx; color: #313131; }
.discuss-scroll .item-list .course-name { position: absolute; right: 32rpx; bottom: 28rpx; font-size: 20rpx; color: #b49441; }
.discuss-scroll .no-data { position: absolute; top: 50%; left: 50%; font-size: 30rpx; color: #112c42; -webkit-transform: translateX(-50%); transform: translateX(-50%); }
\ No newline at end of file
// pages/learnSystem/myScore/myScore.js
const ScoreApi = require('../../../apiService/ScoreApi.js')
Page({
/**
* 页面的初始数据
*/
data: {
score: {
total: 0,
myTotal: 0,
myTotalStr: '0%',
must: 0,
myMust: 0,
myMustStr: '0%',
unmust: 0,
myUnmust: 0,
myUnmustStr: '0%'
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.showLoading({ title: '页面加载中...', mask: true })
ScoreApi.getMyScore((json) => {
this.setData({ 'score': json })
wx.hideLoading()
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
// 显示顶部刷新图标
wx.showNavigationBarLoading()
wx.showLoading({ title: '更新中...', mask: true })
ScoreApi.getMyScore((json) => {
this.setData({ 'score': json })
wx.hideLoading()
// 隐藏导航栏加载框
wx.hideNavigationBarLoading()
// 停止下拉动作
wx.stopPullDownRefresh()
})
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {}
})
\ No newline at end of file
{
"enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "我的学分"
}
\ No newline at end of file
<!--pages/learnSystem/myScore/myScore.wxml-->
<view class='my-score'>
<view class='title'>总计学分<view class='score'>{{score.total}}</view></view>
<view class='pro-line total'>
<view class='active' style='width: {{score.myTotalStr}};'>
<view class='text {{score.myTotal/score.total>0.2 ? "" : "left"}}'>{{score.myTotal}} ({{score.myTotalStr}})</view>
</view>
</view>
<view class='col-5'>
<view class='title'>必修学分<view class='score'>{{score.must}}</view></view>
<view class='pro-line must'>
<view class='active' style='width: {{score.myMustStr}};'>
<view class='text {{score.myMust/score.must>0.4 ? "" : "left"}}'>{{score.myMust}} ({{score.myMustStr}})</view>
</view>
</view>
</view>
<view class='col-5 right'>
<view class='title'>选修学分<view class='score'>{{score.unmust}}</view></view>
<view class='pro-line unmust'>
<view class='active' style='width: {{score.myUnmustStr}};'>
<view class='text {{score.myUnmust/score.unmust>0.4 ? "" : "left"}}'>{{score.myUnmust}} ({{score.myUnmustStr}})</view>
</view>
</view>
</view>
<view></view>
</view>
/* pages/learnSystem/myScore/myScore.wxss */
.my-score { padding: 30rpx 26rpx 100rpx 26rpx; overflow: hidden; }
.my-score .title { padding: 0 10rpx 0 0; width: 100%; font-size: 32rpx; line-height: 50rpx; color: #313131; box-sizing: border-box; -webkit-box-sizing: border-box; }
.my-score .title .score { float: right; color: #666666; font-size: 28rpx; }
.my-score .pro-line { position: relative; width: 100%; height: 60rpx; background: #dcdcdc; }
.my-score .pro-line .active { position: absolute; z-index: 1; left: 0; top: 0; bottom: 0; }
.my-score .pro-line .active .text { position: absolute; right: 10rpx; line-height: 60rpx; font-size: 26rpx; color: #fff; word-break:keep-all; white-space:nowrap; }
.my-score .pro-line .active .text.left { left: 10rpx; right: none; }
.my-score .pro-line.total .active { background: #df9d75; }
.my-score .pro-line.must .active { background: #8ca4cf; }
.my-score .pro-line.unmust .active { background: #66c6bd; }
.my-score .col-5 { float: left; width: 49%; }
.my-score .col-5.right { float: right; }
\ No newline at end of file
/** /**
* 创建一个audio对象 * 创建一个audio对象
* @param {[string]} selectorId [audio组件id对应选择器字符串] * @param {[string]} src [audio组件对应音频源]
* @param {[object]} _that [当前组件所在页面对应this]
*/ */
var Audio = function (selectorId) { var Audio = function (src, _that) {
if (!(this instanceof Audio)) { if (!(this instanceof Audio)) {
return new Audio(selectorId); return new Audio(src, _that);
} else { } else {
this._audio = this.init(selectorId); this._audio = this.init(src, _that);
this.currentTime = 0; // 当前时间 this.currentTime = 0; // 当前时间
this.totalTime = 0; // 总时间 this.totalTime = 0; // 总时间
this.rateIndex = 2; // 取值为 RATE中的 下标 0,1,2,3,4 this.rateIndex = 2; // 取值为 RATE中的 下标 0,1,2,3,4
...@@ -25,8 +26,16 @@ var Audio = function (selectorId) { ...@@ -25,8 +26,16 @@ var Audio = function (selectorId) {
Audio.prototype = { Audio.prototype = {
constructor: Audio, constructor: Audio,
RATE: ['0.5', '0.8', '1.0', '1.25', '1.5'], RATE: ['0.5', '0.8', '1.0', '1.25', '1.5'],
init: function (selectorId) { init: function (src, _that) {
return wx.createAudioContext(selectorId); let _auCtx = wx.createInnerAudioContext();
_auCtx.autoplay = false;
_auCtx.src = src;
/* 使用绑定事件,代替wxml中的事件绑定 */
_auCtx.onTimeUpdate(() => { let e = { detail: { currentTime: _auCtx.currentTime, duration: _auCtx.duration } }; _that.timeUpdate(e) })
_auCtx.onPlay(() => { _that.beginPlayVA() })
_auCtx.onError((e) => { _that.playError(e) })
_auCtx.onEnded(() => { _that.playEnded })
return _auCtx;
}, },
play: function () { play: function () {
this._audio.play(); this._audio.play();
...@@ -48,6 +57,8 @@ Audio.prototype = { ...@@ -48,6 +57,8 @@ Audio.prototype = {
if (this.rateIndex > 4) this.rateIndex = 0; if (this.rateIndex > 4) this.rateIndex = 0;
this._audio.playbackRate(parseFloat(this.RATE[this.rateIndex])); this._audio.playbackRate(parseFloat(this.RATE[this.rateIndex]));
} }
} }
module.exports = { module.exports = {
Audio: Audio Audio: Audio
......
...@@ -5,6 +5,6 @@ ...@@ -5,6 +5,6 @@
<image src='./contentAudio/icons/loading_small.gif' class='loading-image {{status.imagesLoaded && "none"}}' mode='aspectFit'/> <image src='./contentAudio/icons/loading_small.gif' class='loading-image {{status.imagesLoaded && "none"}}' mode='aspectFit'/>
<image wx:if='{{image.imgUrls[image.current]}}' src='{{image.imgUrls[image.current]}}' class='slide-image' mode='aspectFill' bindload='imagesLoaded'/> <image wx:if='{{image.imgUrls[image.current]}}' src='{{image.imgUrls[image.current]}}' class='slide-image' mode='aspectFill' bindload='imagesLoaded'/>
<view wx:if='{{!image.imgUrls[image.current]}}' class='slide-image'>本课程暂无PPT</view> <view wx:if='{{!image.imgUrls[image.current]}}' class='slide-image'>本课程暂无PPT</view>
<audio id="my-audio" class='my-audio' src='{{audio.src}}' controls='{{false}}' bindtimeupdate='timeUpdate' binderror='playError'></audio> <!-- <audio id="my-audio" class='my-audio' src='{{audio.src}}' controls='{{false}}' bindtimeupdate='timeUpdate' bindplay='beginPlayVA' binderror='playError' bindended='playEnded'></audio> -->
</view> </view>
</template> </template>
\ No newline at end of file
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
<view class='content-video' <view class='content-video'
style='{{status.isSet && status.isVideo ? "display: none;" : "" }} {{status.isImages && status.isVideo ? "display: none;" : "" }} {{status.isAudio ? "display: none;" : "" }} {{chapterList.isShow && status.isVideo ? "display: none;" : "" }} {{ status.isLoading ? "display: none": "" }}' style='{{status.isSet && status.isVideo ? "display: none;" : "" }} {{status.isImages && status.isVideo ? "display: none;" : "" }} {{status.isAudio ? "display: none;" : "" }} {{chapterList.isShow && status.isVideo ? "display: none;" : "" }} {{ status.isLoading ? "display: none": "" }}'
> >
<video id='my-video' class='my-video' src='{{video.src}}' initial-time='{{ctrlBar.initial_time}}' show-center-play-btn='{{false}}' controls='{{false}}' bindtimeupdate='timeUpdate' bindplay='beginPlayVA' binderror='playError' autoplay='{{false}}'></video> <video id='my-video' class='my-video' src='{{video.src}}' initial-time='{{ctrlBar.initial_time}}' show-center-play-btn='{{false}}' controls='{{false}}' bindtimeupdate='timeUpdate' autoplay='false' bindfullscreenchange='beginAndOutFullScreen' bindpause='beginPauseVA' bindplay='beginPlayVA' binderror='playError' bindended='playEnded' autoplay='{{false}}'></video>
</view> </view>
</template> </template>
\ No newline at end of file
...@@ -28,9 +28,9 @@ ...@@ -28,9 +28,9 @@
<image class='img' src='./controlBar/icons/btn-back.png' mode='scaleToFill' data-id='{{chapterList.prevVideo.id}}' data-hasVA='{{chapterList.prevVideo.time}}' data-name='{{chapterList.prevVideo.name}}' bindtap='prevChapter'></image> <image class='img' src='./controlBar/icons/btn-back.png' mode='scaleToFill' data-id='{{chapterList.prevVideo.id}}' data-hasVA='{{chapterList.prevVideo.time}}' data-name='{{chapterList.prevVideo.name}}' bindtap='prevChapter'></image>
</view> </view>
<view class='opt'> <view class='opt'>
<image class='img init-page {{initPageFlag ? "" : "none"}}' src='./controlBar/icons/loading_small.gif' mode='aspectFit'></image> <image class='img init-page {{initVAFlag ? "" : "none"}}' src='./controlBar/icons/loading_small.gif' mode='aspectFit'></image>
<image class='img play {{initPageFlag ? "none" : ""}} {{!ctrlBar.isPlay ? "" : "none"}}' src='./controlBar/icons/btn-play.png' mode='scaleToFill' bindtap='playVA'></image> <image class='img play {{initVAFlag ? "none" : ""}} {{!ctrlBar.isPlay ? "" : "none"}}' src='./controlBar/icons/btn-play.png' mode='scaleToFill' bindtap='playVA'></image>
<image class='img pause {{initPageFlag ? "none" : ""}} {{!ctrlBar.isPlay ? "none" : ""}}' src='./controlBar/icons/btn-pause.png' mode='scaleToFill' bindtap='pauseVA'></image> <image class='img pause {{initVAFlag ? "none" : ""}} {{!ctrlBar.isPlay ? "none" : ""}}' src='./controlBar/icons/btn-pause.png' mode='scaleToFill' bindtap='pauseVA'></image>
</view> </view>
<view class='btn-front'> <view class='btn-front'>
<image class='img' src='./controlBar/icons/btn-front.png' mode='scaleToFill' data-id='{{chapterList.nextVideo.id}}' data-hasVA='{{chapterList.nextVideo.time}}' data-name='{{chapterList.nextVideo.name}}' bindtap='nextChapter'></image> <image class='img' src='./controlBar/icons/btn-front.png' mode='scaleToFill' data-id='{{chapterList.nextVideo.id}}' data-hasVA='{{chapterList.nextVideo.time}}' data-name='{{chapterList.nextVideo.name}}' bindtap='nextChapter'></image>
......
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论