1 Star 9 Fork 4

lixinjava/uni-tv

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
App.vue 1.37 KB
一键复制 编辑 原始数据 按行查看 历史
lixinjava 提交于 2021-11-08 03:46 . 小更新
<script>
import {
mapMutations,
mapState
} from 'vuex';
import {
launch
} from '@/api/app.js';
export default {
onLaunch: function() {
console.log('App Launch')
let _self = this
// #ifdef APP-PLUS
var RTModule = uni.requireNativePlugin("RTModule")
try {
RTModule.getSmartCard(function(e) {
let uuid = null
if (!e.smartcard || e.smartcard == "null") {
// 没获取到卡号
let info = uni.getSystemInfoSync();
uuid = info.deviceId
} else {
uuid = e.smartcard
uni.showModal({
title: "卡号",
content: e.smartcard
})
}
_self.setSmartCard(uuid)
if (uni.getStorageSync("uuid") != uuid) {
uni.setStorageSync("uuid", uuid)
launch({
first: true
})
} else {
launch()
}
})
} catch(e) {
console.log("错误", e)
}
// #endif
setInterval(function() {
_self.ping()
}, 1000 * 10)
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
this.close()
},
methods: {
...mapMutations(['setSmartCard']),
}
}
</script>
<style>
body {
background-color: #070707;
background-image: linear-gradient(0deg, #222222 0%, #010101 51%, #070707 75%);
color: white;
}
/* .page{
width: 750rpx
background-color: #070707;
position: absolute;
} */
</style>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/lixinjava/uni-tv.git
[email protected]:lixinjava/uni-tv.git
lixinjava
uni-tv
uni-tv
master

搜索帮助