Commit 7bb0ec31 authored by wangxuelai's avatar wangxuelai

''

parent 8ece89e1
......@@ -39,7 +39,7 @@ Page({
circlePerpage: 10,
modalClass: false,
modelClassAnimate: false,
selectClass: '', // 当前班级
selectClass: {}, // 当前班级
my: 0,
themeStatus: 1,
themeTab: [
......@@ -98,7 +98,7 @@ Page({
switch (Number(createtype)){
case 1:
url = `/business/pages/themeeditor/index?id=${selectClassId}&tid=0&sid=${this.data.sid}`;
url = `/business/pages/themeeditor/index?id=${selectClassId}&tid=0&sid=${this.data.sid}&classes=${encodeURIComponent(this.data.selectClass.id ? JSON.stringify([{id: this.data.selectClass.id, title: this.data.selectClass.title}]) : '[]')}`;
break;
case 2:
url = `/business/pages/calendarthemeeditor/index?id=${selectClassId}&tid=0&sid=${this.data.sid}`;
......
......@@ -227,7 +227,7 @@ Page({
let url = '';
switch (Number(createtype)){
case 1:
url = `/business/pages/themeeditor/index?id=0&tid=0&sid=${this.data.sid}`;
url = `/business/pages/themeeditor/index?id=0&tid=0&sid=${this.data.sid}&classes=${encodeURIComponent('[]')}`;
break;
case 2:
url = `/business/pages/calendarthemeeditor/index?id=0&tid=0&sid=${this.data.sid}`;
......
......@@ -134,7 +134,8 @@ Page({
tid,
clone,
sid,
my
my,
classes,
} = options;
this.setData({
id,
......@@ -143,16 +144,23 @@ Page({
sid: sid || '',
my: my || 0
});
if (tid == 0) {
const currentclasses = classes ? JSON.parse(decodeURIComponent(classes)) : [];
this.setData({
classes: currentclasses,
'params.join_rule_type': currentclasses.length > 0 ? 4 : 1
})
}
if(tid != 0){
wx.setNavigationBarTitle({
title: '编辑作业打卡'
})
this.loadThemeData({
id,
tid,
extra: 'land_content,class'
});
}
this.loadThemeData({
id,
tid,
extra: 'land_content,class'
});
this.getDatePickerData(getDateInfo(Math.floor((new Date()).getTime()/1000)));
this.getStartDatePickerArr(this.data.params.startDate, this.data.params.startTime);
this.getEndDatePickerArr(this.data.params.endDate, this.data.params.endTime);
......@@ -341,80 +349,68 @@ Page({
}
}
},
loadThemeData({
id,
tid,
extra,
}) {
let that = this;
if (tid == 0) { // 走新建的逻辑
this.setData({
currentMockType: 2,
'params.title': that.data.mockTitleList.filter(item=>item.type==2)[0].title,
})
} else { // 走查询的逻辑
wx.showLoading({
title: '数据加载中...'
})
themeDetail({
id: this.data.tid,
school_id: this.data.sid,
extra
}).then((res) => {
wx.hideLoading();
const {
code,
data
} = res;
if (code == 200) {
let _content = [];
try {
_content = JSON.parse(data.content);
} catch (error) {
_content = []
}
let currentMockItem = this.data.mockTitleList.filter(item=>item.title == data.title)[0];
this.setData({
params: {
type: data.type,
title: data.title,
content: _content,
is_cheat: data.is_cheat,
// is_encrypt: data.is_encrypt,
force_status: data.force_status,
force_num:Number(data.force_num),
push_status:data.homework_set.push_status,
text_require_status:data.text_require_status,
text_require_num:Number(data.text_require_num),
image_require_status:data.image_require_status,
image_require_num:Number(data.image_require_num),
video_require_status:data.video_require_status,
video_require_num:Number(data.video_require_num),
audio_require_status:data.audio_require_status,
audio_require_num:Number(data.audio_require_num),
startDate: data.homework_set.publish_time.split(" ")[0],
startTime: data.homework_set.publish_time.split(" ")[1],
endDate: data.homework_set.end_time.split(" ")[0],
endTime: data.homework_set.end_time.split(" ")[1],
// clock_start_time: data.clock_start_time,
// clock_end_time: data.clock_end_time,
push_time:data.homework_set.push_time,
join_rule_type: data.join_rule_type,
join_secret: data.join_secret,
class_ids: data.classes.map((ele) => ele.id).join(','),
},
classes: data.classes.map(ele => ({title: ele.title, id: ele.id})),
themeAdInfo: {
id: (data.land_content && data.land_content.id) || 0,
title: (data.land_content && data.land_content.title) || ''
},
currentMockType: currentMockItem? currentMockItem.type : 0,//标题类型回显
})
loadThemeData({ id, tid, extra }) {
wx.showLoading({
title: '数据加载中...'
})
themeDetail({
id: this.data.tid,
school_id: this.data.sid,
extra
}).then((res) => {
wx.hideLoading();
const {
code,
data
} = res;
if (code == 200) {
let _content = [];
try {
_content = JSON.parse(data.content);
} catch (error) {
_content = []
}
}).catch((err) => {
wx.hideLoading()
})
}
let currentMockItem = this.data.mockTitleList.filter(item=>item.title == data.title)[0];
this.setData({
params: {
type: data.type,
title: data.title,
content: _content,
is_cheat: data.is_cheat,
// is_encrypt: data.is_encrypt,
force_status: data.force_status,
force_num:Number(data.force_num),
push_status:data.homework_set.push_status,
text_require_status:data.text_require_status,
text_require_num:Number(data.text_require_num),
image_require_status:data.image_require_status,
image_require_num:Number(data.image_require_num),
video_require_status:data.video_require_status,
video_require_num:Number(data.video_require_num),
audio_require_status:data.audio_require_status,
audio_require_num:Number(data.audio_require_num),
startDate: data.homework_set.publish_time.split(" ")[0],
startTime: data.homework_set.publish_time.split(" ")[1],
endDate: data.homework_set.end_time.split(" ")[0],
endTime: data.homework_set.end_time.split(" ")[1],
// clock_start_time: data.clock_start_time,
// clock_end_time: data.clock_end_time,
push_time:data.homework_set.push_time,
join_rule_type: data.join_rule_type,
join_secret: data.join_secret,
class_ids: data.classes.map((ele) => ele.id).join(','),
},
classes: data.classes.map(ele => ({title: ele.title, id: ele.id})),
themeAdInfo: {
id: (data.land_content && data.land_content.id) || 0,
title: (data.land_content && data.land_content.title) || ''
},
currentMockType: currentMockItem? currentMockItem.type : 0,//标题类型回显
})
}
}).catch((err) => {
wx.hideLoading()
})
},
titleInput(e) {
const {
......@@ -483,6 +479,15 @@ Page({
})
return;
}
if (this.data.themeAdInfo.id == 0) {
wx.showModal({
title: '提示',
content: '请选择营销页',
confirm: true,
showCancel: false
})
return;
}
if (this.data.submiting) {
return
}
......
......@@ -133,9 +133,9 @@
</view>
</view>
<view class="section-tip" style="color: #999999;margin-bottom:12px;">打卡时间结束后将无法提交打卡!</view>
<view class="section-wrap">
<view class="section-wrap" bindtap="goyinxiaoPage">
<view class="section-item">
<view class="form-item" bindtap="goyinxiaoPage">
<view class="form-item">
<view class="item-l">打卡营销页</view>
<view class="item-r">
<view class="label">{{themeAdInfo.id != 0 ? themeAdInfo.title : '请选择营销页'}}</view>
......@@ -145,9 +145,9 @@
</view>
<view class="section-tip" style="color: #999999;">可在学生加入打卡前展示, 此功能可收集有意向学生的联系方式 <text style="color: #16B0FD;">了解详情</text></view>
</view>
<view class="section-wrap">
<view class="section-wrap" bindtap="bindMoreSetting">
<view class="section-item">
<view class="form-item" bindtap="bindMoreSetting">
<view class="form-item">
<view class="item-l">高级设置</view>
<view class="item-r" bindtap="bindMoreSetting">
<image class="icon-arr" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"/>
......
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