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