|
@@ -3,7 +3,11 @@
|
|
|
export default {
|
|
export default {
|
|
|
onLaunch: function(e) {
|
|
onLaunch: function(e) {
|
|
|
console.log('App Launch', e)
|
|
console.log('App Launch', e)
|
|
|
- let userId = uni.getStorageSync("userId")
|
|
|
|
|
|
|
+ // if (this.$isWxBrowser()) {
|
|
|
|
|
+ // this.WxBrowser(e);
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // this.externalBrowser(e);
|
|
|
|
|
+ // }
|
|
|
if (this.$isWxBrowser() && this.$u.test.isEmpty(e.query)) {
|
|
if (this.$isWxBrowser() && this.$u.test.isEmpty(e.query)) {
|
|
|
// uni.reLaunch({
|
|
// uni.reLaunch({
|
|
|
// url: "/pages/index/guide"
|
|
// url: "/pages/index/guide"
|
|
@@ -15,9 +19,18 @@
|
|
|
url: 'pages/index/guide'
|
|
url: 'pages/index/guide'
|
|
|
})
|
|
})
|
|
|
} else if (this.$isWxBrowser() && !this.$u.test.isEmpty(e.query.userId)) {
|
|
} else if (this.$isWxBrowser() && !this.$u.test.isEmpty(e.query.userId)) {
|
|
|
- uni.reLaunch({
|
|
|
|
|
- url: 'pages/index/guide?userId=' + e.query.userId
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ if (e.query.userId != uni.getStorageSync("userId")) {
|
|
|
|
|
+ let url = window.location.href;
|
|
|
|
|
+ let len = url.indexOf("userId=") - 1
|
|
|
|
|
+ let tmp = url.substring(0, len)
|
|
|
|
|
+ console.log(tmp);
|
|
|
|
|
+ window.location.href = tmp
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.reLaunch({
|
|
|
|
|
+ url: 'pages/index/guide?userId=' + e.query.userId
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
} else {
|
|
} else {
|
|
|
if (!this.$u.test.isEmpty(e.query.userId)) {
|
|
if (!this.$u.test.isEmpty(e.query.userId)) {
|
|
|
uni.reLaunch({
|
|
uni.reLaunch({
|
|
@@ -36,6 +49,36 @@
|
|
|
onHide: function() {
|
|
onHide: function() {
|
|
|
console.log('App Hide')
|
|
console.log('App Hide')
|
|
|
},
|
|
},
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ WxBrowser(e) {
|
|
|
|
|
+ let userId = uni.getStorageSync("userId");
|
|
|
|
|
+ if (this.$u.test.isEmpty(e.query) && this.$u.test.isEmpty(userId)) {
|
|
|
|
|
+ let path = 'pages/index/guide?login=1';
|
|
|
|
|
+ window.location.href = authUrl(path);
|
|
|
|
|
+ } else if (!this.$u.test.isEmpty(e.query.login)) {
|
|
|
|
|
+ uni.reLaunch({
|
|
|
|
|
+ url: 'pages/index/guide'
|
|
|
|
|
+ })
|
|
|
|
|
+ } else if (!this.$u.test.isEmpty(userId) && (userId != e.query.userId)) {
|
|
|
|
|
+ window.location.href = "https://music.nanyue6688.com/vote-h5/index.html#/";
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.reLaunch({
|
|
|
|
|
+ url: 'pages/index/guide?userId=' + e.query.userId
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ externalBrowser(e) {
|
|
|
|
|
+ if (!this.$u.test.isEmpty(e.query.userId)) {
|
|
|
|
|
+ uni.reLaunch({
|
|
|
|
|
+ url: "/pages/activityList/home/home?activityId=1407016573251153922&userId=" + e.query.userId
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.reLaunch({
|
|
|
|
|
+ url: "/pages/activityList/home/home?activityId=1407016573251153922"
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|