hookehuyr

feat(家庭创建/编辑): 在区域选择和封面上传处添加图标并优化交互

- 在创建和编辑家庭页面的区域选择处添加图标
- 优化封面图片上传交互,添加默认提示和图标
- 统一使用IconFont组件替换部分图标
1 <!-- 1 <!--
2 * @Date: 2025-08-27 17:44:53 2 * @Date: 2025-08-27 17:44:53
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2025-09-16 11:01:23 4 + * @LastEditTime: 2025-09-16 13:32:59
5 * @FilePath: /lls_program/src/pages/CreateFamily/index.vue 5 * @FilePath: /lls_program/src/pages/CreateFamily/index.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -48,9 +48,12 @@ ...@@ -48,9 +48,12 @@
48 <view class="block text-lg font-medium mb-4">快来挑选加入哪个区域战队</view> 48 <view class="block text-lg font-medium mb-4">快来挑选加入哪个区域战队</view>
49 <view class="bg-white rounded-xl p-4 border border-gray-200" @click="showDistrictPicker = true"> 49 <view class="bg-white rounded-xl p-4 border border-gray-200" @click="showDistrictPicker = true">
50 <view class="flex justify-between items-center"> 50 <view class="flex justify-between items-center">
51 - <text :class="{'text-gray-400': !selectedDistrictText, 'text-gray-900': selectedDistrictText}" class="text-base"> 51 + <view>
52 - {{ selectedDistrictText || '请选择区域' }} 52 + <IconFont size="15" name="https://cdn.ipadbiz.cn/lls_prog/icon/%E5%88%9B%E5%BB%BA%E5%AE%B6%E5%BA%AD2.png" class="mr-2" />
53 - </text> 53 + <text :class="{'text-gray-400': !selectedDistrictText, 'text-gray-900': selectedDistrictText}" class="text-base">
54 + {{ selectedDistrictText || '请选择区域' }}
55 + </text>
56 + </view>
54 <Right size="16" color="#888" /> 57 <Right size="16" color="#888" />
55 </view> 58 </view>
56 </view> 59 </view>
......
1 <!-- 1 <!--
2 * @Date: 2025-08-27 17:44:53 2 * @Date: 2025-08-27 17:44:53
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2025-09-11 20:03:53 4 + * @LastEditTime: 2025-09-16 13:32:28
5 * @FilePath: /lls_program/src/pages/EditFamily/index.vue 5 * @FilePath: /lls_program/src/pages/EditFamily/index.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -47,9 +47,12 @@ ...@@ -47,9 +47,12 @@
47 <view class="block text-lg font-medium mb-4">快来挑选加入哪个区域战队</view> 47 <view class="block text-lg font-medium mb-4">快来挑选加入哪个区域战队</view>
48 <view class="bg-white rounded-xl p-4 border border-gray-200" @click="showDistrictPicker = true"> 48 <view class="bg-white rounded-xl p-4 border border-gray-200" @click="showDistrictPicker = true">
49 <view class="flex justify-between items-center"> 49 <view class="flex justify-between items-center">
50 - <text :class="{'text-gray-400': !selectedDistrictText, 'text-gray-900': selectedDistrictText}" class="text-base"> 50 + <view>
51 - {{ selectedDistrictText || '请选择区域' }} 51 + <IconFont size="15" name="https://cdn.ipadbiz.cn/lls_prog/icon/%E5%88%9B%E5%BB%BA%E5%AE%B6%E5%BA%AD2.png" class="mr-2" />
52 - </text> 52 + <text :class="{'text-gray-400': !selectedDistrictText, 'text-gray-900': selectedDistrictText}" class="text-base">
53 + {{ selectedDistrictText || '请选择区域' }}
54 + </text>
55 + </view>
53 <Right size="16" color="#888" /> 56 <Right size="16" color="#888" />
54 </view> 57 </view>
55 </view> 58 </view>
...@@ -90,8 +93,10 @@ ...@@ -90,8 +93,10 @@
90 </view> --> 93 </view> -->
91 </view> 94 </view>
92 <view class="flex items-center text-sm text-gray-600"> 95 <view class="flex items-center text-sm text-gray-600">
93 - <Tips size="16" class="text-yellow-500 mr-2" /> 96 + <view>
94 - <view>设置有意义的家训口令,便于家人记忆和加入</view> 97 + <IconFont size="15" name="https://cdn.ipadbiz.cn/lls_prog/icon/%E5%88%9B%E5%BB%BA%E5%AE%B6%E5%BA%AD3.png" />
98 + <text class="ml-1">设置有意义的家训口令,便于家人记忆和加入</text>
99 + </view>
95 </view> 100 </view>
96 </view> 101 </view>
97 </view> 102 </view>
...@@ -103,26 +108,36 @@ ...@@ -103,26 +108,36 @@
103 </view> 108 </view>
104 <!-- 封面显示区域 --> 109 <!-- 封面显示区域 -->
105 <view class="mb-4"> 110 <view class="mb-4">
106 - <view class="relative"> 111 + <view class="relative bg-gray-100 rounded-lg h-48 flex items-center justify-center">
112 + <!-- 有图片时显示图片 -->
107 <image 113 <image
108 - :src="familyAvatar || defaultFamilyCover" 114 + v-if="familyAvatar"
109 - class="w-full h-48 rounded-lg object-cover" 115 + :src="familyAvatar"
116 + class="w-full h-full rounded-lg object-cover"
110 mode="aspectFill" 117 mode="aspectFill"
111 @tap="previewAvatar" 118 @tap="previewAvatar"
112 /> 119 />
120 + <!-- 没有图片时显示上传提示 -->
121 + <view v-else class="flex flex-col items-center justify-center text-gray-400" @click="chooseImage">
122 + <IconFont size="48" class="mb-2" name="https://cdn.ipadbiz.cn/lls_prog/icon/%E5%88%9B%E5%BB%BA%E5%AE%B6%E5%BA%AD4.png" />
123 + <text class="text-sm">点击上传封面图</text>
124 + </view>
125 + <!-- 删除按钮 -->
113 <view 126 <view
114 v-if="familyAvatar" 127 v-if="familyAvatar"
115 - @click="deleteAvatar" 128 + @click.stop="deleteAvatar"
116 class="absolute -top-2 -right-2 w-5 h-5 bg-red-500 rounded-full flex items-center justify-center" 129 class="absolute -top-2 -right-2 w-5 h-5 bg-red-500 rounded-full flex items-center justify-center"
117 > 130 >
118 <view class="text-white text-xs">×</view> 131 <view class="text-white text-xs">×</view>
119 </view> 132 </view>
133 + <!-- 更换按钮 -->
120 <view 134 <view
121 - @click="chooseImage" 135 + v-if="familyAvatar"
122 - class="absolute bottom-3 right-2 px-3 py-1 bg-black bg-opacity-50 text-white text-sm rounded-full flex items-center" 136 + @click.stop="chooseImage"
137 + class="absolute bottom-3 right-2 px-3 py-1 bg-gray-600 bg-opacity-50 text-white text-sm rounded-full flex items-center"
123 > 138 >
124 <Photograph size="14" class="mr-1" /> 139 <Photograph size="14" class="mr-1" />
125 - {{ familyAvatar ? '更换' : '上传' }} 140 + 更换
126 </view> 141 </view>
127 </view> 142 </view>
128 </view> 143 </view>
...@@ -142,8 +157,6 @@ ...@@ -142,8 +157,6 @@
142 </view> 157 </view>
143 </view> 158 </view>
144 159
145 -
146 -
147 <!-- 图片预览 --> 160 <!-- 图片预览 -->
148 <nut-image-preview 161 <nut-image-preview
149 v-model:show="previewVisible" 162 v-model:show="previewVisible"
...@@ -169,7 +182,7 @@ ...@@ -169,7 +182,7 @@
169 <script setup> 182 <script setup>
170 import { ref, onMounted } from 'vue'; 183 import { ref, onMounted } from 'vue';
171 import Taro from '@tarojs/taro'; 184 import Taro from '@tarojs/taro';
172 -import { Edit, Tips, Photograph, Right } from '@nutui/icons-vue-taro'; 185 +import { Edit, Tips, Photograph, Right, IconFont } from '@nutui/icons-vue-taro';
173 // import AppHeader from '../../components/AppHeader.vue'; 186 // import AppHeader from '../../components/AppHeader.vue';
174 import BASE_URL from '@/utils/config'; 187 import BASE_URL from '@/utils/config';
175 // 188 //
...@@ -200,7 +213,7 @@ const districtValue = ref([]); ...@@ -200,7 +213,7 @@ const districtValue = ref([]);
200 const districtColumns = ref(SHANGHAI_REGION); 213 const districtColumns = ref(SHANGHAI_REGION);
201 const familyAvatar = ref(''); 214 const familyAvatar = ref('');
202 const focusedIndex = ref(-1); 215 const focusedIndex = ref(-1);
203 -const defaultFamilyCover = ref(defaultFamilyCoverSvg); 216 +const defaultFamilyCover = ref();
204 217
205 // 图片预览相关 218 // 图片预览相关
206 const previewVisible = ref(false); 219 const previewVisible = ref(false);
......