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