Commit f85d70c0 authored by lvtz's avatar lvtz

Merge branch 'wxl-youhua' of git.server:wangxuelai/wechatapp.shangjiadao.com into 20190829_lvtz

parents 0ea5d429 7a896796
......@@ -222,14 +222,6 @@ Page({
const {bigtabtype} = e.currentTarget.dataset;
that.setData({
bigTabStatus: bigtabtype,
// hasmore: true,
// page: 1,
// mixedthemeList: [],
// mixedthemeTotal: 0,
// schedulesList:[],
// schedulesTotal: 0,
// memberList: [],
// memberTotal: 0,
}, () => {
that.doInit('init','tab');
})
......@@ -330,14 +322,6 @@ Page({
for (var i in list_middle) {
var d = list_middle[i];
if (d.length > 0) {
// for(var i in d){
// var m = d[i].start_time.slice(4,10).split('-');
// var startT = d[i].start_time.slice(11,16);
// var endT = d[i].end_time.slice(11,16);
// var newMonth = m[1]+'月'+m[2]+'日';
// }
list_after.push({month: i, statics: d});
}
}
......
......@@ -278,19 +278,7 @@
<view class="has-nomore" wx:if="{{!hasmore && page>1}}">没有更多了</view>
<view class="form-fixbtn" bindtap="addTheme">发布作业</view>
</block>
</view>
<!-- <poster-box
wx:if="{{posterBoxShow}}"
canvasimagepath="{{canvasImagePath}}"
bind:closeposter="closeposter"
bind:sharecallback="sharecallback"
>
</poster-box> -->
<!-- <view class="poste-box" id='canvas-container' wx:if="{{canvasShow}}">
<canvas class="mycanvas" canvas-id="myCanvas" style="width:100%;height:1334rpx;"/>
</view> -->
<go-top wx:if="{{backTopValue}}"></go-top>
<view class="copy-theme-box" wx:if="{{showcopybox}}" catchtouchmove="preventD" >
<view class="copy-theme-content" >
......
......@@ -182,4 +182,4 @@
</btn-drag>
</view>
\ No newline at end of file
......@@ -323,24 +323,6 @@ Page({
schoolInfo: data ? data : '',
tabList: _tabList,
}, () => {
// const that = this;
// wx.createSelectorQuery().select('#banner').boundingClientRect(function (rect) {
// that.setData({
// "boxTop.banner": rect ? rect.top : ''
// })
// }).exec()
// wx.createSelectorQuery().select('#student-clock').boundingClientRect(function (rect) {
// that.setData({
// "boxTop.studentclock": rect ? rect.top : ''
// })
// }).exec()
// wx.createSelectorQuery().select('#business-info').boundingClientRect(function (rect) {
// that.setData({
// "boxTop.businessinfo": rect ? rect.top : ''
// })
// }).exec()
})
}
}).catch((e) => {
......
......@@ -90,9 +90,7 @@ Component({
if (this.data.submiting) {
return
}
this.setData({
submiting: true
})
this.data.submiting = true;
wx.showLoading({
title: '评论提交中...'
})
......@@ -105,9 +103,7 @@ Component({
p_type: this.data.prams.ptype
// union_id: visitor.unionid
}).then((res) => {
this.setData({
submiting: false
})
this.data.submiting = false;
wx.hideLoading();
if (res.code == 200) {
// console.log(res.data, 'sadsad');
......@@ -118,9 +114,7 @@ Component({
}
}).catch(() => {
wx.hideLoading();
this.setData({
submiting: false
})
this.data.submiting = false;
this.triggerEvent('hidecommenteditor', {
integral: 0
})
......@@ -135,9 +129,7 @@ Component({
p_type:1,
p_id: this.data.prams.eid,
}).then((res) => {
this.setData({
submiting: false
})
this.data.submiting = false;
wx.hideLoading();
if (res.code == 200) {
this.triggerEvent('hidecommenteditor', {
......@@ -146,9 +138,7 @@ Component({
}
}).catch(() => {
wx.hideLoading();
this.setData({
submiting: false
})
this.data.submiting = false;
this.triggerEvent('hidecommenteditor', {
})
})
......
......@@ -44,7 +44,11 @@ WussComponent({
this.setData({
initTimes
}, () => {
this._startTime();
if (this.data.issilence && this.timer) {
clearInterval(this.timer);
} else {
this._startTime();
}
});
},
},
......@@ -60,7 +64,9 @@ WussComponent({
downTime:99,
},
attached () {
this._downTime()
if (this.data.isRead > 0) {
this._downTime()
}
},
detached() {
if (this.data.themeId) {
......@@ -71,14 +77,12 @@ WussComponent({
}
clearTimeout(this.timer);
clearInterval(this.downtimer);
console.log('结束');
},
pageLifetimes: {
show() {
},
hide() {
clearInterval(this.downtimer);
console.log('结束');
if (this.data.themeId) {
wx.setStorage({
key: this.data.themeId + 'themeRead',
......@@ -95,14 +99,15 @@ WussComponent({
_startTime() {
clearInterval(this.timer);
this.timer = setInterval(() => {
console.log('启动了分钟的计时器');
this._timer();
}, 1e3);
this._timer();
},
_downTime(){
clearInterval(this.downtimer);
console.log('开始');
this.downtimer = setInterval(() => {
console.log('启动了毫秒的计时器');
this.setData({
downTime:Number(this.data.downTime)-1>=0?(Number(this.data.downTime)-1>=10?Number(this.data.downTime)-1:'0'+(Number(this.data.downTime)-1)):99
})
......
......@@ -313,13 +313,18 @@ function matchTime(time,type){
}
function monthIsShow(month){
console.log(month,months)
if(months.indexOf(month)>-1){
return false;
}
months.push(month);
return true;
}
function countDownToSecond(timeStamp) {
var newtimeStamp = timeStamp;
return newtimeStamp;
// setTimeout(() => {
// }, 1000)
}
module.exports = {
formatDate: formatDate,
timeCompare: timeCompare,
......@@ -345,5 +350,6 @@ module.exports = {
matchTime: matchTime,
monthIsShow:monthIsShow,
teacherInvitationStatus: teacherInvitationStatus,
courseMode: courseMode
courseMode: courseMode,
countDownToSecond: countDownToSecond,
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -85,8 +85,6 @@
</view>
</view>
<view class="content-wrapper-box" >
<!-- <view class="" style="height: 87px" wx:if="{{fixedWeeks}}">
</view> -->
<view class="weeks-box" >
<view class="item-box" >
<view class="item" wx:for="{{weeksArr}}"
......@@ -273,7 +271,9 @@
bind:showcommenteditor="showcommenteditor"
bind:playvideo="playvideo"
bind:delActiveDClock="delActiveDClock"
bind:drawpaint="drawpaint">
bind:drawpaint="drawpaint"
data-clockitemtype="selfclock"
>
</clock-item>
</view>
</view>
......@@ -285,34 +285,38 @@
<text class="" selectable="false" space="false" decode="false">人</text>
</view>
<view class="" wx:if="{{themeSelect.is_cheat == 0 || (themeSelect.is_cheat == 1 && activeDay.isClock) || (themeSelect.is_cheat == 1 &&!isSchoolStudent) || (clockTotal + selfcount) == 0}}">
<view class="clock-list" wx:if="{{!emptyPage}}">
<view class="clock-item" wx:for="{{clockList}}" wx:key="index" wx:if="{{clockList.length > 0}}">
<clock-item
clock="{{item}}"
bind:delClock="delClock"
bind:expandAccessment="expandAccessment"
bind:fingureUp="fingureUp"
cindex="{{index}}"
tid="{{themeSelect.id}}"
cid="{{id}}"
bind:expandLikes="expandLikes"
bind:expandContent="expandContent"
headerclick="{{true}}"
bind:playvoice="playvoice"
bind:pausevoice="pausevoice"
bind:voiceslide="voiceslide"
audioStorage="{{audioStorage}}"
bind:slidestart="slidestart"
bind:slideend="slideend"
bind:videoplay="videoplay"
bind:delEvaluate="delEvaluate"
bind:showcommenteditor="showcommenteditor"
bind:playvideo="playvideo"
bind:drawpaint="drawpaint">
</clock-item>
</view>
<block class="clock-list" wx:if="{{!emptyPage}}">
<block class="clock-item" wx:for="{{clockList}}" wx:key="bigindex" wx:for-index="bigindex" wx:for-item="bigitem" wx:if="{{clockList.length > 0}}">
<view class="" wx:key="index" wx:for="{{bigitem}}">
<clock-item
clock="{{item}}"
bind:delClock="delClock"
bind:fingureUp="fingureUp"
cindex="{{index}}"
tid="{{themeSelect.id}}"
cid="{{id}}"
bind:expandContent="expandContent"
headerclick="{{true}}"
bind:playvoice="playvoice"
bind:pausevoice="pausevoice"
bind:voiceslide="voiceslide"
audioStorage="{{audioStorage}}"
bind:slidestart="slidestart"
bind:slideend="slideend"
bind:videoplay="videoplay"
bind:delEvaluate="delEvaluate"
bind:showcommenteditor="showcommenteditor"
bind:playvideo="playvideo"
bind:drawpaint="drawpaint"
data-bigindex="{{bigindex}}"
data-index="{{index}}"
data-clockitemtype="clocklist"
>
</clock-item>
</view>
</block>
<list-loading loading="{{clockGetting}}"></list-loading>
</view>
</block>
<view class="empty-content-box" wx:if="{{(clockTotal + selfcount) == 0}}">
<empty-content text="还没有同学交作业,快来抢沙发吧~" emptyimg="common/empty/empty_c_sraech.png" wx:if="{{emptyPage}}" width="263" height="219"></empty-content>
</view>
......@@ -320,8 +324,6 @@
<view class="empty-content-box" wx:else >
<empty-content text="还没有同学交作业,快来抢沙发吧~" emptyimg="common/empty/empty_c_sraech.png" wx:if="{{emptyPage}}" width="263" height="219"></empty-content>
</view>
<!-- <view class="pre-btn" bindtap="goPreDate" wx:if="{{activeIndex>0}}">点击查看更多教学内容</view>
<view class="pre-text" bindtap="" wx:if="{{activeIndex==0}}">没有更多内容了!</view> -->
</view>
<view class="riseDate-box" wx:if="{{activeDay.isRise}}">
<view class="icon" >
......
......@@ -139,7 +139,6 @@ Page({
const visitor = LocalStorage.getItem('visitor');
this.innerAudioContext = wx.createInnerAudioContext(); // 当前页面唯一的一个音频容器
if (options.scene) {
console.log(options.scene);
let sceneQuery = scenQueryGet(options.scene);
const {
t,
......
......@@ -607,27 +607,53 @@ Page({
})
if (res.code == 200) {
if (res.data.status == 2) {
if (this.data.pagefrom == 'themeindex') {
wx.redirectTo({
url: `/src/pages/themeindex/index?id=${this.data.id}&tid=${this.data.tid}&pagefrom=clockeditor&integral=${integral || 0}&sid=${this.data.sid}`
});
} else if (this.data.pagefrom == 'circleindex') {
wx.redirectTo({
url: `/src/pages/circleindex/index?id=${this.data.id}&tid=${this.data.tid}&pagefrom=clockeditor&integral=${integral || 0}&sid=${this.data.sid}`
});
}else if (this.data.pagefrom == 'calendarthemeindex') {
wx.redirectTo({
url: `/src/pages/calendarthemeindex/index?id=${this.data.id}&tid=${this.data.tid}&pagefrom=clockeditor&integral=${integral || 0}&sid=${this.data.sid}`
});
}else if(this.data.pagefrom == 'morethemeindex'){
wx.redirectTo({
url: `/src/pages/morethemeindex/index?id=${this.data.id}&tid=${this.data.tid}&pagefrom=clockeditor&sub=${this.data.sub}&integral=${integral || 0}&sid=${this.data.sid}`
});
const pages = getCurrentPages();
const prePages = pages[pages.length - 2];
if (prePages) {
prePages.setData({
needREfresh: true,
pagefrom: 'clockeditor',
integral: integral || 0
})
wx.navigateBack({
delta: 1, // 回退前 delta(默认为1) 页面
})
} else {
if (this.data.pagefrom == 'themeindex') {
wx.redirectTo({
url: `/src/pages/themeindex/index?id=${this.data.id}&tid=${this.data.tid}&pagefrom=clockeditor&integral=${integral || 0}&sid=${this.data.sid}`
});
} else if (this.data.pagefrom == 'circleindex') {
wx.redirectTo({
url: `/src/pages/circleindex/index?id=${this.data.id}&tid=${this.data.tid}&pagefrom=clockeditor&integral=${integral || 0}&sid=${this.data.sid}`
});
}else if (this.data.pagefrom == 'calendarthemeindex') {
wx.redirectTo({
url: `/src/pages/calendarthemeindex/index?id=${this.data.id}&tid=${this.data.tid}&pagefrom=clockeditor&integral=${integral || 0}&sid=${this.data.sid}`
});
}else if(this.data.pagefrom == 'morethemeindex'){
wx.redirectTo({
url: `/src/pages/morethemeindex/index?id=${this.data.id}&tid=${this.data.tid}&pagefrom=clockeditor&sub=${this.data.sub}&integral=${integral || 0}&sid=${this.data.sid}`
});
}
}
} else if (res.data.status == 1 && res.data.subject.classes.need_audit == 1) {
this.joinClass().then(res => {
if (res.code == 200) {
this.navigatePage(integral);
const pages = getCurrentPages();
const prePages = pages[pages.length - 2];
if (prePages) {
prePages.setData({
needREfresh: true,
pagefrom: 'clockeditor',
integral: integral || 0
})
wx.navigateBack({
delta: 1, // 回退前 delta(默认为1) 页面
})
} else {
this.navigatePage(integral);
}
}
})
} else if (res.data.status==1 && res.data.subject.classes.need_audit == 2) {
......@@ -638,7 +664,19 @@ Page({
success (res) {
if (res.confirm) {
that.joinClass().then(res => {
that.navigatePage();
const pages = getCurrentPages();
const prePages = pages[pages.length - 2];
if (prePages) {
prePages.setData({
pagefrom: 'clockeditor',
integral: 0
})
wx.navigateBack({
delta: 1, // 回退前 delta(默认为1) 页面
})
} else {
that.navigatePage();
}
})
} else if (res.cancel) {
console.log('用户点击取消')
......
......@@ -69,6 +69,18 @@ Page({
wx.hideShareMenu();
this.queryActivtySchoolInfo(sid);
const visitor = LocalStorage.getItem('visitor');
if (this.data.sid == 0) {
return;
}
this.data.page = 1;
this.setData({
// page: 1,
hasmore: true,
})
this.getClassList();
if(this.data.id){
this.themeListGet('init');
}
activityLog({
type: 22,
open_id: visitor && visitor.openid,
......@@ -101,18 +113,18 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
if (this.data.sid == 0) {
return;
}
this.data.page = 1;
this.setData({
// page: 1,
hasmore: true,
})
this.getClassList();
if(this.data.id){
this.themeListGet('init');
}
// if (this.data.sid == 0) {
// return;
// }
// this.data.page = 1;
// this.setData({
// // page: 1,
// hasmore: true,
// })
// this.getClassList();
// if(this.data.id){
// this.themeListGet('init');
// }
},
/**
......@@ -271,9 +283,6 @@ Page({
this.setData({
listLoading: true
})
// wx.showLoading({
// title: '数据加载中'
// })
mixedthemeList({
page: this.data.page,
perPage: this.data.perPage,
......@@ -293,9 +302,6 @@ Page({
} else {
if (data.total) {
this.data.mixedthemeTotal = data.total;
// this.setData({
// mixedthemeTotal: data.total
// })
}
switch (type) {
case 'init': //页面进来第一次加载
......@@ -304,9 +310,6 @@ Page({
}, () => {
if (this.data.mixedthemeTotal > this.caculateArrLength(this.data.mixedthemeList)) {
let page = this.data.page + 1;
// this.setData({
// page: page,
// })
this.data.page = page;
} else { // 没有更多了
this.setData({
......@@ -321,9 +324,6 @@ Page({
}, () => {
if (this.data.mixedthemeTotal > this.caculateArrLength(this.data.mixedthemeList)) {
let page = this.data.page + 1;
// this.setData({
// page,
// })
this.data.page = page;
} else { // 没有更多了
this.setData({
......@@ -339,9 +339,6 @@ Page({
}, () => {
if (this.data.mixedthemeTotal > this.caculateArrLength(this.data.mixedthemeList)) {
let page = this.data.page + 1;
// this.setData({
// page,
// })
this.data.page = page;
} else { // 没有更多了
this.setData({
......
This diff is collapsed.
This diff is collapsed.
......@@ -120,6 +120,7 @@ Page({
backgroundColor:'#FF7DB7'
})
const visitor = LocalStorage.getItem('visitor');
this.initPage()
activityLog({
type: 22,
open_id: visitor && visitor.openid,
......@@ -150,7 +151,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.initPage()
},
/**
......@@ -224,7 +225,11 @@ Page({
dailylistLoading: false,
totalEmpty: false,
weekEmpty: false,
dailyEmpty: false
dailyEmpty: false,
likeTotalpage: 1,
likeTotalhasmore: true,
likeTotallistLoading: false,
liketotalEmpty: false,
})
this.getLikeTotalList('init', 1);
},
......
......@@ -355,7 +355,6 @@ Page({
cid
} = e.detail;
let clock = this.data.clockList.find(ele => ele.id == cid);
console.log(clock.comments.list, 'clock.comments.list');
clock.comments.list = clock.comments.list.filter(ele => ele.id != eid);
clock.comments.total--;
this.setData({
......@@ -539,11 +538,7 @@ Page({
})
},
goclocklist() {
// wx.navigateTo({
// // url: `/src/pages/websiteindex/clocklist?sid=${this.data.sid}`,
// })
wx.reLaunch({
// url: `/src/pages/websiteindex/clocklist?sid=${this.data.sid}`,
url: `/src/pages/papersquare/index?sid=${this.data.sid}`,
})
},
......
......@@ -431,20 +431,18 @@ function copyContent(obj){
}
})
}
function debounce(fun,dely){
var timer = null;
return function(){
var context = this;
var args = arguments;
if(timer) { clearTimeout(timer) }; // 看似多余的 但是是必须的 读者可以自己思考为什么需要这么处理
var doNow = !timer; // 判断是否有定时器,如果有,就dely后清除timer,否则立即执行;
timer = setTimeout(function(){
timer = null ;
},dely)
if(doNow){
fun.apply(context, args);
}
}
function debounce(func, wait) {
var debouncetimeout;
return function () {
let context = this;
let args = arguments;
console.log(debouncetimeout);
if (debouncetimeout) clearTimeout(debouncetimeout);
debouncetimeout = setTimeout(() => {
func.apply(context, args)
}, wait);
console.log(debouncetimeout, 'debouncetimeout');
}
}
export {
encode,
......
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