Commit ea6a60fa by Jaxon

Merge branch 'chore/eslint' into 'dev'

配置工程eslint与 stylelint 以支持 uniapp X

See merge request !13
2 parents bf078635 8c75caa2
Showing 341 changed files with 3988 additions and 17 deletions
...@@ -24,10 +24,13 @@ package-lock.json ...@@ -24,10 +24,13 @@ package-lock.json
**/backend-mock/data **/backend-mock/data
# 忽略所有子文件夹中的 .git # 忽略所有子文件夹中的 .git
**/.git **/.git
# 保留根仓库 .git # 保留根仓库 .git
!/.git !/.git
# uniappx
unpackage
# local env files # local env files
.env.local .env.local
.env.*.local .env.*.local
......
export default { export default {
"*.{js,jsx,ts,tsx,vue,md}": "pnpm eslint --cache --fix", "*.{js,jsx,ts,tsx,vue,uvue,uts,md}": "pnpm eslint --cache --fix",
"package.json": "pnpm eslint --cache --fix", "package.json": "pnpm eslint --cache --fix",
"{!(package)*.json,*.code-snippets,.!(browserslist)*rc}": "pnpm eslint --cache --fix", "{!(package)*.json,*.code-snippets,.!(browserslist)*rc}": "pnpm eslint --cache --fix",
"*.{scss,less,styl,html,vue,css,wxss}":"pnpm stylelint --fix --allow-empty-input", "*.{scss,less,styl,html,vue,uvue,css,wxss}":"pnpm stylelint --fix --allow-empty-input",
}; };
# 忽略特定文件
; path/to/specific-file.wxml
# 忽略特定目录下的所有 wxml
; temp/**/*.wxml
# 忽略所有以 .legacy. 开头的文件
; **/*.legacy.*
dist dist
dev-dist dev-dist
.local .local
...@@ -15,7 +8,8 @@ coverage ...@@ -15,7 +8,8 @@ coverage
CODEOWNERS CODEOWNERS
.nitro .nitro
.output .output
.github/workflows/codeql.yml **/*.uvue
**/*.uts
**/*.vue **/*.vue
**/*.js **/*.js
**/*.ts **/*.ts
...@@ -34,7 +28,7 @@ node_modules ...@@ -34,7 +28,7 @@ node_modules
miniprogram_npm miniprogram_npm
uni_modules uni_modules
wxcomponents wxcomponents
unpackage
# 只格式化 wxml # 只格式化 wxml
!*.wxml !*.wxml
!*.json !*.json
......
...@@ -21,7 +21,9 @@ ...@@ -21,7 +21,9 @@
// CSS 变量提示 // CSS 变量提示
"vunguyentuan.vscode-css-variables", "vunguyentuan.vscode-css-variables",
// 在 package.json 中显示 PNPM catalog 的版本 // 在 package.json 中显示 PNPM catalog 的版本
"antfu.pnpm-catalog-lens" "antfu.pnpm-catalog-lens",
// uniapp X 的 语言服务
"dcloud-ide.hbuilderx-language-services"
], ],
"unwantedRecommendations": [ "unwantedRecommendations": [
// 和 volar 冲突 // 和 volar 冲突
......
...@@ -39,9 +39,8 @@ ...@@ -39,9 +39,8 @@
"editor.autoClosingQuotes": "beforeWhitespace", "editor.autoClosingQuotes": "beforeWhitespace",
"editor.wordSeparators": "`~!@#%^&*()=+[{]}\\|;:'\",.<>/?", "editor.wordSeparators": "`~!@#%^&*()=+[{]}\\|;:'\",.<>/?",
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit", "source.fixAll.eslint": "always",
"source.fixAll.stylelint": "explicit", "source.fixAll.stylelint": "always",
"source.organizeImports": "never"
}, },
"editor.defaultFormatter": "dbaeumer.vscode-eslint", "editor.defaultFormatter": "dbaeumer.vscode-eslint",
"[html]": { "[html]": {
...@@ -83,6 +82,12 @@ ...@@ -83,6 +82,12 @@
"[yaml]": { "[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "esbenp.prettier-vscode"
}, },
"[uts]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[uvue]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
// extensions // extensions
"extensions.ignoreRecommendations": true, "extensions.ignoreRecommendations": true,
...@@ -92,12 +97,17 @@ ...@@ -92,12 +97,17 @@
"terminal.integrated.tabs.enabled": true, "terminal.integrated.tabs.enabled": true,
"terminal.integrated.scrollback": 10000, "terminal.integrated.scrollback": 10000,
"terminal.integrated.stickyScroll.enabled": true, "terminal.integrated.stickyScroll.enabled": true,
"vls.ext.default.style": "scss",
"emmet.includeLanguages": {
"vue": "html",
"uvue": "html"
},
// files // files
"files.eol": "\n", "files.eol": "\n",
"files.insertFinalNewline": true, "files.insertFinalNewline": true,
"files.simpleDialog.enable": true, "files.simpleDialog.enable": true,
"files.associations": { "files.associations": {
"*.uts": "typescript",
"*.ejs": "html", "*.ejs": "html",
"*.art": "html", "*.art": "html",
"**/tsconfig.json": "jsonc", "**/tsconfig.json": "jsonc",
...@@ -200,6 +210,8 @@ ...@@ -200,6 +210,8 @@
"typescript", "typescript",
"javascriptreact", "javascriptreact",
"typescriptreact", "typescriptreact",
"uts",
"uvue",
"vue", "vue",
"html", "html",
"markdown", "markdown",
......
VITE_BASE_URL=https://baidu.com
\ No newline at end of file \ No newline at end of file
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
.DS_Store
dist
dist-ssr
coverage
unpackage
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
*.tsbuildinfo
.eslintcache
# Cypress
/cypress/videos/
/cypress/screenshots/
# Vitest
__screenshots__/
{
"version" : "1.0",
"configurations" : [
{
"playground" : "standard",
"type" : "uni-app:app-android"
}
]
}
<script lang="uts">
// #ifdef APP-ANDROID || APP-HARMONY
let firstBackTime = 0;
// #endif
export default {
onLaunch () {
console.log("App Launch");
},
onShow () {
console.log("App Show");
},
onHide () {
console.log("App Hide");
},
// #ifdef APP-ANDROID || APP-HARMONY
onLastPageBackPress () {
console.log("App LastPageBackPress");
if (firstBackTime == 0) {
uni.showToast({
title: "再按一次退出应用",
position: "bottom",
});
firstBackTime = Date.now();
setTimeout(() => {
firstBackTime = 0;
}, 2000);
} else if (Date.now() - firstBackTime < 2000) {
firstBackTime = Date.now();
uni.exit();
}
},
// #endif
onExit () {
console.log("App Exit");
},
};
</script>
<style lang="scss">
@import url("./uni_modules/cool-unix/tailwindcss.scss");
@import url("./uni_modules/cool-unix/index.scss");
</style>
#### 项目介绍
萤火商城V2.0,是2021年全新推出的一款轻量级、高性能、前后端分离的电商系统,支持微信小程序 + H5+ 公众号 + APP,前后端源码完全开源,看见及所得,完美支持二次开发,可学习可商用,让您快速搭建个性化独立商城。
如果对您有帮助,您可以点右上角 “Star” 收藏一下 ,获取第一时间更新,谢谢!
#### 如何使用uni-app端
##### 一、导入uniapp项目
1. 首先下载HBuilderX并安装,地址:https://www.dcloud.io/hbuilderx.html
2. 打开HBuilderX -> 顶部菜单栏 -> 文件 -> 导入 -> 从本地目录导入 -> 选择uniapp端项目目录
3. 找到config.js文件,找到里面的apiUrl项,填入已搭建的后端url地址
4. 打开manifest.json文件,选择微信小程序配置,填写小程序的appid
##### 二、本地调试
1. 打开HBuilderX -> 顶部菜单栏 -> 运行 -> 运行到浏览器 -> Chrome
2. 如果请求后端api时 提示跨域错误,可安装Chrome插件:【Allow CORS: Access-Control-Allow-Origin】,地址:https://chrome.google.com/webstore/detail/allow-cors-access-control/lhobafahddgcelffkeicbaginigeejlf
##### 三、打包发行(H5)
1. 打开HBuilderX -> 顶部菜单栏 -> 发行 -> 网站H5-手机版
2. 打包后的文件路径:/unpackage/dist/build/h5
3. 将打包完成的所有文件 复制到商城后端/pulic目录下,全部替换
##### 四、打包发行(微信小程序)
1. 下载微信开发者工具并安装,地址:https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html
2. 打开HBuilderX -> 顶部菜单栏 -> 发行 -> 小程序-微信
3. 打包后的文件路径:/unpackage/dist/build/mp-weixin
5. 打开微信开发者工具 导入 打包完成的项目
6. 检查没有运行错误,在右上方上传小程序
#### UNIAPP-页面展示
![前端展示](https://images.gitee.com/uploads/images/2021/0316/215102_7bcb0802_2166072.png "前端展示.png")
#### 系统演示
![前端演示二维码](https://images.gitee.com/uploads/images/2021/0316/104516_3778337e_2166072.png "111.png")
#### 版权须知
1. 允许个人学习研究使用,支持二次开发,允许商业用途(仅限自运营)。
2. 允许商业用途,但仅限自运营,如果商用必须保留版权信息,望自觉遵守。
3. 不允许对程序代码以任何形式任何目的的再发行或出售,否则将追究侵权者法律责任。
\ No newline at end of file \ No newline at end of file
<template>
<view class="w-full p-5 pt-[60px] items-center justify-center">
<image :src="imgSrc" mode="widthFix" class="w-2/3"></image>
<view class="w-full justify-center items-center">
<text class="text-[#999] text-md" v-if="isTips">{{ tips }}</text>
<!-- 内容插槽 -->
<slot></slot>
</view>
</view>
</template>
<script setup lang="uts">
import data from '@/static/images/status/data.png'
import cart from '@/static/images/status/cart.png'
import order from '@/static/images/status/order.png'
import wallet from '@/static/images/status/wallet.png'
import coupon from '@/static/images/status/coupon.png'
import history from '@/static/images/status/history.png'
import message from '@/static/images/status/message.png'
import address from '@/static/images/status/address.png'
import payError from '@/static/images/status/pay-error.png'
import paySuccess from '@/static/images/status/pay-success.png'
type IconType = | 'data' | 'cart' | 'order' | 'wallet' | 'coupon' | 'history' | 'message' | 'address' | 'pay-success' | 'pay-error'
const props = defineProps({
type: {
type: String as PropType<IconType>,
default: 'data'
},
isTips: {
type: Boolean,
default: true
},
tips: {
type: String,
default: '这里空空如也~'
}
})
const imgSrc = computed(() => {
let src = ''
switch (props.type) {
case 'pay-success':
src = paySuccess
break;
case 'pay-error':
src = payError
break;
case 'data':
src = data
break;
case 'cart':
src = cart
break;
case 'order':
src = order
break;
case 'wallet':
src = wallet
break;
case 'coupon':
src = coupon
break;
case 'history':
src = history
break;
case 'message':
src = message
break;
case 'address':
src = address
break;
default:
src = data
break;
}
return src
})
</script>
<style lang="scss">
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="footer-float-bar">
<view :class="{pb: placeholder}">
<slot></slot>
</view>
</view>
</template>
<script setup lang="uts">
type Props = {
placeholder?: boolean
}
// 建议开启默认值,确保模板逻辑健壮
withDefaults(defineProps<Props>(), {
placeholder: true
});
</script>
<style lang="scss">
.footer-float-bar {
position: fixed;
bottom: 0;
left: 0;
z-index: 1;
width: 100%;
padding-bottom: var(--uni-safe-area-inset-bottom);
background-color: #fff;
.pb {
padding: 0 0 50px;
}
}
</style>
<template>
<view class="w-full rounded-md overflow-hidden"
:class="{ 'flex-row': direction == 'horizontal', 'mb-3': mb }"
@tap="goDetail">
<view class="relative"
:class="[direction == 'horizontal' ? 'horizontal-img' : 'vertical-img', customImgWidth ? 'custom-img-w' : '']">
<image class="w-full h-full absolute top-0 left-0"
mode="aspectFill"
src="https://uni-docs.cool-js.com/demo/pages/demo/static/bg1.png">
</image>
</view>
<view class="flex-1 px-2 bg-white" :class="{'py-2': direction == 'horizontal'}">
<cl-text ellipsis :pt="{className: 'text-[#333] font-bold'}">
商品名称
</cl-text>
<cl-text color="info"
ellipsis
:lines="direction == 'horizontal' ? 1 : 2"
size="12px">
云想衣裳花想容,春风拂槛露华浓。若非群玉山头见,会向瑶台月下逢。天阶夜色凉如水,卧看牵牛织女星。人生若只如初见,何事秋风悲画扇。山有木兮木有枝,心悦君兮君不知。
</cl-text>
<view class="flex-row items-center justify-between py-[2px]">
<cl-text color="error"
:pt="{className: 'font-bold'}"
size="15px"
type="amount"
:value="12">
</cl-text>
<cl-text color="info"
:pt="{className: 'ml-1'}"
size="10px">
销量:12
</cl-text>
</view>
<view class="flex-row items-end mt-auto" :class="{'pb-[10px]': direction === 'vertical'}">
<cl-button :pt="{
className: '!rounded-full !p-0 !w-[20px] !h-[20px] !border-none !ml-auto',
label: {
className: '!leading-4'
}
}"
size="small"
type="error"
@tap.stop>
<cl-icon color="#fff" name="add-line"></cl-icon>
</cl-button>
</view>
</view>
</view>
</template>
<script setup lang="uts">
import { router } from "@/utils/router.uts";
type Direction = "horizontal" | "vertical";
const props = defineProps({
/**
* @name 方向
* @enum "vertical , horizontal"
*/
direction: {
type: String as PropType<Direction>,
default: "vertical",
},
/**
* @name 底部边距
*/
mb: {
type: Boolean,
default: true
},
/**
* @name 控制横向商品图片的大小
*/
customImgWidth: {
type: Boolean,
default: false
}
});
const goDetail = () => {
router.navigateTo("/pages/subHome/goods-detail", "");
};
</script>
<style lang="scss">
.horizontal-img {
position: relative;
width: 30%;
padding-bottom: 30%;
}
.custom-img-w {
width: 40% !important;
padding-bottom: 40% !important;
}
.vertical-img {
position: relative;
width: 100%;
padding-bottom: 100%;
}
</style>
<template>
<view class="swiper-box">
<swiper class="swiper"
:current="current"
@change="swiperChange">
<swiper-item v-if="video"
class="swiper-item"
item-id="video">
<video class="swiper-item-video"
controls
:poster="poster"
:src="video">
</video>
</swiper-item>
<swiper-item v-for="item in list" :key="item" class="swiper-item">
<image class="swiper-item-img" :src="item"></image>
</swiper-item>
</swiper>
<view class="bot-type-tag absolute right-3 bottom-3 p-1 z-50">
<!-- 图片和视频下标 -->
<view v-if="video" class="flex-row">
<view class="p-1 rounded-md"
@tap="current = 0">
<text class="text-sm text-white">视频</text>
</view>
<view class="flex-row p-1 rounded-md"
:class="{'bg-black': current != 0}"
@tap="current = 1">
<text class="text-sm text-white">图集</text>
<text v-show="current != 0" class="text-sm text-white">{{ current }}/{{ list.length }}</text>
</view>
</view>
<!-- 仅图片下标 -->
<view v-else class="p-1 rounded-md">
<text class="text-sm text-white">{{ current + 1 }}/{{ list.length }}</text>
</view>
</view>
</view>
</template>
<script setup lang="uts">
defineProps({
list: {
type: Array<String>,
default: () => []
},
video: {
type: String,
default: ""
},
poster: {
type: String,
default: ""
}
});
// 当前轮播图下标
const current = ref<number>(0);
const swiperChange = (e : SwiperChangeEvent) => {
current.value = e.detail.current;
};
</script>
<style lang="scss">
.swiper-box {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
.swiper {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
.swiper-item,
.swiper-item-img,
.swiper-item-video {
width: 100%;
height: 100%;
}
}
.bot-type-tag {
background: rgb(0 0 0 / 70%);
border-radius: 6px;
}
}
</style>
<template>
<cl-topbar back-icon="arrow-left-s-line"
:background-color="bgc"
:color="color"
:fixed="fixed"
:height="height"
:pt="{
className: 'opacity-90 !z-50'
}"
safe-area-top
:show-back="isShowBack"
:title="title">
<template #prepend>
<view class="!pl-2">
<slot name="before"></slot>
</view>
</template>
<template #append>
<view class="pr-2">
<slot name="after"></slot>
</view>
</template>
</cl-topbar>
</template>
<script setup lang="uts">
const props = defineProps({
title: {
type: String,
default: "标题"
},
isShowBack: {
type: Boolean,
default: true
},
fixed: {
type: Boolean,
default: true
},
bgc: {
type: String,
default: "#ffffff"
},
color: {
type: String,
default: "#333333"
},
height: {
type: String,
default: "44px"
}
});
</script>
<style lang="scss">
</style>
<template>
<cl-popup v-model="visible" :show-close="false" title="订单支付">
<scroll-view class="p-4 h-[400px]">
<cl-text>
春江花月夜,花草复青青。
江水流不尽,月光照无情。
夜来风雨急,愁思满心头。
何时再相见,共赏月明楼。
</cl-text>
<cl-text>
春江花月夜,花草复青青。
江水流不尽,月光照无情。
夜来风雨急,愁思满心头。
何时再相见,共赏月明楼。
</cl-text>
<cl-text>
春江花月夜,花草复青青。
江水流不尽,月光照无情。
夜来风雨急,愁思满心头。
何时再相见,共赏月明楼。
</cl-text>
<cl-text>
春江花月夜,花草复青青。
江水流不尽,月光照无情。
夜来风雨急,愁思满心头。
何时再相见,共赏月明楼。
</cl-text>
<cl-text>
春江花月夜,花草复青青。
江水流不尽,月光照无情。
夜来风雨急,愁思满心头。
何时再相见,共赏月明楼。
</cl-text>
<cl-text>
春江花月夜,花草复青青。
江水流不尽,月光照无情。
夜来风雨急,愁思满心头。
何时再相见,共赏月明楼。
</cl-text>
</scroll-view>
<view class="p-3">
<cl-button type="error" @tap="emit('pay')">立即支付</cl-button>
</view>
</cl-popup>
</template>
<script lang="uts" setup>
const emit = defineEmits(['pay'])
const visible = ref(false);
const open = () => {
visible.value = true;
}
const close = () => {
visible.value = false
}
defineExpose({
open,
close
})
</script>
\ No newline at end of file \ No newline at end of file
<template>
<cl-button @tap="sendCode">
{{ isSendRes ? `${number }s 后重试` : text }}
</cl-button>
</template>
<script setup lang="uts">
import { useUi } from "@/uni_modules/cool-unix/hooks";
const props = defineProps({
email: {
type: String,
default: ""
}
});
const ui = useUi();
const number = ref(60);
const text = ref("发送验证码");
// 是否发送成功
const isSendRes = ref(false);
const reg = /^[A-Z0-9\u4E00-\u9FA5]+@[\w-]+(\.[\w-]+)+$/i;
// 操作倒计时数字
const timer = ref<null|number>(null);
const handleNumber = () => {
timer.value = setInterval(() => {
number.value = number.value - 1;
if (number.value == 0) {
if (timer.value != null) {
clearInterval(timer.value as number);
}
isSendRes.value = false;
}
}, 1000) as number;
};
const sendCode = () => {
if (isSendRes.value) return ui.showToast({
message: "验证码已发送,请稍后重试"
});
if (props.email == "") {
ui.showToast({
message: "请输入邮箱地址"
});
} else if (reg.test(props.email)) {
isSendRes.value = true;
handleNumber();
} else {
ui.showToast(({
message: "请输入正确的邮箱地址"
}));
}
};
</script>
<style>
</style>
<template>
<view class="tab-bar">
<view class="flex-row tab-bar-content">
<view class="flex-1 items-center justify-center" v-for="tab in tabBarList" :key="tab.url"
@tap="switchTab(tab.url)">
<image :src="tab.id == current ? tab.image_a : tab.image" class="w-[24px] h-[24px]"></image>
<cl-text size="10px" :pt="{
className: '!leading-[10px]'
}" :color="tab.id == current ? 'primary' : 'info'">{{tab.label}}</cl-text>
</view>
</view>
</view>
<!-- 底部导航占位符 -->
<view class="tab-bar-placeholder">
<view class="placeholder-content">
</view>
</view>
</template>
<script setup lang="uts">
import { router } from '@/utils/router.uts'
import { tabBarList } from '@/utils/pageStaticList'
const props = defineProps({
current: {
default: 'index',
type: String
}
})
const switchTab = (url : string) => {
console.log(url);
router.switchTab(url, '')
}
onLoad(() => {
uni.hideTabBar()
})
</script>
<style lang="scss">
.tab-bar {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
z-index: 99;
background-color: #fff;
border-top: 1px solid #eee;
padding-bottom: var(--uni-safe-area-inset-bottom);
/* #ifdef MP-WEIXIN */
padding-bottom: constant(safe-area-inset-bottom);
/* #endif */
padding-bottom: env(safe-area-inset-bottom);
.tab-bar-content {
height: 50px;
}
}
.tab-bar-placeholder {
padding-bottom: var(--uni-safe-area-inset-bottom);
/* #ifdef MP-WEIXIN */
padding-bottom: constant(safe-area-inset-bottom);
/* #endif */
padding-bottom: env(safe-area-inset-bottom);
.placeholder-content {
height: 50px;
}
}
</style>
\ No newline at end of file \ No newline at end of file
{
"android": {},
"ios": {}
}
\ No newline at end of file \ No newline at end of file
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<link rel="shortcut icon" href="static/logo.png" type="image/x-icon" />
<script>
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
<title></title>
<!--preload-links-->
<!--app-context-->
</head>
<body>
<div id="app" class="app-main"><!--app-html--></div>
<script type="module" src="/main"></script>
</body>
</html>
\ No newline at end of file \ No newline at end of file
import { createSSRApp } from "vue";
import App from "./App.uvue";
import { cool } from "./uni_modules/cool-unix";
export function createApp() {
const app = createSSRApp(App);
app.use(cool);
return {
app
};
}
{
"name": "NOURA",
"appid": "__UNI__F09ACC0",
"description": "NOURA STUDIO.",
"versionName": "1.0.1",
"versionCode": "101",
"uni-app-x": {},
/* 快应用特有相关 */
"quickapp": {},
/* 小程序特有相关 */
"mp-weixin": {
"appid": "wx4b1e8871f5305c63",
"setting": {
"urlCheck": false,
"minified": true
},
"usingComponents": true,
"permission": {
"scope.userLocation": {
"desc": "获取位置"
}
}
},
"mp-alipay": {
"usingComponents": true
},
"mp-baidu": {
"usingComponents": true
},
"mp-toutiao": {
"usingComponents": true
},
"uniStatistics": {
"enable": false
},
"vueVersion": "3",
"app": {
"distribute": {
"icons": {
"android": {
"hdpi": "",
"xhdpi": "",
"xxhdpi": "",
"xxxhdpi": ""
}
}
}
},
"app-android": {
"distribute": {
"modules": {
"uni-location": {
"system": {}
}
},
"icons": {
"hdpi": "D:/workspace/uniapp_demo/lightning/static/logo.png",
"xhdpi": "D:/workspace/uniapp_demo/lightning/static/logo.png",
"xxhdpi": "D:/workspace/uniapp_demo/lightning/static/logo.png",
"xxxhdpi": "D:/workspace/uniapp_demo/lightning/static/logo.png"
},
"splashScreens": {
"default": {}
}
}
},
"app-ios": {
"distribute": {
"modules": {},
"icons": {
"appstore": "D:/workspace/uniapp_demo/lightning/static/logo.png"
},
"splashScreens": {}
}
},
"web": {
"router": {
"mode": ""
},
"title": "NOURA STUDIO."
},
"app-harmony": {
"distribute": {
"modules": {}
}
}
}
{
"name": "uniapp-x-shop",
"version": "1.0.0",
"license": "MIT",
"scripts": {},
"dependencies": {
"vue": "^3.5.13"
},
"devDependencies": {
"@cool-vue/vite-plugin": "8.2.18",
"@dcloudio/types": "^3.4.16",
"@types/node": "^24.0.15",
"@vue/tsconfig": "^0.7.0",
"autoprefixer": "^10.4.21",
"postcss": "^8.5.3",
"prettier": "^3.5.3",
"tailwindcss": "3.4.17",
"vite": "^6.3.5"
}
}
{
"pages": [{
"path": "pages/index/index",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/index/cate",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/index/moments",
"style": {
"navigationStyle": "custom",
"backgroundColor": "#f8f8f8"
}
},
{
"path": "pages/index/cart",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/index/mine",
"style": {
"navigationStyle": "custom"
}
}
],
"subPackages": [{
"root": "pages/subHome",
"pages": [{
"path": "search",
"style": {
"navigationBarTitleText": "搜索",
"navigationStyle": "custom"
}
},
{
"path": "goods-detail",
"style": {
"navigationBarTitleText": "商品详情页",
"navigationStyle": "custom"
}
},
{
"path": "coupon",
"style": {
"navigationBarTitleText": "优惠券领取中心",
"navigationStyle": "custom"
}
}
]
},
{
"root": "pages/login",
"pages": [{
"path": "login",
"style": {
"navigationBarTitleText": "登录",
"navigationStyle": "custom"
}
},
{
"path": "register",
"style": {
"navigationBarTitleText": "注册",
"navigationStyle": "custom"
}
},
{
"path": "agreement",
"style": {
"navigationBarTitleText": "隐私政策/用户协议",
"navigationStyle": "custom"
}
}
]
},
{
"root": "pages/subMoments",
"pages": [{
"path": "release-moment",
"style": {
"navigationBarTitleText": "发布动态",
"navigationStyle": "custom"
}
},
{
"path": "moment-detail",
"style": {
"navigationBarTitleText": "动态详情",
"navigationStyle": "custom"
}
},
{
"path": "my-moments",
"style": {
"navigationBarTitleText": "我的动态",
"navigationStyle": "custom"
}
}
]
},
{
"root": "pages/subMine",
"pages": [{
"path": "settings",
"style": {
"navigationBarTitleText": "设置",
"navigationStyle": "custom"
}
},
{
"path": "contact",
"style": {
"navigationBarTitleText": "联系我们",
"navigationStyle": "custom"
}
},
{
"path": "about",
"style": {
"navigationBarTitleText": "关于我们",
"navigationStyle": "custom"
}
},
{
"path": "user-center",
"style": {
"navigationBarTitleText": "个人中心",
"navigationStyle": "custom"
}
},
{
"path": "account-security",
"style": {
"navigationBarTitleText": "账号安全",
"navigationStyle": "custom"
}
}
]
},
{
"root": "pages/order",
"pages": [{
"path": "submit-order-page",
"style": {
"navigationBarTitleText": "提交订单",
"navigationStyle": "custom"
}
},
{
"path": "payment-status",
"style": {
"navigationBarTitleText": "支付状态",
"navigationStyle": "custom",
"backgroundColorContent": "#ffffff"
}
},
{
"path": "order-detail",
"style": {
"navigationBarTitleText": "订单详情",
"navigationStyle": "custom"
}
},
{
"path": "order-list",
"style": {
"navigationBarTitleText": "订单列表",
"navigationStyle": "custom"
}
}
]
}
],
// "preloadRule": {
// "pages/index/index": {
// "network": "all",
// "packages": [
// "pages/login", "pages/subHome"
// ]
// },
// "pages/index/moments": {
// "network": "all",
// "packages": [
// "pages/subMoments"
// ]
// },
// "pages/index/mine": {
// "network": "all",
// "packages": [
// "pages/subMine"
// ]
// }
// },
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "NOURA STUDIO.",
"navigationBarBackgroundColor": "#fff",
"backgroundColor": "#00b96b",
"backgroundColorContent": "#f8f8f8"
},
"tabBar": {
"color": "#333",
"selectedColor": "#00b96b",
"backgroundColor": "#fff",
"borderStyle": "white",
"list": [{
"text": "首页",
"pagePath": "pages/index/index",
"iconPath": "/static/images/tabbar/home.png",
"selectedIconPath": "/static/images/tabbar/home_a.png"
},
{
"text": "商品",
"pagePath": "pages/index/cate",
"iconPath": "/static/images/tabbar/cate.png",
"selectedIconPath": "/static/images/tabbar/cate_a.png"
},
{
"text": "发现",
"pagePath": "pages/index/moments",
"iconPath": "/static/images/tabbar/moments.png",
"selectedIconPath": "/static/images/tabbar/moments_a.png"
},
{
"text": "购物车",
"pagePath": "pages/index/cart",
"iconPath": "/static/images/tabbar/cart.png",
"selectedIconPath": "/static/images/tabbar/cart_a.png"
},
{
"text": "我的",
"pagePath": "pages/index/mine",
"iconPath": "/static/images/tabbar/mine.png",
"selectedIconPath": "/static/images/tabbar/mine_a.png"
}
]
},
"uniIdRouter": {}
}
\ No newline at end of file \ No newline at end of file
<template>
<cl-page :back-top="false">
<NavBar title="" :is-show-back="false">
<template #before>
<view class="flex-row">
<cl-text :pt="{className: 'text-black'}" @tap="showToast">购物车</cl-text>
<cl-text size="10px" color="info">(40)</cl-text>
</view>
</template>
<template #after>
<cl-text @tap="isAction = !isAction" :style="{marginRight: wxMenuWidth + 'px'}">{{ isAction ? '完成' : '管理' }}</cl-text>
</template>
</NavBar>
<view class="w-full p-3 pb-[60px]">
<view class="w-full p-3 pb-0 rounded-lg bg-white">
<view class="pb-3" v-for="item in 8" :key="item">
<GoodsItem direction="horizontal" :mb="false"></GoodsItem>
</view>
</view>
<!-- 加载更多 -->
<view class="pt-3">
<cl-loadmore loading></cl-loadmore>
</view>
<!-- 底部操作栏 -->
<FooterFloatBar>
<view class="bg-white py-2 px-3 flex-row items-center justify-between">
<view class="flex-row items-center" @tap="isCheckAll = !isCheckAll">
<view class="radio" :class="{ 'a-radio': isCheckAll }">
<view class="radio-block" v-show="isCheckAll"> </view>
</view>
<cl-text :color="isCheckAll ? 'error': 'info'" value="全选"></cl-text>
</view>
<view class="flex-row items-center">
<cl-text type="amount" currency="¥" :value="12" :precision="2" color="error" :pt="{ className: '!mr-2' }"
v-if="!isAction"></cl-text>
<cl-button type="error" @tap="actions">{{ isAction ? '删除' : '去结算(1)' }}</cl-button>
</view>
</view>
</FooterFloatBar>
</view>
<TabBar current="cart"></TabBar>
</cl-page>
</template>
<script setup lang="uts">
import NavBar from '@/components/NavBar.uvue'
import TabBar from '@/components/TabBar.uvue'
import GoodsItem from '@/components/GoodsItem.uvue'
import FooterFloatBar from '@/components/FooterFloatBar.uvue'
import { useUi } from '@/uni_modules/cool-unix/hooks'
import type { ClConfirmAction } from '@/uni_modules/cool-unix/types'
const ui = useUi()
const token = ref<string | null>(null)
// 是否全选
const isCheckAll = ref(false)
// 是否操作
const isAction = ref(false)
const wxMenuWidth = computed(() => {
let mw = 0
// #ifdef MP-WEIXIN
const { width } = uni.getMenuButtonBoundingClientRect()
mw = width + 12
// #endif
return mw
})
const showToast = () => {
ui.showToast({
message: '编辑功能,开发中...'
})
}
const actions = () => {
// 执行删除操作
if (isAction.value) {
ui.showConfirm({
title: '提示',
message: '是否确认删除所选中的商品?',
callback: (ac : ClConfirmAction) => {
console.log(ac);
if (ac == 'confirm') {
isAction.value = false
}
}
})
return
}
// 携带参数,去结算
}
// 页面显示生命周期函数
onPageShow(() => {
const t = uni.getStorageSync('token') as string
token.value = t
console.log(token.value, 'token');
})
</script>
<style lang="scss">
.radio {
width: 16px;
height: 16px;
border-radius: 10px;
border: 2px solid #71717a;
margin-right: 4px;
position: relative;
&.a-radio {
border-color: #ef4444 !important;
}
.radio-block {
position: absolute;
top: 2px;
left: 2px;
width: 8px;
height: 8px;
border-radius: 4px;
background-color: #ef4444;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<cl-page>
<NavBar :fixed="true"
:is-show-back="false"
title="分类">
<template #before>
<cl-icon name="sousuo_2" @tap="search"></cl-icon>
</template>
</NavBar>
<view class="cate-content flex-row" :style="{height: `${contentH }px`}">
<scroll-view class="cate-box" scroll-y="true">
<view v-for="(item, index) in cateList"
:key="item"
class="cate"
@tap="checkCate(index, item)">
<cl-text :color="index == checkCateInfo.index ? 'primary' : ''" size="14px">
猫和老鼠
</cl-text>
</view>
</scroll-view>
<scroll-view class="goods-box"
scroll-y="true"
@scrolltolower="scrollend">
<view class="p-2">
<GoodsItem v-for="goods in 18"
:key="goods"
:custom-img-width="true"
direction="horizontal">
</GoodsItem>
<cl-loadmore :finish="!loading"
finish-text="点击查看更多"
:loading="loading"
@tap="goPrev">
</cl-loadmore>
</view>
</scroll-view>
</view>
<TabBar current="cate"></TabBar>
</cl-page>
</template>
<script setup lang="uts">
import GoodsItem from "@/components/GoodsItem.uvue";
import NavBar from "@/components/NavBar.uvue";
import TabBar from "@/components/TabBar.uvue";
import { router } from "@/utils/router.uts";
// 内容可用高度
const contentH = computed(() => {
const { statusBarHeight, screenHeight } = uni.getSystemInfoSync();
return screenHeight - statusBarHeight - 94;
});
// 分类列表
const cateList = ref<string[]>([
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12",
"13",
"14",
"15",
"16",
"17",
"18",
"19",
]);
// 商品列表
const goodsList = ref<string[]>([
"https://uni-docs.cool-js.com/demo/pages/demo/static/bg1.png",
"https://uni-docs.cool-js.com/demo/pages/demo/static/bg2.png",
"https://uni-docs.cool-js.com/demo/pages/demo/static/bg3.png",
"https://uni-docs.cool-js.com/demo/pages/demo/static/bg4.png",
"https://uni-docs.cool-js.com/demo/pages/demo/static/bg1.png",
"https://uni-docs.cool-js.com/demo/pages/demo/static/bg2.png",
"https://uni-docs.cool-js.com/demo/pages/demo/static/bg3.png",
"https://uni-docs.cool-js.com/demo/pages/demo/static/bg4.png",
]);
const loading = ref(true);
type CheckCate = {
id : string
index : number
}
const checkCateInfo = ref<CheckCate>({
index: 0,
id: ""
});
// 切换分类
const checkCate = (index : number, id : string) => {
checkCateInfo.value = {
index,
id
} as CheckCate;
};
// 滚动到底部
const scrollend = (e : UniScrollToLowerEvent) => {
setTimeout(() => {
loading.value = false;
}, 2000);
};
// 点击查看下一个分类
const goPrev = () => {
const { index } = checkCateInfo.value;
if (index + 1 >= cateList.value.length) return;
checkCateInfo.value = {
index: index + 1,
id: cateList.value[index + 1]
} as CheckCate;
};
// 搜索
const search = () => {
router.navigateTo("/pages/subHome/search", "");
};
</script>
<style lang="scss">
.cate-content {
padding-bottom: var(--uni-safe-area-inset-bottom);
.cate-box {
width: 80px;
background-color: #fff;
border-right: 1px solid #eee;
.cate {
padding: 5px 10px;
}
}
.goods-box {
flex: 1;
.goods-item {
margin-bottom: 12px;
background-color: #fff;
border-radius: 8px;
}
}
}
</style>
<template>
<view class="home-top-components">
<cl-sticky :offset-top="0">
<view class="search-box" :style="{paddingTop: pt + 'px'}">
<view class="search h-[30px] flex-row rounded-[30px]" :style="{marginRight: wxMenuWidth + 'px'}"
@tap="nav('/pages/subHome/search')">
<cl-icon name="sousuo_2" color="#fff"></cl-icon>
<text class="text-md text-[#fff] ml-2">点击搜索更多商品~</text>
</view>
<cl-tabs v-model="val" :height="60" :list="cateList" color="#f40" unColor="#fff"></cl-tabs>
</view>
</cl-sticky>
<view class="b-bg"></view>
<view class="feature-grid-box flex-row items-start">
<view class="feature-banner-box mr-3">
<swiper class="swiper" :indicator-dots="true" :autoplay="true" :interval="10000" :circular="true"
indicator-active-color="#ffdde1">
<swiper-item class="swiper-item" v-for="item in list" :key="item">
<image :src="item" class="swiper-item-img"></image>
</swiper-item>
</swiper>
</view>
<view class="points-new mb-2">
<view class="points" @tap="nav('/pages/subHome/coupon')">
<image src="/static/images/lq-coupon.png" class="points-img" mode="aspectFill"></image>
</view>
<view class="new-goods mt-2">
<image src="/static/images/new-goods.png" class="new-img" mode="aspectFill"></image>
</view>
</view>
</view>
<view class="p-3">
<view class="h-[40px] flex-row">
<view class="w-[40px] h-[40px] bg-green-500">今</view>
<view class="w-[40px] h-[40px] bg-green-500">日</view>
<view class="w-[40px] h-[40px] bg-green-500">上</view>
<view class="w-[40px] h-[40px] bg-green-500">新</view>
<view class="w-[40px] h-[40px] bg-green-500">啦</view>
<view class="w-[40px] h-[40px] bg-green-500">!</view>
<view class="w-[40px] h-[40px] bg-green-500">!</view>
</view>
</view>
</view>
</template>
<script setup lang="uts">
import { router } from '@/utils/router.uts'
import type { ClTabsItem } from "@/uni_modules/cool-unix";
const pt = computed(() => {
const { statusBarHeight } = uni.getSystemInfoSync()
return statusBarHeight + 8
})
const wxMenuWidth = computed(() => {
let mw = 0
// #ifdef MP-WEIXIN
const { width } = uni.getMenuButtonBoundingClientRect()
mw = width
// #endif
return mw
})
const val = ref("1");
const cateList = ref<ClTabsItem[]>([
{
label: "推荐",
value: "1",
},
{
label: "新品上市",
value: "2",
},
{
label: "今日特价",
value: "3",
},
{
label: "人气榜",
value: "4",
},
{
label: "限时团购",
value: "5",
}
]);
const list = ref<string[]>([
"https://img.alicdn.com/imgextra/i1/O1CN01bPtedB1gyEW70NAko_!!6000000004210-2-tps-750-1000.png",
"https://img.alicdn.com/imgextra/i1/O1CN01fkcCak258M3329VoP_!!6000000007481-2-tps-750-1000.png",
" https://img.alicdn.com/imgextra/i3/O1CN01oj7fpb1yOCRLbaqUj_!!6000000006568-2-tps-750-1000.png",
]);
const nav = (url : string) => {
router.navigateTo(url, '')
}
</script>
<style lang="scss">
.home-top-components {
.search-box {
background: #00b96b;
padding: 10px 12px;
.search {
border: 1px solid #f8f9fa;
padding: 0 12px;
margin: 0 0 10px 0;
align-items: center;
}
}
.b-bg {
width: 100%;
padding: 0 0 100px 0;
border-radius: 0 0 15px 15px;
background-image: linear-gradient(to bottom, #00b96b, #fff);
}
.feature-grid-box {
padding: 0 12px 0px;
transform: translateY(-100px);
margin: 0 0 -100px 0;
.feature-banner-box {
width: 50%;
position: relative;
padding: 0 0 70% 0;
border-radius: 10px;
overflow: hidden;
.swiper {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
.swiper-item,
.swiper-item-img {
width: 100%;
height: 100%;
}
}
}
.points-new {
flex: 1;
height: 100%;
.points,
.new-goods {
flex: 1;
position: relative;
border-radius: 10px;
.points-img,
.new-img {
width: 100%;
height: 100%;
position: absolute;
}
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="mine-user-info">
<!-- 顶部悬浮用户头像 -->
<view class="top-avatar" v-show="isShowTopAvatar">
<view class="top-avatar-content" :style="{paddingTop: statusBar}">
<cl-avatar :src="avatar" size="30px" rounded></cl-avatar>
</view>
</view>
<!-- 用户信息 -->
<view class="user-info">
<cl-avatar :src="avatar" size="80px" rounded></cl-avatar>
<view class="user-desc" v-if="token">
<cl-text size="20px" :pt="{
className: '!mb-1 !font-bold'
}">豆包</cl-text>
<cl-text value="17538875228" type="phone" color="info" mask></cl-text>
</view>
<view class="no-login" @tap="emit('nav', '/pages/login/login')" v-else>
<text class="no-text">暂未登录</text>
</view>
</view>
</view>
<!-- 订单模块 -->
<view class="order-box p-3 rounded-xl mb-3">
<view class="flex-row justify-between items-center pb-[10px]">
<!-- <cl-text size="14px">我的订单</cl-text> -->
<view class="flex-row items-center pb-[10px]">
<image src="/static/images/mine/order.png" mode="widthFix" class="w-[18px] mr-1"></image>
<cl-text size="14px">我的订单</cl-text>
</view>
<view class="flex-row items-center" @tap="emit('nav', '/pages/order/order-list')">
<cl-text color="info" size="10px">全部订单</cl-text>
<cl-icon name="arrow-right-s-line" color="info"></cl-icon>
</view>
</view>
<view class="flex-row border-t">
<view class="flex-1 items-center justify-center" v-for="order in minePageOrderList" :key="order.id">
<image :src="order.image" class="size-8"></image>
<cl-text color="info" size="10px">{{ order.label }}</cl-text>
</view>
</view>
</view>
</template>
<script setup lang="ts">
import { minePageOrderList } from '@/utils/pageStaticList'
const props = defineProps({
isShowTopAvatar: {
type: Boolean,
default: false
}
})
const emit = defineEmits(['nav'])
const token = ref<string | null>(null)
const statusBar = computed(() => uni.getSystemInfoSync().statusBarHeight + 10 + 'px')
const avatar = 'https://ts4.tc.mm.bing.net/th/id/OADD2.8246453610765_186UKUV60SS80KKXFI?w=32&h=32&o=6&cb=ucfimg1&pid=21.2&ucfimg=1'
// 页面显示生命周期
onPageShow(() => {
const t = uni.getStorageSync('token') as string
token.value = t
})
</script>
<style lang="scss">
.mine-user-info {
padding: var(--status-bar-height) 0 70px 0;
background-color: #fff;
border-radius: 0 0 20px 20px;
background-image: linear-gradient(to right, #ffcad3, #febf99);
background-image: url('https://mp-2d57ae4b-9de7-44cc-8ebd-8d537a259d9b.cdn.bspapp.com/static/eastShop/home/background.png');
background-repeat: no-repeat;
background-size: cover;
.top-avatar {
position: fixed;
top: 0;
left: 0;
width: 100%;
background-image: url('https://mp-2d57ae4b-9de7-44cc-8ebd-8d537a259d9b.cdn.bspapp.com/static/eastShop/home/background.png');
z-index: 99;
.top-avatar-content {
justify-content: center;
padding: 10px 12px;
}
}
.user-info {
padding: 50px 12px 10px;
flex-direction: row;
align-items: center;
.user-desc,
.no-login {
margin-left: 12px;
}
.no-login {
padding: 5px 15px;
border: 1px solid #f40;
border-radius: 20px;
.no-text {
color: #f40;
}
}
}
}
.order-box {
background-color: rgba(255, 255, 255, .8);
transform: translateY(-60px);
margin: 0 12px -60px;
.border-t {
border-top: solid 1px #e5e5e5;
padding-top: 12px;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<cl-page :back-top="false">
<HomeTop></HomeTop>
<view class="py-[10px]">
<cl-waterfall v-if="123"
ref="waterfallRef"
:column="2"
:gutter="16">
<template #item>
<GoodsItem direction="vertical"></GoodsItem>
</template>
</cl-waterfall>
<cl-loadmore loading></cl-loadmore>
</view>
<TabBar current="index"></TabBar>
</cl-page>
</template>
<script setup lang="uts">
import GoodsItem from "@/components/GoodsItem.uvue";
// import { ClWaterfallComponentPublicInstance } from '@/uni_modules/cool-unix/cool/types'
import TabBar from "@/components/TabBar.uvue";
import HomeTop from "./components/HomeTop.uvue";
const waterfallRef = ref<ClWaterfallComponentPublicInstance | null>(null);
let id = 0;
function generateMockData() {
return [
{
id: id++,
},
{ id: id++,
},
{
id: id++,
},
{
id: id++,
},
{
id: id++,
},
{
id: id++,
},
{
id: id++,
},
{
id: id++,
},
{
id: id++,
},
{
id: id++,
},
] as UTSJSONObject[];
}
onLoad(() => {});
onMounted(() => {
const items = generateMockData();
waterfallRef.value?.append(items);
});
</script>
<style lang="scss">
</style>
<template>
<cl-page :back-top="false">
<view class="mine-page">
<!-- 用户身份信息/订单 -->
<UserOrOrder :is-show-top-avatar="showTopAvatar" @nav="nav"></UserOrOrder>
<view class="mine-content">
<!-- 我的钱包 -->
<view class="bg-white p-3 rounded-xl mb-3">
<view class="flex-row items-center pb-[10px]">
<image src="/static/images/mine/wallet.png" mode="widthFix" class="w-[18px] mr-1"></image>
<cl-text size="14px">我的钱包</cl-text>
</view>
<view class="flex-row border-t">
<view class="flex-1 items-center justify-center">
<cl-text size="16px">0</cl-text>
<cl-text color="info" size="10px">余额</cl-text>
</view>
<view class="flex-1 items-center justify-center">
<cl-text size="16px">30</cl-text>
<cl-text color="info" size="10px">积分</cl-text>
</view>
<view class="flex-1 items-center justify-center">
<cl-text size="16px">0</cl-text>
<cl-text color="info" size="10px">推荐</cl-text>
</view>
</view>
</view>
<!-- 常用功能 -->
<view class="px-3 py-2 rounded-xl bg-white">
<view class="flex-row items-center pb-[10px] b-b">
<image src="/static/images/mine/utils.png" mode="widthFix" class="w-[18px] mr-1"></image>
<cl-text size="14px">常用工具</cl-text>
</view>
<cl-list>
<cl-list-item :image="item.image" :label="item.label" arrow justify="start" hoverable
v-for="item in minePageUtilsList" :key="item.url" @tap="nav(item.url)">
<view class="flex-1 flex-row justify-end items-start">
<cl-text color="info" size="10px" v-if="item.label == '邀请好友'">3679</cl-text>
</view>
</cl-list-item>
</cl-list>
</view>
<view class="p-4 bg-white mt-5 rounded-xl items-center" @tap="logout()" v-if="token">
<text>退出登录</text>
</view>
</view>
</view>
<TabBar current="mine"></TabBar>
</cl-page>
</template>
<script setup lang="uts">
import NavBar from '@/components/NavBar.uvue'
import TabBar from '@/components/TabBar.uvue'
import UserOrOrder from './components/MineTopUserOrOrder.uvue'
import { router } from '@/utils/router.uts'
import { useUi } from '@/uni_modules/cool-unix/hooks'
import type { ClConfirmAction } from '@/uni_modules/cool-unix/types'
import { minePageUtilsList } from '@/utils/pageStaticList'
const ui = useUi()
const showTopAvatar = ref(false)
const token = ref<string | null>(null)
const nav = (url : string) => {
if (url == '') return ui.showToast({ message: '开发中,敬请期待...' })
router.navigateTo(url, '')
}
// 退出登录
const logout = () => {
ui.showConfirm({
title: '提示',
message: '确定要退出当前账号吗?',
callback: (val : ClConfirmAction) => {
if (val == 'confirm') {
uni.removeStorageSync('token')
token.value = ''
}
}
})
}
// 页面显示生命周期
onPageShow(() => {
const t = uni.getStorageSync('token') as string
token.value = t
console.log(token.value);
})
// 页面滚动生命周期
onPageScroll((e : OnPageScrollOptions) => {
const top = e.scrollTop
if (top > 50) {
showTopAvatar.value = true
} else {
showTopAvatar.value = false
}
})
</script>
<style lang="scss">
.mine-page {
.mine-content {
padding: 10px 12px;
}
.border-t {
border-top: solid 1px #eee;
padding-top: 12px;
}
.b-b {
border-bottom: solid 1px #eee;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<cl-page :back-top="false">
<NavBar :is-show-back="false" title="动态">
<template #before>
<cl-icon name="bubble-chart-line" @tap="nav('/pages/subMoments/my-moments')"></cl-icon>
</template>
</NavBar>
<view class="moments-content">
<cl-list-item v-for="item in 3" :key="item" :pt="{
className: 'mb-3 !rounded-xl overflow-hidden'
}" @tap="nav('/pages/subMoments/moment-detail')">
<view class="w-full">
<view class="user-info">
<image src="https://unix.cool-js.com/images/demo/avatar.jpg" mode="aspectFill"
class="w-10 h-10 rounded-full"></image>
<text class="user-name">这是一个昵称</text>
</view>
<!-- 文字描述 -->
<view class="text-content" v-if="item != 1">
<cl-text class="t-text" :lines="5" ellipsis>
简单模型展示:优先用 vue-3d-model(零学习成本)。
中小型交互场景:选 troisjs(Vue3 原生,组件化友好)。
复杂 3D 场景(如动画、物理、VR):用 Three.js + vue-use-three 或 Babylon.js(灵活性高)。
简单模型展示:优先用 vue-3d-model(零学习成本)。
中小型交互场景:选 troisjs(Vue3 原生,组件化友好)。
复杂 3D 场景(如动画、物理、VR):用 Three.js + vue-use-three 或 Babylon.js(灵活性高)。
</cl-text>
</view>
<!-- 单视频 -->
<view class="single-video" v-if="item == 1">
<video
src="http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400.mp4"
poster="https://unix.cool-js.com/images/demo/avatar.jpg" class="img-video"></video>
</view>
<!-- 单图 -->
<view class="single-img" v-if="item == 2">
<image src="https://unix.cool-js.com/images/demo/avatar.jpg" mode="aspectFill" class="img-video"></image>
</view>
<!-- 多图 -->
<cl-row :gutter="0" :pt="{className: 'w-full'}" v-if="item == 3">
<cl-col :span="8" v-for="img in 7" :key="img">
<view class="img-box">
<image src="https://unix.cool-js.com/images/demo/avatar.jpg" mode="aspectFill" class="img-video"></image>
</view>
</cl-col>
</cl-row>
<view class="action">
<cl-text size="12px" color="#999">2025-11-07 15:15:15</cl-text>
<cl-icon :name="item == 2 ? 'heart-fill' : 'dianzan'" :color="item == 2 ? '#f40' : ''"></cl-icon>
</view>
</view>
</cl-list-item>
</view>
<TabBar current="moments"></TabBar>
</cl-page>
</template>
<script setup lang="uts">
import NavBar from '@/components/NavBar.uvue'
import TabBar from '@/components/TabBar.uvue'
import { useUi } from '@/uni_modules/cool-unix/hooks'
import { router } from '@/utils/router.uts'
const ui = useUi()
const tips = () => {
ui.showToast({
message: '新增动态功能,待发布!'
})
}
const nav = (url: string) =>{
router.navigateTo(url, '')
}
</script>
<style lang="scss">
.moments-content {
padding: 10px 12px;
.user-info {
flex-direction: row;
margin-bottom: 10px;
.user-name {
font-size: 14px;
padding-top: 20px;
margin-left: 12px;
}
}
.text-content {
margin-bottom: 6px;
.t-text {
font-size: 13px;
}
}
.single-video {
width: 100%;
padding-bottom: 57%;
position: relative;
}
.single-img {
width: 60%;
padding-bottom: 100%;
position: relative;
}
.img-box {
width: 100%;
padding-bottom: 100%;
position: relative;
}
.img-video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.action {
margin-top: 10px;
flex-direction: row;
justify-content: space-between;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<cl-page>
<NavBar :title="title"></NavBar>
</cl-page>
<web-view class="wv" src="https://dcloud.io/license/DCloud.html" :bounces="false"></web-view>
</template>
<script setup>
import NavBar from '@/components/NavBar.uvue'
const title = ref('')
type OnLoadOptionsType = {
type?: string
}
onLoad((e : OnLoadOptionsType) => {
const { type } = e
if (type === 'policy') {
title.value = '隐私政策'
} else {
title.value = '用户协议'
}
})
</script>
<style lang="scss">
.wv {
width: 100%;
height: 100%;
padding-bottom: var(--uni-safe-area-inset-bottom);
/* #ifdef MP-WEIXIN */
padding-bottom: constant(safe-area-inset-bottom);
/* #endif */
padding-bottom: env(safe-area-inset-bottom);
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<cl-page :back-top="false">
<view class="login-page">
<image src="/static/login-bg.png" mode="aspectFill" class="login-bg"></image>
<view class="login-content" :style="{paddingTop: statusBarHeight + 'px'}">
<view class="back" @tap="nav('back')">
<cl-icon name="back" size="25px"></cl-icon>
</view>
<view class="logo-box">
<image src="/static/logo.png" class="logo"></image>
<text class="logo-text">LOGO_NAME</text>
</view>
<cl-form ref="formRef" v-model="formData" :rules="rules" :show-asterisk="false">
<cl-form-item label="邮箱" prop="email" required>
<cl-input v-model="formData.email" placeholder="请输入邮箱" clearable :border="false" :pt="{
className: '!h-12'
}"></cl-input>
</cl-form-item>
<cl-form-item label="密码" prop="password" required>
<cl-input v-model="formData.password" placeholder="请输入密码" clearable :border="false" :pt="{
className: '!h-12'
}"></cl-input>
</cl-form-item>
</cl-form>
<view class="action">
<cl-text>记住账号</cl-text>
<cl-text color="info" :pt="{
className: '!ml-auto'
}">忘记密码?</cl-text>
</view>
<cl-button type="primary" :pt="{
className: '!h-11'
}" @tap="submit">登录</cl-button>
<view class="register">
<cl-text color="info">还没有账号?</cl-text>
<cl-text color="primary" @tap="nav('/pages/login/register')">去注册</cl-text>
</view>
</view>
<view class="agreement">
<view class="agreement-content">
<cl-text color="info">我已阅读并同意</cl-text>
<cl-text color="#165DFF" @tap="nav('/pages/login/agreement')">《用户协议》</cl-text>
<cl-text color="info">及</cl-text>
<cl-text color="#165DFF" @tap="nav('/pages/login/agreement')">《隐私政策》</cl-text>
</view>
</view>
</view>
</cl-page>
</template>
<script setup lang="uts">
import { ref, type Ref } from 'vue'
import NavBar from '../../components/NavBar.uvue'
import { useUi, useForm } from '@/uni_modules/cool-unix/hooks'
import type { ClFormRule, ClFormValidateError } from '@/uni_modules/cool-unix/types'
import { router } from '@/utils/router'
const ui = useUi()
const { statusBarHeight } = uni.getSystemInfoSync()
type FormData = {
email : string;
password : string;
};
const { formRef, validate, clearValidate, validateField } = useForm()
const formData = ref<FormData>({
email: '',
password: ''
}) as Ref<FormData>
const rules = new Map<string, ClFormRule[]>([
[
"email",
[
{ required: true, message: "邮箱不能为空" },
{ min: 3, max: 20, message: "邮箱长度在3-20个字符之间" },
],
],
[
"password",
[
{ required: true, message: "密码不能为空" },
{ min: 3, max: 20, message: "密码长度在3-20个字符之间" },
],
]
]);
const nav = (url : string) => {
if (url == 'back') {
router.navigateBack()
} else {
router.navigateTo(url, '')
}
}
// 登录
const submit = () => {
validate((valid : Boolean, error : ClFormValidateError[]) => {
if (valid) {
console.log(valid);
ui.showToast({
message: '登陆成功'
})
// 设置 token
uni.setStorageSync('token', 'qwerasdfzxcv1234')
nav('back')
} else {
console.log(error);
}
})
}
</script>
<style lang="scss">
.login-page {
.login-bg,
.login-content {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.login-content {
z-index: 99;
padding: 10px 32px;
padding-bottom: env(safe-area-inset-bottom);
.back {
width: 50px;
height: 50px;
background-color: #fff;
border-radius: 25px;
align-items: center;
justify-content: center;
margin: 20px 0 40px -20px;
}
.logo-box {
align-items: center;
justify-content: center;
.logo {
width: 70px;
height: 70px;
}
.logo-text {
font-size: 20px;
font-weight: bold;
margin: 10px 0 40px 0;
}
}
.cl-form-item__content {
border-bottom: 1px solid #eee !important;
}
.action,
.register {
flex-direction: row;
padding-bottom: 20px;
}
.register {
margin-top: 12px;
}
}
.agreement {
position: fixed;
left: 0;
bottom: 0;
z-index: 999;
width: 100%;
background-color: #fff;
padding: 6px 12px;
padding-bottom: env(safe-area-inset-bottom);
.agreement-content {
flex-direction: row;
padding-bottom: 6px;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<cl-page :back-top="false">
<view class="login-page">
<image src="/static/login-bg.png" mode="aspectFill" class="login-bg"></image>
<view class="login-content" :style="{paddingTop: statusBarHeight + 'px'}">
<view class="back" @tap="nav('back')">
<cl-icon name="back" size="25px"></cl-icon>
</view>
<view class="logo-box">
<image src="/static/logo.png" class="logo"></image>
<text class="logo-text">LOGO_NAME</text>
</view>
<cl-form ref="formRef" v-model="formData" :rules="rules">
<cl-form-item label="邮箱" prop="email">
<cl-input v-model="formData.email" placeholder="请输入邮箱" clearable :border="false" :pt="{
className: '!h-12'
}"></cl-input>
</cl-form-item>
<cl-form-item label="密码" prop="password">
<cl-input v-model="formData.password" placeholder="请输入密码" clearable :border="false" :pt="{
className: '!h-12'
}">
<template #append>
<SendCode :email="formData.email"></SendCode>
</template>
</cl-input>
</cl-form-item>
</cl-form>
<cl-button type="primary" :pt="{
className: '!h-11'
}" @tap="submit">注册</cl-button>
<view class="register">
<cl-text color="info">已有账号?</cl-text>
<cl-text color="primary" @tap="nav('back')">去登录</cl-text>
</view>
</view>
<view class="agreement">
<view class="agreement-content">
<cl-text color="info">我已阅读并同意</cl-text>
<cl-text color="#165DFF">《用户协议》</cl-text>
<cl-text color="info">及</cl-text>
<cl-text color="#165DFF">《隐私政策》</cl-text>
</view>
</view>
</view>
</cl-page>
</template>
<script setup lang="uts">
import { ref, type Ref } from 'vue'
import NavBar from '@/components/NavBar.uvue'
import SendCode from '@/components/SendCode.uvue'
import { useUi } from '@/uni_modules/cool-unix/hooks'
import { type ClFormRule, useForm, type ClFormValidateError } from '@/uni_modules/cool-unix'
import { router } from '@/utils/router'
const ui = useUi()
const { statusBarHeight } = uni.getSystemInfoSync()
const { formRef, validate, clearValidate } = useForm()
type FormData = {
email : string;
password : string;
};
const formData = ref<FormData>({
email: '',
password: ''
}) as Ref<FormData>
const rules = new Map<string, ClFormRule[]>([
[
"email",
[
{ required: true, message: "邮箱不能为空" },
{ min: 3, max: 20, message: "邮箱长度在3-20个字符之间" },
],
],
[
"password",
[
{ required: true, message: "密码不能为空" },
{ min: 3, max: 20, message: "密码长度在3-20个字符之间" },
],
]
]);
const tips = () => {
ui.showToast({
message: 'tips'
})
}
const submit = () => {
console.log(formRef, 'formRef');
validate((valid : Boolean, error : ClFormValidateError[]) => {
if (valid) {
console.log(valid);
} else {
console.log(error);
}
})
}
const nav = (url : string) => {
if (url == 'back') {
router.navigateBack()
} else {
router.navigateTo(url, '')
}
}
</script>
<style lang="scss">
.login-page {
.login-bg,
.login-content {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.login-content {
z-index: 99;
padding: 10px 32px;
padding-bottom: env(safe-area-inset-bottom);
.back {
width: 50px;
height: 50px;
background-color: #fff;
border-radius: 25px;
align-items: center;
justify-content: center;
margin: 20px 0 40px -20px;
}
.logo-box {
align-items: center;
justify-content: center;
.logo {
width: 70px;
height: 70px;
}
.logo-text {
font-size: 20px;
font-weight: bold;
margin: 10px 0 40px 0;
}
}
.cl-form-item__content {
border-bottom: 1px solid #eee !important;
}
.register {
flex-direction: row;
margin-top: 20px;
}
}
.agreement {
position: fixed;
left: 0;
bottom: 0;
z-index: 999;
width: 100%;
background-color: #fff;
padding: 6px 12px;
padding-bottom: env(safe-area-inset-bottom);
.agreement-content {
flex-direction: row;
padding-bottom: 6px;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<cl-page>
<NavBar title="订单详情"></NavBar>
</cl-page>
</template>
<script setup lang="uts">
import NavBar from '@/components/NavBar.uvue'
</script>
<style>
</style>
<template>
<cl-page>
<NavBar title="订单列表"></NavBar>
<view class="">
<Empty type="order" :is-tips="false">
<view class="w-full items-center">
<cl-button type="primary" @tap="nav('/pages/index/index')">去逛逛</cl-button>
</view>
</Empty>
</view>
</cl-page>
</template>
<script setup lang="uts">
import NavBar from '@/components/NavBar.uvue'
import Empty from '@/components/EmptyOrStatus.uvue'
import { router } from '@/utils/router.uts'
const nav = (url : string) => {
router.switchTab(url, '')
}
</script>
<style>
</style>
\ No newline at end of file \ No newline at end of file
<template>
<cl-page>
<NavBar title="支付成功"></NavBar>
<view class="">
<StatusComp type="pay-success" tips="您已支付成功~">
<view class="w-full flex-row justify-center items-center pt-3">
<cl-button type="light" @tap="back">返回</cl-button>
<cl-button type="error" @tap="nav('/pages/order/order-detail')">查看订单</cl-button>
</view>
</StatusComp>
</view>
</cl-page>
</template>
<script setup lang="uts">
import { router } from '@/utils/router.uts'
import NavBar from '@/components/NavBar.uvue'
import StatusComp from '@/components/EmptyOrStatus.uvue'
const back = () => {
router.navigateBack(2)
}
const nav = (url : string) => {
router.navigateTo(url, '')
}
</script>
<style>
</style>
\ No newline at end of file \ No newline at end of file
<template>
<cl-page>
<NavBar title="订单确认"></NavBar>
<view class="pb-[60px]">
</view>
<FooterBar :placeholder="false">
<view class="h-[50px] bg-white px-3 flex-row items-center justify-between">
<view class="flex-row items-center">
<text class="text-sm text-[#999]">合计:</text>
<cl-text :value="12" type="amount" color="#f40" size="16px" :pt="{className: '!font-bold'}"></cl-text>
</view>
<cl-button type="error" @tap="submit">立即支付</cl-button>
</view>
</FooterBar>
<PaymentPopup :ref="refs.set('paymentRef')" @pay="paySuccess"></PaymentPopup>
</cl-page>
</template>
<script setup lang="uts">
import NavBar from '@/components/NavBar.uvue'
import FooterBar from '@/components/FooterFloatBar.uvue'
import PaymentPopup from '@/components/PaymentPopup.uvue'
import { router } from '@/utils/router.uts'
import { useRefs } from '@/uni_modules/cool-unix/cool'
const refs = useRefs()
const submit = () => {
refs.callMethod('paymentRef', 'open')
}
const paySuccess = () => {
router.redirectTo('/pages/order/payment-status', '')
}
</script>
<style lang="scss">
</style>
\ No newline at end of file \ No newline at end of file
<template>
<cl-popup v-model="visible" :title="title">
<scroll-view class="p-4 h-[400px]">
<cl-text>
春江花月夜,花草复青青。
江水流不尽,月光照无情。
夜来风雨急,愁思满心头。
何时再相见,共赏月明楼。
</cl-text>
<cl-text>
春江花月夜,花草复青青。
江水流不尽,月光照无情。
夜来风雨急,愁思满心头。
何时再相见,共赏月明楼。
</cl-text>
<cl-text>
春江花月夜,花草复青青。
江水流不尽,月光照无情。
夜来风雨急,愁思满心头。
何时再相见,共赏月明楼。
</cl-text>
<cl-text>
春江花月夜,花草复青青。
江水流不尽,月光照无情。
夜来风雨急,愁思满心头。
何时再相见,共赏月明楼。
</cl-text>
<cl-text>
春江花月夜,花草复青青。
江水流不尽,月光照无情。
夜来风雨急,愁思满心头。
何时再相见,共赏月明楼。
</cl-text>
<cl-text>
春江花月夜,花草复青青。
江水流不尽,月光照无情。
夜来风雨急,愁思满心头。
何时再相见,共赏月明楼。
</cl-text>
</scroll-view>
</cl-popup>
</template>
<script lang="uts" setup>
const props = defineProps([ "title" ]);
const visible = ref(false);
const open = () => {
visible.value = true;
};
const close = () => {
visible.value = false;
};
defineExpose({
open,
close
});
</script>
<template>
<cl-page :back-top="false">
<NavBar title="领券中心"></NavBar>
<view class="coupon-list">
<view class="coupon w-full flex-row p-[10px] bg-white rounded-lg">
<view class="coupon-left">
<view class="price-box items-center justify-center">
<view class="flex-row items-end">
<cl-text currency=""
:precision="2"
:pt="{className: '!font-bold !text-[16px] !leading-[16px] !text-[#f40]'}"
type="amount"
:value="120">
</cl-text>
<cl-text :pt="{className: '!font-bold !text-[#f40] !leading-[8px] !text-[8px]'}">
元
</cl-text>
</view>
<cl-text :pt="{className: '!text-[#999] !text-[10px]'}">
满1000元可用
</cl-text>
</view>
</view>
<view class="coupon-right">
<view class="coupon-info flex-row items-center p-2">
<view class="flex-1 h-full mr-3 justify-between">
<cl-text ellipsis :pt="{className: '!font-bold !text-[16px]'}">
云想衣裳花想容
</cl-text>
<cl-text ellipsis
:lines="2"
:pt="{className: '!text-[#999] !text-[10px] !leading-[12px]'}">
云想衣裳花想容,春风拂槛露华浓。若非群玉山头见,会向瑶台月下逢。天阶夜色凉如水,卧看牵牛织女星。人生若只如初见,何事秋风悲画扇。山有木兮木有枝,心悦君兮君不知。
</cl-text>
<view class="flex-row items-center justify-between">
<cl-text :pt="{className: '!text-[#f40] !text-[10px]'}">
过期时间:2025-12-31
</cl-text>
<view class="flex-row items-center">
<cl-text :pt="{className: '!text-[#999] !text-[10px] !leading-[10px]'}" @tap="previewRules">
规则
</cl-text>
<cl-icon color="#999"
name="arrow-right-s-line"
size="10px">
</cl-icon>
</view>
</view>
</view>
<view class="get-coupon items-center justify-center">
<text class="text-white font-bold text-[16px]">领取</text>
</view>
</view>
</view>
</view>
</view>
<CouponRules :ref="refs.set('couponRullesRef')" title="云想衣裳花想容"></CouponRules>
</cl-page>
</template>
<script setup lang="uts">
import NavBar from "@/components/NavBar.uvue";
import { useRefs } from "@/uni_modules/cool-unix/cool";
import CouponRules from "./components/CouponRules.uvue";
const refs = useRefs();
const previewRules = () => {
refs.callMethod("couponRullesRef", "open");
};
</script>
<style lang="scss">
.coupon-list {
padding: 10px 12px;
.coupon-left,
.coupon-right {
width: 25%;
position: relative;
border-radius: 8px;
padding-bottom: 25%;
background-color: #fcefee;
.price-box,
.coupon-info {
position: absolute;
width: 100%;
height: 100%;
.get-coupon {
width: 50px;
height: 50px;
border-radius: 25px;
background-color: #f40;
}
}
}
.coupon-right {
flex: 1;
border-left: 1px dashed #fff;
}
}
</style>
<template>
<cl-page :back-top="false">
<!-- 顶部按钮 + 搜索框 -->
<view class="btn-search fixed top-0 left-0 w-full z-[999]"
:class="{'bg-white': scrollTop > 200, 'border-b': scrollTop > 200}"
:style="{paddingTop: pt}">
<view class="w-full flex-row items-center search-box">
<view class="w-[30px] h-[30px] items-center justify-center back-btn rounded-full mr-3" @tap="back">
<cl-icon color="#999"
name="arrow-left-s-line"
size="25px">
</cl-icon>
</view>
<view v-show="scrollTop > 200"
class="search flex-1 h-[30px] flex-row rounded-[30px]"
:style="{marginRight: `${wxMenuWidth }px`}"
@tap="nav('/pages/subHome/search')">
<cl-icon color="#999" name="sousuo_2"></cl-icon>
<text class="text-md text-[#999] ml-2">点击搜索更多商品~</text>
</view>
</view>
</view>
<!-- 轮播图 -->
<view class="banner-box">
<ImageVideoSwiper :list="list"
:poster="poster"
:video="video">
</ImageVideoSwiper>
</view>
<!-- 商品详情 ↓ -->
<view class="goods-detail">
<view class="bg-white p-3 mb-3">
<!-- 价格-收藏 -->
<view class="flex-row justify-between items-center">
<!-- 价格 -->
<view class="flex-row items-end">
<text class="text-[14px] leading-[14px] text-[#f40]">¥</text>
<cl-text color="#f40"
currency=""
:precision="2"
:pt="{className: '!font-bold !text-[20px] !leading-[20px]'}"
type="amount"
:value="2">
</cl-text>
</view>
<!-- 收藏 -->
<view class="flex-row items-center">
<cl-icon color="#999"
name="heart-fill"
size="20px">
</cl-icon>
<text class="ml-1 text-md text-[#333]">收藏</text>
</view>
</view>
<!-- 商品名称 -->
<view class="py-2">
<cl-text ellipsis
:lines="2"
:pt="{className: '!font-bold !leading-loose'}"
size="20px"
value="一杯很好喝的咖啡">
</cl-text>
<!-- <cl-text :lines="4" ellipsis size="13px" color="#999" :pt="{className: '!leading-loose'}" value="星巴克咖啡公司成立于1971年,是全球较大的咖啡连锁店,其总部坐落美国华盛顿州西雅图市。星巴克旗下零售产品包括30多款咖啡豆、手工制作的浓缩咖啡和多款咖啡冷热饮料、新鲜美味的各式糕点食品以及丰富多样的咖啡机咖啡杯等商品。星巴克在全球范围内已经有近21300间分店遍布北美、南美洲、欧洲、中东及太平洋区v"></cl-text> -->
</view>
<!-- 销量-库存 -->
<view class="flex-row">
<view class="flex-1 flex-row">
<cl-text color="#999">
销量:
</cl-text>
<cl-text>99+</cl-text>
</view>
<view class="flex-1 flex-row">
<cl-text color="#999">
库存:
</cl-text>
<cl-text>3679</cl-text>
</view>
</view>
</view>
<cl-sticky :offset-top="tabsStickyTop">
<cl-tabs v-model="tabSelected"
fill
:list="tabList"
:pt="{className: '!bg-white'}"
@change="tabChange">
</cl-tabs>
</cl-sticky>
<!-- 评价 -->
<view id="review" class="review w-full h-[500px] bg-green-500">
review
</view>
<!-- 详情 -->
<view id="details" class="details w-full h-[600px] bg-red-500">
details
</view>
<!-- 推荐 -->
<view id="recommended" class="recommended w-full h-[500px] bg-yellow-500">
recommended
</view>
<!-- 加载更多 -->
<view class="loadmore-box justify-center">
<view class="pb-[60px]">
<cl-loadmore loading></cl-loadmore>
</view>
</view>
</view>
<!-- 底部操作栏 -->
<FooterBar :placeholder="false">
<view class="bg-white h-[50px] px-3 flex-row justify-between items-center">
<view class="flex-row mr-5">
<view class="items-center">
<image class="w-[20px] h-[20px]" src="/static/images/tabbar/mine.png"></image>
<text class="text-[12px] text-[#333]">客服</text>
</view>
<view class="items-center ml-3">
<image class="w-[20px] h-[20px]" src="/static/images/tabbar/cart.png"></image>
<text class="text-[12px] text-[#333]">购物车</text>
</view>
</view>
<view class="flex-row flex-1">
<cl-button :pt="{className: '!flex-1'}"
size="large"
type="warn"
@tap="addCart">
加入购物车
</cl-button>
<cl-button :pt="{className: '!flex-1'}"
size="large"
type="error"
@tap="nav('/pages/order/submit-order-page')">
立即购买
</cl-button>
</view>
</view>
</FooterBar>
</cl-page>
</template>
<script setup>
import type { ClTabsItem } from "@/uni_modules/cool-unix/types";
import FooterBar from "@/components/FooterFloatBar.uvue";
import ImageVideoSwiper from "@/components/ImageVideoSwiper.uvue";
import { elOffsetTopDistance, isLogin } from "@/utils/index.uts";
import { router } from "@/utils/router.uts";
const video = "http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400.mp4";
const poster = "https://unix.cool-js.com/images/demo/avatar.jpg";
const list = ref<string[]>([
"https://uni-docs.cool-js.com/demo/pages/demo/static/bg1.png",
"https://uni-docs.cool-js.com/demo/pages/demo/static/bg2.png",
"https://uni-docs.cool-js.com/demo/pages/demo/static/bg3.png",
]);
const pt = computed(() => `${uni.getSystemInfoSync().statusBarHeight }px`);
const tabsStickyTop = computed(() => {
const { statusBarHeight } = uni.getSystemInfoSync();
// 为了兼容微信小程序搜索框和胶囊处以同一高度
// #ifndef MP-WEIXIN
return statusBarHeight + 48;
// #endif
// #ifdef MP-WEIXIN
return statusBarHeight + 40;
// #endif
});
const wxMenuWidth = computed(() => {
let mw = 0;
// #ifdef MP-WEIXIN
const { width } = uni.getMenuButtonBoundingClientRect();
mw = width;
// #endif
return mw;
});
const tabSelected = ref(0);
// 距离顶部的位置 arr
const distance = ref<number[]>([]);
const tabList = ref<ClTabsItem[]>([
{
label: "评价",
value: 0
},
{
label: "详情",
value: 1
},
{
label: "推荐",
value: 2
}
]);
const scrollTop = ref<number>(0);
// 评价-详情-推荐 => 切换事件
const tabChange = (e : number) => {
uni.pageScrollTo({
duration: 200,
scrollTop: distance.value[e] + 1 // +1 是为了防止滚动到详情位置时tab还选中于评价项
});
};
const back = () => {
router.navigateBack();
};
const nav = (url : string) => {
router.navigateTo(url, "");
};
// 加入购物车
const addCart = () => {
isLogin().then(() => {
console.log("加入购物车");
});
};
// 页面滚动事件
onPageScroll((e : OnPageScrollOptions) => {
scrollTop.value = e.scrollTop;
if (distance.value[1] <= scrollTop.value && scrollTop.value < distance.value[2]) {
tabSelected.value = 1;
} else if (scrollTop.value >= distance.value[2]) {
tabSelected.value = 2;
} else {
tabSelected.value = 0;
}
});
const getGoodsDetail = () => {
setTimeout(() => {
Promise.all([ elOffsetTopDistance("review"), elOffsetTopDistance("details"), elOffsetTopDistance("recommended") ]).then((res : number[]) => {
distance.value = res;
});
}, 500);
};
onMounted(() => {
getGoodsDetail();
});
</script>
<style lang="scss">
.btn-search {
padding: 10px 12px;
.search-box {
/* #ifndef MP-WEIXIN */
padding-top: 8px;
/* #endif */
}
.back-btn {
background-color: rgba(255, 255, 255, .5);
}
.search {
border: 1px solid #f8f9fa;
padding: 0 12px;
align-items: center;
// justify-content: center;
}
}
.border-b {
border-bottom: 1px solid #f8f8f8;
}
.banner-box {
width: 100%;
padding-bottom: 110%;
}
.loadmore-box {
padding: 12px 0 var(--uni-safe-area-inset-bottom) 0;
}
</style>
<template>
<cl-page>
<cl-topbar fixed safe-area-top background-color="#FFF" back-icon="arrow-left-s-line">
<view class="w-full pl-[42px]" :style="{paddingRight: pr}">
<cl-input :pt="{className: '!w-full !rounded-[20px]'}" placeholder="发现更多~">
<template #append>
<cl-button type="primary" size="small" icon="search-line"></cl-button>
</template>
</cl-input>
</view>
</cl-topbar>
</cl-page>
</template>
<script setup lang="uts">
const pr = computed(() => {
let w = 0
// #ifdef MP-WEIXIN
const { width } = uni.getMenuButtonBoundingClientRect()
w = width + 5
// #endif
return (w + 12) + 'px'
})
</script>
<style lang="scss">
</style>
\ No newline at end of file \ No newline at end of file
<template>
<cl-page>
<NavBar title="关于我们"></NavBar>
<view class="p-3">
<view class="logo-version">
<image class="logo" src="/static/logo.png"></image>
<view class="flex-row mt-2">
<cl-text value="当前版本"></cl-text>
<cl-text :value="appVersion"></cl-text>
</view>
</view>
<view class="about-desc">
<cl-text value="关于我们的详细介绍"></cl-text>
</view>
</view>
</cl-page>
</template>
<script lang="uts" setup>
import NavBar from "@/components/NavBar.uvue";
const { appVersion } = uni.getSystemInfoSync();
</script>
<style lang="scss">
.logo-version {
padding: 30px 12px;
align-items: center;
justify-content: center;
border-radius: 8px;
background-color: rgba(255, 255, 255, .5);
.logo {
width: 80px;
height: 80px;
border-radius: 8px;
box-shadow: 1px gray;
}
}
.about-desc {
margin-top: 12px;
padding: 10px 12px;
border-radius: 8px;
background-color: rgba(255, 255, 255, .5);
}
</style>
<template>
<cl-page :back-top="false">
<NavBar title="账号与安全"></NavBar>
</cl-page>
</template>
<script setup>
import NavBar from '@/components/NavBar.uvue'
</script>
<style lang="scss">
</style>
\ No newline at end of file \ No newline at end of file
<template>
<cl-page>
<NavBar title="联系我们"></NavBar>
<view class="contact-content p-3">
<view class="logo-version">
<image class="logo" src="/static/logo.png"></image>
<view class="flex-row mt-2">
<cl-text value="当前版本"></cl-text>
<cl-text :value="appVersion"></cl-text>
</view>
</view>
</view>
</cl-page>
</template>
<script lang="uts" setup>
import NavBar from "@/components/NavBar.uvue";
const { appVersion } = uni.getSystemInfoSync();
</script>
<style lang="scss">
.logo-version {
align-items: center;
justify-content: center;
padding: 30px 12px;
background-color: rgb(255 255 255 / 50%);
border-radius: 8px;
.logo {
width: 80px;
height: 80px;
border-radius: 8px;
box-shadow: 1px gray;
}
}
</style>
<template>
<cl-page>
<NavBar title="设置"></NavBar>
<view class="setting">
<view class="px-3 py-2 rounded-xl bg-white">
<cl-list>
<cl-list-item v-for="item in settingsPageUtilsList"
:key="item.url"
:arrow="item.type === 'link'"
hoverable
justify="start"
:label="item.label"
@tap="nav(item)">
<view class="flex-1 flex-row justify-end">
<cl-text v-if="item.type === 'num'"
color="info"
size="12px">
v{{ version }}
</cl-text>
</view>
</cl-list-item>
</cl-list>
</view>
<view class="p-4 bg-white mt-5 rounded-xl items-center" @tap="logout">
<text class="text-md text-[#3f3f46]">注销账号</text>
</view>
</view>
</cl-page>
</template>
<script setup>
import type { ClConfirmAction } from "@/uni_modules/cool-unix/types";
import NavBar from "@/components/NavBar.uvue";
import { useUi } from "@/uni_modules/cool-unix/hooks";
import { settingsPageUtilsList } from "@/utils/pageStaticList";
import { router } from "@/utils/router.uts";
const ui = useUi();
// 当前版本
const version = computed(() => uni.getSystemInfoSync().appVersion);
const nav = (item : { type : string, url : string }) => {
if (item.type != "link") return;
if (item.url == "") return ui.showToast({ message: "开发中,敬请期待..." });
router.navigateTo(item.url, "");
};
const logout = () => {
ui.showConfirm({
title: "确认注销账号?",
message: "注销后,个人资料、历史记录、权益等相关信息将永久删除,无法恢复!此操作不可逆,请谨慎操作~",
confirmText: "确认(不可逆)",
callback: (val : ClConfirmAction) => {
if (val == "confirm") {
uni.removeStorageSync("token");
}
}
});
};
</script>
<style lang="scss">
.setting {
padding: 10px 12px;
}
</style>
<template>
<cl-page :back-top="false">
<NavBar title="个人中心"></NavBar>
</cl-page>
</template>
<script setup>
import NavBar from "@/components/NavBar.uvue";
</script>
<style lang="scss">
</style>
<template>
<cl-page :back-top="false">
<NavBar title="动态详情"></NavBar>
</cl-page>
</template>
<script setup lang="uts">
import NavBar from '@/components/NavBar.uvue'
</script>
<style>
</style>
<template>
<cl-page :back-top="false">
<NavBar title="我的动态">
<template #after>
<cl-text color="#666" size="12px" @tap="relaseMoments">去发布</cl-text>
</template>
</NavBar>
<view class="w-full">
<view class="banner-box">
<image src="https://uni-docs.cool-js.com/demo/pages/demo/static/bg2.png" mode="aspectFill"
class="w-full h-full absolute top-0 left-0"></image>
</view>
</view>
</cl-page>
</template>
<script setup lang="uts">
import NavBar from '@/components/NavBar.uvue'
import { router } from '@/utils/router.uts'
const relaseMoments = () => {
router.navigateTo('/pages/subMoments/release-moment', '')
}
</script>
<style lang="scss">
.banner-box {
width: 100%;
padding: 0 0 65% 0;
position: relative;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<cl-page>
<NavBar title="发布动态"></NavBar>
</cl-page>
</template>
<script setup lang="uts">
import NavBar from '@/components/NavBar.uvue'
</script>
<style>
</style>
\ No newline at end of file \ No newline at end of file
// 参考链接 https://doc.dcloud.net.cn/uni-app-x/tutorial/ls-plugin.html#setting
{
"targets": [
"APP-ANDROID"
]
}
\ No newline at end of file \ No newline at end of file
import type { Config } from "tailwindcss";
import { join } from "node:path";
// 自动推导所有主色和表面色的类型
type primaryColor =
| "amber"
| "blue"
| "cyan"
| "emerald"
| "fuchsia"
| "green"
| "indigo"
| "lime"
| "orange"
| "pink"
| "purple"
| "sky"
| "teal"
| "violet"
| "yellow";
type surfaceColor = "gray" | "neutral" | "ocean" | "slate" | "soho" | "stone" | "viva" | "zinc";
/**
* 主题主色调色板
*/
export const PRIMARY_COLOR_PALETTES = [
{
name: "emerald",
palette: {
50: "#ecfdf5",
100: "#d1fae5",
200: "#a7f3d0",
300: "#6ee7b7",
400: "#34d399",
500: "#10b981",
600: "#059669",
700: "#047857",
800: "#065f46",
900: "#064e3b",
950: "#022c22"
}
},
{
name: "green",
palette: {
50: "#f0fdf4",
100: "#dcfce7",
200: "#bbf7d0",
300: "#86efac",
400: "#4ade80",
500: "#22c55e",
600: "#16a34a",
700: "#15803d",
800: "#166534",
900: "#14532d",
950: "#052e16"
}
},
{
name: "lime",
palette: {
50: "#f7fee7",
100: "#ecfccb",
200: "#d9f99d",
300: "#bef264",
400: "#a3e635",
500: "#84cc16",
600: "#65a30d",
700: "#4d7c0f",
800: "#3f6212",
900: "#365314",
950: "#1a2e05"
}
},
{
name: "orange",
palette: {
50: "#fff7ed",
100: "#ffedd5",
200: "#fed7aa",
300: "#fdba74",
400: "#fb923c",
500: "#f97316",
600: "#ea580c",
700: "#c2410c",
800: "#9a3412",
900: "#7c2d12",
950: "#431407"
}
},
{
name: "amber",
palette: {
50: "#fffbeb",
100: "#fef3c7",
200: "#fde68a",
300: "#fcd34d",
400: "#fbbf24",
500: "#f59e0b",
600: "#d97706",
700: "#b45309",
800: "#92400e",
900: "#78350f",
950: "#451a03"
}
},
{
name: "yellow",
palette: {
50: "#fefce8",
100: "#fef9c3",
200: "#fef08a",
300: "#fde047",
400: "#facc15",
500: "#eab308",
600: "#ca8a04",
700: "#a16207",
800: "#854d0e",
900: "#713f12",
950: "#422006"
}
},
{
name: "teal",
palette: {
50: "#f0fdfa",
100: "#ccfbf1",
200: "#99f6e4",
300: "#5eead4",
400: "#2dd4bf",
500: "#00b96b",
600: "#009659",
700: "#0f766e",
800: "#115e59",
900: "#134e4a",
950: "#042f2e"
}
},
{
name: "cyan",
palette: {
50: "#ecfeff",
100: "#cffafe",
200: "#a5f3fc",
300: "#67e8f9",
400: "#22d3ee",
500: "#06b6d4",
600: "#0891b2",
700: "#0e7490",
800: "#155e75",
900: "#164e63",
950: "#083344"
}
},
{
name: "sky",
palette: {
50: "#f0f9ff",
100: "#e0f2fe",
200: "#bae6fd",
300: "#7dd3fc",
400: "#38bdf8",
500: "#0ea5e9",
600: "#0284c7",
700: "#0369a1",
800: "#075985",
900: "#0c4a6e",
950: "#082f49"
}
},
{
name: "blue",
palette: {
50: "#eff6ff",
100: "#dbeafe",
200: "#bfdbfe",
300: "#93c5fd",
400: "#60a5fa",
500: "#3b82f6",
600: "#2563eb",
700: "#1d4ed8",
800: "#1e40af",
900: "#1e3a8a",
950: "#172554"
}
},
{
name: "indigo",
palette: {
50: "#eef2ff",
100: "#e0e7ff",
200: "#c7d2fe",
300: "#a5b4fc",
400: "#818cf8",
500: "#6366f1",
600: "#4f46e5",
700: "#4338ca",
800: "#3730a3",
900: "#312e81",
950: "#1e1b4b"
}
},
{
name: "violet",
palette: {
50: "#f5f3ff",
100: "#ede9fe",
200: "#ddd6fe",
300: "#c4b5fd",
400: "#a78bfa",
500: "#8b5cf6",
600: "#7c3aed",
700: "#6d28d9",
800: "#5b21b6",
900: "#4c1d95",
950: "#2e1065"
}
},
{
name: "purple",
palette: {
50: "#faf5ff",
100: "#f3e8ff",
200: "#e9d5ff",
300: "#d8b4fe",
400: "#c084fc",
500: "#a855f7",
600: "#9333ea",
700: "#7e22ce",
800: "#6b21a8",
900: "#581c87",
950: "#3b0764"
}
},
{
name: "fuchsia",
palette: {
50: "#fdf4ff",
100: "#fae8ff",
200: "#f5d0fe",
300: "#f0abfc",
400: "#e879f9",
500: "#d946ef",
600: "#c026d3",
700: "#a21caf",
800: "#86198f",
900: "#701a75",
950: "#4a044e"
}
},
{
name: "pink",
palette: {
50: "#fdf2f8",
100: "#fce7f3",
200: "#fbcfe8",
300: "#f9a8d4",
400: "#f472b6",
500: "#ec4899",
600: "#db2777",
700: "#be185d",
800: "#9d174d",
900: "#831843",
950: "#500724"
}
}
];
/**
* 表面色调色板
*/
export const SURFACE_PALETTES = [
{
name: "slate",
palette: {
0: "#ffffff",
50: "#f8fafc",
100: "#f1f5f9",
200: "#e2e8f0",
300: "#cbd5e1",
400: "#94a3b8",
500: "#64748b",
600: "#475569",
700: "#334155",
800: "#1e293b",
900: "#0f172a",
950: "#020617"
}
},
{
name: "gray",
palette: {
0: "#ffffff",
50: "#f9fafb",
100: "#f3f4f6",
200: "#e5e7eb",
300: "#d1d5db",
400: "#9ca3af",
500: "#6b7280",
600: "#4b5563",
700: "#374151",
800: "#1f2937",
900: "#111827",
950: "#030712"
}
},
{
name: "zinc",
palette: {
0: "#ffffff",
50: "#fafafa",
100: "#f4f4f5",
200: "#e4e4e7",
300: "#d4d4d8",
400: "#a1a1aa",
500: "#71717a",
600: "#52525b",
700: "#3f3f46",
800: "#27272a",
900: "#18181b",
950: "#09090b"
}
},
{
name: "neutral",
palette: {
0: "#ffffff",
50: "#fafafa",
100: "#f5f5f5",
200: "#e5e5e5",
300: "#d4d4d4",
400: "#a3a3a3",
500: "#737373",
600: "#525252",
700: "#404040",
800: "#262626",
900: "#171717",
950: "#0a0a0a"
}
},
{
name: "stone",
palette: {
0: "#ffffff",
50: "#fafaf9",
100: "#f5f5f4",
200: "#e7e5e4",
300: "#d6d3d1",
400: "#a8a29e",
500: "#78716c",
600: "#57534e",
700: "#44403c",
800: "#292524",
900: "#1c1917",
950: "#0c0a09"
}
},
{
name: "soho",
palette: {
0: "#ffffff",
50: "#f4f4f4",
100: "#e8e9e9",
200: "#d2d2d4",
300: "#bbbcbe",
400: "#a5a5a9",
500: "#8e8f93",
600: "#77787d",
700: "#616268",
800: "#4a4b52",
900: "#34343d",
950: "#1d1e27"
}
},
{
name: "viva",
palette: {
0: "#ffffff",
50: "#f3f3f3",
100: "#e7e7e8",
200: "#cfd0d0",
300: "#b7b8b9",
400: "#9fa1a1",
500: "#87898a",
600: "#6e7173",
700: "#565a5b",
800: "#3e4244",
900: "#262b2c",
950: "#0e1315"
}
},
{
name: "ocean",
palette: {
0: "#ffffff",
50: "#fbfcfc",
100: "#F7F9F8",
200: "#EFF3F2",
300: "#DADEDD",
400: "#B1B7B6",
500: "#828787",
600: "#5F7274",
700: "#415B61",
800: "#29444E",
900: "#183240",
950: "#0c1920"
}
}
];
/**
* 获取指定主色调色板
* @param name 主色名称
* @returns 以 primary-开头的色值对象
*/
function getPrimary(name: primaryColor): Record<string, string> {
const color = PRIMARY_COLOR_PALETTES.find((c) => c.name == name);
if (!color) return {};
const result: Record<string, string> = {};
Object.entries(color.palette).forEach(([ key, value ]) => {
result[`primary-${key}`] = value;
});
return result;
}
/**
* 获取指定表面色调色板
* @param name 表面色名称
* @returns 以 surface-开头的色值对象,0为 surface
*/
function getSurface(name: surfaceColor): Record<string, string> {
const color = SURFACE_PALETTES.find((c) => c.name == name);
if (!color) return {};
const result: Record<string, string> = {};
Object.entries(color.palette).forEach(([ key, value ]) => {
result[key == "0" ? "surface" : `surface-${key}`] = value;
});
return result;
}
// 获取项目根目录
const resolve = (dir: string) => join(__dirname, dir);
export default {
content: [ resolve("./**/*.{uvue,vue}"), "!**/node_modules/**", "!**/dist/**" ],
darkMode: "class",
theme: {
extend: {
colors: {
...getPrimary("teal"),
...getSurface("zinc")
},
fontSize: {
md: [ "1rem", "1.5rem" ]
},
scale: {
"80": "0.8"
}
}
},
corePlugins: {
preflight: false
}
} as Config;
{
"light": {
"navBgColor": "#fff",
"bgColor": "#f8f8f8",
"bgColorBottom": "#efefef",
"tabFontColor": "#000000",
"tabSelectedColor": "#00b96b",
"tabBgColor": "#ffffff",
"tabBorderStyle": "black"
},
"dark": {
"navBgColor": "#333333",
"bgColor": "#1f1f1f",
"bgColorBottom": "#1f1f1f",
"tabFontColor": "#ffffff",
"tabSelectedColor": "#51a937",
"tabBgColor": "#292929",
"tabBorderStyle": "white"
}
}
{
"extends": "@vue/tsconfig/tsconfig.json",
"compilerOptions": {
"ignoreDeprecations": "5.0",
"lib": ["esnext", "dom"],
"experimentalDecorators": true,
"paths": {
"@/*": ["./*"],
"$/*": ["./uni_modules/*"]
},
"resolveJsonModule": true,
"types": ["@dcloudio/types", "vue", "./uni_modules/cool-unix/index.d.ts"],
"noImplicitAny": false,
"outDir": "esbuild",
"sourceMap": true,
"esModuleInterop": true,
"verbatimModuleSyntax": true
},
"vueCompilerOptions": {
"extensions": [".vue", ".uvue"]
},
"include": [
"**/*.uts",
"**/*.ts",
"main.ts",
"**/*.uvue",
"**/*.vue",
"App.uvue",
"**/*.d.ts"
],
"exclude": ["node_modules", "dist", "unpackage"]
}
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
$uni-color-primary: #007aff;
$uni-color-success: #4cd964;
$uni-color-warning: #f0ad4e;
$uni-color-error: #dd524d;
/* 文字基本颜色 */
$uni-text-color:#333;//基本色
$uni-text-color-inverse:#fff;//反色
$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
$uni-text-color-placeholder: #808080;
$uni-text-color-disable:#c0c0c0;
/* 背景颜色 */
$uni-bg-color:#fff;
$uni-bg-color-grey:#f8f8f8;
$uni-bg-color-hover:#f1f1f1;//点击状态颜色
$uni-bg-color-mask:rgb(0 0 0 / 40%);//遮罩颜色
/* 边框颜色 */
$uni-border-color:#c8c7cc;
/* 尺寸变量 */
/* 文字尺寸 */
$uni-font-size-sm:12px;
$uni-font-size-base:14px;
$uni-font-size-lg:16px;
/* 图片尺寸 */
$uni-img-size-sm:20px;
$uni-img-size-base:26px;
$uni-img-size-lg:40px;
/* Border Radius */
$uni-border-radius-sm: 2px;
$uni-border-radius-base: 3px;
$uni-border-radius-lg: 6px;
$uni-border-radius-circle: 50%;
/* 水平间距 */
$uni-spacing-row-sm: 5px;
$uni-spacing-row-base: 10px;
$uni-spacing-row-lg: 15px;
/* 垂直间距 */
$uni-spacing-col-sm: 4px;
$uni-spacing-col-base: 8px;
$uni-spacing-col-lg: 12px;
/* 透明度 */
$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
/* 文章场景相关 */
$uni-color-title: #2C405A; // 文章标题颜色
$uni-font-size-title:20px;
$uni-color-subtitle: #555; // 二级标题颜色
$uni-font-size-subtitle:26px;
$uni-color-paragraph: #3F536E; // 文章段落颜色
$uni-font-size-paragraph:15px;
## 8.1.15(2025-10-27)
* [优化]cl-calendar 添加颜色、选中颜色、高度等参数
* [优化]修复脚本 generate-types.js 类型生成错误的问题
## 8.1.14(2025-10-24)
* [功能]1024 节日快乐 🎉🎉🎉
## 8.1.13(2025-10-22)
* [功能]添加 cl-watermark 水印组件,支持颜色,透明度,旋转角度,间距
## 8.1.12(2025-10-20)
* [优化]修复 cl-action-sheet 组件导致原数组值被污染的问题
* [优化]cl-list-item 组件新增 pt.wrapper 参数支持
* [优化]cl-waterfall 组件增加空值判断
## 8.1.11(2025-10-18)
* [优化]cl-topbar 组件添加 backable 控制返回按钮是否可用
* [优化]cl-select 组件添加空选项提示
* [优化]添加 offScroll 方法
* [优化]isPressing 修改为 ref<boolean>
## 8.1.10(2025-10-17)
* [优化]修复 cl-timeline-item 时间线不显示问题
* [优化]添加 帖子详情 模板
* [优化]修复 cl-popup 关闭按钮在小程序端的兼容问题
## 8.1.9(2025-10-16)
* [优化]修复 tailwindcss 插件导致 :deep 失效问题(更新依赖 @cool-vue/vite-plugin@8.2.16)
## 8.1.8(2025-10-14)
* [优化]修复 cl-banner 自动轮播和触摸事件的时序竞争问题
* [优化]修复 HBuilderX 4.8.2版本下 cl-banner 第三张后图片不显示问题
## 8.1.7(2025-10-13)
* [优化]修复 easycom 解析异常的问题,更新依赖 @cool-vue/vite-plugin@8.2.14
* [优化]修复 cool-vibrate 鸿蒙权限文件书写错误问题
## 8.1.6(2025-10-09)
* [优化]修复 cl-cascader 点击过快出现空值的问题
## 8.1.5(2025-09-26)
* [优化]cl-calendar 支持配置 start、end 可选日期
* [优化]cl-calendar-select 添加提示
* [优化]修复 cl-select-date 组件在范围选择模式下首次渲染时内容未显示的问题
## 8.1.4(2025-09-23)
* [优化]router 路由全面升级(特别感谢 ll-huihui 的贡献),新增 beforeEach(to, from, next) 路由守卫钩子,完善登录拦截机制,提升路由安全性与灵活性
* [优化]登录后默认调用 user.get() 获取用户信息
## 8.1.3(2025-09-22)
* [优化]兼容 HBuilder 4.8.1 版本
## 8.1.2(2025-09-19)
* [优化]解决 Illegal '/' in tags. 异常
## 8.1.1(2025-09-18)
* [功能]补充完整组件示例,调整部分细节问题
## 8.1.0(2025-09-18)
* [功能]组件库已独立,如需获取完整项目请前往 GitHub 仓库下载。
* [功能]请按照文档《组件库引入指南.md》进行相关配置。
* [功能]欢迎大家积极反馈在使用过程中遇到的问题,我们将第一时间进行处理和优化
## 8.0.46(2025-09-17)
* [功能]添加 HBuilderX 导入示例项目
## 8.0.45(2025-09-17)
* [优化]解决路由导航路径判断错误问题
## 8.0.44(2025-09-16)
* [优化]优化 usePager 写法
* [优化]解决 cl-input-opt 在小程序兼容问题
* [优化]解决 cl-read-more 动态内容不显示展开问题
* [优化]添加 cl-read-more 动态内容示例
* [优化]添加 cl-text 设置尺寸示例
## 8.0.43(2025-09-15)
* [功能]添加 cl-read-more 查看更多组件
* [优化]cl-text 参数 lines 修改为仅在ellipsis时生效
* [优化]解决图标脚本命名不一致问题
* [优化]支持自定义语言
## 8.0.42(2025-09-13)
* [功能]添加 cl-marquee 跑马灯组件
## 8.0.41(2025-09-12)
* [优化]更新动画、日历文档
* [优化]优化动画库
* [优化]解决图标脚本命名不一致问题
* [优化]cl-countdown 添加 auto 参数
## 8.0.40(2025-09-11)
* [优化]cl-countdown 添加 auto 参数
* [优化]cl-calendar 优化字体大小
* [优化]cl-calendar 支持添加上下文案
* [优化]鸿蒙圆形进度条显示异常问题
## 8.0.39(2025-09-10)
* [功能]添加 cl-calendar cl-calendar-select 日历组件
## 8.0.38(2025-09-09)
* [功能]cl-text 支持多行省略号
## 8.0.37(2025-09-08)
* [功能]添加 animation 动画库,优化组件动画
* [优化]cl-text 组件的字体大小和颜色,在 pt 配置中无需添加 ! 符号
* [优化]cl-list-item 添加 image 参数,添加 slot
## 8.0.36(2025-09-05)
* [优化]解决鸿蒙 svg 渲染问题
## 8.0.35(2025-09-04)
* [优化]解决 ios 端 cl-draggable 拖动异常问题
* [优化]解决 ios 端 cl-cropper 图片不显示问题
* [优化]解决 ios 端 cl-loading 旋转动画异常问题
## 8.0.34(2025-09-03)
* [优化]优化 ios 端样式兼容
* [优化]更新图标库
* [优化]解决 ios 底部自定义栏不显示问题
## 8.0.33(2025-09-02)
* [优化]清理 app 控制台多余警告
## 8.0.32(2025-09-02)
* [优化]优化页面细节,更新组件文档
## 8.0.31(2025-09-01)
* [优化]cl-tree 组件添加 modelValue、multiple 参数
## 8.0.30(2025-09-01)
* [优化]添加 cl-tree 树形组件
## 8.0.29(2025-08-30)
* [优化]优化细节,收集页面模板、组件需求中
## 8.0.28(2025-08-28)
* [功能]添加“收货地址、地址编辑”模板页
## 8.0.27(2025-08-28)
* [功能]添加 cl-slide-verify 滑动验证组件,支持图片转正
## 8.0.26(2025-08-27)
* [优化]弃用 service 请求,重新设计了 request 请求方案。
* [优化]用户信息绑定方式更改为 userInfo
* [优化]更新依赖 @cool-vue/vite-plugin 版本 8.2.9
## 8.0.25(2025-08-27)
* [优化]解决 eps 层级提升问题,更新依赖 @cool-vue/vite-plugin@8.2.8
## 8.0.24(2025-08-26)
* [功能]新增 useWx() 方法,支持微信小程序登录等功能
* [功能]新增微信小程序登录模板,首次登录时提示基本信息的修改
## 8.0.23(2025-08-26)
* [功能]添加 cl-svg 组件、支持 base64、本地文件、svg标签
* [优化]多语言方案已优化,成功解决 APP 端 Method too large 的问题,cool-ui 语言包现已独立分离
* [优化]更新依赖 @cool-vue/ai 版本 1.1.6
* [优化]更新依赖 @cool-vue/vite-plugin 版本 8.2.7
## 8.0.22(2025-08-25)
* [功能]添加“购物车”模板页面
* [优化]解决 cl-tabs 小程序端字体颜色失效问题
## 8.0.21(2025-08-23)
* [优化]优化 cl-qrcode 组件 logo 区域绘制,提升扫码识别率
## 8.0.20(2025-08-22)
* [优化]cl-popup 添加 teleport 和 root-portal 的支持
## 8.0.19(2025-08-22)
* [优化]解决 cl-input-number 首次触发 onChange 的问题
* [优化]解决 cl-select-date 快捷按钮需点击两次的问题
## 8.0.18(2025-08-21)
* [优化]解决 cl-text 参数 size 未生效问题
* [优化]解决小程序上 cl-badge 字体样式失效问题
## 8.0.17(2025-08-21)
* [功能]添加“商品分类”模板页面
## 8.0.16(2025-08-20)
* [功能]持续丰富各类模板页面(如商城、聊天、AI等),以提升二次开发的便捷性与效率
## 8.0.15(2025-08-20)
* [功能]添加 cl-canvas 组件,示例文件:/pages/demo/other/canvas.uvue
* [优化]解决 cl-topbar 参数 pt.className 和 backgroundColor 冲突问题
## 8.0.14(2025-08-19)
* [优化]文档更新,下个版本将支持 useCanvas 方式进行绘制,带来更简便的绘图与导出图片体验。
## 8.0.13(2025-08-18)
* [优化]细节优化,PassThrough 参数编辑器提示优化,:pt="{ className: 'text-[28rpx]' }"
## 8.0.12(2025-08-17)
* [优化]解决 cl-noticebar 等待时间过长显示的问题
## 8.0.11(2025-08-16)
* [优化]解决 tailwindcss 部分兼容问题
## 8.0.10(2025-08-15)
* [功能]cl-form-item 支持配置 rules
* [功能]cl-form 支持配置动态字段校验,如:prop="contacts[0].phone", prop="pca.city"
## 8.0.9(2025-08-14)
* [优化]优化页面细节,更新vite插件
## 8.0.8(2025-08-13)
* [功能]添加全局字号、可动态调整大小
## 8.0.7(2025-08-12)
* [功能]添加纯净版本
* [功能] cl-form 表单验证组件支持滚动到错误位置
* [功能] cl-form 表单内组件支持红框错误提示
* [功能]重新实现 usePage(),支持监听页面滚动及跳转等事件
* [功能] cl-list-view 添加下拉刷新功能
* [功能]添加 usePager() 页面刷新操作
* [功能]添加 cl-back-top 回到顶部组件
* [优化]优化 cl-button cl-loading 组件颜色的控制
* [优化]优化 cl-select-date 组件的选择操作体验(不回到首个)
## 8.0.6(2025-08-10)
* [功能]添加 cl-form、cl-form-item 表单验证组件
* [功能] cl-select-time 支持类型选择
* [修复] cl-select-date 文本无法清空问题
* [优化] useParent 方法支持 useParent<ClFormComponentPublicInstance>('cl-form') 类型定义和目标组件名
## 8.0.5(2025-08-08)
* [功能]添加 cl-cropper 图片裁剪组件
* [修复]cl-popup 内容区域去掉滑动事件
* [修复]locale-set 点击掉帧问题
* [修复]canvasToPng 参数优化,仅需一个 canvasRef
* [[优化]登录页细节调整
## 8.0.4(2025-08-06)
* [功能]cl-slider支持范围选择
* [功能]添加cl-sign签名组件
* [修复]解决多语言切换时部分组件文案不更新
## 8.0.3(2025-07-29)
* [修复]多语言切换时部分组件文本未更新
* [功能]cl-select-date支持范围选择
## 8.0.2(2025-07-26)
* [修复]cl-popup关闭按钮按下体验
* [功能]添加cl-progress-circle圆形进度条
## 8.0.1(2025-07-25)
* [修复]切换多语言tabbar组件无法更新
* [修复]cl-confirm深色字体不显示
* [修复]页面无法注释
## 8.0.0
* 多语言一键翻译
* 深色模式切换
* 全面适配华为鸿蒙生态
* 完美支持小程序开发
* 完美适配 APP 生态系统
This diff could not be displayed because it is too large.
dj-car-life-system @ e37adb1c
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!