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> </script>
<style lang="scss"> <style lang="scss">
@import 'sard-uniapp/index.scss'; @import "uview-plus/index.scss";
/* stylelint-disable selector-type-no-unknown */ /* stylelint-disable selector-type-no-unknown */
button::after { button::after {
border: none; border: none;

View File

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

View File

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

View File

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

View File

@ -61,9 +61,9 @@ function reset() {
<!-- #endif --> <!-- #endif -->
<!-- http://localhost:9000/#/pages/index/request --> <!-- 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 class="h-16">
<view v-if="loading"> <view v-if="loading">
loading... loading...
@ -77,8 +77,8 @@ function reset() {
</view> </view>
</block> </block>
</view> </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> </view>
</template> </template>

View File

@ -13,9 +13,9 @@ const { loading, data, run } = useUpload()
<template> <template>
<view class="p-4 text-center"> <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 v-if="loading" class="h-10 text-blue">
上传... 上传...
</view> </view>

View File

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