y595705120 %!s(int64=3) %!d(string=hai) anos
pai
achega
6baaa9d98a
Modificáronse 3 ficheiros con 8 adicións e 11 borrados
  1. 2 1
      app.js
  2. 1 3
      pages/index/index.js
  3. 5 7
      pages/task/lyg/index.js

+ 2 - 1
app.js

@@ -64,7 +64,7 @@ App({
               this.globalData.userInfo = user
               console.log("login_ok_u", user)
               wx.setStorageSync("@yunyuanqu", user)
-              cb&&cb( user )
+              this.getMakerInfo(cb, true);
             }else{
               util.showMsg( data )
               cb&&cb( {} )
@@ -155,6 +155,7 @@ App({
   setMakerInfo( maker ){
     maker = Object.assign(this.globalData.maker, maker )
     this.globalData.maker = maker;
+    console.log( "setMakerInfo", maker)
   },
   identifyUser(){
     this.globalData.userInfo.identify=1

+ 1 - 3
pages/index/index.js

@@ -18,9 +18,7 @@ Page({
     })
   },
   onLoad: function ( ) {
-    app.checkLogin( ()=>{
-      this.loadData()
-    } )
+    this.loadData()
   },
   loadData :function( cb ){
     let that = this

+ 5 - 7
pages/task/lyg/index.js

@@ -19,16 +19,13 @@ Page({
    */
   onLoad: function ( opt) {
     let TabCur = app.globalData.taskTab||0;
-    console.log( "TabCur", TabCur)
     this.setData( {TabCur} )
-    app.checkLogin( ()=>{
-      this.getuserInfo( this.loadData)
-    } )
+    app.checkLogin(  )
   },
-  getuserInfo( cb ){
+  onShow( ){
     app.getMakerInfo( (userInfo)=>{
       this.setData({userInfo})
-        cb&&cb()
+      this.doOnShow()
     } )
   },
   tabSelect(e){
@@ -56,7 +53,7 @@ Page({
       wx.stopPullDownRefresh();
     })
   },
-  onShow(){
+  doOnShow(){
     let action = app.getAction()
     if( action && action.action=="addDeliverImg"){
       let list = this.data.list;
@@ -67,6 +64,7 @@ Page({
       })
       this.setData({list});
     }
+    this.loadData()
   },
   onReachBottom: function () {
     var that = this