Merge branch 'develop' into 'sit'
Develop See merge request K17_AITS/tra-app!122
This commit is contained in:
+5
-6
@@ -15,22 +15,21 @@ VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001'
|
||||
|
||||
# h5专用地址
|
||||
|
||||
VITE_APP_BASE_H5_API_Url = 'https://aitstest.jlbank.com.cn:7002'
|
||||
#VITE_APP_BASE_H5_API_Url = 'http://25.16.122.65:7001'
|
||||
#VITE_APP_BASE_H5_API_Url = 'http://25.18.122.21:9786'
|
||||
# VITE_APP_BASE_H5_API_Url = 'https://aitstest.jlbank.com.cn:7002'
|
||||
|
||||
# dev
|
||||
VITE_APP_BASE_H5_API_Url = 'http://25.18.122.65:7001'
|
||||
# sit
|
||||
# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.91:9786'
|
||||
#VITE_APP_BASE_H5_API_Url = 'http://25.18.122.91:9786'
|
||||
|
||||
# UAT
|
||||
# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.78:9786'
|
||||
|
||||
# 任东
|
||||
|
||||
#VITE_APP_BASE_H5_API_Url_TRAAPP = 'http://25.64.16.130:9601'
|
||||
#VITE_APP_BASE_H5_API_Url_TRASTUDY = 'http://25.64.16.130:9602'
|
||||
|
||||
# VITE_APP_BASE_H5_API_Url_TRAAPP = 'http://25.64.16.130:9601'
|
||||
# VITE_APP_BASE_H5_API_Url_TRASTUDY = 'http://25.64.16.130:9602'
|
||||
|
||||
# VITE_APP_BASE_H5_API_Url_TRAEXAM = 'http://25.64.16.140:9604'
|
||||
# 张建成
|
||||
|
||||
@@ -3,3 +3,4 @@ ENV = 'production'
|
||||
|
||||
# base api
|
||||
VITE_APP_BASE_API_Url = 'https://aits.jlbank.com.cn:7001'
|
||||
# VITE_APP_BASE_API_Url = 'http://25.18.122.21:9786'
|
||||
+39
@@ -10,6 +10,45 @@
|
||||
// console.log('预加载');
|
||||
},
|
||||
onShow: function () {
|
||||
// 获取浏览器版本信息
|
||||
function getBrowserInfo() {
|
||||
const userAgent = navigator.userAgent;
|
||||
let browserName = '未知浏览器';
|
||||
let version = '未知版本';
|
||||
|
||||
// 检测 Chrome
|
||||
if (userAgent.indexOf('Chrome') > -1 && userAgent.indexOf('Edg') === -1) {
|
||||
browserName = 'Chrome';
|
||||
version = userAgent.match(/Chrome\/(\d+\.\d+)/)[1];
|
||||
}
|
||||
// 检测 Edge (Chromium内核)
|
||||
else if (userAgent.indexOf('Edg') > -1) {
|
||||
browserName = 'Edge';
|
||||
version = userAgent.match(/Edg\/(\d+\.\d+)/)[1];
|
||||
}
|
||||
// 检测 Firefox
|
||||
else if (userAgent.indexOf('Firefox') > -1) {
|
||||
browserName = 'Firefox';
|
||||
version = userAgent.match(/Firefox\/(\d+\.\d+)/)[1];
|
||||
}
|
||||
// 检测 Safari
|
||||
else if (userAgent.indexOf('Safari') > -1 && userAgent.indexOf('Chrome') === -1) {
|
||||
browserName = 'Safari';
|
||||
version = userAgent.match(/Version\/(\d+\.\d+)/)[1];
|
||||
}
|
||||
|
||||
return {
|
||||
browser: browserName,
|
||||
version: version,
|
||||
userAgent: userAgent
|
||||
};
|
||||
}
|
||||
|
||||
// 使用示例
|
||||
// const browserInfo = getBrowserInfo();
|
||||
// console.log(`浏览器: ${browserInfo.browser}`);
|
||||
// console.log(`版本号: ${browserInfo.version}`);
|
||||
// console.log(`完整用户代理: ${browserInfo.userAgent}`);
|
||||
// console.log('App Show')
|
||||
},
|
||||
onHide: function () {
|
||||
|
||||
@@ -24,36 +24,6 @@ export const useAccountLoginApp = (data) => request({
|
||||
}) => {
|
||||
if (rtnCode === '0000') {
|
||||
setToken(body)
|
||||
// 获取科技鹿
|
||||
// queryCurrentValidMascotInfo().then(({body}) => {
|
||||
// const userInfo = getUserInfo()
|
||||
// setUserInfo({
|
||||
// ...userInfo,
|
||||
// 'mascotInfo': body
|
||||
// })
|
||||
// const userInfo2 = getUserInfo()
|
||||
// console.log('设置科技鹿', userInfo2);
|
||||
// if (body.imgAddr) {
|
||||
// setTimeout(() => {
|
||||
// const img = new Image(); // 创建Image对象
|
||||
// // 图片加载成功(缓存完成)
|
||||
// img.onload = () => {
|
||||
// console.log(`图片缓存成功: ${url}`);
|
||||
// resolve(img); // 返回加载完成的Image对象
|
||||
// };
|
||||
|
||||
// // 图片加载失败
|
||||
// img.onerror = () => {
|
||||
// console.error(`图片缓存失败: ${url}`);
|
||||
// reject(new Error(`Failed to load image: ${url}`));
|
||||
// };
|
||||
|
||||
// // 开始加载图片(设置src触发请求,浏览器会自动缓存)
|
||||
// img.src = url;
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// const user_data = await queryCurrentUser()
|
||||
const res = await Promise.all([queryCurrentUser(), queryCurrentValidMascotInfo()])
|
||||
const userInfo = getUserInfo()
|
||||
const mascotInfo = res[1]
|
||||
|
||||
+2
-1
@@ -10,7 +10,8 @@ export const get_base_url = (url = '') => {
|
||||
// #ifdef H5
|
||||
if (url) {
|
||||
let _str = (url.split('/')[0] || url.split('/')[1])?.toUpperCase()
|
||||
return ENV[`VITE_APP_BASE_H5_API_Url_${_str}`] || ENV.VITE_APP_BASE_H5_API_Url || ENV.VITE_APP_BASE_API_Url
|
||||
return ENV[`VITE_APP_BASE_H5_API_Url_${_str}`] || ENV.VITE_APP_BASE_H5_API_Url || ENV
|
||||
.VITE_APP_BASE_API_Url
|
||||
} else {
|
||||
return ENV.VITE_APP_BASE_H5_API_Url || ENV.VITE_APP_BASE_API_Url
|
||||
}
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
import { computed, unref, ref, toRefs, watch, onMounted, nextTick } from 'vue';
|
||||
import { onUnload } from '@dcloudio/uni-app';
|
||||
import { useAudioStore } from '@/store/audioStore';
|
||||
import {downloadFile} from '@/api/common.js'
|
||||
const props = defineProps({
|
||||
dataInfo: {
|
||||
default: () => ({}),
|
||||
@@ -210,11 +211,17 @@
|
||||
// 赋值显示
|
||||
voiceTime.value = displayTime + 's';
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.dataInfo.voicePath,
|
||||
(newVal) => {
|
||||
audioStore.setAudioSrc(newVal);
|
||||
if(newVal === '' && props.dataInfo.ossKey) { // 去下载oss内容
|
||||
console.log('去下载oss内容');
|
||||
downloadFile(props.dataInfo.ossKey).then(res => {
|
||||
audioStore.setAudioSrc(res.tempFilePath);
|
||||
})
|
||||
} else {
|
||||
audioStore.setAudioSrc(newVal);
|
||||
}
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
|
||||
@@ -270,9 +270,11 @@
|
||||
// 点击答题
|
||||
const click_option = (analysisVo) => {
|
||||
if (props.isPreview || !props.clearResult) return;
|
||||
|
||||
// 无论什么类型如果表里已经有了,再次点击就是弹出
|
||||
if (item_answer.value.includes(analysisVo.itemId)) {
|
||||
item_answer.value = item_answer.value.filter((id) => id !== analysisVo.itemId);
|
||||
modelValue.value = item_answer.value;
|
||||
if (!['study'].includes(props.mode)) {
|
||||
muCheckbox('choose');
|
||||
}
|
||||
@@ -280,21 +282,25 @@
|
||||
// 单选
|
||||
// 单选插入,并且移除其他
|
||||
item_answer.value[0] = analysisVo.itemId;
|
||||
modelValue.value = item_answer.value;
|
||||
muCheckbox('choose');
|
||||
} else if (props.item.qnsTyp === 'MU') {
|
||||
// 多选题
|
||||
// 多选直接插入
|
||||
item_answer.value.push(analysisVo.itemId);
|
||||
modelValue.value = item_answer.value;
|
||||
if (!['study'].includes(props.mode)) {
|
||||
muCheckbox('choose');
|
||||
}
|
||||
|
||||
} else if (props.item.qnsTyp === 'JD') {
|
||||
// 判断题
|
||||
// 判断插入,并且移除其他
|
||||
item_answer.value = [analysisVo.itemId];
|
||||
modelValue.value = item_answer.value;
|
||||
muCheckbox('choose');
|
||||
}
|
||||
modelValue.value = item_answer.value;
|
||||
|
||||
};
|
||||
const muBtnClick = () => {
|
||||
if(item_answer.value.length === 0){
|
||||
|
||||
@@ -436,7 +436,7 @@ import { onShow } from "@dcloudio/uni-app"
|
||||
height: 588rpx;
|
||||
padding-bottom: 80rpx;
|
||||
overflow-y: hidden;
|
||||
z-index: 10;
|
||||
z-index: 15;
|
||||
background-color: #f9f9f9;
|
||||
box-shadow: 0rpx 12rpx 20rpx rgba(160,160,160,.25);
|
||||
border-radius: 0 0 0rpx 0rpx;
|
||||
|
||||
@@ -719,7 +719,7 @@ onHide(() => {
|
||||
//#ifdef APP-PLUS
|
||||
uni.offKeyboardHeightChange(setHeight)
|
||||
// #endif
|
||||
if (watchFlag.value === 1) return
|
||||
// if (watchFlag.value === 1) return
|
||||
changePlayItemId('')
|
||||
socketStore.closeSocket()
|
||||
// common.show('提示信息', '检测到您已离开,即将退出学习页面。',false, '','确认').then((res) => {
|
||||
@@ -739,6 +739,7 @@ onUnload(() => {
|
||||
changePlayItemId()
|
||||
teacherVoiceObj?.stop?.()
|
||||
teacherVoiceObj.src = ''
|
||||
socketStore.closeSocket()
|
||||
})
|
||||
const testAnswer = computed(() => {
|
||||
if (talkingList.value.length < 5) return true
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
// 跳转到详情
|
||||
const click_list_item = (list_item) => {
|
||||
common.navigateTo(
|
||||
`/pages/courseRecord/courseStudyRecordDetail?stdyId=${list_item.stdyBatch}&crsName=${item.value.crsName || ''}`
|
||||
`/pages/courseRecord/courseStudyRecordDetail?stdyId=${list_item.stdyId}&crsName=${item.value.crsName || ''}`
|
||||
);
|
||||
};
|
||||
</script>
|
||||
|
||||
+104
-30
@@ -52,7 +52,7 @@
|
||||
<scroll-view :scroll-y="true" class="scroll-Y" :show-scrollbar="false" :refresher-threshold="0">
|
||||
<Subject
|
||||
:item="item"
|
||||
:mode="mode"
|
||||
mode="examination"
|
||||
@subject_click="subject_click"
|
||||
:clearResult="true"
|
||||
v-model="item.my_answer"
|
||||
@@ -155,7 +155,7 @@
|
||||
import Dialog from './components/dialog.vue';
|
||||
import Subject from '@/components/examination/subject.vue';
|
||||
import TouchBtn from '@/components/examination/touchBtn.vue';
|
||||
import { ref, reactive, computed, onMounted } from 'vue';
|
||||
import { ref, reactive, computed, onMounted, nextTick } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import common from '@/common/common';
|
||||
import { getPageCache, setupKeyboardHeightListener } from '@/common/common';
|
||||
@@ -181,14 +181,15 @@
|
||||
backgroundColor: '#E2EDFF',
|
||||
borderRadius: '8rpx'
|
||||
};
|
||||
const mode = 'examination'; // 考试 examination 练习practice
|
||||
let mode = ''; // 课程考试CRS,考试中心考试PAPERS
|
||||
const paperData = reactive({
|
||||
crsId: '', // 课程ID,通过课程id是否为空字符串判断这个试卷是课程考试还是考试中心考试
|
||||
execId: '', // 执行ID
|
||||
examId: '', // 考试ID
|
||||
papersId: '', // 试卷ID
|
||||
limitTm: 0, // 考试限制时间
|
||||
papersName: '' // 试卷名称
|
||||
papersName: '', // 试卷名称
|
||||
isCacheExam: '' // 是否是缓存试卷(继续答题试卷)
|
||||
}); // 试卷信息
|
||||
const topicList = reactive([]); // 问题列表
|
||||
const popup_input_bottom = ref('0px');
|
||||
@@ -266,7 +267,7 @@
|
||||
questionNumber.value = index;
|
||||
popupRef.value.close();
|
||||
};
|
||||
|
||||
|
||||
const subject_click = (type, params) => {
|
||||
if (type === 'mark') {
|
||||
topicList[questionNumber.value]['mark'] = !topicList[questionNumber.value]['mark'];
|
||||
@@ -277,15 +278,11 @@
|
||||
// 问答题点击重答
|
||||
topic.value.my_answer = {};
|
||||
topic.value.es_status = ''; // 取消转圈
|
||||
} else if (type === 'answer') {
|
||||
//多选点击按钮答题
|
||||
if (params.qnsTyp === 'MU') {
|
||||
hand_in_paper_cache()
|
||||
}
|
||||
hand_in_paper_cache();
|
||||
} else if (type === 'choose') {
|
||||
//单选判断点击选项答题
|
||||
if (['JD', 'SN'].includes(params.qnsTyp)) {
|
||||
hand_in_paper_cache()
|
||||
//单选判断点击选项答题,为了缓存,考试这里多选没按钮,也是按照一个选项一个选项的触发
|
||||
if (['JD', 'SN', 'MU'].includes(params.qnsTyp)) {
|
||||
hand_in_paper_cache();
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -312,6 +309,7 @@
|
||||
ossAddr: _res.body.ossFileAddr,
|
||||
voicePath: voicePath
|
||||
};
|
||||
hand_in_paper_cache();
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -324,14 +322,49 @@
|
||||
topic.value.my_answer = {
|
||||
anserResult: submitObj // 正确答案文字内容
|
||||
};
|
||||
hand_in_paper_cache();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
let examinationAnswerCacheKey;
|
||||
const answerCacheList = ref({});
|
||||
const setAnswerCacheList = (value) => {
|
||||
console.log('触发变化', value);
|
||||
answerCacheList.value = value;
|
||||
common.setValue(examinationAnswerCacheKey, value);
|
||||
};
|
||||
// const answerCacheList = computed({
|
||||
// get() {
|
||||
// const cacheList = common.getValue(examinationAnswerCacheKey);
|
||||
// if (cacheList) return cacheList;
|
||||
// return {};
|
||||
// },
|
||||
// set(value) {
|
||||
// console.log('触发变化', value);
|
||||
// common.setValue(examinationAnswerCacheKey, value); // 补充键参数
|
||||
// }
|
||||
// });
|
||||
|
||||
// 添加试题答案缓存
|
||||
const addTopicAnswerCache = () => {
|
||||
|
||||
}
|
||||
|
||||
const my_answer = topic.value.my_answer;
|
||||
const qnsId = topic.value.qnsId;
|
||||
console.log('asdsadas', answerCacheList.value);
|
||||
const newCache = { ...answerCacheList.value };
|
||||
if(topic.value.qnsTyp === 'ES') { // 问答题特殊处理
|
||||
if('anserResult' in my_answer && my_answer.anserResult !== '') {
|
||||
newCache[qnsId] = {...my_answer, voicePath:''};
|
||||
} else {
|
||||
delete newCache[qnsId];
|
||||
}
|
||||
} else {
|
||||
newCache[qnsId] = my_answer;
|
||||
}
|
||||
|
||||
setAnswerCacheList(newCache);
|
||||
// answerCacheList.value = newCache;
|
||||
};
|
||||
|
||||
// 初始化时检查
|
||||
onLoad(() => {
|
||||
const examination = getPageCache('examination');
|
||||
@@ -347,20 +380,58 @@
|
||||
paperData.papersId = examination.papersId;
|
||||
paperData.limitTm = examination.limitTm;
|
||||
paperData.papersName = examination.papersName;
|
||||
// 获取上一次答题的缓存
|
||||
// const answerCacheList = common.getValue('')
|
||||
paperData.isCacheExam = examination.isCacheExam || 'N';
|
||||
mode = paperData.examId ? 'PAPERS' : 'CRS'; // 课程考试CRS,考试中心考试PAPERS
|
||||
// 设置缓存的键的名称
|
||||
const suffix = mode === 'PAPERS' ? paperData.examId : paperData.crsId;
|
||||
examinationAnswerCacheKey = 'examinationAnswerCache' + suffix;
|
||||
answerCacheList.value = common.getValue(examinationAnswerCacheKey) ?? {};
|
||||
console.log('刚进入', answerCacheList.value);
|
||||
topicList.push(
|
||||
...examination.qnsInfoVos.map((res) => ({
|
||||
...res,
|
||||
mark: false,
|
||||
my_answer: []
|
||||
}))
|
||||
...examination.qnsInfoVos.map((res) => {
|
||||
const es_status =
|
||||
paperData.isCacheExam === 'N'
|
||||
? ''
|
||||
: res.qnsId in answerCacheList.value
|
||||
? 'ossKey' in answerCacheList.value[res.qnsId]
|
||||
? '02'
|
||||
: '01'
|
||||
: '';
|
||||
const my_answer =
|
||||
paperData.isCacheExam === 'N'
|
||||
? []
|
||||
: res.qnsId in answerCacheList.value
|
||||
? answerCacheList.value[res.qnsId]
|
||||
: [];
|
||||
return {
|
||||
...res,
|
||||
mark: false,
|
||||
es_status: es_status,
|
||||
my_answer: my_answer
|
||||
};
|
||||
})
|
||||
);
|
||||
setupKeyboardHeightListener((height) => {
|
||||
popup_input_bottom.value = `${height}px`;
|
||||
});
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
if (paperData.isCacheExam === 'Y') {
|
||||
// 代表是缓存来的
|
||||
dialogRef.value.open({
|
||||
title: '中途退出考试,请继续答题',
|
||||
buttonList: [
|
||||
{
|
||||
key: 'revert',
|
||||
name: '继续答题',
|
||||
style: style_button_1
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
});
|
||||
setTimeout(() => {
|
||||
countDownRef.value.start();
|
||||
}, 500);
|
||||
@@ -489,16 +560,17 @@
|
||||
};
|
||||
// 提交当前所有填写了答案的题的缓存
|
||||
const hand_in_paper_cache = () => {
|
||||
// 获取当前题目
|
||||
addTopicAnswerCache();
|
||||
|
||||
const answerDtoList = getAnswerDtoList();
|
||||
commitPaperCache({
|
||||
examTyp: paperData.examId ? 'PAPERS' : 'CRS',
|
||||
papersId: paperData.papersId,
|
||||
examId: paperData.examId??'',
|
||||
examId: paperData.examId ?? '',
|
||||
execId: paperData.execId,
|
||||
answerDtoStr: JSON.stringify(answerDtoList)
|
||||
}).then((res) => {
|
||||
console.log('提交当前所有填写了答案的题的缓存222222', res);
|
||||
});
|
||||
}).then((res) => {});
|
||||
};
|
||||
// 执行交卷
|
||||
const hand_in_paper = (strs = '') => {
|
||||
@@ -514,7 +586,7 @@
|
||||
// 这里是考试中心考试
|
||||
func = commitPaperExam({
|
||||
papersId: paperData.papersId,
|
||||
examId: paperData.examId??'',
|
||||
examId: paperData.examId ?? '',
|
||||
execId: paperData.execId,
|
||||
examLenTm: examLenTm,
|
||||
answerDtoStr: JSON.stringify(answerDtoList)
|
||||
@@ -528,12 +600,14 @@
|
||||
});
|
||||
}
|
||||
func.then((res) => {
|
||||
// 交卷成功,清除缓存
|
||||
common.setValue(examinationAnswerCacheKey, null);
|
||||
// 考试完成事件
|
||||
uni.$emit('exam_completed');
|
||||
// 判断是否需要查分
|
||||
const flagQueryDetail = res.body.flagQueryDetail === '' ? res.body.flagQuery : res.body.flagQueryDetail;
|
||||
common.redirectTo(
|
||||
`/pages/examination/result?execId=${res.body.execId}&flagQuery=${res.body.flagQuery}&flagQueryDetail=${flagQueryDetail}&examLenTm=${examLenTm}&papersName=${paperData.papersName}&papersId=${paperData.papersId}&mode=${mode}&crsId=${paperData.crsId}`
|
||||
`/pages/examination/result?execId=${res.body.execId}&flagQuery=${res.body.flagQuery}&flagQueryDetail=${flagQueryDetail}&papersName=${paperData.papersName}&papersId=${paperData.papersId}&mode=examination&crsId=${paperData.crsId}`
|
||||
);
|
||||
})
|
||||
.catch((res) => {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<view class="seek-setting">
|
||||
<image src="@/static/images/dialog/new-dialog.png" alt="" class="image-icon-new" @click="createNewDialog">
|
||||
</image>
|
||||
<image src="@/static/images/dialog/history.png" alt="" class="image-icon" @click="showMenuList = true"></image>
|
||||
<image src="@/static/images/dialog/history.png" alt="" class="image-icon" @click="showMenuList = !showMenuList"></image>
|
||||
<view :class="['more-list', showMenuList? 'show':'']">
|
||||
<view class="more-item" @click.stop="showHistory">历史</view>
|
||||
<view class="more-item" @click.stop="toMessage">消息</view>
|
||||
@@ -200,7 +200,9 @@
|
||||
|
||||
|
||||
const createNewDialog = () => {
|
||||
common.msg('已经是最新对话')
|
||||
if(talkingList.value.length === 0){
|
||||
common.msg('已经是最新对话')
|
||||
}
|
||||
common.redirectTo(`/pages/index/dialog`)
|
||||
}
|
||||
const showModelComfirm = ref(false)
|
||||
|
||||
@@ -728,7 +728,7 @@
|
||||
font-style: normal;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
|
||||
:deep(.uv-notice-bar) {
|
||||
padding: 9px 2px;
|
||||
}
|
||||
|
||||
+100
-121
@@ -1,127 +1,106 @@
|
||||
<template>
|
||||
<view class="popup-view">
|
||||
<view class="body-title">
|
||||
<uv-icon class="arrow-icon" name="arrow-left" @click="backRouter()" />
|
||||
文件预览
|
||||
</view>
|
||||
<view class="popup-view-preview" v-if="showView">
|
||||
<web-view :src="showUrl" :fullscreen="true" :webview-styles="{
|
||||
width: '100%',
|
||||
height: '100%'
|
||||
}"></web-view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup-view">
|
||||
<view class="body-title">
|
||||
<uv-icon class="arrow-icon" name="arrow-left" @click="backRouter()" />
|
||||
文件预览
|
||||
</view>
|
||||
<view class="popup-view-preview" v-if="showView">
|
||||
<web-view
|
||||
:src="showUrl"
|
||||
:fullscreen="true"
|
||||
:webview-styles="{
|
||||
width: '100%',
|
||||
height: '100%'
|
||||
}"></web-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script >
|
||||
import {
|
||||
getToken
|
||||
} from "@/common/common.js"
|
||||
import common from '@/common/common';
|
||||
import {
|
||||
downloadFile
|
||||
} from "@/api/common.js"
|
||||
import {
|
||||
get_base_url
|
||||
} from '@/api/request.js'
|
||||
var wv
|
||||
export default{
|
||||
data(){
|
||||
return {
|
||||
fileId:'',
|
||||
showUrl:'',
|
||||
viewerUrl: '/static/pdf-view/web/viewer.html',
|
||||
showView: false,
|
||||
wv: null
|
||||
}
|
||||
},
|
||||
onLoad(params){
|
||||
this.fileId = params.fileId || '';
|
||||
},
|
||||
onShow(){
|
||||
this.openPdfFn({
|
||||
fileId: this.fileId
|
||||
})
|
||||
},
|
||||
onReady(){
|
||||
//#ifdef APP-PLUS
|
||||
var currentWebview = this.$scope.$getAppWebview()
|
||||
setTimeout(()=>{
|
||||
wv = currentWebview.children()[0]
|
||||
wv.setStyle({
|
||||
top: 80
|
||||
})
|
||||
uni.onKeyboardHeightChange(setHeight)
|
||||
},1000)
|
||||
// #endif
|
||||
},
|
||||
methods:{
|
||||
// setHeight(res){
|
||||
// wv.setStyle({
|
||||
// top: res.height + 20
|
||||
// })
|
||||
// },
|
||||
backRouter(){
|
||||
common.navigateBack()
|
||||
},
|
||||
openPdfFn(data){
|
||||
const base_url = get_base_url('/traask/traFilePreview/')
|
||||
const token = getToken();
|
||||
const header = {};
|
||||
let _id = data?.fileId
|
||||
let fileUrl = base_url + '/traask/traFilePreview/' + _id
|
||||
if (token)
|
||||
header['summary'] = token
|
||||
uni.downloadFile({
|
||||
//需要预览的文件地址
|
||||
url: fileUrl,
|
||||
header: header,
|
||||
success: (res) => {
|
||||
//下载成功,得到文件临时地址
|
||||
//条件编译,若为h5端则直接赋值文件地址
|
||||
// #ifdef H5
|
||||
let newUrl = res.tempFilePath
|
||||
// #endif
|
||||
//条件编译,若为App端,则需要将本地文件系统URL转换为平台绝对路径
|
||||
// #ifdef APP-PLUS
|
||||
let newUrl = plus.io.convertLocalFileSystemURL(res.tempFilePath)
|
||||
// #endif
|
||||
this.showUrl = this.viewerUrl + '?file=' + newUrl
|
||||
this.showView = true
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
<script>
|
||||
import { getToken } from '@/common/common.js'
|
||||
import common from '@/common/common'
|
||||
import { downloadFile } from '@/api/common.js'
|
||||
import { get_base_url } from '@/api/request.js'
|
||||
var wv
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
fileId: '',
|
||||
showUrl: '',
|
||||
// viewerUrl: '/static/pdf-view/web/viewer.html',
|
||||
viewerUrl: '/static/view-pdf/pdf.html',
|
||||
showView: false,
|
||||
wv: null
|
||||
}
|
||||
},
|
||||
onLoad(params) {
|
||||
this.fileId = params.fileId || ''
|
||||
},
|
||||
onShow() {
|
||||
this.openPdfFn({
|
||||
fileId: this.fileId
|
||||
})
|
||||
},
|
||||
onReady() {
|
||||
//#ifdef APP-PLUS
|
||||
var currentWebview = this.$scope.$getAppWebview()
|
||||
setTimeout(() => {
|
||||
wv = currentWebview.children()[0]
|
||||
wv.setStyle({
|
||||
top: 80
|
||||
})
|
||||
// uni.onKeyboardHeightChange(setHeight)
|
||||
}, 1000)
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
// setHeight(res){
|
||||
// wv.setStyle({
|
||||
// top: res.height + 20
|
||||
// })
|
||||
// },
|
||||
backRouter() {
|
||||
common.navigateBack()
|
||||
},
|
||||
openPdfFn(data) {
|
||||
const base_url = get_base_url('/traask/traFilePreview/')
|
||||
let _id = data?.fileId
|
||||
let fileUrl = base_url + '/traask/traFilePreview/' + _id
|
||||
this.showUrl = this.viewerUrl + '?url=' + fileUrl
|
||||
console.log(this.showUrl)
|
||||
this.showView = true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.popup-view{
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
}
|
||||
.body-title {
|
||||
height: 90rpx;
|
||||
text-align: center;
|
||||
font-size: 33rpx;
|
||||
padding-top: 10rpx;
|
||||
line-height: 46rpx;
|
||||
box-sizing: border-box;
|
||||
font-weight: 500;
|
||||
color: #000;
|
||||
position: fixed;
|
||||
top: var(--status-bar-height);
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
z-index: 10000;
|
||||
// margin-bottom: 23rpx;
|
||||
.arrow-icon {
|
||||
position: absolute;
|
||||
left: 21rpx;
|
||||
top: 5rpx;
|
||||
color: #000;
|
||||
padding: 15rpx;
|
||||
// background-color: red;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
.popup-view {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
}
|
||||
.body-title {
|
||||
height: 90rpx;
|
||||
text-align: center;
|
||||
font-size: 33rpx;
|
||||
padding-top: 10rpx;
|
||||
line-height: 46rpx;
|
||||
box-sizing: border-box;
|
||||
font-weight: 500;
|
||||
color: #000;
|
||||
position: fixed;
|
||||
top: var(--status-bar-height);
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
z-index: 10000;
|
||||
// margin-bottom: 23rpx;
|
||||
.arrow-icon {
|
||||
position: absolute;
|
||||
left: 21rpx;
|
||||
top: 5rpx;
|
||||
color: #000;
|
||||
padding: 15rpx;
|
||||
// background-color: red;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,3 +0,0 @@
|
||||
àRCopyright 1990-2009 Adobe Systems Incorporated.
|
||||
All rights reserved.
|
||||
See ./LICENSEáCNS2-H
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,3 +0,0 @@
|
||||
àRCopyright 1990-2009 Adobe Systems Incorporated.
|
||||
All rights reserved.
|
||||
See ./LICENSEá ETen-B5-H` ^
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,4 +0,0 @@
|
||||
àRCopyright 1990-2009 Adobe Systems Incorporated.
|
||||
All rights reserved.
|
||||
See ./LICENSE!!�º]aX!!]`�21�> �p�z�$]‚�"R‚d�-Uƒ7�*„␍4„%�+ „Z „{�/…%…<�9K…b�1]†.�"‡‰`]‡,�"]ˆ
|
||||
�"]ˆh�"]‰F�"]Š$�"]‹�"]‹`�"]Œ>�"]��"]�z�"]ŽX�"]�6�"]��"]�r�"]‘P�"]’.�"]“�"]“j�"]”H�"]•&�"]–�"]–b�"]—@�"]˜�"]˜|�"]™Z�"]š8�"]›�"]›t�"]œR�"]�0�"]ž�"]žl�"]ŸJ�"] (�"]¡�"]¡d�"]¢B�"]£ �"X£~�']¤W�"]¥5�"]¦�"]¦q�"]§O�"]¨-�"]©�"]©i�"]ªG�"]«%�"]¬�"]¬a�"]?�"]®�"]®{�"]¯Y�"]°7�"]±�"]±s�"]²Q�"]³/�"]´␍�"]´k�"]µI�"]¶'�"]·�"]·c�"]¸A�"]¹�"]¹}�"]º[�"]»9
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user