if (this.num !== 9) {
console.log("下一章");
this.num = this.num + 1
uniCloud.callFunction({
name: "conditiondata",
data: {
num: this.num
}
}).then(res => {
console.log(res);
this.listarr = res.result.data[0].content
this.title = res.result.data[0].title
this.num = res.result.data[0].num
console.log(this.num);
uni.pageScrollTo({
scrollTop: 0, // 将滚动位置设置为顶部
duration: 0 // 滚动到顶部的动画时长,单位为毫秒
});
})
} else {
uni.showToast({
title: "已经是最后一章了哦~~",
icon: "none"
})
uniapp if判断语句的使用
最新推荐文章于 2024-04-27 13:01:21 发布