123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371 |
- const app = getApp();
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- isOne:1,
- graphicReasoning:0,
- statusBar: app.globalData.statusBar,
- times: 0,
- level: 1,
- isOneShow:true,
- isOnePointShow:true,
- isOneImgShow: false,
- isTwoShow:true,
- isTwoImgShow:false,
- isTwoPointShow:true,
- yesImg: '../../image/zheng_que.png',
- noImg: '../../image/cuo_wu.png',
- lianxiList:[
- {
- idx: 1,
- imgTitle: '../../image/lianxi_title_one.png',
- header: '正式测试前先练习一下吧:',
- title: '请从下面所给出的小图片中找出适合大图案的一张,可以使整个图案合理与完整.',
- answerList: [
- {
- img: '../../image/lianxi_one_as_a.png',
- text: 'A',
- isAnswer:0,
- status: ''
- },
- {
- img: '../../image/lianxi_one_as_b.png',
- text: 'B',
- isAnswer: 0,
- status: ''
- },
- {
- img: '../../image/lianxi_one_as_c.png',
- text: 'C',
- isAnswer: 1,
- status: ''
- },
- {
- img: '../../image/lianxi_one_as_d.png',
- text: 'D',
- isAnswer: 0,
- status: ''
- },
- {
- img: '../../image/lianxi_one_as_e.png',
- text: 'E',
- isAnswer: 0,
- status: ''
- },
- {
- img: '../../image/lianxi_one_as_f.png',
- text: 'F',
- isAnswer: 0,
- status: ''
- }
- ]
- },
- {
- idx: 2,
- imgTitle: '../../image/lianxi_title_two.png',
- header:'正式测试前先练习一下吧:',
- title: '下面灰色图形旋转可以得到哪张黄色图形',
- answerList: [
- {
- img: '../../image/lianxi_two_as_a.png',
- text: 'A',
- isAnswer: 0,
- status: ''
- },
- {
- img: '../../image/lianxi_two_as_b.png',
- text: 'B',
- isAnswer: 0,
- status: ''
- },
- {
- img: '../../image/lianxi_two_as_c.png',
- text: 'C',
- isAnswer: 0,
- status: ''
- },
- {
- img: '../../image/lianxi_two_as_d.png',
- text: 'D',
- isAnswer: 1,
- status: ''
- }
- ]
- },
- {
- idx: 3,
- imgTitle: '../../image/lianxi_title_four.png',
- header: '正式测试前先练习一下吧:',
- title: '从左边看这个几何体,看到的形状是?',
- answerList: [
- {
- img: '../../image/lianxi_four_as_a.png',
- text: 'A',
- isAnswer: 1,
- status: ''
- },
- {
- img: '../../image/lianxi_four_as_b.png',
- text: 'B',
- isAnswer: 0,
- status: ''
- },
- {
- img: '../../image/lianxi_four_as_c.png',
- text: 'C',
- isAnswer: 0,
- status: ''
- },
- {
- img: '../../image/lianxi_four_as_d.png',
- text: 'D',
- isAnswer: 1,
- status: ''
- }
- ]
- },
- {
- idx: 4,
- imgTitle: '../../image/lianxi_title_four.png',
- header: '正式测试前先练习一下吧:',
- title: '仔细观察下列图形',
- titleOne:'请找出哪张图片发生了变化',
- titleList: [
- {
- img: '../../image/lianxi_three_as_a.png',
- text: 'A',
- isAnswer: 0,
- status: ''
- },
- {
- img: '../../image/lianxi_three_as_c.png',
- text: 'B',
- isAnswer: 0,
- status: ''
- },
- {
- img: '../../image/lianxi_three_as_d.png',
- text: 'C',
- isAnswer: 0,
- status: ''
- }
- ],
- answerList: [
- {
- img: '../../image/lianxi_three_as_b.png',
- text: 'A',
- isAnswer: 1,
- status: ''
- },
- {
- img: '../../image/lianxi_three_as_c.png',
- text: 'B',
- isAnswer: 0,
- status: ''
- },
- {
- img: '../../image/lianxi_three_as_d.png',
- text: 'C',
- isAnswer: 0,
- status: ''
- }
- ],
- },
- {
- idx: 5,
- imgTitle: '',
- header: '正式测试前先练习一下吧:',
- title: '仔细观察下列图形',
- titleOne: '请找出哪张图片发生了变化',
- titleList: [
- {
- img: '../../image/lianxi_five_as_a.png',
- text: 'A',
- isAnswer: 0,
- status: ''
- },
- {
- img: '../../image/lianxi_five_as_c.png',
- text: 'B',
- isAnswer: 0,
- status: ''
- },
- {
- img: '../../image/lianxi_five_as_d.png',
- text: 'C',
- isAnswer: 0,
- status: ''
- }
- ],
- answerList: [
- {
- img: '../../image/lianxi_five_as_a.png',
- text: 'A',
- isAnswer: 0,
- status: ''
- },
- {
- img: '../../image/lianxi_five_as_b.png',
- text: 'B',
- isAnswer: 1,
- status: ''
- },
- {
- img: '../../image/lianxi_five_as_d.png',
- text: 'C',
- isAnswer: 0,
- status: ''
- }
- ],
- },
- ]
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- this.setData(options)
-
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
-
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
- },
- /**
- * 底部导航跳转
- */
- redirectCtl: app.redirectCtl,
- /**
- * 返回上一级页面
- */
- blockCtl: function () {
- this.redirectCtl({ url: 'info', method: {} }, true)
- },
- /**
- * 开始答题
- */
- actionAnswer:function(){
- const { isTxtl}=this.data;
- this.startSetInter();
- this.setData({ isTxtl:false})
- },
- /**
- * 选择答案
- */
- selectItems: function (e) {
- const { bindex,sindex } = e.currentTarget.dataset;
- const { lianxiList, times} = this.data;
- var that = this;
- var temp = {};
- for (var i in lianxiList[bindex].answerList) {
- temp[`lianxiList[${bindex}].answerList[${i}].status`] = '';
- }
- if (lianxiList[bindex].answerList[sindex].isAnswer == 1) {
- that.setData({ isYes: true })
- } else {
- that.setData({ isYes: false })
- }
- temp[`lianxiList[${bindex}].answerList[${sindex}].status`] = lianxiList[bindex].answerList[sindex].status == '' ? 'active' : ''
- this.setData(temp);
- this.setData({ isAnswer: true })
- setTimeout(
- function () {
- that.setData({ level: bindex + 2, isAnswer:false })
- if (bindex + 2 == 4) {
- that.hiddenShow()
- } else if (bindex + 2 ==5){
- that.hiddenTwoShow()
- }else if(bindex + 2 ==6){
- that.saveExercise()
- that.redirectCtl({ url: 'info', method: { isExercise:1,isShow:1} }, true)
- }
- }, 500
- )
- },
- /**
- * 第四题显示
- */
- hiddenShow:function(){
- const { isOneShow, isOnePointShow, isOneImgShow } = this.data;
- var that = this;
- setTimeout(function () {
- that.setData({ isOneImgShow:true})
- setTimeout(function () {
- that.setData({ isOneShow: false })
- }, 2000)
- }, 400)
- },
- /**
- * 第五题显示
- */
- hiddenTwoShow: function () {
- const { isTwoShow, isTwoImgShow, isTwoPointShow } = this.data;
- var that = this;
- setTimeout(function () {
- that.setData({ isTwoImgShow: true })
- setTimeout(function () {
- that.setData({ isTwoShow: false })
- }, 500)
- }, 400)
- },
- /**
- * 保存练习结果
- */
- saveExercise:function(){
- const postData = { fn: this.getPersonInfo, param: { ...arguments } }
- var that = this;
- app.post('/api/game/v2/saveV2', {level:0}, 0, postData).then(res => {
-
- })
- },
- })
|