8 Star 0 Fork 0

greenhand_coder/practice

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
wrongModal.js 1.66 KB
一键复制 编辑 原始数据 按行查看 历史
greenhand_coder 提交于 2021-09-18 09:29 +08:00 . finally push
// components/wrongModal/wrongModal.js
Component({
/**
* 组件的属性列表
*/
properties: {
// 是否显示
modalShow: {
type: Boolean,
value: false
},
// 题库
questionList: {
type: Array,
value: []
},
// 错题题数-乱序
wrongList: {
type: Array,
value: []
},
// 选择的答案
chooseValue: {
type: Array,
value: []
},
trueValue: {
type: Array,
value: []
}
},
/**
* 组件的初始数据
*/
data: {
index: 0
},
/**
* 组件所在页面的生命周期
*/
pageLifetimes: {
show: function () {
// 页面被展示
console.log('show')
console.log(this.data.questionList)
console.log(this.data.wrongList)
},
hide: function () {
// 页面被隐藏
},
resize: function (size) {
// 页面尺寸变化
}
},
/**
* 组件的方法列表
*/
methods: {
// 下一题
next: function(){
if (this.data.index < this.data.wrongList.length - 1){
// 渲染下一题
this.setData({
index: this.data.index + 1
})
}
},
// 关闭弹窗
closeModal: function(){
this.setData({
modalShow: false
})
},
// 再来一次
again: function(){
wx.reLaunch({
url: '../test/test'
})
},
// 返回首页
toIndex: function () {
wx.reLaunch({
url: '../home/home'
})
},
}
})
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/greenhand_coder/practice.git
git@gitee.com:greenhand_coder/practice.git
greenhand_coder
practice
practice
master

搜索帮助