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