diff --git a/src/uni_modules/uview-plus/components/up-loading-icon/up-loading-icon.uvue b/src/uni_modules/uview-plus/components/up-loading-icon/up-loading-icon.uvue index 72eae6fc0..ef115f355 100644 --- a/src/uni_modules/uview-plus/components/up-loading-icon/up-loading-icon.uvue +++ b/src/uni_modules/uview-plus/components/up-loading-icon/up-loading-icon.uvue @@ -84,7 +84,8 @@ {left: 0, top: 0},{left: 0, top: 0},{left: 0, top: 0},{left: 0, top: 0}, {left: 0, top: 0},{left: 0, top: 0},{left: 0, top: 0},{left: 0, top: 0}, {left: 0, top: 0},{left: 0, top: 0},{left: 0, top: 0},{left: 0, top: 0} - ] as UTSJSONObject[] + ] as UTSJSONObject[], + animationFrame: 0 } }, computed: { @@ -109,7 +110,7 @@ this.init() }, beforeMount() { - cancelAnimationFrame(this.rotateLoader) + cancelAnimationFrame(this.animationFrame) }, methods: { addStyle(val: any): any { @@ -118,16 +119,16 @@ addUnit(val: any): string { return addUnit(val) }, - rotateLoader() { + rotateLoader(): void { this.degree = (this.degree + 3) % 360; // 每次增加3度,循环回到0度 this.transform = `rotate(${this.degree.toString()}deg)`; - requestAnimationFrame(this.rotateLoader); // 递归调用以保持动画 + this.animationFrame = requestAnimationFrame(this.rotateLoader); // 递归调用以保持动画 }, - init() { + init(): void { this.calcSpinnerTopAndLeft() this.rotateLoader() }, - calculateSquareRadius(sideLength: number) { + calculateSquareRadius(sideLength: number): number { // 计算正方形的对角线长度 const diagonalLength = Math.sqrt(sideLength * sideLength + sideLength * sideLength); // 对角线长度的一半即为等效圆的半径 @@ -192,7 +193,7 @@ $up-loading-icon-dot-before-height:25% !default; $up-loading-icon-dot-before-margin:0 auto !default; $up-loading-icon-dot-before-background-color:currentColor !default; - $up-loading-icon-dot-before-border-radius:40% !default; + $up-loading-icon-dot-before-border-radius:8px !default; .up-loading-icon { display: flex; @@ -246,10 +247,10 @@ } } - :host { - font-size: $up-loading-icon-host-font-size; - line-height: $up-loading-icon-host-line-height; - } + // :host { + // font-size: $up-loading-icon-host-font-size; + // line-height: $up-loading-icon-host-line-height; + // } .up-loading-icon { &__spinner--spinner { @@ -284,19 +285,19 @@ $radius: v-bind(size)px; @for $i from 1 through 12 { - .up-loading-icon__dot:nth-of-type(#{$i}) { - transform: rotate(($i + 2) * 30deg); - opacity: 1 - 0.0625 * ($i - 1); - } + // .up-loading-icon__dot:nth-of-type(#{$i}) { + // transform: rotate(($i + 2) * 30deg); + // opacity: 1 - 0.0625 * ($i - 1); + // } } - @keyframes up-rotate { - 0% { - transform: rotate(0deg) - } + // @keyframes up-rotate { + // 0% { + // transform: rotate(0deg) + // } - to { - transform: rotate(1turn) - } - } + // to { + // transform: rotate(1turn) + // } + // } diff --git a/src/uni_modules/uview-plus/components/up-loading-page/up-loading-page.uvue b/src/uni_modules/uview-plus/components/up-loading-page/up-loading-page.uvue index 6948184a8..798a8a389 100644 --- a/src/uni_modules/uview-plus/components/up-loading-page/up-loading-page.uvue +++ b/src/uni_modules/uview-plus/components/up-loading-page/up-loading-page.uvue @@ -10,7 +10,7 @@ backgroundColor: bgColor, display: 'flex', zIndex: zIndex, - ...customStyle + ...customStyleParse }" > @@ -77,8 +77,13 @@ export default { data() { return {}; }, + computed: { + customStyleParse(): UTSJSONObject { + return this.customStyle as UTSJSONObject + } + }, methods: { - addUnit(str: any) { + addUnit(str: any): string { return addUnit(str) } } diff --git a/src/uni_modules/uview-plus/components/up-navbar/navbar.uts b/src/uni_modules/uview-plus/components/up-navbar/navbar.uts new file mode 100644 index 000000000..f2f523a68 --- /dev/null +++ b/src/uni_modules/uview-plus/components/up-navbar/navbar.uts @@ -0,0 +1,32 @@ +/* + * @Author : LQ,jry + * @Description : + * @version : 4.0 + * @Date : 2021-08-20 16:44:21 + * @LastAuthor : jry + * @lastTime : 2024-08-28 14:20:58 + * @FilePath : /uview-plus/libs/config/props/navbar + */ +import color from '../../libs/config/color' + +export default { + // navbar 组件 + navbar: { + safeAreaInsetTop: true, + placeholder: false, + fixed: true, + border: false, + leftIcon: 'arrow-left', + leftText: '', + rightText: '', + rightIcon: '', + title: '', + bgColor: '#ffffff', + titleWidth: '400rpx', + height: '44px', + leftIconSize: 20, + leftIconColor: color['mainColor'], + autoBack: false, + titleStyle: {} + } +} as UTSJSONObject diff --git a/src/uni_modules/uview-plus/components/up-navbar/props.uts b/src/uni_modules/uview-plus/components/up-navbar/props.uts new file mode 100644 index 000000000..a6a8fabbf --- /dev/null +++ b/src/uni_modules/uview-plus/components/up-navbar/props.uts @@ -0,0 +1,88 @@ +import { defineMixin } from '../../libs/vue' +import defProps from './navbar' +let crtProp = defProps['navbar'] as UTSJSONObject + +export const propsNavbar = defineMixin({ + props: { + // 是否开启顶部安全区适配 + safeAreaInsetTop: { + type: Boolean, + default: crtProp['safeAreaInsetTop'] + }, + // 固定在顶部时,是否生成一个等高元素,以防止塌陷 + placeholder: { + type: Boolean, + default: crtProp['placeholder'] + }, + // 是否固定在顶部 + fixed: { + type: Boolean, + default: crtProp['fixed'] + }, + // 是否显示下边框 + border: { + type: Boolean, + default: crtProp['border'] + }, + // 左边的图标 + leftIcon: { + type: String, + default: crtProp['leftIcon'] + }, + // 左边的提示文字 + leftText: { + type: String, + default: crtProp['leftText'] + }, + // 左右的提示文字 + rightText: { + type: String, + default: crtProp['rightText'] + }, + // 右边的图标 + rightIcon: { + type: String, + default: crtProp['rightIcon'] + }, + // 标题 + title: { + type: [String, Number], + default: crtProp['title'] + }, + // 背景颜色 + bgColor: { + type: String, + default: crtProp['bgColor'] + }, + // 标题的宽度 + titleWidth: { + type: [String, Number], + default: crtProp['titleWidth'] + }, + // 导航栏高度 + height: { + type: [String, Number], + default: crtProp['height'] + }, + // 左侧返回图标的大小 + leftIconSize: { + type: [String, Number], + default: crtProp['leftIconSize'] + }, + // 左侧返回图标的颜色 + leftIconColor: { + type: String, + default: crtProp['leftIconColor'] + }, + // 点击左侧区域(返回图标),是否自动返回上一页 + autoBack: { + type: Boolean, + default: crtProp['autoBack'] + }, + // 标题的样式,对象或字符串 + titleStyle: { + type: [Object], + default: crtProp['titleStyle'] + } + } +}) diff --git a/src/uni_modules/uview-plus/components/up-navbar/up-navbar.uvue b/src/uni_modules/uview-plus/components/up-navbar/up-navbar.uvue new file mode 100644 index 000000000..e8971a3af --- /dev/null +++ b/src/uni_modules/uview-plus/components/up-navbar/up-navbar.uvue @@ -0,0 +1,205 @@ + + + + + diff --git a/src/uni_modules/uview-plus/components/up-status-bar/props.uts b/src/uni_modules/uview-plus/components/up-status-bar/props.uts new file mode 100644 index 000000000..119bfda59 --- /dev/null +++ b/src/uni_modules/uview-plus/components/up-status-bar/props.uts @@ -0,0 +1,12 @@ +import { defineMixin } from '../../libs/vue' +import defProps from './statusBar' +let crtProp = defProps['statusBar'] as UTSJSONObject + +export const propsStatusBar = defineMixin({ + props: { + bgColor: { + type: String, + default: crtProp['bgColor'] + } + } +}) diff --git a/src/uni_modules/uview-plus/components/up-status-bar/statusBar.uts b/src/uni_modules/uview-plus/components/up-status-bar/statusBar.uts new file mode 100644 index 000000000..1f99ba68e --- /dev/null +++ b/src/uni_modules/uview-plus/components/up-status-bar/statusBar.uts @@ -0,0 +1,15 @@ +/* + * @Author : jry + * @Description : + * @version : 4.0 + * @Date : 2021-08-20 16:44:21 + * @LastAuthor : jry + * @lastTime : 2024-08-28 21:58:38 + * @FilePath : /uview-plus/libs/config/props/statusBar + */ +export default { + // statusBar + statusBar: { + bgColor: 'transparent' + } +} as UTSJSONObject diff --git a/src/uni_modules/uview-plus/components/up-status-bar/up-status-bar.uvue b/src/uni_modules/uview-plus/components/up-status-bar/up-status-bar.uvue new file mode 100644 index 000000000..746533b1c --- /dev/null +++ b/src/uni_modules/uview-plus/components/up-status-bar/up-status-bar.uvue @@ -0,0 +1,47 @@ + + + + + diff --git a/src/uni_modules/uview-plus/libs/function/index.uts b/src/uni_modules/uview-plus/libs/function/index.uts index 25cf1d70a..7ce36b803 100644 --- a/src/uni_modules/uview-plus/libs/function/index.uts +++ b/src/uni_modules/uview-plus/libs/function/index.uts @@ -46,21 +46,21 @@ export function sleep(value = 30): any { }, value) }) } -// /** -// * @description 运行期判断平台 -// * @returns {string} 返回所在平台(小写) -// * @link 运行期判断平台 https://uniapp.dcloud.io/frame?id=判断平台 -// */ -// export function os(): string { -// return uni.getSystemInfoSync().platform.toLowerCase() -// } -// /** -// * @description 获取系统信息同步接口 -// * @link 获取系统信息同步接口 https://uniapp.dcloud.io/api/system/info?id=getsysteminfosync -// */ -// export function sys(): any { -// return uni.getSystemInfoSync() -// } +/** + * @description 运行期判断平台 + * @returns {string} 返回所在平台(小写) + * @link 运行期判断平台 https://uniapp.dcloud.io/frame?id=判断平台 + */ +export function os(): string { + return uni.getSystemInfoSync().osName +} +/** + * @description 获取系统信息同步接口 + * @link 获取系统信息同步接口 https://uniapp.dcloud.io/api/system/info?id=getsysteminfosync + */ +export function sys(): any { + return uni.getSystemInfoSync() +} // /** // * @description 取一个区间数 diff --git a/uni-app-x/pages/componentsA/loading-page/loading-page.uvue b/uni-app-x/pages/componentsA/loading-page/loading-page.uvue index 94169d49b..1c9b2beaa 100644 --- a/uni-app-x/pages/componentsA/loading-page/loading-page.uvue +++ b/uni-app-x/pages/componentsA/loading-page/loading-page.uvue @@ -15,7 +15,7 @@ @@ -91,30 +91,30 @@ } if (indexNum == 0) { //自定义提示内容 - this.loadingPageData.loadingMode = 'semicircle' - this.loadingPageData.loadingText = "Hello uView" - this.loadingPageData.color = '#C8C8C8' - this.loadingPageData.loadingColor = '#C8C8C8' + this.loadingPageData['loadingMode'] = 'semicircle' + this.loadingPageData['loadingText'] = "Hello uView" + this.loadingPageData['color'] = '#C8C8C8' + this.loadingPageData['loadingColor'] = '#C8C8C8' } else if (indexNum == 1) { // 自定义图片 - this.loadingPageData.image = "/static/uview/common/logo.png" - this.loadingPageData.loadingText = "uView UI" - this.loadingPageData.iconSize = 40 - this.loadingPageData.color = '#C8C8C8' - this.loadingPageData.loadingColor = '#C8C8C8' + this.loadingPageData['image'] = "/static/uview/common/logo.png" + this.loadingPageData['loadingText'] = "uView UI" + this.loadingPageData['iconSize'] = 40 + this.loadingPageData['color'] = '#C8C8C8' + this.loadingPageData['loadingColor'] = '#C8C8C8' } else if (indexNum == 2) { // 自定义加载动画模式 - this.loadingPageData.loadingMode = 'circle' - this.loadingPageData.loadingText = "uView UI" - this.loadingPageData.color = '#C8C8C8' - this.loadingPageData.loadingColor = '#C8C8C8' + this.loadingPageData['loadingMode'] = 'circle' + this.loadingPageData['loadingText'] = "uView UI" + this.loadingPageData['color'] = '#C8C8C8' + this.loadingPageData['loadingColor'] = '#C8C8C8' } else if (indexNum == 3) { // 自定义背景色 - this.loadingPageData.loadingMode = 'spinner' - this.loadingPageData.bgColor = 'rgba(0, 0, 0, 0.3)' - this.loadingPageData.loadingText = "uview-plus" - this.loadingPageData.color = '#eee' - this.loadingPageData.loadingColor = '#ddd' + this.loadingPageData['loadingMode'] = 'spinner' + this.loadingPageData['bgColor'] = 'rgba(0, 0, 0, 0.3)' + this.loadingPageData['loadingText'] = "uview-plus" + this.loadingPageData['color'] = '#eee' + this.loadingPageData['loadingColor'] = '#ddd' } this.loading = true setTimeout(() => {