Files
Smart-Farm/uniapp/uni-app/App.vue
2025-12-22 17:13:05 +08:00

103 lines
1.8 KiB
Vue

<script>
import $store from "@/store/index.js"
// #ifdef APP-PLUS
import skJGPush from "@/utils/jpush.js"
// #endif
export default {
onLaunch() {
let arr = ['autograph', 'userInfo', 'appLogin', 'loginType', 'push_id']
arr.map(key => {
let val = uni.getStorageSync(key) || ''
if (val) {
$store.commit('updateUserItem', {
key,
val
})
}
})
// #ifdef APP-PLUS
// 极光推送-init
// skJGPush.initJPushService()
// 极光推送-打开debug
// skJGPush.openDebug()
// 极光推送-获取rid
// skJGPush.getRegistrationID(result => {
// console.log('【业务getRegistrationID】', result)
// $store.commit('updateUserItem', {
// key: 'push_id',
// val: result
// })
// })
// #endif
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
}
</script>
<style lang="scss">
@import "./styles/index.scss";
page {
font-size: 28rpx;
color: #222;
line-height: 1.5;
background: #F6F6F6;
font-family: -apple-system-font, Helvetica Neue, Helvetica, sans-serif;
}
input {
// font-family: PingFangSC-Medium, PingFang SC, -apple-system-font, Helvetica Neue, Helvetica, sans-serif;
}
input::-webkit-input-placeholder {
/* WebKit browsers */
color: #A9A9A9;
}
input:-moz-placeholder {
/* Mozilla Firefox 4 to 18 */
color: #A9A9A9;
}
input::-moz-placeholder {
/* Mozilla Firefox 19+ */
color: #A9A9A9;
}
input:-ms-input-placeholder {
/* Internet Explorer 10+ */
color: #A9A9A9;
}
view {
box-sizing: border-box;
}
image {
display: block;
}
/*隐藏滚动条*/
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
/* #ifdef MP-BAIDU */
.swan-button.swan-button-radius-ios {
border-radius: 0;
}
/* #endif */
</style>