Commit 97a1e97d authored by lvtz's avatar lvtz

add 作业打卡 改版

parent a3d8df4a
{
"pages": [
"ucenter/index"
"ucenter/index",
"business/pages/webview/index"
],
"subpackages": [
{
......@@ -327,7 +328,8 @@
"root": "business/pages/themeeditor",
"name": "businessthemeeditor",
"pages": [
"index"
"index",
"setting"
]
},
{
......
......@@ -29,6 +29,7 @@ Page({
maxAudioCount: 600,
imageRoot: app.globalData.imageRoot,
imageVersion: app.globalData.imageVersion,
localImageRoot: '../../../images/',
id: 0,
tid: 0,
sid: 0,
......@@ -95,6 +96,15 @@ Page({
modalClass: false,
modelClassAnimate: false,
selectClass: '', // 当前班级
mockTitleList: [
{type: 1,label:"课后作业",title: '请各位同学提交本次课后布置的作业'},
{type: 2,label:"周末作业",title: '请各位同学提交本周周末布置的作业'},
{type: 3,label:"演讲一段话",title: '请各位同学演讲本次作业要讲的话'},
{type: 4,label:"练习动作",title: '请各位同学练习一下动作'},
{type: 5,label:"今日练字作业",title: '请各位同学认真查看今日要练习的作业,并跟着练习'}
],
currentMockType: 2
},
onLoad: function(options) { // Do some initialize when page load.
this.innerAudioContext = wx.createInnerAudioContext(); // 当前页面唯一的一个音频容器
......@@ -128,6 +138,22 @@ Page({
},
onReady: function() { // Do something when page ready.
},
onShow: function() { // Do something when page show.
},
onHide: function() { // Do something when page hide.
this.innerAudioContext.pause();
this.resetAudiosPlayStatus()
clearInterval(this.data.voiceInterval);
},
onUnload: function() { // Do something when page close.
this.innerAudioContext.pause();
this.setData({
audioStorage: {
}
})
clearInterval(this.data.voiceInterval);
},
getStartDatePickerArr (date, time) {
let currentDate = Date.parse(new Date(`${date} ${time}`.replace(/-/g, '/')));
......@@ -280,24 +306,7 @@ Page({
}
}
},
onShow: function() { // Do something when page show.
},
onHide: function() { // Do something when page hide.
this.innerAudioContext.pause();
this.resetAudiosPlayStatus()
clearInterval(this.data.voiceInterval);
},
onUnload: function() { // Do something when page close.
this.innerAudioContext.pause();
this.setData({
audioStorage: {
}
})
clearInterval(this.data.voiceInterval);
},
onTabItemTap(item) {},
loadThemeData({
id,
tid
......@@ -362,7 +371,7 @@ Page({
value
} = e.detail;
this.setData({
'params.title': value.length > 20 ? value.substr(0, 20) : value
'params.title': value.length > 36 ? value.substr(0, 36) : value
})
},
selectType() {
......@@ -651,83 +660,7 @@ Page({
})
},
// 跟录音相关的操作
cheatswitch() {
if (Number(this.data.params.is_cheat) == 0) {
this.setData({
'params.is_cheat': 1
})
} else if (Number(this.data.params.is_cheat) == 1) {
this.setData({
'params.is_cheat': 0
})
}
},
encryptswitch() {
if (Number(this.data.params.is_encrypt) == 0) {
this.setData({
'params.is_encrypt': 1
})
} else if (Number(this.data.params.is_encrypt) == 1) {
this.setData({
'params.is_encrypt': 0
})
}
},
readswitch(){
if (Number(this.data.params.force_status) == 2) {
this.setData({
'params.force_status': 1
})
} else if (Number(this.data.params.force_status) == 1) {
this.setData({
'params.force_status': 2
})
}
},
textswitch() {
if (Number(this.data.params.text_require_status) == 2) {
this.setData({
'params.text_require_status': 1
})
} else if (Number(this.data.params.text_require_status) == 1) {
this.setData({
'params.text_require_status': 2
})
}
},
imageswitch() {
if (Number(this.data.params.image_require_status) == 2) {
this.setData({
'params.image_require_status': 1
})
} else if (Number(this.data.params.image_require_status) == 1) {
this.setData({
'params.image_require_status': 2
})
}
},
videoswitch() {
if (Number(this.data.params.video_require_status) == 2) {
this.setData({
'params.video_require_status': 1
})
} else if (Number(this.data.params.video_require_status) == 1) {
this.setData({
'params.video_require_status': 2
})
}
},
audioswitch() {
if (Number(this.data.params.audio_require_status) == 2) {
this.setData({
'params.audio_require_status': 1
})
} else if (Number(this.data.params.audio_require_status) == 1) {
this.setData({
'params.audio_require_status': 2
})
}
},
remindswitch() {
if (Number(this.data.params.push_status) == 2) {
this.setData({
......@@ -739,70 +672,6 @@ Page({
})
}
},
readtimeInput(e) {
const {
value
} = e.detail;
this.setData({
'params.force_num': Number(value),
})
},
textInput(e) {
const {
value
} = e.detail;
if (Number(value) > this.data.maxLength) {
this.setData({
'params.text_require_num': Number(this.data.maxLength),
})
} else {
this.setData({
'params.text_require_num': Number(value),
})
}
},
imageInput(e) {
const {
value
} = e.detail;
if (Number(value) > this.data.maxImgCount) {
this.setData({
'params.image_require_num': Number(this.data.maxImgCount),
})
} else {
this.setData({
'params.image_require_num': Number(value),
})
}
},
videoInput(e) {
const {
value
} = e.detail;
if (Number(value) > this.data.maxVideoCount) {
this.setData({
'params.video_require_num': Number(this.data.maxVideoCount),
})
} else {
this.setData({
'params.video_require_num': Number(value),
})
}
},
audioInput(e) {
const {
value
} = e.detail;
if (Number(value) > this.data.maxAudioCount) {
this.setData({
'params.audio_require_num': Number(this.data.maxAudioCount),
})
} else {
this.setData({
'params.audio_require_num': Number(value),
})
}
},
tipTimeChange(e){
const {
value
......@@ -822,17 +691,6 @@ Page({
if (type == 2) {}
return new Date(date1.replace(/-/g, '/')).getTime() - new Date(date2.replace(/-/g, '/')).getTime() > 0 ? false : true
},
showLimit(){
this.setData({
showLimitF:!this.data.showLimitF
}
)
},
showRead(){
this.setData({
showReadF:!this.data.showReadF
})
},
// 切换选择班级 start
getClassList(type) {
let dakarole = LocalStorage.getItem('dakarole');
......@@ -977,5 +835,41 @@ Page({
})
}, 200)
},
jumpToSolution(){
wx.navigateTo({
url: `/business/pages/webview/index?type='video'`
})
},
bindMockTitle(e){
let that = this;
const {type} = e.currentTarget.dataset;
if(type==that.data.currentMockType){
return
}
let optMockTitle = that.data.mockTitleList.filter(item=>item.type==type)[0];
that.setData({
'params.title': optMockTitle.title,
currentMockType: type
})
},
// 切换选择班级 end
bindMoreSetting(){
const {
is_cheat,
is_encrypt,
force_status,
force_num,
text_require_status,
text_require_num,
image_require_status,
image_require_num,
audio_require_status,
video_require_num,
video_require_status,
audio_require_num
} = this.data.params
wx.navigateTo({
url: `/business/pages/themeeditor/setting?is_cheat=${is_cheat}&is_encrypt=${is_encrypt}&force_status=${force_status}&force_num=${force_num}&text_require_status=${text_require_status}&text_require_num=${text_require_num}&image_require_status=${image_require_status}&image_require_num=${image_require_num}&audio_require_status=${audio_require_status}&video_require_num=${video_require_num}&video_require_status=${video_require_status}&audio_require_num=${audio_require_num}`
})
}
})
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
// business/pages/themeeditor/setting.js
Page({
data: {
is_cheat: 0,
is_encrypt: 0,
force_status: 2,
force_num:0,
text_require_status:2,
text_require_num:0,
image_require_status:2,
image_require_num:0,
video_require_status:2,
video_require_num:0,
audio_require_status:2,
audio_require_num:0,
tipObj: [
{type: '1', title: '防作弊模式', content: ['开启后学员打卡后','才能看到其他同学的打卡作品!']},
{type: '2', title: '加密模式', content: ['开启后非本校在读人员','看不到老师的主题内容的!']},
{type: '3', title: '强制阅读', content: ['开启后学员点击打卡后将强制阅读','老师布置的作业内容, 倒计时结束后','才能去提交作业!']},
{type: '4', title: '文字要求', content: ['学员输入文字最少多少字']},
{type: '5', title: '图片要求', content: ['学员上传图片最少多少张']},
{type: '6', title: '录音要求', content: ['学员录音时长最少多少秒']},
{type: '7', title: '视频要求', content: ['学员上传视频最少几个视频']}
],
tipModalShow: false,
optTipObj: {},//点击获取的提示内容
},
onLoad: function (options) {
let that = this;
const {is_cheat,
is_encrypt,
force_status,
force_num,
text_require_status,
text_require_num,
image_require_status,
image_require_num,
audio_require_status,
video_require_num,
video_require_status,
audio_require_num
} = options;
that.setData({
is_cheat,
is_encrypt,
force_status,
force_num,
text_require_status,
text_require_num,
image_require_status,
image_require_num,
audio_require_status,
video_require_num,
video_require_status,
audio_require_num
})
},
cheatswitch() {
if (Number(this.data.is_cheat) == 0) {
this.setData({
is_cheat: 1
})
} else if (Number(this.data.is_cheat) == 1) {
this.setData({
is_cheat: 0
})
}
},
encryptswitch() {
if (Number(this.data.is_encrypt) == 0) {
this.setData({
is_encrypt: 1
})
} else if (Number(this.data.is_encrypt) == 1) {
this.setData({
is_encrypt: 0
})
}
},
readswitch(){
if (Number(this.data.force_status) == 2) {
this.setData({
force_status: 1
})
} else if (Number(this.data.force_status) == 1) {
this.setData({
force_status: 2
})
}
},
textswitch() {
if (Number(this.data.text_require_status) == 2) {
this.setData({
text_require_status: 1
})
} else if (Number(this.data.text_require_status) == 1) {
this.setData({
text_require_status: 2
})
}
},
imageswitch() {
if (Number(this.data.image_require_status) == 2) {
this.setData({
image_require_status: 1
})
} else if (Number(this.data.image_require_status) == 1) {
this.setData({
image_require_status: 2
})
}
},
videoswitch() {
if (Number(this.data.video_require_status) == 2) {
this.setData({
video_require_status: 1
})
} else if (Number(this.data.video_require_status) == 1) {
this.setData({
video_require_status: 2
})
}
},
audioswitch() {
if (Number(this.data.audio_require_status) == 2) {
this.setData({
audio_require_status: 1
})
} else if (Number(this.data.audio_require_status) == 1) {
this.setData({
audio_require_status: 2
})
}
},
readtimeInput(e) {
const {
value
} = e.detail;
this.setData({
force_num: Number(value),
})
},
textInput(e) {
const {
value
} = e.detail;
if (Number(value) > this.data.maxLength) {
this.setData({
text_require_num: Number(this.data.maxLength),
})
} else {
this.setData({
text_require_num: Number(value),
})
}
},
imageInput(e) {
const {
value
} = e.detail;
if (Number(value) > this.data.maxImgCount) {
this.setData({
image_require_num: Number(this.data.maxImgCount),
})
} else {
this.setData({
image_require_num: Number(value),
})
}
},
videoInput(e) {
const {
value
} = e.detail;
if (Number(value) > this.data.maxVideoCount) {
this.setData({
video_require_num: Number(this.data.maxVideoCount),
})
} else {
this.setData({
video_require_num: Number(value),
})
}
},
audioInput(e) {
const {
value
} = e.detail;
if (Number(value) > this.data.maxAudioCount) {
this.setData({
audio_require_num: Number(this.data.maxAudioCount),
})
} else {
this.setData({
audio_require_num: Number(value),
})
}
},
bindBackPrevPage(){
let pages = getCurrentPages();
const {
is_cheat,
is_encrypt,
force_status,
force_num,
text_require_status,
text_require_num,
image_require_status,
image_require_num,
audio_require_status,
video_require_num,
video_require_status,
audio_require_num
} = this.data
let currPage = null; //当前页面
let prevPage = null; //上一个页面
if (pages.length >= 2) {
currPage = pages[pages.length - 1]; //当前页面
prevPage = pages[pages.length - 2]; //上一个页面
}
prevPage.setData({
"params.is_cheat": Number(is_cheat),
"params.is_encrypt": Number(is_encrypt),
"params.force_status": Number(force_status),
"params.force_num": Number(force_num),
"params.text_require_status": Number(text_require_status),
"params.text_require_num": Number(text_require_num),
"params.image_require_status": Number(image_require_status),
"params.image_require_num": Number(image_require_num),
"params.audio_require_status": Number(audio_require_status),
"params.video_require_num": Number(video_require_num),
"params.video_require_status": Number(video_require_status),
"params.audio_require_num": Number(audio_require_num)
});
wx.navigateBack({
delta: 1
})
},
showTipModal(e){
const {type} = e.currentTarget.dataset;
let that = this;
let optTipObj = that.data.tipObj.filter(item=>item.type==type)[0]
that.setData({
optTipObj,
tipModalShow: true
})
},
hideTipModal(){
let that = this;
that.setData({
tipModalShow: false
})
}
})
\ No newline at end of file
{
"navigationBarTitleText": "高级设置",
"usingComponents": {
"w-switch": "/dist/w-switch/index"
}
}
\ No newline at end of file
<view class="container">
<view class="section">
<view class="form-item">
<view class="item-l">
<text class="title">防作弊模式</text>
<text class="tip" data-type="1" bindtap="showTipModal" wx:if="{{is_cheat==0}}">什么是防作弊?</text>
</view>
<view class="item-r">
<w-switch slot="content" isBoolean="{{1}}" value="{{ is_cheat }}" color="#65B8F4" size="small" bind:onChange="cheatswitch" />
</view>
</view>
<view class="form-item">
<view class="item-l">
<text class="title">加密模式</text>
<text class="tip" data-type="2" bindtap="showTipModal" wx:if="{{is_encrypt==0}}">什么是加密模式?</text>
</view>
<view class="item-r">
<w-switch slot="content" isBoolean="{{1}}" value="{{ is_encrypt }}" color="#65B8F4" size="small" bind:onChange="encryptswitch" />
</view>
</view>
<view class="form-item">
<view class="item-l">
<text class="title">强制阅读模式</text>
<text class="tip" data-type="3" bindtap="showTipModal" wx:if="{{force_status==2}}">什么是强制阅读模式?</text>
<view class="num-box" wx:else>
<input type="number" placeholder-class="placeholderclass" class="iteminput" maxlength="5" value="{{force_num}}" bindinput="readtimeInput" placeholder=""></input>分钟
</view>
</view>
<view class="item-r">
<w-switch slot="content" value="{{ force_status }}" color="#65B8F4" size="small" bind:onChange="readswitch" />
</view>
</view>
</view>
<view class="section">
<view class="form-item">
<view class="item-l">
<text class="title">文字字数要求</text>
<text class="tip" data-type="4" bindtap="showTipModal" wx:if="{{text_require_status==2}}">什么是文字字数要求?</text>
<view class="num-box" wx:else>
<input type="number" placeholder-class="placeholderclass" class="iteminput" maxlength="5" value="{{text_require_num}}" bindinput="textInput" placeholder=""></input>字
</view>
</view>
<view class="item-r">
<w-switch slot="content" value="{{ text_require_status }}" color="#65B8F4" size="small" bind:onChange="textswitch" />
</view>
</view>
<view class="form-item">
<view class="item-l">
<text class="title">图片个数要求</text>
<text class="tip" data-type="5" bindtap="showTipModal" wx:if="{{image_require_status==2}}">什么是图片个数要求?</text>
<view class="num-box" wx:else>
<input type="number" placeholder-class="placeholderclass" class="iteminput" maxlength="5" value="{{image_require_num}}" bindinput="imageInput" placeholder=""></input>张
</view>
</view>
<view class="item-r">
<w-switch slot="content" value="{{ image_require_status }}" color="#65B8F4" size="small" bind:onChange="imageswitch" />
</view>
</view>
<view class="form-item">
<view class="item-l">
<text class="title">录音时长要求</text>
<text class="tip" data-type="6" bindtap="showTipModal" wx:if="{{audio_require_status==2}}">什么是录音时长要求?</text>
<view class="num-box" wx:else>
<input type="number" placeholder-class="placeholderclass" class="iteminput" maxlength="5" value="{{audio_require_num}}" bindinput="audioInput" placeholder=""></input>秒
</view>
</view>
<view class="item-r">
<w-switch slot="content" value="{{ audio_require_status}}" color="#65B8F4" size="small" bind:onChange="audioswitch"/>
</view>
</view>
<view class="form-item">
<view class="item-l">
<text class="title">视频个数要求</text>
<text class="tip" data-type="7" bindtap="showTipModal" wx:if="{{video_require_status==2}}">什么是视频个数要求?</text>
<view class="num-box" wx:else>
<input type="number" placeholder-class="placeholderclass" class="iteminput" maxlength="30" value="{{video_require_num}}" bindinput="videoInput" placeholder=""></input>个
</view>
</view>
<view class="item-r">
<w-switch slot="content" value="{{ video_require_status}}" color="#65B8F4" size="small" bind:onChange="videoswitch"/>
</view>
</view>
</view>
<view class="modal-dialog" wx:if="{{tipModalShow}}">
<view class="modal-mask"></view>
<view class="modal-box">
<view class="modal-title">{{optTipObj.title}}</view>
<view class="modal-content">
<view class="item" wx:for="{{optTipObj.content}}" wx:key="">{{item}}</view>
</view>
<view class="modal-btn" bindtap="hideTipModal">我知道了</view>
</view>
</view>
<view class="page-btnsubmit" bindtap="bindBackPrevPage">返回</view>
</view>
\ No newline at end of file
page{
background: #F2F2F2;
}
.container{
padding: 0 24rpx;
}
.section{
margin-top: 31rpx;
background: #fff;
border-radius: 20rpx;
width: 100%;
background: #fff;
padding: 10rpx 0;
}
.form-item{
display: flex;
align-items: center;
justify-content: space-between;
line-height: 39rpx;
width: 100%;
padding: 20rpx;
}
.form-item .item-l{
font-size: 28rpx;
display: flex;
align-items: center;
}
.form-item .item-l .title{
color: #1F1F1F;
font-weight: bold;
width: 200rpx;
}
.form-item .item-l .tip{
font-size: 24rpx;
color: #65B8F4;
}
.form-item .item-l .num-box{
display: flex;
align-items: center;
font-size: 24rpx;
color: #9B9B9B;
}
.form-item .item-l .num-box .iteminput{
width: 69rpx;
border-bottom: 2rpx solid #E2E2E2;
margin-right: 26rpx;
font-size: 26rpx;
color: #65B8F4;
text-align: center;
}
.form-item .item-r{
display: flex;
align-items: center;
}
.form-item .item-r .label{
font-size: 26rpx;
color: #686868;
}
.page-btnsubmit {
width: 100%;
height: 100rpx;
background: #65B8F4;
font-size: 38rpx;
color: #fff;
letter-spacing: 4rpx;
position: fixed;
bottom: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
}
/* 提示框 */
.modal-dialog{
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 9;
}
.modal-dialog .modal-mask{
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
background: rgba(0,0,0,.5);
z-index: 9;
}
.modal-dialog .modal-box{
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
width: 600rpx;
height: 349rpx;
background:#fff;
border-radius: 20rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
z-index: 10;
}
.modal-dialog .modal-box .modal-title{
font-size: 28rpx;
color: #000;
font-weight: bold;
text-align: center;
padding-top: 33rpx;
line-height: 1;
}
.modal-dialog .modal-box .modal-content{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.modal-dialog .modal-box .modal-content .item{
line-height: 48rpx;
font-size: 28rpx;
color: #000;
}
.modal-dialog .modal-box .modal-btn{
width: 100%;
height: 100rpx;
display: flex;
align-items: center;
justify-content: center;
border-top: 1px solid rgba(0,0,0,.05);
font-size: 30rpx;
color: #434343;
font-weight: bold;
}
\ No newline at end of file
Page({
data: {
type: ''
},
onLoad: function (options) {
let that = this;
const {type} = options;
that.setData({
type,
})
},
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<web-view src="https://mp.weixin.qq.com/s/HLErsSV2czGyqBYs1ueabA"></web-view>
\ No newline at end of file
/* business/pages/webview/index.wxss */
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment