Blame view

pages/mapdoorplate/mapdoorplate.vue 11.2 KB
1f3f2378   起风了   我的第一次
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  <template>

  	<view class="page">

  		<pyh-nv ref="nv" :config="nvConfig"></pyh-nv>

  		<view class="listBox" :style="{'padding-top':(pageTop+'px')}">

  			<view class="content">

  				<view class="top-box" @click="gopath('/pages/declaration/declarationList?type=6')">

  					<view>上报历史</view>

  					<view class="top-box-img">

  						<image src="../../static/right2.png"></image>

  					</view>

  				</view>

  				<view class="titleall-left">

  					<view class="titleall-left-line"></view>我要上报

  				</view>

  				<view class="message-list" >

  					<view class="info-box">

  						<view class="info-box-list">

  							<view class="serve">

  								<view class="serve-title">路门牌情况</view>

  								<view class="serve-right">

  									<picker @change="bindPickerChange" :value="index" :range="array">

d7d4c017   李宇   1
22
  										<view :class="sign.roadStatus?'uni-input1':'uni-input2'">{{sign.roadStatus?sign.roadStatus:'请选择'}}

1f3f2378   起风了   我的第一次
23
24
25
26
27
28
29
30
31
32
33
34
35
36
  										</view>

  									</picker>

  									<image src="../../static/down3.png"></image>

  								</view>

  							</view>

  						</view>

  					</view>

  					<view class="info-box">

  						<view class="info-box-list">

  							<view class="serve">

  								<view class="serve-title">名称</view>

  								<view>

  									<input id="name" @input="oninput" v-module="sign.name"

  										placeholder="请输入" style="text-align: right;"

d7d4c017   李宇   1
37
  										 placeholder-style="color: #909090;font-size: 26rpx;" />

1f3f2378   起风了   我的第一次
38
39
40
41
42
43
44
45
46
47
48
  								</view>

  							</view>

  						</view>

  					</view>

  					<view class="info-box">

  						<view class="info-box-list">

  							<view class="serve">

  								<view class="serve-title">联系姓名</view>

  								<view>

  									<input id="contactName" @input="oninput" v-module="sign.contactName"

  										placeholder="请输入" style="text-align: right;"

d7d4c017   李宇   1
49
  										 placeholder-style="color: #909090;font-size: 26rpx;" />

1f3f2378   起风了   我的第一次
50
51
52
53
54
55
56
57
58
59
60
  								</view>

  							</view>

  						</view>

  					</view>

  					<view class="info-box">

  						<view class="info-box-list">

  							<view class="serve">

  								<view class="serve-title">联系电话</view>

  								<view>

  									<input id="phone" @input="oninput" v-module="sign.phone"

  										placeholder="请输入" style="text-align: right;"

d7d4c017   李宇   1
61
  										 placeholder-style="color: #909090;font-size: 26rpx;" />

1f3f2378   起风了   我的第一次
62
63
64
65
66
67
68
69
70
  								</view>

  							</view>

  						</view>

  					</view>

  					<view class="info-box">

  						<view class="info-box-list">

  							<view class="serve">

  								<view class="serve-title">详细地址</view>

  								<view class="serve-right" @tap="openaddress">

d7d4c017   李宇   1
71
72
  									<view :class="sign.roadStatus?'uni-input1':'uni-input2'">{{sign.address?sign.address:'请选择'}}</view>

  									<image src="../../static/down3.png"></image>

1f3f2378   起风了   我的第一次
73
74
75
76
77
78
79
80
81
82
83
  								</view>

  							</view>

  						</view>

  					</view>

  					<view class="info-box">

  						<view class="info-box-list">

  							<view class="serve">

  								<view class="serve-title">备注</view>

  								<view>

  									<input id="remark" @input="oninput" v-module="sign.remark"

  										placeholder="请输入" style="text-align: right;"

d7d4c017   李宇   1
84
  										 placeholder-style="color: #909090;font-size: 26rpx;" />

