Compare commits

..

12 Commits
base ... main

Author SHA1 Message Date
feige996
0dd0cab15d chore: 更新 package.json 中的版本号至 3.1.0 2025-06-22 16:58:18 +08:00
feige996
02d8fb1268 feat(utils): 添加查询字符串序列化工具函数替代qs库
实现一个轻量级的查询字符串序列化工具,支持基本类型和数组,用于替代第三方qs库以减少打包体积
2025-06-22 16:55:57 +08:00
feige996
ee8fc19a47 feat(env): 添加 VITE_APP_PROXY 和 UNI_PLATFORM 类型声明 2025-06-22 14:22:08 +08:00
feige996
dd11e45d5f refactor: 将类型定义文件移动到src/types目录下并添加登录相关类型
将types目录移动到src下以保持项目结构一致性
新增登录相关的类型定义文件,包含用户信息、登录返回数据等接口
2025-06-22 14:04:49 +08:00
feige996
8455f09e8c chore: 调整 vscode 文件嵌套配置 2025-06-22 13:12:42 +08:00
feige996
edefc99702 refactor(api): 将登录相关类型定义移动到types目录下 2025-06-22 13:02:10 +08:00
feige996
946ad7c976 feat(首页): 添加作者和官网信息并调整顶部间距
在首页添加作者和官网信息展示,同时将顶部图片间距从mt-12调整为mt-10以优化布局
2025-06-22 12:06:39 +08:00
feige996
cfe5634c91 ci(workflow): 添加 base-uv-ui 和 base-uview-plus 的自动合并工作流
添加两个新的工作流用于将 main 分支自动合并到 base-uv-ui 和 base-uview-plus 分支
2025-06-22 11:59:30 +08:00
feige996
2000eda414 chore: 禁用prettier并启用eslint作为默认格式化工具 2025-06-22 10:07:22 +08:00
feige996
69b7429909 style: 修改页面配置和代码片段格式
- 将首页图标类型从 'wot' 改为 'uiLib'
- 调整 Vue3 代码片段中 template 和 script 的顺序
- 格式化代码片段的缩进和换行
2025-06-22 10:04:44 +08:00
feige996
926d700b60 docs: tabbarList 2025-06-21 22:51:51 +08:00
feige996
f0cd8ee943 docs: tabbar.md 2025-06-21 22:46:42 +08:00
16 changed files with 140 additions and 56 deletions

View File

@ -42,3 +42,39 @@ jobs:
git checkout base-sard-ui
git merge main --no-ff -m "Auto merge main into base-sard-ui"
git push origin base-sard-ui
merge-to-base-uv-ui:
name: Merge main into base-uv-ui
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN_AUTO_MERGE }}
- name: Merge main into base-uv-ui
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git checkout base-uv-ui
git merge main --no-ff -m "Auto merge main into base-uv-ui"
git push origin base-uv-ui
merge-to-base-uview-plus:
name: Merge main into base-uview-plus
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN_AUTO_MERGE }}
- name: Merge main into base-uview-plus
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git checkout base-uview-plus
git merge main --no-ff -m "Auto merge main into base-uview-plus"
git push origin base-uview-plus

2
.gitignore vendored
View File

@ -27,7 +27,7 @@ dist
docs/.vitepress/dist
docs/.vitepress/cache
types
src/types
# lock 文件还是不要了,我主要的版本写死就好了
# pnpm-lock.yaml

35
.vscode/settings.json vendored
View File

@ -41,6 +41,7 @@
"tabbar",
"Toutiao",
"unibest",
"uview",
"uvui",
"Wechat",
"WechatMiniprogram",
@ -52,29 +53,29 @@
"explorer.fileNesting.patterns": {
"README.md": "index.html,favicon.ico,robots.txt,CHANGELOG.md",
"pages.config.ts": "manifest.config.ts,openapi-ts-request.config.ts",
"package.json": "pnpm-lock.yaml,pnpm-workspace.yaml,LICENSE,.gitattributes,.gitignore,.gitpod.yml,CNAME,.npmrc,.browserslistrc",
"eslint.config.mjs": "tsconfig.json,.commitlintrc.*,.prettier*,.editorconfig,.commitlint.cjs,.eslint*"
"package.json": "tsconfig.json,pnpm-lock.yaml,pnpm-workspace.yaml,LICENSE,.gitattributes,.gitignore,.gitpod.yml,CNAME,.npmrc,.browserslistrc",
"eslint.config.mjs": ".commitlintrc.*,.prettier*,.editorconfig,.commitlint.cjs,.eslint*"
},
//
"prettier.enable": true,
"editor.formatOnSave": true,
//
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.fixAll.eslint": "explicit",
"source.fixAll.stylelint": "explicit"
},
// //
// "prettier.enable": true,
// "editor.formatOnSave": true,
// //
// "editor.codeActionsOnSave": {
// "source.fixAll": "explicit",
// "source.fixAll.eslint": "explicit",
// "source.fixAll.stylelint": "explicit"
// },
// Disable the default formatter, use eslint instead
// "prettier.enable": false,
// "editor.formatOnSave": false,
"prettier.enable": false,
"editor.formatOnSave": false,
// Auto fix
// "editor.codeActionsOnSave": {
// "source.fixAll.eslint": "explicit",
// "source.organizeImports": "never"
// },
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},
// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [

