This commit is contained in:
zzyuan 2024-09-09 09:48:40 +08:00
commit ae381c832b
45 changed files with 2877 additions and 299 deletions

View File

@ -36,13 +36,14 @@ module.exports = {
uploadUrl: 'http://192.168.0.14:19999/exam-file/file/uploadBase64',
bmwUrl: 'http://192.168.0.14:19999/exam-bmw',
// 体检-基础路径
tjBaseUrl: 'http://192.168.0.14:20000/AppPeaManager',
// tjBaseUrl: 'http://192.168.0.14:20000/AppPeaManager',
tjBaseUrl: 'http://192.168.2.147:20000/AppPeaManager',
tjFile: 'http://112.29.103.165:1616/medicalDocumentation/statics/',
//实名制移动端-登录接口
realLoginUrl:'http://192.168.0.14:9200/',
//实名制移动端-移动
realAppUrl:'http://192.168.0.14:1913/app',
// 应用信息
appInfo: {
// 应用名称

67
main.js
View File

@ -7,11 +7,11 @@ import Vue from 'vue'
Vue.config.productionTip = false
// Vue.prototype.$api = $api
Vue.prototype.$store = store
Vue.prototype.$adpid = "1111111111"
Vue.prototype.$adpid = '1111111111'
Vue.prototype.$backgroundAudioData = {
playing: false,
playTime: 0,
formatedPlayTime: '00:00:00'
playing: false,
playTime: 0,
formatedPlayTime: '00:00:00'
}
import uView from '@/uni_modules/uview-ui'
@ -24,29 +24,56 @@ Vue.use(uView)
// const vconsole = require('vconsole')
// Vue.prototype.$vconsole = new vconsole() // 使用vconsole
Vue.prototype.$verificationToken = function () {
console.log('验证Token-->')
uni.request({
url: 'http://192.168.0.14:19999/exam-bmw/users/current',
method: 'get',
header: {
Authorization: uni.getStorageSync('access_token')
},
success: (res) => {
console.log('🚀 ~ res:', res)
let data = res.data
console.log('🚀 ~ res.data:', data)
if (data === '' || data === undefined) {
uni.showToast({
title: '已在其他设备登录,请重新登录',
icon: 'none'
})
uni.reLaunch({
url: '/pages/login'
})
}
},
fail: (err) => {
console.log('🚀 ~ err:', err)
}
})
}
App.mpType = 'app'
const app = new Vue({
store,
...App
store,
...App
})
app.$mount()
// #endif
// #ifdef VUE3
import {
createSSRApp
} from 'vue'
import { createSSRApp } from 'vue'
import { data } from 'uview-ui/libs/mixin/mixin';
export function createApp() {
const app = createSSRApp(App)
app.use(store)
app.config.globalProperties.$adpid = "1111111111"
app.config.globalProperties.$backgroundAudioData = {
playing: false,
playTime: 0,
formatedPlayTime: '00:00:00'
}
return {
app
}
const app = createSSRApp(App)
app.use(store)
app.config.globalProperties.$adpid = '1111111111'
app.config.globalProperties.$backgroundAudioData = {
playing: false,
playTime: 0,
formatedPlayTime: '00:00:00'
}
return {
app
}
}
// #endif

35
package-lock.json generated
View File

@ -3,6 +3,41 @@
"version": "3.4.5",
"lockfileVersion": 1,
"requires": true,
"packages": {
"": {
"name": "hello-uniapp",
"version": "3.4.5",
"license": "MIT",
"dependencies": {
"crypto-js": "^4.2.0",
"image-tools": "^1.4.0",
"luch-request": "^3.1.1"
}
},
"node_modules/@dcloudio/types": {
"version": "2.6.12",
"resolved": "https://registry.npmjs.org/@dcloudio/types/-/types-2.6.12.tgz",
"integrity": "sha512-mrCMwcINy1IFjU9VUqLeWBkj404yWs5paLDttBcA+eqUjanuUQbBcTVPqlrGgkyzLXDcV2oDDZRSNxNpXi4kMQ=="
},
"node_modules/crypto-js": {
"version": "4.2.0",
"resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.2.0.tgz",
"integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q=="
},
"node_modules/image-tools": {
"version": "1.4.0",
"resolved": "https://registry.npmmirror.com/image-tools/-/image-tools-1.4.0.tgz",
"integrity": "sha512-TKtvJ6iUwM0mfaD4keMnk1ENHFC470QEjBfA3IlvKdEOufzvWbjbaoNcoyYq6HlViF8+d5tOS1ooE6j7CHf1lQ=="
},
"node_modules/luch-request": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/luch-request/-/luch-request-3.1.1.tgz",
"integrity": "sha512-p7+mlcEtgRcd0OfXC4XZbyiwSr1XgCeqNT7LlVUjnk7InYl/8d5Rk7BUqAYNA2WRafI1wRIUQWRWZRpeUwWR0w==",
"dependencies": {
"@dcloudio/types": "^2.0.16"
}
}
},
"dependencies": {
"@dcloudio/types": {
"version": "2.6.12",

View File

@ -199,7 +199,43 @@
}
},
{
"path" : "pages/HealthExaminationApp/index/index",
"path": "pages/HealthExaminationApp/index/index",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/HealthExaminationApp/appointment/appointment",
"style": {
"navigationBarTitleText": "体检预约"
}
},
{
"path": "pages/HealthExaminationApp/report/report",
"style": {
"navigationBarTitleText": "体检报告"
}
},
{
"path": "pages/HealthExaminationApp/report/pdfView",
"style": {
"navigationBarTitleText": "体检报告"
}
},
{
"path": "pages/HealthExaminationApp/myAppointment/myAppointment",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/HealthExaminationApp/jobAppointment/jobAppointment",
"style": {
"navigationBarTitleText": "职业预约"
}
},
{
"path" : "pages/YNEduApp/index/notices",
"style" :
{
"navigationStyle": "custom"
@ -280,11 +316,7 @@
"navigationStyle": "custom"
}
},
{//
{//
"path": "pages/realName/workAttendance/index",
"style": {
"navigationStyle": "custom"
@ -295,7 +327,46 @@
"style": {
"navigationStyle": "custom"
}
}
},
{
"path" : "pages/YNEduApp/learnProj/imageStudy",
"style" :
{
"navigationBarTitleText" : "图片学习"
}
},
{
"path" : "pages/HealthExaminationApp/myAppointment/bookSuccessfully",
"style" :
{
"navigationBarTitleText" : "体检预约"
}
},
{
"path" : "pages/HealthExaminationApp/myAppointment/healthExamDetails",
"style" :
{
"navigationBarTitleText" : "体检预约单"
}
},
{
"path" : "pages/HealthExaminationApp/index/userInfo",
"style" :
{
"navigationBarTitleText" : "个人信息"
}
},
{
"path" : "pages/HealthExaminationApp/index/message",
"style" :
{
"navigationBarTitleText" : "消息通知"
}
}
],
"globalStyle": {
"fontFamily": "Helvetica, Arial, sans-serif",

View File

@ -1,19 +1,508 @@
<template>
<view>
体检预约
</view>
<view>
<div class="content">
<h3>选择医院</h3>
<div class="item" @click="show = true">
<div v-if="!hospital">点击选择医院</div>
<div v-else>{{ hospital }}</div>
<div><u-icon name="arrow-right"></u-icon></div>
</div>
<h3 style="margin-top: 20px">检查类型</h3>
<div class="item" @click="showPropup = true">
<div v-if="!checkType">点击选择检查类型</div>
<div v-else>{{ checkType }}</div>
<div><u-icon name="arrow-right"></u-icon></div>
</div>
<h3 style="margin-top: 20px">体检时间</h3>
<div class="item" @click="handleShowTime">
<div v-if="!healthTime">点击选择时间</div>
<div v-else>{{ healthTime }}</div>
<div><u-icon name="arrow-right"></u-icon></div>
</div>
</div>
<!-- 选择医院 -->
<u-picker
:show="show"
:columns="[hospitalList]"
keyName="hospitalName"
@cancel="show = false"
@confirm="confirmHospital"
></u-picker>
<!-- 检查类型 -->
<u-popup :show="showPropup" :round="10" mode="bottom" closeable @close="showPropup = false">
<div class="propup-content">
<h3>请选择套餐</h3>
<div class="title-wrapper">
<div class="title title-tip" v-if="!checkType">
<div>请选择</div>
<div class="line"></div>
</div>
<div v-else>
<div class="title">{{ checkType }}</div>
<div class="line"></div>
</div>
</div>
<div>
<div
class="list-item"
:class="{ active: active == index }"
v-for="(item, index) in checkTypeList"
:key="index"
@click="handleCheckType(item, index)"
>
{{ item.text }}
</div>
</div>
<div class="cont-title" v-if="checkTypeContent">
<div class="cont">{{ checkTypeContent }}</div>
<div v-if="showIcon" class="cont-icon" @click="showIcon = false">
<div style="margin-right: 3px">展开</div>
<div>
<u-icon name="arrow-down" color="#1989fa" size="16" />
</div>
</div>
<div v-else class="cont-icon" @click="showIcon = true">
<div style="margin-right: 3px">收起</div>
<div>
<u-icon name="arrow-up" color="#1989fa" size="16" />
</div>
</div>
</div>
<div class="cont-line"></div>
<div v-show="!showIcon" class="contList-wrapper">
<div class="contList-item" v-for="(item, index) in checkTypeContentList" :key="index">
<div class="cont-title">{{ item.combinName }}</div>
<div>项目内容{{ item.combinContent }}</div>
<div>
项目价格
<span style="color: red">{{ item.combinPrice }}</span>
</div>
</div>
</div>
<div class="btn" v-if="checkType">
<u-button type="primary" text="确认套餐" size="small" @click="showPropup = false"></u-button>
</div>
</div>
</u-popup>
<!-- 体检时间 -->
<u-calendar :show="showTime" mode="single" @confirm="confirmTime" @close="showTime = false"></u-calendar>
<div v-if="healthTime" class="reservation-number">当天剩余可预约人数{{ reservationNumber }}</div>
<div class="content" v-if="hospitalInfo.hospitalName">
<h3>医院信息</h3>
<div class="hospital-name">{{ hospitalInfo.hospitalName }}</div>
<div>地址: {{ hospitalInfo.address }}</div>
<div>营业时间: 周一至周五 {{ hospitalInfo.businessEnd }}-{{ hospitalInfo.businessHours }}</div>
<div>负责人: {{ hospitalInfo.responsible }}</div>
<div>联系方式: {{ hospitalInfo.telPhone }}</div>
</div>
<div style="margin: 30px 60px" v-if="hospital && checkType && healthTime && reservationNumber != 0">
<u-button type="primary" text="确定预约" shape="circle" size="small" @click="handleSave"></u-button>
</div>
</view>
</template>
<script>
export default {
data() {
return {
};
}
}
import config from '@/config'
import Crypoto from '@/utils/aescbc'
export default {
data() {
return {
token: uni.getStorageSync('tjToken'),
idcard: '',
active: null,
//
hospitalList: [],
//
hospital: '',
//
hospitalInfo: {},
//
healthTime: '',
show: false,
showTime: false,
columns: [],
showPropup: false,
setMealId: '',
//
checkType: '',
// -
checkTypeList: [],
// -
checkTypeContent: '',
checkTypeContentList: [],
showIcon: false,
reservationNumber: 0,
isDisabled: true
}
},
onLoad(opt) {
opt = JSON.parse(opt.params)
console.log('🚀 ~ onLoad ~ opt:', opt)
this.idcard = opt.idcard
},
mounted() {
this.getHospitalList()
this.getCheckType()
},
methods: {
// app/gethospital
getHospitalList() {
const cry = new Crypoto()
const params = {
token: this.token,
idcard: cry.encrypt(this.idcard)
}
console.log('🚀 ~ getHospitalList ~ params:', params)
uni.request({
url: config.tjBaseUrl + '/app/gethospital',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
token: this.token
},
success: res => {
res = res.data
console.log('🚀 ~ getHospitalList ~ res:', res)
if (res.res == 1) {
this.hospitalList = res.obj
// this.columns , pushcolumns
this.columns.push(this.hospitalList)
console.log('🚀 ~ getHospitalList ~ this.hospitalList:', this.hospitalList)
}
},
fail: err => {
console.log('🚀 ~ getHospitalList ~ err:', err)
}
})
},
//
getCheckType() {
const cry = new Crypoto()
const params = {
token: this.token,
idcard: cry.encrypt(this.idcard)
}
console.log('🚀 ~ getCheckType ~ params:', params)
uni.request({
url: config.tjBaseUrl + '/app/getPhysicalExamination',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
token: this.token
},
success: res => {
res = res.data
console.log('🚀 ~ getCheckType ~ res:', res)
if (res.res == 1) {
this.checkTypeList = res.obj
}
},
fail: err => {
console.log('🚀 ~ getCheckType ~ err:', err)
}
})
},
//
confirmHospital(e) {
console.log('🚀 ~ confirmHospital ~ e:', e)
this.hospital = e.value[0].hospitalName
this.hospitalInfo = e.value[0]
console.log('🚀 ~ confirmHospital ~ this.hospitalInfo:', this.hospitalInfo)
if (this.hospitalInfo.id) this.isDisabled = false
this.show = false
},
//
handleCheckType(item, index) {
console.log('🚀 ~ handleCheckType ~ item:', item)
this.active = index
this.checkType = item.text
this.getCheckTypeContent(item)
},
//
getCheckTypeContent(item) {
const params = {
token: this.token,
checkId: item.id,
combType: 2
}
console.log('🚀 ~ getCheckTypeContent ~ params:', params)
uni.request({
url: config.tjBaseUrl + '/app/getexamination',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
token: this.token
},
success: res => {
res = res.data
console.log('🚀 ~ getCheckTypeContent ~ res:', res)
if (res.res == 1) {
this.setMealId = res.obj.tibean[0].id
this.checkTypeContent = res.obj.tibean[0].combName
this.checkTypeContentList = res.obj.tibeanson
}
},
fail: err => {
console.log('🚀 ~ getCheckTypeContent ~ err:', err)
}
})
},
handleShowTime() {
if (this.isDisabled) {
uni.showToast({
title: '请选择医院',
icon: 'none'
})
} else {
this.showTime = true
}
},
getCurrentDate() {
const date = new Date()
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${year}-${month}-${day}`
},
//
confirmTime(e) {
console.log('🚀 ~ confirmTime ~ e:', e)
const today = this.getCurrentDate()
if (e[0] == today) {
uni.showToast({
title: '不可以预约今天',
icon: 'none'
})
return
}
this.healthTime = e[0]
this.showTime = false
this.getReservationNumber()
},
//
getReservationNumber() {
const params = {
token: this.token,
hosId: this.hospitalInfo.id,
phyAppontTime: this.healthTime,
type: '2'
}
console.log('🚀 ~ getReservationNumber ~ params:', params)
uni.request({
url: config.tjBaseUrl + '/app/getphyappointnum',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
token: this.token
},
success: res => {
res = res.data
console.log('🚀 ~ getReservationNumber ~ res:', res)
if (res.res == 1) {
this.reservationNumber = res.obj
}
},
fail: err => {
console.log('🚀 ~ getReservationNumber ~ err:', err)
}
})
},
// phyappoint
handleSave() {
const cry = new Crypoto()
const params = {
hospitalId: this.hospitalInfo.id,
setMealId: this.setMealId,
phyAppontTime: this.healthTime,
setMealType: '2',
combName: this.checkTypeContent,
// token: this.token
}
console.log('🚀 ~ handleSave ~ params:', params)
console.log('🚀 ~ handleSave ~ params:', cry.encrypt(JSON.stringify(params)))
uni.request({
url: config.tjBaseUrl + '/app/phyappoint',
method: 'post',
data: { encryptedData: cry.encrypt(JSON.stringify(params)), token: this.token },
// data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
token: this.token
},
success: res => {
res = res.data
console.log('🚀 ~ handleSave ~ res:', res)
if (res.res == 1) {
uni.setStorageSync('appoint', true)
uni.showToast({
title: '预约成功',
icon: 'success'
})
uni.reLaunch({
url: '/pages/HealthExaminationApp/myAppointment/bookSuccessfully'
})
}
},
fail: err => {
console.log('🚀 ~ handleSave ~ err:', err)
}
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
margin: 10px;
padding: 10px;
border-radius: 5px;
background: #fff;
h3 {
margin-bottom: 10px;
}
.hospital-wrapper {
/* display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center; */
margin-bottom: 20px;
}
.item {
padding: 0 15px;
width: calc(100% -30px);
height: 50px;
display: flex;
justify-content: space-between;
align-items: center;
background: #f5f5f5;
border-radius: 50px;
font-size: 14px;
}
.hospital-name {
font-weight: 600;
font-size: 16px;
color: #1989fa;
line-height: 35px;
}
}
.propup-content {
height: 500px;
padding: 20px;
.title-wrapper {
display: flex;
justify-content: flex-start;
align-items: center;
}
.title {
margin-top: 20px;
color: #333;
display: flex;
flex-direction: column;
align-items: center;
}
.title-tip {
color: #999;
}
.line {
margin: 10px 0;
width: 42px;
height: 2px;
background: #1989fa;
border-radius: 2px;
}
.list-item {
margin-right: 10px;
color: #333;
&.active {
color: #1989fa;
}
}
.cont-title {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 20px;
color: #1989fa;
font-size: 16px;
.cont-icon {
display: flex;
align-items: center;
}
}
.cont-line {
margin-top: 6px;
width: 100%;
height: 1px;
background: #ccc;
}
.contList-wrapper {
max-height: 300px;
overflow: auto;
}
.contList-item {
margin: 10px 0;
color: #333;
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
word-break: break-all;
overflow: auto;
.cont-title {
font-size: 16px;
color: #1989fa;
line-height: 30px;
}
}
.btn {
//
position: absolute;
bottom: 20px;
left: 20px;
/* width: 80px; */
}
}
.reservation-number {
height: 20px;
margin: 10px;
margin-top: 0;
padding: 10px;
color: #999;
background: #fff;
border-radius: 5px;
font-size: 15px;
/* text-align: start; */
}
</style>

View File

@ -1,6 +1,5 @@
<template>
<view>
<!-- <u-navbar title="首页" placeholder @leftClick="leftClick" /> -->
<div v-if="isShow">
<div class="top-swiper">
<div class="swiper">
@ -11,17 +10,55 @@
<div class="title">体检服务</div>
<div class="opt-list">
<div class="opt-item" v-for="(item, index) in optList" :key="index" @click="handlePage(item.url)">
<div class="opt-item" v-if="personnelType != 0" @click="handlePage(optList[0].url)">
<div class="item">
<u--image :showLoading="true" :src="item.src" width="70px" height="60px" />
<div class="name">{{ item.name }}</div>
<u--image :showLoading="true" :src="optList[0].src" width="70px" height="60px" />
<div class="name">{{ optList[0].name }}</div>
</div>
</div>
<div class="opt-item" v-if="status != 0" @click="handlePage(optList[1].url)">
<div class="item">
<u--image :showLoading="true" :src="optList[1].src" width="70px" height="60px" />
<div class="name">{{ optList[1].name }}</div>
</div>
</div>
<div class="opt-item" @click="handlePage(optList[2].url)">
<div class="item">
<u--image :showLoading="true" :src="optList[2].src" width="70px" height="60px" />
<div class="name">{{ optList[2].name }}</div>
</div>
</div>
<div class="opt-item" @click="handlePage(optList[3].url)">
<div class="item">
<u--image :showLoading="true" :src="optList[3].src" width="70px" height="60px" />
<div class="name">{{ optList[3].name }}</div>
</div>
</div>
</div>
</div>
<div v-else>
<div class="top-swiper">个人中心</div>
<div class="top-swiper avatar">
<u--image :showLoading="true" :src="avatar" shape="circle" width="120px" height="120px" />
<div style="margin-top: 20px; font-size: 18px">{{ userInfo.phyName }}</div>
</div>
<div class="user">
<div class="item" @click="handleUserInfo">
<u-icon name="/static/images-tijian/userInfo.png" size="16"></u-icon>
<div>个人信息</div>
</div>
<u-line color="#F2F2F2"></u-line>
<div class="item" @click="handleMsg">
<u-icon name="/static/images-tijian/message.png" size="16"></u-icon>
<div>消息通知</div>
</div>
<u-line color="#F2F2F2"></u-line>
<div class="item" @click="handleLogout">
<u-icon name="/static/images-tijian/logout.png" size="16"></u-icon>
<div>退出登录</div>
</div>
</div>
</div>
<!-- 底部导航 -->
@ -33,10 +70,15 @@
</template>
<script>
import config from '@/config'
import { decryptCBC } from '@/utils/aescbc'
export default {
data() {
return {
token: uni.getStorageSync('tjToken'),
isShow: true,
userInfo: {},
selectValue: 0,
homeIcon: '/static/images-tijian/home-selected.png',
myIcon: '/static/images-tijian/my-unselected.png',
@ -45,14 +87,24 @@ export default {
'/static/images-tijian/swiper-2.png',
'/static/images-tijian/swiper-3.png'
],
personnelType: '',
status: '',
optList: [
{ name: '体检预约', src: '/static/images-tijian/preOrder.png', url: 'appointment' },
{ name: '体检报告', src: '/static/images-tijian/report.png', url: 'report' },
{ name: '职业预约', src: '/static/images-tijian/careerExam.png', url: 'jobAppointment' },
{ name: '我的预约', src: '/static/images-tijian/myPreOrder.png', url: 'myAppointment' },
{ name: '职业预约', src: '/static/images-tijian/careerExam.png', url: 'jobAppointment' }
]
{ name: '体检报告', src: '/static/images-tijian/report.png', url: 'report' }
],
//
avatar:
'https://img.zcool.cn/community/0104c958b69c23a801219c77ba5da2.png?x-oss-process=image/auto-orient,1/resize,m_lfit,w_1280,limit_1/sharpen,100'
}
},
mounted() {
console.log('🚀 ~ mounted ~ mounted:', this.token)
this.getStatus()
this.getAppLoginInfo()
},
methods: {
changeTab(e) {
console.log('🚀 ~ changeTab ~ e:', e)
@ -63,8 +115,114 @@ export default {
},
//
handlePage(url) {
if (
(url == 'appointment' && uni.getStorageSync('appoint')) ||
(url == 'jobAppointment' && uni.getStorageSync('jobAppoint'))
) {
uni.showToast({
title: '您已经预约过,无法再次预约!',
icon: 'none'
})
return
}
uni.navigateTo({
url: `/pages/HealthExaminationApp/${url}/${url}`
url: `/pages/HealthExaminationApp/${url}/${url}?params=${JSON.stringify(this.userInfo)}`
})
},
//
getStatus() {
const params = {
token: this.token,
telephone: uni.getStorageSync('tjPhone')
}
console.log('🚀 ~ getStatus ~ params:', params)
uni.request({
url: config.tjBaseUrl + '/app/getStatus',
method: 'post',
data: params,
header: {
'content-type': 'application/x-www-form-urlencoded',
token: this.token
},
success: res => {
console.log('🚀 ~ getStatus ~ res:', res)
res = res.data
if (res.res === 1) {
this.personnelType = res.obj.personnelType || 0
this.status = res.obj.status
console.log('🚀 ~ getStatus ~ this.personnelType:', this.personnelType)
console.log('🚀 ~ getStatus ~ this.status:', this.status)
}
},
fail: err => {
console.log('🚀 ~ getStatus ~ err:', err)
}
})
},
// app
getAppLoginInfo() {
const params = {
token: this.token
}
console.log('🚀 ~ getapplogininfo ~ params:', params)
uni.request({
url: config.tjBaseUrl + '/app/getapplogininfo',
method: 'post',
data: params,
header: {
'content-type': 'application/x-www-form-urlencoded',
token: this.token
},
success: res => {
res = res.data
console.log('🚀 ~ getAppLoginInfo ~ res:', res)
if (res.res === 1) {
this.userInfo = res.obj[0]
this.userInfo.phyName = decryptCBC(this.userInfo.phyName)
this.userInfo.idcard = decryptCBC(this.userInfo.idcard)
this.userInfo.telepNumber = decryptCBC(this.userInfo.telepNumber)
console.log('🚀 ~ getAppLoginInfo ~ this.userInfo:', this.userInfo)
}
},
fail: err => {
console.log('🚀 ~ getapplogininfo ~ err:', err)
}
})
},
//
handleUserInfo() {
const params = {
name: this.userInfo.phyName,
idcard: this.userInfo.idcard,
age: this.userInfo.age,
sex: this.userInfo.sex == '0' ? '男' : '女',
phone: this.userInfo.telepNumber,
departName: this.userInfo.departName
}
console.log('🚀 ~ handleUserInfo ~ params:', params)
uni.navigateTo({
url: '/pages/HealthExaminationApp/index/userInfo?params=' + JSON.stringify(params)
})
},
//
handleMsg() {
uni.navigateTo({
url: '/pages/HealthExaminationApp/index/message'
})
},
// 退
handleLogout() {
uni.showModal({
title: '提示',
content: '确定退出登录吗?',
success: res => {
if (res.confirm) {
uni.removeStorageSync('tjToken')
uni.reLaunch({
url: '/pages/login'
})
}
}
})
}
}
@ -82,6 +240,12 @@ export default {
margin-top: 130px;
}
}
.avatar {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.title {
margin: 20px 10px;
@ -114,4 +278,22 @@ export default {
}
}
}
.user {
margin: 10px;
padding: 10px;
background: #fff;
border-radius: 5px;
.item {
display: flex;
align-items: center;
margin: 10px 0;
div {
margin-left: 10px;
font-size: 16px;
color: #333;
}
}
}
</style>

View File

@ -0,0 +1,111 @@
<template>
<view class="content">
<div class="cont-list" v-for="(item, index) in msgList" :key="index">
<div class="list-type">{{ item.ifCareerAppointText }}</div>
<div class="center-cont">
<div class="title">
{{ item.mealName }}
<span class="title-tip">{{ item.ifCancelText }}</span>
</div>
<div v-if="item.ifCancelText == '已取消'">您好您于{{ item.cancelTime }}取消了位于{{ item.hospitalName }}的体检特此通知</div>
</div>
</div>
</view>
</template>
<script>
import config from '@/config'
export default {
data() {
return {
msgList: []
}
},
mounted() {
this.getMessageList()
},
methods: {
//
getMessageList() {
uni.request({
url: config.tjBaseUrl + '/app/getmessage',
method: 'post',
data: {
token: uni.getStorageSync('tjToken')
},
header: {
'content-type': 'application/x-www-form-urlencoded',
token: this.token
},
success: res => {
res = res.data
console.log('🚀 ~ getMessageList ~ res:', res)
if (res.res === 1) {
this.msgList = res.obj
}
},
fail: err => {
console.log('🚀 ~ getMessageList ~ err:', err)
}
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
padding: 10px;
.cont-list {
margin: 10px 0;
display: flex;
justify-content: space-between;
align-items: center;
background: #fff;
border-radius: 5px;
margin-top: 10px;
.list-type {
padding: 10px;
width: 20px;
text-align: center;
font-size: 14px;
font-weight: bold;
white-space: pre-wrap;
word-break: break-all;
background: #9bc5c6;
color: #fff;
border-radius: 5px 0 0 5px;
}
.center-cont {
padding: 0 10px;
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
font-size: 14px;
color: #666;
.title {
font-size: 15px;
font-weight: bold;
color: red;
margin-bottom: 6px;
.title-tip {
padding: 3px;
font-size: 13px;
color: #fff;
margin-left: 10px;
background: #ff7026;
border-radius: 5px;
}
}
}
}
}
</style>

View File

@ -0,0 +1,62 @@
<template>
<view class="content">
<div class="item">
<div>姓名</div>
<div>{{ userInfo.name }}</div>
</div>
<div class="item">
<div>身份证号</div>
<div>{{ userInfo.idcard }}</div>
</div>
<div class="item">
<div>年龄</div>
<div>{{ userInfo.age }}</div>
</div>
<div class="item">
<div>性别</div>
<div>{{ userInfo.sex }}</div>
</div>
<div class="item">
<div>联系方式</div>
<div>{{ userInfo.phone }}</div>
</div>
<div class="item">
<div>部门</div>
<div>{{ userInfo.departName }}</div>
</div>
</view>
</template>
<script>
export default {
data() {
return {
userInfo: {}
}
},
onLoad(opt) {
opt = JSON.parse(opt.params)
console.log('🚀 ~ onLoad ~ opt:', opt)
this.userInfo = opt
}
}
</script>
<style lang="scss" scoped>
.content {
margin: 10px;
padding: 10px;
.item {
padding: 10px;
margin-bottom: 10px;
font-size: 16px;
height: 40px;
background: #fff;
border-radius: 5px;
display: flex;
justify-content: space-between;
align-items: center;
}
}
</style>

View File

@ -1,19 +1,413 @@
<template>
<view>
职业预约
</view>
<view>
<div class="content">
<h3>选择医院</h3>
<div class="item" @click="show = true">
<div v-if="!hospital">点击选择医院</div>
<div v-else>{{ hospital }}</div>
<div><u-icon name="arrow-right"></u-icon></div>
</div>
<h3 style="margin-top: 20px">职工套餐</h3>
<!-- <div class="item" @click="showPropup = true"> -->
<div class="item">
<div>{{ checkType }}</div>
<!-- <div v-if="!checkType">点击选择检查类型</div>
<div v-else>{{ checkType }}</div>
<div><u-icon name="arrow-right"></u-icon></div> -->
</div>
<h3 style="margin-top: 20px">体检时间</h3>
<div class="item" @click="handleShowTime">
<div v-if="!healthTime">点击选择时间</div>
<div v-else>{{ healthTime }}</div>
<div><u-icon name="arrow-right"></u-icon></div>
</div>
</div>
<!-- 选择医院 -->
<u-picker
:show="show"
:columns="[hospitalList]"
keyName="hospitalName"
@cancel="show = false"
@confirm="confirmHospital"
></u-picker>
<!-- 体检时间 -->
<u-calendar :show="showTime" mode="single" @confirm="confirmTime" @close="showTime = false"></u-calendar>
<div v-if="healthTime" class="reservation-number">当天剩余可预约人数{{ reservationNumber }}</div>
<div class="content" v-if="hospitalInfo.hospitalName">
<h3>医院信息</h3>
<div class="hospital-name">{{ hospitalInfo.hospitalName }}</div>
<div>地址: {{ hospitalInfo.address }}</div>
<div>营业时间: 周一至周五 {{ hospitalInfo.businessEnd }}-{{ hospitalInfo.businessHours }}</div>
<div>负责人: {{ hospitalInfo.responsible }}</div>
<div>联系方式: {{ hospitalInfo.telPhone }}</div>
</div>
<div style="margin: 30px 60px" v-if="hospital && checkType && healthTime && reservationNumber != 0">
<u-button type="primary" text="确定预约" shape="circle" size="small" @click="handleSave"></u-button>
</div>
</view>
</template>
<script>
export default {
data() {
return {
};
}
}
import config from '@/config'
import Crypoto from '@/utils/aescbc'
export default {
data() {
return {
token: uni.getStorageSync('tjToken'),
idcard: '',
active: null,
//
hospitalList: [],
//
hospital: '',
//
hospitalInfo: {},
//
healthTime: '',
show: false,
showTime: false,
columns: [],
showPropup: false,
checkId: '',
setMealId: '',
//
checkType: '',
// -
checkTypeList: [],
// -
checkTypeContent: '',
checkTypeContentList: [],
showIcon: false,
reservationNumber: 0,
isDisabled: true
}
},
onLoad(opt) {
opt = JSON.parse(opt.params)
console.log('🚀 ~ onLoad ~ opt:', opt)
this.idcard = opt.idcard
},
mounted() {
this.getHospitalList()
this.getCheckType()
},
methods: {
//
getHospitalList() {
const params = {
token: this.token,
}
console.log('🚀 ~ getHospitalList ~ params:', params)
uni.request({
url: config.tjBaseUrl + '/app/getOccupationHospital',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
token: this.token
},
success: res => {
res = res.data
console.log('🚀 ~ getHospitalList ~ res:', res)
if (res.res == 1) {
this.hospitalList = res.obj
// this.hospitalInfo = res.obj[0]
// this.columns , pushcolumns
this.columns.push(this.hospitalList)
console.log('🚀 ~ getHospitalList ~ this.hospitalList:', this.hospitalList)
}
},
fail: err => {
console.log('🚀 ~ getHospitalList ~ err:', err)
}
})
},
//
getCheckType() {
const params = {
token: this.token
}
console.log('🚀 ~ getCheckType ~ params:', params)
uni.request({
url: config.tjBaseUrl + '/app/getworkexamination',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
token: this.token
},
success: res => {
res = res.data
console.log('🚀 ~ getCheckType ~ res:', res)
if (res.res == 1) {
// this.checkTypeList = res.obj
this.checkType = res.obj.combName
this.setMealId = res.obj.id
}
},
fail: err => {
console.log('🚀 ~ getCheckType ~ err:', err)
}
})
},
//
confirmHospital(e) {
console.log('🚀 ~ confirmHospital ~ e:', e)
this.hospital = e.value[0].hospitalName
this.hospitalInfo = e.value[0]
console.log('🚀 ~ confirmHospital ~ this.hospitalInfo:', this.hospitalInfo)
if (this.hospitalInfo.id) this.isDisabled = false
this.show = false
},
handleShowTime() {
if (this.isDisabled) {
uni.showToast({
title: '请选择医院',
icon: 'none'
})
} else {
this.showTime = true
}
},
getCurrentDate() {
const date = new Date()
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${year}-${month}-${day}`
},
//
confirmTime(e) {
console.log('🚀 ~ confirmTime ~ e:', e)
const today = this.getCurrentDate()
if (e[0] == today) {
uni.showToast({
title: '不可以预约今天',
icon: 'none'
})
return
}
this.healthTime = e[0]
this.showTime = false
this.getReservationNumber()
},
//
getReservationNumber() {
const params = {
token: this.token,
hosId: this.hospitalInfo.id,
phyAppontTime: this.healthTime,
type: '2'
}
console.log('🚀 ~ getReservationNumber ~ params:', params)
uni.request({
url: config.tjBaseUrl + '/app/getphyappointnum',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
token: this.token
},
success: res => {
res = res.data
console.log('🚀 ~ getReservationNumber ~ res:', res)
if (res.res == 1) {
this.reservationNumber = res.obj
}
},
fail: err => {
console.log('🚀 ~ getReservationNumber ~ err:', err)
}
})
},
// phyappoint
handleSave() {
const cry = new Crypoto()
const params = {
hospitalId: this.hospitalInfo.id,
setMealId: this.setMealId,
checkId: '',
phyAppontTime: this.healthTime,
setMealType: '3',
combName: this.checkType,
// token: this.token
}
console.log('🚀 ~ handleSave ~ params:', params)
console.log('🚀 ~ handleSave ~ params:', cry.encrypt(JSON.stringify(params)))
uni.request({
url: config.tjBaseUrl + '/app/phyappoint',
method: 'post',
data: { encryptedData: cry.encrypt(JSON.stringify(params)), token: this.token },
// data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
token: this.token
},
success: res => {
res = res.data
console.log('🚀 ~ handleSave ~ res:', res)
if (res.res == 1) {
uni.setStorageSync('jobAppoint', true)
uni.showToast({
title: '预约成功',
icon: 'success'
})
uni.reLaunch({
url: '/pages/HealthExaminationApp/myAppointment/bookSuccessfully'
})
}
},
fail: err => {
console.log('🚀 ~ handleSave ~ err:', err)
}
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
margin: 10px;
padding: 10px;
border-radius: 5px;
background: #fff;
h3 {
margin-bottom: 10px;
}
.hospital-wrapper {
/* display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center; */
margin-bottom: 20px;
}
.item {
padding: 0 15px;
width: calc(100% -30px);
height: 50px;
display: flex;
justify-content: space-between;
align-items: center;
background: #f5f5f5;
border-radius: 50px;
font-size: 14px;
}
.hospital-name {
font-weight: 600;
font-size: 16px;
color: #1989fa;
line-height: 35px;
}
}
.propup-content {
height: 500px;
padding: 20px;
.title-wrapper {
display: flex;
justify-content: flex-start;
align-items: center;
}
.title {
margin-top: 20px;
color: #333;
display: flex;
flex-direction: column;
align-items: center;
}
.title-tip {
color: #999;
}
.line {
margin: 10px 0;
width: 42px;
height: 2px;
background: #1989fa;
border-radius: 2px;
}
.list-item {
margin-right: 10px;
color: #333;
&.active {
color: #1989fa;
}
}
.cont-title {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 20px;
color: #1989fa;
font-size: 16px;
.cont-icon {
display: flex;
align-items: center;
}
}
.cont-line {
margin-top: 6px;
width: 100%;
height: 1px;
background: #ccc;
}
.contList-wrapper {
max-height: 300px;
overflow: auto;
}
.contList-item {
margin: 10px 0;
color: #333;
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
word-break: break-all;
overflow: auto;
.cont-title {
font-size: 16px;
color: #1989fa;
line-height: 30px;
}
}
.btn {
//
position: absolute;
bottom: 20px;
left: 20px;
/* width: 80px; */
}
}
.reservation-number {
height: 20px;
margin: 10px;
margin-top: 0;
padding: 10px;
color: #999;
background: #fff;
border-radius: 5px;
font-size: 15px;
/* text-align: start; */
}
</style>

View File

@ -0,0 +1,51 @@
<template>
<view>
<div class="img"></div>
<h2 style="text-align: center">恭喜您预约成功</h2>
<div class="btn">
<u-button
type="primary"
shape="circle"
text="返回首页"
plain
style="margin-bottom: 10px"
@click="handleBack"
></u-button>
<u-button type="primary" shape="circle" text="查看预约" @click="handleSee"></u-button>
</div>
</view>
</template>
<script>
export default {
data() {
return {}
},
methods: {
handleBack() {
uni.reLaunch({
url: '/pages/HealthExaminationApp/index/index'
})
},
handleSee() {
uni.reLaunch({
url: '/pages/HealthExaminationApp/myAppointment/myAppointment'
})
}
}
}
</script>
<style lang="scss" scoped>
.img {
margin: 130px auto 0;
width: 344px;
height: 247px;
background: url('/static/images-tijian/success.png') no-repeat;
background-size: 100% 100%;
}
.btn {
margin: 20px 80px;
}
</style>

View File

@ -0,0 +1,105 @@
<template>
<view>
<div class="content">
<h2 style="text-align: center">体检单据</h2>
<div class="title">套餐名称:</div>
<div>{{ combName }}</div>
<div class="title">体检项目:</div>
<div>{{ combItem }}</div>
<div class="title">体检内容:</div>
<div v-for="(item, index) in combContent" :key="index">
<div class="item-content">
<div style="width: 240px">{{ item.mealName }}{{ item.mealContent }}</div>
<div style="color: red; margin-left: 15px">{{ item.mealPrice }} </div>
</div>
<u-line dashed style="margin-bottom: 10px"></u-line>
</div>
<div class="title" style="color: red">体检总价{{ totalPrice }} </div>
</div>
</view>
</template>
<script>
import config from '@/config'
export default {
data() {
return {
token: '',
cancelId: '',
//
combName: '',
//
combItem: '',
//
combContent: [],
//
totalPrice: 0
}
},
onLoad(opt) {
opt = JSON.parse(opt.params)
this.combName = opt.combName
this.cancelId = opt.id
console.log('🚀 ~ onLoad ~ onLoad', opt)
this.token = uni.getStorageSync('tjToken')
},
mounted() {
this.getDetail()
},
methods: {
//
getDetail() {
const params = {
cancelId: String(this.cancelId),
token: this.token
}
console.log('🚀 ~ getDetail ~ params:', params)
uni.request({
url: config.tjBaseUrl + '/app/getcontentByid',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
token: this.token
},
success: res => {
res = res.data
console.log('🚀 ~ getDetail ~ res:', res)
if (res.res == 1) {
this.combContent = res.obj
this.combItem = res.obj.map(item => item.mealName).join('、')
this.totalPrice = res.obj.reduce((total, item) => total + Number(item.mealPrice), 0)
}
}
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
margin: 10px;
padding: 10px;
background: #fff;
border-radius: 5px;
.title {
font-size: 16px;
font-weight: bold;
color: #333;
line-height: 2.5;
}
.item-content {
display: flex;
justify-content: space-between;
margin-bottom: 10px;
word-break: break-all;
}
}
</style>

View File

@ -1,19 +1,278 @@
<template>
<view>
我的预约
</view>
<div>
<u-navbar title="我的预约" @leftClick="leftClick" placeholder></u-navbar>
<div class="content">
<div class="item-wrapper">
<div class="item" @click="show = true">
<div v-if="!makeStatus">请选择体检状态</div>
<div v-else>{{ makeStatus }}</div>
<div><u-icon name="arrow-right"></u-icon></div>
</div>
<div class="btn">
<u-button type="primary" text="查询" @click="handleQuery"></u-button>
</div>
</div>
<u-picker :show="show" :columns="columns" keyName="label" @close="show = false" @confirm="handleSearch"></u-picker>
<div class="tip">提示向左滑动取消预约</div>
<u-swipe-action class="swipe-wrapper">
<u-swipe-action-item
class="swipe-item"
:options="options"
v-for="(item, index) in makeList"
:key="index"
:disabled="item.ifCancel != 2"
@click="handleDelete(item)"
>
<div class="swipe-action" @click="handleOption(item)">
<div class="item-icon">
<u-icon
v-if="item.ifCancel == 1 || item.ifCancel == 4"
name="/static/images-tijian/isCanceled.png"
size="120"
></u-icon>
<u-icon v-else-if="item.ifCancel == 2" name="/static/images-tijian/readyExam.png" size="120"></u-icon>
<u-icon v-else name="/static/images-tijian/isExamed.png" size="120"></u-icon>
</div>
<div class="item-cont">
<div class="hospital-name">{{ item.hospitalName }}</div>
<div class="combName">
<div>{{ item.combName }}</div>
<div style="color: red">{{ item.setMealPrice || '0.0' }}</div>
</div>
<div>预约时间{{ item.phyAppontTime }}</div>
</div>
</div>
</u-swipe-action-item>
</u-swipe-action>
</div>
</div>
</template>
<script>
export default {
data() {
return {
};
}
}
import config from '@/config'
import Crypoto from '@/utils/aescbc'
export default {
data() {
return {
token: '',
show: false,
columns: [
[
{ label: '全部', value: 4 },
{ label: '已取消', value: 1 },
{ label: '待体检', value: 2 },
{ label: '已体检', value: 3 }
]
],
//
makeStatus: '',
makeStatusValue: 4,
//
makeList: [],
//
allList: [],
//
canceledList: [],
//
readyList: [],
//
examList: [],
isDisabled: false,
options: [
{
text: '取消',
style: {
backgroundColor: '#f56c6c'
}
}
]
}
},
created() {
this.token = uni.getStorageSync('tjToken')
},
mounted() {
this.getList()
},
methods: {
handleSearch(e) {
console.log('🚀 ~ handleSearch ~ e:', e)
this.makeStatus = e.value[0].label
this.makeStatusValue = e.value[0].value
this.show = false
},
handleQuery(){
if (this.makeStatusValue == 4) {
this.makeList = this.allList
} else if (this.makeStatusValue == 1) {
this.makeList = this.canceledList
} else if (this.makeStatusValue == 2) {
this.makeList = this.readyList
} else if (this.makeStatusValue == 3) {
this.makeList = this.examList
}
},
// getpersonappointInfo
getList() {
console.log('🚀 ~ 列表 ~ this.token:', this.token)
uni.request({
url: config.tjBaseUrl + '/app/getpersonappointInfo',
method: 'post',
data: this.token,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
token: this.token
},
success: res => {
res = res.data
console.log('🚀 ~ 列表 ~ res:', res)
if (res.res == 1) {
this.makeList = this.allList = res.obj
this.canceledList = res.obj.filter(item => item.ifCancel == 1)
this.readyList = res.obj.filter(item => item.ifCancel == 2)
this.examList = res.obj.filter(item => item.ifCancel == 3)
}
},
fail: err => {
console.log('🚀 ~ 列表 ~ err:', err)
}
})
},
// - cancelpoint
handleDelete(item) {
const cry = new Crypoto()
console.log('🚀 ~ handleDelete ~ item:', item)
const params = {
cancelId: cry.encrypt(item.id),
mealType: item.setMealType,
token: this.token
}
//
uni.showModal({
title: '提示',
content: '确认取消预约吗?',
success: res => {
console.log('🚀 ~ handleDelete ~ res:', res)
if (res.confirm) {
uni.request({
url: config.tjBaseUrl + '/app/cancelpoint',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
token: this.token
},
success: res => {
res = res.data
console.log('🚀 ~ 取消预约 ~ res:', res)
if (res.res == 1) {
if (item.setMealType == '2') {
uni.removeStorageSync('appoint')
} else if (item.setMealType == '3') {
uni.removeStorageSync('jobAppoint')
}
// -
uni.redirectTo({
url: '/pages/HealthExaminationApp/myAppointment/myAppointment'
})
}
},
fail: err => {
console.log('🚀 ~ 列表 ~ err:', err)
}
})
}
},
fail: err => {
console.log('🚀 ~ handleDelete ~ err:', err)
}
})
},
//
handleOption(item) {
console.log('🚀 ~ handleOption ~ item:', item)
const params = {
id: item.id,
combName: item.combName
}
console.log('🚀 ~ handleOption ~ params:', params)
uni.navigateTo({
url: '/pages/HealthExaminationApp/myAppointment/healthExamDetails?params=' + JSON.stringify(params)
})
},
leftClick() {
uni.reLaunch({
url: '/pages/HealthExaminationApp/index/index'
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
padding: 10px;
}
.item-wrapper {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
.item {
padding: 0 15px;
width: calc(100vw - 100px);
height: 50px;
display: flex;
justify-content: space-between;
align-items: center;
background: #f5f5f5;
border-radius: 50px;
font-size: 14px;
margin-right: 10px;
}
.btn {
width: 50px;
}
}
.tip {
margin-left: 10px;
margin-bottom: 20px;
color: #999;
font-size: 15px;
}
.swipe-item {
border-radius: 5px;
margin: 10px 0;
.swipe-action {
padding: 10px;
border-radius: 5px;
word-break: break-all;
.item-icon {
//
position: absolute;
top: -42px;
left: -36px;
}
.item-cont {
margin-left: 50px;
.hospital-name {
font-size: 15px;
font-weight: bold;
line-height: 1.5;
}
.combName {
display: flex;
justify-content: space-between;
}
}
}
}
</style>

View File

@ -0,0 +1,104 @@
<template>
<view class="content">
<web-view :src="url" @message="handlePostMessage"></web-view>
</view>
</template>
<script>
/* uni
* https://ask.dcloud.net.cn/article/35083
* 组件使用pdf.js源码修改了部分内容
* 只需要完成web-view监听页数并与uni通信即可
* @kklxx 2022/12/09修复组件通信
*/
import { computed } from 'vue'
export default {
// props: {
// path: {
// type: String,
// default: ''
// }
// },
data() {
return {
viewerUrl: '/hybrid/html/web/viewer.html', // html hybrid/html
fileUrl: '', // 访pdf
url: '', // web-view
currentPage: 1, //
totalPage: 0, //
currentReadPage: 0 //
}
},
onLoad(opt) {
console.log('页面信息:', opt)
this.fileUrl = opt.path
// /* */
// uni.setNavigationBarTitle({
// title: 'PDF'
// })
// /* */
// this.pageInt() //pdfs
},
mounted() {
console.log('mounted-pdfView', this.path)
/* H5页面通信方式 */
// #ifdef H5
window.addEventListener('message', this.ReceiveMessage)
// #endif
// this.fileUrl = this.path
/* 设置标题 */
uni.setNavigationBarTitle({
title: 'PDF预览'
})
/* 初始页面 */
this.pageInt() //pdfs
},
//
beforeDestroy() {
uni.removeStorage({
//pdfpdf
key: 'pdfjs.history',
success() {
// console.log("removeStorage", res)
}
})
},
methods: {
//
pageInt() {
this.url = `${this.viewerUrl}?file=${encodeURIComponent(this.fileUrl)}&page=` + this.currentPage
},
/*
* 做成监听滚动条判断更好
*
*/
//uni
handlePostMessage(data) {
let arr = data.detail.data.pop()
this.totalPage = arr[0].totalPage //
this.currentReadPage = arr[1].page //
console.log('app:', this.totalPage, this.currentReadPage)
},
//h5
ReceiveMessage(event) {
if (event.data && event.data.data && event.data.data.arg) {
this.totalPage = event.data.data.arg[0].totalPage
this.currentReadPage = event.data.data.arg[1].page + 1
}
console.log('app:', this.totalPage, this.currentReadPage)
},
//
addBrowseRecord() {
// console.log("",this.totalPage);
// console.log("",this.currentReadPage);
}
}
}
</script>
<style lang="scss" scoped></style>

View File

@ -1,19 +1,231 @@
<template>
<view>
提交报告
</view>
<view>
<div class="content">
<u-search
placeholder="查找报告"
v-model="keyword"
clearabled
:showAction="false"
@clickIcon="handleSearch"
></u-search>
<div class="cont-wrapper">
<div class="cont-title">请选择体检年度</div>
<div class="cont-item" @click="showData = true">
<div>{{ year }}</div>
<u-icon name="arrow-right" size="13"></u-icon>
</div>
<div class="cont-item" @click="showType = true">
<div v-if="type">{{ type }}</div>
<div v-else style="color: #999">体检类型</div>
<u-icon name="arrow-right" size="13"></u-icon>
</div>
</div>
<div class="cont-list" v-for="(item, index) in contList" :key="index">
<div class="list-type">{{ item.fixedValue }}</div>
<div class="center-cont">
<div class="title">{{ item.mealName }}</div>
<div>{{ item.createTime }}</div>
</div>
<div class="btn">
<u-button type="primary" shape="circle" text="查看报告" @click="handleSeeReport(item)"></u-button>
</div>
</div>
</div>
<u-picker :show="showData" :columns="dataColumns" @cancel="showData = false" @confirm="handleData"></u-picker>
<u-picker
:show="showType"
:columns="typeColumns"
keyName="label"
@cancel="showType = false"
@confirm="handleType"
></u-picker>
</view>
</template>
<script>
export default {
data() {
return {
};
}
}
import config from '@/config'
import Crypoto from '@/utils/aescbc'
export default {
data() {
return {
isShow: true,
token: '',
keyword: '',
//
year: new Date().getFullYear(),
//
type: '',
typeValue: '',
showData: false,
showType: false,
dataColumns: [],
typeColumns: [
[
{ label: '全部', value: '' },
{ label: '普通体检', value: 0 },
{ label: '职业体检', value: 1 }
]
],
contList: [],
pdfPath: ''
}
},
mounted() {
this.token = uni.getStorageSync('tjToken')
this.year = new Date().getFullYear()
console.log('🚀 ~ mounted ~ year:', this.year)
let arr = []
for (let i = 0; i < 10; i++) {
arr.push(this.year - i)
}
this.dataColumns = [arr]
console.log('🚀 ~ mounted ~ this.dataColumns:', this.dataColumns)
this.getList()
},
methods: {
//
handleSearch() {
console.log('🚀 ~ handleSearch ~ this.keyword:', this.keyword)
this.getList()
},
//
handleData(e) {
console.log('🚀 ~ handleData ~ this.year:', e)
this.year = e.value[0]
this.getList()
this.showData = false
},
//
handleType(e) {
console.log('🚀 ~ handleType ~ this.type:', e)
this.type = e.value[0].label
this.typeValue = e.value[0].value
this.getList()
this.showType = false
},
//
getList() {
const cry = new Crypoto()
const params = {
name: cry.encrypt(this.keyword),
data: this.year,
type: cry.encrypt(this.typeValue),
token: this.token
}
console.log('🚀 ~ getList ~ params:', params)
uni.request({
url: config.tjBaseUrl + '/app/getpackageBid',
method: 'get',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
token: this.token
},
success: res => {
res = res.data
console.log('🚀 ~ 列表 ~ res:', res)
if (res.res == 1) {
this.contList = res.obj
}
},
fail: err => {
console.log('🚀 ~ 列表 ~ err:', err)
}
})
},
//
handleSeeReport(item) {
console.log('🚀 ~ handleSeeReport ~ item:', item)
this.pdfPath = config.tjFile + item.physicalAddress
//
uni.navigateTo({
url: `/pages/HealthExaminationApp/report/pdfView?path=${this.pdfPath}`
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
margin: 10px;
padding: 10px;
.cont-wrapper {
display: flex;
justify-content: space-between;
align-content: center;
padding: 10px 0;
.cont-title {
height: 40px;
line-height: 40px;
font-size: 15px;
font-weight: bold;
text-align: center;
}
.cont-item {
padding: 0 5px;
width: 28%;
height: 40px;
display: flex;
justify-content: space-between;
align-items: center;
background: #fff;
border-radius: 40px;
}
}
.cont-list {
margin: 10px 0;
display: flex;
justify-content: space-between;
align-items: center;
background: #fff;
border-radius: 5px;
margin-top: 10px;
.list-type {
padding: 10px;
width: 20px;
text-align: center;
font-size: 14px;
font-weight: bold;
white-space: pre-wrap;
word-break: break-all;
background: #9bc5c6;
color: #fff;
border-radius: 5px 0 0 5px;
}
.center-cont {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-size: 14px;
color: #666;
.title {
font-size: 15px;
font-weight: bold;
color: #333;
margin-bottom: 15px;
}
}
.btn {
margin-right: 10px;
width: 80px;
text-align: center;
}
}
}
</style>

View File

@ -21,7 +21,7 @@
</div>
</div>
<div class="explain">*进入考试后计时结束将自动交卷退出后将会继续计时</div>
<div class="explain">*进入考试后计时结束将自动交卷退出后将会继续计时考试期间请勿登录其他设备否则成绩作废</div>
<!-- 底部固定按钮 -->
<div class="bottom-btn">
@ -62,7 +62,7 @@ export default {
content: '是否确认进入考试?',
examId: '',
examNum: 0, //
examCount: 1, // 1: 2: 3:
examCount: '', // 1: 2: 3:
examCustom: 0, //
score: 0,
passScore: 0
@ -75,6 +75,10 @@ export default {
this.title = opt.name
this.subtitle = opt.validityDate
this.duration = opt.responseTime
this.examNum = opt.examNum
this.count = opt.examCount === 1 ? '不限次' : opt.examCount === 2 ? '及格终止' : opt.examCustom
this.examCount = opt.examCount
this.examCustom = opt.examCustom
this.switchCount = opt.cutNum.includes('null') || opt.cutNum.includes('undefined') ? '不限次' : opt.cutNum
this.studyId = opt.studyId
this.score = opt.score

View File

@ -85,6 +85,7 @@ export default {
// this.allList = this.list = res.data
// this.waitList = res.data.filter(item => item.status === 1)
// this.alreadyList = res.data.filter(item => item.status === 2)
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/personalCenter/getStudentExamList',
method: 'post',
@ -95,11 +96,13 @@ export default {
},
success: res => {
console.log('🚀 ~ getList ~ res:', res)
this.activeIndex = 0
res = res.data
this.list = this.allList
this.allList = this.list = res.data
this.waitList = res.data.filter(item => item.status === 1)
this.alreadyList = res.data.filter(item => item.status === 2)
this.absentList = res.data.filter(item => item.status === 3 && item.examNum === 0)
},
fail: err => {
console.log(err)
@ -121,6 +124,19 @@ export default {
//
handleExamination(item) {
console.log('🚀 ~ handleExamination ~ item:', item)
// item.validityDate 2021-09-01~2021-09-30 ,
const date = new Date()
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const today = `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}`
if (today < item.validityDate.split('~')[0] || today > item.validityDate.split('~')[1]) {
uni.showToast({
title: '当前时间不在考试时间范围内',
icon: 'none'
})
return
}
if (item.examEquipment == 2) {
uni.showToast({
title: '请在电脑端进行考试',
@ -151,7 +167,7 @@ export default {
examNum: item.examNum, //
examCount: item.examCount, //
examCustom: item.examCustom, //
score: item.score, //
score: item.score, //
passScore: item.passScore //
}
uni.navigateTo({

View File

@ -66,15 +66,24 @@
@click="clickImg(fileUrl + item.examTopicUrl)"
/>
<div class="options">
<div
class="option"
v-for="(option, optionIndex) in item.listOption"
:key="optionIndex"
:class="{ isActive: option.isActive }"
@click="handleSelectOption(item, index, option, optionIndex)"
>
<div class="option-item">{{ option.optionIdent }}.</div>
<div class="option-content">{{ option.optionContent }}</div>
<div class="option-wrapper" v-for="(option, optionIndex) in item.listOption" :key="optionIndex">
<div
class="option"
:class="{ isActive: option.isActive }"
@click="handleSelectOption(item, index, option, optionIndex)"
>
<div class="option-item">{{ option.optionIdent }}.</div>
<div class="option-content">{{ option.optionContent }}</div>
</div>
<u--image
v-if="option.optionUrl"
:showLoading="true"
:src="fileUrl + option.optionUrl || ''"
width="60px"
height="60px"
style="margin-bottom: 10px"
@click="clickImg(fileUrl + option.optionUrl)"
/>
</div>
</div>
</div>
@ -130,6 +139,7 @@ import config from '@/config'
export default {
data() {
return {
isLoading: false,
// id
examId: '',
// id
@ -144,7 +154,6 @@ export default {
examTime: 0,
random1: 0,
random2: 0,
hasScanned: false,
//
answerTime: 0,
currentIndex: 0,
@ -192,16 +201,14 @@ export default {
onHide() {
// this.screenCount++
// console.log('🚀 ~ onHide ~ this.screenCount:', this.screenCount)
if (!this.isHide) {
this.handleConfirmSubmit()
}
setTimeout(() => {
if (!this.isHide) {
this.handleConfirmSubmit()
}
}, 500)
},
mounted() {
this.getList()
this.random1 = Math.ceil(Math.random() * 100000) + 420000 // random1 7-13
// this.random1 = 10000
this.random2 = Math.ceil(Math.random() * 100000) + 900000 // random2 15-19
console.log('🚀 ~ mounted ~ this.random1:', this.random1, this.random2)
},
// onUnload() {
// console.log('🚀 ~ onUnload ~ ')
@ -214,14 +221,7 @@ export default {
const params = {
examId: this.examId
}
// const res = await getExamQuestionList(params)
// const data = res.data
// this.questionList = data.examPaperData
// this.recordId = data.recordId
// this.examTime = data.answerTime
// this.time = Number(data.answerTime) * 60 * 1000
// console.log('🚀 ~ getList ~ this.time:', this.time)
// console.log('🚀 ~ getList ~ res:', res)
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/studentExam/getExamQuestionList',
method: 'post',
@ -240,6 +240,9 @@ export default {
this.time = Number(data.answerTime) * 60 * 1000
console.log('🚀 ~ getList ~ this.time:', this.time)
console.log('🚀 ~ getList ~ this.questionList:', this.questionList)
this.random1 = (data.answerTime / 3) * 60 + Math.ceil(Math.random() * 20) + 20
this.random2 = (data.answerTime / 2) * 60 + Math.ceil(Math.random() * 30) + 30
console.log('🚀 ~ getList ~ this.random1:', this.random1, this.random2)
if (this.questionList.length > 0) {
this.questionList.forEach((item, index) => {
this.$set(item, 'isShow', index < 7)
@ -267,20 +270,27 @@ export default {
changeCountDown(time) {
// console.log('🚀 ~ changeCountDown ~ time:', time)
//
if (this.time == 0) return
if (this.time == 0 && !this.isLoading) return
this.answerTime =
this.time - (time.days * 24 * 60 * 60 + time.hours * 60 * 60 + time.minutes * 60 + time.seconds) * 1000
// console.log('🚀 ~ changeCountDown ~ this.answerTime:', this.answerTime)
if (this.answerTime > this.random1 && this.answerTime < this.random2 && !this.hasScanned) {
this.openFaceScan() // Android
// this.openPhotograph() // IOS
this.hasScanned = true
} else if (this.answerTime > this.random2 && this.hasScanned) {
this.openFaceScan()
// this.openPhotograph()
this.hasScanned = false
}
if (this.answerTime == this.time) {
console.log(
'🚀 ~ changeCountDown ~ this.answerTime:',
this.time,
this.answerTime / 1000,
this.random1,
this.random2
)
console.log('🚀 ~ changeCountDown ~:', this.answerTime / 1000 == this.random1)
console.log('🚀 ~ changeCountDown ~:', this.answerTime / 1000 == this.random2)
if (this.answerTime / 1000 == this.random1) {
console.log('🚀 ~ changeCountDown ~ 人脸识别')
// this.openFaceScan() // Android
this.openPhotograph() // IOS
} else if (this.answerTime / 1000 == this.random2) {
// this.openFaceScan()
this.openPhotograph()
} else if (this.answerTime == this.time) {
// : ,
this.$refs.uToast.show({
message: '考试时间结束, 系统将自动提交',
@ -336,8 +346,12 @@ export default {
questionId: item.id,
selectAnswer
}
if (item.examType == 3) {
params.selectAnswer = selectAnswer == 'A' ? '对' : '错'
}
console.log('🚀 ~ handleSelectOption ~ params:', params)
// insertQuestionAnswerById(params)
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/studentExam/insertQuestionAnswerById',
method: 'post',
@ -345,6 +359,9 @@ export default {
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('access_token')
},
success: res => {
console.log('🚀 ~ handleSelectOption ~ res:', res)
}
})
},
@ -354,6 +371,15 @@ export default {
},
//
handleConfirmSubmit() {
console.log('🚀 ~ 提交-->', this.isLoading)
if (this.isLoading) {
uni.showToast({
title: '正在提交中, 请稍后',
icon: 'none'
})
return
}
this.isLoading = true
//
this.$refs.countDown.pause()
const params = {
@ -364,6 +390,7 @@ export default {
answerTime: Math.ceil(this.answerTime / 60000)
}
// const res = await commitExamByRecordId(params)
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/studentExam/commitExamByRecordId',
method: 'post',
@ -375,7 +402,6 @@ export default {
success: res => {
console.log('🚀 ~ handleConfirmSubmit ~ res:', res)
res = res.data
this.showConfirmModal = false
const params2 = {
examId: this.examId,
examGrade: res.examGrade,
@ -385,7 +411,7 @@ export default {
examTime: this.examTime,
questionCount: this.questionList.length,
switchCount: this.switchCount,
examNum: this.examNum,
examNum: this.examNum + 1,
examCount: this.examCount,
examCustom: this.examCustom,
results: res.examResult,
@ -396,6 +422,9 @@ export default {
uni.navigateTo({
url: `/pages/YNEduApp/exam/examinationDetails?params=${JSON.stringify(params2)}`
})
setTimeout(() => {
this.showConfirmModal = false
}, 1000)
}
})
if (this.studyId) {
@ -424,18 +453,18 @@ export default {
// })
},
//
async openFaceScan() {
face.open(['a'], e => {
console.log('🚀 ~ e-人脸识别:', e)
face.close()
let params = {
userId: uni.getStorageSync('userId'),
img: e
}
params = JSON.stringify(params)
this.getFaceRecognition(params)
})
},
// async openFaceScan() {
// face.open(['a'], e => {
// console.log('🚀 ~ e-:', e)
// face.close()
// let params = {
// userId: uni.getStorageSync('userId'),
// img: e
// }
// params = JSON.stringify(params)
// this.getFaceRecognition(params)
// })
// },
//
openPhotograph() {
this.isHide = true
@ -450,7 +479,7 @@ export default {
this.imgToBase64(res.tempFilePaths[0]).then(base64 => {
url = base64
console.log('🚀 ~ this.imgToBase64 ~ base64:', url)
this.getFaceRecognition(url)
this.getFaceRecognition({ userId: uni.getStorageSync('userId'), img: url })
})
},
fail: err => {
@ -473,6 +502,8 @@ export default {
},
//
getFaceRecognition(params) {
console.log('🚀 ~ getFaceRecognition ~ params:', params)
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/personalCenter/getFaceRecognition',
method: 'POST',
@ -482,8 +513,9 @@ export default {
},
data: params,
success: res => {
console.log('🚀 ~ openFaceScan ~ res-人脸识别:', res)
res = res.data
console.log('🚀 ~ openFaceScan ~ res-人脸识别:', res, res.code)
console.log('🚀 ~ openFaceScan ~ res-人脸识别:', res.code)
if (res.code == 200) {
this.$refs.uToast.show({
message: '人脸识别成功',
@ -501,6 +533,10 @@ export default {
},
fail(err) {
console.log('🚀 ~ openFaceScan ~ 人脸识别失败', err)
this.$refs.uToast.show({
message: err.errMsg,
duration: 1000
})
}
})
},
@ -512,6 +548,7 @@ export default {
// this.screenCount--
},
updStudyDurationExamPractice(params) {
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/student/updStudyDurationExamPractice',
method: 'post',
@ -620,27 +657,32 @@ export default {
}
.options {
margin-top: 10px;
.option {
display: flex;
justify-content: flex-start;
align-items: center;
margin-top: 10px;
background: #f4f9fe;
border-radius: 5px;
&.isActive {
background: #8cbff1;
color: #fff;
}
.option-item {
width: 33px;
height: 33px;
line-height: 33px;
text-align: center;
color: #333;
}
.option-content {
margin-left: 10px;
color: #333;
margin-bottom: 30px;
.option-wrapper {
max-height: 500px;
overflow: auto;
.option {
display: flex;
justify-content: flex-start;
align-items: center;
margin-top: 10px;
background: #f4f9fe;
border-radius: 5px;
&.isActive {
background: #8cbff1;
color: #fff;
}
.option-item {
width: 33px;
height: 33px;
line-height: 33px;
text-align: center;
color: #333;
}
.option-content {
margin-left: 10px;
color: #333;
}
}
}
}

View File

@ -94,7 +94,7 @@ export default {
questionCount: 0,
//
examNum: 0,
examCount: 1, // 1: 2: 3:
examCount: '', // 1: 2: 3:
examCustom: 0, //
results: 0, //
studyId: '',
@ -138,7 +138,7 @@ export default {
} else {
from = '/pages/YNEduApp/exam/exam'
}
// examCount 1: 2: 3:
if (this.examCount == 2 && this.results == 1) {
uni.showToast({
@ -146,7 +146,7 @@ export default {
icon: 'none'
})
setTimeout(() => {
uni.navigateTo({
uni.reLaunch({
url: from
})
}, 1000)
@ -156,23 +156,24 @@ export default {
icon: 'none'
})
setTimeout(() => {
uni.navigateTo({
uni.reLaunch({
url: from
})
}, 1000)
} else {
const params = {
examId: this.examId,
examNum: this.examNum,
examCount: this.examCount,
examCustom: this.examCustom,
switchCount: this.switchCount,
studyId: this.studyId
}
console.log('🚀 ~ handleResetExamination ~ params:', params)
uni.navigateTo({
url: `/pages/YNEduApp/exam/examination?params=${JSON.stringify(params)}`
})
}
const params = {
examId: this.examId,
examNum: this.examNum,
examCount: this.examCount,
examCustom: this.examCustom,
switchCount: this.switchCount,
studyId: this.studyId
}
console.log('🚀 ~ handleResetExamination ~ params:', params)
uni.navigateTo({
url: `/pages/YNEduApp/exam/examination?params=${JSON.stringify(params)}`
})
},
handleArrow() {
let from = ''
@ -193,6 +194,7 @@ export default {
}
// const res = await getExamRankById(params)
// this.rankList = res.data
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/studentExam/getExamRankById',
method: 'post',

View File

@ -18,7 +18,7 @@
</div>
<div class="item">
得分/总分
<span class="item-info">{{ item.score }}/{{ item.examGrade }}</span>
<span class="item-info">{{ item.examGrade }}/{{ item.score }}</span>
</div>
<div class="item">
得分率
@ -66,6 +66,7 @@ export default {
// const res = await getExamRecordById(params)
// console.log('🚀 ~ getList ~ res:', res)
// this.list = res.data
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/studentExam/getExamRecordById',
method: 'get',

View File

@ -95,9 +95,9 @@
</div>
<div v-else :style="{ color: item.isRight ? '#48d66b' : '#fa4f19' }" class="grade">
<div v-if="item.selectAnswer">
<div v-for="(grade, gradeIndex) in item.selectAnswer.split('')" :key="gradeIndex">
<span v-for="(grade, gradeIndex) in item.selectAnswer.split('')" :key="gradeIndex">
{{ grade }}{{ gradeIndex + 1 == item.selectAnswer.split('').length ? '' : ',&nbsp;' }}
</div>
</span>
</div>
</div>
</div>
@ -115,7 +115,7 @@
<div class="btn" v-show="currentIndex != 0">
<u-button size="small" shape="circle" text="上一题" @click="currentIndex--" />
</div>
<div class="btn" v-if="currentIndex !== questionList.length - 1">
<div class="btn" v-if="currentIndex !== list.length - 1">
<u-button type="primary" size="small" shape="circle" text="下一题" @click="currentIndex++" />
</div>
</div>
@ -481,6 +481,7 @@ export default {
}
// const res = await getExamRecordAnswer(params)
// this.questionList = res.data.examPaperData
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/studentExam/getExamRecordAnswer',
method: 'post',

View File

@ -45,7 +45,7 @@
height="8"
activeColor="#579AF8"
/>
<div>{{ item.trainPercentage }}%</div>
<div>{{ item.trainPercentage || 0 }}%</div>
</div>
</div>
<view class="no-task" v-show="!taskList || taskList.length === 0">
@ -99,9 +99,13 @@ export default {
console.log('🚀 ~ mounted ~ mounted-index:')
this.getList()
this.getMsgList()
setTimeout(() => {
this.$verificationToken()
}, 1000)
},
methods: {
async getList() {
getList() {
this.taskList = []
let params = {
userId: this.userId,
@ -111,6 +115,7 @@ export default {
// console.log('🚀 ~ getList ~ res:', res)
// this.taskList = res.data
console.log('🚀 ~ toggleSearch ~ params:', params)
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/personalCenter/getStudentStudyWorkList',
method: 'post',
@ -137,6 +142,7 @@ export default {
}
// const res = await getStudentStudyWorkList(params)
// this.taskList = res.data
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/personalCenter/getStudentStudyWorkList',
method: 'post',
@ -154,6 +160,7 @@ export default {
},
//
getMsgList() {
this.$verificationToken()
uni.request({
url: config.bmwUrl + '/studentUsers/getNoticeList',
method: 'post',

View File

@ -24,7 +24,8 @@ export default {
},
methods: {
//
async getMsgList() {
getMsgList() {
this.$verificationToken()
uni.request({
url: config.bmwUrl + '/studentUsers/getNoticeList',
method: 'post',

View File

@ -40,6 +40,7 @@ export default {
},
data() {
return {
isLoading: false,
studyId: '', // id
stageId: '', // id
stageContentId: '', // id
@ -53,7 +54,8 @@ export default {
//
currentTime: 0,
showModal: false, //
content: '是否确认结束学习?'
content: '是否确认结束学习?',
isEnd: false
}
},
onLoad(opt) {
@ -69,11 +71,24 @@ export default {
console.log('🚀 ~ onLoad ~ this.path:', this.path)
this.studyDuration = this.currentTime = Number(opt.studyDuration)
this.allStudyDuration = Number(opt.allStudyDuration)
this.isEnd = opt.isEnd
if (opt.isEnd) {
this.studyDuration = 0
}
},
onHide() {
console.log('🚀 ~ onHide ~ 页面隐藏')
if (!this.isEnd) {
//
this.handleEnd()
}
},
onUnload() {
console.log('🚀 ~ onUnload ~ 页面关闭')
//
this.handleEnd()
if (!this.isEnd) {
//
this.handleEnd()
}
},
methods: {
videoErrorCallback(e) {
@ -89,6 +104,20 @@ export default {
},
//
handleEnd() {
if (this.isLoading) {
uni.showToast({
title: '正在提交中, 请稍后',
icon: 'none'
})
return
}
this.isLoading = true
if (this.isEnd) {
uni.reLaunch({
url: '/pages/YNEduApp/learnProj/learnProjDetail?id=' + this.studyId
})
return
}
//
const video = uni.createVideoContext('myVideo')
video.pause()
@ -96,7 +125,10 @@ export default {
console.log('当前播放时间:', this.currentTime, this.allStudyDuration)
this.studyDuration = this.currentTime
//
this.studyPercentage = Math.ceil((this.studyDuration / this.allStudyDuration) * 100).toFixed(2)
this.studyPercentage =
Math.ceil((this.studyDuration / this.allStudyDuration) * 100).toFixed(2) > 100
? 100
: Math.ceil((this.studyDuration / this.allStudyDuration) * 100).toFixed(2)
console.log('🚀 ~ handleEnd ~ this.studyPercentage:', this.studyPercentage)
const params = {
@ -116,6 +148,7 @@ export default {
// this.showModal = false
// uni.navigateBack()
// })
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/student/updStudyDuration',
method: 'post',
@ -126,10 +159,13 @@ export default {
},
success: res => {
console.log('🚀 ~ handleEnd ~ res:', res)
this.showModal = false
uni.navigateTo({
uni.reLaunch({
url: '/pages/YNEduApp/learnProj/learnProjDetail?id=' + this.studyId
})
setTimeout(() => {
this.isLoading = false
this.showModal = false
}, 1000)
},
fail: err => {
console.log('🚀 ~ handleEnd ~ err:', err)

View File

@ -80,7 +80,7 @@ export default {
handlePostMessage(data) {
let arr = data.detail.data.pop()
this.totalPage = arr[0].totalPage //
this.currentReadPage = arr[1].page + 1 //
this.currentReadPage = arr[1].page //
console.log('app:', this.totalPage, this.currentReadPage)
},
//h5

View File

@ -0,0 +1,154 @@
<template>
<view class="content">
<u--image :showLoading="true" :src="path" width="300px" height="600px" @click="handleImage"></u--image>
</view>
</template>
<script>
import config from '@/config'
export default {
data() {
return {
isShow: true,
path: '',
params: {},
timer: null,
isEnd: false,
isShowImg: false
}
},
onLoad(opt) {
opt = JSON.parse(opt.params)
console.log('🚀 ~ onLoad ~ opt:', opt)
this.params = JSON.parse(JSON.stringify(opt))
this.params.studyDuration = Number(opt.studyDuration)
this.params.allStudyDuration = Number(opt.allStudyDuration)
this.path = config.fileUrl + opt.path
// this.path = opt.path
console.log('🚀 ~ onLoad ~ this.params:', this.path)
console.log('🚀 ~ onLoad ~ this.params:', Number(opt.studyDuration), Number(opt.allStudyDuration))
if (Number(opt.studyDuration) < Number(opt.allStudyDuration)) {
this.isEnd = false
setTimeout(() => {
this.countDown()
}, 1000)
} else {
this.isEnd = true
// -
uni.showToast({
title: '学习时长已满, 随时可以结束学习',
icon: 'none'
})
}
},
onShow() {
console.log('🚀 ~ onShow ~ 页面显示')
this.isShowImg = false
},
// onHide
onHide() {
console.log('🚀 ~ onHide ~ 页面关闭')
if (this.isEnd) {
return
}
//
if (!this.isShowImg) {
clearInterval(this.timer)
this.updStudyDuration()
}
},
onUnload() {
console.log('🚀 ~ onUnload ~ onUnload-页面关闭:')
if (this.isEnd) {
return
}
//
if (!this.isShowImg) {
clearInterval(this.timer)
this.updStudyDuration()
}
},
methods: {
// allStudyDuration
countDown() {
let allStudyDuration = Number(this.params.allStudyDuration) - Number(this.params.studyDuration)
// let studyDuration = Number(this.params.studyDuration)
this.timer = setInterval(() => {
allStudyDuration--
this.params.studyDuration++
console.log('🚀 ~ countDown ~ this.params.studyDuration:', this.params.studyDuration)
if (allStudyDuration <= 0) {
this.params.studyDuration = this.params.allStudyDuration
this.isEnd = true
clearInterval(this.timer)
// -
uni.showToast({
title: '学习时长已满',
icon: 'none'
})
setTimeout(() => {
this.updStudyDuration()
}, 1000)
}
console.log('🚀 ~ countDown ~ 剩余时间-->:', allStudyDuration)
console.log('🚀 ~ countDown ~ this.params.studyDuration:', this.params.studyDuration)
}, 1000)
},
//
updStudyDuration() {
const params = {
userId: this.params.userId,
studyId: this.params.studyId,
stageId: this.params.stageId,
stageContentId: this.params.stageContentId,
stageType: this.params.stageType,
studyCourseId: this.params.studyCourseId,
sourceId: this.params.sourceId,
studyDuration: this.params.studyDuration,
studyPercentage:
Math.ceil((Number(this.params.studyDuration) / Number(this.params.allStudyDuration)) * 100).toFixed(2) > 100
? 100
: Math.ceil((Number(this.params.studyDuration) / Number(this.params.allStudyDuration)) * 100).toFixed(2)
}
console.log('🚀 ~ updStudyDuration ~ params:', params)
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/student/updStudyDuration',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('access_token')
},
success: res => {
console.log('🚀 ~ handleEnd ~ res:', res)
this.isShow = false
uni.reLaunch({
url: '/pages/YNEduApp/learnProj/learnProjDetail?id=' + this.params.studyId
})
},
fail: err => {
console.log('🚀 ~ handleEnd ~ err:', err)
}
})
},
//
handleImage() {
this.isShowImg = true
uni.previewImage({
urls: [this.path]
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
display: flex;
justify-content: center;
align-items: center;
}
</style>

View File

@ -229,6 +229,7 @@ export default {
})
},
getStudentStudyWorkList(params) {
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/personalCenter/getStudentStudyWorkList',
method: 'post',

View File

@ -243,6 +243,7 @@ export default {
//
async getStudyWorkAll() {
let params = { userId: uni.getStorageSync('userId'), id: this.projId, type: '1' }
this.$verificationToken()
uni.request({
method: 'post',
url: config.bmwUrl + '/studyWork/StudyWorkAll',
@ -276,7 +277,8 @@ export default {
sourceId: item.id, // id
path: item.path, //
studyDuration: item.studyDuration || 0, //
allStudyDuration: item.allStudyDuration //
allStudyDuration: item.allStudyDuration, //
isEnd: item.studyPercentage >= 100 ? true : false
}
console.log('🚀 ~ toggleTheoryLearn ~ params:', params)
console.log('🚀 ~ toggleTheoryLearn ~ item:', item.path)
@ -286,6 +288,8 @@ export default {
url = '/pages/YNEduApp/learn/learn'
} else if (item.path.includes('.pdf')) {
url = '/pages/YNEduApp/learnProj/pdfStudy'
} else {
url = '/pages/YNEduApp/learnProj/imageStudy'
}
uni.navigateTo({
@ -314,6 +318,18 @@ export default {
//
toggleTheoryExam(item) {
console.log('🚀 ~ toggleTheoryExam ~ item:', item, item.examMsg.examEquipment)
const date = new Date()
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const today = `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}`
if (today < item.examMsg.validityDate.split('~')[0] || today > item.examMsg.validityDate.split('~')[1]) {
uni.showToast({
title: '当前时间不在考试时间范围内',
icon: 'none'
})
return
}
if (item.examMsg.examEquipment == 2) {
uni.showToast({
title: '请在电脑端进行考试',
@ -321,6 +337,20 @@ export default {
})
return
}
// examCount 1: 2: 3:
if (item.examMsg.examCount == 2 && item.examMsg.results == 1) {
uni.showToast({
title: '此考试及格终止, 考试以及格, 无需再次考试',
icon: 'none'
})
return
} else if (item.examMsg.examCount == 3 && item.examMsg.examNum >= item.examMsg.examCustom) {
uni.showToast({
title: '此考试有次数限制, 考试次数已达上限, 无法再考试了',
icon: 'none'
})
return
}
const params = {
id: item.examMsg.id, // id
cutNum: item.examMsg.isCut, //

View File

@ -1,7 +1,7 @@
<template>
<view>
<div>
<PdfView v-if="isShow" :path="path"/>
<PdfView v-if="isShow" :path="path" />
</div>
</view>
</template>
@ -26,55 +26,60 @@ export default {
this.params = JSON.parse(JSON.stringify(opt))
this.params.studyDuration = Number(opt.studyDuration)
this.params.allStudyDuration = Number(opt.allStudyDuration)
// this.path =
// config.fileUrl + opt.path + `&studyDuration=${opt.studyDuration}&allStudyDuration=${opt.allStudyDuration}`
this.path = opt.path
// httphttps使
if (opt.path.indexOf('http') !== -1) {
this.path = opt.path
} else {
this.path = config.fileUrl + opt.path
}
console.log('🚀 ~ onLoad ~ this.params:', this.path)
console.log('🚀 ~ onLoad ~ this.params:', Number(opt.studyDuration), Number(opt.allStudyDuration))
// if (Number(opt.studyDuration) <= Number(opt.allStudyDuration)) {
// setTimeout(() => {
// this.countDown()
// }, 1000)
// } else {
// // -
// uni.showToast({
// title: ', ',
// icon: 'none'
// })
// }
if (Number(opt.studyDuration) < Number(opt.allStudyDuration)) {
setTimeout(() => {
this.countDown()
}, 1000)
} else {
// -
uni.showToast({
title: '学习时长已满, 随时可以结束学习',
icon: 'none'
})
}
},
onHide() {
clearInterval(this.timer)
//
this.updStudyDuration()
},
//
onUnload() {
console.log('🚀 ~ onUnload ~ 页面关闭')
clearInterval(this.timer)
//
// this.updStudyDuration()
this.updStudyDuration()
},
methods: {
// allStudyDuration
countDown() {
let allStudyDuration = Number(this.params.allStudyDuration) - Number(this.params.studyDuration)
// let studyDuration = Number(this.params.studyDuration)
this.timer = setInterval(() => {
allStudyDuration--
// studyDuration++
this.params.studyDuration++
// this.$set(this.params, 'studyDuration', studyDuration)
console.log('🚀 ~ countDown ~ this.params.studyDuration:', this.params.studyDuration)
this.params.studyDuration++
console.log('🚀 ~ countDown ~ this.params.studyDuration:', this.params.studyDuration)
if (allStudyDuration <= 0) {
this.params.studyDuration = this.params.allStudyDuration
clearInterval(this.timer)
// -
uni.showToast({
title: '学习时长已满',
icon: 'none'
})
setTimeout(() => {
this.updStudyDuration()
// -
uni.showToast({
title: '学习时长已满',
icon: 'none'
})
}, 1000)
}
console.log('🚀 ~ countDown ~ 剩余时间-->:', allStudyDuration)
console.log('🚀 ~ countDown ~ this.params.studyDuration:', this.params.studyDuration)
console.log('🚀 ~ countDown ~ this.params.studyDuration:', this.params.studyDuration)
}, 1000)
},
//
@ -88,11 +93,13 @@ export default {
studyCourseId: this.params.studyCourseId,
sourceId: this.params.sourceId,
studyDuration: this.params.studyDuration,
studyPercentage: Math.ceil(
(Number(this.params.studyDuration) / Number(this.params.allStudyDuration)) * 100
).toFixed(2)
studyPercentage:
Math.ceil((Number(this.params.studyDuration) / Number(this.params.allStudyDuration)) * 100).toFixed(2) > 100
? 100
: Math.ceil((Number(this.params.studyDuration) / Number(this.params.allStudyDuration)) * 100).toFixed(2)
}
console.log('🚀 ~ updStudyDuration ~ params:', params)
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/student/updStudyDuration',
method: 'post',
@ -104,7 +111,7 @@ export default {
success: res => {
console.log('🚀 ~ handleEnd ~ res:', res)
this.isShow = false
uni.navigateTo({
uni.reLaunch({
url: '/pages/YNEduApp/learnProj/learnProjDetail?id=' + this.params.studyId
})
},

View File

@ -17,7 +17,7 @@
</div>
<div class="question-wrapper" v-for="(item, index) in questionList" :key="index">
<div v-if="item.examType !== 2">
<div v-if="item.examType != 2">
<div class="title">{{ nowNum }}.{{ item.paperTopic }}{{ item.examType == 1 ? '(单选题)' : '(判断题)' }}</div>
<u--image
v-if="item.paperTopicUrl"
@ -36,7 +36,21 @@
@click="handleOption(option, index)"
:class="{ active: option.isCorrect || option.isError }"
>
<div class="label">{{ option.optionIdent }}.{{ option.optionContent }}</div>
<div class="label-wrapper">
<div class="label">
<div style="width: 18px">{{ option.optionIdent }}.</div>
<div class="label-cont">{{ option.optionContent }}</div>
</div>
<u--image
v-if="option.optionUrl"
:showLoading="true"
:src="fileUrl + option.optionUrl"
width="60px"
height="60px"
style="margin: 10px 0"
@click="clickImg(fileUrl + option.optionUrl)"
/>
</div>
<u-icon v-if="option.isCorrect" name="/static/images/right.png" size="25" />
<u-icon v-if="option.isError" name="/static/images/err.png" size="25" />
</div>
@ -46,15 +60,15 @@
<div>正确答案{{ item.correctGrade }}</div>
<div>你的答案{{ item.select }}</div>
<div v-if="item.analysis">
<div>
<div class="analysis">答案解析</div>
<div class="analysis-container">{{ item.answerAnaly }}</div>
</div>
</div>
</div>
<!-- 多选 -->
<div v-else-if="item.examType === 2">
<div class="title">{{ index + 1 }}. {{ item.paperTopic }}多选题</div>
<div v-else-if="item.examType == 2">
<div class="title">{{ nowNum }}. {{ item.paperTopic }}多选题</div>
<u--image
v-if="item.paperTopicUrl"
:showLoading="true"
@ -72,7 +86,7 @@
@click="handleCheckbox(option, index, item)"
:class="{ active: option.isCheck || option.isCorrect || option.isError }"
>
<div>
<div class="label-wrapper">
<div class="label">
<div style="width: 18px">{{ option.optionIdent }}.</div>
<div class="label-cont">{{ option.optionContent }}</div>
@ -80,11 +94,11 @@
<u--image
v-if="option.optionUrl"
:showLoading="true"
:src="fileUrl + option.optionUrl || ''"
:src="fileUrl + option.optionUrl"
width="60px"
height="60px"
style="margin-bottom: 10px"
@click="clickImg(fileUrl + option.optionUrl || '')"
style="margin: 10px 0"
@click="clickImg(fileUrl + option.optionUrl)"
/>
</div>
<u-icon v-if="option.isCorrect" name="/static/images/right.png" size="25" />
@ -189,7 +203,7 @@
v-for="(item, index) in questionListSelect"
:key="index"
class="topic-wrapper"
:class="{ correct: item.isCorrect, error: item.isError }"
:class="{ correct: item.isTrue == 1, error: item.isTrue == 0 }"
@click="handleJump('jump', item.index)"
>
<div v-if="currentIndex == item.index">*</div>
@ -218,18 +232,20 @@ import config from '@/config'
export default {
data() {
return {
isLoading: false,
practiceId: '', // id
recordId: '', // id
isNew: 1, //
isOutOfOrder: 1, //
isError: false, //
nowNum: 0, //
nowNum: '', //
showModal: false,
showModalSelect: false,
//
correctRate: '0',
// - - 00:00:00
usedTime: '00:00:00',
serviceTime: 0,
//
trueNum: 0,
//
@ -271,19 +287,14 @@ export default {
},
methods: {
// -
async getPracticeItData() {
getPracticeItData() {
const params = {
practiceId: this.practiceId,
recordId: this.recordId,
isNew: this.isNew || '',
isMiss: this.isError ? '1' : ''
}
// const res = await getPracticeItData(params)
// this.trueNum = res.data.trueNum
// this.falseNum = res.data.falseNum
// this.allNum = res.data.allNum
// this.nowNum = res.data.nowNum
// console.log('🚀 ~ getPracticeItData ~ res:', res)
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/studentPractice/getPracticeItData',
method: 'post',
@ -306,7 +317,7 @@ export default {
})
},
//
async getPracticeQuestion() {
getPracticeQuestion() {
this.questionList = []
const params = {
practiceId: this.practiceId,
@ -320,6 +331,7 @@ export default {
// this.questionList.push(res.data)
// console.log('🚀 ~ getPracticeQuestion ~ res:', res)
// console.log('🚀 ~ getPracticeQuestion ~ this.questionList:', this.questionList)
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/studentPractice/getPracticeQuestion',
method: 'post',
@ -331,8 +343,43 @@ export default {
success: res => {
console.log('🚀 ~ getPracticeQuestion ~ res:', res)
res = res.data
this.recordId = res.data.recordId ? res.data.recordId : this.recordId
this.questionList.push(res.data)
console.log('🚀 ~ getPracticeQuestion ~ :', this.questionList[0])
this.recordId = res.data.recordId ? res.data.recordId : this.recordId
if (res.data.selectAnswer) {
console.log('执行了--')
if (this.questionList[0].examType == 2) {
this.questionList[0].select = res.data.selectAnswer.split('')
this.questionList[0].isSelect = true
// selectAnswer,
this.questionList[0].listOption.forEach(item => {
if (res.data.selectAnswer.includes(item.optionIdent)) {
item.isSelect = true
}
if (res.data.correctGrade.includes(item.optionIdent)) {
item.isCorrect = true
}
if (item.isSelect && !this.questionList[0].correctGrade.includes(item.optionIdent)) {
item.isError = true
}
})
} else {
this.questionList[0].select = res.data.selectAnswer
this.questionList[0].isSelect = true
// selectAnswer,
this.questionList[0].listOption.forEach(item => {
if (res.data.selectAnswer === item.optionIdent) {
item.isSelect = true
}
if (item.optionIdent === this.questionList[0].correctGrade) {
item.isCorrect = true
}
if (item.isSelect && item.optionIdent !== this.questionList[0].correctGrade) {
item.isError = true
}
})
}
}
},
fail: err => {
console.log(err)
@ -340,15 +387,16 @@ export default {
})
},
//
async handleJump(item, index) {
handleJump(item, index) {
console.log('🚀 ~ handleJump ~ item:', item, this.recordId)
if (item === 'prev') {
this.nowNum -= 1
this.nowNum--
} else if (item === 'next') {
this.nowNum += 1
this.nowNum++
} else if (item === 'jump') {
this.nowNum = index
}
console.log('🚀 ~ handleJump ~ this.nowNum:', this.nowNum)
this.currentIndex = index
this.questionList = []
@ -363,6 +411,7 @@ export default {
// const res = await changeQuestion(params)
// this.questionList.push(res.data)
// console.log('🚀 ~ handleJump ~ res:', res)
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/studentPractice/changeQuestion',
method: 'post',
@ -375,6 +424,39 @@ export default {
console.log('🚀 ~ handleJump ~ res:', res)
res = res.data
this.questionList.push(res.data)
if (res.data.selectAnswer) {
if (this.questionList[0].examType == 2) {
this.questionList[0].select = res.data.selectAnswer.split('')
this.questionList[0].isSelect = true
// selectAnswer,
this.questionList[0].listOption.forEach(item => {
if (res.data.selectAnswer.includes(item.optionIdent)) {
item.isSelect = true
}
if (res.data.correctGrade.includes(item.optionIdent)) {
item.isCorrect = true
}
if (item.isSelect && !this.questionList[0].correctGrade.includes(item.optionIdent)) {
item.isError = true
}
})
} else {
this.questionList[0].select = res.data.selectAnswer
this.questionList[0].isSelect = true
// selectAnswer,
this.questionList[0].listOption.forEach(item => {
if (res.data.selectAnswer === item.optionIdent) {
item.isSelect = true
}
if (item.optionIdent === this.questionList[0].correctGrade) {
item.isCorrect = true
}
if (item.isSelect && item.optionIdent !== this.questionList[0].correctGrade) {
item.isError = true
}
})
}
}
},
fail: err => {
console.log(err)
@ -382,7 +464,7 @@ export default {
})
},
// -
async getPracticeQuestionList() {
getPracticeQuestionList() {
const params = {
recordId: this.recordId,
practiceId: this.practiceId,
@ -391,6 +473,7 @@ export default {
// const res = await getPracticeQuestionList(params)
// console.log('🚀 ~ getPracticeQuestionList ~ res:', res)
// this.questionListSelect = res.data
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/studentPractice/getPracticeQuestionList',
method: 'post',
@ -412,24 +495,36 @@ export default {
// -
startTimer() {
this.intervalId = setInterval(() => {
const time = this.usedTime.split(':')
let hours = parseInt(time[0])
let minutes = parseInt(time[1])
let seconds = parseInt(time[2])
seconds++
if (seconds === 60) {
seconds = 0
minutes++
if (minutes === 60) {
minutes = 0
hours++
}
}
this.usedTime = `${hours < 10 ? '0' + hours : hours}:${minutes < 10 ? '0' + minutes : minutes}:${
seconds < 10 ? '0' + seconds : seconds
}`
this.serviceTime++
this.handleTime()
// const time = this.usedTime.split(':')
// let hours = parseInt(time[0])
// let minutes = parseInt(time[1])
// let seconds = parseInt(time[2])
// seconds++
// if (seconds === 60) {
// seconds = 0
// minutes++
// if (minutes === 60) {
// minutes = 0
// hours++
// }
// }
// this.usedTime = `${hours < 10 ? '0' + hours : hours}:${minutes < 10 ? '0' + minutes : minutes}:${
// seconds < 10 ? '0' + seconds : seconds
// }`
}, 1000)
},
//
handleTime() {
// this.serviceTime
let hours = parseInt(this.serviceTime / 3600)
let minutes = parseInt((this.serviceTime % 3600) / 60)
let seconds = parseInt(this.serviceTime % 60)
this.usedTime = `${hours < 10 ? '0' + hours : hours}:${minutes < 10 ? '0' + minutes : minutes}:${
seconds < 10 ? '0' + seconds : seconds
}`
},
clickImg(url) {
console.log('🚀 ~ clickImg ~ url:', url)
uni.previewImage({
@ -482,6 +577,7 @@ export default {
console.log('🚀 ~ handleOption ~ params:', params)
//
// insertPracticeAnswerById(params)
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/studentPractice/insertPracticeAnswerById',
method: 'post',
@ -560,10 +656,12 @@ export default {
recordId: this.recordId,
questionId: this.questionList[0].questionId,
selectAnswer: select.join(''),
isTrue: isCorrect ? 1 : 0
isTrue: isCorrect ? 1 : 0,
isMiss: this.isError ? '1' : ''
}
console.log('🚀 ~ handleOk ~ params-多选:', params)
// insertPracticeAnswerById(params)
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/studentPractice/insertPracticeAnswerById',
method: 'post',
@ -579,7 +677,9 @@ export default {
}
},
//
async handleSubmit() {
handleSubmit() {
//
clearInterval(this.intervalId)
console.log('提交')
this.answerNum = this.trueNum + this.falseNum
let rate = ((Number(this.trueNum) / Number(this.answerNum)) * 100).toFixed(2)
@ -609,30 +709,32 @@ export default {
handleConfirm() {
console.log('确认')
this.showModal = false
//
this.startTimer()
},
//
handleClose() {
if (this.isLoading) {
uni.showToast({
title: '正在提交中, 请稍后',
icon: 'none'
})
return
}
this.isLoading = true
this.isEnd = true
//
clearInterval()
console.log('结束', this.usedTime)
clearInterval(this.intervalId)
console.log('结束', this.usedTime, this.serviceTime)
//
// savePracticeDuration({
// id: this.practiceId,
// practiceDuration: Math.ceil(this.usedTime.split(':')[0] * 60 + this.usedTime.split(':')[1] / 60)
// })
// this.usedTime 00:00:00
let time = this.usedTime.split(':').reduce((acc, cur, index) => {
return acc + cur * Math.pow(60, 2 - index)
}, 0)
// ,
time = Math.ceil(time / 60)
let time = Math.ceil(this.serviceTime / 60)
console.log('🚀 ~ handleClose ~ time:', time)
const params = {
id: this.recordId,
practiceDuration: time
}
console.log('🚀 ~ handleClose ~ params:', params)
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/studentPractice/savePracticeDuration',
method: 'post',
@ -650,6 +752,7 @@ export default {
// updateRemoveRecordData({
// practiceId: this.practiceId
// })
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/studentPractice/updateRemoveRecordData',
method: 'post',
@ -671,6 +774,7 @@ export default {
studyId: this.studyId
}
// updStudyDurationExamPractice(params)
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/student/updStudyDurationExamPractice',
method: 'post',
@ -693,10 +797,13 @@ export default {
url: '/pages/YNEduApp/prac/prac'
})
}
this.showModal = false
setTimeout(() => {
this.isLoading = false
this.showModal = false
}, 500)
},
//
async openSelect() {
openSelect() {
this.showModalSelect = true
// const res = await this.getPracticeQuestionList()
// console.log('🚀 ~ openSelect ~ res:', res)
@ -706,6 +813,7 @@ export default {
practiceId: this.practiceId,
isMiss: this.isError ? 1 : ''
}
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/studentPractice/getPracticeQuestionList',
method: 'post',
@ -828,6 +936,8 @@ export default {
}
.question-wrapper {
max-height: 500px;
overflow: auto;
padding: 30px;
color: #08428d;
@ -847,11 +957,15 @@ export default {
background: #ffffff;
border-radius: 8px;
overflow: auto;
.label {
display: flex;
align-items: center;
justify-content: flex-start;
text-align: left;
.label-wrapper {
max-height: 100px;
overflow: auto;
.label {
display: flex;
align-items: center;
justify-content: flex-start;
text-align: left;
}
}
}
.active {

View File

@ -70,6 +70,7 @@ export default {
// this.waitList = res.data.filter(item => item.alreadyNum === 0)
// this.alreadyList = res.data.filter(item => item.alreadyNum > 0)
// console.log('🚀 ~ getList ~ res:', res)
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/personalCenter/getStudentPracticeList',
method: 'post',

View File

@ -128,6 +128,7 @@ export default {
const params = {
id: this.practiceId
}
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/studentPractice/getPracticeQuestionRate',
method: 'post',

View File

@ -22,8 +22,8 @@
</div>
</div>
<div class="btn">
<u-button type="primary" shape="circle" text="开始录入" @click="openFaceScan" style="margin-bottom: 10px" />
<!-- <u-button type="primary" shape="circle" text="拍照录入" @click="openPhotograph" /> -->
<!-- <u-button type="primary" shape="circle" text="开始录入" @click="openFaceScan" style="margin-bottom: 10px" /> -->
<u-button type="primary" shape="circle" text="拍照录入" @click="openPhotograph" />
</div>
</div>
@ -36,8 +36,8 @@
<div class="img-tip-content">收集您的信息以实现在考试中检测是否是您本人操作请务必录入您本人的面部信息</div>
<div class="btn">
<u-button type="primary" shape="circle" text="确定录入" @click="handleSubmit" />
<u-button type="primary" plain shape="circle" text="重新录入" @click="openFaceScan" style="margin: 10px 0" />
<!-- <u-button type="primary" plain shape="circle" text="重新拍照" @click="openPhotograph" /> -->
<!-- <u-button type="primary" plain shape="circle" text="重新录入" @click="openFaceScan" style="margin: 10px 0" /> -->
<u-button type="primary" plain shape="circle" text="重新拍照" style="margin: 10px 0" @click="openPhotograph" />
</div>
</div>
</view>
@ -106,6 +106,7 @@ export default {
img: this.url
}
params = JSON.stringify(params)
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/personalCenter/uploadFaceRecognition',
method: 'POST',

View File

@ -48,6 +48,7 @@ export default {
methods: {
//
getMsgList() {
this.$verificationToken()
uni.request({
url: config.bmwUrl + '/users/getMsgInform',
method: 'get',
@ -85,6 +86,7 @@ export default {
markRead(item) {
const ids = [item.id]
console.log('🚀 ~ markRead ~ ids:', ids)
this.$verificationToken()
uni.request({
url: config.bmwUrl + '/users/markAsRead',
method: 'post',
@ -102,6 +104,7 @@ export default {
deleteMsg(item) {
const ids = [item.id]
console.log('🚀 ~ deleteMsg ~ ids:', ids)
this.$verificationToken()
uni.request({
url: config.bmwUrl + '/users/batchDelete',
method: 'post',

View File

@ -81,6 +81,7 @@ export default {
// --
getLearnStats() {
console.log('🚀 ~ getLearnStats ~ this.token:',uni.getStorageSync('access_token'))
this.$verificationToken()
uni.request({
url: config.baseUrl + '/exam-student/personalCenter/getStudyAndCer',
// url: 'http://192.168.0.137:2900' + '/exam-student/personalCenter/getStudyAndCer',

View File

@ -97,6 +97,7 @@
import TabbarConfig from '@/totalTabbar.js'
import AES from "@/utils/realNameAes.js";
import config from '@/config'
import Crypoto from '@/utils/aescbc'
import {
getDayNoticeAnnoByUserId,
@ -193,13 +194,16 @@
})
},
gotoYy(name) {
const cry = new Crypoto()
const params = {
username: uni.getStorageSync('userPhone'),
jwtToken: uni.getStorageSync('App-Token')
}
const tjparams = {
username: '13908860263',
password: 'YNsbd@123456'
// username: '17681010134', // 15912575796
// password: 'YNsbd@123456'
telephone: cry.encrypt(uni.getStorageSync('userPhone')),
jwtToken: uni.getStorageSync('App-Token')
}
const realParams = {
username: AES.encrypt(uni.getStorageSync('userPhone')),
@ -283,7 +287,7 @@
} else if( name == '健康体检移动端') {
uni.request({
url: config.tjBaseUrl + '/login',
url: config.tjBaseUrl + '/app/loginNoPassword',
method: 'POST',
data: tjparams,
header: {
@ -291,9 +295,12 @@
},
success: res => {
console.log('🚀 ~ gotoYy ~ res:', res,)
console.log('🚀 ~ gotoYy ~ res:', res.data.token)
console.log('🚀 ~ gotoYy ~ res:', res.data.obj)
if (res.statusCode == 200) {
uni.setStorageSync('tjToken', res.data.token)
uni.removeStorageSync('tjToken')
uni.removeStorageSync('tjPhone')
uni.setStorageSync('tjToken', res.data.obj)
uni.setStorageSync('tjPhone', tjparams.telephone)
setTimeout(() => {
uni.reLaunch({
url: '/pages/HealthExaminationApp/index/index'
@ -301,7 +308,7 @@
}, 500)
} else {
uni.showToast({
title: req.message,
title: res.data.message,
icon: 'none'
})
}

View File

@ -165,7 +165,7 @@
// globalConfig: getApp().globalData.config,
selectTab: 1,
loginForm: {
phone: '18700000001', // 18955734761 18700000001
phone: '18700000002', // 18955734761 18700000001
pd: 'YNsbd@123456',//YNsbd@123456
},
loginForm0: {

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

54
utils/aescbc.js Normal file
View File

@ -0,0 +1,54 @@
import CryptoJS from 'crypto-js'
export default class Crypoto {
key = CryptoJS.enc.Utf8.parse('zhgd@bonus@zhgd@bonus@1234567890') // 这里找后端要;
iv = CryptoJS.enc.Utf8.parse('1234567812345678')
/* 加密 */
encrypt(word) {
let aqEnnable = true
if (!aqEnnable) {
return word
}
var srcs = CryptoJS.enc.Utf8.parse(word)
var encrypted = CryptoJS.AES.encrypt(srcs, this.key, {
iv: this.iv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
})
return encrypted.toString()
}
encrypts(word) {
const srcs = CryptoJS.enc.Utf8.parse(word)
const encrypted = CryptoJS.AES.encrypt(srcs, this.key, {
iv: this.iv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
})
const ciphertext = encrypted.ciphertext.toString(CryptoJS.enc.Base64url) // 将加密结果转换为 Base64URL 格式 确认后端要的是Base64URL 还是Base64 这两种编码格式不一样
return ciphertext
}
decrypt
}
const jie_mi=true;
/**
* 解密
* @param word
* @returns {*}
*/
export const decryptCBC = function(word) {
if(!jie_mi){
return word;
}
const encrypted = CryptoJS.AES.decrypt(word, CryptoJS.enc.Utf8.parse('zhgd@bonus@zhgd@bonus@1234567890'), {
iv: CryptoJS.enc.Utf8.parse('1234567812345678'),
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
})
return encrypted.toString(CryptoJS.enc.Utf8)
}

View File

@ -14,15 +14,6 @@ const request = config => {
config.header = config.header || {}
if (getToken() && !isToken) {
config.header['Authorization'] = 'Bearer ' + getToken()
} else {
// 没有token - 去登录
// store.dispatch('LogOut').then(() => {
// uni.reLaunch({ url: '/pages/login' })
// })
// const token = 'eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjozMSwidXNlcl9rZXkiOiJiZmJmOGEzZC1hYTc1LTQ4MzQtOGM3NC0yZmQzOTEwZDllYzAiLCJ1c2VybmFtZSI6IuaWueS6riJ9.kv1WmthbgTrqapbsGLvevk-nwbWbYJMniyjj8DC3BSnQjCwm8csQ5GaNpfsLFFFYIHBYa8CrN_sBxXhDKOfR_A'
// const userId = 31
// setUserId(userId)
// setToken(token)
}
// get请求映射params参数
if (config.params) {