| | |
| | | <view style="width: 100%; height: 550px;" v-if="directViewUrl"> |
| | | <iframe :src="directViewUrl" class="frameStyle"></iframe> |
| | | </view> |
| | | <view style="width: 100%; height: 550px;" v-if="urls.length > 0"> |
| | | <view v-for="(item, index) in urls" :key="index" > |
| | | <view style="display: flex;margin-top: 10px;" @click="openFile(item)" > |
| | | <u-icon name="attach" color="#2979ff" size="20"></u-icon> <span>{{item.name}}</span> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- <view class="attache" v-if="isAllImg == 'no'"> |
| | | <view v-for="(item, index) in detailData.attachments" :key="index" > |
| | | <view style="display: flex;margin-top: 10px;" v-if="item.suffix == 'jpg'|| item.suffix =='jpeg' || item.suffix =='png'"> |
| | |
| | | unitType: '', |
| | | directViewUrl: '', |
| | | cityMessage: '响应措施反馈', |
| | | measureData: {} |
| | | measureData: {}, |
| | | urls: [] |
| | | } |
| | | }, |
| | | onLoad:function(options){ |
| | | // #ifdef APP-PLUS |
| | | const currentWebview = this.$scope.$getAppWebview();//获取当前web-view 此对象相当于html5plus里的plus.webview.currentWebview()。在uni-app里vue页面直接使用plus.webview.currentWebview()无效 |
| | | setTimeout(function() { |
| | | const wv = currentWebview.children()[0]; |
| | | console.log(wv); |
| | | wv.setStyle({//设置web-view距离顶部的距离以及自己的高度,单位为px |
| | | top: 68, |
| | | height:300 |
| | | }) |
| | | }, 1000);//如页面初始化调用需要写延迟 |
| | | // #endif |
| | | this.role = uni.getStorageSync('roleName'); |
| | | //获取手机状态栏高度 |
| | | this.statusBarHeight = uni.getSystemInfoSync()['statusBarHeight']; |
| | | let test = options.data && JSON.parse(decodeURIComponent(options.data)); |
| | | this.detailData = test; |
| | | |
| | | this.directViewUrl = this.detailData.directViewUrl; |
| | | if(this.detailData.attachments && this.detailData.attachments.length >0){ |
| | | this.urls = this.detailData.attachments.map(item => { |
| | | return { |
| | | url: VUE_APP_BASE_URL + item.attachement, |
| | | name: item.attachementName |
| | | } |
| | | }) |
| | | }else if(this.detailData.attachment && this.detailData.attachment.length >0){ |
| | | this.urls = this.detailData.attachment.map(item => { |
| | | return { |
| | | url: VUE_APP_BASE_URL + item.attachment, |
| | | name: item.attachmentName |
| | | } |
| | | }) |
| | | } |
| | | console.log("urls",this.urls) |
| | | |
| | | |
| | | |
| | | // this.directViewUrl = 'https://huaban.com/' |
| | | this.unitType = uni.getStorageSync('unittype'); |
| | | if(this.detailData.role == 'leader' || this.detailData.role == 'infoPeople' ) { |
| | |
| | | openFile(item) { |
| | | let fileUrl = ''; |
| | | console.log("iiii",item) |
| | | if(this.detailData.role == 'leader' || this.detailData.role == 'infoPeople' ){ |
| | | fileUrl = VUE_APP_BASE_URL + item.attachment; |
| | | }else { |
| | | fileUrl = VUE_APP_BASE_URL + item.attachement; |
| | | } |
| | | // if(this.detailData.role == 'leader' || this.detailData.role == 'infoPeople' ){ |
| | | // fileUrl = VUE_APP_BASE_URL + item.attachment; |
| | | // }else { |
| | | // fileUrl = VUE_APP_BASE_URL + item.attachement; |
| | | // } |
| | | fileUrl = item.url |
| | | console.log("urlllllllll",fileUrl) |
| | | uni.downloadFile({ |
| | | url: fileUrl, |