|
@@ -2,55 +2,93 @@
|
2
|
2
|
<div class="context">
|
3
|
3
|
<div class="ContextBox">
|
4
|
4
|
<div class="uploadimg">
|
5
|
|
- <img :src="FamilyPortraitIcon">
|
|
5
|
+ <img src="https://spaceofcheng.oss-cn-beijing.aliyuncs.com/voting/yttj_icon_love.png">
|
6
|
6
|
<span>上传您认为最美的全家福照片</span>
|
7
|
7
|
</div>
|
8
|
|
- <img class="uploadimgbox" :src="uploadimg">
|
|
8
|
+ <van-uploader :after-read="onRead">
|
|
9
|
+ <img class="uploadimgbox" :src="uploadimg">
|
|
10
|
+ </van-uploader>
|
9
|
11
|
<div class="WriteWord">
|
10
|
|
- <img :src="WriteWordIcon">
|
|
12
|
+ <img src="https://spaceofcheng.oss-cn-beijing.aliyuncs.com/voting/yttj_icon_pen.png">
|
11
|
13
|
<span>寄语</span>
|
12
|
14
|
</div>
|
13
|
15
|
<div class="input_content">
|
14
|
|
- <textarea id="textArea" class="content_txt" maxlength="200"></textarea>
|
|
16
|
+ <textarea id="textArea" @input="messageWrite" maxlength="200" v-model="postData.message" class="content_txt" ></textarea>
|
15
|
17
|
<span class="number">
|
16
|
|
- <span id="textNum">0</span>
|
|
18
|
+ <span id="textNum">{{messagenum}}</span>
|
17
|
19
|
<span class="totalnum" >/200</span>
|
18
|
20
|
</span>
|
19
|
21
|
</div>
|
20
|
22
|
<div class="ContactInformation">
|
21
|
|
- <img :src="ContactInformationIcon"/>
|
|
23
|
+ <img src="https://spaceofcheng.oss-cn-beijing.aliyuncs.com/voting/yttj_icon_phone.png"/>
|
22
|
24
|
<span>联系方式</span>
|
23
|
25
|
</div>
|
24
|
|
- <input placeholder="输入手机号"/>
|
25
|
|
- <input placeholder="输入姓名"/>
|
|
26
|
+ <input placeholder="输入手机号" v-model="postData.phone"/>
|
|
27
|
+ <input placeholder="输入姓名" v-model="postData.name"/>
|
26
|
28
|
<!-- <textarea class="addressarea" placeholder="所在社区"></textarea> -->
|
27
|
29
|
<div class="btn">
|
28
|
30
|
<button class="SubmitBtn">提交</button>
|
29
|
31
|
</div>
|
30
|
|
-
|
31
|
32
|
</div>
|
32
|
33
|
</div>
|
33
|
34
|
</template>
|
34
|
35
|
|
35
|
36
|
<script>
|
36
|
|
-// import FamilyPortraitIcon from "../../common/icon/xin.png";
|
37
|
|
-// import WriteWordIcon from "../../common/icon/xiegenjin.png";
|
38
|
|
-// import ContactInformationIcon from "../../common/icon/dianhua.png"
|
39
|
|
-// import uploadimg from "../../images/uploadimg.png";
|
|
37
|
+import { createNamespacedHelpers } from 'vuex';
|
|
38
|
+const {mapState: mapVoteState, mapActions: mapVoteActions} = createNamespacedHelpers('vote')
|
40
|
39
|
export default {
|
41
|
|
- name: "signup",
|
|
40
|
+ name: 'signup',
|
42
|
41
|
data() {
|
43
|
42
|
return {
|
44
|
|
- // FamilyPortraitIcon,
|
45
|
|
- // WriteWordIcon,
|
46
|
|
- // uploadimg,
|
47
|
|
- // ContactInformationIcon,
|
|
43
|
+ isLoading: false,
|
|
44
|
+ uploadimg: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/voting/uploadimg.png',
|
|
45
|
+ messagenum: 0,
|
|
46
|
+ postData: {
|
|
47
|
+ photo: '',
|
|
48
|
+ phone: '',
|
|
49
|
+ name: '',
|
|
50
|
+ addr: '',
|
|
51
|
+ message: '',
|
|
52
|
+ }
|
48
|
53
|
};
|
49
|
|
- }
|
|
54
|
+ },
|
|
55
|
+ computed: {
|
|
56
|
+ },
|
|
57
|
+ methods: {
|
|
58
|
+ ...mapVoteActions([
|
|
59
|
+ '',
|
|
60
|
+ ]),
|
|
61
|
+ onRead (file) {
|
|
62
|
+ let that = this
|
|
63
|
+ this.isLoading = true
|
|
64
|
+ let reader = new FileReader();
|
|
65
|
+ reader.readAsDataURL(file.file);
|
|
66
|
+ reader.onload = function (e) {
|
|
67
|
+ let data = e.target.result;
|
|
68
|
+ //加载图片获取图片真实宽度和高度
|
|
69
|
+ let image = new Image();
|
|
70
|
+ image.src = data;
|
|
71
|
+ image.onload = function () {
|
|
72
|
+ that.toolClass.upload(file).then((res) => {
|
|
73
|
+ that.uploadimg = res.result.url
|
|
74
|
+ that.postData.photo = res.result.url
|
|
75
|
+ }).catch(() => {
|
|
76
|
+ that.isLoading = false
|
|
77
|
+ })
|
|
78
|
+ };
|
|
79
|
+ };
|
|
80
|
+ },
|
|
81
|
+ messageWrite () {
|
|
82
|
+ this.messagenum = this.postData.message.length
|
|
83
|
+ },
|
|
84
|
+ SubmitBtn () {
|
|
85
|
+
|
|
86
|
+ },
|
|
87
|
+ },
|
50
|
88
|
};
|
51
|
89
|
</script>
|
52
|
90
|
|
53
|
|
-<style lang="scss" scoped>
|
|
91
|
+<style lang='scss' scoped>
|
54
|
92
|
.context {
|
55
|
93
|
width: 100%;
|
56
|
94
|
height: 100%;
|