| | |
| | | <view class="statusBar" :style="{ paddingTop: statusBarHeight + 'px' }"></view> |
| | | <!-- 真正的导航栏内容 --> |
| | | <view class="navBar"> |
| | | <u-icon name="arrow-left" color="black" size="17" @click="goBack" /> |
| | | <u-icon name="arrow-left" color="black" style="margin-left: 10px;" size="17" @click="goBack" /> |
| | | <view class="barText">响应措施反馈</view> |
| | | </view> |
| | | </view> |
| | | <view class="measureCard"> |
| | | <view class="head"> |
| | | <u-form :model="form" ref="uForm" label-width="100px"> |
| | | <u-form-item label="信息标题 :" ></u-form-item> |
| | | <u-form-item label="发布单位 :"></u-form-item> |
| | | <u-form-item label="发布时间 :"></u-form-item> |
| | | <u-form-item label="反馈时间 :"></u-form-item> |
| | | <u-form :model="form" ref="uForm" label-width="80px"> |
| | | <u-form-item label="信息标题 :" >{{form.title}}</u-form-item> |
| | | <u-form-item label="发布单位 :">{{form.publishingUnit}}</u-form-item> |
| | | <u-form-item label="发布时间 :">{{form.publishingTime}}</u-form-item> |
| | | <u-form-item label="反馈时间 :">{{form.measureSubmitTime}}</u-form-item> |
| | | </u-form> |
| | | </view> |
| | | <view class="first"> |
| | | <text style="font-size: 16px;margin-bottom: 20px;font-weight: 600;">基础措施</text> |
| | | <view v-for="(item, index) in measureList" :key="index" style="margin-left: 18px;margin-bottom:10px; font-size:16px;"> |
| | | <text style="margin-top: 15px;">{{item.name}}</text> |
| | | <view class="first" v-if="measureList"> |
| | | <text style="font-size: 18px;margin-bottom: 20px;font-weight: 600;">基础措施</text> |
| | | <view v-for="(item, index) in measureList" :key="index" style="margin-left: 18px;margin-bottom:10px; font-size:15px;"> |
| | | <text style="margin-top: 15px;">{{item}}</text> |
| | | </view> |
| | | </view> |
| | | <view class="second"> |
| | | <text style="font-size: 16px;margin-bottom: 20px;font-weight: 600;">补充措施</text> |
| | | <u--textarea style="margin-top: -5px;" v-model="measures" disabled="true" placeholder="请输入内容" ></u--textarea> |
| | | <view class="second" v-if="measures!=null"> |
| | | <text style="font-size: 18px;margin-bottom: 20px;font-weight: 600;">补充措施</text> |
| | | <u--textarea style="margin-top: -5px;" v-model="measures" disabled placeholder="请输入内容" ></u--textarea> |
| | | </view> |
| | | <view class="third"> |
| | | <view v-for="(item, index) in images" :key="index"> |
| | | <u-image @click="previewSqs(item,index)" style="margin: 5px; 5px" width="230rpx" height="230rpx" :src="item.url"></u-image> |
| | | <u-image @click="previewSqs(item,index)" style="margin: 5px; 5px" width="180rpx" height="180rpx" :src="item.url"></u-image> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import VUE_APP_BASE_URL from '../../../common/constant.js' |
| | | export default { |
| | | components:{ |
| | | |
| | |
| | | fileList1: [], |
| | | nameList: [], |
| | | checkboxValue1: '', |
| | | measures: "111", |
| | | measures: "", |
| | | type: 'textarea', |
| | | border: true, |
| | | height: 100, |
| | | autoHeight: true, |
| | | measureList: [ |
| | | { |
| | | name: '苹果', |
| | | }, |
| | | { |
| | | name: '香蕉', |
| | | }, |
| | | { |
| | | name: '橙子', |
| | | } |
| | | ], |
| | | images: [ |
| | | { |
| | | url: 'https://img2.baidu.com/it/u=638285213,1746517464&fm=253&fmt=auto&app=120&f=JPEG?w=1422&h=800' |
| | | }, |
| | | |
| | | ] |
| | | form: { |
| | | }, |
| | | measureList: [], |
| | | images: [] |
| | | } |
| | | }, |
| | | onLoad() { |
| | | //获取手机状态栏高度 |
| | | onLoad(options) { |
| | | let test = options.data && JSON.parse(decodeURIComponent(options.data)); |
| | | console.log("tes111t",test) |
| | | this.form = test; |
| | | this.measures = this.form.responseMeasure; |
| | | this.measureList = this.form.baseMeasures; |
| | | if(this.form.attachments && this.form.attachments.length>0){ |
| | | this.images = this.form.attachments.map((item) => { |
| | | return {url: VUE_APP_BASE_URL + item.attachment}; |
| | | }); |
| | | }else { |
| | | this.images = []; |
| | | } |
| | | console.log("img",this.images) |
| | | this.statusBarHeight = uni.getSystemInfoSync()['statusBarHeight']; |
| | | uni.hideTabBar(); |
| | | }, |
| | | methods: { |
| | | goBack() { |
| | | uni.navigateBack({ |
| | | url:'/pages/tabBar/responsivity/villageResponsivity' |
| | | }); |
| | | }, |
| | | |
| | | checkboxChange(n) { |
| | | console.log('change', n); |
| | | }, |
| | | // 删除图片 |
| | | deletePic(event) { |
| | | this[`fileList${event.name}`].splice(event.index, 1) |
| | | this.nameList.splice(event.index,1) |
| | | console.log("name",this.nameList) |
| | | }, |
| | | // 新增图片 |
| | | async afterRead(event) { |
| | | // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式 |
| | | let lists = [].concat(event.file) |
| | | let fileListLen = this[`fileList${event.name}`].length |
| | | console.log("list",lists) |
| | | lists.map((item) => { |
| | | this.nameList.push({name: item.name}); |
| | | this[`fileList${event.name}`].push({ |
| | | ...item, |
| | | status: 'uploading', |
| | | message: '上传中' |
| | | console.log(uni.getStorageSync('backMeasures'),'222222') |
| | | if(uni.getStorageSync('backMeasures') == 'detail'){ |
| | | uni.navigateTo({ |
| | | url: `/pages/tabBar/notice/detail?data=` + encodeURIComponent(JSON.stringify(uni.getStorageSync("fdetailData"))) |
| | | }) |
| | | }) |
| | | console.log("nameList",this.nameList) |
| | | for (let i = 0; i < lists.length; i++) { |
| | | const result = await this.uploadFilePromise(lists[i].url) |
| | | let item = this[`fileList${event.name}`][fileListLen] |
| | | this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, { |
| | | status: 'success', |
| | | message: '', |
| | | url: result |
| | | })) |
| | | fileListLen++ |
| | | }else if (uni.getStorageSync('backMeasures') == 'county'){ |
| | | uni.navigateTo({ |
| | | url: '/pages/tabBar/responsivity/countyResponsivity' |
| | | }) |
| | | } |
| | | }, |
| | | uploadFilePromise(url) { |
| | | return new Promise((resolve, reject) => { |
| | | let a = uni.uploadFile({ |
| | | url: 'http://www.example.com', // 仅为示例,非真实的接口地址 |
| | | filePath: url, |
| | | name: 'file', |
| | | formData: { |
| | | user: 'test' |
| | | }, |
| | | success: (res) => { |
| | | setTimeout(() => { |
| | | resolve(res.data.data) |
| | | }, 1000) |
| | | } |
| | | }); |
| | | }) |
| | | |
| | | }, |
| | | //预览图片 |
| | | previewSqs(item,index) { |
| | |
| | | height: 50px; |
| | | display: flex; |
| | | flex-direction: row; |
| | | justify-content: center; |
| | | /* justify-content: center; */ |
| | | align-items: center; |
| | | box-shadow: 0 3px 12px rgba(0,0,0,0.05); |
| | | } |
| | | .barText{ |
| | | /* margin-left: 20px; */ |
| | | text-align: center; |
| | | width: 85%; |
| | | width: 90%; |
| | | font-size: 16px; |
| | | /* text-align: center; */ |
| | | font-weight: 600; |
| | |
| | | .second{ |
| | | display: flex; |
| | | flex-direction: column; |
| | | margin-top: 50px; |
| | | margin-top: 30px; |
| | | } |
| | | .third{ |
| | | display: flex; |