Commit 91b7bfc349ae909af2f26f53afe456dd2111c44a

Authored by yvan.ni
1 parent cd12dd96

组合购的分享图的bug优化

packageB/pages/zuhegou/index/index.js
@@ -125,7 +125,29 @@ Page({ @@ -125,7 +125,29 @@ Page({
125 */ 125 */
126 onLoad: function (options) { 126 onLoad: function (options) {
127 self = this; 127 self = this;
128 - this.data.id = options.id; 128 + var the_id = options.id;
  129 + var first_leader='';
  130 + //--如果tg_id是空的话,分享回来--
  131 + if (the_id == undefined || the_id == null || the_id == "") {
  132 + var gid_str = decodeURIComponent(options.scene);
  133 + gid_str=gid_str.split("_");
  134 + the_id=gid_str[0];
  135 + if(gid_str.length>1){
  136 + first_leader=gid_str[1];
  137 + }
  138 + }
  139 +
  140 + this.data.id=the_id;
  141 + if(first_leader){
  142 + getApp().globalData.first_leader=first_leader;
  143 + //调用接口判断是不是会员
  144 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{
  145 + if(res.data.code==0){
  146 + getApp().globalData.guide_id=res.data.data.id;
  147 + }
  148 + })
  149 + }
  150 +
129 //如果有会员的时候 151 //如果有会员的时候
130 var userInfo = getApp().globalData.userInfo; 152 var userInfo = getApp().globalData.userInfo;
131 if(!userInfo){ 153 if(!userInfo){
@@ -204,7 +226,7 @@ Page({ @@ -204,7 +226,7 @@ Page({
204 scene += "_" + user_id; 226 scene += "_" + user_id;
205 ///二微码 227 ///二微码
206 var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + 228 var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
207 - os.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo"; 229 + os.stoid + "?sceneValue=" + scene + "&pageValue=packageB/pages/zuhegou/index/index";
208 wx.getImageInfo({ 230 wx.getImageInfo({
209 src: path3, 231 src: path3,
210 success: function (res) { 232 success: function (res) {