yujialong 3 days ago
parent 84c5e1fe95
commit 28cebc7ac4
  1. 2
      components/realName/realName.vue
  2. 4
      config/request.js
  3. 102
      course/courseDetail/courseDetail.vue
  4. 5
      course/practiceDetail/practiceDetail.vue
  5. 10
      pages.json
  6. 44
      pages/achievement/achievement.vue
  7. 82
      pages/login/login.vue
  8. 11
      styles/common.scss
  9. 10
      user/info/info.vue
  10. 6
      user/phone/phone.vue
  11. 23
      user/reg/reg.vue
  12. 2
      user/selectAccount/selectAccount.vue
  13. 2
      user/switchAccount/switchAccount.vue

@ -35,7 +35,7 @@
async handleRealName () {
const res = await checkUserNameOrWorkNumber()
//
if (!res.hasName) this.realNameForm.workNumber = res.workNumber
if (!res.hasName) this.realNameForm.workNumber = res.workNumber || ''
this.$refs.alertDialog[res.hasName ? 'close' : 'open']()
},
//

@ -6,8 +6,8 @@
export default {
// baseURL: 'https://izhixinyun.com/',
baseURL: 'http://192.168.31.51:9000/',
// baseURL: 'http://118.31.167.228/',
// baseURL: 'http://192.168.31.51:9000/',
baseURL: 'http://118.31.167.228/',
headers: {
'Content-Type': 'application/json;charset=UTF-8'
},

@ -89,7 +89,7 @@
<!-- 考核成绩 -->
<view v-show="curTab === 3">
<view v-if="ass.length" class="list">
<view v-for="(item, i) in ass" :key="i" class="item" @click="toDetail(item)">
<view v-for="(item, i) in ass" :key="i" class="item" @click="toReport(item)">
<view class="c-name">{{ item.experimentalName }}</view>
<view class="line">得分{{ item.score }}&emsp;&emsp;耗时{{ item.timeSum }}min</view>
<view class="line">考核开始时间{{ item.startTime }}</view>
@ -104,7 +104,7 @@
</template>
<script>
import { queryChaptersAndSubsections, detailsOfGoods, queryPracticeByStudent, queryAssessmentByStudent, getPlayAuth, playRecordSave, recordRecentUsage } from '@/apis/modules/course.js'
import { queryChaptersAndSubsections, detailsOfGoods, queryPracticeByStudent, queryAssessmentByStudent, getPlayAuth, playRecordSave, recordRecentUsage, getALinkToTheExperimentReport, getExamPaperReportUrl } from '@/apis/modules/course.js'
export default {
data() {
return {
@ -303,6 +303,46 @@
toPrac(row) {
this.$util.to(`../practiceDetail/practiceDetail?cid=${this.cid}&projectId=${row.projectId || ''}&paperId=${row.paperId || ''}`)
},
//
async toReport(row) {
uni.showLoading({
title: '加载中',
mask: true
})
let res
if (row.paperId) {
//
res = await getExamPaperReportUrl({
reportId: row.reportId
})
} else {
//
res = await getALinkToTheExperimentReport(row.reportId)
}
//
uni.downloadFile({
url: res.url,
success: function(res) {
console.log(11, res)
// doc, xls, ppt, pdf, docx, xlsx, pptx
uni.openDocument({
filePath: res.tempFilePath,
fileType: 'docx', // doc, xls, ppt, pdf, docx, xlsx, pptx
showMenu: true, //
success: res => {
uni.hideLoading()
},
fail: openError => {
uni.hideLoading()
}
})
},
fail: function(err) {
uni.hideLoading()
}
})
},
// //pdf
handleFileType(row) {
@ -322,64 +362,6 @@
this.playListVisible = false
this.videoFullScreen = false
this.handleFileType(row)
// debugger
if (this.curRow.isVideo) {
//
if (row.fileId) {
getPlayAuth(row.fileId).then(res => {
this.playAuth = res.playAuth;
//
if (this.player) {
this.player.dispose()
this.player = null
}
this.$nextTick(() => {
if (this.player) {
this.player.replayByVidAndPlayAuth(row.fileId, this.playAuth);
} else {
this.player = new Aliplayer({
id: "player",
width: "100%",
autoplay: false,
vid: row.fileId,
playauth: this.playAuth,
encryptType: 1 //
})
}
})
}).catch(res => { });
}
} else {
// const that = this
// uni.downloadFile({
// // url: this.curRow.fileUrl,
// url: 'https://huoran.oss-cn-shenzhen.aliyuncs.com/1732589800544.xlsx',
// success: function(res) {
// console.log(11, res)
// uni.hideLoading();
// uni.showLoading({
// title: '',
// mask: true
// })
// // doc, xls, ppt, pdf, docx, xlsx, pptx
// uni.openDocument({
// filePath: res.tempFilePath,
// // fileType: that.curRow.fileType, // doc, xls, ppt, pdf, docx, xlsx, pptx
// fileType: 'xlsx',
// showMenu: true, //
// success: res => {
// uni.hideLoading()
// },
// fail: openError => {
// uni.hideLoading()
// }
// })
// },
// fail: function(err) {
// uni.hideLoading()
// }
// })
}
},
//
fullScreenChange(e) {

@ -94,11 +94,6 @@
url: res.url,
success: function(res) {
console.log(11, res)
uni.hideLoading();
uni.showLoading({
title: '正在打开',
mask: true
})
// doc, xls, ppt, pdf, docx, xlsx, pptx
uni.openDocument({
filePath: res.tempFilePath,

@ -1,17 +1,17 @@
{
"pages": [
{
"path" : "pages/login/login",
"path" : "pages/index/index",
"style" :
{
"navigationBarTitleText": "登录",
{"navigationBarTitleText": "课程",
"enablePullDownRefresh": false
}
},
{
"path" : "pages/index/index",
"path" : "pages/login/login",
"style" :
{"navigationBarTitleText": "课程",
{
"navigationBarTitleText": "登录",
"enablePullDownRefresh": false
}
},

@ -57,7 +57,7 @@
<!-- 考核成绩 -->
<template v-else>
<view v-if="list.length" class="list">
<view v-for="(item, i) in list" :key="i" class="item" @click="toDetail(item)">
<view v-for="(item, i) in list" :key="i" class="item" @click="toReport(item)">
<view class="c-name">{{ item.experimentalName }}</view>
<view class="line">得分{{ item.score }}&emsp;&emsp;耗时{{ item.timeSum }}min</view>
<view class="line">考核开始时间{{ item.startTime }}</view>
@ -74,7 +74,7 @@
</template>
<script>
import { experimentOverview, getSchoolEffectiveCourse, queryPracticeByStudent, queryAssessmentByStudent } from '@/apis/modules/course.js'
import { experimentOverview, getSchoolEffectiveCourse, queryPracticeByStudent, queryAssessmentByStudent, getALinkToTheExperimentReport, getExamPaperReportUrl } from '@/apis/modules/course.js'
export default {
data() {
return {
@ -169,6 +169,46 @@
toPrac(row) {
this.$util.to(`/course/practiceDetail/practiceDetail?cid=${row.curriculumId}&projectId=${row.projectId || ''}&paperId=${row.paperId || ''}`)
},
//
async toReport(row) {
uni.showLoading({
title: '加载中',
mask: true
})
let res
if (row.paperId) {
//
res = await getExamPaperReportUrl({
reportId: row.reportId
})
} else {
//
res = await getALinkToTheExperimentReport(row.reportId)
}
//
uni.downloadFile({
url: res.url,
success: function(res) {
console.log(11, res)
// doc, xls, ppt, pdf, docx, xlsx, pptx
uni.openDocument({
filePath: res.tempFilePath,
fileType: 'docx', // doc, xls, ppt, pdf, docx, xlsx, pptx
showMenu: true, //
success: res => {
uni.hideLoading()
},
fail: openError => {
uni.hideLoading()
}
})
},
fail: function(err) {
uni.hideLoading()
}
})
},
}
}
</script>

@ -2,8 +2,8 @@
<view class="page">
<view class="wrap">
<image class="logo" src="https://eduvessel.com/images/occupationlab/hjyz-logo.png" mode="widthFix"></image>
<button v-if="isBind" class="btn" open-type="getPhoneNumber" @getphonenumber="onGetPhoneNumber">快捷登录</button>
<button v-else class="btn" @click="toAccounts">快捷登录</button>
<button v-if="!agree.length" class="btn"@click="toAccounts">登录</button>
<button v-else class="btn" open-type="getPhoneNumber" @getphonenumber="toAccounts">登录</button>
<view class="agree">
<uni-data-checkbox class="check" multiple v-model="agree" :localdata="agreeData"></uni-data-checkbox>
@ -15,11 +15,12 @@
</template>
<script>
import { studentWeChatAppletCallback, studentBinding, weChatToken } from '@/apis/modules/user.js'
import { studentWeChatAppletCallback, studentBinding } from '@/apis/modules/user.js'
import WXBizDataCrypt from '@/libs/WXBizDataCrypt'
export default {
data() {
return {
token: uni.getStorageSync('token'),
agree: [],
agreeData: [{
text: '同意',
@ -29,37 +30,18 @@
openid: '',
unionid: '',
submiting: false,
token: '',
isBind: false,
accounts: [],
}
},
onShow() {
const pages = getCurrentPages()
const { options } = pages[pages.length - 1]
this.fromLogout = options.logout || 0
this.checkLogin()
this.submiting = false
this.autoLogin()
},
methods: {
//
checkLogin() {
if (uni.getStorageSync('token')) {
this.toIndex()
} else {
uni.clearStorageSync()
this.token = ''
this.isBind = false
this.submiting = false
this.autoLogin()
}
},
// openid
autoLogin() {
uni.login({
success: async ({ code }) => {
if (code) {
//
try {
const res = await studentWeChatAppletCallback({
code,
@ -71,16 +53,6 @@
this.openid = e.openid
uni.setStorageSync('sessionKey', e.session_key)
uni.setStorageSync('openid', e.openid)
//
if (data.state === 'login') {
this.token = data.token
} else if (data.state === 'bind') {
//
this.isBind = true
} else if (data.data.userAccounts) {
//
this.accounts = JSON.stringify(data.data.userAccounts)
}
} catch (e) {}
} else {
that.$util.errMsg('登录失败!')
@ -88,34 +60,35 @@
}
})
},
async toAccounts() {
async toAccounts(e) {
if (this.agree.length) {
if (this.submiting) return false
this.submiting = true
if (!this.token) {
uni.setStorageSync('accounts', this.accounts)
this.$util.to(`/user/selectAccount/selectAccount?openid=${this.openid}`)
} else {
uni.setStorageSync('token', this.token)
this.toIndex()
}
} else {
this.$util.errMsg('请先阅读勾选协议!')
}
},
//
async onGetPhoneNumber(e){
if (this.agree.length) {
if (this.submiting) return false
const { encryptedData, iv } = e.detail
const appId = uni.getAccountInfoSync().miniProgram.appId
const pc = new WXBizDataCrypt(appId , this.sessionKey)
const decData = pc.decryptData(encryptedData , iv)
this.submiting = true
const phone = decData.phoneNumber
uni.setStorageSync('phone', phone)
//
this.$util.to(`/user/reg/reg?openid=${this.openid}&phone=${phone}`)
const { data } = await studentBinding({
openid: this.openid,
phone,
platformId: 1
})
if (data) {
if (data.token) {
//
uni.setStorageSync('token', data.token)
this.toIndex()
} else if (data.userAccounts) {
//
uni.setStorageSync('accounts', JSON.stringify(data.userAccounts))
this.$util.to(`/user/selectAccount/selectAccount?openid=${this.openid}`)
}
} else {
//
this.$util.to(`/user/reg/reg`)
}
} else {
this.$util.errMsg('请先阅读勾选协议!')
}
@ -154,9 +127,6 @@
margin-bottom: 80rpx;
}
.btn {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 88rpx;
margin-bottom: 50rpx;

@ -118,6 +118,12 @@ ul {
.selected-list {
padding-left: 0;
}
.selected-area {
font-size: 28rpx !important;
}
.arrow-area {
display: none;
}
}
.picker-date {
.uni-date-x--border {
@ -130,8 +136,9 @@ ul {
display: none;
}
.uni-date__x-input {
height: 1.4rem;
line-height: 1.4rem;
height: 1.4rem !important;
line-height: 1.4rem !important;
font-size: 28rpx !important;
}
}
.selected-item-text-overflow {

@ -50,16 +50,16 @@
<view class="line">
<view class="name">性别</view>
<uni-data-picker class="picker-input" placeholder="请选择性别" popup-title="请选择性别" preload :clear-icon="false" :localdata="sex" v-model="hrUserInfo.sex"></uni-data-picker>
<uni-icons class="arrow" type="right" size="18" color="#ababab"></uni-icons>
</view>
<view class="line">
<view class="name">出生日期</view>
<uni-datetime-picker class="picker-date" type="date" placeholder="请选择出生日期" :clear-icon="false" v-model="hrUserInfo.dateBirth" />
<!-- <uni-icons class="arrow" type="right" size="18" color="#ababab"></uni-icons> -->
<uni-icons class="arrow" type="right" size="18" color="#ababab"></uni-icons>
</view>
<view class="line">
<view class="name">身份证号</view>
<input type="text" placeholder="请输入身份证号" v-model="hrUserInfo.idNumber" />
<uni-icons class="arrow" type="right" size="18" color="#ababab"></uni-icons>
</view>
<view class="line">
<view class="name">所在国家</view>
@ -68,14 +68,17 @@
<view class="line">
<view class="name">所在省份</view>
<uni-data-picker class="picker-input" placeholder="请选择省份" popup-title="请选择省份" preload :clear-icon="false" :localdata="provinces" v-model="hrUserInfo.provinceId" @change="getCity"></uni-data-picker>
<uni-icons class="arrow" type="right" size="18" color="#ababab"></uni-icons>
</view>
<view class="line">
<view class="name">所在城市</view>
<uni-data-picker class="picker-input" placeholder="请选择城市" popup-title="请选择城市" preload :clear-icon="false" :localdata="cities" v-model="hrUserInfo.cityId" :readonly="!hrUserInfo.provinceId"></uni-data-picker>
<uni-icons class="arrow" type="right" size="18" color="#ababab"></uni-icons>
</view>
<view class="line">
<view class="name">受教育程度</view>
<uni-data-picker class="picker-input" placeholder="请选择受教育程度" popup-title="请选择受教育程度" preload :clear-icon="false" :localdata="educationDegreeList" v-model="hrUserInfo.educationDegree"></uni-data-picker>
<uni-icons class="arrow" type="right" size="18" color="#ababab"></uni-icons>
</view>
<view class="line">
<view class="name">当前所在学校</view>
@ -89,7 +92,7 @@
<view class="p-title">
<image class="icon" src="https://eduvessel.com/images/occupationlab/files.svg" mode="widthFix"></image> &nbsp;个人档案
</view>
<uni-icons class="plus" type="plus" size="20" color="#007EFF" @click="addArch"></uni-icons>
<uni-icons class="plus" type="plus" size="26" color="#007EFF" @click="addArch"></uni-icons>
</view>
<view class="archives">
@ -549,6 +552,7 @@
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
}
.archives {
padding-bottom: 20rpx;

@ -1,8 +1,8 @@
<template>
<view class="page">
<view class="line">
<view class="label">手机号</view>
<input type="number" v-model.trim="form.phone" placeholder="请填写你的手机号" maxlength="11" />
<view class="label">手机号</view>
<input type="number" v-model.trim="form.phone" placeholder="请填写手机号" maxlength="11" />
</view>
<view class="line code-wrap not-bd">
<view class="label">验证码</view>
@ -36,7 +36,7 @@
//
sendCode() {
const { phone } = this.form
if (!phone) return this.$util.errMsg('请输入手机号')
if (!phone) return this.$util.errMsg('请输入手机号')
if (!/^1[3456789]\d{9}$/.test(phone) && !/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(phone)) return this.$util.errMsg('请输入正确的手机号')
//
sendPhoneOrEmailCode({

@ -13,11 +13,12 @@
<script>
import { captcha, weChatToken } from '@/apis/modules/user.js'
import WXBizDataCrypt from '@/libs/WXBizDataCrypt'
export default {
data() {
return {
openid: '',
phone: '',
openid: uni.getStorageSync('openid'),
phone: uni.getStorageSync('phone'),
form: {
account: '',
password: '',
@ -27,17 +28,9 @@
}
},
onShow() {
const pages = getCurrentPages()
const { options } = pages[pages.length - 1]
this.openid = options.openid
this.phone = options.phone || ''
this.getVerImg()
},
methods: {
getVerImg () { //
this.form.random = Math.floor(Math.random() * 999999999)
this.verImg = `${captcha}?random=${this.form.random}`
},
//
async submit() {
const { form } = this
@ -89,10 +82,12 @@
}
.btn {
width: 100%;
height: 80rpx;
margin-top: 50rpx;
height: 88rpx;
margin-bottom: 50rpx;
font-size: 32rpx;
line-height: 80rpx;
color: #fff;
background-color: #007EFF;
border-radius: 10rpx;
}
}
</style>

@ -25,7 +25,6 @@
data() {
return {
openid: '',
phone: '',
accounts: JSON.parse(uni.getStorageSync('accounts')),
}
},
@ -33,7 +32,6 @@
const pages = getCurrentPages()
const { options } = pages[pages.length - 1]
this.openid = options.openid
this.phone = options.phone
},
methods: {
//

@ -63,7 +63,7 @@
},
//
addAccount() {
this.$util.to(`../reg/reg?openid=${this.openid}&phone=`)
this.$util.to(`../reg/reg`)
}
}
}

Loading…
Cancel
Save