yujialong 19 hours ago
parent cb43773265
commit 84c5e1fe95
  1. 12
      apis/modules/course.js
  2. 4
      config/request.js
  3. 12
      course/courseDetail/courseDetail.vue
  4. 85
      course/practiceDetail/practiceDetail.vue
  5. 2
      pages/achievement/achievement.vue
  6. 2
      pages/index/index.vue
  7. 71
      pages/login/login.vue
  8. 2
      styles/common.scss
  9. 2
      user/selectAccount/selectAccount.vue

@ -17,8 +17,8 @@ export const schoolCourse = data => {
return get('nakadai/nakadai/curriculum/schoolCourse', data)
}
export const queryChaptersAndSubsections = data => {
return get('nakadai/nakadai/curriculum/chapter/queryChaptersAndSubsections', data)
export const queryChaptersAndSubsections = id => {
return get('nakadai/nakadai/curriculum/chapter/queryChaptersAndSubsections/' + id)
}
export const detailsOfGoods = data => {
@ -55,4 +55,12 @@ export const playRecordSave = data => {
export const recordRecentUsage = mallId => {
return post(`nakadai/nakadai/curriculum/recordRecentUsage?mallId=${mallId}`)
}
export const getALinkToTheExperimentReport = reportId => {
return post(`occupationlab/occupationlab/achievement/getALinkToTheExperimentReport?reportId=${reportId}`)
}
export const getExamPaperReportUrl = data => {
return get(`exam/exam/paper/getExamPaperReportUrl`, data)
}

@ -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'
},

@ -209,7 +209,6 @@
}
},
onUnload () {
console.log('hide fn')
//
if (this.cid) {
playRecordSave({
@ -232,10 +231,7 @@
//
async getChapter () {
if (this.cid) {
const res = await queryChaptersAndSubsections({
keyword: this.keyword,
courseId: this.cid,
})
const res = await queryChaptersAndSubsections(this.cid)
this.chapterList = res.chapterList
}
},
@ -538,7 +534,8 @@
.chapterName {
display: flex;
justify-content: space-between;
font-size: 26rpx;
font-size: 30rpx;
font-weight: 600;
color: #333;
}
.arrow {
@ -549,6 +546,7 @@
transition: .5s;
overflow: hidden;
&.shrink {
// display: none;
height: 0;
// transform: scaleY(0);
}
@ -556,7 +554,7 @@
.sectionName {
display: flex;
align-items: center;
margin: 30rpx 0;
margin: 40rpx 0;
font-size: 24rpx;
color: #333;

@ -14,7 +14,7 @@
<script>
import OSS from '@/libs/Oss/upload'
import { practiceByStudentDetail, exportExamPaperReport } from '@/apis/modules/course.js'
import { practiceByStudentDetail, exportExamPaperReport, getALinkToTheExperimentReport, getExamPaperReportUrl } from '@/apis/modules/course.js'
export default {
data() {
return {
@ -72,79 +72,26 @@
this.reachBottom = 0
this.getList()
},
saveFile(fileData) {
console.log('url:', fileData)
uni.downloadFile({
// url: 'https://eduvessel.com/images/occupationlab/ac.docx',
url: fileData,
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: 'docx', // doc, xls, ppt, pdf, docx, xlsx, pptx
showMenu: true, //
success: res => {
uni.hideLoading()
},
fail: openError => {
uni.hideLoading()
}
})
},
fail: function(err) {
uni.hideLoading()
}
})
},
//
async toDetail(row) {
// uni.showLoading({
// title: '',
// mask: true
// })
// const that = this
// uni.request({
// header: {
// token: uni.getStorageSync('token')
// },
// url: 'https://izhixinyun.com/exam/exam/paper/exportExamPaperReport?reportId=73157',
// method: 'GET', // GET
// data: {},
// // responseType: 'blob',
// success: (res) => {
// console.log(4444, res)
// OSS(res.data, ({ url }) => {
// console.log('ffff:', url)
// // that.saveFile(url)
// })
// },
// fail: err => {
// console.log('fail:',fail)
// uni.showToast({
// title: '',
// icon: 'none'
// })
// },
// })
// return
// const res = await exportExamPaperReport({
// reportId: row.reportId
// })
// this.saveFile(res)
uni.showLoading({
title: '加载中',
mask: true
})
// return
let res
if (row.paperId) {
//
res = await getExamPaperReportUrl({
reportId: row.reportId
})
} else {
//
res = await getALinkToTheExperimentReport(row.reportId)
}
//
uni.downloadFile({
// url: 'https://eduvessel.com/images/occupationlab/ac.docx',
url: 'https://huoran.oss-cn-shenzhen.aliyuncs.com/1732592617329.docx',
url: res.url,
success: function(res) {
console.log(11, res)
uni.hideLoading();

@ -99,7 +99,7 @@
pageSize: 10,
}
},
onShow() {
onLoad() {
this.getOverview()
this.getCourse()
this.$refs.realName.handleRealName()

@ -173,7 +173,7 @@
-webkit-line-clamp: 2;
text-overflow: ellipsis;
overflow: hidden;
height: 64rpx;
height: 68rpx;
margin: 10rpx 0 16rpx;
font-size: 26rpx;
color: #333;

@ -29,12 +29,16 @@
openid: '',
unionid: '',
submiting: false,
token: '',
isBind: false,
accounts: [],
}
},
onShow() {
// uni.setStorageSync('token', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOjM5NTc2LCJyblN0ciI6IjZXZUtCNTdOMU9ubGhBSG53RmJwMWN0c3VuVWlyR2l5IiwiYWNjb3VudElkIjozOTU3NiwidXNlcklkIjozOTU3NSwic2Nob29sSWQiOjI4NDYsInVzZXJOYW1lIjoiYWMiLCJwbGF0Zm9ybUlkIjoiMSJ9.hYkjwTUdMMYQLXJVRmqnw3tqRvGndNAzUiVh1ClyCec')
const pages = getCurrentPages()
const { options } = pages[pages.length - 1]
this.fromLogout = options.logout || 0
this.checkLogin()
},
methods: {
@ -44,6 +48,8 @@
this.toIndex()
} else {
uni.clearStorageSync()
this.token = ''
this.isBind = false
this.submiting = false
this.autoLogin()
}
@ -53,8 +59,6 @@
uni.login({
success: async ({ code }) => {
if (code) {
this.submiting = true
//
try {
const res = await studentWeChatAppletCallback({
@ -62,7 +66,6 @@
avatarUrl: ''
})
const { data } = res
this.submiting = false
const e = data.sessionKey
this.sessionKey = e.session_key
this.openid = e.openid
@ -70,8 +73,7 @@
uni.setStorageSync('openid', e.openid)
//
if (data.state === 'login') {
uni.setStorageSync('token', data.token)
this.toIndex()
this.token = data.token
} else if (data.state === 'bind') {
//
this.isBind = true
@ -79,50 +81,43 @@
//
this.accounts = JSON.stringify(data.data.userAccounts)
}
} catch (e) {
this.submiting = false
}
} catch (e) {}
} else {
this.submiting = false
that.$util.errMsg('登录失败!')
}
}
})
},
async toAccounts() {
uni.setStorageSync('accounts', this.accounts)
this.$util.to(`/user/selectAccount/selectAccount?openid=${this.openid}`)
},
//
async onGetPhoneNumber(e){
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)
const { data } = await studentBinding({
openid: this.openid,
phone,
platformId: 1
})
if (data) {
const accounts = data.userAccounts
if (accounts) {
//
uni.setStorageSync('accounts', JSON.stringify(accounts))
this.$util.to(`/user/selectAccount/selectAccount?openid=${this.openid}&phone=${phone}`)
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', data.token)
uni.switchTab({
url: '/pages/index/index'
})
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}`)
} else {
this.$util.errMsg('请先阅读勾选协议!')
}
},
toAgreement(id) {

@ -103,7 +103,7 @@ ul {
}
.action {
position: absolute;
top: 24rpx;
top: 32rpx;
right: 20rpx;
font-size: 26rpx;
color: #3394f7;

@ -1,6 +1,6 @@
<template>
<view class="page">
<view class="tips">已为你展示{{ phone }}手机号关联的账号登录后可在切换账号列表快捷切换至其他账号</view>
<view class="tips">已为你展示当前微信关联的账号登录后可在切换账号列表快捷切换至其他账号</view>
<template v-if="accounts.length">
<ul class="list">

Loading…
Cancel
Save