123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <script>
- import Vue from 'vue';
- // 解析地址栏参数
- function getQueryVariable(variable) {
- // 从?开始获取后面的所有数据
- var query = window.location.search.substring(1);
- // 从字符串&开始分隔成数组split
- var vars = query.split('&');
- // 遍历该数组
- for (var i = 0; i < vars.length; i++) {
- // 从等号部分分割成字符
- var pair = vars[i].split('=');
- // 如果第一个元素等于 传进来的参的话 就输出第二个元素
- if (pair[0] == variable) {
- return pair[1];
- }
- }
- return undefined;
- }
- export default {
- onLaunch: function() {
- uni.getSystemInfo({
- success: function(e) {
- console.log(e);
- Vue.prototype.StatusBar = e.statusBarHeight;
- // #ifdef MP-WEIXIN
- let custom = wx.getMenuButtonBoundingClientRect();
- Vue.prototype.Custom = custom;
- Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight + 4;
- // #endif
- // #ifndef MP-WEIXIN
- Vue.prototype.CustomBar = 48
- // #endif
- //用来判断是否iphoneX类型的全面屏设备
- if (e.model.indexOf('iPhone X') == 0) {
- Vue.prototype.isIphoneX = 68;
- } else {
- Vue.prototype.isIphoneX = 0;
- }
- },
- });
- },
- onShow: function() {
- // console.log('App Show')
- },
- onHide: function() {
- // console.log('App Hide')
- }
- }
- </script>
- <style lang="scss">
- /*每个页面公共css */
- @import "uview-ui/index.scss";
- @import "styles/iconfont.css";
- </style>
|