Commit 83bb399e authored by Facius's avatar Facius

feat: 接受二维码分享

parent d4414ded
Pipeline #3999 canceled with stages
...@@ -270,7 +270,7 @@ export default { ...@@ -270,7 +270,7 @@ export default {
onLoad(options) { onLoad(options) {
if (options.q) { if (options.q) {
const q = decodeURIComponent(options.q); // 获取到二维码原始链接内容 const q = decodeURIComponent(options.q); // 获取到二维码原始链接内容
console.log(q); uni.setStorageSync('shareUserId', this.getShareUserId(q))
} }
if (options && options.shareUserId) { // 点别人的分享邀请进来 if (options && options.shareUserId) { // 点别人的分享邀请进来
uni.setStorageSync('shareUserId', options.shareUserId) uni.setStorageSync('shareUserId', options.shareUserId)
...@@ -305,6 +305,17 @@ export default { ...@@ -305,6 +305,17 @@ export default {
uni.$off('bill-list-reload'); uni.$off('bill-list-reload');
}, },
methods: { methods: {
getShareUserId(q) {
var array = q.split('?')
if (array.length > 1) {
var arr = array[1].split('&')
for (var item of arr) {
if (item.indexOf('shareUserId=') != -1) {
return item.split('=')[1]
}
}
}
},
changeEye() { changeEye() {
this.$store.dispatch('Save_eye_fill', !this.eyeClose); this.$store.dispatch('Save_eye_fill', !this.eyeClose);
}, },
......
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