Browse Source

feat: h5;

fox
Fox-33 16 hours ago
parent
commit
4a363a818a
3 changed files with 73 additions and 0 deletions
  1. +8
    -0
      pages.json
  2. +59
    -0
      pages_order/growing/activity/export.vue
  3. +6
    -0
      pages_order/growing/activity/index.vue

+ 8
- 0
pages.json View File

@ -143,6 +143,14 @@
{
"path": "growing/activity/applyEmail"
},
{
"path": "growing/activity/export",
"style": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "行后报告",
"navigationBarBackgroundColor": "#DAF3FF"
}
},
{
"path": "growing/achievement/index"
},


+ 59
- 0
pages_order/growing/activity/export.vue View File

@ -0,0 +1,59 @@
<template>
<view class="">
<web-view :src="h5Url" @message="message"></web-view>
</view>
</template>
<script>
export default {
data(){
return{
id: '',
h5Url: '',
imageData: '',
}
},
onLoad({ id }) {
this.id = id
// this.h5Url = `https://adminh5.kjetax.com/#/?id=${id}&token=${uni.getStorageSync('token')}`
this.h5Url = `https://192.168.10.100:8080/#/?id=${id}&token=${uni.getStorageSync('token')}`
console.log('url', this.h5Url)
console.log('...')
},
methods: {
message(e) {
const url = e.detail.data[0]
console.log('pdf', url)
this.downloadFile(url)
},
downloadFile(url) {
console.log('downloadFile', url)
uni.downloadFile({
url, //
success: (downloadRes) => {
console.log('downloadRes', downloadRes)
if (downloadRes.statusCode === 200) {
uni.openDocument({
showMenu: true,
filePath: downloadRes.tempFilePath,
success: () => console.log('打开成功')
});
} else {
uni.showToast({ title: '下载失败', icon: 'none' });
}
},
fail: (err) => {
console.log('downloadFile fail', err)
uni.showToast({ title: '网络异常', icon: 'none' });
}
});
},
},
}
</script>
<style>
</style>

+ 6
- 0
pages_order/growing/activity/index.vue View File

@ -69,6 +69,7 @@
<view class="section-header">行后报告</view>
<view class="section-content report">
<!-- todo -->
<button class="btn" @click="jumpToExport">点击查看详情</button>
</view>
</view>
@ -171,6 +172,11 @@
onApplyEmail() {
this.$utils.navigateTo(`/pages_order/growing/activity/applyEmail?id=${this.id}`)
},
jumpToExport() {
uni.navigateTo({
url: `/pages_order/growing/activity/export?id=${this.id}`
})
},
onMark() {
this.$refs.markPopup.open(this.detail.activityId)
},


Loading…
Cancel
Save