feat: 添加积分收集组件并更新项目文档
添加 PointsCollector 积分收集组件,包含动画效果和一键收集功能 更新项目文档,补充项目描述和运行说明
Showing
4 changed files
with
28 additions
and
3 deletions
| 1 | # 项目规则 | 1 | # 项目规则 |
| 2 | -这是一个小程序项目,基于 Taro4 框架,使用 vue 写法编写,组件库使用 NutUI4,图标库使用 @nutui/icons-vue-taro。 | 2 | +# 项目名称 |
| 3 | + 老来赛 Taro小程序项目, 是一个和老人一起使用的记录步数的小程序, 可以分享海报, 并且可以通过步数兑换商品. | ||
| 4 | + | ||
| 5 | + | ||
| 6 | +## 代码参考 | ||
| 7 | +1. 参考代码是react编写, 目录在.resource文件夹里面 | ||
| 3 | 8 | ||
| 4 | ## 项目依赖 | 9 | ## 项目依赖 |
| 5 | 1. 项目基于 Taro4, 文档参考: https://docs.taro.zone/docs/. | 10 | 1. 项目基于 Taro4, 文档参考: https://docs.taro.zone/docs/. |
| ... | @@ -7,6 +12,11 @@ | ... | @@ -7,6 +12,11 @@ |
| 7 | 3. 项目中使用 NutUI4 组件库. | 12 | 3. 项目中使用 NutUI4 组件库. |
| 8 | 4. 项目中使用 @nutui/icons-vue-taro 图标库, 如果遇到 lucide-react 引用, 替换成相应的icons-vue-taro图标. | 13 | 4. 项目中使用 @nutui/icons-vue-taro 图标库, 如果遇到 lucide-react 引用, 替换成相应的icons-vue-taro图标. |
| 9 | 5. CSS部分使用 Tailwindcss. | 14 | 5. CSS部分使用 Tailwindcss. |
| 15 | +6. 项目使用css尺寸 rpx | ||
| 16 | +7. 项目技术参考在resource/doc文件夹里面, 有关于API使用和组件使用的说明 | ||
| 17 | + | ||
| 18 | +## 项目运行测试 | ||
| 19 | +╰─ npm run dev:weapp 只测试微信小程序 | ||
| 10 | 20 | ||
| 11 | ## 功能清单 | 21 | ## 功能清单 |
| 12 | | 序号 | 模块 | 功能 | | | 22 | | 序号 | 模块 | 功能 | | | ... | ... |
| ... | @@ -11,6 +11,7 @@ declare module 'vue' { | ... | @@ -11,6 +11,7 @@ declare module 'vue' { |
| 11 | NutButton: typeof import('@nutui/nutui-taro')['Button'] | 11 | NutButton: typeof import('@nutui/nutui-taro')['Button'] |
| 12 | NutToast: typeof import('@nutui/nutui-taro')['Toast'] | 12 | NutToast: typeof import('@nutui/nutui-taro')['Toast'] |
| 13 | Picker: typeof import('./src/components/time-picker-data/picker.vue')['default'] | 13 | Picker: typeof import('./src/components/time-picker-data/picker.vue')['default'] |
| 14 | + PointsCollector: typeof import('./src/components/PointsCollector.vue')['default'] | ||
| 14 | PosterBuilder: typeof import('./src/components/PosterBuilder/index.vue')['default'] | 15 | PosterBuilder: typeof import('./src/components/PosterBuilder/index.vue')['default'] |
| 15 | RouterLink: typeof import('vue-router')['RouterLink'] | 16 | RouterLink: typeof import('vue-router')['RouterLink'] |
| 16 | RouterView: typeof import('vue-router')['RouterView'] | 17 | RouterView: typeof import('vue-router')['RouterView'] | ... | ... |
src/components/PointsCollector.vue
0 → 100644
This diff is collapsed. Click to expand it.
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2025-06-28 10:33:00 | 2 | * @Date: 2025-06-28 10:33:00 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-07-01 11:13:13 | 4 | + * @LastEditTime: 2025-08-27 15:22:35 |
| 5 | * @FilePath: /lls_program/src/pages/index/index.vue | 5 | * @FilePath: /lls_program/src/pages/index/index.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| 8 | <template> | 8 | <template> |
| 9 | <view class="index"> | 9 | <view class="index"> |
| 10 | <nut-button type="primary" @click="onClick">按钮</nut-button> | 10 | <nut-button type="primary" @click="onClick">按钮</nut-button> |
| 11 | + <nut-button type="success" @click="showPointsCollector" style="margin-left: 20rpx;">积分收集</nut-button> | ||
| 11 | <nut-toast v-model:visible="show" msg="你成功了" /> | 12 | <nut-toast v-model:visible="show" msg="你成功了" /> |
| 12 | - <View className="text-[#acc855] text-[100px]">Hello world!</View> | 13 | + <!-- <View className="text-[#acc855] text-[100px]">Hello world!</View> --> |
| 14 | + | ||
| 15 | + <!-- 积分收集组件 --> | ||
| 16 | + <PointsCollector v-if="showCollector" /> | ||
| 13 | </view> | 17 | </view> |
| 14 | </template> | 18 | </template> |
| 15 | 19 | ||
| ... | @@ -18,13 +22,23 @@ import Taro from '@tarojs/taro' | ... | @@ -18,13 +22,23 @@ import Taro from '@tarojs/taro' |
| 18 | import '@tarojs/taro/html.css' | 22 | import '@tarojs/taro/html.css' |
| 19 | import { ref, onMounted } from 'vue' | 23 | import { ref, onMounted } from 'vue' |
| 20 | import { useDidShow, useReady } from '@tarojs/taro' | 24 | import { useDidShow, useReady } from '@tarojs/taro' |
| 25 | +import PointsCollector from '@/components/PointsCollector.vue' | ||
| 21 | import "./index.less"; | 26 | import "./index.less"; |
| 22 | 27 | ||
| 23 | const show = ref(false) | 28 | const show = ref(false) |
| 29 | +const showCollector = ref(false) | ||
| 30 | + | ||
| 24 | const onClick = () => { | 31 | const onClick = () => { |
| 25 | show.value = true | 32 | show.value = true |
| 26 | } | 33 | } |
| 27 | 34 | ||
| 35 | +/** | ||
| 36 | + * 显示积分收集组件 | ||
| 37 | + */ | ||
| 38 | +const showPointsCollector = () => { | ||
| 39 | + showCollector.value = !showCollector.value | ||
| 40 | +} | ||
| 41 | + | ||
| 28 | // 生命周期钩子 | 42 | // 生命周期钩子 |
| 29 | useDidShow(() => { | 43 | useDidShow(() => { |
| 30 | console.warn('index onShow') | 44 | console.warn('index onShow') | ... | ... |
-
Please register or login to post a comment