Commit 7d77c275 authored by lvtz's avatar lvtz

fix

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