25 lines
516 B
TypeScript
25 lines
516 B
TypeScript
Component({
|
|
methods: {
|
|
// 更新阅读进度
|
|
updateProgress(e: any) {
|
|
const { currentPage } = e.detail;
|
|
const { book } = this.data;
|
|
|
|
// 更新进度
|
|
wx.cloud.callFunction({
|
|
name: 'updateReadingProgress',
|
|
data: {
|
|
bookId: book.id,
|
|
currentPage,
|
|
readingTime: this.data.currentReadingTime
|
|
}
|
|
});
|
|
},
|
|
|
|
// 开始计时
|
|
startReading() {
|
|
this.startTime = Date.now();
|
|
// 开始计时逻辑
|
|
}
|
|
}
|
|
});
|