zhouwenxuan
2023-12-15 277d6652893fcc10fb6827b62ef16fe2910a525c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<template>
    <view>
        <!-- 自定义导航栏 -->
        <view class="navBarBox fix">
            <!-- 状态栏占位 -->
            <view class="statusBar" :style="{ paddingTop: statusBarHeight + 'px' }"></view>
            <!-- 真正的导航栏内容 -->
            <view class="navBar">
                <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="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" 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"  v-if="measures" >
                <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="180rpx" height="180rpx" :src="item.url"></u-image>
                </view>
            </view>
        </view>
    </view>
</template>
 
<script>
    import VUE_APP_BASE_URL from '../../../common/constant.js'
    export default {
        components:{
            
        },
        data() {
            return {
                statusBarHeight: [],
                fileList1: [],
                nameList: [],
                checkboxValue1: '',
                measures: "",
                type: 'textarea',
                border: true,
                height: 100,
                autoHeight: true,
                form: {
                },
                measureList: [],
                images: []
            }
        },
        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() {
                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")))
                    })
                }else if (uni.getStorageSync('backMeasures') == 'county'){
                    console.log("countyDetail",uni.getStorageSync('countyDetail'))
                    uni.navigateTo({
                      url: `/pages/tabBar/responsivity/countyResponsivity?data=` + encodeURIComponent(JSON.stringify(uni.getStorageSync("countyDetail")))
                    })
                }
 
            },
            //预览图片
            previewSqs(item,index) {
                let imgs = [];
                for (let i = 0; i < this.images.length; i++) {
                    imgs.push(this.images[i].url)
                }
                console.log("预览",imgs)
                uni.previewImage({
                    urls: imgs,
                    current: index,
                    indicator: 'number',
                    loop: true
                })
            },
        }
    }
 
</script>
 
<style lang='scss' scoped>
.navBarBox .navBar {
  background-color:#fff;
  height: 50px;
  display: flex;
  flex-direction: row;
  /* 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: 90%;
  font-size: 16px;
  /* text-align: center; */
  font-weight: 600;
}
 
.measureCard{
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: 0 3px 12px rgba(0,0,0,0.05);
    margin: 12px 12px 20px;
    border-radius: 5px;
    padding: 30px 12px;
}
.fix{
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1;
}
.statusBar{
    background-color:lightgrey;
}
.first{
    display: flex;
    flex-direction: column;
}
.second{
    display: flex;
    flex-direction: column;
    margin-top: 30px;
}
.third{
    display: flex;
    flex-wrap: wrap;
    margin-top: 30px;
    margin-bottom: 50px;
}
/deep/ .u-upload__button{
    background-color: white;
}
.pic{
    display: flex;
    flex-direction: column;
    background-color: rgb(242,242,242);
    margin-top: 5px;
    font-size: 14px;
}
 
.measures{
    margin-top: 50px 12px 0;
    padding: 0 12px;
    
    .measureBtn{
        border-radius: 5px;
        box-shadow: 0 3px 12px rgba(33,239,102,0.4);
    }
}
.head{
    margin-top: -20px;
    margin-bottom: 20px;
    line-height: 15px;
}
</style>