| @@ -53,10 +53,301 @@ Page({ | |||||
| ['8', '9', '0', '', '', '', 'DEL'] | ['8', '9', '0', '', '', '', 'DEL'] | ||||
| ], | ], | ||||
| }, | }, | ||||
| onLoad: function () { | |||||
| }, | |||||
| jumpTo: function () { | jumpTo: function () { | ||||
| wx.redirectTo({ | wx.redirectTo({ | ||||
| url: '/pages/passCar/passCar' | url: '/pages/passCar/passCar' | ||||
| }); | }); | ||||
| }, | |||||
| handleTap: function (e) { | |||||
| this.buttonStatus(); | |||||
| this.setData({ | |||||
| choose: e.target.dataset.cardata, | |||||
| chooseClass: e.target.dataset.msg, | |||||
| chooseTop: e.target.dataset.cardata | |||||
| }); | |||||
| if (e.target.dataset.cardata == "carData.title") { | |||||
| this.setData({ | |||||
| titleShow: true, | |||||
| englishShow: false, | |||||
| numShow: false, | |||||
| specShow: false | |||||
| }) | |||||
| } else if (e.target.dataset.cardata == "carData.numFir") { | |||||
| this.setData({ | |||||
| titleShow: false, | |||||
| englishShow: true, | |||||
| numShow: false, | |||||
| specShow: false | |||||
| }) | |||||
| } else { | |||||
| if (e.target.dataset.cardata == 'carData.numSix' && this.data.title == '粤') { | |||||
| this.setData({ | |||||
| titleShow: false, | |||||
| englishShow: false, | |||||
| numShow: false, | |||||
| specShow: true | |||||
| }) | |||||
| } else { | |||||
| this.setData({ | |||||
| titleShow: false, | |||||
| englishShow: false, | |||||
| numShow: true, | |||||
| specShow: false | |||||
| }) | |||||
| } | |||||
| } | |||||
| }, | |||||
| chooseNum: function (e) { | |||||
| //console.log(this.data.choose) | |||||
| // console.log(e.target.dataset.msg); | |||||
| if (e.target.dataset.msg == 'I') { | |||||
| return | |||||
| } | |||||
| if (!!e.target.dataset.msg && e.target.dataset.msg != 'DEL') { | |||||
| switch (this.data.choose) { | |||||
| case "carData.title": | |||||
| this.setData({ | |||||
| title: e.target.dataset.msg, | |||||
| chooseClass: e.target.dataset.msg, | |||||
| chooseTop: 'carData.numFir' | |||||
| }); | |||||
| break; | |||||
| case "carData.numFir": | |||||
| this.setData({ | |||||
| numFir: e.target.dataset.msg, | |||||
| chooseClass: e.target.dataset.msg, | |||||
| chooseTop: 'carData.numSco' | |||||
| }); | |||||
| break; | |||||
| case "carData.numSco": | |||||
| this.setData({ | |||||
| numSco: e.target.dataset.msg, | |||||
| chooseClass: e.target.dataset.msg, | |||||
| chooseTop: 'carData.numThr' | |||||
| }); | |||||
| break; | |||||
| case "carData.numThr": | |||||
| this.setData({ | |||||
| numThr: e.target.dataset.msg, | |||||
| chooseClass: e.target.dataset.msg, | |||||
| chooseTop: 'carData.numFor' | |||||
| }); | |||||
| break; | |||||
| case "carData.numFor": | |||||
| this.setData({ | |||||
| numFor: e.target.dataset.msg, | |||||
| chooseClass: e.target.dataset.msg, | |||||
| chooseTop: 'carData.numFive' | |||||
| }); | |||||
| break; | |||||
| case "carData.numFive": | |||||
| this.setData({ | |||||
| numFive: e.target.dataset.msg, | |||||
| chooseClass: e.target.dataset.msg, | |||||
| chooseTop: 'carData.numSix' | |||||
| }); | |||||
| break; | |||||
| case "carData.numSix": | |||||
| this.setData({ | |||||
| numSix: e.target.dataset.msg, | |||||
| chooseClass: e.target.dataset.msg | |||||
| }); | |||||
| break; | |||||
| case "carData.numSource": | |||||
| this.setData({ | |||||
| numSource: e.target.dataset.msg, | |||||
| chooseClass: e.target.dataset.msg | |||||
| }); | |||||
| break; | |||||
| }; | |||||
| switch (this.data.chooseTop) { | |||||
| case "carData.numFir": | |||||
| this.setData({ | |||||
| choose: 'carData.numFir', | |||||
| titleShow: false, | |||||
| englishShow: true, | |||||
| numShow: false, | |||||
| specShow: false | |||||
| }) | |||||
| break; | |||||
| case "carData.numSco": | |||||
| this.setData({ | |||||
| choose: 'carData.numSco', | |||||
| titleShow: false, | |||||
| englishShow: false, | |||||
| numShow: true, | |||||
| specShow: false | |||||
| }) | |||||
| break; | |||||
| case "carData.numThr": | |||||
| this.setData({ | |||||
| choose: 'carData.numThr', | |||||
| titleShow: false, | |||||
| englishShow: false, | |||||
| numShow: true, | |||||
| specShow: false | |||||
| }) | |||||
| break; | |||||
| case "carData.numFor": | |||||
| this.setData({ | |||||
| choose: 'carData.numFor', | |||||
| titleShow: false, | |||||
| englishShow: false, | |||||
| numShow: true, | |||||
| specShow: false | |||||
| }) | |||||
| break; | |||||
| case "carData.numFive": | |||||
| this.setData({ | |||||
| choose: 'carData.numFive', | |||||
| titleShow: false, | |||||
| englishShow: false, | |||||
| numShow: true, | |||||
| specShow: false | |||||
| }) | |||||
| break; | |||||
| case "carData.numSix": | |||||
| if (this.data.title == '粤') { | |||||
| this.setData({ | |||||
| choose: 'carData.numSix', | |||||
| titleShow: false, | |||||
| englishShow: false, | |||||
| numShow: false, | |||||
| specShow: true | |||||
| }) | |||||
| } else { | |||||
| this.setData({ | |||||
| choose: 'carData.numSix', | |||||
| titleShow: false, | |||||
| englishShow: false, | |||||
| numShow: true, | |||||
| specShow: false | |||||
| }) | |||||
| } | |||||
| break; | |||||
| } | |||||
| } else if (e.target.dataset.msg == 'DEL') { | |||||
| switch (this.data.choose) { | |||||
| case "carData.title": | |||||
| this.setData({ | |||||
| title: '', | |||||
| chooseTop: 'carData.title', | |||||
| choose: 'carData.title', | |||||
| titleShow: true, | |||||
| englishShow: false, | |||||
| numShow: false, | |||||
| specShow: false | |||||
| }); | |||||
| break; | |||||
| case "carData.numFir": | |||||
| this.setData({ | |||||
| numFir: '', | |||||
| chooseTop: 'carData.title', | |||||
| choose: 'carData.title', | |||||
| titleShow: true, | |||||
| englishShow: false, | |||||
| numShow: false, | |||||
| specShow: false | |||||
| }); | |||||
| break; | |||||
| case "carData.numSco": | |||||
| this.setData({ | |||||
| numSco: '', | |||||
| // chooseClass: e.target.dataset.msg, | |||||
| chooseTop: 'carData.numFir', | |||||
| choose: 'carData.numFir', | |||||
| titleShow: false, | |||||
| englishShow: true, | |||||
| numShow: false, | |||||
| specShow: false | |||||
| }); | |||||
| break; | |||||
| case "carData.numThr": | |||||
| this.setData({ | |||||
| numThr: '', | |||||
| // chooseClass: e.target.dataset.msg, | |||||
| chooseTop: 'carData.numSco', | |||||
| choose: 'carData.numSco', | |||||
| titleShow: false, | |||||
| englishShow: false, | |||||
| numShow: true, | |||||
| specShow: false | |||||
| }); | |||||
| break; | |||||
| case "carData.numFor": | |||||
| this.setData({ | |||||
| numFor: '', | |||||
| // chooseClass: e.target.dataset.msg, | |||||
| chooseTop: 'carData.numThr', | |||||
| choose: 'carData.numThr', | |||||
| titleShow: false, | |||||
| englishShow: false, | |||||
| numShow: true, | |||||
| specShow: false | |||||
| }); | |||||
| break; | |||||
| case "carData.numFive": | |||||
| this.setData({ | |||||
| numFive: '', | |||||
| // chooseClass: e.target.dataset.msg, | |||||
| chooseTop: 'carData.numFor', | |||||
| choose: 'carData.numFor', | |||||
| titleShow: false, | |||||
| englishShow: false, | |||||
| numShow: true, | |||||
| specShow: false | |||||
| }); | |||||
| break; | |||||
| case "carData.numSix": | |||||
| this.setData({ | |||||
| numSix: '', | |||||
| // chooseClass: e.target.dataset.msg | |||||
| chooseTop: 'carData.numFive', | |||||
| choose: 'carData.numFive', | |||||
| titleShow: false, | |||||
| englishShow: false, | |||||
| numShow: true, | |||||
| specShow: false | |||||
| }); | |||||
| break; | |||||
| case "carData.numSource": | |||||
| this.setData({ | |||||
| numSource: '' | |||||
| }); | |||||
| break; | |||||
| } | |||||
| } | |||||
| this.buttonStatus(); | |||||
| }, | |||||
| submit: function () { | |||||
| wx.navigateTo({ | |||||
| url: '/pages/passCar/passCar', | |||||
| }) | |||||
| }, | |||||
| buttonStatus: function () { | |||||
| if (this.data.title != "" && this.data.numFir != "" && this.data.numSco != "" && this.data.numThr != "" && this.data.numFor != "" && this.data.numFive != "" && this.data.numSix != "") { | |||||
| this.setData({ | |||||
| buttonStatus: true | |||||
| }); | |||||
| } else { | |||||
| this.setData({ | |||||
| buttonStatus: false | |||||
| }); | |||||
| } | |||||
| } | } | ||||
| }) | }) | ||||