Commit 7a0723f3 authored by Facius's avatar Facius

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

parents 213e1cad d00c5517
...@@ -27,6 +27,9 @@ let userApiFun = function(vm) { ...@@ -27,6 +27,9 @@ let userApiFun = function(vm) {
params params
) )
let getCertFromOut = async (params = {}) =>
await vm.$u.get(apiUrl + '/rest/certificate/national', params)
const userApi = { const userApi = {
updateUserInfo, updateUserInfo,
getUserInfo, getUserInfo,
...@@ -35,6 +38,7 @@ let userApiFun = function(vm) { ...@@ -35,6 +38,7 @@ let userApiFun = function(vm) {
getCountryCertList, getCountryCertList,
getlearnCertList, getlearnCertList,
getlearnCertDetail, getlearnCertDetail,
getCertFromOut,
} }
return userApi return userApi
} }
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
"style": { "style": {
"navigationBarTitleText": "证书", "navigationBarTitleText": "证书",
"navigationStyle": "custom", "navigationStyle": "custom",
"disableScroll": true "disableScroll": false
} }
}, },
{ {
...@@ -239,6 +239,21 @@ ...@@ -239,6 +239,21 @@
} }
] ]
}, },
{
"root": "pages/cert",
"pages": [
{
"path": "detailLearn",
"name": "certDetailLearn",
"style": {
"navigationBarTitleText": "证书详情-学时证",
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"disableScroll": false
}
}
]
},
{ {
"root": "pages/mine", "root": "pages/mine",
"pages": [ "pages": [
......
This diff is collapsed.
<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">{{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">{{idCard}}</u-td>
</u-tr>
<u-tr class="u-tr">
<u-td class="u-td bg-td">工作单位</u-td>
<u-td class="u-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">{{subjectName}}</u-td>
</u-tr>
<u-tr class="u-tr">
<u-td class="u-td bg-td">培训机构</u-td>
<u-td class="u-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">{{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">在线培训</u-td>
<u-td class="u-td">{{maxpoint}}</u-td>
<u-td class="u-td">{{learnTime}}</u-td>
<u-td class="u-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 + 'xueshitoubu@2x.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;
}
}
.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.
...@@ -129,7 +129,7 @@ export default { ...@@ -129,7 +129,7 @@ export default {
return this.userInfo.nickName != undefined return this.userInfo.nickName != undefined
}, },
loginTips() { loginTips() {
return this.student.consumeAmount || 0 return (this.student && this.student.consumeAmount) || 0
}, },
avatar() { avatar() {
return (this.userInfo && this.userInfo.avatarUrl) || this.pic return (this.userInfo && this.userInfo.avatarUrl) || this.pic
......
...@@ -64,10 +64,15 @@ ...@@ -64,10 +64,15 @@
<view <view
class="c-list" class="c-list"
v-if="type === 1 || type === 3" 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-image
<u-icon v-show="collectionFlag" name="star-fill" color="#FF930D" size="40"></u-icon> :src="collectImg"
width="36"
height="36"
:fade="false"
:lazy-load="false"
/>
<text>{{ collectionFlag ? '已收藏' : '收藏' }}</text> <text>{{ collectionFlag ? '已收藏' : '收藏' }}</text>
</view> </view>
<view class="c-list" v-if="type === 2" @click="handPapers"> <view class="c-list" v-if="type === 2" @click="handPapers">
...@@ -205,6 +210,11 @@ export default { ...@@ -205,6 +210,11 @@ export default {
removeImg() { removeImg() {
return process.uniEnv.qn_base_url + 'remove-error.png' 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() { currentNumber() {
let index = this.currentIndex let index = this.currentIndex
return index === -2 ? this.total : index + 1 return index === -2 ? this.total : index + 1
...@@ -520,8 +530,9 @@ export default { ...@@ -520,8 +530,9 @@ export default {
}) })
}, },
// 收藏 // 收藏
collection(status) { collection() {
const info = this.list.find(v => v.index === this.currentIndex) const info = this.list.find(v => v.index === this.currentIndex)
const status = info ? info.collectionFlag : false
const action = status ? 'removeCollection' : 'joinCollection' const action = status ? 'removeCollection' : 'joinCollection'
this.$u.api[action]({questionId: info.id}).then(res => { this.$u.api[action]({questionId: info.id}).then(res => {
if(res) { if(res) {
......
...@@ -77,25 +77,27 @@ export default { ...@@ -77,25 +77,27 @@ export default {
}, },
computed: { computed: {
headPhoto() { headPhoto() {
return this.student.avatarPath || this.userInfo.avatarUrl return (
(this.student && this.student.avatarPath) || this.userInfo.avatarUrl
)
}, },
headCertPhoto() { headCertPhoto() {
return ( return (
this.student.certificatePhotoPath || (this.student && this.student.certificatePhotoPath) ||
process.uniEnv.qn_base_url + 'xitongtouxiang.png' process.uniEnv.qn_base_url + 'xitongtouxiang.png'
) )
}, },
isupLoadCertPhoto() { isupLoadCertPhoto() {
return this.student.identityNumber || false return (this.student && this.student.identityNumber) || false
}, },
getMobile() { getMobile() {
return this.student.phoneNumber || '' return (this.student && this.student.phoneNumber) || ''
}, },
getCompany() { getCompany() {
return this.student.workUnit || '' return (this.student && this.student.workUnit) || ''
}, },
getCertifyStatus() { getCertifyStatus() {
return !this.student.isCertify ? '去认证' : '已认证' return this.student && !this.student.isCertify ? '去认证' : '已认证'
}, },
}, },
onLoad() { onLoad() {
...@@ -108,7 +110,10 @@ export default { ...@@ -108,7 +110,10 @@ export default {
} }
}) })
this.$u.api.getUserInfo().then((res) => { this.$u.api.getUserInfo().then((res) => {
res.isCertify = res.identityNumber ? true : false if (res && res.identityNumber) {
res.isCertify = true
}
this.student = res this.student = res
}) })
}, },
......
...@@ -67,8 +67,13 @@ ...@@ -67,8 +67,13 @@
</view> </view>
<view class="u-flex opera"> <view class="u-flex opera">
<view class="opera-list" @click="collection(item)"> <view class="opera-list" @click="collection(item)">
<u-icon v-show="!collectionFlag" name="star" color="#5A6073" size="40"></u-icon> <u-image
<u-icon v-show="collectionFlag" name="star-fill" color="#FF930D" size="40"></u-icon> :src="collectImg"
width="36"
height="36"
:fade="false"
:lazy-load="false"
/>
<text>{{ collectionFlag ? '已收藏' : '收藏' }}</text> <text>{{ collectionFlag ? '已收藏' : '收藏' }}</text>
</view> </view>
<view class="opera-list" @click="arrowUp(index)"> <view class="opera-list" @click="arrowUp(index)">
...@@ -128,6 +133,11 @@ export default { ...@@ -128,6 +133,11 @@ export default {
count() { count() {
return this.lists.length 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() { collectionFlag() {
const info = this.lists.find(v => v.index === this.arrIndex) const info = this.lists.find(v => v.index === this.arrIndex)
return info ? info.collectionFlag : false return info ? info.collectionFlag : false
...@@ -178,12 +188,13 @@ export default { ...@@ -178,12 +188,13 @@ export default {
search(val) { search(val) {
if (val){ if (val){
this.keyword = val this.keyword = val
let history = this.searchHistory let history = this.searchHistory.filter(v => v !== val)
history.unshift(val) history.unshift(val)
if (history.length > 9) { if (history.length > 9) {
history.splice(9, 1) history.splice(9, 1)
} }
this.$u.vuex('searchHistory', history) this.$u.vuex('searchHistory', history)
this.init()
} }
}, },
collection(item) { collection(item) {
......
...@@ -43,8 +43,7 @@ ...@@ -43,8 +43,7 @@
export default { export default {
data() { data() {
return { return {
keyword: '', keyword: ''
history: [],
} }
}, },
computed: { computed: {
...@@ -56,19 +55,20 @@ export default { ...@@ -56,19 +55,20 @@ export default {
deleteImg() { deleteImg() {
return process.uniEnv.qn_base_url + 'delete.png' return process.uniEnv.qn_base_url + 'delete.png'
}, },
}, history() {
created() { return this.searchHistory
this.history = this.searchHistory }
}, },
methods: { methods: {
search(val) { search(val) {
if (val){ if (val){
this.keyword = val this.keyword = val
this.history.unshift(val) let history = this.searchHistory.filter(v => v !== val)
if(this.history.length > 9){ history.unshift(val)
this.history.splice(9, 1) if(history.length > 9){
history.splice(9, 1)
} }
this.$u.vuex('searchHistory', this.history) this.$u.vuex('searchHistory', history)
this.toSearchDetail(val) this.toSearchDetail(val)
} }
}, },
...@@ -86,7 +86,6 @@ export default { ...@@ -86,7 +86,6 @@ export default {
content: '确认要清空搜索历史记录?', content: '确认要清空搜索历史记录?',
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
this.history = []
this.$u.vuex('searchHistory', []) this.$u.vuex('searchHistory', [])
} }
}, },
......
<template> <template>
<view class="u-td" :style="[tdStyle]"> <view class="u-td" :style="[tdStyle]">
<slot></slot> <slot></slot>
</view> </view>
</template> </template>
<script> <script>
/** /**
* td td单元格 * td td单元格
* @description 表格组件一般用于展示大量结构化数据的场景(搭配u-table使用) * @description 表格组件一般用于展示大量结构化数据的场景(搭配u-table使用)
* @tutorial https://www.uviewui.com/components/table.html#td-props * @tutorial https://www.uviewui.com/components/table.html#td-props
* @property {String Number} width 单元格宽度百分比或者具体带单位的值,如30%, 200rpx等,一般使用百分比,单元格宽度默认为均分tr的长度(默认auto) * @property {String Number} width 单元格宽度百分比或者具体带单位的值,如30%, 200rpx等,一般使用百分比,单元格宽度默认为均分tr的长度(默认auto)
* @example <u-td>二年级</u-td> * @example <u-td>二年级</u-td>
*/ */
export default { export default {
name: "u-td", name: 'u-td',
props: { props: {
// 宽度,百分比或者具体带单位的值,如30%, 200rpx等,一般使用百分比 // 宽度,百分比或者具体带单位的值,如30%, 200rpx等,一般使用百分比
width: { width: {
type: [Number, String], type: [Number, String],
default: 'auto' default: 'auto',
} },
}, },
data() { data() {
return { return {
tdStyle: { tdStyle: {},
}
} },
} created() {
}, this.parent = false
created() { },
this.parent = false; mounted() {
}, this.parent = this.$u.$parent.call(this, 'u-table')
mounted() { if (this.parent) {
this.parent = this.$u.$parent.call(this, 'u-table'); // 将父组件的相关参数,合并到本组件
if (this.parent) { let style = {}
// 将父组件的相关参数,合并到本组件 if (this.width != 'auto') style.flex = `0 0 ${this.width}`
let style = {}; style.textAlign = this.parent.align
if (this.width != "auto") style.flex = `0 0 ${this.width}`; style.fontSize = this.parent.fontSize + 'rpx'
style.textAlign = this.parent.align; style.padding = this.parent.padding
style.fontSize = this.parent.fontSize + 'rpx'; style.borderBottom = `solid 1px ${this.parent.borderColor}`
style.padding = this.parent.padding; style.borderRight = `solid 1px ${this.parent.borderColor}`
style.borderBottom = `solid 1px ${this.parent.borderColor}`; style.color = this.parent.color
style.borderRight = `solid 1px ${this.parent.borderColor}`; this.tdStyle = style
style.color = this.parent.color; }
this.tdStyle = style; },
} }
}
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "../../libs/css/style.components.scss"; @import '../../libs/css/style.components.scss';
.u-td { .u-td {
@include vue-flex; @include vue-flex;
flex-direction: column; flex-direction: column;
flex: 1; flex: 1;
justify-content: center; justify-content: center;
font-size: 28rpx; font-size: 28rpx;
color: $u-content-color; color: $u-content-color;
align-self: stretch; align-self: stretch;
box-sizing: border-box; box-sizing: border-box;
height: 100%; height: 100%;
} }
</style> </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