Commit d262a6e0 authored by wangxuelai's avatar wangxuelai

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

parents 191ee931 42a44650
......@@ -82,7 +82,7 @@
.date-area {
/* height: 80rpx; */
line-height: 1;
padding: 0 224rpx;
padding: 0 214rpx;
font-size:26rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
......
......@@ -47,6 +47,7 @@ import initCalendar, {
setSelectedDays,
getSelectedDay,
enableArea,
enableDays,
jump
} from '../../components/calendar/main.js';
function compare(property) {
......@@ -293,10 +294,6 @@ Page({
})
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()));
......@@ -362,6 +359,13 @@ Page({
noCommentTotal: Number(data.not_review_count || 0),
})
this.getCircleDetail()
const startD = data.calendar_set.start_time.split(" ")[0]
const endD = data.calendar_set.end_time.split(" ")[0]
if (this.numberDate(startD) == this.numberDate(endD)) {
enableDays([this.numberDate(startD)])
} else {
enableArea([this.numberDate(startD), this.numberDate(endD)])
}
}
}).catch((err) => {
wx.hideLoading()
......@@ -1282,26 +1286,6 @@ Page({
isexpand: !this.data.isexpand
})
},
teachersPermission() {
const _permission = this.data.permission;
teachersPermission({
school_id: this.data.sid,
}).then(res => {
if (res.code == 200) {
const list = res.data.list;
for (let i = 0; i < list.length; i++) {
for (let j = 0; j < _permission.length; j++) {
if (list[i] == j + 1) {
_permission[j] = list[i]
}
}
}
this.setData({
permission: _permission,
})
}
}).catch(() => {})
},
showcommenteditor(e) {
const { listindex , index} = e.currentTarget.dataset;
Object.assign(this.data,{
......@@ -1359,10 +1343,7 @@ Page({
const mydate = '' + currentDate;
var currentFirstDate;
var formatDate = function (date) {
const today = new Date(new Date().getFullYear()+'/'+(new Date().getMonth()+1)+'/'+new Date().getDate());
// console.log(Math.abs(today.getTime() - date.getTime()))
var year = date.getFullYear() + '';
var month = (date.getMonth() + 1) + '';
var day = date.getDate() + '';
......@@ -1388,19 +1369,15 @@ Page({
date = addDate(date, week * -1);
currentFirstDate = new Date(date);
for (var i = 0; i < 7; i++) {
// formatDate(i==0 ? date : addDate(date,1)); 星期一开始
//console.log(); //星期日开始
arr.push(formatDate(i == 0 ? addDate(date, -1) : addDate(date, 1)));
}
return arr
}
// console.log(setDate(currentFirstDate));
const _weeksArr = setDate(currentDate);
for (let i = 0; i < _weeksArr.length; i++) {
if (Math.abs(new Date(_weeksArr[i].date).getTime() - new Date(mydate).getTime()) <= 86390000) {
_weeksArr[i].isSelect = true;
}
// console.log(_weeksArr[i].year+'-'+_weeksArr[i].month+'-'+_weeksArr[i].day)
if(restDates){
let flag = false;
for(let j=0,len=restDates.length;j<len;j++){
......@@ -1512,4 +1489,7 @@ Page({
})
return _length;
},
numberDate(date) {
return date.split('-')[0] + '-' + Number(date.split('-')[1]) + '-' + Number(date.split('-')[2])
},
})
\ No newline at end of file
......@@ -5,7 +5,7 @@
* @Last Modified time: 2019-01-26 15:50:05
*/
import WussComponent from '../common/extends/baseComponent';
var app = getApp();
WussComponent({
/**
* @param {boolean} notimestamp 是否使用时间戳 true为不是
......@@ -63,6 +63,7 @@ WussComponent({
},
downTime:99,
localImageRoot: '../../images/',
imageRoot: app.globalData.imageRoot,
},
attached () {
if (this.data.isRead > 0) {
......
......@@ -204,17 +204,6 @@ Page({
pagefrom,
integral
} = options;
// const {id, tid} = options;
// let pagefrom = 'businesstheme';
// if (integral !== undefined && Number(integral) > 0) {
// this.setData({
// scoreFeedBackStatus: {
// integral: integral,
// show: true,
// scoretype: 1,
// }
// })
// }
this.setData({
id,
tid,
......@@ -278,20 +267,6 @@ Page({
hasmore: true,
})
}
// // this.clockListGet('init');
// // this.selfClockGet();
// initCalendar({ // 这次注释
// multi: false,
// noDefault: false,
// whenChangeMonth(current, next) {},
// afterCalendarRender(ctx) {
// const data = [];
// // 异步请求
// setTimeout(() => {}, 1000);
// setTimeout(() => {}, 2000);
// }
// });
},
onHide: function () { // Do something when page hide.
this.innerAudioContext.pause();
......
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