|
@@ -6,24 +6,20 @@
|
6
|
6
|
{{ ruleForm.activityContent }}
|
7
|
7
|
</div>
|
8
|
8
|
<div class="activityContextImg">
|
9
|
|
- <img v-for="item in ruleForm.contentImg" :src="item" width="80" height="80" >
|
|
9
|
+ <img v-for="item in ruleForm.contentImg" :src="item" width="80" height="80" />
|
10
|
10
|
</div>
|
|
11
|
+ <span v-if="ruleForm.signInCode=='1'">
|
11
|
12
|
<div style="display: flex;">
|
12
|
13
|
<span style="width: 200px;transform:translateY(25%);">是否需要报名人扫码签到</span>
|
13
|
|
- <el-radio v-model="ruleForm.radio" label="1" style="padding-left:4%;font-weight:bold;font-size:12px;transform:translateY(30%);">需要</el-radio>
|
14
|
|
- <el-radio v-model="ruleForm.radio" label="2" style="padding-left:8%;font-weight:bold;font-size:12px;transform:translateY(30%);">不需要</el-radio>
|
15
|
|
- <el-button type="primary" style="float:left;" @click="singn">查看签到名单</el-button>
|
|
14
|
+ <el-radio v-model="ruleForm.signInCode" label="1" style="padding-left:4%;font-weight:bold;font-size:12px;transform:translateY(30%);">需要</el-radio>
|
|
15
|
+ <el-radio v-model="ruleForm.signInCode" label="2" style="padding-left:8%;font-weight:bold;font-size:12px;transform:translateY(30%);">不需要</el-radio>
|
|
16
|
+ <span style="padding-left:20%"><el-button type="primary" style="float:left;" @click="singn">查看签到名单</el-button></span>
|
16
|
17
|
</div>
|
17
|
|
- <div style="padding-left:30%;">
|
18
|
|
- <div><img :src="ruleForm.activityCode" width="200" height="200" ></div>
|
19
|
|
-
|
20
|
|
- <a :href="ruleForm.activityCode" download="图片">
|
21
|
|
- <img :src="ruleForm.activityCode" alt="图片">
|
22
|
|
- </a>
|
23
|
|
-
|
24
|
|
- <!-- <a download="图片" :href="ruleForm.activityCode + 'admin/miniProgram.jpg'">点击下载</a>
|
25
|
|
- <div><el-button type="primary" style="float:left;" @click=" downloadCodeImg()">查看签到名单</el-button> </div> -->
|
26
|
|
- </div>
|
|
18
|
+ <div style="padding-left:30%;">
|
|
19
|
+ <div><img :src="qrcode" width="200" height="200" ></div>
|
|
20
|
+ <a :href="qrcode" download="qrcode.jpg" style="color:#00BFFF;padding-left:15%">点击下载</a>
|
|
21
|
+ </div>
|
|
22
|
+ </span>
|
27
|
23
|
<div class="progress">
|
28
|
24
|
<div class="text-progress">
|
29
|
25
|
<span class="people-number">已报名人数 {{ ruleForm.signUpCount }}</span>
|
|
@@ -32,7 +28,7 @@
|
32
|
28
|
</div>
|
33
|
29
|
<div class="circular"/>
|
34
|
30
|
<div class="people-limit">限制{{ ruleForm.signUpMax }}人</div>
|
35
|
|
- <a type="primary" style="float: left;" @click="lockSignUp">查看报名名单</a>
|
|
31
|
+ <el-button type="primary" style="float: left;" @click="lockSignUp">查看报名名单</el-button>
|
36
|
32
|
</div>
|
37
|
33
|
<span>报名截止时间:{{ formatDate(ruleForm.registrationEndTime) }}</span>
|
38
|
34
|
<div class="bom-button">
|
|
@@ -42,6 +38,8 @@
|
42
|
38
|
</template>
|
43
|
39
|
|
44
|
40
|
<script>
|
|
41
|
+import html2canvas from 'html2canvas';
|
|
42
|
+import QRCode from 'qrcode'
|
45
|
43
|
|
46
|
44
|
export default {
|
47
|
45
|
name: 'Index',
|
|
@@ -61,8 +59,11 @@ export default {
|
61
|
59
|
sort: 1, // 权重
|
62
|
60
|
status: '' // 状态 0 是已作废 1 是已发布 2 是草稿 3 是已修改
|
63
|
61
|
},
|
|
62
|
+ codeIMG: '',
|
|
63
|
+ ownerDocument: '',
|
64
|
64
|
isEdi: true, // 显示修改按钮
|
65
|
|
- innerW: 0 // 进度条
|
|
65
|
+ innerW: 0, // 进度条
|
|
66
|
+ qrcode: '',
|
66
|
67
|
}
|
67
|
68
|
},
|
68
|
69
|
mounted() {
|
|
@@ -76,12 +77,10 @@ export default {
|
76
|
77
|
this.ruleForm = resData.info
|
77
|
78
|
this.codeIMG =resData.info.activityCode
|
78
|
79
|
this.ruleForm.contentImg = resData.contentImg
|
79
|
|
- if (this.ruleForm.signUpMax !== 0) {
|
80
|
|
- const tempNum = 450 / this.ruleForm.signUpMax
|
81
|
|
- this.innerW = this.ruleForm.signUpCount * tempNum
|
82
|
|
- console.log(this.$refs.innerDiv.style.width)
|
83
|
|
- console.log(this.innerW)
|
84
|
|
- }
|
|
80
|
+
|
|
81
|
+ QRCode.toDataURL(this.codeIMG, (err, url)=> {
|
|
82
|
+ this.qrcode = url
|
|
83
|
+ })
|
85
|
84
|
if (this.ruleForm.status === '0') {
|
86
|
85
|
this.isEdi = false
|
87
|
86
|
}
|
|
@@ -121,8 +120,40 @@ export default {
|
121
|
120
|
alink.href = this.ruleForm.activityCode;
|
122
|
121
|
alink.download = "pic"; //图片名
|
123
|
122
|
alink.click();
|
124
|
|
- }
|
125
|
|
-
|
|
123
|
+ },
|
|
124
|
+
|
|
125
|
+ dataURLToBlob(dataurl) {//ie 图片转格式
|
|
126
|
+ var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
|
|
127
|
+ bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
|
|
128
|
+ while (n--) {
|
|
129
|
+ u8arr[n] = bstr.charCodeAt(n);
|
|
130
|
+ }
|
|
131
|
+ return new Blob([u8arr], {type: mime})
|
|
132
|
+ },
|
|
133
|
+
|
|
134
|
+ downloadResult() {
|
|
135
|
+ html2canvas(document.getElementById('mymap')).then(canvas => {
|
|
136
|
+ this.imgmap = canvas.toDataURL()
|
|
137
|
+ console.log(999, this.imgmap)
|
|
138
|
+ if (window.navigator.msSaveOrOpenBlob) {
|
|
139
|
+ var bstr = atob(this.imgmap.split(',')[1])
|
|
140
|
+ var n = bstr.length
|
|
141
|
+ var u8arr = new Uint8Array(n)
|
|
142
|
+ while (n--) {
|
|
143
|
+ u8arr[n] = bstr.charCodeAt(n)
|
|
144
|
+ }
|
|
145
|
+ var blob = new Blob([u8arr])
|
|
146
|
+ window.navigator.msSaveOrOpenBlob(blob, 'chart-download' + '.' + 'png')
|
|
147
|
+ } else {
|
|
148
|
+ // 这里就按照chrome等新版浏览器来处理
|
|
149
|
+ const a = document.createElement('a')
|
|
150
|
+ a.href = this.imgmap
|
|
151
|
+ a.setAttribute('download', 'chart-download')
|
|
152
|
+ a.click()
|
|
153
|
+ }
|
|
154
|
+
|
|
155
|
+ });
|
|
156
|
+ }
|
126
|
157
|
}
|
127
|
158
|
}
|
128
|
159
|
</script>
|