Commit c93219e7 authored by linwenqing's avatar linwenqing

Merge branch 'dev-v1.0.0' into test

parents 8bad8498 19fd5136
let commonApiFun = function(vm) {
const globalUrl = process.uniEnv || {}
let uCenterApiUrl = globalUrl.uCenterUrl
let apiUrl = globalUrl.apiUrl
let loginWechatAuth = async (params = {}) =>
await vm.$u.post('/wxapp/unify/authorization', params)
let payOrder = async (params = {}) => await vm.$u.post('/pay/order', params)
let payQuery = async (params = {}) => await vm.$u.get('/pay/query', params)
let getQiNiuToken = async (params = {}) =>
await vm.$u.post(uCenterApiUrl + 'v1/tokens', params)
await vm.$u.get(apiUrl + '/rest/file/token/get', params)
const commonApi = {
loginWechatAuth,
payOrder,
......
......@@ -21,8 +21,8 @@ let learnApiFun = function(vm) {
)
// 查询省份列表
let getProvinceList = async (params = {}) =>
await vm.$u.get('/rest/question/getProvinceList', params)
let getProvinceList = async (subjectId) =>
await vm.$u.get('/rest/question/getProvinceList/' + subjectId)
// 学生查询题库首页
let queryMyQuestionWarehouseDetail = async (questionWarehouseId) =>
......
......@@ -27,6 +27,9 @@ let userApiFun = function(vm) {
params
)
let getCertFromOut = async (params = {}) =>
await vm.$u.get(apiUrl + '/rest/certificate/national', params)
const userApi = {
updateUserInfo,
getUserInfo,
......@@ -35,6 +38,7 @@ let userApiFun = function(vm) {
getCountryCertList,
getlearnCertList,
getlearnCertDetail,
getCertFromOut,
}
return userApi
}
......
......@@ -46,7 +46,7 @@ function getPhoto(type, token) {
}
let sourceType = type == 1 ? ['album'] : ['album', 'camera']
uni.chooseImage({
count: 6, //默认9
count: 1, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: sourceType, //从相册选择
success: function(res) {
......@@ -87,7 +87,7 @@ function upload(filePath, token) {
},
complete: (res) => {
if (res.statusCode === 200) {
resolve(JSON.parse(res.data).key)
resolve(JSON.parse(res.data).key || JSON.parse(res.data).src)
} else {
reject(res.errMsg)
}
......
......@@ -5,7 +5,7 @@
v-model="visible"
safe-area-inset-bottom
mode="center"
width="654rpx"
width="622rpx"
:mask-close-able="false"
>
<view class="pop-view">
......
......@@ -137,7 +137,7 @@ export default {
this.defaultUrl + (a3 > 9 ? 'a' : 'a0') + String(a3) + '.jpeg',
]
this.list = [this.noticeText]
// this.list = [this.noticeText]
setInterval(() => {
this.produceTime += this.duration
}, this.duration)
......@@ -164,7 +164,7 @@ export default {
}
this.avatars = [...array, this.defaultUrl + str]
this.list = [this.noticeText]
// this.list = [this.noticeText]
},
},
}
......
......@@ -6,10 +6,10 @@
:current="swiperCurrent"
@change="swiperChange"
circular
>
<swiper-item v-for="(item, index) in swiperList" :key="index">
>
<swiper-item v-for="(item, index) in swiperList" :key="index" class="swiper-items">
<view class="u-flex subject">
<view class="title" v-if="item.title"><text>{{ titleType[item.type - 1] }}</text>{{ item.title }}</view>
<view class="title" v-if="item.title"><text class="title-type">{{ titleType[item.type - 1] }}</text>{{ item.title }}</view>
<view class="content">
<answer-sheet
ref="answerSheet"
......@@ -69,8 +69,8 @@ export default {
},
// 值为0禁止切换动画
swiperDuration: {
type: String,
default: "250"
type: Number,
default: 1000
},
// 分页需要传此数据
total: {
......@@ -262,7 +262,7 @@ export default {
height: 100%;
display: flex;
flex-direction: column;
swiper-item {
.swiper-items {
overflow: auto;
}
.subject {
......@@ -280,7 +280,7 @@ export default {
font-weight: bold;
width: 100%;
text-align: left;
text {
.title-type {
background: #9EA5BB;
color: #fff;
padding: 8rpx 20rpx;
......
......@@ -18,7 +18,7 @@
"style": {
"navigationBarTitleText": "证书",
"navigationStyle": "custom",
"disableScroll": true
"disableScroll": false
}
},
{
......@@ -239,6 +239,21 @@
}
]
},
{
"root": "pages/cert",
"pages": [
{
"path": "detailLearn",
"name": "certDetailLearn",
"style": {
"navigationBarTitleText": "证书详情-学时证",
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"disableScroll": false
}
}
]
},
{
"root": "pages/mine",
"pages": [
......
......@@ -14,88 +14,22 @@
<u-image :src="topImage" height="116rpx" width="100%"></u-image>
</view>
<view class="table-list">
<view class="item">
<view class="name">低压电工证</view>
<view v-if="type == 'country'" class="item">
<view class="name">{{ certName }}</view>
<view class="table">
<u-table>
<u-tr class="u-tr">
<u-th class="u-th">姓名</u-th>
<u-th class="u-th">年龄</u-th>
<u-th class="u-th">籍贯</u-th>
<u-th class="u-th">性别</u-th>
</u-tr>
<u-tr class="u-tr">
<u-td class="u-td">吕布</u-td>
<u-td class="u-td">22</u-td>
<u-td class="u-td">楚河</u-td>
<u-td class="u-td">男</u-td>
</u-tr>
<u-tr class="u-tr">
<u-td class="u-td">吕布</u-td>
<u-td class="u-td">22</u-td>
<u-td class="u-td">楚河</u-td>
<u-td class="u-td">男</u-td>
</u-tr>
<u-tr class="u-tr">
<u-td class="u-td">吕布</u-td>
<u-td class="u-td">22</u-td>
<u-td class="u-td">楚河</u-td>
<u-td class="u-td">男</u-td>
</u-tr>
<u-tr class="u-tr">
<u-td class="u-td">吕布</u-td>
<u-td class="u-td">22</u-td>
<u-td class="u-td">楚河</u-td>
<u-td class="u-td">男</u-td>
</u-tr>
<u-tr class="u-tr">
<u-td class="u-td">吕布</u-td>
<u-td class="u-td">22</u-td>
<u-td class="u-td">楚河</u-td>
<u-td class="u-td">男</u-td>
</u-tr>
</u-table>
</view>
</view>
<view class="item">
<view class="name">低压电工证</view>
<view class="table">
<u-table>
<u-tr class="u-tr">
<u-th class="u-th">姓名</u-th>
<u-th class="u-th">年龄</u-th>
<u-th class="u-th">籍贯</u-th>
<u-th class="u-th">性别</u-th>
</u-tr>
<u-tr class="u-tr">
<u-td class="u-td">吕布</u-td>
<u-td class="u-td">22</u-td>
<u-td class="u-td">楚河</u-td>
<u-td class="u-td">男</u-td>
</u-tr>
<u-tr class="u-tr">
<u-td class="u-td">吕布</u-td>
<u-td class="u-td">22</u-td>
<u-td class="u-td">楚河</u-td>
<u-td class="u-td">男</u-td>
</u-tr>
<u-tr class="u-tr">
<u-td class="u-td">吕布</u-td>
<u-td class="u-td">22</u-td>
<u-td class="u-td">楚河</u-td>
<u-td class="u-td">男</u-td>
</u-tr>
<u-tr class="u-tr">
<u-td class="u-td">吕布</u-td>
<u-td class="u-td">22</u-td>
<u-td class="u-td">楚河</u-td>
<u-td class="u-td">男</u-td>
</u-tr>
<u-tr class="u-tr">
<u-td class="u-td">吕布</u-td>
<u-td class="u-td">22</u-td>
<u-td class="u-td">楚河</u-td>
<u-td class="u-td">男</u-td>
<u-table border-color="#9EA5BB">
<u-tr
v-for="(item, i) in data.certificateTextContent"
:key="i"
class="u-tr"
>
<u-td
v-for="(val, name, index) in item"
:key="index"
class="u-td bg-td"
>
{{ val }}
</u-td>
</u-tr>
</u-table>
</view>
......@@ -103,7 +37,7 @@
</view>
<view class="foot">
<text>证书机构:中华人民共和国应急管理部</text>
<text style="padding-top: 28rpx;">更新时间:2021.07.21</text>
<text style="padding-top: 28rpx;">更新时间:{{ nowDate }}</text>
</view>
</view>
</view>
......@@ -114,13 +48,103 @@
export default {
data() {
return {
data: null,
data: {
certificateTextContent: [],
},
learnData: {},
type: null,
certName: '',
topImage: process.uniEnv.qn_base_url + 'tezhongzuoyepingtai@2x.png',
}
},
onShow: function() {
this.data = getApp().globalData.certItemData
console.log('shoudao param', this.data)
this.formatDataByType()
},
computed: {
nowDate() {
var Today = new Date()
let m = Today.getMonth() + 1
let d = Today.getDate()
return (
Today.getFullYear() +
'.' +
(String(m).length > 1 ? m : '0' + m) +
'.' +
(String(d).length > 1 ? d : '0' + d)
)
},
startDate() {
return this.learnData.startDate || ' '
},
learnDate() {
return this.learnData.startDate + '~' + this.learnData.endDate
},
name() {
return this.learnData.name || ' '
},
idCard() {
return this.learnData.idCard || ' '
},
company() {
return this.learnData.company || ' '
},
subjectName() {
return this.learnData.subjectName || ' '
},
institutionName() {
return this.learnData.institutionName || ' '
},
maxpoint() {
return this.learnData.maxPoint || 0
},
learnTime() {
return this.learnData.time || 0
},
resultForTest() {
return (this.learnData.maxPoint > 80 && '合格') || '不合格'
},
},
methods: {
formatDataByType() {
console.log('shoudao param', getApp().globalData.certItemData)
if (!getApp().globalData.certItemData) {
return
}
let certData = getApp().globalData.certItemData
this.certName = certData.certificateName
if (certData.type == 'country') {
console.log('ok')
this.type = 'country'
this.certName = certData.certificateName
let countryData = []
let count = certData.data.count || 2
let list
console.log('data is', certData.data)
if (!certData.data.certificateTextContent) {
list = JSON.parse(
JSON.parse(JSON.stringify(certData.data.certificateContent))
)
console.log('list is', list)
} else {
list = certData.data.certificateTextContent
}
for (let key in list) {
countryData[key] = []
for (let i = 1; i <= count; i++) {
countryData[key].push(list[key]['filedName_' + i])
countryData[key].push(list[key]['filedValue_' + i])
}
}
console.log('data countryData', countryData)
certData.data.certificateTextContent = countryData
this.data = certData.data
console.log('data log', this.data)
} else if (certData.type == 'learn') {
this.type = 'learn'
this.learnData = certData.data
}
},
},
}
</script>
......@@ -149,7 +173,7 @@ export default {
flex-direction: column;
align-items: center;
justify-content: center;
padding: 130rpx 24rpx 0rpx 24rpx;
padding: 30rpx 24rpx 0rpx 24rpx;
}
.cert-body {
......@@ -161,19 +185,29 @@ export default {
position: relative;
.top {
height: 116rpx;
background-color: #000000;
}
.table-list {
margin-top: 20rpx;
margin-bottom: 200rpx;
.name {
font-size: 24rpx;
font-size: 28rpx;
text-align: left;
padding: 30rpx 0;
color: #191c27;
font-weight: bold;
}
.table {
background-color: #2953ff;
/* background-color: #2953ff; */
min-height: 200rpx;
::v-deep .u-td {
font-weight: bold;
color: #5a6073;
}
::v-deep .bg-td:nth-of-type(2n + 1) {
background-color: #e8ebf3 !important;
font-weight: bold !important;
color: #191c27;
}
}
}
.foot {
......@@ -189,5 +223,22 @@ export default {
font-size: 28rpx;
color: #5a6073;
}
.cert-foot {
height: 100rpx;
width: 100%;
text-align: right;
padding-left: 24rpx;
display: flex;
flex-direction: column;
font-size: 24rpx;
color: #5a6073;
}
.u-tr ::v-deep .u-td {
font-size: 22rpx !important;
height: 80rpx;
}
.u-tr ::v-deep .u-td .u-td {
padding: 5rpx 0 !important;
}
}
</style>
<template>
<view class="begin-answer">
<u-navbar
back-icon-color="#ffffff"
background="transparent"
title="证书详情"
titleColor="#ffffff"
:border-bottom="false"
title-bold
></u-navbar>
<view class="content">
<view class="cert-body">
<view class="top"></view>
<view class="top-baody">
<view class="table-list">
<view class="head-photo">
<u-image :src="headPhoto" width="144" height="144" shape="circle"></u-image>
</view>
<view v-if="type == 'learn'" class="item" style="margin-top: 30rpx;">
<view class="table">
<u-table border-color="#9EA5BB">
<u-tr class="u-tr">
<u-td class="u-td bg-td">姓名</u-td>
<u-td class="u-td val-td">{{name}}</u-td>
</u-tr>
<u-tr class="u-tr">
<u-td class="u-td bg-td">身份证号</u-td></u-td>
<u-td class="u-td val-td">{{idCard}}</u-td>
</u-tr>
<u-tr class="u-tr">
<u-td class="u-td bg-td">工作单位</u-td>
<u-td class="u-td val-td">{{company}}</u-td>
</u-tr>
<u-tr class="u-tr">
<u-td class="u-td bg-td">资格类型</u-td>
<u-td class="u-td val-td">{{subjectName}}</u-td>
</u-tr>
<u-tr class="u-tr">
<u-td class="u-td bg-td">培训机构</u-td>
<u-td class="u-td val-td">{{institutionName}}</u-td>
</u-tr>
<u-tr class="u-tr">
<u-td class="u-td bg-td">培训日期</u-td>
<u-td class="u-td val-td">{{learnDate}}</u-td>
</u-tr>
</u-table>
</view>
<view class="table" style="margin-top: 30rpx;">
<u-table class="table" border-color="#9EA5BB">
<u-tr class="u-tr">
<u-td class="u-td bg-td">培训方式</u-td>
<u-td class="u-td bg-td">最高分</u-td></u-td>
<u-td class="u-td bg-td">实修学时</u-td>
<u-td class="u-td bg-td">测试成绩</u-td>
</u-tr>
<u-tr class="u-tr">
<u-td class="u-td val-td">在线培训</u-td>
<u-td class="u-td val-td">{{maxpoint}}</u-td>
<u-td class="u-td val-td">{{learnTime}}</u-td>
<u-td class="u-td val-td">{{resultForTest}}</u-td>
</u-tr>
</u-table>
</view>
</view>
<view class="cert-foot">
<text class="cert-top" style="line-height: 60rpx;">{{institutionName}}</text>
<text class="cert-bottom">{{startDate}}</text>
</view>
</view>
</view>
<view class="foot">
<text>证书机构:模考大师</text>
<text style="padding-top: 28rpx;">更新时间:{{ nowDate }}</text>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
learnData: {},
type: null,
certName: '',
topImage: process.uniEnv.qn_base_url + 'xueshitoubu@2x.png',
}
},
onShow: function() {
this.formatDataByType()
},
computed: {
nowDate(){
var Today=new Date();
let m = (Today.getMonth()+1)
let d = Today.getDate()
return (Today.getFullYear() + '.' + (m.length > 1 ? m : '0' + m) + '.' + (d.length > 1 ? d : '0' + d))
},
headPhoto(){
return this.learnData.photo || (process.uniEnv.qn_base_url + 'xitongtouxiang.png')
},
startDate() {
return this.learnData.startDate || ' '
},
learnDate() {
return this.learnData.startDate + '~' + this.learnData.endDate
},
name() {
return this.learnData.name || ' '
},
idCard() {
return this.learnData.idCard || ' '
},
company() {
return this.learnData.company || ' '
},
subjectName() {
return this.learnData.subjectName || ' '
},
institutionName() {
return this.learnData.institutionName || '模考大师'
},
maxpoint() {
return this.learnData.maxPoint || 0
},
learnTime() {
return this.learnData.time || 0
},
resultForTest() {
return (this.learnData.maxPoint > 80 && '合格') || '不合格'
},
},
methods: {
formatDataByType() {
console.log('shoudao param', getApp().globalData.certItemData.data)
if (!getApp().globalData.certItemData) {
return
}
this.certName = getApp().globalData.certItemData.certificateName
this.type = 'learn'
this.learnData = getApp().globalData.certItemData.data
},
},
}
</script>
<style scoped lang="scss">
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
display: none;
}
.begin-answer {
display: flex;
flex-direction: column;
background-color: #2953ff;
background-size: 100% 920rpx;
background-repeat: no-repeat;
height: 120vh;
position: absolute;
top: 0;
width: 100%;
}
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 30rpx 24rpx 0rpx 24rpx;
}
.cert-body {
width: 702rpx;
background-color: #ffffff;
text-align: center;
border-radius: 12rpx;
position: relative;
height: 1254rpx;
.top {
width: 100%;
height: 240rpx;
position: absolute;
left: 0;
top: 0;
background-image: url('https://qn-static.banshouhui.com/study/xueshitoubu@2x.png');
background-repeat: no-repeat;
background-size: 100%;
background-position: center;
}
.top-baody {
height: 1090rpx;
width: 100%;
position: absolute;
background-repeat: no-repeat;
background-size: 95%;
background-position: center;
background-image: url('https://qn-static.banshouhui.com/study/biantiao@2x.png');
.head-photo{
height: 145rpx;
padding-left: 260rpx;
}
.table-list {
padding: 160rpx 40rpx 0 40rpx;
.name {
font-size: 24rpx;
text-align: left;
padding: 30rpx 0;
}
.table {
/* background-color: #2953ff; */
/* min-height: 200rpx; */
}
::v-deep .u-td{
height: 70rpx;
}
.bg-td{
background-color: #E8EBF3;
font-weight: bold;
}
}
.cert-foot {
height: 100rpx;
width: 100%;
text-align: right;
padding-left: 24rpx;
display: flex;
flex-direction: column;
font-size: 24rpx;
color: #5a6073;
margin-top: 30rpx;
}
.u-tr ::v-deep .u-td {
font-size: 22rpx !important;
}
.u-tr ::v-deep .val-td {
font-weight: bold;
color: #5A6073 !important;
}
}
.foot {
height: 100rpx;
width: 100%;
text-align: left;
padding-left: 24rpx;
display: flex;
flex-direction: column;
font-size: 28rpx;
color: #5a6073;
position: absolute;
font-weight: 500;
bottom: 40rpx;
left: 0;
}
}
</style>
This diff is collapsed.
......@@ -47,9 +47,7 @@
:src="item.image"
></image
><text v-if="item.title" class="detail-title">{{ item.title }}</text
><text class="detail-text">{{
item.key == 'location' ? provinceName : info[item.key]
}}</text></view
><text class="detail-text">{{ info[item.key] }}</text></view
>
</view>
<SubjectStatistics
......@@ -68,7 +66,7 @@
<view class="right-view">
<view>{{ item.name }}</view>
<view class="label-view"
><text class="left-label" v-if="item.leftLabel">{{
><text class="left-label" v-if="info.cardId">{{
item.leftLabel
}}</text
><text>{{ item.label }}</text></view
......@@ -117,10 +115,10 @@ export default {
visible: false, // 免费体验弹窗
show: false,
type: 'select',
provinceList: [],
// provinceList: [],
detail: { questionWarehouse: {} },
selected: {},
data: {},
data: { questionWarehouse: {} },
// relationId: 0, // 绑卡用
loading: false,
canExperience: false, // 体验资格
......@@ -166,7 +164,10 @@ export default {
id: this.selected.id,
cardId:
this.detail.questionWarehouse && this.detail.questionWarehouse.cardId,
provinceName: this.provinceName,
provinceName:
this.data.questionWarehouse.echoMap &&
this.data.questionWarehouse.echoMap.provinceId &&
this.data.questionWarehouse.echoMap.provinceId.fullName,
experience: this.canExperience,
pass: this.$u.random(95, 99) + '%',
days: this.detail.totalDayCount || 0,
......@@ -208,19 +209,19 @@ export default {
},
]
},
provinceName() {
for (var item of this.provinceList) {
if (item.id == this.selected.provinceId) {
return item.fullName + '题'
}
}
return ''
},
// provinceName() {
// for (var item of this.provinceList) {
// if (item.id == this.selected.provinceId) {
// return item.fullName + '题'
// }
// }
// return ''
// },
detailItems() {
return [
{
title: '',
key: 'location',
key: 'provinceName',
image: process.uniEnv.qn_base_url + 'quyu.png',
imageStyle: 'width:24rpx;height:28rpx',
},
......@@ -248,7 +249,7 @@ export default {
onLoad() {
if (this.vuex_token) {
this.loading = true
this.getProvinceList()
// this.getProvinceList()
}
},
onShow() {
......@@ -269,7 +270,7 @@ export default {
},
methods: {
initData() {
this.getProvinceList()
// this.getProvinceList()
this.queryMyQuestionWarehouseDetail('0')
},
// 检查是否具有体验资格
......@@ -381,9 +382,10 @@ export default {
})
}
} else {
this.$u.route({
url: 'pages/learn/selectCategory',
})
this.show = true
// this.$u.route({
// url: 'pages/learn/selectCategory',
// })
}
},
handleClickLeftTop() {
......@@ -392,10 +394,10 @@ export default {
})
},
handleClickToast(type) {
var str = type == 'select' ? 'addExam' : 'detail'
// var str = type == 'select' ? 'selectCategory' : 'detail'
this.$u.route({
url: 'pages/learn/' + str,
url: 'pages/learn/selectCategory',
params: {
// relationId: this.relationId,
id: this.info.id,
......@@ -463,9 +465,10 @@ export default {
})
} else {
// 未选题库
this.$u.route({
url: 'pages/learn/selectCategory',
})
this.show = true
// this.$u.route({
// url: 'pages/learn/selectCategory',
// })
}
},
handleClick(path, params) {
......@@ -495,16 +498,16 @@ export default {
})
}
},
getProvinceList() {
this.$u.api
.getProvinceList()
.then((res) => {
this.provinceList = res || []
})
.catch((err) => {
console.log(err)
})
},
// getProvinceList() {
// this.$u.api
// .getProvinceList()
// .then((res) => {
// this.provinceList = res || []
// })
// .catch((err) => {
// console.log(err)
// })
// },
setPageInfo(info) {
var pages = getCurrentPages()
if (pages.length >= 1) {
......
......@@ -58,7 +58,7 @@
<u-image
slot="icon"
width="36rpx"
height="40rpx"
height="42rpx"
:src="questionIcon"
></u-image>
</u-cell-item>
......@@ -71,7 +71,7 @@
<u-image
slot="icon"
width="36rpx"
height="40rpx"
height="36rpx"
:src="serviceIcon"
></u-image>
</u-cell-item>
......@@ -84,7 +84,7 @@
<u-image
slot="icon"
width="36rpx"
height="40rpx"
height="34rpx"
:src="settingIcon"
></u-image>
</u-cell-item>
......@@ -129,7 +129,7 @@ export default {
return this.userInfo.nickName != undefined
},
loginTips() {
return this.student.consumeAmount || 0
return (this.student && this.student.consumeAmount) || 0
},
avatar() {
return (this.userInfo && this.userInfo.avatarUrl) || this.pic
......
......@@ -64,10 +64,15 @@
<view
class="c-list"
v-if="type === 1 || type === 3"
@click="collection(collectionFlag)"
@click="$u.throttle(collection, 500)"
>
<u-icon v-show="!collectionFlag" name="star" color="#5A6073" size="40"></u-icon>
<u-icon v-show="collectionFlag" name="star-fill" color="#FF930D" size="40"></u-icon>
<u-image
:src="collectImg"
width="36"
height="36"
:fade="false"
:lazy-load="false"
/>
<text>{{ collectionFlag ? '已收藏' : '收藏' }}</text>
</view>
<view class="c-list" v-if="type === 2" @click="handPapers">
......@@ -192,9 +197,9 @@ export default {
computed: {
defaultImg() {
let name = ''
if (this.type === 4) {
if (this.source === 5) {
name = 'no-error.png'
} else if (this.type === 5) {
} else if (this.source === 4) {
name = 'no-collect.png'
}
return process.uniEnv.qn_base_url + name
......@@ -205,6 +210,11 @@ export default {
removeImg() {
return process.uniEnv.qn_base_url + 'remove-error.png'
},
collectImg() {
const info = this.list.find(v => v.index === this.currentIndex)
const name = info?.collectionFlag ? 'collected.png' : 'collect.png'
return process.uniEnv.qn_base_url + name
},
currentNumber() {
let index = this.currentIndex
return index === -2 ? this.total : index + 1
......@@ -215,7 +225,7 @@ export default {
}
},
onLoad(e) {
if (e?.experience) this.experience = Boolean(e.experience) // 体验资格
if (e?.experience) this.experience = JSON.parse(e.experience) // 体验资格
if (e?.daily) this.daily.status = true // 每日一练
if (e?.dailyCount) this.daily.count = parseInt(e.dailyCount) // 打卡天数
if (e?.source) this.source = parseInt(e.source) // 来源
......@@ -273,20 +283,22 @@ export default {
// 列表总长度,一定要在第一次请求列表数据前明确该值
// 否则无法知道下一页是否还有数据
let total = parseInt(res) || 0
// 考试
if (this.type === 2) {
this.pageSize = this.totalPoint
total = this.totalPoint
if (total > 0) {
// 考试
if (this.type === 2) {
this.pageSize = this.totalPoint
total = this.totalPoint
}
this.total = total
// 练习模式-初始化答题卡列表
if (this.source === 1) Utils.initAnswerCardList(total, this)
this.cachePageDataMap = new Map()
// 上次答到了第几题
let index = this.source === 1 ? (this.lastIndex[this.questionWarehouseId] || 0) : 0
this.refresh(index)
}
this.total = total
// 练习模式-初始化答题卡列表
if (this.source === 1) Utils.initAnswerCardList(total, this)
this.cachePageDataMap = new Map()
// 上次答到了第几题
let index = this.source === 1 ? (this.lastIndex[this.questionWarehouseId] || 0) : 0
this.refresh(index)
})
},
// 切换
......@@ -488,7 +500,7 @@ export default {
uni.hideLoading()
if (res) { // 交卷
this.$u.route({
type: 'redirect',
type: 'reLaunch',
url: '/pages/learn/score',
params: {
id: this.recordId
......@@ -520,11 +532,17 @@ export default {
})
},
// 收藏
collection(status) {
collection() {
const info = this.list.find(v => v.index === this.currentIndex)
const status = info ? info.collectionFlag : false
const action = status ? 'removeCollection' : 'joinCollection'
this.$u.api[action]({questionId: info.id}).then(res => {
if(res) {
const msg = status ? '取消收藏成功' : '收藏成功'
this.$u.toast(msg)
if (status && this.source === 4) {
this.current = this.currentIndex + 1
}
info.collectionFlag = !status
if (this.source === 1) { //更新缓存数据
this.questionList[this.questionWarehouseId][this.currentIndex] = info
......
......@@ -157,7 +157,7 @@ export default {
{
title: '判断题',
icon: this.panduanmage,
key: 'trueAnswerCount',
key: 'trueOrFalseCount',
},
{
title: '多选题',
......
......@@ -33,7 +33,7 @@
</view>
<view class="exam-area">
<view class="area-title-view">
<text class="rea-title-view">包括区域</text>
<text class="rea-title-view">报考区域</text>
<text>请确认与所在考试省份一致</text>
</view>
<picker
......@@ -91,9 +91,14 @@
@submit="handleClickSubmit"
>
<view v-for="(value, key) in selected" :key="key" class="pop-content">
<view :class="['pop-content-text', { last: key == thirdKey }]">{{
value.label
}}</view>
<view :class="['pop-content-text', { last: key == thirdKey }]"
>{{ value.label
}}<text v-if="key != secondKey"
>({{
key == firstKey ? selectedTypeText : currentProvince.label
}})</text
></view
>
<u-icon v-if="key != thirdKey" name="arrow-downward"></u-icon>
</view>
</PopView>
......@@ -162,16 +167,20 @@ export default {
buttonDisabled() {
return !(this.currentProvince.label && this.selectedTypeId)
},
selectedType() {
for (var item of this.types) {
if (item.selected == true) {
return true
}
}
return false
typeTexts() {
return { '1': '初训', '2': '复训' }
},
selectedTypeText() {
return this.typeTexts[this.selectedTypeId]
},
thirdKey() {
return key3 || key2 || key1
return key3
},
firstKey() {
return key1
},
secondKey() {
return key2
},
selectedTypeId() {
for (var item of this.types) {
......@@ -185,7 +194,7 @@ export default {
onLoad(e) {
this.getPageInfo()
this.getLocation()
this.getProvinceList()
this.getProvinceList(this.category.id)
},
methods: {
handleClickArea() {
......@@ -219,8 +228,8 @@ export default {
this.showPop = true
},
// 获取省份列表
async getProvinceList() {
let res = await this.$u.api.getProvinceList()
async getProvinceList(id) {
let res = await this.$u.api.getProvinceList(id)
console.log(res)
this.range = res
},
......@@ -241,32 +250,43 @@ export default {
}
// 获取科目对应的题库
let res = await this.$u.api.getQuestionWarehouse(this.category.id, param)
let data = res[0]
this.setPageInfo(data)
// 学员增加自己的题库
let result = await this.$u.api
.addQuestionWarehouse({
questionWarehouseId: data.id,
})
.catch((err) => {
console.log(err)
})
if (res && res.length > 0) {
let data = res[0]
// 学员增加自己的题库
let result = await this.$u.api
.addQuestionWarehouse({
questionWarehouseId: data.id,
})
.catch((err) => {
console.log(err)
})
if (result) {
// 成功
if (result) {
this.setPageInfo(data)
// 成功
this.$refs.uToast.show({
title: '添加题库成功',
type: 'success',
duration: 1500,
callback: () => {
this.showPop = false
uni.switchTab({
url: '/pages/index/index',
})
},
})
} else {
this.showPop = false
}
} else {
this.$refs.uToast.show({
title: '添加题库成功',
type: 'success',
title: '该类型和区域没有的题库',
type: 'warning',
duration: 1500,
callback: () => {
this.showPop = false
uni.switchTab({
url: '/pages/index/index',
})
},
})
} else {
this.showPop = false
}
},
changeIndex() {
......
......@@ -7,6 +7,7 @@
titleColor="#191C27"
:border-bottom="false"
title-bold
:custom-back="customBack"
></u-navbar>
<view
class="top-view"
......@@ -194,7 +195,6 @@ export default {
})
},
handleClickRecord() {
console.log("11", 11)
this.$u.route({
url: 'pages/learn/answer',
params: {
......@@ -208,6 +208,13 @@ export default {
this.show = false
}, 2500)
},
customBack() {
console.log("111", 111)
this.$u.route({
type: 'tab',
url: 'pages/index/index'
})
}
},
}
</script>
......
......@@ -91,6 +91,11 @@ export default {
.getMyQuestionWarehouseList(param)
.then((res) => {
this.loading = false
for (var item of res) {
if (item && item.echoMap && item.echoMap.questionWarehouseId) {
item.echoMap.questionWarehouseId.number = item.number
}
}
this.list = res
})
.catch((err) => {
......
......@@ -6,92 +6,6 @@
// }
const TOTAL = 100
const lists = [
{
type: 1,
title: '采用QS1电桥测量tanδ的接线方式一般有差接线及和接线。',
answerList: [
{
sort: 'A',
text: '正确',
},
{
sort: 'B',
text: '错误',
},
],
answer: 'A',
explain:
'极性电介质在外电场作用下,由偶极子分子的转向形成的极化称为偶极子式极化。',
index: 0,
rightKey: ['A'],
},
{
type: 2,
title:
'空气间隙的操作冲击击穿电压数值大小不仅与间隙距离、电极形状、电极极性有关,而且与操作冲击电压波的波前时间的长短有关。',
answerList: [
{
sort: 'A',
text: '正确',
},
{
sort: 'B',
text: '错误',
},
],
answer: 'B',
explain:
'极性电介质在外电场作用下,由偶极子分子的转向形成的极化称为偶极子式极化。',
index: 1,
rightKey: ['B'],
},
{
type: 3,
title: '西林电桥采用正接线及反接线时,其测试原理相同',
answerList: [
{
sort: 'A',
text: '影响',
},
{
sort: 'B',
text: '影响很小',
},
{
sort: 'C',
text: '影响很大',
},
{
sort: 'D',
text: '无影响',
},
],
answer: 'B,C',
explain:
'双臂电桥是在单臂电桥的基础上增加特殊机构,以消除测试时连接线和接线柱接触电阻对测量结果的影响。',
index: 2,
rightKey: ['B', 'C'],
},
{
type: 2,
title: '测试标题测试标题测试标题测试标题',
answerList: [
{
sort: 'A',
text: '是',
},
{
sort: 'B',
text: '否',
},
],
answer: 'B',
explain: '测试内容测试内容测试内容测试内容测试内容测试内容',
index: 3,
rightKey: ['B'],
},
]
// 请求一页数据
function request({ currentPage, size, onSuccess, onFailed }, vm) {
......
......@@ -32,6 +32,7 @@
binderror=""
bindload=""
@click="getBack"
style="margin-top: 30rpx"
/>
</view>
</view>
......
......@@ -29,12 +29,21 @@ export default {
return {
student: {
workUnit: '',
isNotSet: null,
},
}
},
computed: {},
onLoad() {
this.student = getApp().globalData.student
if (this.student.workUnit == '' || !this.student.workUnit) {
this.isNotSet = true
}
},
onUnload() {
if (this.isNotSet) {
this.student.workUnit = ''
}
},
methods: {
submit() {
......@@ -47,6 +56,7 @@ export default {
workUnit: this.student.workUnit,
})
.then((res) => {
this.isNotSet = false
this.$u.toast('保存成功')
setTimeout(() => {
this.$u.route({
......
......@@ -24,7 +24,12 @@
></u-image>
</view>
</u-cell-item>
<u-cell-item title="证件照" @click="changeCertPhoto">
<u-cell-item
title="证件照"
@click="changeCertPhoto"
:arrow="false"
:hover-class="none"
>
<view slot="right-icon">
<u-image
v-if="isupLoadCertPhoto"
......@@ -32,7 +37,7 @@
height="120rpx"
:src="headCertPhoto"
></u-image>
<text v-else style="color:blue;">未上传</text>
<text v-else style="color:#2953FF">去上传</text>
</view>
</u-cell-item>
<u-cell-item title="手机号" :arrow="false" :hover-class="none">
......@@ -43,7 +48,8 @@
open-type="getPhoneNumber"
@getphonenumber="getPhonenumber"
>
{{ getMobile }}
<text v-if="getMobile">{{ getMobile }}</text>
<text v-else class="empty-value">去绑定</text>
</button>
</view>
</u-cell-item>
......@@ -51,12 +57,18 @@
title="实名认证"
title-style="{'font':'bold','font-size':'40rpx'}"
:value="getCertifyStatus"
:value-style="{
color: getCertifyStatus == '去认证' ? '#2953FF' : '#191C27',
}"
@click="goCertify"
>
</u-cell-item>
<u-cell-item
title="工作单位"
:value="getCompany"
:value-style="{
color: getCompany == '去填写' ? '#2953FF' : '#191C27',
}"
@click="goCompany"
></u-cell-item>
</u-cell-group>
......@@ -77,38 +89,46 @@ export default {
},
computed: {
headPhoto() {
return this.student.avatarPath || this.userInfo.avatarUrl
return (
(this.student && this.student.avatarPath) || this.userInfo.avatarUrl
)
},
headCertPhoto() {
return (
this.student.certificatePhotoPath ||
(this.student && this.student.certificatePhotoPath) ||
process.uniEnv.qn_base_url + 'xitongtouxiang.png'
)
},
isupLoadCertPhoto() {
return this.student.identityNumber || false
return (this.student && this.student.identityNumber) || false
},
getMobile() {
return this.student.phoneNumber || ''
return (
(this.student &&
this.student.phoneNumber &&
this.student.phoneNumber.length > 5 &&
this.student.phoneNumber) ||
false
)
},
getCompany() {
return this.student.workUnit || ''
return (this.student && this.student.workUnit) || '去填写'
},
getCertifyStatus() {
return !this.student.isCertify ? '去认证' : '已认证'
return this.student && this.student.isCertify ? '已认证' : '去认证'
},
},
onLoad() {
this.$u.api.getQiNiuToken({ type: 'image' }).catch((data) => {
if (data.errMsg == 'request:ok') {
this.$u.api
.getQiNiuToken({ bucketName: 'banshou-userprofile' })
.then((res) => {
this.token = data.data.token //token为七牛云的token一般由后台接口提供
getApp().globalData.qiNiuToken = data.data.token
} else {
this.$u.toast('获取token失败')
}
})
})
this.$u.api.getUserInfo().then((res) => {
res.isCertify = res.identityNumber ? true : false
if (res && res.identityNumber) {
this.student.isCertify = true
}
this.student = res
})
},
......@@ -263,8 +283,11 @@ page {
.mobile-button {
width: 115px;
height: 55rpx;
background: none;
font-size: 28rpx;
text-align: right;
padding-right: 0;
}
button::after {
border: none;
......@@ -285,7 +308,7 @@ button::after {
border-top-width: 0;
}
.content ::v-deep .u-cell__value {
color: #191c27;
.empty-value {
color: #2953ff;
}
</style>
......@@ -5,6 +5,7 @@
title="版本更新"
value="当前版本v1.1.0"
:border-bottom="false"
@tap="upgrade"
></u-cell-item>
</u-cell-group>
<view class="logout" @tap="logout">退出登录</view>
......@@ -19,6 +20,27 @@ export default {
computed: {},
onLoad() {},
methods: {
upgrade: function() {
wx.showToast({
title: '正在更新版本...',
icon: 'loading',
})
const um = wx.getUpdateManager()
um.onCheckForUpdate(function(res) {
if (res.hasUpdate) {
um.onUpdateReady(function() {
um.applyUpdate()
wx.showToast({
title: '更新完成',
})
})
} else {
wx.showToast({
title: '已是最新版本',
})
}
})
},
logout() {
this.$u.vuex('vuex_token', '')
this.$u.vuex('openId', '')
......
......@@ -67,8 +67,13 @@
</view>
<view class="u-flex opera">
<view class="opera-list" @click="collection(item)">
<u-icon v-show="!collectionFlag" name="star" color="#5A6073" size="40"></u-icon>
<u-icon v-show="collectionFlag" name="star-fill" color="#FF930D" size="40"></u-icon>
<u-image
:src="collectImg"
width="36"
height="36"
:fade="false"
:lazy-load="false"
/>
<text>{{ collectionFlag ? '已收藏' : '收藏' }}</text>
</view>
<view class="opera-list" @click="arrowUp(index)">
......@@ -128,6 +133,11 @@ export default {
count() {
return this.lists.length
},
collectImg() {
const info = this.lists.find(v => v.index === this.arrIndex)
const name = info?.collectionFlag ? 'collected.png' : 'collect.png'
return process.uniEnv.qn_base_url + name
},
collectionFlag() {
const info = this.lists.find(v => v.index === this.arrIndex)
return info ? info.collectionFlag : false
......@@ -178,18 +188,23 @@ export default {
search(val) {
if (val){
this.keyword = val
let history = this.searchHistory
let history = this.searchHistory.filter(v => v !== val)
history.unshift(val)
if (history.length > 9) {
history.splice(9, 1)
}
this.$u.vuex('searchHistory', history)
this.init()
}
},
collection(item) {
const action = item.collectionFlag ? 'removeCollection' : 'joinCollection'
this.$u.api[action]({questionId: item.id}).then(res => {
if(res) item.collectionFlag = !item.collectionFlag
if(res) {
const msg = item.collectionFlag ? '取消收藏成功' : '收藏成功'
this.$u.toast(msg)
item.collectionFlag = !item.collectionFlag
}
})
},
arrowUp(index) {
......
......@@ -43,8 +43,7 @@
export default {
data() {
return {
keyword: '',
history: [],
keyword: ''
}
},
computed: {
......@@ -56,19 +55,20 @@ export default {
deleteImg() {
return process.uniEnv.qn_base_url + 'delete.png'
},
},
created() {
this.history = this.searchHistory
history() {
return this.searchHistory
}
},
methods: {
search(val) {
if (val){
this.keyword = val
this.history.unshift(val)
if(this.history.length > 9){
this.history.splice(9, 1)
let history = this.searchHistory.filter(v => v !== val)
history.unshift(val)
if(history.length > 9){
history.splice(9, 1)
}
this.$u.vuex('searchHistory', this.history)
this.$u.vuex('searchHistory', history)
this.toSearchDetail(val)
}
},
......@@ -86,7 +86,6 @@ export default {
content: '确认要清空搜索历史记录?',
success: (res) => {
if (res.confirm) {
this.history = []
this.$u.vuex('searchHistory', [])
}
},
......
<template>
<view class="u-td" :style="[tdStyle]">
<slot></slot>
</view>
<view class="u-td" :style="[tdStyle]">
<slot></slot>
</view>
</template>
<script>
/**
* td td单元格
* @description 表格组件一般用于展示大量结构化数据的场景(搭配u-table使用)
* @tutorial https://www.uviewui.com/components/table.html#td-props
* @property {String Number} width 单元格宽度百分比或者具体带单位的值,如30%, 200rpx等,一般使用百分比,单元格宽度默认为均分tr的长度(默认auto)
* @example <u-td>二年级</u-td>
*/
export default {
name: "u-td",
props: {
// 宽度,百分比或者具体带单位的值,如30%, 200rpx等,一般使用百分比
width: {
type: [Number, String],
default: 'auto'
}
},
data() {
return {
tdStyle: {
}
}
},
created() {
this.parent = false;
},
mounted() {
this.parent = this.$u.$parent.call(this, 'u-table');
if (this.parent) {
// 将父组件的相关参数,合并到本组件
let style = {};
if (this.width != "auto") style.flex = `0 0 ${this.width}`;
style.textAlign = this.parent.align;
style.fontSize = this.parent.fontSize + 'rpx';
style.padding = this.parent.padding;
style.borderBottom = `solid 1px ${this.parent.borderColor}`;
style.borderRight = `solid 1px ${this.parent.borderColor}`;
style.color = this.parent.color;
this.tdStyle = style;
}
}
};
/**
* td td单元格
* @description 表格组件一般用于展示大量结构化数据的场景(搭配u-table使用)
* @tutorial https://www.uviewui.com/components/table.html#td-props
* @property {String Number} width 单元格宽度百分比或者具体带单位的值,如30%, 200rpx等,一般使用百分比,单元格宽度默认为均分tr的长度(默认auto)
* @example <u-td>二年级</u-td>
*/
export default {
name: 'u-td',
props: {
// 宽度,百分比或者具体带单位的值,如30%, 200rpx等,一般使用百分比
width: {
type: [Number, String],
default: 'auto',
},
},
data() {
return {
tdStyle: {},
}
},
created() {
this.parent = false
},
mounted() {
this.parent = this.$u.$parent.call(this, 'u-table')
if (this.parent) {
// 将父组件的相关参数,合并到本组件
let style = {}
if (this.width != 'auto') style.flex = `0 0 ${this.width}`
style.textAlign = this.parent.align
style.fontSize = this.parent.fontSize + 'rpx'
style.padding = this.parent.padding
style.borderBottom = `solid 1px ${this.parent.borderColor}`
style.borderRight = `solid 1px ${this.parent.borderColor}`
style.color = this.parent.color
this.tdStyle = style
}
},
}
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
@import '../../libs/css/style.components.scss';
.u-td {
@include vue-flex;
flex-direction: column;
flex: 1;
justify-content: center;
font-size: 28rpx;
color: $u-content-color;
align-self: stretch;
box-sizing: border-box;
height: 100%;
}
.u-td {
@include vue-flex;
flex-direction: column;
flex: 1;
justify-content: center;
font-size: 28rpx;
color: $u-content-color;
align-self: stretch;
box-sizing: border-box;
height: 100%;
}
</style>
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