yujialong 3 months ago
parent 6618757af3
commit 313a1210d9
  1. 4
      apis/modules/course.js
  2. 4
      config/request.js
  3. 108
      course/practiceDetail/practiceDetail.vue
  4. 10
      pages/achievement/achievement.vue
  5. 2
      pages/index/index.vue
  6. 1
      pages/person/person.vue
  7. 1
      user/selectAccount/selectAccount.vue
  8. 6
      user/switchAccount/switchAccount.vue

@ -39,4 +39,8 @@ export const experimentOverview = () => {
export const getSchoolEffectiveCourse = () => {
return get('nakadai/nakadai/curriculum/getSchoolEffectiveCourse')
}
export const exportExamPaperReport = data => {
return get('exam/exam/paper/exportExamPaperReport', data)
}

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

@ -13,7 +13,7 @@
</template>
<script>
import { practiceByStudentDetail } from '@/apis/modules/course.js'
import { practiceByStudentDetail, exportExamPaperReport } from '@/apis/modules/course.js'
export default {
data() {
return {
@ -66,9 +66,107 @@
this.status = noMore ? 'noMore' : 'more' // noMore
this.reachBottom = noMore ? -1 : 0 // -1
},
saveFile(fileData) {
const fs = uni.getFileSystemManager();
//
const tempFilePath = `${uni.env.USER_DATA_PATH}/tempFile`;
console.log('临时文件路径:', uni.env, tempFilePath, fileData)
//
fs.writeFile({
filePath: tempFilePath,
data: fileData,
encoding: 'binary', // 使 binary
success: (res) => {
console.log('文件写入成功', res);
//
uni.saveFile({
tempFilePath: tempFilePath,
success: (res) => {
console.log('文件保存成功', res.savedFilePath);
uni.downloadFile({
// url: 'https://eduvessel.com/images/occupationlab/ac.docx',
url: res.savedFilePath,
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()
}
})
},
fail: (err) => {
console.error('文件保存失败', err);
}
});
},
fail: (err) => {
console.error('文件写入失败', err);
}
});
},
//
toDetail(row) {
// this.$util.to(path)
async toDetail(row) {
uni.showLoading({
title: '加载中',
mask: true
})
const res = await exportExamPaperReport({
reportId: row.reportId
})
this.saveFile(res)
return
//
uni.downloadFile({
url: 'https://eduvessel.com/images/occupationlab/ac校赛试卷四.docx',
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()
}
})
},
}
}
@ -83,7 +181,9 @@
.item {
position: relative;
padding: 20rpx 0;
border-bottom: 1px solid #e6e6e6;
&:not(:last-child) {
border-bottom: 1px solid #e6e6e6;
}
}
.c-name {
font-size: 32rpx;

@ -37,7 +37,8 @@
<ul class="tabs">
<li v-for="(item, i) in tabs" :key="i" :class="{active: curTab === item.id}" @click="tabChange(item.id)">{{ item.name }}</li>
</ul>
<uni-data-select class="select" v-model="mallId" :localdata="courses" @change="initList"></uni-data-select>
<uni-data-picker class="picker-input" preload :clear-icon="false" :localdata="courses" v-model="mallId" @change="initList"></uni-data-picker>
<!-- <uni-data-select class="select" v-model="mallId" :localdata="courses" @change="initList"></uni-data-select> -->
</view>
<!-- 练习成绩 -->
@ -140,9 +141,9 @@
})
}
const { page } = res
this.practices = this.reachBottom > 0 ? [...this.practices, ...page.records] : page.records
this.list = this.reachBottom > 0 ? [...this.list, ...page.records] : page.records
this.page++ // page+1
const noMore = this.practices.length === page.total //
const noMore = this.list.length === page.total //
this.status = noMore ? 'noMore' : 'more' // noMore
this.reachBottom = noMore ? -1 : 0 // -1
}
@ -159,7 +160,7 @@
},
//
toPrac(row) {
this.$util.to(`../practiceDetail/practiceDetail?cid=${this.cid}&projectId=${row.projectId || ''}&paperId=${row.paperId || ''}`)
this.$util.to(`/course/practiceDetail/practiceDetail?cid=${row.curriculumId}&projectId=${row.projectId || ''}&paperId=${row.paperId || ''}`)
},
}
}
@ -185,7 +186,6 @@
}
.tabs {
display: flex;
margin-bottom: 32rpx;
li {
position: relative;
margin-right: 40rpx;

@ -63,7 +63,7 @@
}, 1500)
},
onShow() {
// uni.setStorageSync('token', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOjM5NTc2LCJyblN0ciI6Ik5vcTB1UlNEZ0V0UExOUzBSUWtSZHlVVGsxOFYycnpNIiwiYWNjb3VudElkIjozOTU3NiwidXNlcklkIjozOTU3NSwic2Nob29sSWQiOjI4NDYsInVzZXJOYW1lIjoiYWMiLCJwbGF0Zm9ybUlkIjoiMSJ9.-YiaJdr5H2j6TGezs1eDS1EX5bNYCWGGghRw6eD3jk4')
uni.setStorageSync('token', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOjM5NTc2LCJyblN0ciI6IlNMbWxtU1E0akE2RUlBT2RPVTV5eENPSHVZa3lpeDUzIiwiYWNjb3VudElkIjozOTU3NiwidXNlcklkIjozOTU3NSwic2Nob29sSWQiOjI4NDYsInVzZXJOYW1lIjoiYWMiLCJwbGF0Zm9ybUlkIjoiMSJ9.ouC5QsZkRnTCI6qk7ZqEYMRoapp2qq0kkAxWakzvjC8')
this.getTab()
},
methods: {

@ -209,6 +209,7 @@
width: 60rpx;
height: 60rpx;
margin-right: 20rpx;
border-radius: 50%;
}
.name {
font-size: 24rpx;

@ -44,7 +44,6 @@
phone: this.phone,
platformId: 1,
})
debugger
uni.setStorageSync('token', data.token)
uni.switchTab({
url: '/pages/index/index'

@ -2,7 +2,7 @@
<view class="page">
<template v-if="list.length">
<ul class="list">
<li v-for="item in list" @change="checkChange(item)">
<li v-for="item in list" @click="checkChange(item)">
<view class="left">
<image class="avatar" :src="item.userAvatars || require('@/static/image/avatar.png')" mode=""></image>
<view class="info">
@ -56,6 +56,10 @@
openid: this.openid,
platformId: 1
})
uni.setStorageSync('token', data.token)
uni.switchTab({
url: '/pages/person/person'
})
},
//
addAccount() {

Loading…
Cancel
Save