Browse Source

优化

devlop
mo-bai 4 years ago
parent
commit
8378fcced7
2 changed files with 18 additions and 18 deletions
  1. 4
      env/index.js
  2. 32
      pages/vip-center/index.vue

4
env/index.js

@ -1,8 +1,8 @@
/** /**
* @description 唯一环境变量 * @description 唯一环境变量
*/ */
const env = 'test'
// const env = 'test'
// const env = 'dev' // const env = 'dev'
// const env = 'production'
const env = 'production'
export default env export default env

32
pages/vip-center/index.vue

@ -66,6 +66,22 @@ export default {
wxCode: null wxCode: null
} }
}, },
onLoad() {
let url = window.location.href
let codeIndex = url.indexOf('code=')
if (codeIndex === -1) {
uni.showModal({
title: '提示',
content: '参数错误,请重新打开',
success: (res) => {
back()
}
})
} else {
let endIndex = url.indexOf('&', codeIndex)
this.wxCode = url.substring(codeIndex + 5, endIndex)
}
},
methods: { methods: {
back, back,
payForVip() { payForVip() {
@ -110,22 +126,6 @@ export default {
}, 1000) }, 1000)
} }
}) })
},
onLoad() {
let url = window.location.href
let codeIndex = url.indexOf('code=')
if (codeIndex === -1) {
uni.showModal({
title: '提示',
content: '参数错误,请重新打开',
success: (res) => {
back()
}
})
} else {
let endIndex = url.indexOf('&', codeIndex)
this.wxCode = url.substring(codeIndex + 5, endIndex)
}
} }
} }
} }

Loading…
Cancel
Save