diff --git a/package.json b/package.json index ec8cb7f..a36d19f 100644 --- a/package.json +++ b/package.json @@ -76,6 +76,7 @@ "lint:fix": "eslint --fix" }, "dependencies": { + "@climblee/uv-ui": "^1.1.20", "@dcloudio/uni-app": "3.0.0-4060620250520001", "@dcloudio/uni-app-harmony": "3.0.0-4060620250520001", "@dcloudio/uni-app-plus": "3.0.0-4060620250520001", @@ -99,6 +100,7 @@ "pinia": "2.0.36", "pinia-plugin-persistedstate": "3.2.1", "qs": "6.5.3", + "uview-ui": "2.0.38", "vue": "^3.4.21", "wot-design-uni": "^1.9.1", "z-paging": "2.8.7" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b4b9e85..762af98 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,6 +16,9 @@ importers: .: dependencies: + '@climblee/uv-ui': + specifier: ^1.1.20 + version: 1.1.20 '@dcloudio/uni-app': specifier: 3.0.0-4060620250520001 version: 3.0.0-4060620250520001(@dcloudio/types@3.4.14)(postcss@8.4.49)(rollup@4.41.1)(vue@3.5.15(typescript@5.7.2)) @@ -85,6 +88,9 @@ importers: qs: specifier: 6.5.3 version: 6.5.3 + uview-ui: + specifier: 2.0.38 + version: 2.0.38 vue: specifier: ^3.4.21 version: 3.5.15(typescript@5.7.2) @@ -938,6 +944,9 @@ packages: '@clack/prompts@0.11.0': resolution: {integrity: sha512-pMN5FcrEw9hUkZA4f+zLlzivQSeQf5dRGJjSUbvVYDLvpKCdQx5OaknvKzgbtXOizhP+SJJJjqEbOe55uKKfAw==} + '@climblee/uv-ui@1.1.20': + resolution: {integrity: sha512-jkyesHJsPJkF4Nap9ZmG1/ibKlxXA5M8+ntqKXwwloIsYSYL5SOKb0gyPj17aBOU1PkJpmeiZ8PwnTolhK2/HA==} + '@commitlint/cli@19.8.1': resolution: {integrity: sha512-LXUdNIkspyxrlV6VDHWBmCZRtkEVRpBKxi2Gtw3J54cGWhLCTouVD/Q6ZSaSvd2YaDObWK8mDjrz3TIKtaQMAA==} engines: {node: '>=v18'} @@ -6152,6 +6161,10 @@ packages: resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} engines: {node: '>= 0.4.0'} + uview-ui@2.0.38: + resolution: {integrity: sha512-6egHDf9lXHKpG3hEjRE0vMx4+VWwKk/ReTf5x18KrIKqdvdPRqO3+B8Unh7vYYwrIxzAWIlmhZ9RJpKI/4UqPQ==} + engines: {HBuilderX: ^3.1.0} + v8-to-istanbul@8.1.1: resolution: {integrity: sha512-FGtKtv3xIpR6BYhvgH8MI/y78oT7d8Au3ww4QIxymrCtZEh5b8gCw2siywE+puhEmuWKDtmfrvF5UlB298ut3w==} engines: {node: '>=10.12.0'} @@ -7330,6 +7343,8 @@ snapshots: picocolors: 1.1.1 sisteransi: 1.0.5 + '@climblee/uv-ui@1.1.20': {} + '@commitlint/cli@19.8.1(@types/node@20.17.9)(typescript@5.7.2)': dependencies: '@commitlint/format': 19.8.1 @@ -14036,6 +14051,8 @@ snapshots: utils-merge@1.0.1: {} + uview-ui@2.0.38: {} + v8-to-istanbul@8.1.1: dependencies: '@types/istanbul-lib-coverage': 2.0.6 diff --git a/src/components/CustomNavbar.vue b/src/components/CustomNavbar.vue new file mode 100644 index 0000000..2325d16 --- /dev/null +++ b/src/components/CustomNavbar.vue @@ -0,0 +1,78 @@ + + + + + diff --git a/src/layouts/fg-tabbar/tabbarList.ts b/src/layouts/fg-tabbar/tabbarList.ts index 1506b47..6a6dc2f 100644 --- a/src/layouts/fg-tabbar/tabbarList.ts +++ b/src/layouts/fg-tabbar/tabbarList.ts @@ -35,18 +35,12 @@ export const tabbarList = [ // 注意 unocss 的图标需要在 页面上引入一下,或者配置到 unocss.config.ts 的 safelist 中 iconType: 'unocss', }, - // { - // pagePath: 'pages/my/index', - // text: '我的', - // icon: '/static/logo.svg', - // iconType: 'local', - // }, - // { - // pagePath: 'pages/mine/index', - // text: '我的', - // icon: 'iconfont icon-my', - // iconType: 'iconfont', - // }, + { + pagePath: 'pages/my/index', + text: '我的', + icon: 'i-ant-design-user-outlined ', + iconType: 'unocss', + }, ] const _tabbar = { @@ -54,7 +48,7 @@ const _tabbar = { selectedColor: '#018d71', backgroundColor: '#F8F8F8', borderStyle: 'black', - height: '50px', + height: '60px', fontSize: '10px', iconWidth: '24px', spacing: '3px', diff --git a/src/layouts/heardbg.vue b/src/layouts/heardbg.vue new file mode 100644 index 0000000..598c6b1 --- /dev/null +++ b/src/layouts/heardbg.vue @@ -0,0 +1,25 @@ + + + diff --git a/src/pages-sub/demo/index.vue b/src/pages-tourism-sub/demo/index.vue similarity index 100% rename from src/pages-sub/demo/index.vue rename to src/pages-tourism-sub/demo/index.vue diff --git a/src/pages-tourism-sub/home/index.vue b/src/pages-tourism-sub/home/index.vue new file mode 100644 index 0000000..005ed78 --- /dev/null +++ b/src/pages-tourism-sub/home/index.vue @@ -0,0 +1,335 @@ + +{ + layout: 'default', + style: { + navigationBarTitleText: '', + }, +} + + + + + diff --git a/src/pages-village-sub/demo/index.vue b/src/pages-village-sub/demo/index.vue new file mode 100644 index 0000000..bee8a77 --- /dev/null +++ b/src/pages-village-sub/demo/index.vue @@ -0,0 +1,27 @@ + +{ + style: { + navigationStyle: 'default', + navigationBarTitleText: '分包页面 标题', + }, +} + + + + + + + diff --git a/src/pages-village-sub/home/index.vue b/src/pages-village-sub/home/index.vue new file mode 100644 index 0000000..aa51dfa --- /dev/null +++ b/src/pages-village-sub/home/index.vue @@ -0,0 +1,455 @@ + +{ + layout: 'default', + style: { + navigationBarTitleText: '', + }, +} + + + + + diff --git a/src/pages-village-sub/server/classroom.vue b/src/pages-village-sub/server/classroom.vue new file mode 100644 index 0000000..250995c --- /dev/null +++ b/src/pages-village-sub/server/classroom.vue @@ -0,0 +1,128 @@ + +{ + layout: 'default', + style: { + navigationBarTitleText: '', + }, +} + + + + + diff --git a/src/pages-village-sub/server/helper.vue b/src/pages-village-sub/server/helper.vue new file mode 100644 index 0000000..229009a --- /dev/null +++ b/src/pages-village-sub/server/helper.vue @@ -0,0 +1,157 @@ + +{ + layout: 'default', + style: { + navigationBarTitleText: '', + }, +} + + + + + diff --git a/src/pages-village-sub/server/index.vue b/src/pages-village-sub/server/index.vue new file mode 100644 index 0000000..0f78d38 --- /dev/null +++ b/src/pages-village-sub/server/index.vue @@ -0,0 +1,153 @@ + +{ + layout: 'default', + style: { + navigationBarTitleText: '', + }, +} + + + + + diff --git a/src/pages-village-sub/server/market.vue b/src/pages-village-sub/server/market.vue new file mode 100644 index 0000000..77696fe --- /dev/null +++ b/src/pages-village-sub/server/market.vue @@ -0,0 +1,153 @@ + +{ + layout: 'default', + style: { + navigationBarTitleText: '', + }, +} + + + + + + diff --git a/src/pages-village-sub/server/rice.vue b/src/pages-village-sub/server/rice.vue new file mode 100644 index 0000000..d8c8296 --- /dev/null +++ b/src/pages-village-sub/server/rice.vue @@ -0,0 +1,208 @@ + +{ + layout: 'default', + style: { + navigationBarTitleText: '', + }, +} + + + + + diff --git a/src/pages.json b/src/pages.json index a385426..4ed5508 100644 --- a/src/pages.json +++ b/src/pages.json @@ -19,7 +19,7 @@ "selectedColor": "#018d71", "backgroundColor": "#F8F8F8", "borderStyle": "black", - "height": "50px", + "height": "60px", "fontSize": "10px", "iconWidth": "24px", "spacing": "3px", @@ -39,6 +39,12 @@ "text": "关于", "icon": "i-carbon-code", "iconType": "unocss" + }, + { + "pagePath": "pages/my/index", + "text": "我的", + "icon": "i-ant-design-user-outlined ", + "iconType": "unocss" } ] }, @@ -46,7 +52,7 @@ { "path": "pages/index/index", "type": "home", - "layout": "tabbar", + "layout": "default", "style": { "navigationStyle": "custom", "navigationBarTitleText": "首页" @@ -59,7 +65,123 @@ "style": { "navigationBarTitleText": "关于" } + }, + { + "path": "pages/index/detail", + "type": "page", + "layout": "default", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/login/login", + "type": "page", + "layout": "tabbar", + "style": { + "navigationBarTitleText": "登录" + } + }, + { + "path": "pages/my/index", + "type": "page", + "style": { + "navigationBarTitleText": "我的" + } + }, + { + "path": "pages/web_view/index", + "type": "page", + "layout": "heardbg", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom", + "navigationBarTextStyle": "white" + } } ], - "subPackages": [] + "subPackages": [ + { + "root": "pages-village-sub", + "pages": [ + { + "path": "demo/index", + "type": "page", + "style": { + "navigationStyle": "default", + "navigationBarTitleText": "分包页面 标题" + } + }, + { + "path": "home/index", + "type": "page", + "layout": "default", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "server/classroom", + "type": "page", + "layout": "default", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "server/helper", + "type": "page", + "layout": "default", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "server/index", + "type": "page", + "layout": "default", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "server/market", + "type": "page", + "layout": "default", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "server/rice", + "type": "page", + "layout": "default", + "style": { + "navigationBarTitleText": "" + } + } + ] + }, + { + "root": "pages-tourism-sub", + "pages": [ + { + "path": "demo/index", + "type": "page", + "style": { + "navigationStyle": "default", + "navigationBarTitleText": "分包页面 标题" + } + }, + { + "path": "home/index", + "type": "page", + "layout": "default", + "style": { + "navigationBarTitleText": "" + } + } + ] + } + ] } \ No newline at end of file diff --git a/src/pages/index/detail.vue b/src/pages/index/detail.vue new file mode 100644 index 0000000..bd13162 --- /dev/null +++ b/src/pages/index/detail.vue @@ -0,0 +1,123 @@ + +{ + layout: 'default', + style: { + navigationStyle: 'custom', + }, +} + + + + + diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index ec3bcbf..d6fb328 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -1,7 +1,7 @@ { - layout: 'tabbar', + layout: 'default', style: { // 'custom' 表示开启自定义导航栏,默认 'default' navigationStyle: 'custom', @@ -10,73 +10,376 @@ } - - + + + + diff --git a/src/pages/login/login.vue b/src/pages/login/login.vue new file mode 100644 index 0000000..5474bf4 --- /dev/null +++ b/src/pages/login/login.vue @@ -0,0 +1,20 @@ + +{ + layout: 'tabbar', + style: { + navigationBarTitleText: '登录', + }, +} + + + + + + + diff --git a/src/pages/my/components/wx-login.vue b/src/pages/my/components/wx-login.vue new file mode 100644 index 0000000..30e5ff9 --- /dev/null +++ b/src/pages/my/components/wx-login.vue @@ -0,0 +1,39 @@ + +{ + style: { navigationBarTitleText: '登录' }, +} + + + + + diff --git a/src/pages/my/index.vue b/src/pages/my/index.vue new file mode 100644 index 0000000..3daeee5 --- /dev/null +++ b/src/pages/my/index.vue @@ -0,0 +1,37 @@ + +{ + style: { navigationBarTitleText: '我的' }, +} + + + + diff --git a/src/pages/web_view/index.vue b/src/pages/web_view/index.vue new file mode 100644 index 0000000..3746d52 --- /dev/null +++ b/src/pages/web_view/index.vue @@ -0,0 +1,91 @@ + +{ + layout: 'heardbg', + style: { + navigationBarTitleText: '', + navigationStyle: 'custom', + navigationBarTextStyle: 'white', + }, +} + + + + + + diff --git a/src/static/icons/agriculture_course.png b/src/static/icons/agriculture_course.png new file mode 100644 index 0000000..7f0ae4b Binary files /dev/null and b/src/static/icons/agriculture_course.png differ diff --git a/src/static/icons/agriculture_service.png b/src/static/icons/agriculture_service.png new file mode 100644 index 0000000..e85c964 Binary files /dev/null and b/src/static/icons/agriculture_service.png differ diff --git a/src/static/icons/rural_ecommerce.png b/src/static/icons/rural_ecommerce.png new file mode 100644 index 0000000..e712e05 Binary files /dev/null and b/src/static/icons/rural_ecommerce.png differ diff --git a/src/static/icons/top_num.png b/src/static/icons/top_num.png new file mode 100644 index 0000000..3617d51 Binary files /dev/null and b/src/static/icons/top_num.png differ diff --git a/src/static/icons/village_service.png b/src/static/icons/village_service.png new file mode 100644 index 0000000..dd18350 Binary files /dev/null and b/src/static/icons/village_service.png differ diff --git a/src/style/index.scss b/src/style/index.scss index 86184d9..e2702cd 100644 --- a/src/style/index.scss +++ b/src/style/index.scss @@ -1,4 +1,5 @@ @import './iconfont.css'; +@import '@/uni.scss'; .test { // 可以通过 @apply 多个样式封装整体样式 @@ -7,12 +8,159 @@ padding-top: 4px; color: red; } +.default-color { + color: #70cd6aff; +} :root, page { + background-color: $uni-bg-color; // 修改按主题色 - // --wot-color-theme: #37c2bc; + --wot-color-theme: #70cd6aff; + --wot-button-primary-bg-color: #70cd6aff; // 按钮默认颜色 + --wot-grid-item-padding: 0rpx 10rpx; //gid布局 + --wot-search-input-height: 60rpx; //搜索框高度 - // 修改按钮背景色 - // --wot-button-primary-bg-color: green; + --wot-tabs-nav-height: 80rpx; //tab滚动条高度 + + --wot-grid-item-bg: --wot-color-white, rgba(0, 0, 0, 0); //grid-item统一去边框 + + --wot-card-margin: 0 var(--wot-size-side-padding, 20rpx); //card 统一边距 + + // background-color: var(--wot-grid-item-bg, var(--wot-color-white, rgb(255, 255, 255))); + // --wot-segmented-item-bg-color: #70CD6AFF; //wd-segmentedb 背景颜色 +} + +.wd-search { + background-color: transparent !important; +} +//渐变背景 +.background_home { + background: linear-gradient(to bottom, #70cd6aff, #f1f1f1); /* 垂直渐变 */ +} + +//渐变背景 +.background_home_card { + background: linear-gradient(to bottom, #f1f1f1, #70cd6aff); /* 垂直渐变 */ +} + +.scroll-view-container { + white-space: nowrap; // 防止内容换行 + padding: 20rpx; + height: 80rpx; + overflow-x: auto; // 允许水平滚动 + .wd-button { + margin-right: 20rpx !important; // 添加间距以防止按钮粘连 + } +} +.relative { + position: relative; +} +// .wd-segmented__item.is-active { +// background: #70CD6AFF !important; +// color: #fff !important; +// } + +.background-none { + --wot-color-white: rgba(0, 0, 0, 0) !important; + background: rgba(0, 0, 0, 0) !important; +} +// .wd-grid-item__content { +// padding: 0px !important; +// } +//card 样式 +.card-content { + margin: 0px !important; + padding: 0px !important; +} +.wd-grid-item { + border-radius: 20rpx; +} + +.detail-box { + margin: 10rpx 0rpx; + background-color: #fff; + border: 1rpx solid #dfdfdf; + border-radius: 20rpx; + padding: 16rpx; +} +.wd-card__title-content { + padding: 10rpx 0 !important; +} +.content, +.title { + font-size: 32rpx; + // font-weight: bold; + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; +} + +.content { + justify-content: flex-start; +} +.title { + justify-content: space-between; +} +.title-tip { + color: rgba(0, 0, 0, 0.25); + font-size: 12px; +} + +.ellipsis { + display: inline-block; + /* 在末尾显示省略号 */ + width: calc(100vw - 340rpx); + /* 防止文字换行 */ + overflow: hidden; + /* 隐藏超出部分的文字 */ + text-overflow: ellipsis; + white-space: nowrap; + /* 确保元素有宽度 */ +} +$container-width: 100vw; +$padding-width: 0rpx; +.ellipsis-2 { + display: -webkit-box; + font-weight: 500; + font-size: 40rpx; + line-height: 40rpx; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; /* 限制为2行 */ + overflow: hidden; + text-overflow: ellipsis; + white-space: normal; /* 允许文字换行 */ + width: calc($container-width - $padding-width); /* 确保容器有宽度 */ + // 注意事项:100vw 和 340rpx 的单位不同,可能会导致在某些设备上显示异常。 +} + +.ellipsis-5 { + display: -webkit-box; + font-weight: 500; + font-size: 40rpx; + line-height: 40rpx; + -webkit-box-orient: vertical; + -webkit-line-clamp: 5; /* 限制为2行 */ + overflow: hidden; + text-overflow: ellipsis; + white-space: normal; /* 允许文字换行 */ + width: calc($container-width - $padding-width); /* 确保容器有宽度 */ + // 注意事项:100vw 和 340rpx 的单位不同,可能会导致在某些设备上显示异常。 +} +//上下布局 +.flex-content-column { + display: flex; + flex-direction: column; + justify-content: space-between; /* 这行确保子元素在容器中顶部和底部对齐 */ + flex: 1; /* 使该容器自适应高度 */ + min-height: 0; /* 确保在某些情况下仍然能够自适应高度 */ +} +//横向布局 +.flex-content-row { + display: flex; + flex-direction: row; + justify-content: space-between; /* 这行确保子元素在容器中顶部和底部对齐 */ + flex: 1; /* 使该容器自适应高度 */ + min-height: 0; /* 确保在某些情况下仍然能够自适应高度 */ } diff --git a/src/uni.scss b/src/uni.scss index 21b9e5f..dfc1930 100644 --- a/src/uni.scss +++ b/src/uni.scss @@ -16,8 +16,9 @@ /* 颜色变量 */ /* 行为相关颜色 */ +$uni-color-default: #70cd6aff; $uni-color-primary: #007aff; -$uni-color-success: #4cd964; +$uni-color-success: #70cd6aff; $uni-color-warning: #f0ad4e; $uni-color-error: #dd524d; @@ -29,7 +30,7 @@ $uni-text-color-placeholder: #808080; $uni-text-color-disable: #c0c0c0; /* 背景颜色 */ -$uni-bg-color: #fff; +$uni-bg-color: #f1f1f1; $uni-bg-color-grey: #f8f8f8; $uni-bg-color-hover: #f1f1f1; // 点击状态颜色 $uni-bg-color-mask: rgb(0 0 0 / 40%); // 遮罩颜色 diff --git a/vite.config.ts b/vite.config.ts index 6d9e635..468d76f 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -62,7 +62,7 @@ export default async ({ command, mode }) => { routeBlockLang: 'json5', // 虽然设了默认值,但是vue文件还是要加上 lang="json5", 这样才能很好地格式化 // homePage 通过 vue 文件的 route-block 的type="home"来设定 // pages 目录为 src/pages,分包目录不能配置在pages目录下 - // subPackages: ['src/pages-sub'], // 是个数组,可以配置多个,但是不能为pages里面的目录 + subPackages: ['src/pages-village-sub', 'src/pages-tourism-sub'], // 是个数组,可以配置多个,但是不能为pages里面的目录 dts: 'src/types/uni-pages.d.ts', }), UniLayouts(), @@ -75,7 +75,7 @@ export default async ({ command, mode }) => { // 自定义插件禁用 vite:vue 插件的 devToolsEnabled,强制编译 vue 模板时 inline 为 true name: 'fix-vite-plugin-vue', configResolved(config) { - const plugin = config.plugins.find(p => p.name === 'vite:vue') + const plugin = config.plugins.find((p) => p.name === 'vite:vue') if (plugin && plugin.api && plugin.api.options) { plugin.api.options.devToolsEnabled = false } @@ -91,7 +91,7 @@ export default async ({ command, mode }) => { // Optimization 插件需要 page.json 文件,故应在 UniPages 插件之后执行 Optimization({ enable: { - 'optimization': true, + optimization: true, 'async-import': true, 'async-component': true, }, @@ -113,14 +113,14 @@ export default async ({ command, mode }) => { }, }, // 打包分析插件,h5 + 生产环境才弹出 - UNI_PLATFORM === 'h5' - && mode === 'production' - && visualizer({ - filename: './node_modules/.cache/visualizer/stats.html', - open: true, - gzipSize: true, - brotliSize: true, - }), + UNI_PLATFORM === 'h5' && + mode === 'production' && + visualizer({ + filename: './node_modules/.cache/visualizer/stats.html', + open: true, + gzipSize: true, + brotliSize: true, + }), // 只有在 app 平台时才启用 copyNativeRes 插件 // UNI_PLATFORM === 'app' && copyNativeRes(), Components({ @@ -163,7 +163,7 @@ export default async ({ command, mode }) => { [VITE_APP_PROXY_PREFIX]: { target: VITE_SERVER_BASEURL, changeOrigin: true, - rewrite: path => path.replace(new RegExp(`^${VITE_APP_PROXY_PREFIX}`), ''), + rewrite: (path) => path.replace(new RegExp(`^${VITE_APP_PROXY_PREFIX}`), ''), }, } : undefined,