stanley-king 4 år sedan
förälder
incheckning
f7d3365a76

+ 3 - 1
app.js

@@ -31,7 +31,9 @@ App({
         record: null,
         card_type: '',
         authPages: null,
-        mWxAuthor:null
+        mWxAuthor:null,
+        member_id:0,
+        relay_id:0
     },
 
     setFromSource(fromSource) {

+ 0 - 2
config.js

@@ -1,5 +1,3 @@
-// let api = "https://passport.lrlz.com/mobile/index.php";
-// let api = "http://www.xyzshops.cn/mobile/index.php";
 let api = "http://192.168.1.200/mobile/index.php";
 // let api = "https://www.xyzshops.cn/mobile/index.php";
 

+ 0 - 1
pages/auth/auth.js

@@ -1,6 +1,5 @@
 // pages/auth.js
 Page({
-
   /**
    * 页面的初始数据
    */

+ 1 - 0
pages/components/auth/auth.js

@@ -65,6 +65,7 @@ Component({
       getReq(app,params, function (res) {
         if (res.code == 200) {
           let datas = res.datas;
+          app.member_id = datas.member_id 
           if (datas.hasmobile == false) {
             self.setData({showAuthName:false,showAuthPhone:true})
           }

+ 0 - 1
pages/handOutBonus/handOutBonus.js

@@ -331,6 +331,5 @@ Page({
         path: `/${path}`
       }
     }
-
   }
 })

+ 20 - 12
pages/index/index.js

@@ -27,19 +27,24 @@ Page({
     if (!this.data.firstLoad) {
       app.setFromSource(this.data.fromSource)
     }
-    if (app.globalData.userInfo) {
-      setTimeout(() => {
-        bonusUp((tipsFlag, tipsDatas) => {
-          this.setData({
-            tipsFlag,
-            tipsDatas
-          })
-        })
-      }, 0);
-    }
+
+    // if (app.globalData.userInfo) {
+    //   setTimeout(() => {
+    //     bonusUp((tipsFlag, tipsDatas) => {
+    //       this.setData({
+    //         tipsFlag,
+    //         tipsDatas
+    //       })
+    //     })
+    //   }, 0);
+    // }
   },
 
-  onLoad: function () {
+  onLoad: function (options) {
+    console.log('index onLoad:',options)
+    if (!options.relay_id) {
+      app.globalData.relay_id = options.relay_id
+    }
     // this.req_tabs();
     this.getDatas(0)
   },
@@ -138,9 +143,12 @@ Page({
     })
   },
   onShareAppMessage: function () {
+    console.log('index onShareAppMessage')
+    let relay_id = 100
+    
     return {
       title: `${app.globalData.channel}小程序`,
-      path: "/pages/index/index"
+      path: "/pages/index/index?relay_id=${relay_id}"
     }
   },
   onReachBottom: function () {

+ 11 - 11
pages/person/person.js

@@ -148,17 +148,17 @@ Page({
       }
     })
     this.getBonusTotal()
-    setTimeout(() => {
-      bonusUp((tipsFlag, tipsDatas) => {
-        if (tipsFlag) {
-          this.getBonusTotal()
-        }
-        this.setData({
-          tipsFlag,
-          tipsDatas
-        })
-      })
-    }, 0);
+    // setTimeout(() => {
+    //   bonusUp((tipsFlag, tipsDatas) => {
+    //     if (tipsFlag) {
+    //       this.getBonusTotal()
+    //     }
+    //     this.setData({
+    //       tipsFlag,
+    //       tipsDatas
+    //     })
+    //   })
+    // }, 0);
   },
   getBonusTotal() {
     let self = this

+ 0 - 1
pages/postageManage/postageManage.js

@@ -18,7 +18,6 @@ Page({
    */
   onLoad: function (options) {
     const { card_type } = options
-    // wx.setNavigationBarTitle({ title })
     app.setCardType(card_type)
     console.log(card_type)
     this.setData({ card_type })

+ 10 - 10
pages/shopCart/shopCart.js

@@ -47,16 +47,16 @@ Page({
     });
     this.req_datas();
     this.getFavorite()
-    if (app.globalData.userInfo) {
-      setTimeout(() => {
-        bonusUp((tipsFlag, tipsDatas) => {
-          this.setData({
-            tipsFlag,
-            tipsDatas
-          })
-        })
-      }, 0);
-    }
+    // if (app.globalData.userInfo) {
+    //   setTimeout(() => {
+    //     bonusUp((tipsFlag, tipsDatas) => {
+    //       this.setData({
+    //         tipsFlag,
+    //         tipsDatas
+    //       })
+    //     })
+    //   }, 0);
+    // }
   },
   getFavorite() {
     let self = this

+ 2 - 1
pages/special/special.js

@@ -103,9 +103,10 @@ Page({
   onShareAppMessage: function () {
     let special_id = this.data.special_id;
     let title = this.data.title;
+    let relay_id = app.globalData.member_id;
     return {
       title: `${app.globalData.channel}为您推荐:${title}`,
-      path: `/pages/special/special?title=${title}&special_id=${special_id}`
+      path: `/pages/special/special?title=${title}&special_id=${special_id}&relay_id=${relay_id}`
     }
   }
 })

+ 3 - 1
utils/WxAuthor.js

@@ -72,8 +72,10 @@ export default class WxAuthor {
     let params = {
       user_info: userInfo,
       act: "login",
-      op: "wxauthen"
+      op: "wxauthen",
+      relay_id: 100
     }
+
     getReq(this.target,params, res => {
       if (res.code == 200) {
         let url = this.getUrl()