Commit 1552c5762e03867df23296b6f3874ccb6f189540
1 parent
72b95789
专项礼包分享优化
Showing
3 changed files
with
20 additions
and
4 deletions
pages/giftpack/buygiftpack/giftpackbuy.js
pages/giftpack/giftpacklist/giftpacklist.js
pages/giftpack/mygiftpack/mygiftpack.js
| ... | ... | @@ -25,7 +25,8 @@ Page({ |
| 25 | 25 | curpage: 1, //当前分页数 |
| 26 | 26 | pageSize: 10, //页大小 |
| 27 | 27 | total: 0, //总数量 |
| 28 | - ad_data:null, | |
| 28 | + ad_data:null, | |
| 29 | + first_leader: e.globalData.first_leader || 0, // 推荐人ID | |
| 29 | 30 | }, |
| 30 | 31 | |
| 31 | 32 | onLoad: function(options) { |
| ... | ... | @@ -35,7 +36,22 @@ Page({ |
| 35 | 36 | getUserID: d.user_id, |
| 36 | 37 | loadingType: 0, |
| 37 | 38 | getDate: i.formatTime(new Date().getTime()) |
| 38 | - }) | |
| 39 | + }); | |
| 40 | + //-- 获取分享人的ID -- | |
| 41 | + var first_leader = options.first_leader || getApp().globalData.first_leader; | |
| 42 | + if (first_leader) { | |
| 43 | + this.setData({ | |
| 44 | + first_leader, | |
| 45 | + }) | |
| 46 | + //-- user_id代过来免登录 -- | |
| 47 | + getApp().globalData.first_leader = first_leader; | |
| 48 | + //调用接口判断是不是会员 | |
| 49 | + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => { | |
| 50 | + if (res.data.code == 0) { | |
| 51 | + getApp().globalData.guide_id = res.data.data.id; | |
| 52 | + } | |
| 53 | + }) | |
| 54 | + } | |
| 39 | 55 | |
| 40 | 56 | getApp().request.promiseGet("/api/weshop/ad/page?pid=901&store_id=" + os.stoid, { |
| 41 | 57 | data: { | ... | ... |