1 Star 0 Fork 139

棒打耗子 / 云喵圈子-uniapp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
App.vue 2.31 KB
一键复制 编辑 原始数据 按行查看 历史
喵大人 提交于 2021-04-19 18:51 . update
<script>
export default {
onLaunch: function() {
const updateManager = uni.getUpdateManager();
updateManager.onCheckForUpdate(function(res) {
// 请求完新版本信息的回调
});
updateManager.onUpdateReady(function(res) {
uni.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success(res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate();
}
}
});
});
updateManager.onUpdateFailed(function(res) {
// 新的版本下载失败
});
},
onShow: function() {
//#ifdef MP-WEIXIN
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
//#endif
// 获取消息
if (uni.getStorageSync("token")) {
this.$H.post("message/num").then(res => {
let num = res.result;
let numCount = num.all_count;
this.$store.state.messegeNum = numCount;
if (numCount > 0) {
uni.setTabBarBadge({
index: 3,
text: numCount.toString()
})
} else {
uni.removeTabBarBadge({
index: 3
})
}
})
}
},
onHide: function() {
// console.log('App Hide');
}
};
</script>
<style lang="scss">
@import "uview-ui/index.scss";
@import "static/css/iconfont.css";
page {
font-size: 32rpx;
line-height: 1.7;
}
.container {
padding: 20rpx;
}
// 发布按钮
.plus-box {
background-color: $themes-color;
width: 110rpx;
height: 110rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 160rpx;
right: 50rpx;
z-index: 999;
box-shadow: 0 0 10rpx #333;
}
.plus-box:active {
background-color: #cdcdfe;
}
.f-wrap {
padding: 20rpx;
border-radius: 10rpx;
box-shadow: 5rpx 5rpx 20rpx #e6e6e6;
background-color: #FFFFFF;
margin-bottom: 20rpx;
}
.f-wrap>.title {
font-weight: bold;
margin-bottom: 20rpx;
}
.f-fixed {
position: fixed;
left: 0;
right: 0;
bottom: 0;
padding: 20rpx 20rpx 50rpx 20rpx;
z-index: 999;
background-color: #fff;
}
/* 隐藏滚动条 */
::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
}
</style>
JavaScript
1
https://gitee.com/guogu/cloud-meow-uni.git
git@gitee.com:guogu/cloud-meow-uni.git
guogu
cloud-meow-uni
云喵圈子-uniapp
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891