跳转支付小程序根据配置来确定是开发版还是正式版

This commit is contained in:
zhl 2019-03-08 13:01:01 +08:00
parent d7c168fbf9
commit eb34c78d65
4 changed files with 12 additions and 7 deletions

View File

@ -1,4 +1,4 @@
const env = 'test';
const env = 'test'; //product, test
export default {
env: env,
apiBase: env === 'test'? 'https://ghost-test.kingsome.cn' : 'https://ghost.kingsome.cn',

View File

@ -58,7 +58,7 @@
app-id="wx815bf59d472c0a63"
path="/pages/product?{{config.params}}"
extra-data=""
version="develop"
version="{{config.payVer}}"
>促销开通</navigator>
<view class="one-line bottom-line" @tap="cancelTap">取消</view>
@ -73,7 +73,8 @@
hide: true,
goldTitle: '',
params: '',
showBuy: false
showBuy: false,
payVer: 'develop'
}
}
data = {

View File

@ -100,9 +100,10 @@
hide: true,
goldTitle: '金币开通',
params: '',
showBuy: false
showBuy: false,
payVer: 'develop'
},
vip: false
vip: false,
};
methods = {
imageTap: function(index) {
@ -146,6 +147,7 @@
};
onLoad(params) {
this.zActionSheetCfg.payVer = g.env === 'product' ? 'release' : 'develop';
this.vip = this.$parent.isVip();
this.id = decodeURIComponent(params.id);
this.showAll = this.$parent.showAll();

View File

@ -17,7 +17,7 @@
app-id="wx815bf59d472c0a63"
path="/pages/buyvip?{{vip_params}}"
extra-data=""
version="develop"
version="{{payVer}}"
>
{{vip_btn_title}}</navigator>
</view>
@ -88,7 +88,8 @@
vipImg: image.vip_s,
vip_btn_title: '激活',
vip_params: '',
showBuy: false
showBuy: false,
payVer: 'develop'
};
methods = {
@ -122,6 +123,7 @@
async onLoad(options) {
let self = this;
this.payVer = global.env === 'product' ? 'release' : 'develop';
if (!this.$parent.checkClientLogin()) {
this.getAllData();
this.vip_params = `token=${this.$parent.getGlobalDate('gameToken')}`;