| | |
| | | <template> |
| | | <view> |
| | | <view style="display: flex;flex-direction: column;height: 100%;"> |
| | | <!-- 自定义导航栏 --> |
| | | <view class="navBarBox"> |
| | | <!-- 状态栏占位 --> |
| | |
| | | <!-- 真正的导航栏内容 --> |
| | | <view style="display: flex; flex-direction: column;"> |
| | | <view class="navBar"> |
| | | <u-icon name="arrow-left" color="black" size="17" @click="goBack" /> |
| | | <u-icon name="arrow-left" color="black" size="17" style="margin-left: 8px;" @click="goBack" /> |
| | | <view class="barText">信息详情</view> |
| | | <!-- <view > |
| | | <u-button type="text" @click="loginOut" style="color: blue;margin-right: 5px;">退出</u-button> |
| | | </view> --> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <!-- 页面内容 --> |
| | | <view class="detailCard"> |
| | | <view class="detailCard" > |
| | | <text style="font-size: 18px;"><b>标题:</b>{{detailData.title}}</text> |
| | | <text class="textTop"><b>类别:</b>{{detailData.disaster}}</text> |
| | | <view style="display: flex;align-items: center;" class="textTop"> |
| | | <text><b>级别:</b></text> |
| | | <u-tag |
| | | :color="detailData.warningLevel === 3 ? 'rgb(255, 244, 88)' :detailData.warningLevel === 2 ? 'orange':detailData.warningLevel === 1 ?'red':'blue'" |
| | | :text="detailData.warningLevel === 3 ? '黄色' : detailData.warningLevel === 2 ? '橙色': detailData.warningLevel === 1 ?'红色':'蓝色'" |
| | | :bg-color="detailData.warningLevel === 3 ? 'rgb(254, 255, 230)' :detailData.warningLevel === 2 ? 'rgb(255, 210, 179)':detailData.warningLevel === 1 ?'rgb(255, 128, 128)':'rgb(121, 150, 255)'" |
| | | border-color="white"> |
| | | </u-tag> |
| | | <view class="levelDisaster"> |
| | | <text class="textTop"><b>类别:</b>{{detailData.disaster}}</text> |
| | | <view style="display: flex;align-items: center;margin-left: 10%" class="textTop"> |
| | | <text><b>级别:</b></text> |
| | | <u-tag |
| | | :color="detailData.warningLevel === 3 ? 'rgb(211, 211, 0)' :detailData.warningLevel === 2 ? 'orange':detailData.warningLevel === 1 ?'red':'blue'" |
| | | :text="detailData.warningLevel === 3 ? '黄色' : detailData.warningLevel === 2 ? '橙色': detailData.warningLevel === 1 ?'红色':'蓝色'" |
| | | :bg-color="detailData.warningLevel === 3 ? 'rgb(254, 255, 230)' :detailData.warningLevel === 2 ? 'rgb(255, 210, 179)':detailData.warningLevel === 1 ?'rgb(255, 128, 128)':'rgb(121, 150, 255)'" |
| | | border-color="white"> |
| | | </u-tag> |
| | | </view> |
| | | </view> |
| | | <text class="textTop" v-if="detailData.forwardPath" style="display: flex;"><b>发布单位:</b> |
| | | <text v-for="(item,index) in detailData.forwardPath"> |
| | |
| | | </text> |
| | | <text class="textTop" v-else><b>发布单位:</b>{{detailData.publishingUnit}}</text> |
| | | <text class="textTop"><b>短信内容:</b><i style="background-color: rgb(240, 248, 255);">{{detailData.content}}发布单位:{{detailData.publishingUnit}}</i></text> |
| | | <view :style="{ height: directViewUrl ? '360px' : '' }" style="margin-top: 20px;"> |
| | | <view :style="{ height: directViewUrl ? '560px' : '' }" style="margin-top: 20px;"> |
| | | <text class="textTop" style="width: 76px;" ><b>附件内容:</b></text> |
| | | <view style="width: 100%; height: 350px;" v-if="directViewUrl"> |
| | | <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'"> |
| | |
| | | </view> |
| | | </view> --> |
| | | </view> |
| | | <text class="textTop" v-if="detailData.role == 'leader'"><b>信息提交人:</b>{{detailData.infoSubmitterRealName}}</text> |
| | | <text class="textTop" style="margin-top: 30px;" v-if="detailData.role == 'leader'"><b>信息提交人:</b>{{detailData.infoSubmitterRealName}}</text> |
| | | <view class="textTop" v-if="detailData.role == 'leader'"> |
| | | <text ><b>审核状态:</b></text> |
| | | <text v-if="detailData.reviewStatus == 1" class="responseStatus" |
| | |
| | | unitType: '', |
| | | directViewUrl: '', |
| | | cityMessage: '响应措施反馈', |
| | | measureData: {} |
| | | measureData: {}, |
| | | urls: [], |
| | | backFlag: '' |
| | | } |
| | | }, |
| | | 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' ) { |
| | | this.detailData.attachments = this.detailData.attachment; |
| | |
| | | console.log("this.isAllImg",this.isAllImg) |
| | | console.log("detailData",this.detailData) |
| | | this.detailData.disaster = test.disasterType == 1 ? '地震': test.disasterType == 2 ? '洪涝' : test.disasterType == 3 ? '气象' : test.disasterType == 4 ? '地质灾害': test.disasterType == 5 ? '水旱': '森林草原火灾'; |
| | | this.getMeasures(); |
| | | if(this.unitType == 4 && this.role == '工作人员'){ |
| | | this.getMeasures(); |
| | | } |
| | | // this.backFlag = uni.getStorageSync('backFlag') |
| | | // console.log(this.backFlag,'1111') |
| | | }, |
| | | methods: { |
| | | goBack() { |
| | | uni.navigateBack({ |
| | | url:'./notice/notice' |
| | | }); |
| | | console.log(uni.getStorageSync('backFlag'),'1111') |
| | | if(uni.getStorageSync('backFlag') == 'notice'){ |
| | | uni.switchTab({ |
| | | url: '/pages/tabBar/notice/notice' |
| | | }) |
| | | }else if (uni.getStorageSync('backFlag') == 'info') { |
| | | uni.switchTab({ |
| | | url: '/pages/tabBar/information/information' |
| | | }) |
| | | }else if (uni.getStorageSync('backFlag') == 'examine') { |
| | | uni.switchTab({ |
| | | url: '/pages/tabBar/examine/examine' |
| | | }) |
| | | }else if (uni.getStorageSync('backFlag') == 'current') { |
| | | uni.switchTab({ |
| | | url: '/pages/tabBar/current/current' |
| | | }) |
| | | }else if ( uni.getStorageSync('backFlag') == 'response'){ |
| | | uni.switchTab({ |
| | | url: '/pages/tabBar/response/response' |
| | | }) |
| | | } |
| | | }, |
| | | loginOut() { |
| | | uni.clearStorageSync(); |
| | | uni.clearStorage(); |
| | | uni.navigateTo({ |
| | | url: '/pages/index/index' |
| | | }) |
| | | }, |
| | | getMeasures(){ |
| | | getMeasureDetail({id: this.detailData.id}).then(res => { |
| | | if(res.code == 100){ |
| | | if(res.data.baseMeasures && res.data.baseMeasures.length>0 ){ |
| | | console.log('111111') |
| | | this.cityMessage = '查看措施反馈'; |
| | | this.measureData = res.data; |
| | | }else { |
| | | this.cityMessage = '响应措施反馈'; |
| | | } |
| | | } |
| | | }else{ |
| | | uni.$u.toast(res.msg) |
| | | } |
| | | }) |
| | | }, |
| | | goMeasures() { |
| | | if(this.cityMessage == '查看措施反馈' ){ |
| | | uni.setStorageSync('backMeasures','detail') |
| | | this.measureData.id = this.detailData.id |
| | | uni.navigateTo({ |
| | | url: `/pages/tabBar/responsivity/showMeasures?data=` + encodeURIComponent(JSON.stringify(this.measureData)) |
| | | }) |
| | |
| | | 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, |
| | |
| | | height: 50px; |
| | | display: flex; |
| | | flex-direction: row; |
| | | justify-content: center; |
| | | justify-content: space-around; |
| | | align-items: center; |
| | | box-shadow: 0 3px 12px rgba(0,0,0,0.05); |
| | | } |
| | | .barText{ |
| | | margin-left: -20px; |
| | | flex: 1; |
| | | /* margin-left: 20px; */ |
| | | text-align: center; |
| | | width: 85%; |
| | |
| | | margin-left: 15px; |
| | | } |
| | | .detailCard{ |
| | | flex-grow: 1; |
| | | display: flex; |
| | | flex-direction: column; |
| | | background: #fff; |
| | |
| | | width: 100%; |
| | | } |
| | | .measures{ |
| | | margin-top: 50px 12px 0; |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | padding: 0 12px; |
| | | |
| | | .resBtn{ |
| | | border-radius: 5px; |
| | | box-shadow: 0 3px 12px rgba(33,148,239,0.4); |
| | | } |
| | | margin-bottom: 20px ; |
| | | |
| | | } |
| | | .frameStyle{ |
| | | width: 100%; |
| | | height: 350px; |
| | | height: 550px; |
| | | border: 1px solid #dddddc; |
| | | margin-top: 5px; |
| | | } |
| | | .levelDisaster{ |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | </style> |