Showing
1 changed file
with
15 additions
and
4 deletions
| @@ -26,16 +26,27 @@ Page({ | @@ -26,16 +26,27 @@ Page({ | ||
| 26 | * 生命周期函数--监听页面加载 | 26 | * 生命周期函数--监听页面加载 |
| 27 | */ | 27 | */ |
| 28 | onLoad(options) { | 28 | onLoad(options) { |
| 29 | + console.log('options',options); | ||
| 30 | + var obj = {}; | ||
| 31 | + if(options.scene){ | ||
| 32 | + let scene=decodeURIComponent(options.scene); | ||
| 33 | + console.log('scene',scene); | ||
| 34 | + for (var i = 0; i < scene.split('&').length;i++){ | ||
| 35 | + var arr = scene.split('&')[i].split('='); | ||
| 36 | + obj[arr[0]] = arr[1]; | ||
| 37 | + } | ||
| 38 | + } | ||
| 39 | + console.log('obj',{...obj}); | ||
| 29 | this.setData({ | 40 | this.setData({ |
| 30 | opt:{ | 41 | opt:{ |
| 31 | - id:options.id, | ||
| 32 | - sid:options.sid, | 42 | + id:options.id || obj.id, |
| 43 | + sid:options.sid || obj.sid, | ||
| 33 | oid:options.oid, | 44 | oid:options.oid, |
| 34 | - types:options.types,//1是邀请函过来的(邀请函的券或者点击意见反馈买券) 2是提前点餐 3是商家APP分享的或者短信的链接 | 45 | + types:options.types || obj.types,//1是邀请函过来的(邀请函的券或者点击意见反馈买券) 2是提前点餐 3是商家APP分享的或者短信的链接 |
| 35 | rid:options.rid?options.rid:'', | 46 | rid:options.rid?options.rid:'', |
| 36 | } | 47 | } |
| 37 | }) | 48 | }) |
| 38 | - console.log('onLoad',{...this.data.opt}); | 49 | + console.log('opt',{...this.data.opt}); |
| 39 | }, | 50 | }, |
| 40 | 51 | ||
| 41 | /** | 52 | /** |
-
Please register or login to post a comment