Commit 29a29fc2 authored by Damon's avatar Damon

Merge branch 'dev-v1.0.0' of git.banshouhui.com:wuzhenzhe/study into dev-v1.0.0

parents 76aed41f 0f830ebb
......@@ -75,6 +75,9 @@ let learnApiFun = function(vm) {
let queryExamRecordOne = async (params = {}) =>
await vm.$u.get(`/rest/question/queryExamRecord/${params.id}`, params)
// 学员获取自己的题库
let getMyQuestionWarehouseList = async (params = {}) =>
await vm.$u.get('/rest/question/query/getMyQuestionWarehouseList', params)
const learnApi = {
getQuestion,
getQuestionTotal,
......@@ -92,7 +95,8 @@ let learnApiFun = function(vm) {
applyExam,
submitExamRecord,
queryExamRecord,
queryExamRecordOne
queryExamRecordOne,
getMyQuestionWarehouseList,
}
return learnApi
}
......
<template>
<view class="question-bank-cell">
<view class="label-normal">
<view>{{ info.label }}</view>
<view>{{ info.label || info.title }}</view>
<view class="label-text">
共
<text class="label-blue">{{ info.number }}</text
......
......@@ -151,7 +151,10 @@ export default {
cardId:
this.detail.questionWarehouse && this.detail.questionWarehouse.cardId,
provinceName: this.provinceName,
experience: this.experience,
experience:
this.selected.state && !this.detail.questionWarehouse.cardId
? true
: false,
pass: this.$u.random(95, 99) + '%',
days: this.detail.totalDayCount || 0,
today: this.detail.todayCount || 0,
......@@ -248,12 +251,12 @@ export default {
})
this.data = res || { questionWarehouse: {} }
this.selected = this.data.questionWarehouse
this.$u.vuex(
'experience',
this.selected.state && !this.detail.questionWarehouse.cardId
? true
: false
)
// this.$u.vuex(
// 'experience',
// this.selected.state && !this.detail.questionWarehouse.cardId
// ? true
// : false
// )
},
// 学生查询题库首页
async queryMyQuestionWarehouseDetail(id) {
......@@ -280,7 +283,7 @@ export default {
} else if (this.info.id) {
if (this.info.experience) {
this.selected.state = false
this.$u.vuex('experience', false)
// this.$u.vuex('experience', false)
// 体验
// 1.顺序答题 2.随机练习 3.模拟考试 4.收藏答题 5.错题答题 6.专项练习-单选 7.专项练习-多选 8.专项练习-判断 9.专项练习-答案是
this.$u.route({
......@@ -288,6 +291,8 @@ export default {
params: {
source: 2,
daily: true,
experience: true,
dailyCount: this.info.days,
},
})
} else {
......@@ -332,7 +337,7 @@ export default {
},
handleClickExperience() {
this.selected.state = false
this.$u.vuex('experience', false)
// this.$u.vuex('experience', false)
// 体验
// 1.顺序答题 2.随机练习 3.模拟考试 4.收藏答题 5.错题答题 6.专项练习-单选 7.专项练习-多选 8.专项练习-判断 9.专项练习-答案是
this.$u.route({
......@@ -340,6 +345,8 @@ export default {
params: {
source: 2,
daily: true,
experience: true,
dailyCount: this.info.days,
},
})
},
......@@ -364,8 +371,11 @@ export default {
// 已选题库
// 绑卡
this.type = 'bound'
this.show = true
// this.type = 'bound'
// this.show = true
this.$u.route({
url: 'pages/learn/detail',
})
} else {
// 未选题库
this.$u.route({
......
......@@ -96,6 +96,7 @@ export default {
if (pages.length >= 2) {
var page = pages[pages.length - 2]
this.selected = page.info
page.info = null
}
},
},
......
......@@ -317,6 +317,7 @@ export default {
if (pages.length >= 2) {
var page = pages[pages.length - 2]
this.selected = page.info
page.info = null
}
},
// 获取报考类型
......
......@@ -82,6 +82,7 @@ export default {
if (pages.length >= 2) {
var page = pages[pages.length - 2]
this.info = page.info
page.info = null
}
},
// 点击了添加按钮
......
......@@ -12,7 +12,7 @@
<view class="label-content">
<view v-for="(label, index) in list" :key="index" class="label-item">
<QuestionBankCell
:info="label"
:info="label && label.echoMap && label.echoMap.questionWarehouseId"
:type="type"
@action="handleAction"
></QuestionBankCell>
......@@ -84,24 +84,19 @@ export default {
})
},
// 获取题库列表
loadList() {
// async loadList() {
// this.loading = true;
// let res = await this.$u.api.fileLabel({categoryId: this.category.id});
// this.loading = false
// if (res && res.code == 200) {
// this.list = res.data || [];
for (var i = 0; i < 10; i++) {
// 测试模拟多条数据
this.list.push({
name: '登高架设作业',
quantity: '80000',
pass: '98%',
id: i,
async loadList() {
this.loading = true
let param = {}
let res = await this.$u.api
.getMyQuestionWarehouseList(param)
.then((res) => {
this.loading = false
this.list = res
})
.catch((err) => {
this.loading = false
console.log(err)
})
}
// }
},
setPageInfo(info) {
var pages = getCurrentPages()
......
......@@ -19,7 +19,6 @@ let saveStateKeys = [
'lastIndex',
'tipStatus',
'questionWarehouseId',
'experience',
]
// 保存变量到本地存储中
......@@ -42,7 +41,6 @@ const store = new Vuex.Store({
// 加上vuex_前缀,是防止变量名冲突,也让人一目了然
userInfo: lifeData.userInfo ? lifeData.userInfo : {},
vuex_token: lifeData.vuex_token ? lifeData.vuex_token : '',
experience: lifeData.experience ? lifeData.experience : false,
openId: lifeData.openId ? lifeData.openId : '',
searchHistory: lifeData.searchHistory ? lifeData.searchHistory : [], // 搜索历史记录
questionList: lifeData.questionList ? lifeData.questionList : [], // 练习列表
......
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