From 117da08d652db513d8889924ea12b13aed68fba2 Mon Sep 17 00:00:00 2001 From: 马宇豪 <978517621@qq.com> Date: 星期二, 16 七月 2024 14:59:09 +0800 Subject: [PATCH] 提交 --- pages/tabBar/notice/detail.vue | 103 +++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 87 insertions(+), 16 deletions(-) diff --git a/pages/tabBar/notice/detail.vue b/pages/tabBar/notice/detail.vue index 2f315aa..b12c732 100644 --- a/pages/tabBar/notice/detail.vue +++ b/pages/tabBar/notice/detail.vue @@ -9,9 +9,9 @@ <view class="navBar"> <u-icon name="arrow-left" color="black" size="17" style="margin-left: 8px;" @click="goBack" /> <view class="barText">信息详情</view> - <view > +<!-- <view > <u-button type="text" @click="loginOut" style="color: blue;margin-right: 5px;">退出</u-button> - </view> + </view> --> </view> </view> </view> @@ -30,6 +30,7 @@ </u-tag> </view> </view> + <text class="textTop"><b>发布时间:</b>{{detailData.publishingTime}}</text> <text class="textTop" v-if="detailData.forwardPath" style="display: flex;"><b>发布单位:</b> <text v-for="(item,index) in detailData.forwardPath"> <text v-if="index !=detailData.forwardPath.length-1"> @@ -45,6 +46,17 @@ <view style="width: 100%; height: 550px;" v-if="directViewUrl"> <iframe :src="directViewUrl" class="frameStyle"></iframe> </view> + <view style="width: 100%; height: auto" 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> + <span v-if="!(directViewUrl || urls.length > 0)"> + 无 + </span> + <!-- <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'"> @@ -98,17 +110,17 @@ <view v-if="detailData.role == 'leader' && detailData.reviewStatus == 1" class="btn"> <u-button style="background-color:rgb(6, 202, 23);color: white;width: 180px;" - @click="approved" + @click="$noMoreClicks(approved)" >审核通过</u-button> <u-button style="background-color:rgb(247, 108, 125);color: white;width: 180px;" - @click="reject" + @click="$noMoreClicks(reject)" >审核驳回</u-button> </view> <view v-if="detailData.role == 'infoPeople' && detailData.reviewStatus == 2" class="btn"> <u-button style="background-color:rgb(6, 202, 23);color: white;width: 180px;" - @click="infoSend" + @click="$noMoreClicks(infoSend)" >确认发布</u-button> </view> <!-- //村级显示 --> @@ -150,16 +162,50 @@ unitType: '', directViewUrl: '', cityMessage: '响应措施反馈', - measureData: {} + measureData: {}, + urls: [], + backFlag: '', + noClick:true, } }, 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' ) { @@ -191,13 +237,33 @@ 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(); @@ -222,6 +288,8 @@ }, 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)) }) @@ -279,11 +347,12 @@ 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, @@ -333,6 +402,7 @@ box-shadow: 0 3px 12px rgba(0,0,0,0.05); } .barText{ + margin-left: -20px; flex: 1; /* margin-left: 20px; */ text-align: center; @@ -374,7 +444,8 @@ margin-left: 15px; } .detailCard{ - flex-grow: 1; + // flex-grow: 1; + // height: 65%; display: flex; flex-direction: column; background: #fff; -- Gitblit v1.9.2