Commit 0fe67afa authored by sujie's avatar sujie

dd

parent 4152a441
......@@ -33,7 +33,8 @@ Page({
classhourList: '',
selectClassShow: false,
delDailogShow: false,
delKey: ''
delKey: '',
addSubDialogS: false
},
onLoad: function (options) {
const {
......@@ -154,8 +155,33 @@ Page({
},
// 课时添加
unlockSubjectAdd: function (e) {
let classhourListTotal = this.data.classhourList.length + this.data.unlockSubjectList.length;
if(classhourListTotal>=200){
const that = this;
const { unlockSubjectList , moreTheme} = this.data;
if(!unlockSubjectList[moreTheme.subject_count-1]){
wx.showToast({
icon: 'none',
title: '请先编辑上一个关卡'
})
return
}
// let classhourListTotal = this.data.classhourList.length + this.data.unlockSubjectList.length;
// if(classhourListTotal>=200){
// wx.showToast({
// title: '最多添加199关卡',
// icon: 'none',
// duration: 2000
// })
// return false;
// }
// wx.navigateTo({
// url: `/business/pages/morethemeindex/index?id=${this.data.id}&tid=${this.data.tid}&sid=${this.data.sid}&sort=${this.data.allsubject_count+1}&sub=0`
// })
this.setData({
addSubDialogS:true
})
},
goAddSub(){
if (this.data.moreTheme.subject_count > 199) {
wx.showToast({
title: '最多添加199关卡',
icon: 'none',
......@@ -163,11 +189,24 @@ Page({
})
return false;
}
if(this.data.moreTheme.max_student_clock_count==this.data.moreTheme.subject_count){
wx.showToast({
title: '已有学生全部通关,不能添加关卡',
icon: 'none',
duration: 2000
})
return false;
}
this.addSubDialogHide();
wx.navigateTo({
url: `/business/pages/morethemeindex/index?id=${this.data.id}&tid=${this.data.tid}&sid=${this.data.sid}&sort=${this.data.allsubject_count+1}&sub=0`
url: `/business/pages/themeeditorlock/subjecteditor?id=${this.data.id}&tid=${this.data.tid}&sid=${this.data.sid}&sort=${this.data.moreTheme.subject_count+1}&sub=0&addSub=1`
})
},
addSubDialogHide(){
this.setData({
addSubDialogS:false
})
},
// 课时编辑
unlockSubjectEdit(){
const actSub = this.data.actSub;
......
......@@ -77,4 +77,13 @@
</view>
</view>
</view>
\ No newline at end of file
<view class="addSub-dialog" wx:if="{{addSubDialogS}}">
<view class="addSub-dialog-content">
<view class="title">提示</view>
<view class="content">确认新增额外关卡?</view>
<view class="footer">
<view class="btn" bindtap="addSubDialogHide">取消</view>
<view class="btn right" bindtap="goAddSub">确定</view>
</view>
</view>
</view>
\ No newline at end of file
......@@ -357,4 +357,58 @@
display: flex;
align-items: center;
justify-content: center;
}
\ No newline at end of file
}
.addSub-dialog{
width: 100%;
height: 100%;
position: fixed;
background:rgba(0,0,0,.5);
left: 0;
top: 0;
display: flex;
align-items: center;
justify-content: center;
z-index: 200;
}
.addSub-dialog .addSub-dialog-content{
width:599rpx;
background:rgba(255,255,255,1);
border-radius:20rpx;
}
.addSub-dialog .addSub-dialog-content .title{
padding-top: 48rpx;
font-size:32rpx;
font-family:PingFang-SC-Bold;
font-weight:bold;
color:rgba(0,0,0,1);
line-height: 1;
text-align: center;
}
.addSub-dialog .addSub-dialog-content .content{
padding: 92rpx 0;
text-align: center;
font-size:26rpx;
font-family:PingFang-SC-Regular;
font-weight:400;
color:rgba(0,0,0,1);
line-height:1;
}
.addSub-dialog .addSub-dialog-content .footer{
height: 95rpx;
border-top: 1px solid rgba(0,0,0,.05);
display: flex;
}
.addSub-dialog .addSub-dialog-content .footer .btn{
flex: 1;
text-align: center;
font-size:30rpx;
font-family:PingFang-SC-Bold;
font-weight:bold;
color:rgba(67,67,67,1);
line-height:1;
line-height: 85rpx;
}
.addSub-dialog .addSub-dialog-content .footer .right{
color:rgba(101,184,244,1);
border-left:1px solid rgba(0,0,0,.05);
}
\ No newline at end of file
......@@ -1591,17 +1591,17 @@ Page({
switch (item.source_type) {
case 1:
wx.navigateTo({
url:`/src/pages/themeindex/index?id=${item.class_id}&tid=${item.id}`
url:`/src/pages/themeindex/index?id=${item.class_id}&tid=${item.source_id}`
})
break;
case 2:
wx.navigateTo({
url:`/src/pages/calendarthemeindex/index?id=${item.class_id}&tid=${item.id}`
url:`/src/pages/calendarthemeindex/index?id=${item.class_id}&tid=${item.source_id}`
})
break;
case 3:
wx.navigateTo({
url:`/src/pages/sharemoretheme/index?tid=${item.id}`
url:`/src/pages/sharemoretheme/index?tid=${item.source_id}`
})
break;
default:
......
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