Skip to content

Commit 1410086

Browse files
committed
add:点击复制取件码,文本
1 parent dd3267c commit 1410086

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

templates/index.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<meta name="description" content="{{description}}"/>
1212
<meta name="keywords" content="{{keywords}}"/>
1313
<meta name="generator" content="FileCodeBox"/>
14-
<meta name="template" content="Lan-V1.5.5"/>
14+
<meta name="template" content="Lan-V1.5.6"/>
1515
<style>
1616
.qu .el-button {
1717
width: 100px;
@@ -87,7 +87,7 @@
8787
</el-col>
8888
</el-card>
8989
</el-row>
90-
<el-row v-else style="width:400px;height: 596px;margin: 20vh auto 0 auto">
90+
<el-row v-else style="width:400px;height: 596px;margin: 6vh auto 0 auto">
9191
<el-col :span="24">
9292
<el-card style="padding-top: 20px">
9393
<el-row>
@@ -133,9 +133,6 @@
133133
placeholder="请输入内容,使用按钮存入"
134134
v-model="uploadData.text">
135135
</el-input>
136-
<!--? <div style="height: 240px">-->
137-
<!--? </div>e="height: 240px">-->
138-
<!--? </div>-->
139136
<div class="el-upload__tip">
140137
<el-button round @click="pageNum=0">
141138
<div class="el-icon-back"></div>
@@ -160,11 +157,11 @@
160157
size="50%"
161158
>
162159
<el-card v-for="(file,index) in files" :key="index" class="box-card">
163-
<div style="cursor: pointer;text-align: left">
160+
<div style="cursor: pointer;text-align: left;margin-left: 2rem">
164161
<div>取件码:${ file.code }</div>
165162
<div>文件名:${ file.name }</div>
166163
<div v-if="file.name==='文本分享'">
167-
<span>内&nbsp;&nbsp; 容:${ file.text }</span>
164+
<span @click="copyText(file.text,1)">内&nbsp;&nbsp; 容:${ file.text }</span>
168165
</div>
169166
<div v-else>
170167
<span>链&nbsp;&nbsp; 接:</span>
@@ -185,14 +182,14 @@
185182
<el-empty v-if="files.length===0" description="请上传文件"></el-empty>
186183
<el-card style="margin-top: 0.2rem" v-for="(file,index) in files" :key="index">
187184
<el-row>
188-
<el-col :span="20">
185+
<el-col :span="15">
189186
<el-row>
190187
<el-col :span="24" style="line-height: 45px">
191188
${ file.name }
192189
</el-col>
193190
<el-col :span="24">
194191
取件码:
195-
<h1 @click="copyCode(file.code)" style="margin: 0;display: inline;cursor: pointer">
192+
<h1 @click="copyText(file.code,0)" style="margin: 0;display: inline;cursor: pointer">
196193
${ file.code }
197194
</h1>
198195
</el-col>
@@ -299,10 +296,13 @@ <h1 @click="copyCode(file.code)" style="margin: 0;display: inline;cursor: pointe
299296
})
300297
})
301298
},
302-
copyCode: function (value) {
299+
copyText: function (value, style = 1) {
300+
if (style === 0) {
301+
value = '我在分享了给你文件,取件码:${value},${window.location.href}?code=${value}';
302+
}
303303
const input = document.createElement('input');
304304
input.setAttribute('readonly', 'readonly');
305-
input.setAttribute('value', `我在${window.location.href}分享了给你文件,取件码:${value}`);
305+
input.setAttribute('value', value);
306306
document.body.appendChild(input);
307307
input.select();
308308
if (document.execCommand('copy')) {

0 commit comments

Comments
 (0)