refactor(ui): 替换 sard-uniapp 为 uview-plus 组件库

This commit is contained in:
feige996 2025-06-22 11:14:12 +08:00
parent ac05ba415e
commit 34dc7c071d
7 changed files with 18 additions and 16 deletions

View File

@ -17,7 +17,7 @@ onHide(() => {
</script>
<style lang="scss">
@import 'sard-uniapp/index.scss';
@import "uview-plus/index.scss";
/* stylelint-disable selector-type-no-unknown */
button::after {
border: none;

View File

@ -34,7 +34,7 @@ onLoad(() => {
</script>
<template>
<sar-tabbar
<up-tabbar
v-if="customTabbarEnable"
v-model:current="tabbarStore.curIdx"
bordered
@ -44,14 +44,14 @@ onLoad(() => {
@change="selectTabBar"
>
<block v-for="(item, idx) in tabbarList" :key="item.path">
<sar-tabbar-item
<up-tabbar-item
v-if="item.iconType === 'uiLib'"
:text="item.text"
:icon="item.icon"
:name="idx"
/>
<sar-tabbar-item
<up-tabbar-item
v-else-if="item.iconType === 'unocss' || item.iconType === 'iconfont'"
:text="item.text"
:name="idx"
@ -63,12 +63,12 @@ onLoad(() => {
:class="[item.icon, idx === tabbarStore.curIdx ? 'is-active' : 'is-inactive']"
/>
</template>
</sar-tabbar-item>
<sar-tabbar-item v-else-if="item.iconType === 'local'" :text="item.text" :name="idx">
</up-tabbar-item>
<up-tabbar-item v-else-if="item.iconType === 'local'" :text="item.text" :name="idx">
<template #icon>
<image :src="item.icon" h-40rpx w-40rpx />
</template>
</sar-tabbar-item>
</up-tabbar-item>
</block>
</sar-tabbar>
</up-tabbar>
</template>

View File

@ -23,7 +23,7 @@ export const tabbarList = [
selectedIconPath: 'static/tabbar/homeHL.png',
pagePath: 'pages/index/index',
text: '首页',
icon: 'image',
icon: 'home',
iconType: 'uiLib',
},
{

View File

@ -31,7 +31,7 @@
"selectedIconPath": "static/tabbar/homeHL.png",
"pagePath": "pages/index/index",
"text": "首页",
"icon": "image",
"icon": "home",
"iconType": "uiLib"
},
{

View File

@ -61,9 +61,9 @@ function reset() {
<!-- #endif -->
<!-- http://localhost:9000/#/pages/index/request -->
<sar-button class="my-6" @click="run">
<up-button class="my-6" @click="run">
发送请求
</sar-button>
</up-button>
<view class="h-16">
<view v-if="loading">
loading...
@ -77,8 +77,8 @@ function reset() {
</view>
</block>
</view>
<sar-button theme="danger" class="my-6" :disabled="!data" @click="reset">
<up-button theme="danger" class="my-6" :disabled="!data" @click="reset">
重置数据
</sar-button>
</up-button>
</view>
</template>

View File

@ -13,9 +13,9 @@ const { loading, data, run } = useUpload()
<template>
<view class="p-4 text-center">
<sar-button @click="run">
<up-button @click="run">
选择图片并上传
</sar-button>
</up-button>
<view v-if="loading" class="h-10 text-blue">
上传...
</view>

View File

@ -75,3 +75,5 @@ $uni-color-subtitle: #555; // 二级标题颜色
$uni-font-size-subtitle: 18px;
$uni-color-paragraph: #3f536e; // 文章段落颜色
$uni-font-size-paragraph: 15px;
@import "uview-plus/theme.scss"; // /* 行为相关颜色 */