|
|
|
@ -16,47 +16,48 @@ Page({ |
|
|
|
* 生命周期函数--监听页面加载 |
|
|
|
*/ |
|
|
|
onLoad: function (options) { |
|
|
|
console.log('options',decodeURIComponent(options.weburl)) |
|
|
|
console.log('options',decodeURIComponent(options.weburl)) |
|
|
|
options.weburl = decodeURIComponent(options.weburl) |
|
|
|
if(options.weburl.indexOf('m.cloud.sz-trip.com')!=-1){ |
|
|
|
userApi.user_post("user/getMyInfo").then(res=>{ |
|
|
|
let weburl = options.weburl |
|
|
|
if(weburl.indexOf('?')!=-1){ |
|
|
|
weburl += '&token='+res.data.token; |
|
|
|
} |
|
|
|
else { |
|
|
|
weburl += '?token='+res.data.token |
|
|
|
} |
|
|
|
this.setData({ |
|
|
|
info:res.data, |
|
|
|
webUrl:weburl |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
else if(options.weburl.indexOf('m.jszhwlpt.com')!=-1 || options.weburl.indexOf('wechat.b2c.zj-trip.net')!=-1){ |
|
|
|
// 如果是去苏心游或者镇江的话
|
|
|
|
userApi.user_post("user/getJumpThirdAppCode",{}).then(res=>{ |
|
|
|
let weburl = options.weburl |
|
|
|
if(weburl.indexOf('?')!=-1){ |
|
|
|
weburl += '&original_sys_name=jdsz&auth_code='+res.data; |
|
|
|
} |
|
|
|
else { |
|
|
|
weburl += '?original_sys_name=jdsz&auth_code='+res.data |
|
|
|
} |
|
|
|
this.setData({ |
|
|
|
info:res.data, |
|
|
|
webUrl:weburl |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
else { |
|
|
|
// if(options.weburl.indexOf('m.cloud.sz-trip.com')!=-1){
|
|
|
|
// userApi.user_post("user/getMyInfo").then(res=>{
|
|
|
|
// let weburl = options.weburl
|
|
|
|
// if(weburl.indexOf('?')!=-1){
|
|
|
|
// weburl += '&token='+res.data.token;
|
|
|
|
// }
|
|
|
|
// else {
|
|
|
|
// weburl += '?token='+res.data.token
|
|
|
|
// }
|
|
|
|
// this.setData({
|
|
|
|
// info:res.data,
|
|
|
|
// webUrl:weburl
|
|
|
|
// })
|
|
|
|
// })
|
|
|
|
// }
|
|
|
|
// else if(options.weburl.indexOf('m.jszhwlpt.com')!=-1 || options.weburl.indexOf('wechat.b2c.zj-trip.net')!=-1){
|
|
|
|
// // 如果是去苏心游或者镇江的话
|
|
|
|
// userApi.user_post("user/getJumpThirdAppCode",{}).then(res=>{
|
|
|
|
// let weburl = options.weburl
|
|
|
|
// if(weburl.indexOf('?')!=-1){
|
|
|
|
// weburl += '&original_sys_name=jdsz&auth_code='+res.data;
|
|
|
|
// }
|
|
|
|
// else {
|
|
|
|
// weburl += '?original_sys_name=jdsz&auth_code='+res.data
|
|
|
|
// }
|
|
|
|
// this.setData({
|
|
|
|
// info:res.data,
|
|
|
|
// webUrl:weburl
|
|
|
|
// })
|
|
|
|
// })
|
|
|
|
// }
|
|
|
|
// else {
|
|
|
|
this.setData({ |
|
|
|
webUrl:options.weburl |
|
|
|
}) |
|
|
|
} |
|
|
|
console.log('打印',this.data.webUrl); |
|
|
|
// }
|
|
|
|
}, |
|
|
|
handleMessage(data) { |
|
|
|
console.log(data) |
|
|
|
console.log(data) |
|
|
|
this.setData({ |
|
|
|
shareTitle:data.shareTitle, |
|
|
|
shareUrl:data.shareUrl |
|
|
|
|