reactor:getSystemInfoSync =》 getWindowInfo,解决 device

pull/147/head
YunaiV 2025-04-29 20:38:50 +08:00
parent 9582d5944e
commit c95f621144
7 changed files with 16 additions and 22 deletions

View File

@ -11,9 +11,6 @@
</template>
<script setup>
import sheep from '@/sheep';
const { safeAreaInsets } = sheep.$platform.device;
const props = defineProps({
content: {
type: String,

View File

@ -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) {

View File

@ -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,

View File

@ -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;

View File

@ -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.0css sticky(7sticky)
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({

View File

@ -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
}
},

View File

@ -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