Commit cf256ef1 authored by salitedfish's avatar salitedfish

bug修复

parent 60787343
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
{{ name }} {{ name }}
</div> </div>
<div ref="btn" @click="handleClickCopy(name)" class="ml-1"> <div ref="btn" @click="handleClickCopy(name)" class="copyBtn ml-1" >
<app-icon name="icon-fuzhi" size="18px"></app-icon> <app-icon name="icon-fuzhi" size="18px"></app-icon>
</div> </div>
</div> </div>
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
<script lang="ts"> <script lang="ts">
import Vue from "vue"; import Vue from "vue";
// import Clipboard from "clipboard"; import ClipboardJS from "clipboard";
import { ActionSheet } from "vant"; import { ActionSheet } from "vant";
export default Vue.extend({ export default Vue.extend({
...@@ -225,23 +225,26 @@ export default Vue.extend({ ...@@ -225,23 +225,26 @@ export default Vue.extend({
} }
this.$emit("cellOnChange", this.inputValue); this.$emit("cellOnChange", this.inputValue);
}, },
handleClickCopy(text: string | number) { async handleClickCopy(text: string | number) {
this.$util.cliboard(text); // this.$util.cliboard(text);
this.$toast("复制成功");
// const btn = this.$refs.btn as HTMLElement;
// const clipboard = new Clipboard(btn);
// clipboard.on("success", function (e) {
// console.info("Action:", e.action);
// console.info("Text:", e.text);
// console.info("Trigger:", e.trigger);
// e.clearSelection();
// });
// clipboard.on("error", function (e) {
// console.error("Action:", e.action);
// console.error("Trigger:", e.trigger);
// });
// this.$toast("复制成功"); // this.$toast("复制成功");
// const clipboardObj = navigator.clipboard
// await clipboardObj.writeText(text.toString())
let clipboard = new ClipboardJS('.copyBtn', {
text: function() {
return text.toString();
}
});
clipboard.on("success", (e)=>{
this.$toast("复制成功~");
e.clearSelection();
});
clipboard.on("error", ()=>{
this.$toast("复制失败~");
});
}, },
onCancel() {}, onCancel() {},
onSelect(value: any) { onSelect(value: any) {
......
...@@ -5,5 +5,7 @@ export default function (text: string | number) { ...@@ -5,5 +5,7 @@ export default function (text: string | number) {
ele.setAttribute('data-clipboard-text', text.toString()) ele.setAttribute('data-clipboard-text', text.toString())
document.body.appendChild(ele) document.body.appendChild(ele)
const clipboard = new ClipboardJS(ele) const clipboard = new ClipboardJS(ele)
// clipboard.write(text.toString())
// return new ClipboardJS(ele)
// document.body.removeChild(ele) // document.body.removeChild(ele)
} }
<template> <template>
<div class="register pt-5"> <div class="register pt-5">
<div class="closeBtnBox">
<img src="@/assets/img/closeBtn.png" class="closeBtn" @click="closeLogin"/>
</div>
<div class="flex justify-between items-center text-base"> <div class="flex justify-between items-center text-base">
<img src="@/assets/img/cmp_logo.png" class="h-12" alt="" /> <img src="@/assets/img/cmp_logo.png" class="h-12" alt="" />
<div class=" text-font-white header-text">注册/登录</div> <div class=" text-font-white header-text">注册/登录</div>
...@@ -324,6 +327,9 @@ export default Vue.extend({ ...@@ -324,6 +327,9 @@ export default Vue.extend({
sendVoice() { sendVoice() {
return this.sendVoiceFunc(this.phone); return this.sendVoiceFunc(this.phone);
}, },
closeLogin(){
this.$router.push('/Mine')
}
}, },
computed: { computed: {
codeValid(): boolean { codeValid(): boolean {
...@@ -384,4 +390,16 @@ export default Vue.extend({ ...@@ -384,4 +390,16 @@ export default Vue.extend({
font-weight: 500; font-weight: 500;
color: #EEF1F6; color: #EEF1F6;
} }
.closeBtnBox {
color: white;
height: 50px;
line-height: 50px;
display: flex;
align-items: center;
}
.closeBtn {
width: 40px;
text-align:center;
cursor: pointer;
}
</style> </style>
\ No newline at end of file
...@@ -69,6 +69,7 @@ export default Vue.extend({ ...@@ -69,6 +69,7 @@ export default Vue.extend({
}, },
methods:{ methods:{
async submitUserInfo(){ async submitUserInfo(){
if(this.btnDisabled) return
let data = {} as any let data = {} as any
const value = this.inputSet.value; const value = this.inputSet.value;
data[this.$route.params.type] = value; data[this.$route.params.type] = value;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment