diff --git a/api/request.js b/api/request.js index 9418270..736da5c 100644 --- a/api/request.js +++ b/api/request.js @@ -8,7 +8,7 @@ var request = function(config) { method: config.method, timeout: 5000, header: { - // token: uni.getStorageSync('token') + // token: uni.getStorageSync('token') }, success(res) { resolve(res.data) diff --git a/pages/index/index.vue b/pages/index/index.vue index 4dfb982..3b1f95b 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -2,24 +2,25 @@ - + - + + 姓名:{{yonghuwx.nickName}} 姓名:{{parentList.parentName}} - 昵称:{{parentList.parentName}} + 昵称:{{parentList.parentName}} + 昵称:{{parentList.parentName}} 昵称:{{yonghuwx.nickName}} - - + @@ -33,14 +34,14 @@ - + + 学生信息 - 姓名 @@ -76,8 +77,6 @@ {{item.classTeacher}} - - @@ -99,7 +98,7 @@ 提示 - + 您的手机号不符合,请更改信息 @@ -108,13 +107,13 @@ - + + @@ -122,12 +121,10 @@ - - - + --> @@ -166,7 +163,6 @@ key: 'user', success: function(res) { that.yonghuwx = res.data - console.log(that.yonghuwx); that.login = true that.stuinfos = true that.tip = false @@ -186,7 +182,6 @@ }, getPreOrderById() { getPreOrderById(this.logincode, this.phonecode).then(res => { - console.log((res)) if (res.code == 200) { if (res.data.flag == "EMPTY") { this.mask = true; @@ -206,7 +201,7 @@ this.tip = false this.top2 = true this.top = false - this.mask2 = false; + // this.mask2 = false; } } }) @@ -214,16 +209,13 @@ getPhoneNumberp(val) { this.phonecode = val.detail.code - console.log(val) let that = this; wx.login({ provider: 'weixin', success: function(loginRes) { - console.log(loginRes) that.logincode = loginRes.code - console.log(that.logincode) that.getPreOrderById(); - that.mask2 = false; + // that.mask2 = false; } }); }, @@ -233,7 +225,6 @@ desc: "获取用户信息", lang: "zh_CN", success(res) { - console.log(res) that.yonghuwx = res.userInfo uni.setStorage({ key: 'user', @@ -245,17 +236,23 @@ //失败则返回home页面 }, }); - }, getInfoByPhoneinfo() { + var that = this getInfoByPhone(this.phone).then(res => { if (res.code == 200) { - console.log(res) this.studentList = res.data.studentInfoList; this.classList = res.data.classInfoList; this.parentList = res.data; + that.login = true + that.stuinfos = true + that.tip = false + that.top2 = true + that.top = false // this.mask = true; + } else { + } }) } @@ -267,43 +264,19 @@ "FAMELE": "女", "MALE": "男", } - return sexEnum[str]; }, }, - onShow() {}, onLoad(options) { let that = this; - uni.getStorage({ - key: 'user', - success: function(res) { - that.yonghuwx = res.data - that.login = true - that.stuinfos = true - that.tip = false - that.top2 = true - that.top = false - // that.mask = true - }, - fail: function(err) { - console.log('1', (err)) - that.login = false - that.stuinfos = false - that.tip = true - that.top2 = false - that.top = true - } - }); uni.getStorage({ key: 'phone', success: function(res) { - console.log((res)) that.phone = res.data // that.mask = true that.getInfoByPhoneinfo(); }, fail: function(err) { - console.log('1', (err)) that.login = false that.stuinfos = false that.tip = true @@ -311,7 +284,14 @@ that.top = true } }); - + uni.getStorage({ + key: 'user', + success: function(res) { + that.yonghuwx = res.data + // that.mask = true + }, + fail: function(err) {} + }); @@ -319,7 +299,6 @@ // this.yonghuwx = JSON.parse(options.userinfo) - // console.log(this.yonghuwx) // uni.request({ // url: '/kindergarten/applet/appletLogin', //仅为示例,并非真实接口地址。 // method:'GET' @@ -328,7 +307,6 @@ // }, // success: (res) => { - // console.log(res.data); // this.text = 'request success'; // } // });