From 66bdd2a78217c5b94b59c7561723555bd2cd5ee7 Mon Sep 17 00:00:00 2001 From: lfs3 Date: Mon, 16 Jul 2018 16:08:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=94=A8=E6=88=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 3 +- pages/mcenter/mcenter.js | 67 ++++++++++++++++++++++++++++++++++++++ pages/mcenter/mcenter.wxml | 10 +++--- 3 files changed, 74 insertions(+), 6 deletions(-) diff --git a/app.js b/app.js index cbc6508..9bc65ac 100644 --- a/app.js +++ b/app.js @@ -1,7 +1,8 @@ //app.js App({ gw: { - hostUrl: 'https://www.1hjz.cn', + // hostUrl: 'https://www.1hjz.cn', + hostUrl: 'https://test.1hjz.cn/', mapUrl:'https://api.map.baidu.com', systemInfo : null,//系统信息 }, diff --git a/pages/mcenter/mcenter.js b/pages/mcenter/mcenter.js index 36600a7..09d3864 100644 --- a/pages/mcenter/mcenter.js +++ b/pages/mcenter/mcenter.js @@ -45,6 +45,72 @@ Page({ }, onLoad: function () { + // this.setData({ + // sessionId: wx.getStorageSync('sessionId') + // }) + // let that = this; + // wx.request({ + // url: app.gw.hostUrl + '/mall/wxa/user/baseinfo', + // data: {}, + // header: { + // "Content-Type": "application/json", + // 'sessionId': wx.getStorageSync('sessionId') + // }, + // method: 'GET', + // dataType: 'json', + // responseType: 'text', + // success: function (res) { + // var data = res.data; + // var status = data.code; + // if (status != 0) { + // wx.showToast({ + // title: data.msg, + // icon: 'none', + // duration: 3000 + // }); + // return; + // } + // that.setData({ + // items2: res.data.response + // }) + // }, + // fail: function (res) { + // wx.showToast({ + // title: '网络异常!err:authlogin', + // icon: 'none', + // duration: 2000 + // }); + // }, + // complete: function (res) { }, + // }) + // if (app.globalData.userInfo) { + // this.setData({ + // userInfo: app.globalData.userInfo, + // hasUserInfo: true + // }) + // } else if (this.data.canIUse) { + // // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 + // // 所以此处加入 callback 以防止这种情况 + // app.userInfoReadyCallback = res => { + // this.setData({ + // userInfo: res.userInfo, + // hasUserInfo: true + // }) + // } + // } else { + // // 在没有 open-type=getUserInfo 版本的兼容处理 + // wx.getUserInfo({ + // success: res => { + // app.globalData.userInfo = res.userInfo + // this.setData({ + // userInfo: res.userInfo, + // hasUserInfo: true + // }) + // } + // }) + // } + }, + onShow: function(){ this.setData({ sessionId: wx.getStorageSync('sessionId') }) @@ -118,3 +184,4 @@ Page({ }) } }) + diff --git a/pages/mcenter/mcenter.wxml b/pages/mcenter/mcenter.wxml index 7f09681..ab23c52 100644 --- a/pages/mcenter/mcenter.wxml +++ b/pages/mcenter/mcenter.wxml @@ -1,5 +1,5 @@ - + @@ -7,19 +7,19 @@ - 绑定手机:{{items2.mobile}} + 绑定手机:{{items2.mobile}} - + 登录一号家政,实现高端保洁 - + {{item.title}} - + \ No newline at end of file