|
|
|
@ -19,12 +19,12 @@ |
|
|
|
<view class="down_item"> |
|
|
|
<view class="left_icon"></view> |
|
|
|
<view class="down_link">国家文化专网网络应用入口</view> |
|
|
|
<view class="right_icon" @click="download(1)"></view> |
|
|
|
<view class="right_icon" @click="zwdz()"></view> |
|
|
|
</view> |
|
|
|
<view class="down_item"> |
|
|
|
<view class="left_icon"></view> |
|
|
|
<view class="down_link">手机绑定关联程序</view> |
|
|
|
<view class="right_icon" @click="download(2)"></view> |
|
|
|
<view class="right_icon" @click="downapp()"></view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="s_title">2.输入设备安装码</view> |
|
|
|
@ -44,19 +44,108 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import store from '@/store' |
|
|
|
// 校验登录 |
|
|
|
import { checkLogin, showError } from '@/core/app' |
|
|
|
import * as UserApi from '@/api/user' |
|
|
|
|
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
installationCode: '', |
|
|
|
account: '', |
|
|
|
// dev refer |
|
|
|
devpath:"", |
|
|
|
//用户信息 |
|
|
|
userInfo:[] |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(opt) { |
|
|
|
this.devpath = opt.dev |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
// this.getUserInfo() |
|
|
|
this.mkdevsn() |
|
|
|
this.init() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
download(type){ |
|
|
|
// 生成安装码 |
|
|
|
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(){ |
|
|
|
const zwurl="http://10.24.4.14" |
|
|
|
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(){ |
|
|
|
const durl =""; |
|
|
|
//判断当前设备,切换到相应位置 |
|
|
|
var u = navigator.userAgent; |
|
|
|
if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) {//安卓手机 |
|
|
|
//alert('这是安卓手机') |
|
|
|
durl="" |
|
|
|
} else if (u.indexOf('iPhone') > -1) {//苹果手机 |
|
|
|
durl="https://bf-analyze.oss-cn-shenzhen.aliyuncs.com/test/planet" |
|
|
|
//alert('这是iPhone') |
|
|
|
} else if (u.indexOf('Windows Phone') > -1) {//winphone手机 |
|
|
|
//alert('这是 windows Phone') |
|
|
|
} |
|
|
|
// |
|
|
|
window.location.href=durl |
|
|
|
|
|
|
|
}, |
|
|
|
//提交成功 |
|
|
|
submit(){ |
|
|
|
|
|
|
|
const app = this |
|
|
|
app.$navTo("pages/book/index") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|