Commit 528238df authored by 俞嘉婷's avatar 俞嘉婷

feat: 接收渠道参数

parent 2e6eae94
...@@ -11,9 +11,12 @@ Page({ ...@@ -11,9 +11,12 @@ Page({
// options 参数: // options 参数:
// redirect, // redirect,
// isNeedLogin, // isNeedLogin,
// channel,
const channel = options.channel || '0';
this.options = { this.options = {
...options, ...options,
redirect: encodeURIComponent(options.redirect ? decodeURIComponent(options.redirect) : default_rUrl) channel,
redirect: encodeURIComponent((options.redirect ? decodeURIComponent(options.redirect) : default_rUrl) + (channel ? `&channel=${channel}` : ''))
}; };
this.isLogin(); this.isLogin();
}, },
......
...@@ -34,7 +34,7 @@ Page({ ...@@ -34,7 +34,7 @@ Page({
const loginRes = await reqDbLogin({ const loginRes = await reqDbLogin({
data: { data: {
code: res.code, code: res.code,
redirect: redirectUrl redirect: this.redirectUrl
} }
}) })
if (loginRes.success) { if (loginRes.success) {
...@@ -47,9 +47,9 @@ Page({ ...@@ -47,9 +47,9 @@ Page({
}) })
} }
} }
} else if (redirectUrl) { } else if (this.redirectUrl) {
this.setData({ this.setData({
path: redirectUrl, path: this.redirectUrl,
}) })
} }
}, },
......
...@@ -20,5 +20,24 @@ ...@@ -20,5 +20,24 @@
"ignoreDevUnusedFiles": true "ignoreDevUnusedFiles": true
}, },
"libVersion": "3.8.12", "libVersion": "3.8.12",
"condition": {} "condition": {
"miniprogram": {
"list": [
{
"name": "公众号渠道",
"pathName": "pages/index/index",
"query": "channel=1",
"scene": null,
"launchMode": "default"
},
{
"name": "助力",
"pathName": "pages/index/index",
"query": "isNeedLogin=1&redirect=https%3A%2F%2Factivity.m.duibatest.com.cn%2Fprojectx%2Fp94791461%2Fshare.html%3FappID%3D19487%26type%3D2%26code%3DJPSO36",
"scene": null,
"launchMode": "default"
}
]
}
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment