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

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 { export default {
env: env, env: env,
apiBase: env === 'test'? 'https://ghost-test.kingsome.cn' : 'https://ghost.kingsome.cn', apiBase: env === 'test'? 'https://ghost-test.kingsome.cn' : 'https://ghost.kingsome.cn',

View File

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

View File

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

View File

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