gy-app-shop/App.vue

80 lines
1.6 KiB
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<style lang="scss">
/* 注意要写在第一行同时给style标签加入lang="scss"属性 */
// NVUE不加载
/* #ifndef APP-PLUS-NVUE */
@import "uview-ui/index.scss";
/* #endif */
</style>
<script>
export default {
onLaunch: function() {
console.log('App Launch');
// #ifdef MP-WEIXIN
const updateManager = uni.getUpdateManager();
updateManager.onCheckForUpdate(function (res) {
// 请求完新版本信息的回调
console.log(res.hasUpdate);
});
updateManager.onUpdateReady(function (res) {
uni.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success(res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate();
}
}
});
});
updateManager.onUpdateFailed(function (res) {
// 新的版本下载失败
});
// #endif
},
onShow: function() {
console.log('App Show');
},
onHide: function() {
console.log('App Hide');
}
};
</script>
<style>
@import url("static/fonts/iconfont.css");
page>view {
/* background: linear-gradient(to bottom,#CEDCFF,#F0F0F0 554rpx); */
min-height: 100%;
}
</style>
<style lang="scss">
.dict-item{
&.info{
color: #909399 !important;
}
&.primary{
color: #409eff !important;
}
&.success{
color: #67c23a !important;
}
&.danger{
color: #f56c6c !important;
}
&.warning{
color: #e6a23c !important;
}
&.default{
color: #409eff !important;
}
}
</style>