页面样式
页面代码
collection.js
import Toast from "../../miniprogram_npm/@vant/weapp/toast/toast";
Page({
/**
* 页面的初始数据
*/
data: {
loadFinish: false,
total: 0,
currentIndex: 0,
question: null,
questionList: [],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this._getList();
},
_getList() {
const that = this;
wx.cloud
.callFunction({
name: "questionPool",
data: {
type: "getCollection",
},
})
.then((res) => {
const { questionList, errMsg, errCode } = res.result