View File

@ -27,12 +27,12 @@
" },",
"}",
"</route>\n",
"<template>",
" <view class=\"\">$2</view>",
"</template>\n",
"<script lang=\"ts\" setup>",
"//$3",
"</script>\n",
"<template>",
" <view class=\"\">$2</view>",
"</template>\n",
"<style lang=\"scss\" scoped>",
"//$4",
"</style>\n",
@ -41,16 +41,28 @@
"Print unibest style": {
"scope": "vue",
"prefix": "st",
"body": ["<style lang=\"scss\" scoped>", "//", "</style>\n"],
"body": [
"<style lang=\"scss\" scoped>",
"//",
"</style>\n"
],
},
"Print unibest script": {
"scope": "vue",
"prefix": "sc",
"body": ["<script lang=\"ts\" setup>", "//$3", "</script>\n"],
"body": [
"<script lang=\"ts\" setup>",
"//$3",
"</script>\n"
],
},
"Print unibest template": {
"scope": "vue",
"prefix": "te",
"body": ["<template>", " <view class=\"\">$1</view>", "</template>\n"],
"body": [
"<template>",
" <view class=\"\">$1</view>",
"</template>\n"
],
},
}

View File

@ -1,7 +1,7 @@
{
"name": "unibest",
"type": "commonjs",
"version": "3.0.0",
"version": "3.1.0",
"description": "unibest - 最好的 uniapp 开发模板",
"update-time": "2025-06-21",
"author": {
@ -98,7 +98,6 @@
"js-cookie": "^3.0.5",
"pinia": "2.0.36",
"pinia-plugin-persistedstate": "3.2.1",
"qs": "6.5.3",
"vue": "^3.4.21",
"wot-design-uni": "^1.9.1",
"z-paging": "2.8.7"

9
pnpm-lock.yaml generated
View File

@ -82,9 +82,6 @@ importers:
pinia-plugin-persistedstate:
specifier: 3.2.1
version: 3.2.1(pinia@2.0.36(typescript@5.7.2)(vue@3.5.15(typescript@5.7.2)))
qs:
specifier: 6.5.3
version: 6.5.3
vue:
specifier: ^3.4.21
version: 3.5.15(typescript@5.7.2)
@ -5440,10 +5437,6 @@ packages:
resolution: {integrity: sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==}
engines: {node: '>=0.6'}
qs@6.5.3:
resolution: {integrity: sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==}
engines: {node: '>=0.6'}
quansync@0.2.10:
resolution: {integrity: sha512-t41VRkMYbkHyCYmOvx/6URnN80H7k4X0lLdBMGsz+maAwrJQYB1djpV6vHrQIBE0WBSGqhtEHrK9U3DWWH8v7A==}
@ -13257,8 +13250,6 @@ snapshots:
dependencies:
side-channel: 1.0.6
qs@6.5.3: {}
quansync@0.2.10: {}
querystringify@2.2.0: {}

View File

@ -1,4 +1,4 @@
import type { ICaptcha, IUpdateInfo, IUpdatePassword, IUserInfoVo, IUserLogin } from './login.typings'
import type { ICaptcha, IUpdateInfo, IUpdatePassword, IUserInfoVo, IUserLogin } from './types/login'
import { http } from '@/utils/http'
/**

3
src/env.d.ts vendored
View File

@ -29,3 +29,6 @@ interface ImportMetaEnv {
interface ImportMeta {
readonly env: ImportMetaEnv
}
declare const __VITE_APP_PROXY__: 'true' | 'false'
declare const __UNI_PLATFORM__: 'app' | 'h5' | 'mp-alipay' | 'mp-baidu' | 'mp-kuaishou' | 'mp-lark' | 'mp-qq' | 'mp-tiktok' | 'mp-weixin' | 'mp-xiaochengxu'

View File

@ -1,7 +1,7 @@
import qs from 'qs'
import { useUserStore } from '@/store'
import { getEnvBaseUrl } from '@/utils'
import { platform } from '@/utils/platform'
import { stringifyQuery } from '@/utils/queryString'
export type CustomRequestOptions = UniApp.RequestOptions & {
query?: Record<string, any>
@ -18,7 +18,7 @@ const httpInterceptor = {
invoke(options: CustomRequestOptions) {
// 接口请求支持通过 query 参数配置 queryString
if (options.query) {
const queryStr = qs.stringify(options.query)
const queryStr = stringifyQuery(options.query)
if (options.url.includes('?')) {
options.url += `&${queryStr}`
}

View File

@ -1,16 +1,16 @@
# tabbar 说明
tabbar 分为4种情况
`tabbar` 分为 `4 ` 情况:
- 完全原生tabbar使用 switchTab 切换 tabbartabbar页面有缓存。
- 优势原生自带的tabbar最先渲染有缓存。
- 劣势只能使用2组图片来切换选中和非选中状态修改颜色只能重新换图片或者用iconfont
- 半自定义tabbar使用 switchTab 切换 tabbartabbar页面有缓存。使用了第三方UI库的 tabbar 组件,并隐藏了原生 tabbar 的显示。
- 优势:可以随意配置自己想要的 svg icon切换字体颜色方便。有缓存。可以实现各种花里胡哨的动效等。
- 劣势首次点击tababr会闪烁。
- 全自定义tabbar使用 navigateTo 切换tabbartabbar页面无缓存。使用了第三方UI库的 tabbar 组件。
- `完全原生 tabbar`,使用 `switchTab` 切换 tabbar`tabbar` 页面有缓存。
- 优势:原生自带的 tabbar最先渲染有缓存。
- 劣势:只能使用 2 组图片来切换选中和非选中状态,修改颜色只能重新换图片(或者用 iconfont
- `半自定义 tabbar`,使用 `switchTab` 切换 tabbar`tabbar` 页面有缓存。使用了第三方 UI 库的 `tabbar` 组件,并隐藏了原生 `tabbar` 的显示。
- 优势:可以随意配置自己想要的 `svg icon`,切换字体颜色方便。有缓存。可以实现各种花里胡哨的动效等。
- 劣势:首次点击 tababr 会闪烁。
- `全自定义 tabbar`,使用 `navigateTo` 切换 `tabbar``tabbar` 页面无缓存。使用了第三方 UI 库的 `tabbar` 组件。
- 优势:可以随意配置自己想要的 svg icon切换字体颜色方便。可以实现各种花里胡哨的动效等。
- 劣势首次点击tababr会闪烁无缓存。
- 无tabbar只有一个页面入口底部无tabbar显示常用语临时活动页。
- 劣势:首次点击 `tababr` 会闪烁,无缓存。
- ` tabbar`,只有一个页面入口,底部无 `tabbar` 显示;常用语临时活动页。
> 注意:花里胡哨的效果需要自己实现,本模版不提供。

View File

@ -1,9 +1,9 @@
/**
* tabbar tabbar.md
* 0: 'NATIVE_TABBAR'
* 2: 'FULL_CUSTOM_TABBAR'
* 1: 'HALF_CUSTOM_TABBAR'
* 3: 'NO_TABBAR'
* 0: 'NATIVE_TABBAR' `完全原生 tabbar`
* 2: 'FULL_CUSTOM_TABBAR' `全自定义 tabbar`
* 1: 'HALF_CUSTOM_TABBAR' `半自定义 tabbar`
* 3: 'NO_TABBAR' `无 tabbar`
*
* pages.json
*/

View File

@ -30,7 +30,7 @@
"pagePath": "pages/index/index",
"text": "首页",
"icon": "home",
"iconType": "wot"
"iconType": "uiLib"
},
{
"iconPath": "static/tabbar/example.png",

View File

@ -53,7 +53,7 @@ console.log('index')
<template>
<view class="bg-white px-4 pt-2" :style="{ marginTop: `${safeAreaInsets?.top}px` }">
<view class="mt-12">
<view class="mt-10">
<image src="/static/logo.svg" alt="" class="mx-auto block h-28 w-28" />
</view>
<view class="mt-4 text-center text-4xl text-[#d14328]">
@ -66,6 +66,19 @@ console.log('index')
<view class="m-auto mb-2 max-w-100 text-justify indent text-4">
{{ description }}
</view>
<view class="mt-4 text-center">
作者
<text class="text-green-500">
菲鸽
</text>
</view>
<view class="mt-4 text-center">
官网地址
<text class="text-green-500">
https://unibest.tech
</text>
</view>
<view class="mt-6 h-1px bg-#eee" />
<view class="mt-8 text-center">
当前平台是
<text class="text-green-500">

View File

@ -1,4 +1,4 @@
import type { IUserInfoVo } from '@/api/login.typings'
import type { IUserInfoVo } from '@/api/types/login'
import { defineStore } from 'pinia'
import { ref } from 'vue'
import {

29
src/utils/queryString.ts Normal file
View File

@ -0,0 +1,29 @@
/**
* URL查询字符串 qs
*
* @param obj
* @returns
*/
export function stringifyQuery(obj: Record<string, any>): string {
if (!obj || typeof obj !== 'object' || Array.isArray(obj))
return ''
return Object.entries(obj)
.filter(([_, value]) => value !== undefined && value !== null)
.map(([key, value]) => {
// 对键进行编码
const encodedKey = encodeURIComponent(key)
// 处理数组类型
if (Array.isArray(value)) {
return value
.filter(item => item !== undefined && item !== null)
.map(item => `${encodedKey}=${encodeURIComponent(item)}`)
.join('&')
}
// 处理基本类型
return `${encodedKey}=${encodeURIComponent(value)}`
})
.join('&')
}