123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- <script>
- import $http from '@/utils/request.js'
- import { urlParameter } from '@/utils/util.js'
- export default {
- globalData: {
- userInfo: {},
- },
- onLaunch: function(options) {
- uni.hideTabBar()
- if (options.query && options.query.qrCode) {
- const { qrCode } = options.query
- let parameter = urlParameter(qrCode)
- uni.setStorageSync('code', parameter.id)
- }
- },
- onShow: function(options) {
- uni.hideTabBar()
- if (options.query && options.query.qrCode) {
- const { qrCode } = options.query
- let parameter = urlParameter(qrCode)
- uni.setStorageSync('code', parameter.id)
- }
- this.updateManager()
- // this.anotherApplet() //打包盲票小程序时候解开
- },
- methods: {
- updateManager() {
- const updateManager = uni.getUpdateManager();
- if (updateManager) {
- updateManager.onCheckForUpdate(res => {
- // 请求完新版本信息的回调
- })
- updateManager.onUpdateReady(() => {
- uni.showModal({
- title: '更新提示',
- content: '新版本已经准备好,即将重启应用',
- showCancel: false,
- success(res) {
- if (res.confirm) {
- // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
- updateManager.applyUpdate()
- }
- }
- })
- })
- updateManager.onUpdateFailed(() => {
- // 新的版本下载失败
- uni.showModal({
- title: '更新提示',
- content: '新版本下载失败',
- showCancel: false
- })
- })
- }
- },
- anotherApplet() {
- $http.post('/api/v1/mp/user/isJump', {}).then(res => {
- if(res.data) {
- uni.setStorageSync('anotherApplet',true)
- uni.switchTab({
- url:'/pages/index/index'
- })
- }else {
- uni.removeStorageSync('anotherApplet')
- }
- })
- },
- }
- }
- </script>
- <style lang="scss">
- /* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
- @import "uview-ui/index.scss";
- // 设置整个项目的背景色
- page {
- background-color: #F9F7F5;
- font-size: 14px;
- color: #333;
- }
- view {
- box-sizing: border-box;
- word-break: break-all;
- }
- .container {
- background-color: #fff;
- font-size: 14px;
- color: #333;
- padding: 10px;
- }
- .flex {
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .ells {
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- }
- ::v-deep .u-tabs__wrapper__nav__line {
- border-radius: 0!important;
- bottom: 0px!important;
- }
- .ells-one {
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 1;
- }
- @font-face {
- font-family: 'YouSheBiaoTiHei';
- src: url('https://mp-public-1310078123.cos.ap-shanghai.myqcloud.com/YouSheBiaoTiHei.ttf');
- }
- // 只有在app.vue里面定义的keyframes才能在style里面使用
- @keyframes moveLeft {
- 0% {
- -webkit-transform: translate3d(0, 0, 0);
- transform: translate3d(0, 0, 0);
- }
- 100% {
- -webkit-transform: translate3d(-100%, 0, 0);
- transform: translate3d(-100%, 0, 0);
- }
- }
- </style>
|