Commit 21e4ddfc authored by linwenqing's avatar linwenqing

add:查询版本信息,如果审核未通过不显示学习视频

parent 4f382137
......@@ -2,6 +2,9 @@
(function() {
let NODE_ENV = 'test'; // dev:开发环境 | test:测试环境 | prod:生产环境
let ENV_VAR = null;
let VERSION_NUMBER = '1.2.9';//版本号
//小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频
let IS_AUDIT_PASS = false;
if (process.env.NODE_ENV === "development") {
if (NODE_ENV === 'dev') {
ENV_VAR = require('./.env.dev.js');
......@@ -21,6 +24,8 @@
if (ENV_VAR) {
process.uniEnv = {};
process.uniEnv['node_env'] = NODE_ENV;
process.uniEnv['version_number'] = VERSION_NUMBER;
process.uniEnv['is_audit_pass'] = IS_AUDIT_PASS;
for (let key in ENV_VAR) {
process.uniEnv[key] = ENV_VAR[key];
}
......
......@@ -22,8 +22,10 @@ let learnApiFun = function(vm){
let applyExam = async (examId, params = {}) => await vm.$u.post(sysApiUrl + '/wxh-worker-rest/rest/exam/serviceRule/' + vm.vuex_token + '?examId=' + examId, params);
/* 获取下一题 */
let getNextQuestion = async (userExamId, questionId, userAnswerIds, params = {}) => await vm.$u.post(sysApiUrl + '/wxh-worker-rest/rest/exam/serviceRule/next/' + vm.vuex_token + '?userExamId=' + userExamId + '&questionId=' + questionId + '&userAnswerIds=' + (userAnswerIds || "9999"), params);
/* 获取版本号*/
let getVersionInfo = async (version) => await vm.$u.get(ucenterApiUrl +'/v1/version/info?version=' + version);
const learnApi = {
getTrainingNoticeList,CourseList,ChapterDetails,CourseSection,updateLearnCourses,getExamResult,applyExam,getNextQuestion
getTrainingNoticeList,CourseList,ChapterDetails,CourseSection,updateLearnCourses,getExamResult,applyExam,getNextQuestion,getVersionInfo
}
return learnApi
}
......
......@@ -368,6 +368,17 @@ export default {
data() {
return {
tabs: [
{
name: "交付规范",
},
{
name: "消息通知",
},
{
name: "考核认证",
},
],
tabs2: [
{
name: "交付规范",
},
......@@ -463,6 +474,7 @@ export default {
isReflesh: true,
triggered: false,
_freshing: false,
version: false,
};
},
onLoad(param) {
......@@ -474,6 +486,7 @@ export default {
this.swiperCurrent = param.tabs;
}
} catch (e) {}
this.getVersion();
},
computed: {
bannerImage() {
......@@ -492,6 +505,21 @@ export default {
}
},
methods: {
getVersion() {
let version = process.uniEnv.version_number;
let that = this;
this.$u.api
.getVersionInfo(version)
.then((res) => {
let data = res.data;
if(data.hasOwnProperty('is_audit') && data.is_audit == 1){
that.tabs = that.tabs2;
}
})
.catch((err) => {
});
},
stopPull() {
let that = this;
setTimeout(function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment