From 8378fcced75ddbb14f5f29b78a5366694ed4c16f Mon Sep 17 00:00:00 2001 From: mo-bai <1873032855@qq.com> Date: Mon, 18 Apr 2022 15:12:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- env/index.js | 4 ++-- pages/vip-center/index.vue | 32 ++++++++++++++++---------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/env/index.js b/env/index.js index a0bfcb1..bcf6a22 100644 --- a/env/index.js +++ b/env/index.js @@ -1,8 +1,8 @@ /** * @description 唯一环境变量 */ -const env = 'test' +// const env = 'test' // const env = 'dev' -// const env = 'production' +const env = 'production' export default env diff --git a/pages/vip-center/index.vue b/pages/vip-center/index.vue index 970ff70..bd3a67a 100644 --- a/pages/vip-center/index.vue +++ b/pages/vip-center/index.vue @@ -66,6 +66,22 @@ export default { 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: { back, payForVip() { @@ -110,22 +126,6 @@ export default { }, 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) - } } } }