Commit ab5f61ae12c4c607ec180e00aa734cac4b725e51
1 parent
2f4a0160
1.分享的地址优化生成
2.接口的替换
Showing
6 changed files
with
40 additions
and
8 deletions
packageA/pages/prom_list/prom_list.js
... | ... | @@ -641,9 +641,9 @@ Page({ |
641 | 641 | } |
642 | 642 | if(getApp().globalData.user_id){ |
643 | 643 | if(pagePath.indexOf("?")>0){ |
644 | - pagePath+="&first_leader="+getApp().globalData.user_id; | |
644 | + pagePath+="&goods_id="+this.data.gid+" &first_leader="+getApp().globalData.user_id; | |
645 | 645 | }else{ |
646 | - pagePath+="?first_leader="+getApp().globalData.user_id; | |
646 | + pagePath+="?goods_id="+this.data.gid+"&first_leader="+getApp().globalData.user_id; | |
647 | 647 | } |
648 | 648 | } |
649 | 649 | ... | ... |
pages/cart/cart2/cart2.js
... | ... | @@ -1431,7 +1431,7 @@ Page({ |
1431 | 1431 | goods.guide_id=gg.guide_id; |
1432 | 1432 | goods.guide_type=gg.guide_type; |
1433 | 1433 | //调用接口判断是不是会员 |
1434 | - await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+oo.stoid+"/"+gg.guide_id,{}).then(res=>{ | |
1434 | + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getid/"+oo.stoid+"/"+gg.guide_id,{}).then(res=>{ | |
1435 | 1435 | if(res.data.code==0){ |
1436 | 1436 | goods.guide_name=res.data.data.salesman; |
1437 | 1437 | goods.guide_sn=res.data.data.salesman_no; |
... | ... | @@ -1631,7 +1631,7 @@ Page({ |
1631 | 1631 | goods.guide_id=g_item.guide_id; |
1632 | 1632 | goods.guide_type=g_item.guide_type; |
1633 | 1633 | //调用接口判断是不是会员 |
1634 | - await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+oo.stoid+"/"+g_item.guide_id,{}).then(res=>{ | |
1634 | + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getid/"+oo.stoid+"/"+g_item.guide_id,{}).then(res=>{ | |
1635 | 1635 | if(res.data.code==0){ |
1636 | 1636 | goods.guide_name=res.data.data.salesman; |
1637 | 1637 | goods.guide_sn=res.data.data.salesman_no; | ... | ... |
pages/goods/goodsList/goodsList.js
... | ... | @@ -21,10 +21,13 @@ Page({ |
21 | 21 | is_new:0, |
22 | 22 | is_hot:0, |
23 | 23 | prom_goods_list:null, |
24 | + rq_data:null, | |
24 | 25 | }, |
25 | 26 | |
26 | 27 | onLoad: function(t) { |
27 | 28 | |
29 | + this.data.rq_data=t; | |
30 | + | |
28 | 31 | //接受有没有导购的参数 |
29 | 32 | var first_leader=t.first_leader; |
30 | 33 | if(first_leader){ |
... | ... | @@ -212,14 +215,20 @@ Page({ |
212 | 215 | if (pagePath.indexOf('/') != 0) { |
213 | 216 | pagePath = '/' + pagePath; |
214 | 217 | } |
215 | - if(getApp().globalData.user_id){ | |
216 | 218 | |
219 | + if(this.data.rq_data && JSON.stringify(this.data.rq_data) != "{}") { | |
220 | + var parm = ut.ob_to_parm(this.data.rq_data); | |
221 | + pagePath += "?" + parm; | |
222 | + } | |
223 | + | |
224 | + if(getApp().globalData.user_id){ | |
217 | 225 | if(pagePath.indexOf("?")>0){ |
218 | 226 | pagePath+="&first_leader="+getApp().globalData.user_id; |
219 | 227 | }else{ |
220 | 228 | pagePath+="?first_leader="+getApp().globalData.user_id; |
221 | 229 | } |
222 | 230 | } |
231 | + console.log("11-11"+pagePath); | |
223 | 232 | return { |
224 | 233 | title: "商品列表", |
225 | 234 | path:pagePath, | ... | ... |
pages/goods/search/search.js
... | ... | @@ -21,8 +21,11 @@ Page({ |
21 | 21 | |
22 | 22 | tabname: "goods_id", //排序的字段 |
23 | 23 | adname: "desc", //升降的字段 |
24 | + rq_data:null, | |
24 | 25 | }, |
25 | 26 | onLoad: function(t) { |
27 | + this.data.rq_data=t; | |
28 | + | |
26 | 29 | //接受有没有导购的参数 |
27 | 30 | var first_leader=t.first_leader; |
28 | 31 | if(first_leader){ |
... | ... | @@ -184,6 +187,7 @@ Page({ |
184 | 187 | //-----点击搜索按钮---- |
185 | 188 | search: function(t) { |
186 | 189 | if ("string" != typeof t || "" == t) return a.showWarning("请输入搜索关键词"); |
190 | + this.data.key_str=t; | |
187 | 191 | this.resetData(), this.requestSearch(this.data.baseUrl + "&key_str=" + encodeURIComponent(t)); |
188 | 192 | }, |
189 | 193 | |
... | ... | @@ -194,6 +198,11 @@ Page({ |
194 | 198 | if (pagePath.indexOf('/') != 0) { |
195 | 199 | pagePath = '/' + pagePath; |
196 | 200 | } |
201 | + | |
202 | + if(this.data.key_str) { | |
203 | + pagePath += "?s_key=" + this.data.key_str; | |
204 | + } | |
205 | + | |
197 | 206 | if(getApp().globalData.user_id){ |
198 | 207 | |
199 | 208 | if(pagePath.indexOf("?")>0){ |
... | ... | @@ -202,6 +211,8 @@ Page({ |
202 | 211 | pagePath+="?first_leader="+getApp().globalData.user_id; |
203 | 212 | } |
204 | 213 | } |
214 | + | |
215 | + console.log("11-11"+pagePath); | |
205 | 216 | return { |
206 | 217 | title: "商品搜索", |
207 | 218 | path:pagePath, | ... | ... |
pages/team/team_success/team_success.js
... | ... | @@ -677,10 +677,11 @@ Page({ |
677 | 677 | |
678 | 678 | //------ 分享配置 -------- |
679 | 679 | onShareAppMessage: function (e) { |
680 | - var scene=th.data.teamgroup.id; | |
680 | + var th=this; | |
681 | + var scene=this.data.teamgroup.id; | |
681 | 682 | var url="/pages/team/team_show/team_show?tg_id="+scene; |
682 | 683 | //--分享图片-- |
683 | - img=th.data.iurl+th.data.teamlist.share_imgurl; | |
684 | + var img=th.data.iurl+th.data.teamlist.share_imgurl; | |
684 | 685 | //--把会员分享出去-- |
685 | 686 | if(getApp().globalData.user_id){ |
686 | 687 | if(url.indexOf("?")>0) |
... | ... | @@ -688,6 +689,7 @@ Page({ |
688 | 689 | else |
689 | 690 | url+="?first_leader="+getApp().globalData.user_id; |
690 | 691 | } |
692 | + console.log(url); | |
691 | 693 | |
692 | 694 | return { |
693 | 695 | path:url, | ... | ... |
utils/util.js
... | ... | @@ -401,6 +401,15 @@ function base64_encode (str) { // 编码,配合encodeURIComponent使用 |
401 | 401 | return strin |
402 | 402 | } |
403 | 403 | |
404 | +function ob_to_parm(ob){ | |
405 | + var parm=""; | |
406 | + for( var key in ob){ | |
407 | + parm+="&"+key+"="+ob[key]; | |
408 | + } | |
409 | + parm = parm.substr(1); | |
410 | + return parm; | |
411 | +} | |
412 | + | |
404 | 413 | module.exports = { |
405 | 414 | formatTime: function(e, r) { |
406 | 415 | var t = e ? new Date(1e3 * e) : new Date(), n = t.getFullYear(), o = t.getMonth() + 1, a = t.getDate(), u = t.getHours(), i = t.getMinutes(), f = t.getSeconds(), s = function(e) { |
... | ... | @@ -505,5 +514,6 @@ module.exports = { |
505 | 514 | draw_circle:draw_circle,//绘制圆, |
506 | 515 | mergeArray:mergeArray, //数组合并 |
507 | 516 | isContained:isContained, //是否包含 |
508 | - base64_encode:base64_encode //64位加密 | |
517 | + base64_encode:base64_encode, //64位加密 | |
518 | + ob_to_parm:ob_to_parm //对象变成参数 | |
509 | 519 | }; | ... | ... |