123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <script>
- import checkVersion from '@/pages/lq-upgrade/checkVersion.js'
- export default {
- onLaunch: function() {
- console.log('App Launch')
- this.upgrade()
- },
- onShow: function() {
- console.log('App Show')
- },
- onHide: function() {
- console.log('App Hide')
- },
- methods: {
- upgrade(){
- let res=uni.$u.http.post('admin/api.login/appupdata').then(res => {
- //模拟接口请求
- // console.log(res)
- setTimeout(()=>{
- let name=res.version
- let code=res.code
- let content=res.content
- let url=res.url
- let forceUpdate=false;//是否强制更新
- checkVersion({
- name,//最新版本名称
- code,//最新版本号
- content,//更新内容
- url,//下载链接
- forceUpdate//是否强制升级
- })
- },1000)
- })
-
-
- }
- }
- }
- </script>
- <style lang="scss">
- @import "uni_modules/uview-ui/index.scss";
- /*每个页面公共css */
- // @import "./static/css/iconfont.css";
- </style>
|