Browse Source

修复部分浏览器复制的故障

master
453530270@qq.com 3 years ago
parent
commit
fd17885c85
  1. 2
      pages/login/index.vue
  2. 66
      pages/verfiy/vsuccess.vue

2
pages/login/index.vue

@ -38,7 +38,7 @@
<!-- logo -->
<view class="vbottom">
<view class="imagezone">
<image mode="heightFix" style="height: 72rpx;" src="../../static/wjslogo.png"/>X
<image mode="heightFix" style="height: 72rpx;" src="../../static/wjslogo.png"/>
<image mode="heightFix" style="height: 72rpx;" src="../../static/ccde.png"/>
</view>
<view class="txtzone">

66
pages/verfiy/vsuccess.vue

@ -6,7 +6,7 @@
</view>
<view class="icon_area">
<image src="../../static/pay/success.png" mode="" class="success_icon"></image>
<view class="success_txt">实名等级完成</view>
<view class="success_txt">实名登记完成</view>
<view class="sucess_tips">11月1日至30日免费使用过期后需正常续费后方能使用</view>
</view>
<view class="content_area">
@ -22,12 +22,12 @@
<view class="down_link">国家文化专网网络应用入口请下载</view>
<view class="right_icon"></view>
</view>
<view class="down_item" @click="docopy('https://pelerin.cn/planet')">
<view class="down_item" style="user-select: all;" @click="docopy('https://pelerin.cn/planet')">
<view class="left_icon"></view>
<view class="down_link">根服务器文件请复制</view>
<view class="right_icopy" ></view>
</view>
<view class="down_item" @click="docopy('fc00dd5d63caabd8')">
<view class="down_item" style="user-select: all;" @click="docopy('fc00dd5d63caabd8')">
<view class="left_icon"></view>
<view class="down_link">网络ID请复制</view>
<view class="right_icopy" ></view>
@ -52,15 +52,16 @@
</template>
<script>
import store from '@/store'
//
import { checkLogin, showError } from '@/core/app'
import * as UserApi from '@/api/user'
import store from '@/store'
//
import { checkLogin, showError } from '@/core/app'
import * as UserApi from '@/api/user'
import * as Verify from '@/utils/verify'
export default {
data() {
return {
installationCode: '',
devsn: '',
account: '',
// dev refer
devpath:"",
@ -79,10 +80,29 @@
methods: {
//
docopy(str){
navigator.clipboard.writeText(str).then(() => {
//this.$message.success('')
//
if(navigator.clipboard){
navigator.clipboard.writeText(str).then(() => {
this.$toast("复制成功")
})
}else{
var textarea = document.createElement('textarea');
document.body.appendChild(textarea);
//
textarea.style.position = 'fixed';
textarea.style.clip = 'rect(0 0 0 0)';
textarea.style.top = '10px';
//
textarea.value = str;
//
textarea.select();
//
document.execCommand('copy', true);
//
document.body.removeChild(textarea);
this.$toast("复制成功")
})
}
//this.$toast(str)
//alert("changancopy")
},
@ -170,14 +190,24 @@
//
submit(){
const app = this
let rdata = {devsn:app.devsn}
UserApi.devrs({form:data}).then(res=>{
console.log(res)
app.$navTo("pages/book/success")
}).catch(err=>{
console.log(err)
});
if(app.formValidation(app.devsn)){
let rdata = {devsn:app.devsn}
UserApi.devrs({form:rdata}).then(res=>{
console.log(res)
app.$navTo("pages/book/success")
}).catch(err=>{
console.log(err)
});
}
//app.$navTo("pages/book/success")
},
//todo
formValidation(str){
if(Verify.isEmpty(str)){
this.$toast('设备安装码不能为空')
return false
}
return true
}
}
}

Loading…
Cancel
Save