Commit de5ef7e0 authored by wangxuelai's avatar wangxuelai

Merge remote-tracking branch 'origin/sj-dev-optimize' into wxl-youhua

parents 62bdb374 92bc1b6a
......@@ -331,7 +331,7 @@ Component({
godetail() {},
goClockDetail() {
wx.navigateTo({
url: `/business/pages/clockdetail/index?tid=${this.data.tid}&cid=${this.data.clock.id}&sid=${this.data.clock.school_id}`,
url: `/business/pages/clockdetail/index?tid=${this.data.clock.subject_id}&cid=${this.data.clock.id}&sid=${this.data.clock.school_id}`,
})
},
// 播放视频
......
......@@ -575,6 +575,16 @@ Page({
})
return;
}
let pages = getCurrentPages();
let currPage = null; //当前页面
let prevPage = null; //上一个页面
if (pages.length >= 2) {
currPage = pages[pages.length - 1]; //当前页面
prevPage = pages[pages.length - 2]; //上一个页面
}
prevPage.setData({
showRefresh: true
});
wx.navigateBack({
delta: 1, // 回退前 delta(默认为1) 页面
success: function () {
......
......@@ -121,7 +121,8 @@ Page({
riseDate:"",
activeDay: "", // 选中的日期
listindex: "",
index: ""
index: "",
showRefresh:false,
},
onLoad: function (options) { // Do some initialize when page load.
this.innerAudioContext = wx.createInnerAudioContext(); // 当前页面唯一的一个音频容器
......@@ -141,72 +142,14 @@ Page({
sid
})
this.getWeeksDay(new Date());
// wx.hideShareMenu()
this.initPage();
},
onReady: function () { // Do something when page ready.
let user = LocalStorage.getItem('user');
let dakarole = LocalStorage.getItem('dakarole');
if (dakarole == 1) {
this.setData({
permission: [1, 2, 3, 4, 5, 6, 7]
})
}
},
onShow: function () { // Do something when page show.
const that = this;
initCalendar({
multi: false,
noDefault: false,
whenChangeMonth(current, next) {
// console.log(current);
// console.log(next);
},
afterCalendarRender(ctx) {
const data = [
{
year: '2019',
month: '3',
day: '15'
},
{
year: 2019,
month: 3,
day: 18,
todoText: '休'
}
];
// 异步请求
setTimeout(() => {
setTodoLabels({
pos: 'top',
dotColor: '#40',
days: data
});
}, 1000);
// enableArea([that.data.params.startDate, that.data.params.endDate]);
setTimeout(() => {
// setSelectedDays(data);
//jump(2018, 6, 6)
}, 2000);
}
});
this.getDetail();
if (this.data.bigSort == 1) {
this.setData({
page: 1,
hasmore: true,
})
this.clockListGet(this.data.oneSmallSort, 'init');
} else if (this.data.bigSort == 2) {
this.setData({
mPage: 1,
mHasmore: true,
})
this.clockMemberListGet(this.data.twoSmallSort, 'init');
}
let dakarole = LocalStorage.getItem('dakarole');
if (dakarole == 2) {
this.teachersPermission();
if(this.data.showRefresh){
this.initPage();
this.data.showRefresh = false;
}
},
onHide: function () { // Do something when page hide.
......@@ -298,6 +241,63 @@ Page({
},
}
},
initPage() {
const that = this;
initCalendar({
multi: false,
noDefault: false,
whenChangeMonth(current, next) {
// console.log(current);
// console.log(next);
},
afterCalendarRender(ctx) {
const data = [
{
year: '2019',
month: '3',
day: '15'
},
{
year: 2019,
month: 3,
day: 18,
todoText: '休'
}
];
// 异步请求
setTimeout(() => {
setTodoLabels({
pos: 'top',
dotColor: '#40',
days: data
});
}, 1000);
// enableArea([that.data.params.startDate, that.data.params.endDate]);
setTimeout(() => {
// setSelectedDays(data);
//jump(2018, 6, 6)
}, 2000);
}
});
this.getDetail();
if (this.data.bigSort == 1) {
this.setData({
page: 1,
hasmore: true,
})
this.clockListGet(this.data.oneSmallSort, 'init');
} else if (this.data.bigSort == 2) {
this.setData({
mPage: 1,
mHasmore: true,
})
this.clockMemberListGet(this.data.twoSmallSort, 'init');
}
let dakarole = LocalStorage.getItem('dakarole');
if (dakarole == 2) {
this.teachersPermission();
}
},
getDetail() {
const today = new Date().getFullYear() + '-' + (Number((new Date().getMonth() + 1))<10?'0'+(new Date().getMonth() + 1):(new Date().getMonth())) + '-' + (Number((new Date().getDate()))<10?'0'+(new Date().getDate()):(new Date().getDate()));
const _activeDay = this.data.activeDay;
......
......@@ -300,6 +300,16 @@ Page({
formIdCreate({
formId
})
let pages = getCurrentPages();
let currPage = null; //当前页面
let prevPage = null; //上一个页面
if (pages.length >= 2) {
currPage = pages[pages.length - 1]; //当前页面
prevPage = pages[pages.length - 2]; //上一个页面
}
prevPage.setData({
showRefresh: true
});
wx.navigateBack({
delta: 1, // 回退前 delta(默认为1) 页面
})
......
......@@ -118,7 +118,8 @@ Page({
circlepage: 1,
circleperPage: 10,
circleList: [],
circleTotal: 0
circleTotal: 0,
showRefresh: false
},
onLoad: function (options) { // Do some initialize when page load.
const {
......@@ -129,21 +130,7 @@ Page({
Object.assign(this.data, {
id: id || 0,
from: from || 0,
sid: sid || 0
})
wx.hideShareMenu()
},
onReady: function () { // Do something when page ready.
let that = this;
wx.createSelectorQuery().select('.header-wrap').boundingClientRect(function(rect){
rect.height; // 节点高度
}).exec(function(res){
that.headerHeight = res[0].height;
})
},
onShow: function () { // Do something when page show.
this.getCircleDetail();
Object.assign(this.data, {
sid: sid || 0,
page: 1,
studentpage: 1,
schedulepage: 1,
......@@ -151,6 +138,7 @@ Page({
mixedthemeTotal: 0,
memberTotal: 0,
})
this.getCircleDetail();
this.setData({
hasmore: true,
scheduleHasmore: true,
......@@ -161,6 +149,40 @@ Page({
},()=>{
this.doInit('init')
})
wx.hideShareMenu()
},
onReady: function () { // Do something when page ready.
let that = this;
wx.createSelectorQuery().select('.header-wrap').boundingClientRect(function(rect){
rect.height; // 节点高度
}).exec(function(res){
that.headerHeight = res[0].height;
})
},
onShow: function () { // Do something when page show.
if(this.data.showRefresh){
this.getCircleDetail();
Object.assign(this.data, {
page: 1,
studentpage: 1,
schedulepage: 1,
schedulesTotal: 0,
mixedthemeTotal: 0,
memberTotal: 0,
})
this.setData({
hasmore: true,
scheduleHasmore: true,
studentHasmore: true,
mixedthemeList: [],
schedulesList:[],
memberList: [],
},()=>{
this.doInit('init')
})
this.data.showRefresh = false;
}
},
onPullDownRefresh: function () { // Do something when pull down.
Object.assign(this.data, {
......
......@@ -40,6 +40,8 @@ Page({
} = options;
Object.assign(this.data, {
sid: sid || 0,
})
this.setData({
newcreate: newcreate || 0,
})
if (this.data.newcreate) {
......
......@@ -209,14 +209,25 @@ Page({
},
// 跟打卡列表组件相关联的操作
goClock () {
if (this.data.clock.subject.subject_type == 1) {
wx.navigateTo({
url: `/business/pages/themeindex/index?id=${this.data.id}&tid=${this.data.tid}&sid=${this.data.sid}`
})
} else if (this.data.clock.subject.subject_type == 2) {
wx.navigateTo({
url: `/business/pages/calendarthemeindex/index?id=${this.data.id}&tid=${this.data.tid}&sid=${this.data.sid}`
})
const thisSubject = this.data.clock.subject;
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}`
})
break;
case 2:
wx.navigateTo({
url: `/business/pages/calendarthemeindex/index?id=${this.data.id}&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}`
})
break;
default:
break;
}
},
delComments (e) {
......
......@@ -498,6 +498,16 @@ Page({
} else if (!that.data.privatecomment && that.data.peid) {
that.privateCommentDel()
} else{
let pages = getCurrentPages();
let currPage = null; //当前页面
let prevPage = null; //上一个页面
if (pages.length >= 2) {
currPage = pages[pages.length - 1]; //当前页面
prevPage = pages[pages.length - 2]; //上一个页面
}
prevPage.setData({
showRefresh: true
});
wx.navigateBack({
delta: 1, // 回退前 delta(默认为1) 页面
})
......@@ -516,6 +526,16 @@ Page({
school_id:this.data.sid
}).then((res) => {
if (res.code == 200) {
let pages = getCurrentPages();
let currPage = null; //当前页面
let prevPage = null; //上一个页面
if (pages.length >= 2) {
currPage = pages[pages.length - 1]; //当前页面
prevPage = pages[pages.length - 2]; //上一个页面
}
prevPage.setData({
showRefresh: true
});
wx.navigateBack({
delta: 1, // 回退前 delta(默认为1) 页面
})
......
......@@ -120,7 +120,8 @@ Page({
AcSubIndex: 0, // 当前选中的关卡
emptySub: false, // 未设置课时
addSubDialogS:false,// 添加关卡
scrollLeft:0
scrollLeft:0,
showRefresh:false,
},
onLoad: function (options) { // Do some initialize when page load.
this.innerAudioContext = wx.createInnerAudioContext(); // 当前页面唯一的一个音频容器
......@@ -139,6 +140,8 @@ Page({
sub:sub||0,
AcSubIndex:sort?sort-1:0
})
this.getDetail();
this.getUnlockSubjectList();
// console.log(this.data.sort)
},
onReady: function () { // Do something when page ready.
......@@ -151,12 +154,10 @@ Page({
}
},
onShow: function () { // Do something when page show.
this.getDetail();
this.getUnlockSubjectList();
// this.getThemeDetail();
let dakarole = LocalStorage.getItem('dakarole');
if (dakarole == 2) {
this.teachersPermission();
if(this.data.showRefresh){
this.getDetail();
this.getUnlockSubjectList();
this.data.showRefresh = false;
}
},
onHide: function () { // Do something when page hide.
......
......@@ -52,6 +52,7 @@ Page({
},
commenteditor: false, // 评论input框
commentclock: '', //回复的clock
showRefresh: false
},
/**
......@@ -68,9 +69,12 @@ Page({
title: '未点评'
})
this.setData({
page: 1,
hasmore: true,
emptyPage: false,
listLoading: false,
page: 1,
})
this.getThemeList('init');
},
......@@ -79,13 +83,6 @@ Page({
*/
onReady: function () {
wx.hideShareMenu();
// let user = LocalStorage.getItem('user');
let dakarole = LocalStorage.getItem('dakarole');
if (dakarole == 1) {
this.setData({
permission: [1, 2, 3, 4, 5, 6, 7]
})
}
},
/**
......@@ -93,22 +90,16 @@ Page({
*/
onShow: function () {
// let user = LocalStorage.getItem('user');
let dakarole = LocalStorage.getItem('dakarole');
if (dakarole == 1) {
if(this.data.showRefresh){
this.setData({
permission: [1, 2, 3, 4, 5, 6, 7]
hasmore: true,
emptyPage: false,
listLoading: false,
page: 1,
})
this.getThemeList('init');
this.data.showRefresh = false;
}
if (dakarole == 2) {
this.teachersPermission();
}
this.setData({
hasmore: true,
emptyPage: false,
listLoading: false,
page: 1,
})
this.getThemeList('init');
},
/**
......
......@@ -225,6 +225,16 @@ Page({
return
}
// 班级添加学员
let pages = getCurrentPages();
let currPage = null; //当前页面
let prevPage = null; //上一个页面
if (pages.length >= 2) {
currPage = pages[pages.length - 1]; //当前页面
prevPage = pages[pages.length - 2]; //上一个页面
}
prevPage.setData({
showRefresh: true
});
if(from=='circle'){
classStudentsAdd({
class_id: this.data.id,
......
......@@ -380,6 +380,12 @@ Page({
const {
formId
} = e.detail;
clearTimeout(this.timeOut)
this.timeOut = setTimeout((formId)=>{
this.thisSaveTheme(formId)
},300)
},
thisSaveTheme() {
const that = this;
const _params = JSON.parse(JSON.stringify(this.data.params));
const publish_time = this.data.params.startDate+' '+this.data.params.startTime;
......@@ -438,9 +444,9 @@ Page({
} = res;
wx.hideLoading();
if (code == 200) {
formIdCreate({
formId
})
// formIdCreate({
// formId
// })
wx.showToast({
title: '保存成功'
})
......@@ -462,6 +468,16 @@ Page({
})
return;
}
let pages = getCurrentPages();
let currPage = null; //当前页面
let prevPage = null; //上一个页面
if (pages.length >= 2) {
currPage = pages[pages.length - 1]; //当前页面
prevPage = pages[pages.length - 2]; //上一个页面
}
prevPage.setData({
showRefresh: true
});
wx.navigateBack({
delta: 1, // 回退前 delta(默认为1) 页面
success: function () {
......
......@@ -293,6 +293,16 @@ Page({
wx.showToast({
title: '保存成功'
})
let pages = getCurrentPages();
let currPage = null; //当前页面
let prevPage = null; //上一个页面
if (pages.length >= 2) {
currPage = pages[pages.length - 1]; //当前页面
prevPage = pages[pages.length - 2]; //上一个页面
}
prevPage.setData({
showRefresh: true
});
wx.navigateBack({
delta: 1, // 回退前 delta(默认为1) 页面
success () {
......
......@@ -109,7 +109,8 @@ Page({
commenteditor: false, // 评论input框
commentclock: '', //回复的clock
listindex:'',
index:''
index:'',
showRefresh: false,
},
onLoad: function(options) { // Do some initialize when page load.
this.innerAudioContext = wx.createInnerAudioContext(); // 当前页面唯一的一个音频容器
......@@ -119,11 +120,6 @@ Page({
tid,
sid
})
// wx.hideShareMenu()
},
onReady: function() { // Do something when page ready.
},
onShow: function() { // Do something when page show.
this.getDetail();
if (this.data.bigSort == 1) {
this.setData({
......@@ -138,6 +134,28 @@ Page({
})
this.clockMemberListGet(this.data.twoSmallSort, 'init');
}
// wx.hideShareMenu()
},
onReady: function() { // Do something when page ready.
},
onShow: function() { // Do something when page show.
if(this.data.showRefresh){
this.getDetail();
if (this.data.bigSort == 1) {
this.setData({
page: 1,
hasmore: true,
})
this.clockListGet(this.data.oneSmallSort, 'init');
} else if(this.data.bigSort == 2){
this.setData({
mPage: 1,
mHasmore: true,
})
this.clockMemberListGet(this.data.twoSmallSort, 'init');
}
this.data.showRefresh = false;
}
},
onHide: function() { // Do something when page hide.
this.innerAudioContext.pause();
......
......@@ -78,6 +78,7 @@ Component({
iosPhoneWarn: false,
},
created () {
console.log(this.data.content, 'this.data.content')
},
attached () {
},
......@@ -109,7 +110,7 @@ Component({
if (this.data.maxTextBoxLength == this.data.textBoxLength) { // 当等于10条了不能继续添加
return
}
let content = this.data.content;
let content = JSON.parse(JSON.stringify(this.data.content));
content.push({
type: 'text',
value: '',
......@@ -123,6 +124,7 @@ Component({
textBoxLength: this.countCaculate('text', this.data.content)
})
})
console.log(this.data.content, 'this.data.content')
},
addImg () { // 添加图片的操作
if (this.data.maxImgBoxLength == this.data.imgBoxLength) { // 当等于10条了不能继续添加
......
......@@ -186,12 +186,9 @@
<view class="theme-name-box {{type == 1 ? '' : 'pdl64'}}" wx:if="{{clock.subject_type!=3 &&( type==1 || othertype==1)}}" bindtap="goThemeIndex" data-subject="{{clock}}">{{clock.subject.title}}</view>
<view class="operate-box">
<view class="btn fingureup-btn" bindtap="fingureUp" bindtouchstart="touchStart" bindtouchend="touchEnd">
<!-- <form report-submit="true" bindsubmit="formIdCreate" class="createidform">
<button form-type="submit" class="createidbutton">生成form</button>
</form> -->
<image class="iconimg {{clock.had_like ? 'fingureuporedicon' : ''}}" src="{{imageRoot}}2c/clockdetail/{{clock.had_like ? 'redheart' : 'heart'}}.png?{{imageVersion}}" ></image>
<!-- <text class="btnname" style="{{clock.had_like ? 'color:#FF6161' : ''}}" >赞</text> -->
<text class="btnname" style="{{clock.had_like ? 'color:#FF6161' : ''}}" wx:if="{{clock.likes.total > 0}}">{{clock.likes.total}}</text>
<text class="btnname" style="{{clock.had_like ? 'color:#FF6161' : ''}}" >赞</text>
<text class="btnname" style="{{clock.had_like ? 'color:#FF6161' : ''}}" wx:if="{{clock.likes.total > 0}}">{{clock.likes.total}}</text>
</view>
<view class="btn assess-btn" data-cid="{{clock.id}}" bindtap="goEvaluate">
<form report-submit="true" bindsubmit="formIdCreate" class="createidform">
......
/*
time: 2018-10-31
author: wxl
*/
import {
judgeIsClock,
clockList,
......@@ -435,9 +432,6 @@ Page({
})
},
contactShop() {
// this.setData({
// concatDiaShow: true
// })
wx.navigateTo({
url: `/src/pages/contactindex/index?sid=${this.data.circleInfo.school_id}`,
})
......
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