reactor:getSystemInfoSync =》 getWindowInfo,解决 device
parent
9582d5944e
commit
c95f621144
|
@ -11,9 +11,6 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import sheep from '@/sheep';
|
||||
const { safeAreaInsets } = sheep.$platform.device;
|
||||
|
||||
const props = defineProps({
|
||||
content: {
|
||||
type: String,
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
import { onPageScroll } from '@dcloudio/uni-app';
|
||||
import sheep from '@/sheep';
|
||||
import throttle from '@/sheep/helper/throttle.js';
|
||||
import { showMenuTools, closeMenuTools } from '@/sheep/hooks/useModal';
|
||||
import { showMenuTools } from '@/sheep/hooks/useModal';
|
||||
|
||||
const sys_statusBar = sheep.$platform.device.statusBarHeight;
|
||||
const sys_navBar = sheep.$platform.navbar;
|
||||
|
@ -98,7 +98,8 @@
|
|||
|
||||
function getCommentCardNode() {
|
||||
return new Promise((res, rej) => {
|
||||
uni.createSelectorQuery()
|
||||
uni
|
||||
.createSelectorQuery()
|
||||
.select('.detail-comment-selector')
|
||||
.boundingClientRect((data) => {
|
||||
if (data) {
|
||||
|
|
|
@ -47,13 +47,6 @@ export function sleep(value = 30) {
|
|||
export function os() {
|
||||
return uni.getDeviceInfo().platform.toLowerCase();
|
||||
}
|
||||
/**
|
||||
* @description 获取系统信息同步接口
|
||||
* @link 获取系统信息同步接口 https://uniapp.dcloud.io/api/system/info?id=getsysteminfosync
|
||||
*/
|
||||
export function sys() {
|
||||
return uni.getSystemInfoSync();
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 取一个区间数
|
||||
|
@ -679,7 +672,6 @@ export default {
|
|||
getPx,
|
||||
sleep,
|
||||
os,
|
||||
sys,
|
||||
random,
|
||||
guid,
|
||||
$parent,
|
||||
|
|
|
@ -18,7 +18,7 @@ import apple from './provider/apple';
|
|||
import share from './share';
|
||||
import Pay from './pay';
|
||||
|
||||
const device = uni.getSystemInfoSync();
|
||||
const device = uni.getWindowInfo();
|
||||
|
||||
const os = uni.getDeviceInfo().platform;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { deepMerge, addStyle, addUnit, sleep, guid, getPx, os, sys } from '@/sheep/helper';
|
||||
import { deepMerge, addStyle, addUnit, guid, getPx, os } from '@/sheep/helper';
|
||||
import sheep from '@/sheep';
|
||||
/**
|
||||
* sticky 吸顶
|
||||
|
@ -130,7 +130,8 @@
|
|||
},
|
||||
$uGetRect(selector, all) {
|
||||
return new Promise((resolve) => {
|
||||
uni.createSelectorQuery()
|
||||
uni
|
||||
.createSelectorQuery()
|
||||
.in(this)
|
||||
[all ? 'selectAll' : 'select'](selector)
|
||||
.boundingClientRect((rect) => {
|
||||
|
@ -194,7 +195,7 @@
|
|||
// #endif
|
||||
|
||||
// 如果安卓版本高于8.0,依然认为是支持css sticky的(因为安卓7在某些机型,可能不支持sticky)
|
||||
if (os() === 'android' && Number(sys().system) > 8) {
|
||||
if (os() === 'android' && Number(uni.getDeviceInfo().system) > 8) {
|
||||
this.cssSticky = true;
|
||||
}
|
||||
|
||||
|
@ -218,7 +219,8 @@
|
|||
// 方法内进行判断,避免在其他平台生成无用代码
|
||||
// #ifdef APP-VUE || MP-WEIXIN
|
||||
return new Promise((resolve) => {
|
||||
uni.createSelectorQuery()
|
||||
uni
|
||||
.createSelectorQuery()
|
||||
.in(this)
|
||||
.select('.u-sticky')
|
||||
.fields({
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 富文本 -->
|
||||
<!-- #ifdef H5 || ((MP-WEIXIN || MP-QQ || APP-PLUS || MP-360) && VUE2) -->
|
||||
<rich-text v-else-if="!n.c&&!handler.isInline(n.name, n.attrs.style)" :id="n.attrs.id" :style="n.f" :user-select="opts[4]" :nodes="[n]" />
|
||||
|
@ -125,7 +125,7 @@ export default {
|
|||
return {
|
||||
ctrl: {},
|
||||
// #ifdef MP-WEIXIN
|
||||
isiOS: uni.getSystemInfoSync().system.includes('iOS')
|
||||
isiOS: uni.getDeviceInfo().system.includes('iOS')
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
|
|
|
@ -77,11 +77,13 @@ const config = {
|
|||
}
|
||||
const tagSelector={}
|
||||
const {
|
||||
windowWidth,
|
||||
// #ifdef MP-WEIXIN
|
||||
system
|
||||
// #endif
|
||||
} = uni.getSystemInfoSync()
|
||||
} = uni.getDeviceInfo()
|
||||
const {
|
||||
windowWidth
|
||||
} = uni.getWindowInfo()
|
||||
const blankChar = makeMap(' ,\r,\n,\t,\f')
|
||||
let idIndex = 0
|
||||
|
||||
|
|
Loading…
Reference in New Issue