|
@@ -15,6 +15,7 @@ define(['base', '$', 'native', 'api', 'order', 'config', 'address'], function (b
|
|
|
this.mobile = '';
|
|
|
this.balance = 0;
|
|
|
this.info = {};
|
|
|
+ this.userData = null;
|
|
|
this.orders = {
|
|
|
1: {
|
|
|
data: [],
|
|
@@ -115,7 +116,9 @@ define(['base', '$', 'native', 'api', 'order', 'config', 'address'], function (b
|
|
|
//获取用户信息
|
|
|
User.prototype.getUserInfo = function (callback) {
|
|
|
var that = this;
|
|
|
+ console.log(that)
|
|
|
native.getUserInfo(function (res) {
|
|
|
+ this.userData = res;
|
|
|
loginWithData.call(that, res);//loginWithData-登录数据
|
|
|
if (typeof(callback) == 'function') {//判断callback是否为函数.
|
|
|
callback();//调用函数
|
|
@@ -185,8 +188,10 @@ define(['base', '$', 'native', 'api', 'order', 'config', 'address'], function (b
|
|
|
var that = this;
|
|
|
console.log(that);
|
|
|
this.getUserInfo(function (res) {//在获取用户信息
|
|
|
+ this.userData = res
|
|
|
if (that.id == '') {
|
|
|
native.login(function (resA) {//本地中读取是否存在登陆数据
|
|
|
+
|
|
|
loginWithData.call(that, resA);//调用登录数据
|
|
|
|
|
|
if (typeof(callback) == 'function') {//判断callback是否为函数,true让其回调
|