Commit 8bd660be1e6b82cb2281230306db02162e87b885

Authored by 后端研发-苏泰源
1 parent e9c130f7

积分购

Showing 1 changed file with 92 additions and 54 deletions
packageA/pages/jfbuy/jfbuy.js
... ... @@ -187,64 +187,102 @@ Page({
187 187 /**
188 188 * 用户点击右上角分享
189 189 */
190   - // onShareAppMessage: function () {
191   - // var th = this;
192   - // //礼包的转发
193   - // if(th.data.currentIndex==3){
194   - // var lbid=th.data.hui_active.lbId;
195   - // var url="pages/giftpack/giftpacklist/giftpacklist?lbId="+lbid+"&isBuy=1";
196   - // if(getApp().globalData.user_id){
197   - // url+="&first_leader="+getApp().globalData.user_id;
198   - // }
199   - // var img=this.data.share_img;
200   - // var title=th.data.hui_active.giftTitle;
  190 + onShareAppMessage: function () {
  191 +
  192 + var store_name = getApp().globalData.config ? getApp().globalData.config.store_name:'';
  193 +
  194 + var pagePath = this.route; //当前页面url
  195 +
  196 + if(!store_name) store_name = getApp().globalData.setting.appName;
  197 +
  198 + if(pagePath.indexOf('/') != 0) {
  199 + pagePath = '/' + pagePath;
  200 + }
  201 +
  202 + if(getApp().globalData.user_id){
  203 + if(pagePath.indexOf('?')>0){
  204 + pagePath += '&first_leader=' + getApp().globalData.user_id;
  205 + }else{
  206 + pagePath += '?first_leader=' + getApp().globalData.user_id;
  207 + }
  208 + }
  209 + return {
  210 + title: store_name + '-积分购',
  211 + path: pagePath,
  212 + }
  213 + // var th = this;
  214 + // //礼包的转发
  215 + // if(th.data.currentIndex==3){
  216 + // var lbid=th.data.hui_active.lbId;
  217 + // var url="pages/giftpack/giftpacklist/giftpacklist?lbId="+lbid+"&isBuy=1";
  218 + // if(getApp().globalData.user_id){
  219 + // url+="&first_leader="+getApp().globalData.user_id;
  220 + // }
  221 + // var img=this.data.share_img;
  222 + // var title=th.data.hui_active.giftTitle;
201 223  
202   - // var ob={
203   - // title:title,
204   - // path:url,
205   - // imageUrl: img,
206   - // };
207   - // th.setData({share_hidden:1});
208   - // return ob;
  224 + // var ob={
  225 + // title:title,
  226 + // path:url,
  227 + // imageUrl: img,
  228 + // };
  229 + // th.setData({share_hidden:1});
  230 + // return ob;
209 231  
210   - // }else{
211   - // //---秒杀,拼团,促销---
212   - // var item=this.data.share_good;
213   - // if(item){
214   - // var price = item.shop_price;
215   - // var title= item.goods_name;
216   - // var img=this.data.url+item.original_img;
217   - // var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid;
218   - // if(getApp().globalData.user_id){
219   - // url+="&first_leader="+getApp().globalData.user_id;
220   - // }
221   - // var ob={
222   - // title: price + "元 " +title,
223   - // path:url,
224   - // imageUrl: img,
225   - // };
226   - // th.setData({share_hidden:1,share_good:null});
227   - // return ob;
228   - // }else{
229   - // var url="/pages/index/index/index";
230   - // if(getApp().globalData.user_id){
231   - // url+="?first_leader="+getApp().globalData.user_id;
232   - // }
233   - // var hui_active=this.data.hui_active;
234   - // var title=hui_active.name;
235   - // if(!title) title=hui_active.main_goods_name;
236   - // if(!title) title=hui_active.giftTitle;
  232 + // }else{
  233 + // //---秒杀,拼团,促销---
  234 + // var item=this.data.share_good;
  235 + // if(item){
  236 + // var price = item.shop_price;
  237 + // var title= item.goods_name;
  238 + // var img=this.data.url+item.original_img;
  239 + // var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid;
  240 + // if(getApp().globalData.user_id){
  241 + // url+="&first_leader="+getApp().globalData.user_id;
  242 + // }
  243 + // var ob={
  244 + // title: price + "元 " +title,
  245 + // path:url,
  246 + // imageUrl: img,
  247 + // };
  248 + // th.setData({share_hidden:1,share_good:null});
  249 + // return ob;
  250 + // }else{
  251 + // var url="/pages/index/index/index";
  252 + // if(getApp().globalData.user_id){
  253 + // url+="?first_leader="+getApp().globalData.user_id;
  254 + // }
  255 + // var hui_active=this.data.hui_active;
  256 + // var title=hui_active.name;
  257 + // if(!title) title=hui_active.main_goods_name;
  258 + // if(!title) title=hui_active.giftTitle;
237 259  
238   - // var ob={
239   - // title: title,
240   - // path:url,
241   - // };
242   - // th.setData({share_hidden:1,share_good:null});
243   - // return ob;
244   - // }
245   - // }
  260 + // var ob={
  261 + // title: title,
  262 + // path:url,
  263 + // };
  264 + // th.setData({share_hidden:1,share_good:null});
  265 + // return ob;
  266 + // }
  267 + // }
246 268  
247   - // },
  269 + },
  270 +
  271 +
  272 + onShareTimeline() {
  273 + var store_name = getApp().globalData.config ? getApp().globalData.config.store_name:'';
  274 +
  275 + var pagePath = this.route; //当前页面url
  276 +
  277 + if(!store_name) store_name = getApp().globalData.setting.appName;
  278 + if(pagePath.indexOf('/') != 0) {
  279 + pagePath = '/' + pagePath;
  280 + }
  281 + return {
  282 + title: store_name + '-积分购',
  283 + path: pagePath,
  284 + }
  285 + },
248 286  
249 287  
250 288 //-- 点击tab --
... ...