Commit d0dcf731 authored by youjie's avatar youjie

no message

parent 8c12371c
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="examList-box"> <view class="examList-box">
<view class="examList-import" @click="ImportInformation"> <view class="examList-import" @click="ImportInformation">
<van-icon name="plus" /> <van-icon name="plus" />
<text>导入考试信息</text> <text @click.stop="goUrlWebview">导入考试信息</text>
</view> </view>
<block v-if="dataList && dataList.length>0"> <block v-if="dataList && dataList.length>0">
<view class="examList activeOne" v-for="(item,index) in dataList" :key="index"> <view class="examList activeOne" v-for="(item,index) in dataList" :key="index">
...@@ -128,6 +128,17 @@ ...@@ -128,6 +128,17 @@
} }
) )
let methods = { let methods = {
// 跳web上传
goUrlWebview(){
data.userData = uni.getStorageSync('userInfo')
let dataContent = {
Uid:data.userData.Id,
CourseId:data.uploadParm.CourseId,
}
uni.navigateTo({
url: `/pages/webview/upload?exam=${encodeURIComponent(JSON.stringify(dataContent))}`
});
},
examDetails(item){ examDetails(item){
uni.navigateTo({ uni.navigateTo({
url: `/pages/index/examDetails?exam=${encodeURIComponent(JSON.stringify(item))}` url: `/pages/index/examDetails?exam=${encodeURIComponent(JSON.stringify(item))}`
......
...@@ -71,6 +71,11 @@ ...@@ -71,6 +71,11 @@
// "style": { // "style": {
// "navigationStyle": "custom" // "navigationStyle": "custom"
// } // }
},{
"path": "pages/webview/upload",
"style": {
"navigationStyle": "custom"
}
} }
], ],
......
<template> <template>
<web-view src="" @message=""></web-view> <view>
</template> <web-view :webview-styles="webviewStyles" :src="host" @message="Back" update-title="false"></web-view>
</view>
</template>
<!-- uni 的 SDK -->
<script type="text/javascript" src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js"></script>
<script> <script>
import vue, { import vue, {
...@@ -21,14 +25,45 @@ ...@@ -21,14 +25,45 @@
setup(props) { setup(props) {
let data = reactive({ let data = reactive({
host:'',
dataContent:{}
}); });
let methods = {
Back(){
uni.navigateBack({
delta: 1
})
},
getUrl(){
uni.showLoading({
title:'加载中',
mask:true
})
if (process.env.NODE_ENV === "development") {
data.host = `http://localhost:8181/#/uploadFiles?uid=${data.dataContent.Uid}&courseId=${data.dataContent.CourseId}`
setTimeout(()=>{
uni.hideLoading()
},1000)
} else {
data.host = `http://edu.oytour.com/#/uploadFiles?uid=${data.dataContent.Uid}&courseId=${data.dataContent.CourseId}`
setTimeout(()=>{
uni.hideLoading()
},1000)
}
}
}
return { return {
...toRefs(data) ...toRefs(data),
...methods
}; };
}, },
onLoad(option) { onLoad(options) {
//this.workMsg.stuId = option.stuId uni.setNavigationBarTitle({
title: '上传文件'
});
let json = JSON.parse(decodeURIComponent(options.exam))
this.dataContent = json
this.getUrl()
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment