From 1552c5762e03867df23296b6f3874ccb6f189540 Mon Sep 17 00:00:00 2001 From: abson Date: Wed, 8 Dec 2021 11:13:27 +0800 Subject: [PATCH] 专项礼包分享优化 --- pages/giftpack/buygiftpack/giftpackbuy.js | 2 +- pages/giftpack/giftpacklist/giftpacklist.js | 2 +- pages/giftpack/mygiftpack/mygiftpack.js | 20 ++++++++++++++++++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/pages/giftpack/buygiftpack/giftpackbuy.js b/pages/giftpack/buygiftpack/giftpackbuy.js index 7949a2a..c814bea 100644 --- a/pages/giftpack/buygiftpack/giftpackbuy.js +++ b/pages/giftpack/buygiftpack/giftpackbuy.js @@ -38,7 +38,7 @@ Page({ }); //-- 获取分享人的ID -- - var first_leader = options.first_leader; + var first_leader = options.first_leader || getApp().globalData.first_leader; if (first_leader) { this.setData({ first_leader, diff --git a/pages/giftpack/giftpacklist/giftpacklist.js b/pages/giftpack/giftpacklist/giftpacklist.js index 997afb2..2eaa2b2 100644 --- a/pages/giftpack/giftpacklist/giftpacklist.js +++ b/pages/giftpack/giftpacklist/giftpacklist.js @@ -41,7 +41,7 @@ Page({ }) //-- 获取分享人的ID -- - var first_leader = options.first_leader; + var first_leader = options.first_leader || getApp().globalData.first_leader; if (first_leader) { this.setData({ first_leader, diff --git a/pages/giftpack/mygiftpack/mygiftpack.js b/pages/giftpack/mygiftpack/mygiftpack.js index 8f30334..06c9688 100644 --- a/pages/giftpack/mygiftpack/mygiftpack.js +++ b/pages/giftpack/mygiftpack/mygiftpack.js @@ -25,7 +25,8 @@ Page({ curpage: 1, //当前分页数 pageSize: 10, //页大小 total: 0, //总数量 - ad_data:null, + ad_data:null, + first_leader: e.globalData.first_leader || 0, // 推荐人ID }, onLoad: function(options) { @@ -35,7 +36,22 @@ Page({ getUserID: d.user_id, loadingType: 0, getDate: i.formatTime(new Date().getTime()) - }) + }); + //-- 获取分享人的ID -- + var first_leader = options.first_leader || getApp().globalData.first_leader; + if (first_leader) { + this.setData({ + first_leader, + }) + //-- user_id代过来免登录 -- + getApp().globalData.first_leader = first_leader; + //调用接口判断是不是会员 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => { + if (res.data.code == 0) { + getApp().globalData.guide_id = res.data.data.id; + } + }) + } getApp().request.promiseGet("/api/weshop/ad/page?pid=901&store_id=" + os.stoid, { data: { -- libgit2 0.21.4