|
@@ -1,19 +1,18 @@
|
1
|
1
|
<template>
|
2
|
|
- <div class="context" :style="{backgroundImage: 'url(' + (coverImgUrl ?BgImage:BgImg) + ')'}">
|
|
2
|
+ <div :class="'context theme'+theme">
|
3
|
3
|
<div class="ContextBox">
|
4
|
4
|
<div class="uploadimg">
|
5
|
|
- <img :src="img?yttjlove:yjslove">
|
6
|
|
- <span :class="desc?desc1:desc2">上传您认为最美的全家福照片</span>
|
|
5
|
+ <img :src="theme===1?yttjlove:yjslove">
|
|
6
|
+ <span class="desc">上传您认为最美的全家福照片</span>
|
7
|
7
|
</div>
|
8
|
8
|
<van-uploader :after-read="onRead">
|
9
|
|
- <img v-if="postData.photo" class="uploadimgbox" :src="postData.photo" alt="">
|
10
|
|
- <img v-else class="uploadimgbox" :src="theme == 1? uploadimg1 : uploadimg2">
|
|
9
|
+ <img class="uploadimgbox" :src="uploadimg">
|
11
|
10
|
</van-uploader>
|
12
|
|
- <div class="WriteWord" v-if="writeword">
|
13
|
|
- <img :src="img?yttjpen:yjspen">
|
14
|
|
- <span :class="desc?desc1:desc2">寄语</span>
|
|
11
|
+ <div class="WriteWord" v-if="theme===1">
|
|
12
|
+ <img :src="theme===1?yttjpen:yjspen">
|
|
13
|
+ <span class="desc">寄语</span>
|
15
|
14
|
</div>
|
16
|
|
- <div class="input_content" v-if="writeword">
|
|
15
|
+ <div class="input_content" v-if="theme===1">
|
17
|
16
|
<textarea
|
18
|
17
|
id="textArea"
|
19
|
18
|
@input="messageWrite"
|
|
@@ -27,21 +26,21 @@
|
27
|
26
|
</span>
|
28
|
27
|
</div>
|
29
|
28
|
<div class="ContactInformation">
|
30
|
|
- <img :src="img?yttjphone:yjsphone">
|
31
|
|
- <span :class="desc?desc1:desc2">联系方式</span>
|
|
29
|
+ <img :src="theme===1?yttjphone:yjsphone">
|
|
30
|
+ <span class="desc">联系方式</span>
|
32
|
31
|
</div>
|
33
|
|
- <div :class="desc?inputbox1:inputbox2">
|
|
32
|
+ <div class="inputbox cinput">
|
34
|
33
|
<input placeholder="输入手机号" v-model="postData.phone">
|
35
|
34
|
</div>
|
36
|
35
|
|
37
|
|
- <div :class="desc?inputbox1:inputbox2">
|
|
36
|
+ <div class="inputbox cinput">
|
38
|
37
|
<input placeholder="输入姓名" v-model="postData.name">
|
39
|
38
|
</div>
|
40
|
|
- <div :class="desc?textareabox1:textareabox2" v-if="address">
|
|
39
|
+ <div class="textareabox cinput" v-if="theme===2">
|
41
|
40
|
<textarea class="addressarea" placeholder="所在社区"></textarea>
|
42
|
41
|
</div>
|
43
|
42
|
<div class="btn">
|
44
|
|
- <button :class="desc?SubmitBtn1:SubmitBtn2" @click="SubmitBtn">提交</button>
|
|
43
|
+ <button class="SubmitBtn cbtn" @click="SubmitBtn">提交</button>
|
45
|
44
|
</div>
|
46
|
45
|
</div>
|
47
|
46
|
</div>
|
|
@@ -49,8 +48,6 @@
|
49
|
48
|
|
50
|
49
|
<script>
|
51
|
50
|
import { createNamespacedHelpers } from "vuex";
|
52
|
|
-import BgImg from "../../assets/bgimg.jpg";
|
53
|
|
-import BgImage from "../../assets/yttjbg.png";
|
54
|
51
|
const {
|
55
|
52
|
mapState: mapVoteState,
|
56
|
53
|
mapActions: mapVoteActions
|
|
@@ -58,27 +55,17 @@ const {
|
58
|
55
|
export default {
|
59
|
56
|
name: "signup",
|
60
|
57
|
data() {
|
61
|
|
- return {
|
62
|
|
- writeword: false,
|
63
|
|
- address: false,
|
64
|
|
- desc: true,
|
65
|
|
- desc1: "desc1",
|
66
|
|
- desc2: "desc2",
|
67
|
|
- inputbox1: "inputbox1",
|
68
|
|
- inputbox2: "inputbox2",
|
69
|
|
- textareabox1: "textareabox1",
|
70
|
|
- textareabox2: "textareabox2",
|
71
|
|
- SubmitBtn1: "SubmitBtn1",
|
72
|
|
- SubmitBtn2: "SubmitBtn2",
|
73
|
|
- coverImgUrl: true,
|
74
|
|
- BgImg,
|
75
|
|
- BgImage,
|
76
|
|
- img: true,
|
77
|
|
- isLoading: false,
|
78
|
|
- uploadimg1:
|
79
|
|
- "https://spaceofcheng.oss-cn-beijing.aliyuncs.com/voting/uploadimg.png",
|
80
|
|
- uploadimg2:
|
81
|
|
- "https://spaceofcheng.oss-cn-beijing.aliyuncs.com/voting/yjsuploadimg.png",
|
|
58
|
+ return{
|
|
59
|
+ messagenum: 0,
|
|
60
|
+ postData: {
|
|
61
|
+ photo: "",
|
|
62
|
+ phone: "",
|
|
63
|
+ name: "",
|
|
64
|
+ addr: "",
|
|
65
|
+ message: ""
|
|
66
|
+ },
|
|
67
|
+ uploadimg: '',
|
|
68
|
+ actid: "",
|
82
|
69
|
yttjlove:
|
83
|
70
|
"https://spaceofcheng.oss-cn-beijing.aliyuncs.com/voting/yttj_icon_love.png",
|
84
|
71
|
yttjpen:
|
|
@@ -91,15 +78,6 @@ export default {
|
91
|
78
|
"https://spaceofcheng.oss-cn-beijing.aliyuncs.com/voting/xiegenjin.png",
|
92
|
79
|
yjsphone:
|
93
|
80
|
"https://spaceofcheng.oss-cn-beijing.aliyuncs.com/voting/dianhua.png",
|
94
|
|
- messagenum: 0,
|
95
|
|
- postData: {
|
96
|
|
- photo: "",
|
97
|
|
- phone: "",
|
98
|
|
- name: "",
|
99
|
|
- addr: "",
|
100
|
|
- message: ""
|
101
|
|
- },
|
102
|
|
- actid: ""
|
103
|
81
|
};
|
104
|
82
|
},
|
105
|
83
|
computed: {
|
|
@@ -110,42 +88,45 @@ export default {
|
110
|
88
|
},
|
111
|
89
|
created() {
|
112
|
90
|
this.actid = this.$route.params.actid;
|
113
|
|
- this.getActivity({
|
114
|
|
- actid: this.actid,
|
115
|
|
- })
|
116
|
|
- if (this.actid == 1) {
|
117
|
|
- this.coverImgUrl = true;
|
118
|
|
- this.img = true;
|
119
|
|
- this.address = false;
|
120
|
|
- this.writeword = true;
|
121
|
|
- this.desc = true;
|
122
|
|
- } else if (this.actid == 2) {
|
123
|
|
- this.coverImgUrl = false;
|
124
|
|
- this.img = false;
|
125
|
|
- this.address = true;
|
126
|
|
- this.writeword = false;
|
127
|
|
- this.desc = false;
|
128
|
|
- }
|
129
|
91
|
if (this.$route.params.actid != "") {
|
130
|
92
|
this.actid = this.$route.params.actid;
|
|
93
|
+ this.getActivity({
|
|
94
|
+ actid: this.actid,
|
|
95
|
+ }).then(() => {
|
|
96
|
+ if (this.theme === 1){
|
|
97
|
+ this.uploadimg = 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/voting/uploadimg.png'
|
|
98
|
+ } else {
|
|
99
|
+ this.uploadimg = 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/voting/yjsuploadimg.png'
|
|
100
|
+ }
|
|
101
|
+ })
|
131
|
102
|
} else {
|
132
|
103
|
alert("不存在对应的活动信息!");
|
133
|
104
|
}
|
134
|
105
|
},
|
135
|
106
|
methods: {
|
136
|
|
- ...mapVoteActions(["voteMember", "getActivity"]),
|
|
107
|
+ ...mapVoteActions(["voteMember","getActivity"]),
|
137
|
108
|
onRead(file) {
|
138
|
109
|
let that = this;
|
139
|
110
|
this.isLoading = true;
|
140
|
|
- that.toolClass
|
141
|
|
- .upload(file)
|
142
|
|
- .then(res => {
|
143
|
|
- that.uploadimg = res.result.url;
|
144
|
|
- that.postData.photo = res.result.url;
|
145
|
|
- })
|
146
|
|
- .catch(() => {
|
147
|
|
- that.isLoading = false;
|
148
|
|
- });
|
|
111
|
+ let reader = new FileReader();
|
|
112
|
+ reader.readAsDataURL(file.file);
|
|
113
|
+ reader.onload = function(e) {
|
|
114
|
+ let data = e.target.result;
|
|
115
|
+ //加载图片获取图片真实宽度和高度
|
|
116
|
+ let image = new Image();
|
|
117
|
+ image.src = data;
|
|
118
|
+ image.onload = function() {
|
|
119
|
+ that.toolClass
|
|
120
|
+ .upload(file)
|
|
121
|
+ .then(res => {
|
|
122
|
+ that.uploadimg = res.result.url;
|
|
123
|
+ that.postData.photo = res.result.url;
|
|
124
|
+ })
|
|
125
|
+ .catch(() => {
|
|
126
|
+ that.isLoading = false;
|
|
127
|
+ });
|
|
128
|
+ };
|
|
129
|
+ };
|
149
|
130
|
},
|
150
|
131
|
messageWrite() {
|
151
|
132
|
this.messagenum = this.postData.message.length;
|
|
@@ -168,10 +149,7 @@ export default {
|
168
|
149
|
<style lang='scss' scoped>
|
169
|
150
|
.context {
|
170
|
151
|
width: 100%;
|
171
|
|
- // height: 100%;
|
172
|
|
- // background-color: rgba(209, 220, 228, 1);
|
173
|
|
- // background:no-repeat center;
|
174
|
|
- // background-size:100% 100%;
|
|
152
|
+ height: 100%;
|
175
|
153
|
display: flex;
|
176
|
154
|
justify-content: center;
|
177
|
155
|
|
|
@@ -193,21 +171,6 @@ export default {
|
193
|
171
|
width: 0.22rem;
|
194
|
172
|
height: 0.2rem;
|
195
|
173
|
}
|
196
|
|
-
|
197
|
|
- .desc1 {
|
198
|
|
- font-size: 0.16rem;
|
199
|
|
- font-weight: bolder;
|
200
|
|
- color: rgba(112, 125, 138, 1);
|
201
|
|
- line-height: 0.22rem;
|
202
|
|
- padding-left: 0.03rem;
|
203
|
|
- }
|
204
|
|
- .desc2 {
|
205
|
|
- font-size: 0.16rem;
|
206
|
|
- font-weight: bolder;
|
207
|
|
- color: rgba(112, 84, 75, 1);
|
208
|
|
- line-height: 0.22rem;
|
209
|
|
- padding-left: 0.03rem;
|
210
|
|
- }
|
211
|
174
|
}
|
212
|
175
|
|
213
|
176
|
.uploadimgbox {
|
|
@@ -225,20 +188,6 @@ export default {
|
225
|
188
|
width: 0.22rem;
|
226
|
189
|
height: 0.2rem;
|
227
|
190
|
}
|
228
|
|
- .desc1 {
|
229
|
|
- font-size: 0.16rem;
|
230
|
|
- font-weight: bolder;
|
231
|
|
- color: rgba(112, 125, 138, 1);
|
232
|
|
- line-height: 0.22rem;
|
233
|
|
- padding-left: 0.03rem;
|
234
|
|
- }
|
235
|
|
- .desc2 {
|
236
|
|
- font-size: 0.16rem;
|
237
|
|
- font-weight: bolder;
|
238
|
|
- color: rgba(112, 84, 75, 1);
|
239
|
|
- line-height: 0.22rem;
|
240
|
|
- padding-left: 0.03rem;
|
241
|
|
- }
|
242
|
191
|
}
|
243
|
192
|
|
244
|
193
|
.input_content {
|
|
@@ -292,51 +241,12 @@ export default {
|
292
|
241
|
width: 0.22rem;
|
293
|
242
|
height: 0.2rem;
|
294
|
243
|
}
|
295
|
|
- .desc1 {
|
296
|
|
- font-size: 0.16rem;
|
297
|
|
- font-family: PingFangSC-Medium;
|
298
|
|
- font-weight: bolder;
|
299
|
|
- color: rgba(112, 125, 138, 1);
|
300
|
|
- line-height: 0.22rem;
|
301
|
|
- padding-left: 0.03rem;
|
302
|
|
- }
|
303
|
|
- .desc2 {
|
304
|
|
- font-size: 0.16rem;
|
305
|
|
- font-family: PingFangSC-Medium;
|
306
|
|
- font-weight: bolder;
|
307
|
|
- color: rgba(112, 84, 75, 1);
|
308
|
|
- line-height: 0.22rem;
|
309
|
|
- padding-left: 0.03rem;
|
310
|
|
- }
|
311
|
244
|
}
|
312
|
245
|
|
313
|
|
- .inputbox1 {
|
|
246
|
+ .inputbox {
|
314
|
247
|
width: 92%;
|
315
|
248
|
height: 0.4rem;
|
316
|
|
- background-color: rgba(220, 229, 236, 0.63);
|
317
|
|
- margin-left: calc(4%);
|
318
|
|
- margin-bottom: 0.08rem;
|
319
|
|
- border-radius: 0.06rem;
|
320
|
|
- input {
|
321
|
|
- width: 100%;
|
322
|
|
- height: 100%;
|
323
|
|
- background-color: rgba(255, 255, 255, 0);
|
324
|
|
- text-indent: 0.12rem;
|
325
|
|
- }
|
326
|
249
|
|
327
|
|
- input::-webkit-input-placeholder {
|
328
|
|
- font-size: 0.16rem;
|
329
|
|
- font-family: PingFangSC-Medium;
|
330
|
|
- font-weight: bolder;
|
331
|
|
- color: rgba(117, 132, 146, 0.4);
|
332
|
|
- line-height: 0.22rem;
|
333
|
|
- }
|
334
|
|
- }
|
335
|
|
-
|
336
|
|
- .inputbox2 {
|
337
|
|
- width: 92%;
|
338
|
|
- height: 0.4rem;
|
339
|
|
- background-color: rgba(232, 224, 220, 1);
|
340
|
250
|
margin-left: calc(4%);
|
341
|
251
|
margin-bottom: 0.08rem;
|
342
|
252
|
border-radius: 0.06rem;
|
|
@@ -346,19 +256,10 @@ export default {
|
346
|
256
|
background-color: rgba(255, 255, 255, 0);
|
347
|
257
|
text-indent: 0.12rem;
|
348
|
258
|
}
|
349
|
|
-
|
350
|
|
- input::-webkit-input-placeholder {
|
351
|
|
- font-size: 0.16rem;
|
352
|
|
- font-family: PingFangSC-Medium;
|
353
|
|
- font-weight: bolder;
|
354
|
|
- color: rgba(139, 116, 102, 0.4);
|
355
|
|
- line-height: 0.22rem;
|
356
|
|
- }
|
357
|
259
|
}
|
358
|
|
- .textareabox1 {
|
|
260
|
+ .textareabox {
|
359
|
261
|
width: 92%;
|
360
|
262
|
height: 0.8rem;
|
361
|
|
- background-color: rgba(220, 229, 236, 0.63);
|
362
|
263
|
border-radius: 0.06rem;
|
363
|
264
|
margin-left: calc(4%);
|
364
|
265
|
.addressarea {
|
|
@@ -368,37 +269,7 @@ export default {
|
368
|
269
|
background-color: rgba(255, 255, 255, 0);
|
369
|
270
|
margin-left: 0.12rem;
|
370
|
271
|
}
|
371
|
|
- textarea::-webkit-input-placeholder {
|
372
|
|
- font-size: 0.16rem;
|
373
|
|
- font-family: PingFangSC-Medium;
|
374
|
|
- font-weight: bolder;
|
375
|
|
- color: rgba(112, 125, 138, 0.4);
|
376
|
|
- line-height: 0.22rem;
|
377
|
|
- }
|
378
|
272
|
}
|
379
|
|
-
|
380
|
|
- .textareabox2 {
|
381
|
|
- width: 92%;
|
382
|
|
- height: 0.8rem;
|
383
|
|
- background-color: rgba(232, 224, 220, 1);
|
384
|
|
- border-radius: 0.06rem;
|
385
|
|
- margin-left: calc(4%);
|
386
|
|
- .addressarea {
|
387
|
|
- width: 100%;
|
388
|
|
- height: 100%;
|
389
|
|
- margin-top: 0.08rem;
|
390
|
|
- background-color: rgba(255, 255, 255, 0);
|
391
|
|
- margin-left: 0.12rem;
|
392
|
|
- }
|
393
|
|
- textarea::-webkit-input-placeholder {
|
394
|
|
- font-size: 0.16rem;
|
395
|
|
- font-family: PingFangSC-Medium;
|
396
|
|
- font-weight: bolder;
|
397
|
|
- color: rgba(139, 116, 102, 0.4);
|
398
|
|
- line-height: 0.22rem;
|
399
|
|
- }
|
400
|
|
- }
|
401
|
|
-
|
402
|
273
|
.btn {
|
403
|
274
|
width: 100%;
|
404
|
275
|
display: flex;
|
|
@@ -410,12 +281,10 @@ export default {
|
410
|
281
|
// left: 0;
|
411
|
282
|
// bottom: 0.32rem;
|
412
|
283
|
|
413
|
|
- .SubmitBtn1 {
|
|
284
|
+ .SubmitBtn {
|
414
|
285
|
width: 44%;
|
415
|
286
|
height: 0.5rem;
|
416
|
287
|
border-radius: 0.23rem;
|
417
|
|
- background: rgba(166, 184, 201, 1);
|
418
|
|
- box-shadow: 0px 2px 10px 0px rgba(207, 217, 227, 1);
|
419
|
288
|
border: none;
|
420
|
289
|
font-size: 0.2rem;
|
421
|
290
|
font-family: PingFangSC-Medium;
|
|
@@ -424,23 +293,73 @@ export default {
|
424
|
293
|
line-height: 0.28rem;
|
425
|
294
|
// padding-top: 0.32rem;
|
426
|
295
|
}
|
427
|
|
- .SubmitBtn2 {
|
428
|
|
- width: 44%;
|
429
|
|
- height: 0.5rem;
|
430
|
|
- border-radius: 0.23rem;
|
431
|
|
- background: rgba(173, 145, 129, 1);
|
432
|
|
- box-shadow: 0px 2px 10px 0px rgba(120, 108, 101, 0.46);
|
433
|
|
- border: none;
|
434
|
|
- font-size: 0.2rem;
|
435
|
|
- font-family: PingFangSC-Medium;
|
436
|
|
- font-weight: bolder;
|
437
|
|
- color: rgba(255, 255, 255, 1);
|
438
|
|
- line-height: 0.28rem;
|
439
|
|
- margin-top: 1rem;
|
440
|
|
- }
|
441
|
296
|
}
|
442
|
297
|
}
|
443
|
298
|
}
|
|
299
|
+
|
|
300
|
+.theme1{
|
|
301
|
+ background-image: url("../../assets/yttjbg.png");
|
|
302
|
+ .desc{
|
|
303
|
+ font-size: 0.16rem;
|
|
304
|
+ font-weight: bolder;
|
|
305
|
+ color: rgba(112, 125, 138, 1);
|
|
306
|
+ line-height: 0.22rem;
|
|
307
|
+ padding-left: 0.03rem;
|
|
308
|
+ }
|
|
309
|
+ .cinput{
|
|
310
|
+ background-color: rgba(220, 229, 236, 0.63);
|
|
311
|
+ }
|
|
312
|
+ .cbtn{
|
|
313
|
+ background: rgba(166, 184, 201, 1);
|
|
314
|
+ box-shadow: 0px 2px 10px 0px rgba(207, 217, 227, 1);
|
|
315
|
+ }
|
|
316
|
+ input::-webkit-input-placeholder {
|
|
317
|
+ font-size: 0.16rem;
|
|
318
|
+ font-family: PingFangSC-Medium;
|
|
319
|
+ font-weight: bolder;
|
|
320
|
+ color: rgba(117, 132, 146, 0.4);
|
|
321
|
+ line-height: 0.22rem;
|
|
322
|
+ }
|
|
323
|
+ textarea::-webkit-input-placeholder {
|
|
324
|
+ font-size: 0.16rem;
|
|
325
|
+ font-family: PingFangSC-Medium;
|
|
326
|
+ font-weight: bolder;
|
|
327
|
+ color: rgba(112, 125, 138, 0.4);
|
|
328
|
+ line-height: 0.22rem;
|
|
329
|
+ }
|
|
330
|
+}
|
|
331
|
+
|
|
332
|
+.theme2{
|
|
333
|
+ background-image: url("../../assets/bgimg.jpg");
|
|
334
|
+ .desc{
|
|
335
|
+ font-size: 0.16rem;
|
|
336
|
+ font-weight: bolder;
|
|
337
|
+ color: rgba(112, 84, 75, 1);
|
|
338
|
+ line-height: 0.22rem;
|
|
339
|
+ padding-left: 0.03rem;
|
|
340
|
+ }
|
|
341
|
+ .cinput{
|
|
342
|
+ background-color: rgba(232, 224, 220, 1);
|
|
343
|
+ }
|
|
344
|
+ .cbtn{
|
|
345
|
+ background: rgba(173, 145, 129, 1);
|
|
346
|
+ box-shadow: 0px 2px 10px 0px rgba(120, 108, 101, 0.46);
|
|
347
|
+ }
|
|
348
|
+ input::-webkit-input-placeholder {
|
|
349
|
+ font-size: 0.16rem;
|
|
350
|
+ font-family: PingFangSC-Medium;
|
|
351
|
+ font-weight: bolder;
|
|
352
|
+ color: rgba(139, 116, 102, 0.4);
|
|
353
|
+ line-height: 0.22rem;
|
|
354
|
+ }
|
|
355
|
+ textarea::-webkit-input-placeholder {
|
|
356
|
+ font-size: 0.16rem;
|
|
357
|
+ font-family: PingFangSC-Medium;
|
|
358
|
+ font-weight: bolder;
|
|
359
|
+ color: rgba(139, 116, 102, 0.4);
|
|
360
|
+ line-height: 0.22rem;
|
|
361
|
+ }
|
|
362
|
+}
|
444
|
363
|
</style>
|
445
|
364
|
|
446
|
365
|
|