Commit de960bd0 authored by Damon's avatar Damon

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

parents 10783d78 a1efe6ab
......@@ -18,12 +18,19 @@ let userApiFun = function(vm) {
let getCertList = async (params = {}) =>
await vm.$u.post(apiUrl + '/rest/certificate/query', params)
let getUserQuestionWareHouse = async (params = {}) =>
await vm.$u.get(
apiUrl + '/rest/question/query/getMyQuestionWarehouseList',
params
)
const userApi = {
updateUserInfo,
getUserInfo,
checkIdCardFront,
checkIdCardBack,
getCertList,
getUserQuestionWareHouse,
}
return userApi
}
......
......@@ -8,7 +8,7 @@
:border-bottom="false"
title-bold
></u-navbar>
<view class="content">
<view class="content" v-if="lists.length > 0">
<!-- <text class="title">{{ title }}</text> -->
<my-subject
class="subject-item"
......@@ -21,6 +21,17 @@
:statusStyle="item.statusStyle"
></my-subject>
</view>
<view class="content" v-else>
<u-image
width="374rpx"
height="322rpx"
:src="nothing"
style="margin-top: 100rpx;"
></u-image>
<text style="margin-top: 20rpx;font-size: 28rpx;color: #9EA5BB;"
>当前暂无题库内容</text
>
</view>
</view>
</template>
......@@ -33,31 +44,58 @@ export default {
data() {
return {
title: '我的题库',
lists: [
{
time: '2021.06.25 18:06',
status: '已激活',
title: '高处安装、维护、拆除作业人员',
subtitle: '题库将于48天后到期',
statusStyle: { color: '#2953FF' },
},
{
time: '2021.05.25 14:05',
status: '已绑定',
title: '高处安装、维护、拆除作业人员',
subtitle: '题库将于88天后到期',
statusStyle: { color: '#2953FF' },
},
{
time: '2021.07.25 11:06',
status: '已失效',
title: '高处安装、维护、拆除作业人员',
subtitle: '题库已过期',
statusStyle: { color: '#9EA5BB' },
},
],
nothing: process.uniEnv.qn_base_url + 'zanwucuoti@3x.png',
lists: [],
}
},
onLoad() {
this.$u.api.getUserQuestionWareHouse().then((res) => {
let length = res.length
if (res.length <= 0) {
this.lists = []
}
let data = []
for (let i = 0; i < length; i++) {
data[i] = {}
if (
!res[i].echoMap ||
!res[i].echoMap.questionWarehouseId ||
!res[i].echoMap.cardId
) {
continue
}
//绑卡或支付时间
data[i].title = res[i].echoMap.questionWarehouseId.title
data[i].subtitle = res[i].echoMap.questionWarehouseId.subtitle
data[i].time =
res[i].echoMap.cardId.bindingTime ||
res[i].echoMap.cardId.buyTime ||
''
let status = ''
switch (res[i].echoMap.cardId.cardStatus) {
case 0:
status = '未绑定'
break
case 5:
status = '已绑定'
break
case 10:
status = '已激活'
break
case 15:
status = '已失效'
break
default:
break
}
data[i].status = status
data[i].statusStyle = { color: '#2953FF' }
}
this.lists = data
console.log(data)
})
},
}
</script>
......@@ -76,7 +114,7 @@ page {
.begin-answer {
display: flex;
flex-direction: column;
background-image: linear-gradient(to top, #f7f9fc 0%, #e9f3ff 40%);
background-image: linear-gradient(to top, #f7f9fc 0%, #e9f3ff 20%);
background-color: #f7f9fc;
background-size: 100% 920rpx;
background-repeat: no-repeat;
......
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