Commit 3a5fa85d authored by lvtz's avatar lvtz

fix

parents 7397cfa9 26795a36
......@@ -336,6 +336,10 @@ Page({
wx.redirectTo({
url: `/business/pages/circleindex/index?id=${res.data.id}&sid=${this.data.sid}&from=2`
})
}else if(this.data.from == 4){
wx.navigateBack({
delta: 1, // 回退前 delta(默认为1) 页面
})
}else{
wx.redirectTo({
url: `/business/pages/classservice/classdetail?id=${res.data.id}&sid=${this.data.sid}`
......
......@@ -250,17 +250,17 @@ Page({
switch (thisSubject.subject_type) {
case 1:
wx.navigateTo({
url: `/business/pages/themeindex/index?id=${this.data.id}&tid=${this.data.tid}&sid=${this.data.sid}`
url: `/business/pages/themeindex/index?tid=${this.data.tid}&sid=${this.data.sid}`
})
break;
case 2:
wx.navigateTo({
url: `/business/pages/calendarthemeindex/index?id=${this.data.id}&tid=${this.data.tid}&sid=${this.data.sid}`
url: `/business/pages/calendarthemeindex/index?tid=${this.data.tid}&sid=${this.data.sid}`
})
break;
case 3:
wx.navigateTo({
url: `/business/pages/morethemeindex/index?id=${this.data.id}&tid=${thisSubject.unlock_mode_id}&sid=${this.data.sid}`
url: `/business/pages/morethemeindex/index?mid=${this.data.clock.unlock_mode_id}&tid=${thisSubject.id}&sid=${this.data.sid}`
})
break;
default:
......
......@@ -46,12 +46,12 @@ Page({
sid,
classes: !class_ids ? [] : JSON.parse(decodeURIComponent(class_ids)),
});
this.getMyRoleInfo()
},
onReady: function() { // Do something when page ready.
},
onShow: function() { // Do something when page show.
this.getMyRoleInfo()
},
onHide: function() { // Do something when page hide.
......@@ -101,9 +101,22 @@ Page({
}).then((res) => {
const { code, data } = res;
if (code == 200) {
const chooseClasses = [];
data.list.forEach((course) => {
course.classes && course.classes.forEach((classes) => {
if (this.data.classes.indexOf(classes.id) != -1) {
chooseClasses.push({
title: classes.title,
id: classes.id
});
}
})
})
this.setData({
courseList: data.list
courseList: data.list,
chooseClasses,
})
console.log(chooseClasses, 'chooseClasses');
} else {
}
......@@ -114,6 +127,7 @@ Page({
const { classes, chooseClasses } = this.data;
const classesIndex = classes.indexOf(item.id);
const chooseClassesIndex = chooseClasses.findIndex(ele => ele.id == item.id);
console.log(chooseClassesIndex, 'chooseClassesIndex');
if (classesIndex == -1) {
classes.push(item.id);
} else {
......@@ -125,8 +139,10 @@ Page({
id: item.id,
});
} else {
chooseClasses.splice(classesIndex, 1);
chooseClasses.splice(chooseClassesIndex, 1);
}
console.log(classes, 'classes');
console.log(chooseClasses, 'chooseClasses');
this.setData({
classes,
chooseClasses,
......@@ -136,6 +152,15 @@ Page({
const curPages = getCurrentPages();
let currPage = null; //当前页面
let prevPage = null; //上一个页面
console.log(this.data.chooseClasses, 'this.data.chooseClasses');
// return;
if (this.data.chooseClasses.length == 0) {
wx.showToast({
title: '请选择班级',
icon: 'none',
})
return;
}
if (curPages.length >= 2) {
currPage = curPages[curPages.length - 1]; //当前页面
prevPage = curPages[curPages.length - 2]; //上一个页面
......@@ -146,5 +171,10 @@ Page({
wx.navigateBack({
delta: 1
})
},
toAddClass() {
wx.navigateTo({
url: `/business/pages/circleeditor/index?sid=${this.data.sid}&id=0&from=4`,
})
}
})
\ No newline at end of file
......@@ -24,5 +24,6 @@
</view>
</block>
<empty-content text="暂无数据~" emptyimg="" wx:else></empty-content>
<view class="savebtn" hover-class="none" hover-stop-propagation="false" bindtap="saveClass">保存</view>
<view class="savebtn" hover-class="none" hover-stop-propagation="false" bindtap="saveClass" wx:if="{{courseList.length > 0}}">保存</view>
<view class="savebtn" hover-class="none" hover-stop-propagation="false" bindtap="toAddClass" wx:if="{{courseList.length == 0}}">新增班级</view>
</view>
......@@ -155,11 +155,7 @@ Page({
},
goThemeDetail (e) {
const { index, item } = e.currentTarget.dataset;
if (item.id > 0) {
wx.navigateTo({
url: `/business/pages/morethemeindex/index?mid=${this.data.tid}&tid=${item.id}&sid=${this.data.sid}`,
})
} else {
if (index >= 1) {
if (this.data.lockSubjects[index - 1].id == 0) {
wx.showModal({
title: '提示',
......@@ -168,6 +164,12 @@ Page({
})
return;
}
}
if (item.id > 0) {
wx.navigateTo({
url: `/business/pages/morethemeindex/index?mid=${this.data.tid}&tid=${item.id}&sid=${this.data.sid}`,
})
} else {
wx.navigateTo({
url: `/business/pages/themeeditor/subjecteditor?tid=${this.data.tid}&sid=${this.data.sid}&addSort=0&sort=${index + 1}&id=${item.id}&index=${index}&currentSortIndex=0&from=index`,
})
......
......@@ -311,7 +311,23 @@ Page({
editType,
max_clock_count,
unlock_limit,
} = this.data
} = this.data;
if (join_rule_type == 3 && join_secret == '') {
wx.showToast({
title: '请输入密码',
icon: 'none'
})
return;
}
if ((join_rule_type == 2 || join_rule_type == 4) && classes.length == 0) {
wx.showModal({
title: '提示',
content: `当前选择的参与打卡模式为${join_rule_type == 2 ? '【任何人都可参与(指定班级学生收到通知)】' : ''}${join_rule_type == 4 ? '【指定班级学生参与】' : ''},请选择班级`,
showCancel: false,
})
return;
}
console.log()
let currPage = null; //当前页面
let prevPage = null; //上一个页面
if (pages.length >= 2) {
......
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