|
@@ -22,26 +22,21 @@ export default {
|
|
});
|
|
});
|
|
console.log('其他浏览器');
|
|
console.log('其他浏览器');
|
|
}
|
|
}
|
|
- // 获取参数免费时长
|
|
|
|
- this.$u.api
|
|
|
|
- .getParamsApi({
|
|
|
|
- key: 'park.lock.freetime'
|
|
|
|
- })
|
|
|
|
- .then((res) => {
|
|
|
|
- if (res.code === 200) {
|
|
|
|
- this.$u.vuex('free_time', res.msg);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- onShow: function () {
|
|
|
|
- // console.log('App Show')
|
|
|
|
|
|
+ // 判断从什么入口进入 车位锁等页面无需调用
|
|
const backUrl = location.href,
|
|
const backUrl = location.href,
|
|
- openidPage = ['/pages/parkingLock/parkingLock'], // 只需要穿openid的页面集合
|
|
|
|
|
|
+ openidPage = this.config.onlyWxLogin, // 只需要穿openid的页面集合
|
|
needValidPage = openidPage.filter((item) => backUrl.indexOf(item) > -1); // 是否为需要验证的页面集合
|
|
needValidPage = openidPage.filter((item) => backUrl.indexOf(item) > -1); // 是否为需要验证的页面集合
|
|
const { openId } = this.vuex_wxinfo;
|
|
const { openId } = this.vuex_wxinfo;
|
|
|
|
+ console.log('openId', openId);
|
|
|
|
+ console.log('needValidPage', needValidPage);
|
|
if (openId && needValidPage.length === 0) {
|
|
if (openId && needValidPage.length === 0) {
|
|
this.getUserInfo(openId);
|
|
this.getUserInfo(openId);
|
|
}
|
|
}
|
|
|
|
+ // 获取参数
|
|
|
|
+ this.getFreeTime();
|
|
|
|
+ },
|
|
|
|
+ onShow: function () {
|
|
|
|
+ console.log('App Show');
|
|
},
|
|
},
|
|
onHide: function () {
|
|
onHide: function () {
|
|
// console.log('App Hide')
|
|
// console.log('App Hide')
|
|
@@ -77,6 +72,18 @@ export default {
|
|
type: 'error'
|
|
type: 'error'
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ /**
|
|
|
|
+ * @description: 获取参数免费时长
|
|
|
|
+ * @return {*}
|
|
|
|
+ */
|
|
|
|
+ async getFreeTime() {
|
|
|
|
+ try {
|
|
|
|
+ const { msg } = await this.$u.api.getParamsApi({ key: 'park.lock.freetime' });
|
|
|
|
+ this.$u.vuex('free_time', msg);
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.log(error);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|