1f3f2378   起风了   我的第一次
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
  								</view>

  							</view>

  						</view>

  					</view>

  				</view>

  				<view class="message-list">

  					<view class="info-box">

  						<view class="info-box-list">

  							<view class="info-box-width" style="width: 100%;">

  								<view class="info-box-small">图片</view>

  								<view style="margin-top: 20rpx;width: 100%;">

  									<u-upload name="1" multiple :fileList="fileList" @delete="deletePic"

  										@afterRead="afterRead" :previewFullImage="true" :maxCount="1"></u-upload>

  								</view>

  								<!-- <view class="info-box-list-img"><image src="../../static/img.png"></image></view> -->

  							</view>

  						</view>

  					</view>

  				</view>

  				<view class="page-footer">

  					<view class="footer-buy">

  						<view class="cart-add" @click="mapdoorplatesuccess">

  							<image src="../../static/btn5.png"></image>

  							<text>立即上报</text>

  						</view>

  					</view>

  				</view>

  

  			</view>

  		</view>

  		<uni-calendar ref="calendar" :insert="false" @confirm="confirm" />

  	</view>

  </template>

  

  <script>

  	import service from '@/service/service.js'

  	import BASE_URL from "@/common/config.js"

  	import sczl from "@/components/sczl.vue"

  	export default {

  		data() {

  			return {

  				BASE_URL,

  				fileList: [],

  				OrderType: 0,

  				nvConfig: {

d7d4c017   李宇   1
130
  					title: "地名标志牌需求申报",

1f3f2378   起风了   我的第一次
131
132
133
134
135
136
137
138
139
140
141
  					bgColor: "#ffffff",

  					color: "#000000",

  					fixedAssist: {

  						hide: true,

  					},

  				},

  				time: null,

  				sign: {

  					applyId: uni.getStorageSync('USERS_KEY').userId,

  					createdUser: uni.getStorageSync('USERS_KEY').userId,

  					roadStatus: null, //请选择路门牌情况

d7d4c017   李宇   1
142
  					status: '待处理', //审核状态

1f3f2378   起风了   我的第一次
143
144
145
146
147
148
149
150
151
152
  					name: null, //名称

  					phone: null, //联系电话

  					address: null, //详细地址

  					remark: null, //备注

  					longitude: null, //东经

  					latitude: null, //北纬

  					reportTime:new Date().getTime(),//时间

  					inspectionImage:null,//图片

  				},

  

d7d4c017   李宇   1
153
  				array:['新申报','报修', '查询'] ,

1f3f2378   起风了   我的第一次
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
  

  			};

  		},

  		onPageScroll(e) {

  			this.$refs.nv.pageScroll(e)

  		},

  		components:{sczl},

  		computed: {

  			pageTop() {

  				return parseInt(88 * uni.getSystemInfoSync().windowWidth / 750) + uni.getSystemInfoSync().statusBarHeight

  			}

  		},

  		onLoad(params) {

  		},

  		methods: {

  

  			oninput(e) {

  				this.sign[e.target.id] = e.target.value

  			},

  			gopath(e) {

  				uni.navigateTo({

  					url: e

  				})

  			},

  			async afterRead(event) {

  				for (let i = 0; i < event.file.length; i++) {

  					var res = await this.uploadImg(event.file[i].url)

  					// console.log(res)

  					res = JSON.parse(res.data)

  					this.fileList.push({

  						name: res.fileName,

  						fileId: res.newFileName,

  						url: this.BASE_URL + res.fileName

  					})

  				}

  			},

  			uploadImg(url) {

  				return new Promise((r, e) => {

  					uni.uploadFile({

  						url: this.BASE_URL + "/common/upload",

  						filePath: url,

  						name: "file",

  						success: (d) => r(d)

  					})

  				})

  			},

  			deletePic(event) {

  				this.fileList.splice(event.index, 1)

  			},

  			bindPickerChange: function(e) {

  				this.sign.roadStatus = this.array[e.detail.value]

  				console.log('picker发送选择改变,携带值为', e)

  			},

  			mapdoorplatesuccess() {

  				console.log('this.sign', this.sign)

  				// return

  				for (let i = 0; i < this.fileList.length; i++) {

  					if (i == 0) {

  						this.sign.inspectionImage = this.fileList[i].name

  					} else {

  						this.sign.inspectionImage = this.sign.inspectionImage + ',' + this.fileList[i].name

  					}

  				}

  				this.API.addroadSign(this.sign).then(res => {

  					console.log(res);

  					if (res.code == 200) {

  						uni.showToast({

  							icon: 'success',

  							title: "添加成功",

  						})

  						setTimeout(() => {

  							uni.redirectTo({

  								url: '/pages/mapdoorplatesuccess/mapdoorplatesuccess',

  							})

  						}, 800)

  				

  					}

  				})

  

  

  			},

  			openaddress(e) {

  				let that = this

  				// 用户已经同意小程序使用录音功能,后续调用 wx.startRecord 接口不会弹窗询问

  				wx.chooseLocation({

  					success: function(res) {

  						console.log(res);

  						that.sign.latitude = res.latitude

  						that.sign.longitude = res.longitude

  						that.sign.address = res.address

  					},

  					fail(err) {

  						console.log(err)

  					}

  				});

  			},

  		}

  	}

  </script>

  

  <style scoped lang="scss">

d7d4c017   李宇   1
255
256
257
258
259
260
261
262
263
264
265
266
267
  	.uni-input1 {

  		color:#3d3d3d;

  		// font-weight: bold;

  	

  	}

  	.uni-input2 {

  		color: #909090;

  	

  	}

  	input {

  		color: #3d3d3d;

  		font-size: 26rpx;

  	}

