You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
332 lines
7.7 KiB
332 lines
7.7 KiB
<template>
|
|
<view class="wrapper">
|
|
<view class="nav_area">
|
|
<view @click="goback()"><image src="../../static/pay/left.png" mode="" style="width: 50rpx;height: 50rpx;"></image></view>
|
|
<view @click="gettips()"><image src="../../static/pay/help.png" mode="" style="width: 40rpx;height: 40rpx;"></image></view>
|
|
</view>
|
|
<view class="icon_area">
|
|
<image src="../../static/pay/success.png" mode="" class="success_icon"></image>
|
|
<view class="success_txt">实名登记完成</view>
|
|
<view class="sucess_tips">11月1日至30日免费使用,过期后需正常续费后方能使用</view>
|
|
</view>
|
|
<view class="content_area">
|
|
<view class="">
|
|
<view class="title">请根据指引下载安装</view>
|
|
<view class="subtitle">请根据指引步骤进行国家文化专网网络入网应用安装</view>
|
|
</view>
|
|
<view class="">
|
|
<view class="s_title">1.应用下载</view>
|
|
<view class="down_area">
|
|
<view class="down_item" @click="zwdz()">
|
|
<view class="left_icon"></view>
|
|
<view class="down_link">国家文化专网网络应用入口(请下载)</view>
|
|
<view class="right_icon"></view>
|
|
</view>
|
|
<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" style="user-select: all;" @click="docopy('fc00dd5d63caabd8')">
|
|
<view class="left_icon"></view>
|
|
<view class="down_link">网络ID(请复制)</view>
|
|
<view class="right_icopy" ></view>
|
|
</view>
|
|
|
|
|
|
</view>
|
|
<view class="s_title">2.输入设备安装码</view>
|
|
<view class="">
|
|
<input type="text" v-model="devsn" placeholder="请输入" placeholder-style="color: #B7B7B7;" class="input_box">
|
|
</view>
|
|
<view class="s_title">3.交易中心账号绑定</view>
|
|
<view class="">
|
|
<input type="text" v-model="account" placeholder="默认为注册手机号" maxlength="11" placeholder-style="color: #B7B7B7;" class="input_box">
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="footer_area">
|
|
<button class="btn" @click="submit()">提交</button>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
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 {
|
|
devsn: '',
|
|
account: '',
|
|
// dev refer
|
|
devpath:"",
|
|
//用户信息
|
|
userInfo:[]
|
|
}
|
|
},
|
|
onLoad(opt) {
|
|
this.devpath = opt.dev
|
|
},
|
|
mounted() {
|
|
// this.getUserInfo()
|
|
// this.mkdevsn()
|
|
this.init()
|
|
},
|
|
methods: {
|
|
// 返回
|
|
goback(){
|
|
uni.navigateBack(-1)
|
|
},
|
|
// 使用协议
|
|
gettips(){
|
|
this.$navTo("pages/dev/help")
|
|
},
|
|
// 长按复制
|
|
docopy(str){
|
|
uni.setClipboardData({
|
|
data:str,
|
|
success() {
|
|
uni.showToast({
|
|
title:"复制成功"
|
|
})
|
|
|
|
}
|
|
})
|
|
},
|
|
docopyBAk(str){
|
|
//支持复制的浏览器
|
|
if(navigator.clipboard){
|
|
navigator.clipboard.writeText(str).then(() => {
|
|
this.$toast("复制成功")
|
|
})
|
|
}else{
|
|
const textArea = document.createElement('textArea')
|
|
textArea.value = str
|
|
textArea.style.width = 0
|
|
textArea.style.position = 'fixed'
|
|
textArea.style.left = '-999px'
|
|
textArea.style.top = '10px'
|
|
textArea.setAttribute('readonly', 'readonly')
|
|
document.body.appendChild(textArea)
|
|
|
|
textArea.select()
|
|
document.execCommand('copy')
|
|
document.body.removeChild(textArea)
|
|
this.$toast("复制成功")
|
|
}
|
|
|
|
//this.$toast(str)
|
|
//alert("changancopy")
|
|
},
|
|
// 生成安装码
|
|
mkdevsn(){
|
|
const dev = this.devpath
|
|
const td = dev.charAt(2)
|
|
// console.log(td)
|
|
const tdd = dev.substring(2,-1).toUpperCase()+Date.now()
|
|
this.installationCode = tdd
|
|
|
|
// this.account = this.userInfo.mobile
|
|
},
|
|
|
|
init(){
|
|
if(checkLogin()==true){
|
|
this.isLogin = true
|
|
//console.log(this.userInfo)
|
|
this.getUserInfo()
|
|
}else{
|
|
this.isLogin= false
|
|
//this.$navTo("pages/login/index")
|
|
showError("请登录后再操作",this.gotologin())
|
|
}
|
|
},
|
|
// 专网地址
|
|
zwdz(){
|
|
let zwurl="https://pelerin.cn/CCDE.apk"
|
|
// 弹窗告诉用户去登录
|
|
uni.showModal({
|
|
title: '提示',
|
|
content: '即将打开链接:'+zwurl,
|
|
success: res => {
|
|
if(res.confirm){
|
|
this.$navTo("pages/webview/webview?url="+zwurl)
|
|
}
|
|
|
|
}
|
|
})
|
|
//window.location.href=zwurl
|
|
},
|
|
|
|
// 跳转到登录页
|
|
handleLogin() {
|
|
!this.isLogin && this.$navTo('pages/login/index')
|
|
},
|
|
|
|
// 获取当前用户信息
|
|
getUserInfo() {
|
|
const app = this
|
|
return new Promise((resolve, reject) => {
|
|
!app.isLogin ? resolve(null) : UserApi.info({}, { load: app.isFirstload })
|
|
.then(result => {
|
|
// console.log(result)
|
|
app.userInfo = result.data.userInfo
|
|
// app.account = result.data.userInfo.mobile
|
|
resolve(app.userInfo)
|
|
})
|
|
.catch(err => {
|
|
if (err.result && err.result.status == 401) {
|
|
app.isLogin = false
|
|
resolve(null)
|
|
} else {
|
|
reject(err)
|
|
}
|
|
})
|
|
})
|
|
},
|
|
|
|
//下载
|
|
downapp(){
|
|
let durl ="https://pelerin.cn/planet"; //
|
|
// 弹窗告诉用户
|
|
uni.showModal({
|
|
title: '提示',
|
|
content: '即将打开链接:'+durl,
|
|
success: res => {
|
|
if (res.confirm) {
|
|
this.$navTo("pages/webview/webview?url="+durl)
|
|
}
|
|
}
|
|
})
|
|
|
|
},
|
|
//提交成功
|
|
submit(){
|
|
const app = this
|
|
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
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.wrapper{
|
|
color: #101010;
|
|
padding-bottom: 160rpx;
|
|
}
|
|
.nav_area{
|
|
height: 94rpx;
|
|
padding: 0px 50rpx;
|
|
padding-top: var(--status-bar-height);
|
|
margin-bottom: 24rpx;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
.icon_area{
|
|
text-align: center;
|
|
}
|
|
.success_icon{
|
|
width: 220rpx;
|
|
height: 220rpx;
|
|
}
|
|
.success_txt{
|
|
font-size: 20px;
|
|
margin: 20px 0px 35px;
|
|
}
|
|
.content_area{
|
|
padding: 0px 50rpx;
|
|
}
|
|
.title{
|
|
font-size: 26px;
|
|
font-weight: bold;
|
|
line-height: 50px;
|
|
}
|
|
.subtitle{
|
|
color: #999;
|
|
font-size: 13px;
|
|
margin-bottom: 26px;
|
|
}
|
|
.s_title{
|
|
font-size: 16px;
|
|
margin-bottom: 10px;
|
|
}
|
|
.down_area{
|
|
margin-bottom: 10px;
|
|
}
|
|
.down_item{
|
|
height: 70rpx;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
.left_icon{
|
|
width: 40rpx;
|
|
height: 40rpx;
|
|
background-image: url("../../static/pay/install.png");
|
|
background-size: cover;
|
|
}
|
|
.down_link{
|
|
font-size: 12px;
|
|
flex: 1;
|
|
margin: 0px 40rpx;
|
|
}
|
|
.right_icon{
|
|
width: 40rpx;
|
|
height: 40rpx;
|
|
background-image: url("../../static/pay/download.png");
|
|
background-size: cover;
|
|
}
|
|
.right_icopy{
|
|
width: 40rpx;
|
|
height: 40rpx;
|
|
background-image: url("../../static/pay/icopy.svg");
|
|
background-size: cover;
|
|
}
|
|
.input_box{
|
|
width: 640rpx;
|
|
height: 90rpx;
|
|
padding: 0px 40rpx;
|
|
box-sizing: border-box;
|
|
background-color: #f8f8f8;
|
|
font-size: 14px;
|
|
margin-bottom: 26px;
|
|
}
|
|
.footer_area{
|
|
width: 100vw;
|
|
height: 100rpx;
|
|
/* position: fixed; */
|
|
bottom: 60rpx;
|
|
left: 0px;
|
|
}
|
|
.footer_area .btn{
|
|
width: 100%;
|
|
height: 100%;
|
|
font-size: 16px;
|
|
color: #fff;
|
|
background-color: #10476E;
|
|
border-radius: 0px;
|
|
line-height: 100rpx;
|
|
}
|
|
</style>
|
|
|