12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- // pages/register/register.ts
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- region: ['北京市', '北京市', '海淀区'],
- schoolArray: ['中国', '美国', '巴西', '日本'],
- schoolIndex: 0,
- classArray: ['一年级一班', '一年级2班', '一年级3班', '一年级4班'],
- classIndex: 0,
- isShowPassWord: true
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad() {
- },
- bindRegionChange: function (event: any) {
- console.log('picker发送选择改变,携带值为', event.detail.value)
- this.setData({
- region: event.detail.value
- })
- },
- bindSchoolPicker: function (event: any) {
- let newArray;
- switch (Number(event.detail.value)) {
- case 0:
- newArray = ["一", "二", "三"];
- this.setData({
- classArray: newArray,
- classIndex: 0
- })
- break;
- case 1:
- newArray = ["4", "5", "6"];
- this.setData({
- classArray: newArray,
- classIndex: 0
- })
- break;
- case 2:
- newArray = ["as", "ad", "af"];
- this.setData({
- classArray: newArray,
- classIndex: 0
- })
- break;
- case 3:
- newArray = ["b1", "b2", "b3"];
- this.setData({
- classArray: newArray,
- classIndex: 0
- })
- break;
- }
- this.setData({
- schoolIndex: event.detail.value
- })
- },
- bindClssPicker: function (event: any) {
- this.setData({
- classIndex: event.detail.value
- })
- },
- showPwdTab: function () {
- if (this.data.isShowPassWord) {
- this.setData({
- isShowPassWord: false
- })
- } else {
- this.setData({
- isShowPassWord: true
- })
- }
- },
- exitPage: function () {
- wx.navigateBack()
- }
- })
|