data: {
targetPath: '',
targetArguments: ''
},
onLoad (options) {
console.log(options, 'options')
const { scene, path } = options
if (scene) {
const path = decodeURIComponent(scene).split('&')
let obj = {}
path.map((item, index) => {
let newArr = item.split('=')
obj[newArr[0]] = newArr[1]
})
console.log(obj, 'opObj')
}
if (path) {
let arr = Object.keys(options)
let newArr = []
for (let item of arr) {
newArr.push(`${item}=${options[item]}`)
}
this.targetPath = path
this.targetArguments = newArr.join('&')
this.toPath()
}
},
methods: {
toPath () {
wx.reLaunch({
url: `/pages/pageA/${this.targetPath}?${this.targetArguments}`
})
}
}
```