feat: 添加多个页面组件和功能实现
refactor: 重构PointsCollector组件样式和逻辑 style: 更新样式文件和组件布局 docs: 添加组件注释和文档说明 chore: 删除无用图片资源和更新配置文件
Showing
61 changed files
with
2212 additions
and
83 deletions
| ... | @@ -7,13 +7,16 @@ export {} | ... | @@ -7,13 +7,16 @@ export {} |
| 7 | 7 | ||
| 8 | declare module 'vue' { | 8 | declare module 'vue' { |
| 9 | export interface GlobalComponents { | 9 | export interface GlobalComponents { |
| 10 | + AppHeader: typeof import('./src/components/AppHeader.vue')['default'] | ||
| 11 | + BottomNav: typeof import('./src/components/BottomNav.vue')['default'] | ||
| 12 | + GlassCard: typeof import('./src/components/GlassCard.vue')['default'] | ||
| 10 | NavBar: typeof import('./src/components/navBar.vue')['default'] | 13 | NavBar: typeof import('./src/components/navBar.vue')['default'] |
| 11 | - NutButton: typeof import('@nutui/nutui-taro')['Button'] | ||
| 12 | - NutToast: typeof import('@nutui/nutui-taro')['Toast'] | ||
| 13 | Picker: typeof import('./src/components/time-picker-data/picker.vue')['default'] | 14 | Picker: typeof import('./src/components/time-picker-data/picker.vue')['default'] |
| 14 | PointsCollector: typeof import('./src/components/PointsCollector.vue')['default'] | 15 | PointsCollector: typeof import('./src/components/PointsCollector.vue')['default'] |
| 15 | PosterBuilder: typeof import('./src/components/PosterBuilder/index.vue')['default'] | 16 | PosterBuilder: typeof import('./src/components/PosterBuilder/index.vue')['default'] |
| 17 | + PrimaryButton: typeof import('./src/components/PrimaryButton.vue')['default'] | ||
| 16 | RouterLink: typeof import('vue-router')['RouterLink'] | 18 | RouterLink: typeof import('vue-router')['RouterLink'] |
| 17 | RouterView: typeof import('vue-router')['RouterView'] | 19 | RouterView: typeof import('vue-router')['RouterView'] |
| 20 | + TabBar: typeof import('./src/components/TabBar.vue')['default'] | ||
| 18 | } | 21 | } |
| 19 | } | 22 | } | ... | ... |
| 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-08-27 13:19:11 | 4 | + * @LastEditTime: 2025-08-27 18:00:05 |
| 5 | * @FilePath: /lls_program/src/app.config.js | 5 | * @FilePath: /lls_program/src/app.config.js |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | */ | 7 | */ |
| 8 | export default { | 8 | export default { |
| 9 | pages: [ | 9 | pages: [ |
| 10 | - 'pages/index/index', | 10 | + // 'pages/index/index', |
| 11 | - 'pages/auth/index', | 11 | + // 'pages/auth/index', |
| 12 | - ], | 12 | + 'pages/Welcome/index', |
| 13 | - subpackages: [ // 配置在tabBar中的页面不能分包写到subpackages中去 | 13 | + 'pages/CreateFamily/index', |
| 14 | - { | 14 | + 'pages/JoinFamily/index', |
| 15 | - root: 'pages/demo', | 15 | + 'pages/Dashboard/index', |
| 16 | - pages: ['index'], | 16 | + 'pages/Activities/index', |
| 17 | - }, | 17 | + 'pages/RewardCategories/index', |
| 18 | + 'pages/Rewards/index', | ||
| 19 | + 'pages/Profile/index', | ||
| 20 | + 'pages/Feedback/index', | ||
| 21 | + 'pages/PointsDetail/index', | ||
| 22 | + 'pages/RewardDetail/index', | ||
| 23 | + 'pages/PrivacyPolicy/index', | ||
| 24 | + 'pages/UserAgreement/index', | ||
| 18 | ], | 25 | ], |
| 19 | window: { | 26 | window: { |
| 20 | backgroundTextStyle: 'light', | 27 | backgroundTextStyle: 'light', | ... | ... |
1.36 KB
1.27 KB
1.62 KB
1.49 KB
990 Bytes
910 Bytes
1.25 KB
1.17 KB
src/assets/images/welcome_home.png
0 → 100644
162 KB
src/components/AppHeader.vue
0 → 100644
| 1 | +<!-- | ||
| 2 | + * @Date: 2025-08-27 17:45:12 | ||
| 3 | + * @LastEditors: hookehuyr hookehuyr@gmail.com | ||
| 4 | + * @LastEditTime: 2025-08-27 18:05:42 | ||
| 5 | + * @FilePath: /lls_program/src/components/AppHeader.vue | ||
| 6 | + * @Description: 文件描述 | ||
| 7 | +--> | ||
| 8 | +<template> | ||
| 9 | + <view class="relative px-4 py-5 flex items-center justify-center bg-white bg-opacity-70 backdrop-blur-md border-b border-gray-100"> | ||
| 10 | + <button | ||
| 11 | + v-if="showBack && !isRootPath" | ||
| 12 | + @click="goBack" | ||
| 13 | + class="absolute left-4 p-2 rounded-full hover:bg-gray-100 transition-colors" | ||
| 14 | + aria-label="返回" | ||
| 15 | + > | ||
| 16 | + <Left size="24" /> | ||
| 17 | + </button> | ||
| 18 | + <h1 class="text-xl font-medium">{{ title }}</h1> | ||
| 19 | + <button | ||
| 20 | + v-if="showHome && !isRootPath" | ||
| 21 | + @click="goHome" | ||
| 22 | + class="absolute right-4 p-2 rounded-full hover:bg-gray-100 transition-colors" | ||
| 23 | + aria-label="首页" | ||
| 24 | + > | ||
| 25 | + <Home size="24" /> | ||
| 26 | + </button> | ||
| 27 | + </view> | ||
| 28 | +</template> | ||
| 29 | + | ||
| 30 | +<script setup> | ||
| 31 | +import { computed } from 'vue'; | ||
| 32 | +import Taro from '@tarojs/taro'; | ||
| 33 | +import { Left, Home } from '@nutui/icons-vue-taro'; | ||
| 34 | + | ||
| 35 | +defineProps({ | ||
| 36 | + title: { | ||
| 37 | + type: String, | ||
| 38 | + required: true | ||
| 39 | + }, | ||
| 40 | + showBack: { | ||
| 41 | + type: Boolean, | ||
| 42 | + default: true | ||
| 43 | + }, | ||
| 44 | + showHome: { | ||
| 45 | + type: Boolean, | ||
| 46 | + default: false | ||
| 47 | + } | ||
| 48 | +}); | ||
| 49 | + | ||
| 50 | +const currentPage = computed(() => { | ||
| 51 | + const pages = Taro.getCurrentPages(); | ||
| 52 | + return pages.length > 0 ? '/' + pages[pages.length - 1].route : ''; | ||
| 53 | +}); | ||
| 54 | + | ||
| 55 | +const isRootPath = computed(() => { | ||
| 56 | + return currentPage.value === '/pages/index/index' || currentPage.value === '/pages/Dashboard/index'; | ||
| 57 | +}); | ||
| 58 | + | ||
| 59 | +const goBack = () => { | ||
| 60 | + Taro.navigateBack(); | ||
| 61 | +}; | ||
| 62 | + | ||
| 63 | +const goHome = () => { | ||
| 64 | + Taro.switchTab({ url: '/pages/index/index' }); | ||
| 65 | +}; | ||
| 66 | +</script> |
src/components/BottomNav.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <view class="fixed bottom-0 left-0 right-0 bg-white border-t border-gray-100 flex justify-around py-2"> | ||
| 3 | + <view | ||
| 4 | + v-for="item in navItems" | ||
| 5 | + :key="item.path" | ||
| 6 | + @click="navigate(item.path)" | ||
| 7 | + :class="['flex flex-col items-center py-2 px-5', isActive(item.path) ? 'text-blue-600' : 'text-gray-500']" | ||
| 8 | + > | ||
| 9 | + <component :is="item.icon" size="24" /> | ||
| 10 | + <span class="text-xs mt-1">{{ item.label }}</span> | ||
| 11 | + <view v-if="isActive(item.path)" class="absolute bottom-0 w-10 h-1 bg-blue-600 rounded-t-full"></view> | ||
| 12 | + </view> | ||
| 13 | + </view> | ||
| 14 | +</template> | ||
| 15 | + | ||
| 16 | +<script setup> | ||
| 17 | +import { computed, shallowRef } from 'vue'; | ||
| 18 | +import Taro from '@tarojs/taro'; | ||
| 19 | +import { Home, Find, Shop, My } from '@nutui/icons-vue-taro'; | ||
| 20 | + | ||
| 21 | +const navItems = shallowRef([ | ||
| 22 | + { path: '/pages/Dashboard/index', icon: Home, label: '首页' }, | ||
| 23 | + { path: '/pages/Activities/index', icon: Find, label: '活动' }, | ||
| 24 | + { path: '/pages/Rewards/index', icon: Shop, label: '兑换' }, | ||
| 25 | + { path: '/pages/Profile/index', icon: My, label: '我的' }, | ||
| 26 | +]); | ||
| 27 | + | ||
| 28 | +const currentPage = computed(() => { | ||
| 29 | + const pages = Taro.getCurrentPages(); | ||
| 30 | + return pages.length > 0 ? '/' + pages[pages.length - 1].route : ''; | ||
| 31 | +}); | ||
| 32 | + | ||
| 33 | +const isActive = (path) => { | ||
| 34 | + return currentPage.value === path; | ||
| 35 | +}; | ||
| 36 | + | ||
| 37 | +const navigate = (path) => { | ||
| 38 | + Taro.reLaunch({ url: path }); | ||
| 39 | +}; | ||
| 40 | +</script> |
src/components/GlassCard.vue
0 → 100644
| ... | @@ -60,16 +60,16 @@ const isCollecting = ref(false) // 是否正在收集,防止重复触发 | ... | @@ -60,16 +60,16 @@ const isCollecting = ref(false) // 是否正在收集,防止重复触发 |
| 60 | */ | 60 | */ |
| 61 | const generateMockData = () => { | 61 | const generateMockData = () => { |
| 62 | const mockItems = [ | 62 | const mockItems = [ |
| 63 | - { id: 1, type: 'steps', value: 500, steps: 5000 }, | 63 | + { id: 1, type: 'steps', value: 5000, steps: 5000 }, |
| 64 | { id: 2, type: 'points', value: 500 }, | 64 | { id: 2, type: 'points', value: 500 }, |
| 65 | - { id: 3, type: 'steps', value: 800, steps: 5000 }, | 65 | + { id: 3, type: 'steps', value: 8000, steps: 5000 }, |
| 66 | { id: 4, type: 'points', value: 30 }, | 66 | { id: 4, type: 'points', value: 30 }, |
| 67 | - { id: 5, type: 'steps', value: 1200, steps: 12000 }, | 67 | + { id: 5, type: 'steps', value: 12000, steps: 12000 }, |
| 68 | { id: 6, type: 'points', value: 800 }, | 68 | { id: 6, type: 'points', value: 800 }, |
| 69 | { id: 7, type: 'points', value: 250 }, | 69 | { id: 7, type: 'points', value: 250 }, |
| 70 | - { id: 8, type: 'steps', value: 600, steps: 6000 }, | 70 | + { id: 8, type: 'steps', value: 6000, steps: 6000 }, |
| 71 | { id: 9, type: 'points', value: 1000 }, | 71 | { id: 9, type: 'points', value: 1000 }, |
| 72 | - { id: 10, type: 'steps', value: 1000, steps: 10000 }, | 72 | + { id: 10, type: 'steps', value: 10000, steps: 10000 }, |
| 73 | ].map(item => ({ ...item, collecting: false })); // 初始化collecting状态 | 73 | ].map(item => ({ ...item, collecting: false })); // 初始化collecting状态 |
| 74 | 74 | ||
| 75 | const maxValue = Math.max(...mockItems.map(i => i.value)); | 75 | const maxValue = Math.max(...mockItems.map(i => i.value)); |
| ... | @@ -287,12 +287,12 @@ onMounted(() => { | ... | @@ -287,12 +287,12 @@ onMounted(() => { |
| 287 | display: block; | 287 | display: block; |
| 288 | font-size: 24rpx; | 288 | font-size: 24rpx; |
| 289 | margin-top: 8rpx; | 289 | margin-top: 8rpx; |
| 290 | - // opacity: 0.9; | 290 | + opacity: 0.9; |
| 291 | } | 291 | } |
| 292 | 292 | ||
| 293 | .floating-item { | 293 | .floating-item { |
| 294 | position: absolute; | 294 | position: absolute; |
| 295 | - background: rgb(62, 144, 239); | 295 | + background: rgb(100, 166, 240); |
| 296 | border-radius: 50%; | 296 | border-radius: 50%; |
| 297 | display: flex; | 297 | display: flex; |
| 298 | align-items: center; | 298 | align-items: center; |
| ... | @@ -309,7 +309,8 @@ onMounted(() => { | ... | @@ -309,7 +309,8 @@ onMounted(() => { |
| 309 | 309 | ||
| 310 | .item-value { | 310 | .item-value { |
| 311 | display: block; | 311 | display: block; |
| 312 | - font-size: 22rpx; | 312 | + font-size: 20rpx; |
| 313 | + // font-weight: bold; | ||
| 313 | line-height: 1; | 314 | line-height: 1; |
| 314 | } | 315 | } |
| 315 | 316 | ||
| ... | @@ -317,7 +318,6 @@ onMounted(() => { | ... | @@ -317,7 +318,6 @@ onMounted(() => { |
| 317 | display: block; | 318 | display: block; |
| 318 | font-size: 23rpx; | 319 | font-size: 23rpx; |
| 319 | margin-top: 4rpx; | 320 | margin-top: 4rpx; |
| 320 | - font-weight: bold; | ||
| 321 | // opacity: 0.7; | 321 | // opacity: 0.7; |
| 322 | } | 322 | } |
| 323 | 323 | ||
| ... | @@ -379,7 +379,7 @@ onMounted(() => { | ... | @@ -379,7 +379,7 @@ onMounted(() => { |
| 379 | } | 379 | } |
| 380 | 380 | ||
| 381 | .points-label { | 381 | .points-label { |
| 382 | - font-size: 24rpx; | 382 | + font-size: 20rpx; |
| 383 | } | 383 | } |
| 384 | } | 384 | } |
| 385 | </style> | 385 | </style> | ... | ... |
src/components/PrimaryButton.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <button | ||
| 3 | + :class="[ | ||
| 4 | + 'w-full bg-blue-500 text-white font-bold py-3 px-4 rounded-lg shadow-lg', | ||
| 5 | + 'hover:bg-blue-600 transition-colors duration-300', | ||
| 6 | + 'disabled:bg-gray-400 disabled:cursor-not-allowed' | ||
| 7 | + ]" | ||
| 8 | + :disabled="disabled" | ||
| 9 | + @click="$emit('click')" | ||
| 10 | + > | ||
| 11 | + <slot></slot> | ||
| 12 | + </button> | ||
| 13 | +</template> | ||
| 14 | + | ||
| 15 | +<script setup> | ||
| 16 | +/** | ||
| 17 | + * PrimaryButton 组件 | ||
| 18 | + * @description 一个通用的主操作按钮,封装了统一样式和交互效果。 | ||
| 19 | + * @props {boolean} disabled - 是否禁用按钮。 | ||
| 20 | + * @emits {void} click - 点击事件。 | ||
| 21 | + */ | ||
| 22 | + | ||
| 23 | +const props = defineProps({ | ||
| 24 | + disabled: { | ||
| 25 | + type: Boolean, | ||
| 26 | + default: false | ||
| 27 | + } | ||
| 28 | +}); | ||
| 29 | + | ||
| 30 | +const emit = defineEmits(['click']); | ||
| 31 | +</script> |
src/components/TabBar.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="fixed bottom-0 w-full max-w-md mx-auto z-50"> | ||
| 3 | + <div class="backdrop-blur-md bg-white/70 border-t border-gray-200 px-4 py-2"> | ||
| 4 | + <div class="flex justify-around items-center"> | ||
| 5 | + <!-- 首页 --> | ||
| 6 | + <view | ||
| 7 | + @click="navigateTo('/pages/index/index')" | ||
| 8 | + :class="getTabClass('index')" | ||
| 9 | + > | ||
| 10 | + <Home size="20" :color="getIconColor('index')" /> | ||
| 11 | + <span class="text-xs mt-1">首页</span> | ||
| 12 | + </view> | ||
| 13 | + | ||
| 14 | + <!-- 分类 --> | ||
| 15 | + <view | ||
| 16 | + @click="navigateTo('/pages/post/index')" | ||
| 17 | + :class="getTabClass('post')" | ||
| 18 | + > | ||
| 19 | + <Category size="20" :color="getIconColor('post')" /> | ||
| 20 | + <span class="text-xs mt-1">分类</span> | ||
| 21 | + </view> | ||
| 22 | + | ||
| 23 | + <!-- 我要卖车 --> | ||
| 24 | + <div class="relative -mt-5"> | ||
| 25 | + <view | ||
| 26 | + @click="navigateTo('/pages/sell/index')" | ||
| 27 | + class="bg-orange-500 rounded-full p-3 text-white shadow-lg" | ||
| 28 | + > | ||
| 29 | + <span class="text-sm font-medium">我要卖车</span> | ||
| 30 | + </view> | ||
| 31 | + </div> | ||
| 32 | + | ||
| 33 | + <!-- 消息 --> | ||
| 34 | + <view | ||
| 35 | + @click="navigateTo('/pages/messages/index')" | ||
| 36 | + :class="getTabClass('messages')" | ||
| 37 | + class="relative" | ||
| 38 | + > | ||
| 39 | + <Message size="20" :color="getIconColor('messages')" /> | ||
| 40 | + <!-- 未读消息红点 --> | ||
| 41 | + <div | ||
| 42 | + v-if="unreadCount > 0" | ||
| 43 | + class="absolute top-0 right-0 bg-red-500 rounded-full w-2 h-2" | ||
| 44 | + > | ||
| 45 | + </div> | ||
| 46 | + <span class="text-xs mt-1">通知</span> | ||
| 47 | + </view> | ||
| 48 | + | ||
| 49 | + <!-- 我的 --> | ||
| 50 | + <view | ||
| 51 | + @click="navigateTo('/pages/profile/index')" | ||
| 52 | + :class="getTabClass('profile')" | ||
| 53 | + > | ||
| 54 | + <My size="20" :color="getIconColor('profile')" /> | ||
| 55 | + <span class="text-xs mt-1">我的</span> | ||
| 56 | + </view> | ||
| 57 | + </div> | ||
| 58 | + </div> | ||
| 59 | + </div> | ||
| 60 | +</template> | ||
| 61 | + | ||
| 62 | +<script setup> | ||
| 63 | +import { ref, onMounted, computed } from 'vue' | ||
| 64 | +import Taro from '@tarojs/taro' | ||
| 65 | +import { Home, Category, Message, My } from '@nutui/icons-vue-taro' | ||
| 66 | +import { useUserStore } from '@/stores/user' | ||
| 67 | +import { checkPermission, PERMISSION_TYPES } from '@/utils/permission' | ||
| 68 | + | ||
| 69 | +// 当前激活的tab | ||
| 70 | +const activeTab = ref('') | ||
| 71 | +// 用户状态管理 | ||
| 72 | +const userStore = useUserStore() | ||
| 73 | +// 未读消息数量 | ||
| 74 | +const unreadCount = computed(() => userStore.userInfo.message_count) | ||
| 75 | + | ||
| 76 | +/** | ||
| 77 | + * 获取当前页面路径并设置激活状态 | ||
| 78 | + */ | ||
| 79 | +const getCurrentPage = () => { | ||
| 80 | + const pages = Taro.getCurrentPages() | ||
| 81 | + if (pages.length > 0) { | ||
| 82 | + const currentPage = pages[pages.length - 1] | ||
| 83 | + const route = currentPage.route | ||
| 84 | + | ||
| 85 | + if (route.includes('index/index')) { | ||
| 86 | + activeTab.value = 'index' | ||
| 87 | + } else if (route.includes('post/index')) { | ||
| 88 | + activeTab.value = 'post' | ||
| 89 | + } else if (route.includes('sell/index')) { | ||
| 90 | + activeTab.value = 'sell' | ||
| 91 | + } else if (route.includes('messages/index')) { | ||
| 92 | + activeTab.value = 'messages' | ||
| 93 | + } else if (route.includes('profile/index')) { | ||
| 94 | + activeTab.value = 'profile' | ||
| 95 | + } | ||
| 96 | + } | ||
| 97 | +} | ||
| 98 | + | ||
| 99 | +/** | ||
| 100 | + * 导航到指定页面 | ||
| 101 | + * @param {string} url - 页面路径 | ||
| 102 | + */ | ||
| 103 | +const navigateTo = async (url) => { | ||
| 104 | + // 定义需要权限验证的页面(移除个人中心和sell页面的权限检查) | ||
| 105 | + // const permissionPages = { | ||
| 106 | + // '/pages/messages/index': PERMISSION_TYPES.MESSAGE | ||
| 107 | + // } | ||
| 108 | + | ||
| 109 | + // 检查是否需要权限验证 | ||
| 110 | + // const permissionType = permissionPages[url] | ||
| 111 | + // if (permissionType) { | ||
| 112 | + // const hasPermission = await checkPermission(permissionType) | ||
| 113 | + // if (!hasPermission) { | ||
| 114 | + // return | ||
| 115 | + // } | ||
| 116 | + // } | ||
| 117 | + | ||
| 118 | + Taro.reLaunch({ | ||
| 119 | + url | ||
| 120 | + }) | ||
| 121 | +} | ||
| 122 | + | ||
| 123 | +/** | ||
| 124 | + * 获取tab按钮的样式类 | ||
| 125 | + * @param {string} tab - tab标识 | ||
| 126 | + * @returns {string} 样式类名 | ||
| 127 | + */ | ||
| 128 | +const getTabClass = (tab) => { | ||
| 129 | + const baseClass = 'flex flex-col items-center p-2' | ||
| 130 | + const activeClass = activeTab.value === tab ? 'text-orange-500' : 'text-gray-500' | ||
| 131 | + return `${baseClass} ${activeClass}` | ||
| 132 | +} | ||
| 133 | + | ||
| 134 | +/** | ||
| 135 | + * 获取图标颜色 | ||
| 136 | + * @param {string} tab - tab标识 | ||
| 137 | + * @returns {string} 颜色值 | ||
| 138 | + */ | ||
| 139 | +const getIconColor = (tab) => { | ||
| 140 | + return activeTab.value === tab ? '#f97316' : '#6b7280' | ||
| 141 | +} | ||
| 142 | + | ||
| 143 | +onMounted(async () => { | ||
| 144 | + getCurrentPage() | ||
| 145 | + // 初始化用户信息 | ||
| 146 | + await userStore.fetchUserInfo() | ||
| 147 | +}) | ||
| 148 | +</script> | ||
| 149 | + | ||
| 150 | +<style lang="less" scoped> | ||
| 151 | +/* 确保底部导航栏在最上层 */ | ||
| 152 | +.z-50 { | ||
| 153 | + z-index: 50; | ||
| 154 | +} | ||
| 155 | +</style> |
src/pages/Activities/index.config.js
0 → 100644
src/pages/Activities/index.less
0 → 100644
File mode changed
src/pages/Activities/index.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <view class="min-h-screen flex flex-col bg-white"> | ||
| 3 | + <AppHeader title="城市漫步" :showBack="false" /> | ||
| 4 | + <!-- Map container --> | ||
| 5 | + <view class="flex-1 relative"> | ||
| 6 | + <Map | ||
| 7 | + class="w-full h-full" | ||
| 8 | + :longitude="121.47" | ||
| 9 | + :latitude="31.23" | ||
| 10 | + :scale="15" | ||
| 11 | + :markers="markers" | ||
| 12 | + @markertap="onMarkerTap" | ||
| 13 | + /> | ||
| 14 | + </view> | ||
| 15 | + <!-- Check-in point detail modal --> | ||
| 16 | + <view v-if="showModal && selectedPoint" class="fixed inset-0 bg-black bg-opacity-50 flex items-end justify-center z-20"> | ||
| 17 | + <view class="bg-white rounded-t-2xl w-full max-h-[80%] overflow-y-auto"> | ||
| 18 | + <view class="relative h-64 overflow-hidden"> | ||
| 19 | + <image :src="selectedPoint.image" :alt="selectedPoint.name" class="w-full h-full object-cover" /> | ||
| 20 | + <button class="absolute top-4 right-4 bg-white rounded-full p-2" @click="showModal = false"> | ||
| 21 | + <Failure size="24" /> | ||
| 22 | + </button> | ||
| 23 | + </view> | ||
| 24 | + <view class="p-4"> | ||
| 25 | + <h2 class="text-2xl font-bold mb-2">{{ selectedPoint.name }}</h2> | ||
| 26 | + <p class="text-gray-600 mb-6">{{ selectedPoint.description }}</p> | ||
| 27 | + <button @click="handleCheckIn" :disabled="selectedPoint.isCheckedIn" :class="['w-full py-3 rounded-full text-white font-medium', selectedPoint.isCheckedIn ? 'bg-gray-400' : 'bg-blue-500']"> | ||
| 28 | + {{ selectedPoint.isCheckedIn ? '已打卡' : '打卡' }} | ||
| 29 | + </button> | ||
| 30 | + </view> | ||
| 31 | + </view> | ||
| 32 | + </view> | ||
| 33 | + <!-- Check-in success message --> | ||
| 34 | + <view v-if="showSuccess" class="fixed inset-0 flex items-center justify-center z-30 pointer-events-none"> | ||
| 35 | + <view class="bg-black bg-opacity-70 text-white px-6 py-4 rounded-lg flex items-center"> | ||
| 36 | + <Check size="24" class="text-green-400 mr-2" /> | ||
| 37 | + <span>打卡成功!</span> | ||
| 38 | + </view> | ||
| 39 | + </view> | ||
| 40 | + <BottomNav /> | ||
| 41 | + </view> | ||
| 42 | +</template> | ||
| 43 | + | ||
| 44 | +<script setup> | ||
| 45 | +import { ref, computed } from 'vue'; | ||
| 46 | +import AppHeader from '../../components/AppHeader.vue'; | ||
| 47 | +import BottomNav from '../../components/BottomNav.vue'; | ||
| 48 | +import { Failure, Check } from '@nutui/icons-vue-taro'; | ||
| 49 | + | ||
| 50 | +const selectedPoint = ref(null); | ||
| 51 | +const showModal = ref(false); | ||
| 52 | +const showSuccess = ref(false); | ||
| 53 | + | ||
| 54 | +const checkInPoints = ref([ | ||
| 55 | + { | ||
| 56 | + id: 'yuyuan', | ||
| 57 | + name: '豫园', | ||
| 58 | + description: '豫园始建于1559年,是明代著名的私家园林,现为国家重点文物保护单位。园内亭台楼阁布局精巧,景色优美,是上海著名的旅游景点。', | ||
| 59 | + latitude: 31.2271, | ||
| 60 | + longitude: 121.4875, | ||
| 61 | + iconPath: '/static/images/activities/marker.png', | ||
| 62 | + width: 30, | ||
| 63 | + height: 30, | ||
| 64 | + image: "/static/images/activities/citywalk2_1.png", | ||
| 65 | + isCheckedIn: false | ||
| 66 | + }, | ||
| 67 | + { | ||
| 68 | + id: 'jiuquqiao', | ||
| 69 | + name: '九曲桥', | ||
| 70 | + description: '豫园九曲桥位于上海城隍庙豫园内,是上海的标志性建筑之一。桥因始建于明代嘉靖、万历年间,九曲桥与荷花池在那时就已存在,最初为木桥。清朝隆年间进行过修建,上世纪20年代因火灾改建为水泥桥,解放后又恢复了石桥形式。', | ||
| 71 | + latitude: 31.2275, | ||
| 72 | + longitude: 121.4895, | ||
| 73 | + iconPath: '/static/images/activities/marker.png', | ||
| 74 | + width: 30, | ||
| 75 | + height: 30, | ||
| 76 | + image: "/static/images/activities/citywalk2_1.png", | ||
| 77 | + isCheckedIn: false | ||
| 78 | + } | ||
| 79 | +]); | ||
| 80 | + | ||
| 81 | +const markers = computed(() => checkInPoints.value.map(p => ({ | ||
| 82 | + id: p.id, | ||
| 83 | + latitude: p.latitude, | ||
| 84 | + longitude: p.longitude, | ||
| 85 | + iconPath: p.iconPath, | ||
| 86 | + width: p.width, | ||
| 87 | + height: p.height, | ||
| 88 | +}))); | ||
| 89 | + | ||
| 90 | +const onMarkerTap = (e) => { | ||
| 91 | + const point = checkInPoints.value.find(p => p.id === e.detail.markerId); | ||
| 92 | + if (point) { | ||
| 93 | + selectedPoint.value = point; | ||
| 94 | + showModal.value = true; | ||
| 95 | + } | ||
| 96 | +}; | ||
| 97 | + | ||
| 98 | +const handleCheckIn = () => { | ||
| 99 | + if (selectedPoint.value) { | ||
| 100 | + const index = checkInPoints.value.findIndex(p => p.id === selectedPoint.value.id); | ||
| 101 | + if (index !== -1) { | ||
| 102 | + checkInPoints.value[index].isCheckedIn = true; | ||
| 103 | + } | ||
| 104 | + showModal.value = false; | ||
| 105 | + showSuccess.value = true; | ||
| 106 | + setTimeout(() => { | ||
| 107 | + showSuccess.value = false; | ||
| 108 | + }, 2000); | ||
| 109 | + } | ||
| 110 | +}; | ||
| 111 | +</script> |
src/pages/CreateFamily/index.config.js
0 → 100644
src/pages/CreateFamily/index.less
0 → 100644
File mode changed
src/pages/CreateFamily/index.vue
0 → 100644
| 1 | +<!-- | ||
| 2 | + * @Date: 2025-08-27 17:44:53 | ||
| 3 | + * @LastEditors: hookehuyr hookehuyr@gmail.com | ||
| 4 | + * @LastEditTime: 2025-08-27 18:05:54 | ||
| 5 | + * @FilePath: /lls_program/src/pages/CreateFamily/index.vue | ||
| 6 | + * @Description: 文件描述 | ||
| 7 | +--> | ||
| 8 | +<template> | ||
| 9 | + <view class="min-h-screen flex flex-col bg-white"> | ||
| 10 | + <AppHeader title="创建家庭" /> | ||
| 11 | + <view class="flex-1 px-4 py-6 overflow-auto"> | ||
| 12 | + <view class="mb-6"> | ||
| 13 | + <p class="text-gray-600 mb-6"> | ||
| 14 | + 请填写家庭信息,创建您的专属家庭空间 | ||
| 15 | + </p> | ||
| 16 | + <!-- Family Name --> | ||
| 17 | + <view class="mb-6"> | ||
| 18 | + <view class="bg-white rounded-lg border border-gray-200 p-4"> | ||
| 19 | + <label class="block text-lg font-medium mb-2">家庭名称</label> | ||
| 20 | + <input | ||
| 21 | + type="text" | ||
| 22 | + v-model="familyName" | ||
| 23 | + class="w-full text-gray-600 focus:outline-none" | ||
| 24 | + placeholder="请输入家庭名称" | ||
| 25 | + /> | ||
| 26 | + </view> | ||
| 27 | + </view> | ||
| 28 | + <!-- Family Introduction --> | ||
| 29 | + <view class="mb-6"> | ||
| 30 | + <view class="bg-white rounded-lg border border-gray-200 p-4"> | ||
| 31 | + <label class="block text-lg font-medium mb-2">家庭介绍</label> | ||
| 32 | + <textarea | ||
| 33 | + v-model="familyIntro" | ||
| 34 | + class="w-full text-gray-600 focus:outline-none resize-none" | ||
| 35 | + placeholder="请输入您家庭的特色、成员特点等家庭标签" | ||
| 36 | + :rows="2" | ||
| 37 | + /> | ||
| 38 | + </view> | ||
| 39 | + </view> | ||
| 40 | + <!-- Family Size --> | ||
| 41 | + <view class="mb-6"> | ||
| 42 | + <view class="bg-white rounded-lg border border-gray-200 p-4"> | ||
| 43 | + <label class="block text-lg font-medium mb-4">家庭规模</label> | ||
| 44 | + <view class="flex gap-2"> | ||
| 45 | + <button | ||
| 46 | + v-for="size in familySizes" | ||
| 47 | + :key="size" | ||
| 48 | + @click="familySize = size" | ||
| 49 | + :class="[ | ||
| 50 | + 'flex-1 py-3 rounded-lg border', | ||
| 51 | + familySize === size | ||
| 52 | + ? 'border-blue-500 bg-blue-50 text-blue-500' | ||
| 53 | + : 'border-gray-200 text-gray-700' | ||
| 54 | + ]" | ||
| 55 | + > | ||
| 56 | + {{ size }} | ||
| 57 | + </button> | ||
| 58 | + </view> | ||
| 59 | + </view> | ||
| 60 | + </view> | ||
| 61 | + <!-- Family Motto --> | ||
| 62 | + <view class="mb-6"> | ||
| 63 | + <view class="bg-white rounded-lg border border-gray-200 p-4"> | ||
| 64 | + <view class="flex justify-between items-center mb-4"> | ||
| 65 | + <label class="block text-lg font-medium">家训口令</label> | ||
| 66 | + <button | ||
| 67 | + @click="generateRandomMotto" | ||
| 68 | + class="px-3 py-1 bg-blue-100 text-blue-600 rounded-full text-sm" | ||
| 69 | + > | ||
| 70 | + 随机生成 | ||
| 71 | + </button> | ||
| 72 | + </view> | ||
| 73 | + <view class="flex gap-2 mb-4"> | ||
| 74 | + <view v-for="(char, index) in familyMotto" :key="index" class="flex-1"> | ||
| 75 | + <input | ||
| 76 | + type="text" | ||
| 77 | + v-model="familyMotto[index]" | ||
| 78 | + maxlength="1" | ||
| 79 | + class="w-full aspect-square flex items-center justify-center text-center text-xl bg-gray-100 rounded-lg" | ||
| 80 | + /> | ||
| 81 | + </view> | ||
| 82 | + <view class="flex-1 flex items-center justify-center"> | ||
| 83 | + <button class="w-full aspect-square flex items-center justify-center bg-gray-100 rounded-lg text-blue-500"> | ||
| 84 | + <Edit size="20" /> | ||
| 85 | + </button> | ||
| 86 | + </view> | ||
| 87 | + </view> | ||
| 88 | + <view class="flex items-center text-sm text-gray-600"> | ||
| 89 | + <Bulb size="16" class="text-yellow-500 mr-2" /> | ||
| 90 | + <p>设置有意义的家训口令,便于家人记忆和加入</p> | ||
| 91 | + </view> | ||
| 92 | + </view> | ||
| 93 | + </view> | ||
| 94 | + <!-- Family Avatar --> | ||
| 95 | + <view class="mb-10"> | ||
| 96 | + <view class="bg-white rounded-lg border border-gray-200 p-4"> | ||
| 97 | + <label class="block text-lg font-medium mb-2"> | ||
| 98 | + 家庭头像(选填) | ||
| 99 | + </label> | ||
| 100 | + <view | ||
| 101 | + class="border border-dashed border-gray-300 rounded-lg p-6 flex flex-col items-center justify-center" | ||
| 102 | + @click="chooseImage" | ||
| 103 | + > | ||
| 104 | + <view class="text-gray-400 mb-2"> | ||
| 105 | + <Image size="24" /> | ||
| 106 | + </view> | ||
| 107 | + <p class="text-center text-gray-400">点击上传图片</p> | ||
| 108 | + <p class="text-center text-gray-400 text-xs mt-1"> | ||
| 109 | + 支持jpg、png格式,大小不超过2MB | ||
| 110 | + </p> | ||
| 111 | + </view> | ||
| 112 | + </view> | ||
| 113 | + </view> | ||
| 114 | + </view> | ||
| 115 | + <!-- Submit Button --> | ||
| 116 | + <button | ||
| 117 | + @click="handleCreateFamily" | ||
| 118 | + class="w-full py-4 bg-blue-500 text-white text-lg font-medium rounded-lg" | ||
| 119 | + > | ||
| 120 | + 创建家庭 | ||
| 121 | + </button> | ||
| 122 | + </view> | ||
| 123 | + </view> | ||
| 124 | +</template> | ||
| 125 | + | ||
| 126 | +<script setup> | ||
| 127 | +import { ref } from 'vue'; | ||
| 128 | +import Taro from '@tarojs/taro'; | ||
| 129 | +import { Edit, Bulb, Image } from '@nutui/icons-vue-taro'; | ||
| 130 | +import AppHeader from '../../components/AppHeader.vue'; | ||
| 131 | + | ||
| 132 | +const familyName = ref(''); | ||
| 133 | +const familyIntro = ref(''); | ||
| 134 | +const familySize = ref('3-5人'); | ||
| 135 | +const familyMotto = ref(['孝', '敬', '和', '睦']); | ||
| 136 | +const familySizes = ['2人', '3-5人', '6人+']; | ||
| 137 | + | ||
| 138 | +const generateRandomMotto = () => { | ||
| 139 | + // 在实际应用中,这里会生成随机家训 | ||
| 140 | + // 目前仅作为演示使用预设值 | ||
| 141 | + familyMotto.value = ['爱', '和', '勤', '俭']; | ||
| 142 | +}; | ||
| 143 | + | ||
| 144 | +const chooseImage = () => { | ||
| 145 | + Taro.chooseImage({ | ||
| 146 | + count: 1, | ||
| 147 | + sizeType: ['compressed'], | ||
| 148 | + sourceType: ['album', 'camera'], | ||
| 149 | + success: (res) => { | ||
| 150 | + const tempFilePaths = res.tempFilePaths; | ||
| 151 | + // 在实际应用中,这里会上传图片到服务器 | ||
| 152 | + console.log('选择的图片路径:', tempFilePaths); | ||
| 153 | + } | ||
| 154 | + }); | ||
| 155 | +}; | ||
| 156 | + | ||
| 157 | +const handleCreateFamily = () => { | ||
| 158 | + // 在实际应用中,这里会调用API创建家庭 | ||
| 159 | + // 目前仅作为演示跳转到仪表盘页面 | ||
| 160 | + Taro.navigateTo({ | ||
| 161 | + url: '/pages/Dashboard/index' | ||
| 162 | + }); | ||
| 163 | +}; | ||
| 164 | +</script> |
src/pages/Dashboard/index.config.js
0 → 100644
src/pages/Dashboard/index.less
0 → 100644
File mode changed
src/pages/Dashboard/index.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <view class="min-h-screen flex flex-col bg-white pb-16"> | ||
| 3 | + <!-- Hero section with family name and background image --> | ||
| 4 | + <view class="relative h-48"> | ||
| 5 | + <image src="/static/images/home/dashboard-bg.png" alt="Family background" class="w-full h-full object-cover" /> | ||
| 6 | + <view class="absolute inset-0 bg-black bg-opacity-30 flex flex-col justify-end p-5"> | ||
| 7 | + <button class="absolute top-4 right-4 text-white" @click="goToProfile"> | ||
| 8 | + <Setting size="24" /> | ||
| 9 | + </button> | ||
| 10 | + <h1 class="text-white text-2xl font-bold">张爷爷的家庭</h1> | ||
| 11 | + <p class="text-white opacity-90">每日走万步,全家一起行</p> | ||
| 12 | + </view> | ||
| 13 | + </view> | ||
| 14 | + | ||
| 15 | + <!-- Today's steps section --> | ||
| 16 | + <view class="p-5"> | ||
| 17 | + <view class="flex justify-between items-center mb-1"> | ||
| 18 | + <span class="text-gray-500">今日</span> | ||
| 19 | + </view> | ||
| 20 | + <view class="flex justify-between items-center"> | ||
| 21 | + <view class="flex items-baseline"> | ||
| 22 | + <span class="text-4xl font-bold"> | ||
| 23 | + {{ todaySteps.toLocaleString() }} | ||
| 24 | + </span> | ||
| 25 | + <span class="ml-1 text-gray-500">步</span> | ||
| 26 | + </view> | ||
| 27 | + <button class="bg-blue-500 text-white px-4 py-2 rounded-full text-sm" @click="handleSyncSteps"> | ||
| 28 | + 一键汇总 | ||
| 29 | + </button> | ||
| 30 | + </view> | ||
| 31 | + </view> | ||
| 32 | + | ||
| 33 | + <!-- Points circles --> | ||
| 34 | + <view class="flex justify-between px-5 my-4"> | ||
| 35 | + <view class="flex flex-col items-center"> | ||
| 36 | + <view class="w-16 h-16 bg-blue-500 rounded-full flex flex-col items-center justify-center text-white"> | ||
| 37 | + <span class="text-sm">热血</span> | ||
| 38 | + <span class="text-sm font-bold">100分</span> | ||
| 39 | + </view> | ||
| 40 | + </view> | ||
| 41 | + <view class="flex flex-col items-center"> | ||
| 42 | + <view class="w-20 h-20 bg-blue-500 rounded-full flex flex-col items-center justify-center text-white"> | ||
| 43 | + <span class="text-sm">恒心</span> | ||
| 44 | + <span class="text-sm font-bold">900分</span> | ||
| 45 | + </view> | ||
| 46 | + </view> | ||
| 47 | + <view class="flex flex-col items-center"> | ||
| 48 | + <view class="w-24 h-24 bg-blue-600 rounded-full flex flex-col items-center justify-center text-white cursor-pointer" @click="goToRewards"> | ||
| 49 | + <span class="text-lg font-bold">8,760分</span> | ||
| 50 | + <span class="text-xs">去兑换 ></span> | ||
| 51 | + </view> | ||
| 52 | + </view> | ||
| 53 | + </view> | ||
| 54 | + | ||
| 55 | + <!-- Family step ranking --> | ||
| 56 | + <view class="px-5 mt-6"> | ||
| 57 | + <view class="flex justify-between items-center mb-4"> | ||
| 58 | + <h2 class="font-medium text-lg">今日家庭步数排行</h2> | ||
| 59 | + <span class="text-sm text-gray-500"> | ||
| 60 | + 总计 {{ totalSteps.toLocaleString() }} 步 | ||
| 61 | + </span> | ||
| 62 | + </view> | ||
| 63 | + <view class="grid grid-cols-4 gap-2"> | ||
| 64 | + <view v-for="member in familyMembers" :key="member.id" class="flex flex-col items-center"> | ||
| 65 | + <image :src="member.avatar" :alt="member.name" class="w-16 h-16 rounded-full mb-1" /> | ||
| 66 | + <span class="text-sm text-gray-700"> | ||
| 67 | + {{ member.steps.toLocaleString() }}步 | ||
| 68 | + </span> | ||
| 69 | + </view> | ||
| 70 | + </view> | ||
| 71 | + </view> | ||
| 72 | + | ||
| 73 | + <!-- Photo button --> | ||
| 74 | + <view class="px-5 mt-6"> | ||
| 75 | + <button class="w-full bg-blue-500 text-white py-3 rounded-lg flex items-center justify-center" @click="goToActivities"> | ||
| 76 | + <Camera size="20" class="mr-2" /> | ||
| 77 | + 拍照留念,奖励积分 | ||
| 78 | + </button> | ||
| 79 | + </view> | ||
| 80 | + | ||
| 81 | + <!-- Family album --> | ||
| 82 | + <view class="px-5 mt-6"> | ||
| 83 | + <view class="flex justify-between items-center mb-2"> | ||
| 84 | + <h2 class="font-medium text-lg">家庭相册</h2> | ||
| 85 | + <button class="text-blue-500 flex items-center" @click="goToActivities"> | ||
| 86 | + 打开相册 <Right size="16" /> | ||
| 87 | + </button> | ||
| 88 | + </view> | ||
| 89 | + <p class="text-sm text-gray-500 mb-3">记录每一个家庭活动瞬间</p> | ||
| 90 | + <view class="grid grid-cols-2 gap-3"> | ||
| 91 | + <view class="rounded-lg overflow-hidden"> | ||
| 92 | + <image src="/static/images/home/album-1.png" alt="家庭活动照片" class="w-full h-32 object-cover" /> | ||
| 93 | + </view> | ||
| 94 | + <view class="rounded-lg overflow-hidden"> | ||
| 95 | + <image src="/static/images/home/album-2.png" alt="家庭活动照片" class="w-full h-32 object-cover" /> | ||
| 96 | + </view> | ||
| 97 | + </view> | ||
| 98 | + </view> | ||
| 99 | + | ||
| 100 | + <BottomNav /> | ||
| 101 | + </view> | ||
| 102 | +</template> | ||
| 103 | + | ||
| 104 | +<script setup> | ||
| 105 | +import { ref, computed } from 'vue'; | ||
| 106 | +import Taro from '@tarojs/taro'; | ||
| 107 | +import { Setting, Camera, Right } from '@nutui/icons-vue-taro'; | ||
| 108 | +import BottomNav from '../../components/BottomNav.vue'; | ||
| 109 | + | ||
| 110 | +const todaySteps = ref(2000); | ||
| 111 | + | ||
| 112 | +// Mock data for family members | ||
| 113 | +const familyMembers = ref([ | ||
| 114 | + { | ||
| 115 | + id: 1, | ||
| 116 | + name: '妈妈', | ||
| 117 | + steps: 7000, | ||
| 118 | + avatar: 'https://randomuser.me/api/portraits/women/44.jpg' | ||
| 119 | + }, | ||
| 120 | + { | ||
| 121 | + id: 2, | ||
| 122 | + name: '爸爸', | ||
| 123 | + steps: 6000, | ||
| 124 | + avatar: 'https://randomuser.me/api/portraits/men/32.jpg' | ||
| 125 | + }, | ||
| 126 | + { | ||
| 127 | + id: 3, | ||
| 128 | + name: '儿子', | ||
| 129 | + steps: 5000, | ||
| 130 | + avatar: 'https://randomuser.me/api/portraits/men/22.jpg' | ||
| 131 | + }, | ||
| 132 | + { | ||
| 133 | + id: 4, | ||
| 134 | + name: '女儿', | ||
| 135 | + steps: 4000, | ||
| 136 | + avatar: 'https://randomuser.me/api/portraits/women/29.jpg' | ||
| 137 | + } | ||
| 138 | +]); | ||
| 139 | + | ||
| 140 | +// Calculate total family steps | ||
| 141 | +const totalSteps = computed(() => | ||
| 142 | + familyMembers.value.reduce((sum, member) => sum + member.steps, 0) + todaySteps.value | ||
| 143 | +); | ||
| 144 | + | ||
| 145 | +const handleSyncSteps = () => { | ||
| 146 | + // In a real app, this would sync with a health API | ||
| 147 | + // For demo purposes, we'll just log and do nothing | ||
| 148 | + console.log('Syncing steps...'); | ||
| 149 | +}; | ||
| 150 | + | ||
| 151 | +const goToProfile = () => { | ||
| 152 | + Taro.navigateTo({ url: '/pages/Profile/index' }); | ||
| 153 | +}; | ||
| 154 | + | ||
| 155 | +const goToRewards = () => { | ||
| 156 | + Taro.navigateTo({ url: '/pages/RewardCategories/index' }); | ||
| 157 | +}; | ||
| 158 | + | ||
| 159 | +const goToActivities = () => { | ||
| 160 | + Taro.switchTab({ url: '/pages/Activities/index' }); | ||
| 161 | +}; | ||
| 162 | +</script> |
src/pages/Feedback/index.config.js
0 → 100644
src/pages/Feedback/index.less
0 → 100644
File mode changed
src/pages/Feedback/index.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <view class="min-h-screen flex flex-col bg-white"> | ||
| 3 | + <AppHeader title="意见反馈" /> | ||
| 4 | + <view class="flex-1 px-4 py-6 pb-20"> | ||
| 5 | + <form @submit.prevent="handleSubmit" class="space-y-6"> | ||
| 6 | + <view> | ||
| 7 | + <label for="feedback" class="block text-sm font-medium text-gray-700 mb-1"> | ||
| 8 | + 您的反馈 | ||
| 9 | + </label> | ||
| 10 | + <textarea | ||
| 11 | + id="feedback" | ||
| 12 | + rows="5" | ||
| 13 | + class="w-full p-3 border border-gray-300 rounded-lg focus:ring-blue-500 focus:border-blue-500" | ||
| 14 | + placeholder="请描述您遇到的问题或建议..." | ||
| 15 | + v-model="feedback" | ||
| 16 | + required | ||
| 17 | + /> | ||
| 18 | + </view> | ||
| 19 | + <view> | ||
| 20 | + <label class="block text-sm font-medium text-gray-700 mb-1"> | ||
| 21 | + 上传截图 (可选) | ||
| 22 | + </label> | ||
| 23 | + <view class="flex flex-wrap gap-2 mb-2"> | ||
| 24 | + <view v-for="(image, index) in images" :key="index" class="relative w-20 h-20"> | ||
| 25 | + <image :src="image" :alt="`上传图片 ${index + 1}`" class="w-full h-full object-cover rounded-lg" /> | ||
| 26 | + <button type="button" class="absolute -top-2 -right-2 bg-red-500 text-white rounded-full p-1" @click="removeImage(index)"> | ||
| 27 | + <Failure size="16" /> | ||
| 28 | + </button> | ||
| 29 | + </view> | ||
| 30 | + <view | ||
| 31 | + class="w-20 h-20 flex flex-col items-center justify-center border-2 border-dashed border-gray-300 rounded-lg cursor-pointer hover:bg-gray-50" | ||
| 32 | + @click="chooseImage" | ||
| 33 | + > | ||
| 34 | + <Upload size="24" class="text-gray-400" /> | ||
| 35 | + <span class="text-xs text-gray-500 mt-1">添加图片</span> | ||
| 36 | + </view> | ||
| 37 | + </view> | ||
| 38 | + </view> | ||
| 39 | + <view> | ||
| 40 | + <label for="name" class="block text-sm font-medium text-gray-700 mb-1"> | ||
| 41 | + 您的姓名 | ||
| 42 | + </label> | ||
| 43 | + <input | ||
| 44 | + type="text" | ||
| 45 | + id="name" | ||
| 46 | + class="w-full p-3 border border-gray-300 rounded-lg focus:ring-blue-500 focus:border-blue-500" | ||
| 47 | + placeholder="请输入您的姓名" | ||
| 48 | + v-model="name" | ||
| 49 | + /> | ||
| 50 | + </view> | ||
| 51 | + <view> | ||
| 52 | + <label for="contact" class="block text-sm font-medium text-gray-700 mb-1"> | ||
| 53 | + 联系方式 | ||
| 54 | + </label> | ||
| 55 | + <input | ||
| 56 | + type="text" | ||
| 57 | + id="contact" | ||
| 58 | + class="w-full p-3 border border-gray-300 rounded-lg focus:ring-blue-500 focus:border-blue-500" | ||
| 59 | + placeholder="请输入您的手机号或微信号" | ||
| 60 | + v-model="contact" | ||
| 61 | + /> | ||
| 62 | + </view> | ||
| 63 | + <button type="submit" class="w-full py-3 bg-blue-500 text-white font-medium rounded-lg hover:bg-blue-600 transition-colors"> | ||
| 64 | + 提交反馈 | ||
| 65 | + </button> | ||
| 66 | + </form> | ||
| 67 | + </view> | ||
| 68 | + <BottomNav /> | ||
| 69 | + </view> | ||
| 70 | +</template> | ||
| 71 | + | ||
| 72 | +<script setup> | ||
| 73 | +import { ref } from 'vue'; | ||
| 74 | +import Taro from '@tarojs/taro'; | ||
| 75 | +import AppHeader from '../../components/AppHeader.vue'; | ||
| 76 | +import BottomNav from '../../components/BottomNav.vue'; | ||
| 77 | +import { Upload, Failure } from '@nutui/icons-vue-taro'; | ||
| 78 | + | ||
| 79 | +const feedback = ref(''); | ||
| 80 | +const name = ref(''); | ||
| 81 | +const contact = ref(''); | ||
| 82 | +const images = ref([]); | ||
| 83 | + | ||
| 84 | +const chooseImage = () => { | ||
| 85 | + Taro.chooseImage({ | ||
| 86 | + count: 9 - images.value.length, | ||
| 87 | + sizeType: ['original', 'compressed'], | ||
| 88 | + sourceType: ['album', 'camera'], | ||
| 89 | + success: (res) => { | ||
| 90 | + images.value = [...images.value, ...res.tempFilePaths]; | ||
| 91 | + } | ||
| 92 | + }); | ||
| 93 | +}; | ||
| 94 | + | ||
| 95 | +const removeImage = (index) => { | ||
| 96 | + images.value = images.value.filter((_, i) => i !== index); | ||
| 97 | +}; | ||
| 98 | + | ||
| 99 | +const handleSubmit = () => { | ||
| 100 | + // In a real app, we would send this data to a server | ||
| 101 | + Taro.showToast({ | ||
| 102 | + title: '感谢您的反馈!我们会尽快处理。', | ||
| 103 | + icon: 'success', | ||
| 104 | + duration: 2000 | ||
| 105 | + }); | ||
| 106 | + | ||
| 107 | + setTimeout(() => { | ||
| 108 | + Taro.navigateBack(); | ||
| 109 | + }, 2000); | ||
| 110 | +}; | ||
| 111 | +</script> |
src/pages/JoinFamily/index.config.js
0 → 100644
src/pages/JoinFamily/index.less
0 → 100644
File mode changed
src/pages/JoinFamily/index.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <view class="min-h-screen flex flex-col bg-white"> | ||
| 3 | + <AppHeader title="加入家庭" /> | ||
| 4 | + <view class="flex-1 px-4 py-6 flex flex-col"> | ||
| 5 | + <!-- Title --> | ||
| 6 | + <h2 class="text-xl font-bold text-center mb-2 mt-4"> | ||
| 7 | + 输入家训口令 | ||
| 8 | + </h2> | ||
| 9 | + <!-- Description --> | ||
| 10 | + <p class="text-gray-600 text-center text-sm mb-6"> | ||
| 11 | + 请输入家人提供的家训口令,加入家庭一起参与健康挑战 | ||
| 12 | + </p> | ||
| 13 | + <!-- Input boxes --> | ||
| 14 | + <view class="flex justify-center gap-3 w-full mb-6"> | ||
| 15 | + <view v-for="(char, index) in mottoChars" :key="index" class="w-16 h-16"> | ||
| 16 | + <input | ||
| 17 | + :ref="(el) => (inputRefs[index] = el)" | ||
| 18 | + type="text" | ||
| 19 | + v-model="mottoChars[index]" | ||
| 20 | + @input="(e) => handleInputChange(index, e.target.value)" | ||
| 21 | + @keydown="(e) => handleKeyDown(index, e)" | ||
| 22 | + maxlength="1" | ||
| 23 | + class="w-full h-full text-center text-xl border border-gray-300 rounded-md focus:border-blue-500 focus:outline-none" | ||
| 24 | + /> | ||
| 25 | + </view> | ||
| 26 | + </view> | ||
| 27 | + <!-- Help text --> | ||
| 28 | + <p class="text-gray-500 text-center text-sm mb-8"> | ||
| 29 | + 没有口令?请联系您的大家长获取 | ||
| 30 | + </p> | ||
| 31 | + <!-- Role selection --> | ||
| 32 | + <view class="mb-6"> | ||
| 33 | + <h3 class="text-base font-medium mb-4 border-t pt-4"> | ||
| 34 | + 选择您的身份 | ||
| 35 | + </h3> | ||
| 36 | + <view class="grid grid-cols-2 gap-3"> | ||
| 37 | + <button | ||
| 38 | + v-for="role in familyRoles" | ||
| 39 | + :key="role.id" | ||
| 40 | + :class="[ | ||
| 41 | + 'flex items-center justify-center p-3 border rounded-md', | ||
| 42 | + selectedRole === role.id | ||
| 43 | + ? 'border-blue-500 bg-blue-50' | ||
| 44 | + : 'border-gray-200' | ||
| 45 | + ]" | ||
| 46 | + @click="selectedRole = role.id" | ||
| 47 | + > | ||
| 48 | + <view class="flex flex-col items-center"> | ||
| 49 | + <My | ||
| 50 | + size="20" | ||
| 51 | + :class="[ | ||
| 52 | + 'mb-1', | ||
| 53 | + selectedRole === role.id ? 'text-blue-500' : 'text-gray-400' | ||
| 54 | + ]" | ||
| 55 | + /> | ||
| 56 | + <span | ||
| 57 | + :class="[ | ||
| 58 | + selectedRole === role.id ? 'text-blue-500' : 'text-gray-600' | ||
| 59 | + ]" | ||
| 60 | + > | ||
| 61 | + {{ role.label }} | ||
| 62 | + </span> | ||
| 63 | + </view> | ||
| 64 | + </button> | ||
| 65 | + </view> | ||
| 66 | + </view> | ||
| 67 | + <!-- Submit Button --> | ||
| 68 | + <button | ||
| 69 | + @click="handleJoinFamily" | ||
| 70 | + :disabled="!isComplete" | ||
| 71 | + :class="[ | ||
| 72 | + 'w-full py-4 text-white text-lg font-medium rounded-lg mt-auto', | ||
| 73 | + isComplete ? 'bg-blue-500' : 'bg-gray-300' | ||
| 74 | + ]" | ||
| 75 | + > | ||
| 76 | + 加入家庭 | ||
| 77 | + </button> | ||
| 78 | + </view> | ||
| 79 | + </view> | ||
| 80 | +</template> | ||
| 81 | + | ||
| 82 | +<script setup> | ||
| 83 | +import { ref, computed } from 'vue'; | ||
| 84 | +import Taro from '@tarojs/taro'; | ||
| 85 | +import { My } from '@nutui/icons-vue-taro'; | ||
| 86 | +import AppHeader from '../../components/AppHeader.vue'; | ||
| 87 | + | ||
| 88 | +const mottoChars = ref(['', '', '', '']); | ||
| 89 | +const selectedRole = ref(''); | ||
| 90 | +const inputRefs = ref([]); | ||
| 91 | + | ||
| 92 | +const handleInputChange = (index, value) => { | ||
| 93 | + if (value && !/^[\u4e00-\u9fa5]$/.test(value)) { | ||
| 94 | + return; | ||
| 95 | + } | ||
| 96 | + mottoChars.value[index] = value; | ||
| 97 | + if (value && index < 3) { | ||
| 98 | + // Taro中无法直接操作DOM进行focus,这里仅保留逻辑 | ||
| 99 | + // 在小程序中,可以通过设置 `focus` 属性来控制 | ||
| 100 | + } | ||
| 101 | +}; | ||
| 102 | + | ||
| 103 | +const handleKeyDown = (index, e) => { | ||
| 104 | + if (e.key === 'Backspace' && !mottoChars.value[index] && index > 0) { | ||
| 105 | + // 同样,在Taro中处理光标移动需要不同的方式 | ||
| 106 | + } | ||
| 107 | +}; | ||
| 108 | + | ||
| 109 | +const familyRoles = [ | ||
| 110 | + { id: 'husband', label: '丈夫' }, | ||
| 111 | + { id: 'wife', label: '妻子' }, | ||
| 112 | + { id: 'son', label: '儿子' }, | ||
| 113 | + { id: 'daughter-in-law', label: '儿媳' }, | ||
| 114 | + { id: 'son-in-law', label: '女婿' }, | ||
| 115 | + { id: 'daughter', label: '女儿' }, | ||
| 116 | + { id: 'grandson', label: '孙子' }, | ||
| 117 | + { id: 'maternal-grandson', label: '外孙' }, | ||
| 118 | + { id: 'granddaughter', label: '孙女' }, | ||
| 119 | + { id: 'maternal-granddaughter', label: '外孙女' } | ||
| 120 | +]; | ||
| 121 | + | ||
| 122 | +const isComplete = computed(() => { | ||
| 123 | + return mottoChars.value.every((char) => char) && selectedRole.value; | ||
| 124 | +}); | ||
| 125 | + | ||
| 126 | +const handleJoinFamily = () => { | ||
| 127 | + if (isComplete.value) { | ||
| 128 | + Taro.navigateTo({ | ||
| 129 | + url: '/pages/Dashboard/index' | ||
| 130 | + }); | ||
| 131 | + } | ||
| 132 | +}; | ||
| 133 | +</script> |
src/pages/PointsDetail/index.config.js
0 → 100644
src/pages/PointsDetail/index.less
0 → 100644
File mode changed
src/pages/PointsDetail/index.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <view class="min-h-screen flex flex-col bg-white"> | ||
| 3 | + <!-- Blue header background --> | ||
| 4 | + <view class="bg-blue-500 h-52 absolute w-full top-0 left-0 z-0"></view> | ||
| 5 | + <AppHeader title="积分明细" /> | ||
| 6 | + <!-- Content --> | ||
| 7 | + <view class="relative z-10 flex-1 pb-20"> | ||
| 8 | + <!-- Points display --> | ||
| 9 | + <view class="pt-4 pb-6 flex flex-col items-center"> | ||
| 10 | + <h2 class="text-4xl font-bold text-white mb-1">2580</h2> | ||
| 11 | + <p class="text-white text-opacity-80">当前可用积分</p> | ||
| 12 | + </view> | ||
| 13 | + <!-- Points strategy section --> | ||
| 14 | + <view class="bg-white rounded-t-3xl px-4 pt-5"> | ||
| 15 | + <view class="flex justify-between items-center mb-4"> | ||
| 16 | + <h3 class="text-lg font-medium">积分攻略</h3> | ||
| 17 | + <button class="text-blue-500 text-sm flex items-center"> | ||
| 18 | + 查看全部 | ||
| 19 | + <Right size="16" /> | ||
| 20 | + </button> | ||
| 21 | + </view> | ||
| 22 | + <!-- Strategy cards --> | ||
| 23 | + <view class="space-y-3 mb-6"> | ||
| 24 | + <view class="bg-blue-50 p-4 rounded-lg flex items-start"> | ||
| 25 | + <view class="w-10 h-10 bg-blue-100 rounded-full flex items-center justify-center mr-3"> | ||
| 26 | + <My size="20" class="text-blue-500" /> | ||
| 27 | + </view> | ||
| 28 | + <view> | ||
| 29 | + <h4 class="font-medium">每日同步步数获得积分</h4> | ||
| 30 | + <p class="text-sm text-gray-600"> | ||
| 31 | + 每日前1000步可兑换1积分,每日上限100积分 | ||
| 32 | + </p> | ||
| 33 | + </view> | ||
| 34 | + </view> | ||
| 35 | + <view class="bg-blue-50 p-4 rounded-lg flex items-start"> | ||
| 36 | + <view class="w-10 h-10 bg-blue-100 rounded-full flex items-center justify-center mr-3"> | ||
| 37 | + <Trophy size="20" class="text-blue-500" /> | ||
| 38 | + </view> | ||
| 39 | + <view> | ||
| 40 | + <h4 class="font-medium">参与周末步数挑战</h4> | ||
| 41 | + <p class="text-sm text-gray-600"> | ||
| 42 | + 每周末参与可获得额外200积分奖励 | ||
| 43 | + </p> | ||
| 44 | + </view> | ||
| 45 | + </view> | ||
| 46 | + <view class="bg-blue-50 p-4 rounded-lg flex items-start"> | ||
| 47 | + <view class="w-10 h-10 bg-blue-100 rounded-full flex items-center justify-center mr-3"> | ||
| 48 | + <People size="20" class="text-blue-500" /> | ||
| 49 | + </view> | ||
| 50 | + <view> | ||
| 51 | + <h4 class="font-medium">邀请家人加入家庭</h4> | ||
| 52 | + <p class="text-sm text-gray-600"> | ||
| 53 | + 每成功邀请1位家人,获得500积分奖励 | ||
| 54 | + </p> | ||
| 55 | + </view> | ||
| 56 | + </view> | ||
| 57 | + </view> | ||
| 58 | + <!-- Tabs --> | ||
| 59 | + <view class="border-b border-gray-200"> | ||
| 60 | + <view class="flex space-x-8"> | ||
| 61 | + <button :class="['py-3 font-medium', activeTab === 'all' ? 'text-blue-500 border-b-2 border-blue-500' : 'text-gray-500']" @click="activeTab = 'all'"> | ||
| 62 | + 全部 | ||
| 63 | + </button> | ||
| 64 | + <button :class="['py-3 font-medium', activeTab === 'earned' ? 'text-blue-500 border-b-2 border-blue-500' : 'text-gray-500']" @click="activeTab = 'earned'"> | ||
| 65 | + 已发放 | ||
| 66 | + </button> | ||
| 67 | + <button :class="['py-3 font-medium', activeTab === 'spent' ? 'text-blue-500 border-b-2 border-blue-500' : 'text-gray-500']" @click="activeTab = 'spent'"> | ||
| 68 | + 已消耗 | ||
| 69 | + </button> | ||
| 70 | + </view> | ||
| 71 | + </view> | ||
| 72 | + <!-- Points history list --> | ||
| 73 | + <view class="pt-4"> | ||
| 74 | + <view v-for="item in filteredPoints" :key="item.id" class="py-4 border-b border-gray-100 flex justify-between"> | ||
| 75 | + <view> | ||
| 76 | + <h4 class="font-medium">{{ item.title }}</h4> | ||
| 77 | + <p class="text-sm text-gray-500">{{ item.date }}</p> | ||
| 78 | + </view> | ||
| 79 | + <span :class="['font-medium', item.type === 'earned' ? 'text-green-500' : 'text-red-500']"> | ||
| 80 | + {{ item.type === 'earned' ? '+' : '-' }} | ||
| 81 | + {{ item.points }} | ||
| 82 | + </span> | ||
| 83 | + </view> | ||
| 84 | + </view> | ||
| 85 | + </view> | ||
| 86 | + </view> | ||
| 87 | + <BottomNav /> | ||
| 88 | + </view> | ||
| 89 | +</template> | ||
| 90 | + | ||
| 91 | +<script setup> | ||
| 92 | +import { ref, computed } from 'vue'; | ||
| 93 | +import AppHeader from '../../components/AppHeader.vue'; | ||
| 94 | +import BottomNav from '../../components/BottomNav.vue'; | ||
| 95 | +import { Right, My, Trophy, People } from '@nutui/icons-vue-taro'; | ||
| 96 | + | ||
| 97 | +const activeTab = ref('all'); | ||
| 98 | + | ||
| 99 | +const pointsHistory = ref([ | ||
| 100 | + { | ||
| 101 | + id: 1, | ||
| 102 | + title: '每日步数奖励', | ||
| 103 | + date: '2025-08-24 09:30', | ||
| 104 | + points: 100, | ||
| 105 | + type: 'earned' | ||
| 106 | + }, | ||
| 107 | + { | ||
| 108 | + id: 2, | ||
| 109 | + title: '周末步数挑战完成', | ||
| 110 | + date: '2025-08-24 08:15', | ||
| 111 | + points: 200, | ||
| 112 | + type: 'earned' | ||
| 113 | + }, | ||
| 114 | + { | ||
| 115 | + id: 3, | ||
| 116 | + title: '兑换杏花楼85折券', | ||
| 117 | + date: '2025-08-23 15:20', | ||
| 118 | + points: 10, | ||
| 119 | + type: 'spent' | ||
| 120 | + }, | ||
| 121 | + { | ||
| 122 | + id: 4, | ||
| 123 | + title: '邀请家人奖励', | ||
| 124 | + date: '2025-08-23 14:00', | ||
| 125 | + points: 500, | ||
| 126 | + type: 'earned' | ||
| 127 | + }, | ||
| 128 | + { | ||
| 129 | + id: 5, | ||
| 130 | + title: '兑换老凤祥9折券', | ||
| 131 | + date: '2025-08-22 16:45', | ||
| 132 | + points: 1000, | ||
| 133 | + type: 'spent' | ||
| 134 | + } | ||
| 135 | +]); | ||
| 136 | + | ||
| 137 | +const filteredPoints = computed(() => { | ||
| 138 | + if (activeTab.value === 'all') { | ||
| 139 | + return pointsHistory.value; | ||
| 140 | + } | ||
| 141 | + return pointsHistory.value.filter(p => p.type === activeTab.value); | ||
| 142 | +}); | ||
| 143 | +</script> |
src/pages/PrivacyPolicy/index.config.js
0 → 100644
src/pages/PrivacyPolicy/index.less
0 → 100644
File mode changed
src/pages/PrivacyPolicy/index.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <view class="min-h-screen flex flex-col bg-white"> | ||
| 3 | + <AppHeader title="隐私政策" /> | ||
| 4 | + <view class="flex-1 px-4 py-6 pb-20"> | ||
| 5 | + <view class="prose prose-sm max-w-none"> | ||
| 6 | + <h2 class="text-xl font-bold mb-4">老来赛隐私政策</h2> | ||
| 7 | + <p class="text-gray-700 mb-4"> | ||
| 8 | + 本隐私政策旨在帮助您了解我们如何收集、使用、存储和共享您的个人信息,以及您如何访问、更新、控制和保护您的个人信息。请您在使用我们的服务前,仔细阅读并了解本隐私政策。 | ||
| 9 | + </p> | ||
| 10 | + <h3 class="text-lg font-semibold mt-6 mb-2">一、我们收集的信息</h3> | ||
| 11 | + <p class="text-gray-700 mb-4"> | ||
| 12 | + 为了向您提供服务,我们可能会收集以下类型的信息: | ||
| 13 | + </p> | ||
| 14 | + <ul class="list-disc pl-5 mb-4 text-gray-700"> | ||
| 15 | + <li> | ||
| 16 | + <strong>您提供的信息:</strong> | ||
| 17 | + 当您注册账号、使用我们的服务或联系我们时,您可能会提供姓名、电话号码、电子邮件地址等个人信息。 | ||
| 18 | + </li> | ||
| 19 | + <li> | ||
| 20 | + <strong>设备信息:</strong> | ||
| 21 | + 我们可能会收集设备型号、操作系统版本、设备设置、唯一设备标识符等信息。 | ||
| 22 | + </li> | ||
| 23 | + <li> | ||
| 24 | + <strong>日志信息:</strong> | ||
| 25 | + 当您使用我们的服务时,我们的服务器会自动记录您的搜索查询、IP地址、浏览器类型、语言设置、访问日期和时间等信息。 | ||
| 26 | + </li> | ||
| 27 | + <li> | ||
| 28 | + <strong>位置信息:</strong> | ||
| 29 | + 经您同意,我们可能会收集和处理有关您实际位置的信息,以便为您提供相关服务。 | ||
| 30 | + </li> | ||
| 31 | + <li> | ||
| 32 | + <strong>微信步数信息:</strong> | ||
| 33 | + 经您授权,我们会从微信获取您的步数信息,用于计算积分和提供健康服务。 | ||
| 34 | + </li> | ||
| 35 | + </ul> | ||
| 36 | + <h3 class="text-lg font-semibold mt-6 mb-2"> | ||
| 37 | + 二、我们如何使用收集的信息 | ||
| 38 | + </h3> | ||
| 39 | + <p class="text-gray-700 mb-4"> | ||
| 40 | + 我们可能将收集的信息用于以下目的: | ||
| 41 | + </p> | ||
| 42 | + <ul class="list-disc pl-5 mb-4 text-gray-700"> | ||
| 43 | + <li>提供、维护和改进我们的服务</li> | ||
| 44 | + <li>开发新的服务和功能</li> | ||
| 45 | + <li>了解您如何使用我们的服务</li> | ||
| 46 | + <li>个性化我们的服务,包括提供推荐、个性化内容和广告</li> | ||
| 47 | + <li>进行身份验证、安全防护、存档和备份</li> | ||
| 48 | + <li>发送服务通知和与您沟通</li> | ||
| 49 | + <li>评估服务中的广告和其他促销及推广活动的效果</li> | ||
| 50 | + <li>改进我们的广告投放和测量效果</li> | ||
| 51 | + </ul> | ||
| 52 | + <h3 class="text-lg font-semibold mt-6 mb-2">三、信息共享与披露</h3> | ||
| 53 | + <p class="text-gray-700 mb-4"> | ||
| 54 | + 除以下情况外,未经您同意,我们不会与任何第三方分享您的个人信息: | ||
| 55 | + </p> | ||
| 56 | + <ul class="list-disc pl-5 mb-4 text-gray-700"> | ||
| 57 | + <li> | ||
| 58 | + <strong>合作伙伴:</strong> | ||
| 59 | + 我们可能与合作伙伴共享您的某些信息,以便他们为您提供或改进我们的服务。 | ||
| 60 | + </li> | ||
| 61 | + <li> | ||
| 62 | + <strong>服务提供商:</strong> | ||
| 63 | + 我们可能会委托受信任的第三方代表我们提供服务,例如数据分析、发送电子邮件、提供客户服务等。 | ||
| 64 | + </li> | ||
| 65 | + <li> | ||
| 66 | + <strong>法律要求:</strong> | ||
| 67 | + 如果法律要求披露您的个人信息,或者我们有理由相信需要这样做以遵守法律程序、应对索赔或保护我们的用户的权利、财产或安全,我们将披露您的个人信息。 | ||
| 68 | + </li> | ||
| 69 | + <li> | ||
| 70 | + <strong>业务转让:</strong> | ||
| 71 | + 如果我们参与合并、收购或资产出售,您的个人信息可能作为此类交易的一部分被转让。 | ||
| 72 | + </li> | ||
| 73 | + </ul> | ||
| 74 | + <h3 class="text-lg font-semibold mt-6 mb-2">四、信息安全</h3> | ||
| 75 | + <p class="text-gray-700 mb-4"> | ||
| 76 | + 我们致力于保护您的个人信息安全。我们采取各种安全技术和程序,以防止信息的丢失、不当使用、未经授权的访问或披露。但请理解,由于技术的限制以及可能存在的各种恶意手段,在互联网行业,即便竭尽所能加强安全措施,也不可能始终保证信息百分之百的安全。 | ||
| 77 | + </p> | ||
| 78 | + <h3 class="text-lg font-semibold mt-6 mb-2">五、您的权利</h3> | ||
| 79 | + <p class="text-gray-700 mb-4">根据适用的法律法规,您可能有权:</p> | ||
| 80 | + <ul class="list-disc pl-5 mb-4 text-gray-700"> | ||
| 81 | + <li>访问您的个人信息</li> | ||
| 82 | + <li>更正不准确的个人信息</li> | ||
| 83 | + <li>删除您的个人信息</li> | ||
| 84 | + <li>反对或限制对您个人信息的处理</li> | ||
| 85 | + <li>数据可携带性</li> | ||
| 86 | + <li>撤回您的同意</li> | ||
| 87 | + </ul> | ||
| 88 | + <p class="text-gray-700 mb-4"> | ||
| 89 | + 如果您想行使这些权利,请通过本隐私政策中提供的联系方式与我们联系。 | ||
| 90 | + </p> | ||
| 91 | + <h3 class="text-lg font-semibold mt-6 mb-2">六、儿童隐私</h3> | ||
| 92 | + <p class="text-gray-700 mb-4"> | ||
| 93 | + 我们的服务主要面向成年人。如果您是未满18岁的未成年人,您应当在父母或监护人的陪同下阅读本隐私政策,并在征得您的父母或监护人同意的前提下使用我们的服务和提供个人信息。 | ||
| 94 | + </p> | ||
| 95 | + <h3 class="text-lg font-semibold mt-6 mb-2">七、隐私政策的更新</h3> | ||
| 96 | + <p class="text-gray-700 mb-4"> | ||
| 97 | + 我们可能会不时更新本隐私政策。当我们更新隐私政策时,我们会在应用内发布更新后的隐私政策,并更新"最后更新"日期。在某些情况下,我们还会通过其他方式通知您,例如在我们的应用程序中显示醒目通知或发送电子邮件通知。我们鼓励您定期查看本隐私政策,以了解我们如何保护您的信息。 | ||
| 98 | + </p> | ||
| 99 | + <h3 class="text-lg font-semibold mt-6 mb-2">八、联系我们</h3> | ||
| 100 | + <p class="text-gray-700 mb-4"> | ||
| 101 | + 如果您对本隐私政策有任何疑问、意见或建议,请通过以下方式与我们联系: | ||
| 102 | + </p> | ||
| 103 | + <p class="text-gray-700 mb-4"> | ||
| 104 | + 电子邮件:privacy@laolaisai.com | ||
| 105 | + <br /> | ||
| 106 | + 电话:400-888-8888 | ||
| 107 | + </p> | ||
| 108 | + <p class="text-gray-700 mt-8">最后更新日期:2023年5月1日</p> | ||
| 109 | + </view> | ||
| 110 | + </view> | ||
| 111 | + <BottomNav /> | ||
| 112 | + </view> | ||
| 113 | +</template> | ||
| 114 | + | ||
| 115 | +<script setup> | ||
| 116 | +import AppHeader from '../../components/AppHeader.vue'; | ||
| 117 | +import BottomNav from '../../components/BottomNav.vue'; | ||
| 118 | +</script> |
src/pages/Profile/index.config.js
0 → 100644
src/pages/Profile/index.less
0 → 100644
File mode changed
src/pages/Profile/index.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <view class="min-h-screen flex flex-col bg-white"> | ||
| 3 | + <!-- Blue header background --> | ||
| 4 | + <view class="bg-blue-500 h-40 absolute w-full top-0 left-0 z-0"></view> | ||
| 5 | + <!-- Content --> | ||
| 6 | + <view class="relative z-10 flex-1 pb-20"> | ||
| 7 | + <!-- User profile section --> | ||
| 8 | + <view class="px-4 pt-8 pb-6 flex items-center justify-between"> | ||
| 9 | + <view class="flex items-center"> | ||
| 10 | + <image src="https://randomuser.me/api/portraits/men/32.jpg" alt="User avatar" class="w-16 h-16 rounded-full border-2 border-white" /> | ||
| 11 | + <view class="ml-4"> | ||
| 12 | + <h1 class="text-xl font-bold text-white">张爷爷</h1> | ||
| 13 | + </view> | ||
| 14 | + </view> | ||
| 15 | + <button class="text-white"> | ||
| 16 | + <span>编辑</span> | ||
| 17 | + </button> | ||
| 18 | + </view> | ||
| 19 | + <!-- Menu items --> | ||
| 20 | + <view class="bg-white rounded-t-3xl px-4 py-5"> | ||
| 21 | + <view class="space-y-px"> | ||
| 22 | + <template v-for="(item, index) in menuItems" :key="item.id"> | ||
| 23 | + <view class="flex items-center py-4 cursor-pointer" @click="item.onClick"> | ||
| 24 | + <view :class="['w-10 h-10', item.color, 'rounded-full flex items-center justify-center mr-4']"> | ||
| 25 | + <component :is="item.icon" size="20" class="text-white" /> | ||
| 26 | + </view> | ||
| 27 | + <span class="flex-1 text-lg">{{ item.label }}</span> | ||
| 28 | + <Right size="20" class="text-gray-400" /> | ||
| 29 | + </view> | ||
| 30 | + <view v-if="index < menuItems.length - 1" class="h-px bg-gray-100" /> | ||
| 31 | + </template> | ||
| 32 | + </view> | ||
| 33 | + </view> | ||
| 34 | + </view> | ||
| 35 | + <BottomNav /> | ||
| 36 | + </view> | ||
| 37 | +</template> | ||
| 38 | + | ||
| 39 | +<script setup> | ||
| 40 | +import { ref } from 'vue'; | ||
| 41 | +import Taro from '@tarojs/taro'; | ||
| 42 | +import BottomNav from '../../components/BottomNav.vue'; | ||
| 43 | +import { Chart, Gift, Message, Document, Shield, Right } from '@nutui/icons-vue-taro'; | ||
| 44 | + | ||
| 45 | +const menuItems = ref([ | ||
| 46 | + { | ||
| 47 | + id: 'points', | ||
| 48 | + icon: Chart, | ||
| 49 | + label: '积分明细', | ||
| 50 | + color: 'bg-blue-500', | ||
| 51 | + onClick: () => Taro.navigateTo({ url: '/pages/PointsDetail/index' }) | ||
| 52 | + }, | ||
| 53 | + { | ||
| 54 | + id: 'rewards', | ||
| 55 | + icon: Gift, | ||
| 56 | + label: '我的兑换', | ||
| 57 | + color: 'bg-blue-500', | ||
| 58 | + onClick: () => Taro.navigateTo({ url: '/pages/Rewards/index' }) | ||
| 59 | + }, | ||
| 60 | + { | ||
| 61 | + id: 'feedback', | ||
| 62 | + icon: Message, | ||
| 63 | + label: '意见反馈', | ||
| 64 | + color: 'bg-blue-500', | ||
| 65 | + onClick: () => Taro.navigateTo({ url: '/pages/Feedback/index' }) | ||
| 66 | + }, | ||
| 67 | + { | ||
| 68 | + id: 'agreement', | ||
| 69 | + icon: Document, | ||
| 70 | + label: '用户协议', | ||
| 71 | + color: 'bg-blue-500', | ||
| 72 | + onClick: () => Taro.navigateTo({ url: '/pages/UserAgreement/index' }) | ||
| 73 | + }, | ||
| 74 | + { | ||
| 75 | + id: 'privacy', | ||
| 76 | + icon: Shield, | ||
| 77 | + label: '隐私政策', | ||
| 78 | + color: 'bg-blue-500', | ||
| 79 | + onClick: () => Taro.navigateTo({ url: '/pages/PrivacyPolicy/index' }) | ||
| 80 | + } | ||
| 81 | +]); | ||
| 82 | +</script> |
src/pages/RewardCategories/index.config.js
0 → 100644
src/pages/RewardCategories/index.less
0 → 100644
File mode changed
src/pages/RewardCategories/index.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <view class="min-h-screen flex flex-col bg-white"> | ||
| 3 | + <AppHeader title="积分兑换" :showBack="false" /> | ||
| 4 | + <view class="flex-1 pb-20"> | ||
| 5 | + <view class="p-4 space-y-4"> | ||
| 6 | + <view v-for="category in categories" :key="category.id" class="rounded-lg overflow-hidden shadow-sm" @click="goToRewards"> | ||
| 7 | + <template v-if="category.id !== 'merchants'"> | ||
| 8 | + <view class="relative h-40"> | ||
| 9 | + <view class="absolute inset-0 bg-black bg-opacity-30 flex flex-col justify-end p-4 text-white" :style="{ background: category.bgColor || 'linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.6))' }"> | ||
| 10 | + <h3 class="text-xl font-bold mb-1">{{ category.title }}</h3> | ||
| 11 | + <p class="text-sm text-white text-opacity-90"> | ||
| 12 | + {{ category.description }} | ||
| 13 | + </p> | ||
| 14 | + </view> | ||
| 15 | + <image :src="category.image" :alt="category.title" class="w-full h-full object-cover" :style="{ objectPosition: category.bgPosition || 'center' }" /> | ||
| 16 | + <view v-if="category.iconUrl" class="absolute top-4 left-4 w-12 h-12 bg-white bg-opacity-90 rounded-full flex items-center justify-center"> | ||
| 17 | + <image :src="category.iconUrl" alt="" class="w-8 h-8" /> | ||
| 18 | + </view> | ||
| 19 | + </view> | ||
| 20 | + </template> | ||
| 21 | + <template v-else> | ||
| 22 | + <view class="bg-white border border-gray-100 rounded-lg p-4"> | ||
| 23 | + <view class="flex justify-between items-center mb-3"> | ||
| 24 | + <view> | ||
| 25 | + <h3 class="text-lg font-bold">{{ category.title }}</h3> | ||
| 26 | + <p class="text-sm text-gray-600"> | ||
| 27 | + {{ category.description }} | ||
| 28 | + </p> | ||
| 29 | + </view> | ||
| 30 | + <Right size="20" class="text-gray-400" /> | ||
| 31 | + </view> | ||
| 32 | + <view class="grid grid-cols-5 gap-2"> | ||
| 33 | + <view v-for="(merchant, index) in category.merchants.slice(0, 10)" :key="index" class="flex flex-col items-center"> | ||
| 34 | + <image :src="merchant.logo" :alt="merchant.name" class="w-12 h-12 object-contain rounded-md" /> | ||
| 35 | + <span class="text-xs text-gray-600 mt-1 text-center truncate w-full"> | ||
| 36 | + {{ merchant.name }} | ||
| 37 | + </span> | ||
| 38 | + </view> | ||
| 39 | + </view> | ||
| 40 | + </view> | ||
| 41 | + </template> | ||
| 42 | + </view> | ||
| 43 | + </view> | ||
| 44 | + </view> | ||
| 45 | + <BottomNav /> | ||
| 46 | + </view> | ||
| 47 | +</template> | ||
| 48 | + | ||
| 49 | +<script setup> | ||
| 50 | +import { ref } from 'vue'; | ||
| 51 | +import Taro from '@tarojs/taro'; | ||
| 52 | +import AppHeader from '../../components/AppHeader.vue'; | ||
| 53 | +import BottomNav from '../../components/BottomNav.vue'; | ||
| 54 | +import { Right } from '@nutui/icons-vue-taro'; | ||
| 55 | + | ||
| 56 | +const categories = ref([ | ||
| 57 | + { | ||
| 58 | + id: 'health', | ||
| 59 | + title: '银龄健康特色兑换区', | ||
| 60 | + description: '南京商圈线下实体店消费积分兑换', | ||
| 61 | + image: "/static/images/rewards/reward-banner.png", | ||
| 62 | + bgPosition: 'center' | ||
| 63 | + }, | ||
| 64 | + { | ||
| 65 | + id: 'online', | ||
| 66 | + title: '民政领域网上商城"银龄购"', | ||
| 67 | + description: '线上康复健康购物积分兑换', | ||
| 68 | + image: 'https://images.unsplash.com/photo-1563013544-824ae1b704d3?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1740&q=80', | ||
| 69 | + bgPosition: 'center', | ||
| 70 | + bgColor: 'linear-gradient(135deg, #0ea5e9, #2563eb)', | ||
| 71 | + iconUrl: 'https://cdn-icons-png.flaticon.com/512/3144/3144456.png' | ||
| 72 | + }, | ||
| 73 | + { | ||
| 74 | + id: 'merchants', | ||
| 75 | + title: '人驻商户多元场景广覆盖', | ||
| 76 | + description: '丰富商户积分兑换', | ||
| 77 | + image: 'https://images.unsplash.com/photo-1607082349566-187342175e2f?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1740&q=80', | ||
| 78 | + bgPosition: 'center', | ||
| 79 | + merchants: [ | ||
| 80 | + { name: '上海老饭店', logo: 'https://placehold.co/100x100/e2f3ff/0369a1?text=上海老饭店&font=roboto' }, | ||
| 81 | + { name: '功德林', logo: 'https://placehold.co/100x100/e2f3ff/0369a1?text=功德林&font=roboto' }, | ||
| 82 | + { name: '一茶一坐', logo: 'https://placehold.co/100x100/e2f3ff/0369a1?text=一茶一坐&font=roboto' }, | ||
| 83 | + { name: '杏花楼', logo: 'https://placehold.co/100x100/e2f3ff/0369a1?text=杏花楼&font=roboto' }, | ||
| 84 | + { name: '新雅', logo: 'https://placehold.co/100x100/e2f3ff/0369a1?text=新雅&font=roboto' }, | ||
| 85 | + { name: '五芳斋', logo: 'https://placehold.co/100x100/e2f3ff/0369a1?text=五芳斋&font=roboto' }, | ||
| 86 | + { name: '沈大成', logo: 'https://placehold.co/100x100/e2f3ff/0369a1?text=沈大成&font=roboto' }, | ||
| 87 | + { name: '老凤祥', logo: 'https://placehold.co/100x100/e2f3ff/0369a1?text=老凤祥&font=roboto' }, | ||
| 88 | + { name: '御宝轩', logo: 'https://placehold.co/100x100/e2f3ff/0369a1?text=御宝轩&font=roboto' }, | ||
| 89 | + { name: '恒源祥', logo: 'https://placehold.co/100x100/e2f3ff/0369a1?text=恒源祥&font=roboto' } | ||
| 90 | + ] | ||
| 91 | + } | ||
| 92 | +]); | ||
| 93 | + | ||
| 94 | +const goToRewards = () => { | ||
| 95 | + Taro.navigateTo({ url: '/pages/Rewards/index' }); | ||
| 96 | +}; | ||
| 97 | +</script> |
src/pages/RewardDetail/index.config.js
0 → 100644
src/pages/RewardDetail/index.less
0 → 100644
File mode changed
src/pages/RewardDetail/index.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <view class="min-h-screen flex flex-col bg-gradient-to-br from-blue-50 to-purple-50"> | ||
| 3 | + <AppHeader title="优惠券详情" /> | ||
| 4 | + <view class="flex-1 p-4"> | ||
| 5 | + <template v-if="!redeemed"> | ||
| 6 | + <view class="bg-white rounded-2xl shadow-sm overflow-hidden mb-4"> | ||
| 7 | + <view class="h-40 bg-blue-600 flex items-center justify-center p-6"> | ||
| 8 | + <image :src="reward.image" :alt="reward.merchant" class="max-h-full max-w-full object-contain" /> | ||
| 9 | + </view> | ||
| 10 | + <view class="p-4"> | ||
| 11 | + <h1 class="text-xl font-medium mb-1">{{ reward.title }}</h1> | ||
| 12 | + <p class="text-gray-600">{{ reward.description }}</p> | ||
| 13 | + <view class="flex items-center mt-4 text-blue-600"> | ||
| 14 | + <Ticket size="20" class="mr-2" /> | ||
| 15 | + <span class="font-medium">{{ reward.points }} 积分</span> | ||
| 16 | + </view> | ||
| 17 | + </view> | ||
| 18 | + </view> | ||
| 19 | + | ||
| 20 | + <GlassCard class="mb-4"> | ||
| 21 | + <h2 class="text-lg font-medium mb-4">使用须知</h2> | ||
| 22 | + <view class="space-y-3"> | ||
| 23 | + <view class="flex"> | ||
| 24 | + <Calendar size="20" class="text-gray-500 mr-3 flex-shrink-0" /> | ||
| 25 | + <view> | ||
| 26 | + <p class="font-medium">有效期</p> | ||
| 27 | + <p class="text-gray-600">{{ reward.validUntil }}</p> | ||
| 28 | + </view> | ||
| 29 | + </view> | ||
| 30 | + <view class="flex"> | ||
| 31 | + <Location2 size="20" class="text-gray-500 mr-3 flex-shrink-0" /> | ||
| 32 | + <view> | ||
| 33 | + <p class="font-medium">适用门店</p> | ||
| 34 | + <p class="text-gray-600">{{ reward.locations }}</p> | ||
| 35 | + </view> | ||
| 36 | + </view> | ||
| 37 | + </view> | ||
| 38 | + </GlassCard> | ||
| 39 | + | ||
| 40 | + <GlassCard class="mb-6"> | ||
| 41 | + <h2 class="text-lg font-medium mb-4">使用条款</h2> | ||
| 42 | + <view class="space-y-2"> | ||
| 43 | + <view v-for="(term, index) in reward.terms" :key="index" class="flex"> | ||
| 44 | + <Info size="16" class="text-gray-500 mr-2 flex-shrink-0 mt-0.5" /> | ||
| 45 | + <p class="text-gray-600">{{ term }}</p> | ||
| 46 | + </view> | ||
| 47 | + </view> | ||
| 48 | + </GlassCard> | ||
| 49 | + | ||
| 50 | + <PrimaryButton @click="handleRedeem" :disabled="redeeming"> | ||
| 51 | + <template v-if="redeeming"> | ||
| 52 | + <view class="animate-spin mr-2"> | ||
| 53 | + <Loading class="w-5 h-5" /> | ||
| 54 | + </view> | ||
| 55 | + 兑换中... | ||
| 56 | + </template> | ||
| 57 | + <template v-else> | ||
| 58 | + 立即兑换 | ||
| 59 | + </template> | ||
| 60 | + </PrimaryButton> | ||
| 61 | + </template> | ||
| 62 | + | ||
| 63 | + <template v-else> | ||
| 64 | + <view class="flex flex-col items-center justify-center h-full"> | ||
| 65 | + <GlassCard class="w-full max-w-md"> | ||
| 66 | + <view class="flex flex-col items-center"> | ||
| 67 | + <view class="w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mb-4"> | ||
| 68 | + <Check size="40" class="text-green-600" /> | ||
| 69 | + </view> | ||
| 70 | + <h2 class="text-xl font-medium mb-2">兑换成功</h2> | ||
| 71 | + <p class="text-gray-600 text-center mb-6"> | ||
| 72 | + 您已成功兑换{{ reward.title }} | ||
| 73 | + </p> | ||
| 74 | + <view class="bg-gray-50 w-full rounded-lg p-4 mb-6 text-center"> | ||
| 75 | + <p class="text-gray-600 mb-2">兑换码</p> | ||
| 76 | + <p class="text-2xl font-mono tracking-wider font-medium"> | ||
| 77 | + SB12345678 | ||
| 78 | + </p> | ||
| 79 | + </view> | ||
| 80 | + <image :src="reward.image" :alt="reward.merchant" class="w-24 h-24 object-contain mb-6" /> | ||
| 81 | + <view class="text-center mb-6"> | ||
| 82 | + <p class="font-medium">{{ reward.title }}</p> | ||
| 83 | + <p class="text-gray-600">{{ reward.description }}</p> | ||
| 84 | + <p class="text-gray-500 text-sm mt-2"> | ||
| 85 | + 有效期至: {{ reward.validUntil }} | ||
| 86 | + </p> | ||
| 87 | + </view> | ||
| 88 | + <PrimaryButton @click="goBack"> | ||
| 89 | + 返回兑换页面 | ||
| 90 | + </PrimaryButton> | ||
| 91 | + </view> | ||
| 92 | + </GlassCard> | ||
| 93 | + </view> | ||
| 94 | + </template> | ||
| 95 | + </view> | ||
| 96 | + </view> | ||
| 97 | +</template> | ||
| 98 | + | ||
| 99 | +<script setup> | ||
| 100 | +import { ref } from 'vue'; | ||
| 101 | +import Taro from '@tarojs/taro'; | ||
| 102 | +import AppHeader from '../../components/AppHeader.vue'; | ||
| 103 | +import GlassCard from '../../components/GlassCard.vue'; | ||
| 104 | +import PrimaryButton from '../../components/PrimaryButton.vue'; | ||
| 105 | +import { Ticket, Calendar, Location2, Info, Check, Loading } from '@nutui/icons-vue-taro'; | ||
| 106 | + | ||
| 107 | +const redeeming = ref(false); | ||
| 108 | +const redeemed = ref(false); | ||
| 109 | + | ||
| 110 | +// Mock reward data | ||
| 111 | +const reward = { | ||
| 112 | + id: 1, | ||
| 113 | + title: '星巴克咖啡券', | ||
| 114 | + description: '任意中杯咖啡一杯', | ||
| 115 | + points: 500, | ||
| 116 | + merchant: '星巴克', | ||
| 117 | + image: 'https://upload.wikimedia.org/wikipedia/en/thumb/d/d3/Starbucks_Corporation_Logo_2011.svg/1200px-Starbucks_Corporation_Logo_2011.svg.png', | ||
| 118 | + validUntil: '2023年12月31日', | ||
| 119 | + locations: '全国各星巴克门店', | ||
| 120 | + terms: ['每人限兑换1次', '不与其他优惠同享', '使用时请出示兑换码', '最终解释权归商家所有'] | ||
| 121 | +}; | ||
| 122 | + | ||
| 123 | +const handleRedeem = () => { | ||
| 124 | + redeeming.value = true; | ||
| 125 | + // Simulate API call | ||
| 126 | + setTimeout(() => { | ||
| 127 | + redeeming.value = false; | ||
| 128 | + redeemed.value = true; | ||
| 129 | + }, 1500); | ||
| 130 | +}; | ||
| 131 | + | ||
| 132 | +const goBack = () => { | ||
| 133 | + Taro.navigateTo({ url: '/pages/Rewards/index' }); | ||
| 134 | +}; | ||
| 135 | + | ||
| 136 | +</script> |
src/pages/Rewards/index.config.js
0 → 100644
src/pages/Rewards/index.less
0 → 100644
File mode changed
src/pages/Rewards/index.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <view class="min-h-screen flex flex-col bg-white"> | ||
| 3 | + <!-- Blue header background --> | ||
| 4 | + <view class="bg-blue-500 h-48 absolute w-full top-0 left-0 z-0"></view> | ||
| 5 | + <AppHeader title="兑换中心" :showBack="false" /> | ||
| 6 | + <!-- Content --> | ||
| 7 | + <view class="relative z-10 flex-1 pb-20"> | ||
| 8 | + <!-- Points display --> | ||
| 9 | + <view class="pt-4 pb-8 flex flex-col items-center"> | ||
| 10 | + <h2 class="text-4xl font-bold text-white mb-1">2580分</h2> | ||
| 11 | + <p class="text-white text-opacity-80">我的积分</p> | ||
| 12 | + </view> | ||
| 13 | + <!-- Main content --> | ||
| 14 | + <view class="bg-white rounded-t-3xl px-4 pt-5"> | ||
| 15 | + <!-- Quick exchange options --> | ||
| 16 | + <view class="flex gap-3 mb-6"> | ||
| 17 | + <button v-for="option in quickExchangeOptions" :key="option.points" class="flex-1 py-3 bg-white border border-gray-200 rounded-lg text-center text-gray-700"> | ||
| 18 | + {{ option.label }} | ||
| 19 | + </button> | ||
| 20 | + </view> | ||
| 21 | + <h3 class="text-lg font-medium mb-4">可兑换列表</h3> | ||
| 22 | + <!-- Rewards list --> | ||
| 23 | + <view class="space-y-4"> | ||
| 24 | + <view v-for="reward in rewardItems" :key="reward.id" class="flex items-center border-b border-gray-100 pb-4"> | ||
| 25 | + <view class="w-12 h-12 mr-4 flex-shrink-0"> | ||
| 26 | + <image :src="reward.logo" :alt="reward.title" class="w-full h-full object-contain" /> | ||
| 27 | + </view> | ||
| 28 | + <view class="flex-1"> | ||
| 29 | + <h4 class="font-medium">{{ reward.title }}</h4> | ||
| 30 | + <p class="text-gray-500 text-sm">{{ reward.points }}积分</p> | ||
| 31 | + </view> | ||
| 32 | + <button class="px-4 py-1 bg-blue-500 text-white rounded-full text-sm"> | ||
| 33 | + 兑换 | ||
| 34 | + </button> | ||
| 35 | + </view> | ||
| 36 | + </view> | ||
| 37 | + </view> | ||
| 38 | + </view> | ||
| 39 | + <BottomNav /> | ||
| 40 | + </view> | ||
| 41 | +</template> | ||
| 42 | + | ||
| 43 | +<script setup> | ||
| 44 | +import { ref } from 'vue'; | ||
| 45 | +import AppHeader from '../../components/AppHeader.vue'; | ||
| 46 | +import BottomNav from '../../components/BottomNav.vue'; | ||
| 47 | + | ||
| 48 | +const rewardItems = ref([ | ||
| 49 | + { | ||
| 50 | + id: 1, | ||
| 51 | + title: '星巴克中杯咖啡兑换券', | ||
| 52 | + points: 1000, | ||
| 53 | + logo: 'https://upload.wikimedia.org/wikipedia/en/thumb/d/d3/Starbucks_Corporation_Logo_2011.svg/1200px-Starbucks_Corporation_Logo_2011.svg.png' | ||
| 54 | + }, | ||
| 55 | + { | ||
| 56 | + id: 2, | ||
| 57 | + title: '老凤祥20元抵用券', | ||
| 58 | + points: 600, | ||
| 59 | + logo: 'https://placehold.co/400x400/e2f3ff/0369a1?text=LFX&font=roboto' | ||
| 60 | + }, | ||
| 61 | + { | ||
| 62 | + id: 3, | ||
| 63 | + title: '杏花楼集团8折券', | ||
| 64 | + points: 500, | ||
| 65 | + logo: 'https://placehold.co/400x400/e2f3ff/0369a1?text=XHL&font=roboto' | ||
| 66 | + }, | ||
| 67 | + { | ||
| 68 | + id: 4, | ||
| 69 | + title: '肯德基汉堡套餐券', | ||
| 70 | + points: 1000, | ||
| 71 | + logo: 'https://upload.wikimedia.org/wikipedia/en/thumb/b/bf/KFC_logo.svg/1200px-KFC_logo.svg.png' | ||
| 72 | + }, | ||
| 73 | + { | ||
| 74 | + id: 5, | ||
| 75 | + title: '沈大成双黄团3元抵用券', | ||
| 76 | + points: 300, | ||
| 77 | + logo: 'https://placehold.co/400x400/e2f3ff/0369a1?text=SDC&font=roboto' | ||
| 78 | + } | ||
| 79 | +]); | ||
| 80 | + | ||
| 81 | +const quickExchangeOptions = ref([ | ||
| 82 | + { points: 3000, label: '3000分可兑' }, | ||
| 83 | + { points: 1000, label: '1000分可兑' }, | ||
| 84 | + { points: 100, label: '100分可兑' } | ||
| 85 | +]); | ||
| 86 | +</script> |
src/pages/UserAgreement/index.config.js
0 → 100644
src/pages/UserAgreement/index.less
0 → 100644
File mode changed
src/pages/UserAgreement/index.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <view class="min-h-screen flex flex-col bg-white"> | ||
| 3 | + <AppHeader title="用户协议" /> | ||
| 4 | + <view class="flex-1 px-4 py-6 pb-20"> | ||
| 5 | + <view class="prose prose-sm max-w-none"> | ||
| 6 | + <h2 class="text-xl font-bold mb-4">老来赛用户协议</h2> | ||
| 7 | + <p class="text-gray-700 mb-4"> | ||
| 8 | + 欢迎您使用老来赛应用服务。在使用老来赛应用服务之前,请您务必仔细阅读并透彻理解本用户协议。 | ||
| 9 | + </p> | ||
| 10 | + <h3 class="text-lg font-semibold mt-6 mb-2">一、协议的范围</h3> | ||
| 11 | + <p class="text-gray-700 mb-4"> | ||
| 12 | + 本协议是您与老来赛应用之间关于您使用老来赛应用服务所订立的协议。"老来赛"是指老来赛应用及其开发者。"用户"是指注册、登录、使用本服务的个人或组织。本服务包括老来赛应用及相关网站。 | ||
| 13 | + </p> | ||
| 14 | + <h3 class="text-lg font-semibold mt-6 mb-2"> | ||
| 15 | + 二、账号注册与使用 | ||
| 16 | + </h3> | ||
| 17 | + <p class="text-gray-700 mb-4"> | ||
| 18 | + 1. | ||
| 19 | + 用户在使用本服务前需要注册一个老来赛账号。老来赛账号应当使用手机号码绑定注册,请用户使用尚未与老来赛账号绑定的手机号码,以及未被老来赛根据本协议封禁的手机号码注册老来赛账号。 | ||
| 20 | + </p> | ||
| 21 | + <p class="text-gray-700 mb-4"> | ||
| 22 | + 2. | ||
| 23 | + 用户应当对账号信息的真实性、合法性、有效性承担全部责任。用户不得冒充他人或利用他人的名义注册账号,不得利用多个手机号注册多个账号,不得使用可能侵犯他人合法权益的账号名称。 | ||
| 24 | + </p> | ||
| 25 | + <h3 class="text-lg font-semibold mt-6 mb-2">三、用户行为规范</h3> | ||
| 26 | + <p class="text-gray-700 mb-4"> | ||
| 27 | + 1. | ||
| 28 | + 用户在使用老来赛服务时,必须遵守中华人民共和国相关法律法规的规定,不得利用本服务进行任何违法或不正当的活动,包括但不限于: | ||
| 29 | + </p> | ||
| 30 | + <ul class="list-disc pl-5 mb-4 text-gray-700"> | ||
| 31 | + <li>发布、传送、传播、储存违反国家法律法规禁止的内容</li> | ||
| 32 | + <li> | ||
| 33 | + 发布、传送、传播、储存侵害他人名誉权、肖像权、知识产权、商业秘密等合法权利的内容 | ||
| 34 | + </li> | ||
| 35 | + <li>虚构事实、隐瞒真相以误导、欺骗他人</li> | ||
| 36 | + <li>发布、传送、传播广告信息及垃圾信息</li> | ||
| 37 | + </ul> | ||
| 38 | + <h3 class="text-lg font-semibold mt-6 mb-2"> | ||
| 39 | + 四、服务变更、中断或终止 | ||
| 40 | + </h3> | ||
| 41 | + <p class="text-gray-700 mb-4"> | ||
| 42 | + 1. | ||
| 43 | + 鉴于网络服务的特殊性,老来赛有权根据实际情况随时变更、中断或终止部分或全部的服务而无需对用户或第三方负责。 | ||
| 44 | + </p> | ||
| 45 | + <p class="text-gray-700 mb-4"> | ||
| 46 | + 2. | ||
| 47 | + 如发生下列任何一种情形,老来赛有权随时中断或终止向用户提供本协议项下的服务而无需对用户或任何第三方承担责任: | ||
| 48 | + </p> | ||
| 49 | + <ul class="list-disc pl-5 mb-4 text-gray-700"> | ||
| 50 | + <li>用户提供的个人资料不真实</li> | ||
| 51 | + <li>用户违反本协议中规定的使用规则</li> | ||
| 52 | + <li>用户在使用老来赛服务时有违法行为</li> | ||
| 53 | + </ul> | ||
| 54 | + <h3 class="text-lg font-semibold mt-6 mb-2">五、免责声明</h3> | ||
| 55 | + <p class="text-gray-700 mb-4"> | ||
| 56 | + 1. | ||
| 57 | + 用户明确同意其使用老来赛服务所存在的风险将完全由其自己承担;因其使用老来赛服务而产生的一切后果也由其自己承担,老来赛对用户不承担任何责任。 | ||
| 58 | + </p> | ||
| 59 | + <p class="text-gray-700 mb-4"> | ||
| 60 | + 2. | ||
| 61 | + 老来赛不保证服务一定能满足用户的要求,也不保证服务不会中断,对服务的及时性、安全性、准确性也都不作保证。 | ||
| 62 | + </p> | ||
| 63 | + <h3 class="text-lg font-semibold mt-6 mb-2">六、协议修改</h3> | ||
| 64 | + <p class="text-gray-700 mb-4"> | ||
| 65 | + 1. | ||
| 66 | + 老来赛有权随时修改本协议的任何条款,一旦本协议的内容发生变动,老来赛将会在应用内更新并提示修改内容。 | ||
| 67 | + </p> | ||
| 68 | + <p class="text-gray-700 mb-4"> | ||
| 69 | + 2. | ||
| 70 | + 如果不同意老来赛对本协议相关条款所做的修改,用户有权停止使用老来赛服务。如果用户继续使用服务,则视为用户接受老来赛对本协议相关条款所做的修改。 | ||
| 71 | + </p> | ||
| 72 | + <h3 class="text-lg font-semibold mt-6 mb-2">七、通知送达</h3> | ||
| 73 | + <p class="text-gray-700 mb-4"> | ||
| 74 | + 1. | ||
| 75 | + 本协议项下老来赛对于用户所有的通知均可通过网页公告、电子邮件、手机短信或常规的信件传送等方式进行。 | ||
| 76 | + </p> | ||
| 77 | + <h3 class="text-lg font-semibold mt-6 mb-2"> | ||
| 78 | + 八、法律适用与争议解决 | ||
| 79 | + </h3> | ||
| 80 | + <p class="text-gray-700 mb-4"> | ||
| 81 | + 1. 本协议的订立、执行和解释及争议的解决均应适用中华人民共和国法律。 | ||
| 82 | + </p> | ||
| 83 | + <p class="text-gray-700 mb-4"> | ||
| 84 | + 2. | ||
| 85 | + 如双方就本协议内容或其执行发生任何争议,双方应尽量友好协商解决;协商不成时,任何一方均可向老来赛所在地的人民法院提起诉讼。 | ||
| 86 | + </p> | ||
| 87 | + <p class="text-gray-700 mt-8">本协议最终解释权归老来赛所有。</p> | ||
| 88 | + </view> | ||
| 89 | + </view> | ||
| 90 | + <BottomNav /> | ||
| 91 | + </view> | ||
| 92 | +</template> | ||
| 93 | + | ||
| 94 | +<script setup> | ||
| 95 | +import AppHeader from '../../components/AppHeader.vue'; | ||
| 96 | +import BottomNav from '../../components/BottomNav.vue'; | ||
| 97 | +</script> |
src/pages/Welcome/index.config.js
0 → 100644
src/pages/Welcome/index.less
0 → 100644
File mode changed
src/pages/Welcome/index.vue
0 → 100644
| 1 | +<!-- | ||
| 2 | + * @Date: 2025-08-27 17:43:45 | ||
| 3 | + * @LastEditors: hookehuyr hookehuyr@gmail.com | ||
| 4 | + * @LastEditTime: 2025-08-27 18:21:32 | ||
| 5 | + * @FilePath: /lls_program/src/pages/Welcome/index.vue | ||
| 6 | + * @Description: 文件描述 | ||
| 7 | +--> | ||
| 8 | +<template> | ||
| 9 | + <view class="min-h-screen flex flex-col bg-white"> | ||
| 10 | + <!-- Header --> | ||
| 11 | + <header class="py-5 text-center"> | ||
| 12 | + <h1 class="text-xl font-bold">老来赛</h1> | ||
| 13 | + </header> | ||
| 14 | + <!-- Main content --> | ||
| 15 | + <view class="flex-1 flex flex-col px-4 pb-20"> | ||
| 16 | + <!-- Hero Image --> | ||
| 17 | + <view class="w-full mb-6"> | ||
| 18 | + <view class="w-full h-48 rounded-2xl overflow-hidden"> | ||
| 19 | + <image :src="welcomeHomeImg" alt="家庭在上海外滩散步" class="w-full h-full object-cover" /> | ||
| 20 | + </view> | ||
| 21 | + </view> | ||
| 22 | + <!-- Steps Section --> | ||
| 23 | + <view class="mb-8"> | ||
| 24 | + <h2 class="text-xl font-bold mb-6">简单三步,开启健康生活</h2> | ||
| 25 | + <view class="space-y-6"> | ||
| 26 | + <!-- Step 1 --> | ||
| 27 | + <view class="flex items-center"> | ||
| 28 | + <view class="w-10 h-10 bg-blue-500 rounded-full flex items-center justify-center text-white font-bold text-lg mr-4 flex-shrink-0"> | ||
| 29 | + 1 | ||
| 30 | + </view> | ||
| 31 | + <view> | ||
| 32 | + <h3 class="font-bold">创建家庭</h3> | ||
| 33 | + <p class="text-gray-600 text-sm"> | ||
| 34 | + 家长创建家庭,获取专属口令 | ||
| 35 | + </p> | ||
| 36 | + </view> | ||
| 37 | + </view> | ||
| 38 | + <!-- Step 2 --> | ||
| 39 | + <view class="flex items-center"> | ||
| 40 | + <view class="w-10 h-10 bg-blue-500 rounded-full flex items-center justify-center text-white font-bold text-lg mr-4 flex-shrink-0"> | ||
| 41 | + 2 | ||
| 42 | + </view> | ||
| 43 | + <view> | ||
| 44 | + <h3 class="font-bold">邀请家人</h3> | ||
| 45 | + <p class="text-gray-600 text-sm">分享口令,邀请家人加入</p> | ||
| 46 | + </view> | ||
| 47 | + </view> | ||
| 48 | + <!-- Step 3 --> | ||
| 49 | + <view class="flex items-center"> | ||
| 50 | + <view class="w-10 h-10 bg-blue-500 rounded-full flex items-center justify-center text-white font-bold text-lg mr-4 flex-shrink-0"> | ||
| 51 | + 3 | ||
| 52 | + </view> | ||
| 53 | + <view> | ||
| 54 | + <h3 class="font-bold">同步步数,兑换好礼</h3> | ||
| 55 | + <p class="text-gray-600 text-sm"> | ||
| 56 | + 每日同步微信步数,兑换抵用券 | ||
| 57 | + </p> | ||
| 58 | + </view> | ||
| 59 | + </view> | ||
| 60 | + </view> | ||
| 61 | + </view> | ||
| 62 | + <!-- Action Buttons --> | ||
| 63 | + <view class="space-y-4 mt-auto"> | ||
| 64 | + <button @click="navigateTo('/pages/CreateFamily/index')" class="w-full py-3.5 bg-blue-500 text-white text-lg font-medium rounded-full"> | ||
| 65 | + 创建家庭 | ||
| 66 | + </button> | ||
| 67 | + <button @click="navigateTo('/pages/JoinFamily/index')" class="w-full py-3.5 bg-white text-gray-800 text-lg font-medium rounded-full border border-gray-300"> | ||
| 68 | + 加入家庭 | ||
| 69 | + </button> | ||
| 70 | + </view> | ||
| 71 | + </view> | ||
| 72 | + <!-- Bottom Navigation --> | ||
| 73 | + <BottomNav /> | ||
| 74 | + </view> | ||
| 75 | +</template> | ||
| 76 | + | ||
| 77 | +<script setup> | ||
| 78 | +import Taro from '@tarojs/taro'; | ||
| 79 | +import BottomNav from '../../components/BottomNav.vue'; // 假设BottomNav组件已转换 | ||
| 80 | +import welcomeHomeImg from '../../assets/images/welcome_home.png'; | ||
| 81 | + | ||
| 82 | +const navigateTo = (url) => { | ||
| 83 | + Taro.navigateTo({ url }); | ||
| 84 | +}; | ||
| 85 | +</script> | ||
| 86 | + | ||
| 87 | +<style lang="less"> | ||
| 88 | +.font-sans { | ||
| 89 | + font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; | ||
| 90 | +} | ||
| 91 | +</style> |
src/pages/demo/CreateFamily/index.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <view class="min-h-screen flex flex-col bg-white"> | ||
| 3 | + <AppHeader title="创建家庭" /> | ||
| 4 | + <view class="flex-1 px-4 py-6 overflow-auto"> | ||
| 5 | + <view class="mb-6"> | ||
| 6 | + <p class="text-gray-600 mb-6"> | ||
| 7 | + 请填写家庭信息,创建您的专属家庭空间 | ||
| 8 | + </p> | ||
| 9 | + <!-- Family Name --> | ||
| 10 | + <view class="mb-6"> | ||
| 11 | + <view class="bg-white rounded-lg border border-gray-200 p-4"> | ||
| 12 | + <label class="block text-lg font-medium mb-2">家庭名称</label> | ||
| 13 | + <input | ||
| 14 | + type="text" | ||
| 15 | + v-model="familyName" | ||
| 16 | + class="w-full text-gray-600 focus:outline-none" | ||
| 17 | + placeholder="请输入家庭名称" | ||
| 18 | + /> | ||
| 19 | + </view> | ||
| 20 | + </view> | ||
| 21 | + <!-- Family Introduction --> | ||
| 22 | + <view class="mb-6"> | ||
| 23 | + <view class="bg-white rounded-lg border border-gray-200 p-4"> | ||
| 24 | + <label class="block text-lg font-medium mb-2">家庭介绍</label> | ||
| 25 | + <textarea | ||
| 26 | + v-model="familyIntro" | ||
| 27 | + class="w-full text-gray-600 focus:outline-none resize-none" | ||
| 28 | + placeholder="请输入您家庭的特色、成员特点等家庭标签" | ||
| 29 | + :rows="2" | ||
| 30 | + /> | ||
| 31 | + </view> | ||
| 32 | + </view> | ||
| 33 | + <!-- Family Size --> | ||
| 34 | + <view class="mb-6"> | ||
| 35 | + <view class="bg-white rounded-lg border border-gray-200 p-4"> | ||
| 36 | + <label class="block text-lg font-medium mb-4">家庭规模</label> | ||
| 37 | + <view class="flex gap-2"> | ||
| 38 | + <button | ||
| 39 | + v-for="size in familySizes" | ||
| 40 | + :key="size" | ||
| 41 | + @click="familySize = size" | ||
| 42 | + :class="[ | ||
| 43 | + 'flex-1 py-3 rounded-lg border', | ||
| 44 | + familySize === size | ||
| 45 | + ? 'border-blue-500 bg-blue-50 text-blue-500' | ||
| 46 | + : 'border-gray-200 text-gray-700' | ||
| 47 | + ]" | ||
| 48 | + > | ||
| 49 | + {{ size }} | ||
| 50 | + </button> | ||
| 51 | + </view> | ||
| 52 | + </view> | ||
| 53 | + </view> | ||
| 54 | + <!-- Family Motto --> | ||
| 55 | + <view class="mb-6"> | ||
| 56 | + <view class="bg-white rounded-lg border border-gray-200 p-4"> | ||
| 57 | + <view class="flex justify-between items-center mb-4"> | ||
| 58 | + <label class="block text-lg font-medium">家训口令</label> | ||
| 59 | + <button | ||
| 60 | + @click="generateRandomMotto" | ||
| 61 | + class="px-3 py-1 bg-blue-100 text-blue-600 rounded-full text-sm" | ||
| 62 | + > | ||
| 63 | + 随机生成 | ||
| 64 | + </button> | ||
| 65 | + </view> | ||
| 66 | + <view class="flex gap-2 mb-4"> | ||
| 67 | + <view v-for="(char, index) in familyMotto" :key="index" class="flex-1"> | ||
| 68 | + <input | ||
| 69 | + type="text" | ||
| 70 | + v-model="familyMotto[index]" | ||
| 71 | + maxlength="1" | ||
| 72 | + class="w-full aspect-square flex items-center justify-center text-center text-xl bg-gray-100 rounded-lg" | ||
| 73 | + /> | ||
| 74 | + </view> | ||
| 75 | + <view class="flex-1 flex items-center justify-center"> | ||
| 76 | + <button class="w-full aspect-square flex items-center justify-center bg-gray-100 rounded-lg text-blue-500"> | ||
| 77 | + <Edit size="20" /> | ||
| 78 | + </button> | ||
| 79 | + </view> | ||
| 80 | + </view> | ||
| 81 | + <view class="flex items-center text-sm text-gray-600"> | ||
| 82 | + <Bulb size="16" class="text-yellow-500 mr-2" /> | ||
| 83 | + <p>设置有意义的家训口令,便于家人记忆和加入</p> | ||
| 84 | + </view> | ||
| 85 | + </view> | ||
| 86 | + </view> | ||
| 87 | + <!-- Family Avatar --> | ||
| 88 | + <view class="mb-10"> | ||
| 89 | + <view class="bg-white rounded-lg border border-gray-200 p-4"> | ||
| 90 | + <label class="block text-lg font-medium mb-2"> | ||
| 91 | + 家庭头像(选填) | ||
| 92 | + </label> | ||
| 93 | + <view | ||
| 94 | + class="border border-dashed border-gray-300 rounded-lg p-6 flex flex-col items-center justify-center" | ||
| 95 | + @click="chooseImage" | ||
| 96 | + > | ||
| 97 | + <view class="text-gray-400 mb-2"> | ||
| 98 | + <Image size="24" /> | ||
| 99 | + </view> | ||
| 100 | + <p class="text-center text-gray-400">点击上传图片</p> | ||
| 101 | + <p class="text-center text-gray-400 text-xs mt-1"> | ||
| 102 | + 支持jpg、png格式,大小不超过2MB | ||
| 103 | + </p> | ||
| 104 | + </view> | ||
| 105 | + </view> | ||
| 106 | + </view> | ||
| 107 | + </view> | ||
| 108 | + <!-- Submit Button --> | ||
| 109 | + <button | ||
| 110 | + @click="handleCreateFamily" | ||
| 111 | + class="w-full py-4 bg-blue-500 text-white text-lg font-medium rounded-lg" | ||
| 112 | + > | ||
| 113 | + 创建家庭 | ||
| 114 | + </button> | ||
| 115 | + </view> | ||
| 116 | + </view> | ||
| 117 | +</template> | ||
| 118 | + | ||
| 119 | +<script setup> | ||
| 120 | +import { ref } from 'vue'; | ||
| 121 | +import Taro from '@tarojs/taro'; | ||
| 122 | +import { Edit, Bulb, Image } from '@nutui/icons-vue-taro'; | ||
| 123 | +import AppHeader from '../../components/AppHeader.vue'; | ||
| 124 | + | ||
| 125 | +const familyName = ref(''); | ||
| 126 | +const familyIntro = ref(''); | ||
| 127 | +const familySize = ref('3-5人'); | ||
| 128 | +const familyMotto = ref(['孝', '敬', '和', '睦']); | ||
| 129 | +const familySizes = ['2人', '3-5人', '6人+']; | ||
| 130 | + | ||
| 131 | +const generateRandomMotto = () => { | ||
| 132 | + // 在实际应用中,这里会生成随机家训 | ||
| 133 | + // 目前仅作为演示使用预设值 | ||
| 134 | + familyMotto.value = ['爱', '和', '勤', '俭']; | ||
| 135 | +}; | ||
| 136 | + | ||
| 137 | +const chooseImage = () => { | ||
| 138 | + Taro.chooseImage({ | ||
| 139 | + count: 1, | ||
| 140 | + sizeType: ['compressed'], | ||
| 141 | + sourceType: ['album', 'camera'], | ||
| 142 | + success: (res) => { | ||
| 143 | + const tempFilePaths = res.tempFilePaths; | ||
| 144 | + // 在实际应用中,这里会上传图片到服务器 | ||
| 145 | + console.log('选择的图片路径:', tempFilePaths); | ||
| 146 | + } | ||
| 147 | + }); | ||
| 148 | +}; | ||
| 149 | + | ||
| 150 | +const handleCreateFamily = () => { | ||
| 151 | + // 在实际应用中,这里会调用API创建家庭 | ||
| 152 | + // 目前仅作为演示跳转到仪表盘页面 | ||
| 153 | + Taro.navigateTo({ | ||
| 154 | + url: '/pages/demo/Dashboard' | ||
| 155 | + }); | ||
| 156 | +}; | ||
| 157 | +</script> |
src/pages/index copy/index.config.js
0 → 100644
src/pages/index copy/index.less
0 → 100644
src/pages/index copy/index.vue
0 → 100644
| 1 | +<!-- | ||
| 2 | + * @Date: 2025-06-28 10:33:00 | ||
| 3 | + * @LastEditors: hookehuyr hookehuyr@gmail.com | ||
| 4 | + * @LastEditTime: 2025-08-27 17:13:11 | ||
| 5 | + * @FilePath: /lls_program/src/pages/index/index.vue | ||
| 6 | + * @Description: 文件描述 | ||
| 7 | +--> | ||
| 8 | +<template> | ||
| 9 | + <view class="index"> | ||
| 10 | + <PointsCollector ref="pointsCollectorRef" height="30vh" /> | ||
| 11 | + <nut-button type="success" @click="handleCollectAll" style="margin-top: 20rpx;">一键收取</nut-button> | ||
| 12 | + </view> | ||
| 13 | +</template> | ||
| 14 | + | ||
| 15 | +<script setup> | ||
| 16 | +import Taro from '@tarojs/taro' | ||
| 17 | +import '@tarojs/taro/html.css' | ||
| 18 | +import { ref, onMounted } from 'vue' | ||
| 19 | +import { useDidShow, useReady } from '@tarojs/taro' | ||
| 20 | +import PointsCollector from '@/components/PointsCollector.vue' | ||
| 21 | +import "./index.less"; | ||
| 22 | + | ||
| 23 | +const pointsCollectorRef = ref(null) | ||
| 24 | + | ||
| 25 | +/** | ||
| 26 | + * 触发积分收集组件的一键收取 | ||
| 27 | + */ | ||
| 28 | +const handleCollectAll = () => { | ||
| 29 | + if (pointsCollectorRef.value) { | ||
| 30 | + pointsCollectorRef.value.collectAll() | ||
| 31 | + } | ||
| 32 | +} | ||
| 33 | + | ||
| 34 | +// 生命周期钩子 | ||
| 35 | +useDidShow(() => { | ||
| 36 | + console.warn('index onShow') | ||
| 37 | +}) | ||
| 38 | + | ||
| 39 | +useReady(async () => { | ||
| 40 | + console.warn('index onReady') | ||
| 41 | + // 版本更新检查 | ||
| 42 | + if (!Taro.canIUse("getUpdateManager")) { | ||
| 43 | + Taro.showModal({ | ||
| 44 | + title: "提示", | ||
| 45 | + content: "当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试", | ||
| 46 | + showCancel: false, | ||
| 47 | + }); | ||
| 48 | + return; | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + // https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.html | ||
| 52 | + const updateManager = Taro.getUpdateManager(); | ||
| 53 | + | ||
| 54 | + updateManager.onCheckForUpdate((res) => { | ||
| 55 | + // 请求完新版本信息的回调 | ||
| 56 | + if (res.hasUpdate) { | ||
| 57 | + updateManager.onUpdateReady(function () { | ||
| 58 | + Taro.showModal({ | ||
| 59 | + title: "更新提示", | ||
| 60 | + content: "新版本已经准备好,是否重启应用?", | ||
| 61 | + success: function (res) { | ||
| 62 | + if (res.confirm) { | ||
| 63 | + // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 | ||
| 64 | + updateManager.applyUpdate(); | ||
| 65 | + } | ||
| 66 | + }, | ||
| 67 | + }); | ||
| 68 | + }); | ||
| 69 | + | ||
| 70 | + updateManager.onUpdateFailed(function () { | ||
| 71 | + // 新版本下载失败 | ||
| 72 | + Taro.showModal({ | ||
| 73 | + title: "更新提示", | ||
| 74 | + content: "新版本已上线,请删除当前小程序,重新搜索打开", | ||
| 75 | + }); | ||
| 76 | + }); | ||
| 77 | + } | ||
| 78 | + }); | ||
| 79 | +}) | ||
| 80 | + | ||
| 81 | +onMounted(() => { | ||
| 82 | + console.warn('index mounted') | ||
| 83 | +}) | ||
| 84 | + | ||
| 85 | +// 分享功能 | ||
| 86 | +wx.showShareMenu({ | ||
| 87 | + withShareTicket: true, | ||
| 88 | + menus: ['shareAppMessage', 'shareTimeline'] | ||
| 89 | +}) | ||
| 90 | +</script> | ||
| 91 | + | ||
| 92 | +<script> | ||
| 93 | +import { getCurrentPageParam } from "@/utils/weapp"; | ||
| 94 | + | ||
| 95 | +export default { | ||
| 96 | + name: "indexPage", | ||
| 97 | + onHide () { | ||
| 98 | + console.warn('index onHide') | ||
| 99 | + }, | ||
| 100 | + onShareAppMessage() { | ||
| 101 | + let params = getCurrentPageParam(); | ||
| 102 | + // 设置菜单中的转发按钮触发转发事件时的转发内容 | ||
| 103 | + var shareObj = { | ||
| 104 | + title: "xxx", // 默认是小程序的名称(可以写slogan等) | ||
| 105 | + path: `pages/detail/index?id=${params.id}&start_date=${params.start_date}&end_date=${params.end_date}&room_type=${params.room_type}`, // 默认是当前页面,必须是以'/'开头的完整路径 | ||
| 106 | + imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4 | ||
| 107 | + success: function (res) { | ||
| 108 | + // 转发成功之后的回调 | ||
| 109 | + if (res.errMsg == 'shareAppMessage:ok') { | ||
| 110 | + // | ||
| 111 | + } | ||
| 112 | + }, | ||
| 113 | + fail: function () { | ||
| 114 | + // 转发失败之后的回调 | ||
| 115 | + if (res.errMsg == 'shareAppMessage:fail cancel') { | ||
| 116 | + // 用户取消转发 | ||
| 117 | + } else if (res.errMsg == 'shareAppMessage:fail') { | ||
| 118 | + // 转发失败,其中 detail message 为详细失败信息 | ||
| 119 | + } | ||
| 120 | + }, | ||
| 121 | + complete: function () { | ||
| 122 | + // 转发结束之后的回调(转发成不成功都会执行) | ||
| 123 | + } | ||
| 124 | + } | ||
| 125 | + // 来自页面内的按钮的转发 | ||
| 126 | + // if (options.from == 'button') { | ||
| 127 | + // var eData = options.target.dataset; | ||
| 128 | + // // 此处可以修改 shareObj 中的内容 | ||
| 129 | + // shareObj.path = '/pages/goods/goods?goodId=' + eData.id; | ||
| 130 | + // } | ||
| 131 | + // 返回shareObj | ||
| 132 | + return shareObj; | ||
| 133 | + } | ||
| 134 | +}; | ||
| 135 | +</script> |
| 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-08-27 17:13:11 | 4 | + * @LastEditTime: 2025-08-27 16:04:30 |
| 5 | * @FilePath: /lls_program/src/pages/index/index.vue | 5 | * @FilePath: /lls_program/src/pages/index/index.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -13,10 +13,7 @@ | ... | @@ -13,10 +13,7 @@ |
| 13 | </template> | 13 | </template> |
| 14 | 14 | ||
| 15 | <script setup> | 15 | <script setup> |
| 16 | -import Taro from '@tarojs/taro' | 16 | +import { ref } from 'vue' |
| 17 | -import '@tarojs/taro/html.css' | ||
| 18 | -import { ref, onMounted } from 'vue' | ||
| 19 | -import { useDidShow, useReady } from '@tarojs/taro' | ||
| 20 | import PointsCollector from '@/components/PointsCollector.vue' | 17 | import PointsCollector from '@/components/PointsCollector.vue' |
| 21 | import "./index.less"; | 18 | import "./index.less"; |
| 22 | 19 | ||
| ... | @@ -30,63 +27,6 @@ const handleCollectAll = () => { | ... | @@ -30,63 +27,6 @@ const handleCollectAll = () => { |
| 30 | pointsCollectorRef.value.collectAll() | 27 | pointsCollectorRef.value.collectAll() |
| 31 | } | 28 | } |
| 32 | } | 29 | } |
| 33 | - | ||
| 34 | -// 生命周期钩子 | ||
| 35 | -useDidShow(() => { | ||
| 36 | - console.warn('index onShow') | ||
| 37 | -}) | ||
| 38 | - | ||
| 39 | -useReady(async () => { | ||
| 40 | - console.warn('index onReady') | ||
| 41 | - // 版本更新检查 | ||
| 42 | - if (!Taro.canIUse("getUpdateManager")) { | ||
| 43 | - Taro.showModal({ | ||
| 44 | - title: "提示", | ||
| 45 | - content: "当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试", | ||
| 46 | - showCancel: false, | ||
| 47 | - }); | ||
| 48 | - return; | ||
| 49 | - } | ||
| 50 | - | ||
| 51 | - // https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.html | ||
| 52 | - const updateManager = Taro.getUpdateManager(); | ||
| 53 | - | ||
| 54 | - updateManager.onCheckForUpdate((res) => { | ||
| 55 | - // 请求完新版本信息的回调 | ||
| 56 | - if (res.hasUpdate) { | ||
| 57 | - updateManager.onUpdateReady(function () { | ||
| 58 | - Taro.showModal({ | ||
| 59 | - title: "更新提示", | ||
| 60 | - content: "新版本已经准备好,是否重启应用?", | ||
| 61 | - success: function (res) { | ||
| 62 | - if (res.confirm) { | ||
| 63 | - // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 | ||
| 64 | - updateManager.applyUpdate(); | ||
| 65 | - } | ||
| 66 | - }, | ||
| 67 | - }); | ||
| 68 | - }); | ||
| 69 | - | ||
| 70 | - updateManager.onUpdateFailed(function () { | ||
| 71 | - // 新版本下载失败 | ||
| 72 | - Taro.showModal({ | ||
| 73 | - title: "更新提示", | ||
| 74 | - content: "新版本已上线,请删除当前小程序,重新搜索打开", | ||
| 75 | - }); | ||
| 76 | - }); | ||
| 77 | - } | ||
| 78 | - }); | ||
| 79 | -}) | ||
| 80 | - | ||
| 81 | -onMounted(() => { | ||
| 82 | - console.warn('index mounted') | ||
| 83 | -}) | ||
| 84 | - | ||
| 85 | -// 分享功能 | ||
| 86 | -wx.showShareMenu({ | ||
| 87 | - withShareTicket: true, | ||
| 88 | - menus: ['shareAppMessage', 'shareTimeline'] | ||
| 89 | -}) | ||
| 90 | </script> | 30 | </script> |
| 91 | 31 | ||
| 92 | <script> | 32 | <script> | ... | ... |
-
Please register or login to post a comment