Commit 7d77c275 authored by lvtz's avatar lvtz

fix

parent 08392407
......@@ -128,12 +128,8 @@ Page({
},
bindTemplateSelected(e) {
const { id } = e.currentTarget.dataset;
wx.showToast({
title: `模板id是${id}`,
icon: 'none'
});
wx.navigateTo({
url: `/business/pages/themeeditor/index?tid=${id}&sid=${this.data.sid}&editType=1&clone=1`
url: `/business/pages/themeeditor/index?tid=0&sid=${this.data.sid}&editType=1&tempid=${id}`
})
},
createCustom() {
......
......@@ -528,14 +528,6 @@ Page({
wx.hideLoading();
if (res.code == 200) { // 成功的操作
if (this.data.sid == 0) { // 新增的操作
LocalStorage.setItem('dakarole', 1);
LocalStorage.setItem("user", {
token: `bearer ${res.data.token}`
});
LocalStorage.setItem("teacher", {
token: `bearer ${res.data.token}`
});
// permissionUtils.myMenulistGet(res.data.id)
wx.redirectTo({
url: `/business/pages/organizationalmgt/qxknow?sid=${res.data.id}`
});
......
......@@ -27,6 +27,7 @@ import initCalendar, {
} from '../../components/calendar/main.js';
import {
erpClassListGet,
subjectTemplateDetail
} from '../../../service/business/common.js';
var app = getApp();
Page({
......@@ -240,7 +241,9 @@ Page({
],
radioname: '',
confirmId: 0,
// has_subjects_count: 0
// has_subjects_count: 0,
tempid: 0,//作业模板id,
},
onLoad: function(options) { // Do some initialize when page load.
const that = this;
......@@ -251,6 +254,7 @@ Page({
my,
classes,
editType,
tempid
} = options;
this.setData({
tid,
......@@ -258,6 +262,7 @@ Page({
sid: sid || '',
my: my || 0,
editType,
tempid: tempid || 0
});
if (tid == 0) {
const currentclasses = classes ? JSON.parse(decodeURIComponent(classes)) : [];
......@@ -267,6 +272,9 @@ Page({
wx.setNavigationBarTitle({
title: '新建作业打卡'
})
if(tempid && tempid!=0){
this.loadThemeTemplate()
}
this.setData({
classes: currentclasses,
'params.join_rule_type': currentclasses.length > 0 ? 4 : 1
......@@ -738,6 +746,31 @@ Page({
wx.hideLoading()
})
},
loadThemeTemplate (){
wx.showLoading({
title: '数据加载中...'
})
subjectTemplateDetail({
id: this.data.tempid
}).then(res=>{
wx.hideLoading();
const {code, data} = res;
if(code == 200){
let _content = [];
try {
_content = JSON.parse(data.content);
} catch (error) {
_content = []
}
this.setData({
'params.title': data.title,
'params.content': _content,
})
}
}).catch((err) => {
wx.hideLoading()
})
},
titleInput(e) {
const {
value
......@@ -852,7 +885,6 @@ Page({
rest_dates: restdates.join(','),
content_id: this.data.calendarThemeAdInfo.id,
})
console.log(data, 'data');
themeEditor(data).then((res) => {
const {
code,
......@@ -2022,7 +2054,6 @@ Page({
lockSubjects: lockSubjects,
lockSubjectLists: lockSubjects.slice(this.data.currentSortIndex * 10, this.data.currentSortIndex * 10 + 10),
})
console.log(this.data.lockSubjectLists,'lockSubjectLists1')
this.getSubjectSort();
} else {
const that = this;
......@@ -2401,7 +2432,6 @@ Page({
lockSubjectLists: lockSubjects.slice(this.data.currentSortIndex * 10, this.data.currentSortIndex * 10 + 10)
})
console.log(this.data.lockSubjects,this.data.lockSubjectLists,'关卡',this.data.currentSortIndex * 10, this.data.currentSortIndex * 10 + 10)
this.getSubjectSort();
}
}).catch(() => {
......
......@@ -398,10 +398,18 @@ function getSubjectTemplates(data){
method: 'GET',
data,
errorresolve: 1,
// needToken: true
needToken: true
})
}
function subjectTemplateDetail(data){
return wxRequest({
role: '2b',
url: `${apis.business.common.subjectTemplates}/${data.id}`,
method: 'GET',
errorresolve: 1,
needToken: true
})
}
export {
nicknameGet,
......@@ -444,5 +452,6 @@ export {
analyzeclasscourseGet,
analyzeDashboardGet,
getUuid,
getSubjectTemplates
getSubjectTemplates,
subjectTemplateDetail
}
\ No newline at end of file
......@@ -123,6 +123,7 @@ Page({
secret: "", //加入的密码
studentMobile: "", //手机号
hadAuthMobile: false,// 授权成功但未加入成功,只为页面记录状态不再重复授权
w: 0,//页面来源分享的学生id
fromShareInfo: {},
scoreFeedBackStatus: {
......@@ -965,7 +966,8 @@ Page({
that.setData({
sessionCode: that.data.sessionCode,
encryptData: encryptedData,
iv
iv,
hadAuthMobile: true,
});
if (this.data.themeSelect.join_rule_type == 3) {
this.setData({
......
......@@ -132,7 +132,7 @@
<view class="tip">学校首页</view>
</view>
<!-- 没有手机号 需要授权-->
<button class="btn btn-clock" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" wx:if="{{studentMobile==''}}">加入打卡</button>
<button class="btn btn-clock" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" wx:if="{{studentMobile=='' || !hadAuthMobile}}">加入打卡</button>
<view class="btn btn-clock" bindtap="goClock">{{themeSelect.is_join==1 ? (themeSelect.is_clock ? '已打卡' : '去打卡') : '加入打卡'}}</view>
</view>
</view>
......
......@@ -129,6 +129,7 @@ Page({
secret: '',//加入的密码
studentMobile: '', //手机号
encryptedData: '',
hadAuthMobile: false,// 授权成功但未加入成功,只为页面记录状态不再重复授权
w: 0,//页面来源分享的学生id
fromShareInfo: {},
},
......@@ -957,7 +958,8 @@ Page({
that.setData({
sessionCode: that.data.sessionCode,
encryptData: encryptedData,
iv
iv,
hadAuthMobile: true
});
if (this.data.themeSelect.join_rule_type == 3) {
this.setData({
......
......@@ -133,7 +133,7 @@
<view class="tip">学校首页</view>
</view>
<!-- 没有手机号 需要授权 -->
<button class="btn btn-clock" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" wx:if="{{studentMobile==''}}">加入打卡</button>
<button class="btn btn-clock" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" wx:if="{{studentMobile=='' || !hadAuthMobile}}">加入打卡</button>
<view class="btn btn-clock" bindtap="goClock" wx:else>{{themeSelect.is_join==1 ? (themeSelect.is_clock ? '已打卡' : '去打卡') : '加入打卡'}}</view>
</view>
</view>
......
......@@ -333,22 +333,22 @@ Page({
getMember()
.then(res => {
const { data, code } = res;
if (code == 40000) {
if (code == 200) {
// 没绑定微信或者没有校区
wx.navigateTo({
url: `/business/pages/organizationalmgt/newinfo`
});
} else if (code == 200) {
} else if (code == 2000) {
this.setData({
loginStatus: 1
})
if (data.member.length + data.teacher.length > 0) {
LocalStorage.setItem("user", {
token: `bearer ${data.token}`
});
LocalStorage.setItem("teacher", {
token: `bearer ${data.token}`
});
// LocalStorage.setItem("user", {
// token: `bearer ${data.token}`
// });
// LocalStorage.setItem("teacher", {
// token: `bearer ${data.token}`
// });
wx.navigateTo({
url: `/business/pages/exchangebusiness/index?from=1`
});
......
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