1f3f2378   起风了   我的第一次
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
  	.listBox {

  		position: relative;

  		z-index: 1;

  	}

  

  	.content {

  		width: 100%;

  		padding-bottom: 120rpx;

  	}

  

  	.titleall-left {

  		font-size: 28rpx;

  		font-weight: bold;

  		display: flex;

  		align-items: center;

  		margin: 30rpx;

  

  		.titleall-left-line {

  			width: 10rpx;

  			height: 25rpx;

  			border-radius: 18rpx;

  			background-color: #547DFF;

  			margin-right: 20rpx;

  			box-shadow: inset 0rpx 4rpx 9rpx 0rpx rgba(255, 255, 255, 0.34), 5rpx 7rpx 9rpx 0rpx rgba(80, 161, 255, 0.33);

  		}

  	}

  

  	.top-box {

  		display: flex;

  		justify-content: space-between;

  		margin: 30rpx;

  		font-size: 28rpx;

  		font-weight: bold;

  		background-color: #fff;

  		border-radius: 21rpx;

  		padding: 30rpx;

  

  		.top-box-img {

  			image {

  				width: 40rpx;

  				height: 40rpx;

  			}

  		}

  	}

  

  	.titleall-box {

  		display: flex;

  		justify-content: space-between;

  		padding: 40rpx 20rpx 20rpx 0;

  

  		.titleall-left {

  			font-size: 32rpx;

  			font-weight: bold;

  			display: flex;

  			align-items: center;

  

  			.titleall-left-line {

  				width: 14rpx;

  				height: 36rpx;

  				border-radius: 0 10rpx 10rpx 0;

  				background-color: #667FFF;

  				box-shadow: 0 0 10rpx 5rpx #d1d9ff;

  				margin-right: 20rpx;

  			}

  

  			text {

  				font-size: 28rpx;

  				color: #999999;

  			}

  		}

  	}

  

  	.message-list {

  		// background-color: #FFFFFF;

  		// border-radius: 20rpx;

  		font-size: 25rpx;

  		margin: 25rpx;

  

  		.info-box {

  			padding: 0 40rpx;

  			background: #FFFFFF;

  			border-radius: 21rpx;

  			margin-bottom: 15rpx;

  

  			.info-box-list {

  				display: flex;

  				align-items: center;

  				border-bottom: 2rpx solid #ececec;

  				padding-top: 20rpx;

  				padding-bottom: 20rpx;

  

  				.width100 {

  					width: 100% !important;

  				}

  

  				.info-box-width {

  					width: 50%;

  					font-size: 30rpx;

  					font-weight: bold;

  

  					.info-box-small {

  						font-size: 26rpx;

  						color: #a8a8a8;

  						font-weight: 500;

  						margin-top: 10rpx;

  					}

  

  					.info-box-list-img {

  						margin-top: 30rpx;

  

  						image {

  							width: 180rpx;

  							height: 180rpx;

  							border-radius: 20rpx;

  						}

  					}

  

  					.input-text {

  						font-size: 30rpx;

  					}

  

  					.inputtext {

  						color: #3d3d3d;

  					}

  

  					.textarea {

  						background-color: #F7F7F7;

  						border-radius: 20rpx;

  						width: 100%;

  						margin-top: 20rpx;

  						padding: 20rpx;

  						font-size: 28rpx;

  						font-weight: normal;

  						min-height: 80rpx;

  					}

  				}

  

  				.serve {

  					display: flex;

  					justify-content: space-between;

  					align-items: center;

  					width: 100%;

  

  					.serve-title {

d7d4c017   李宇   1
412
  						font-size: 26rpx;

1f3f2378   起风了   我的第一次
413
414
415
416
  						color: #909090;

  					}

  

  					.serve-right {

d7d4c017   李宇   1
417
418
  						font-size: 26rpx;

  						// font-weight: bold;

1f3f2378   起风了   我的第一次
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
  						display: flex;

  						align-items: center;

  						justify-content: flex-end;

  

  						text {

  							color: #FC4444;

  						}

  

  						image {

  							width: 20rpx;

  							height: 20rpx;

  							margin-left: 10rpx;

  						}

  					}

  				}

  			}

  

  			.info-box-list:last-child {

  				border-bottom: 0;

  			}

  		}

  	}

  

  	/* 底部 */

  	.page-footer {

  		margin: 30rpx;

  		display: flex;

  		height: 100rpx;

  

  		.footer-buy {

  			height: 100%;

  			width: 100%;

  

  			.cart-add {

  				display: flex;

  				align-items: center;

  				justify-content: center;

  				margin-top: 60rpx;

  

  				image {

  					position: absolute;

  					z-index: 0;

  					width: 95%;

  					height: 83rpx;

  					box-shadow: 5rpx 10rpx 20rpx 0 #b7c8ff;

  					border-radius: 100rpx;

  				}

  

  				text {

  					font-size: 30rpx;

  					font-weight: bold;

  					color: #fff;

  					position: absolute;

  					z-index: 1;

  				}

  			}

  		}

  	}

  </style>