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 --> <!-- logo -->
<view class="vbottom"> <view class="vbottom">
<view class="imagezone"> <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"/> <image mode="heightFix" style="height: 72rpx;" src="../../static/ccde.png"/>
</view> </view>
<view class="txtzone"> <view class="txtzone">

66
pages/verfiy/vsuccess.vue

@ -6,7 +6,7 @@
</view> </view>
<view class="icon_area"> <view class="icon_area">
<image src="../../static/pay/success.png" mode="" class="success_icon"></image> <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 class="sucess_tips">11月1日至30日免费使用过期后需正常续费后方能使用</view>
</view> </view>
<view class="content_area"> <view class="content_area">
@ -22,12 +22,12 @@
<view class="down_link">国家文化专网网络应用入口请下载</view> <view class="down_link">国家文化专网网络应用入口请下载</view>
<view class="right_icon"></view> <view class="right_icon"></view>
</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="left_icon"></view>
<view class="down_link">根服务器文件请复制</view> <view class="down_link">根服务器文件请复制</view>
<view class="right_icopy" ></view> <view class="right_icopy" ></view>
</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="left_icon"></view>
<view class="down_link">网络ID请复制</view> <view class="down_link">网络ID请复制</view>
<view class="right_icopy" ></view> <view class="right_icopy" ></view>
@ -52,15 +52,16 @@
</template> </template>
<script> <script>
import store from '@/store' import store from '@/store'
// //
import { checkLogin, showError } from '@/core/app' import { checkLogin, showError } from '@/core/app'
import * as UserApi from '@/api/user' import * as UserApi from '@/api/user'
import * as Verify from '@/utils/verify'
export default { export default {
data() { data() {
return { return {
installationCode: '', devsn: '',
account: '', account: '',
// dev refer // dev refer
devpath:"", devpath:"",
@ -79,10 +80,29 @@
methods: { methods: {
// //
docopy(str){ 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("复制成功")
}) }
//this.$toast(str) //this.$toast(str)
//alert("changancopy") //alert("changancopy")
}, },
@ -170,14 +190,24 @@
// //
submit(){ submit(){
const app = this const app = this
let rdata = {devsn:app.devsn} if(app.formValidation(app.devsn)){
UserApi.devrs({form:data}).then(res=>{ let rdata = {devsn:app.devsn}
console.log(res) UserApi.devrs({form:rdata}).then(res=>{
app.$navTo("pages/book/success") console.log(res)
}).catch(err=>{ app.$navTo("pages/book/success")
console.log(err) }).catch(err=>{
}); console.log(err)
});
}
//app.$navTo("pages/book/success") //app.$navTo("pages/book/success")
},
//todo
formValidation(str){
if(Verify.isEmpty(str)){
this.$toast('设备安装码不能为空')
return false
}
return true
} }
} }
} }

Loading…
Cancel
Save