Commit 2640416a authored by Damon's avatar Damon

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

parents b0e175db de370eef
......@@ -97,6 +97,13 @@ let learnApiFun = function(vm) {
'/rest/question/query/everyTaskList/' + questionWarehouseId,
params
)
// 练习分析
let studyRecord = async (questionWarehouseId, params = {}) =>
await vm.$u.get(
'/rest/question/query/studyRecord/' + questionWarehouseId,
params
)
const learnApi = {
getQuestion,
getQuestionTotal,
......@@ -120,6 +127,7 @@ let learnApiFun = function(vm) {
searchQuestion,
checkGetQuestion,
everyTaskList,
studyRecord,
}
return learnApi
}
......
......@@ -64,7 +64,7 @@
</view>
<view class="cert-foot">
<text class="cert-top" style="line-height: 60rpx;">{{institutionName}}</text>
<text class="cert-bottom">{{startDate}}</text>
<text class="cert-bottom">{{endDate}}</text>
</view>
</view>
</view>
......@@ -111,6 +111,9 @@ export default {
startDate() {
return this.learnData.startDate || ' '
},
endDate() {
return this.learnData.endDate || ' '
},
learnDate() {
return String(this.learnData.startDate).length > 1 && (this.learnData.startDate + '~' + this.learnData.endDate) || ' '
},
......@@ -208,7 +211,7 @@ export default {
background-image: url('https://qn-static.banshouhui.com/study/biantiao@2x.png');
.head-photo{
height: 145rpx;
padding-left: 260rpx;
padding-left: 245rpx;
}
.table-list {
padding: 160rpx 40rpx 0 40rpx;
......
......@@ -3,7 +3,7 @@
<u-navbar
back-icon-color="#333333"
background="transparent"
title="题库平台"
title="模考大师"
titleColor="#191C27"
:border-bottom="false"
title-bold
......@@ -23,6 +23,7 @@
<text v-else>{{ title }}</text>
<u-icon class="icon-view" name="arrow-up-fill"></u-icon>
</view>
<view>{{ orgIdText }}</view>
<view v-if="noExam" class="tip-view">
<text>您还未选择题库,请先选择题库</text>
</view>
......@@ -128,6 +129,9 @@ export default {
}
},
computed: {
orgIdText() {
return getApp().globalData.orgId
},
title() {
return this.selected.title || '请选择题库'
},
......
......@@ -44,7 +44,7 @@
>
<view class="select-area">
<view @click="handleClickArea" class="area-text-view">
<text>{{ currentProvince.label }}</text>
<text>{{ currentProvince.label || '请选择' }}</text>
<u-icon name="arrow-down"></u-icon>
</view>
<view class="loading-view" v-if="loading">
......@@ -112,7 +112,7 @@ export default {
{ id: '1', name: '初训(初次考试)', selected: false },
{ id: '2', name: '复训(年审或换证)', selected: false },
],
currentProvince: { label: '北京市' },
currentProvince: { label: '' },
loading: true,
showPop: false,
range: [],
......@@ -218,7 +218,7 @@ export default {
// if (this.buttonDisabled) return
if (this.range.length <= 0 || this.range.length == null) {
this.$refs.uToast.show({
title: '该类型和区域没有题库',
title: '该类型和区域没有该题库',
type: 'warning',
duration: 1500,
callback: () => {
......@@ -273,7 +273,7 @@ export default {
})
} else {
this.$refs.uToast.show({
title: '该类型和区域没有题库',
title: '该类型和区域没有该题库',
type: 'warning',
duration: 1500,
callback: () => {
......
......@@ -111,6 +111,18 @@ export default {
},
methods: {
handleClick() {
if (!this.code || !this.password) {
this.$refs.uToast.show({
title: '请输入正确的卡号、密码',
type: 'warning',
duration: 1500,
callback: () => {
this.showPop = false
},
})
return
}
this.loading = true
this.$u.api
.bindCard({
......
......@@ -169,23 +169,23 @@ export default {
onLoad(e) {
if (e && e.key) {
this.$nextTick(() => {
setTimeout(() => {
this.scrollId = 'part-' + e.key
}, 500)
// setTimeout(() => {
this.scrollId = 'part-' + e.key
// }, 500)
})
}
this.queryExamRecord()
this.chartInit()
this.queryExamRecord()
},
methods: {
chartInit() {
this.chartData.series = [
{
name: '时间轴1',
name: '答题数',
pointShape: 'circle',
legendShape: 'circle',
data: [
[10000, 55],
[10000, 55], // 【日期, 数值】
[30000, 25],
[50000, 55],
[70000, 25],
......@@ -193,7 +193,7 @@ export default {
],
},
{
name: '时间轴2',
name: '正确率',
pointShape: 'circle',
legendShape: 'circle',
data: [
......@@ -205,6 +205,7 @@ export default {
],
},
]
this.studyRecord()
},
// 每日一练统计
everyTaskList(year, month) {
......@@ -230,6 +231,37 @@ export default {
console.log(err)
})
},
// 练习分析
studyRecord(start, end) {
var params = {}
if (!start || !end) {
// 近七天
end = new Date().getTime()
start = new Date().setDate(new Date().getDay() - 6)
}
console.log(
'---------start---------',
start,
'---------start---------',
end
)
params = {
startDate: this.$u.timeFormat(start, 'yyyy-mm-dd'),
endDate: this.$u.timeFormat(end, 'yyyy-mm-dd'),
}
this.$u.api
.studyRecord(this.questionWarehouseId, params)
.then((res) => {
console.log('----------studyRecord------------', res)
// this.days = []
// for (var item of res) {
// this.days.push(item.time.replace(/\-0/g, '\-'))
// }
})
.catch((err) => {
console.log(err)
})
},
// 模考记录
queryExamRecord() {
this.recordParams.current += 1
......@@ -406,6 +438,7 @@ export default {
.charts-content {
width: 100%;
height: 570rpx;
padding: 0 24rpx 10rpx 0rpx;
.charts-box {
width: 100%;
height: 570rpx;
......@@ -413,10 +446,10 @@ export default {
}
}
.list-view {
padding-bottom: 20rpx;
padding-bottom: 44rpx;
.list-content {
padding: 0 30rpx 20rpx 30rpx;
min-height: 44rpx;
.show-more {
display: flex;
justify-content: center;
......
......@@ -83,6 +83,7 @@ export default {
},
handleAction(info) {
this.setPageInfo(info)
this.$u.vuex('searchHistory', [])
this.$u.route({
type: 'back',
})
......
......@@ -42,14 +42,24 @@ export default {
})
},
logout() {
this.$u.vuex('vuex_token', '')
this.$u.vuex('openId', '')
this.$u.vuex('userInfo', {})
setTimeout(() => {
this.$u.route({
type: 'back',
})
}, 1000)
let that = this
uni.showModal({
title: '提示',
content: '确认退出当前账号',
success: function(res) {
if (res.confirm) {
that.$u.vuex('vuex_token', '')
that.$u.vuex('openId', '')
that.$u.vuex('userInfo', {})
setTimeout(() => {
that.$u.route({
type: 'back',
})
}, 800)
} else if (res.cancel) {
}
},
})
},
},
}
......
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