reactor:osName 的获取,从 getSystemInfoSync 迁移到 getDeviceInfo
reactor:pixelRatio/windowHeight/windowWidth 的获取,从 getSystemInfoSync 迁移到 getWindowInfopull/147/head
parent
04bb5e65d3
commit
82aada5ecd
|
@ -72,7 +72,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { deepMerge, addStyle, addUnit, sleep, getPx, sys } from '@/sheep/helper';
|
||||
import { deepMerge, addStyle, addUnit, sleep, getPx } from '@/sheep/helper';
|
||||
// #ifdef APP-NVUE
|
||||
const animation = uni.requireNativePlugin('animation');
|
||||
const dom = uni.requireNativePlugin('dom');
|
||||
|
@ -221,7 +221,8 @@
|
|||
methods: {
|
||||
$uGetRect(selector, all) {
|
||||
return new Promise((resolve) => {
|
||||
uni.createSelectorQuery()
|
||||
uni
|
||||
.createSelectorQuery()
|
||||
.in(this)
|
||||
[all ? 'selectAll' : 'select'](selector)
|
||||
.boundingClientRect((rect) => {
|
||||
|
@ -301,7 +302,7 @@
|
|||
return total + curr.rect.width;
|
||||
}, 0);
|
||||
// 此处为屏幕宽度
|
||||
const windowWidth = sys().windowWidth;
|
||||
const windowWidth = uni.getWindowInfo().windowWidth;
|
||||
// 将活动的tabs-item移动到屏幕正中间,实际上是对scroll-view的移动
|
||||
let scrollLeft =
|
||||
offsetLeft -
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
}
|
||||
},
|
||||
dpr() {
|
||||
return this.pixelRatio || uni.getSystemInfoSync().pixelRatio;
|
||||
return this.pixelRatio || uni.getWindowInfo().pixelRatio;
|
||||
},
|
||||
boardWidth() {
|
||||
const {width = 0} = (this.elements && this.elements.css) || this.elements || this
|
||||
|
|
|
@ -6,16 +6,13 @@ import {
|
|||
networkReg
|
||||
} from './utils';
|
||||
const dom = weex.requireModule('dom')
|
||||
import {
|
||||
version
|
||||
} from '../../package.json'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tempFilePath: [],
|
||||
isInitFile: false,
|
||||
osName: uni.getSystemInfoSync().osName
|
||||
osName: uni.getDeviceInfo().osName
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -3,7 +3,8 @@ export const isBase64 = (path) => /^data:image\/(\w+);base64/.test(path);
|
|||
export function sleep(delay) {
|
||||
return new Promise(resolve => setTimeout(resolve, delay))
|
||||
}
|
||||
let {platform, SDKVersion} = uni.getSystemInfoSync()
|
||||
let platform = uni.getDeviceInfo().platform
|
||||
let SDKVersion = uni.getSystemInfoSync().SDKVersion
|
||||
export const isPC = /windows|mac/.test(platform)
|
||||
// 缓存图片
|
||||
let cache = {}
|
||||
|
@ -316,7 +317,7 @@ export function getImageInfo(path, useCORS) {
|
|||
// #ifdef APP-PLUS
|
||||
// console.log('getImageInfo', +new Date() - time)
|
||||
// ios 比较严格 可能需要设置跨域
|
||||
if(uni.getSystemInfoSync().osName == 'ios' && useCORS) {
|
||||
if(uni.getDeviceInfo().osName === 'ios' && useCORS) {
|
||||
pathToBase64(image.path).then(base64 => {
|
||||
image.path = base64
|
||||
cache[path] = image
|
||||
|
|
|
@ -432,7 +432,7 @@
|
|||
|
||||
mounted() {
|
||||
// #ifdef APP-NVUE
|
||||
const res = uni.getSystemInfoSync();
|
||||
const res = uni.getWindowInfo();
|
||||
this.fixNvueBug = {
|
||||
top: res.windowHeight / 2,
|
||||
left: res.windowWidth / 2
|
||||
|
|
|
@ -473,7 +473,7 @@
|
|||
right.setDate(this.$refs.right.nowDate.fullDate)
|
||||
},
|
||||
platform() {
|
||||
const systemInfo = uni.getSystemInfoSync()
|
||||
const systemInfo = uni.getWindowInfo()
|
||||
this.isPhone = systemInfo.windowWidth <= 500
|
||||
this.windowWidth = systemInfo.windowWidth
|
||||
},
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
}
|
||||
},
|
||||
mounted() {
|
||||
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px'
|
||||
this.statusBarHeight = uni.getWindowInfo().statusBarHeight + 'px'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -187,7 +187,7 @@
|
|||
// #endif
|
||||
// #ifdef APP-NVUE
|
||||
dom.getComponentRect(this.$refs['animationEle'], (res) => {
|
||||
let winWidth = uni.getSystemInfoSync().windowWidth
|
||||
let winWidth = uni.getWindowInfo().windowWidth
|
||||
this.textWidth = res.size.width
|
||||
animation.transition(this.$refs['animationEle'], {
|
||||
styles: {
|
||||
|
|
Loading…
Reference in New Issue