Ver código fonte

修改显示细节问题

快乐的梦鱼 1 semana atrás
pai
commit
e313a3adb7

+ 20 - 3
src/components/basic/Image.vue

@@ -22,7 +22,7 @@
     />
     <view v-if="showFailed && isErrorState" class="inner-view error">
       <!-- todo: failed -->
-      <Text color="second">加载失败</Text>
+      <Text color="second" :text="src ? '暂无图片' : '加载失败'" />
     </view>
     <view v-if="showLoading && isLoadState" class="inner-view loading">
       <ActivityIndicator
@@ -34,7 +34,7 @@
 </template>
 
 <script setup lang="ts">
-import { computed, ref, watch } from 'vue';
+import { computed, onMounted, ref, watch } from 'vue';
 import { propGetThemeVar, useTheme } from '../theme/ThemeDefine';
 import ActivityIndicator from './ActivityIndicator.vue';
 import Text from './Text.vue';
@@ -145,9 +145,26 @@ function handleClick() {
   }
   emit('click');
 }
+function loadSrcState() {
+  if (props.src) {
+    isErrorState.value = false;
+    isLoadState.value = true;
+  } else {
+    isErrorState.value = true;
+    isLoadState.value = false;
+  }
+}
 
 watch(() => props.src, (newVal, oldVal) => {
-  isErrorState.value = false;
+  if (newVal) {
+    isErrorState.value = true;
+    isLoadState.value = false;
+  } else
+    isErrorState.value = false;
+})
+
+onMounted(() => {
+  loadSrcState();
 })
 </script>
 

+ 1 - 1
src/components/dynamic/DynamicForm.vue

@@ -115,7 +115,7 @@ async function submitForm<T = Record<string, any>>() : Promise<T|null> {
   } catch (e) {
     if (isErrorState)
       uni.showToast({
-        title: '请将表单填写完整',
+        title: '表单中有未填写项,请检查',
         icon: 'none'
       });
     console.log(e);

+ 2 - 1
src/pages/dig/admin.vue

@@ -16,9 +16,10 @@
         backgroundColor="white" 
         radius="20"
         :padding="20"
+        :gap="20"
         @click="goDetail(item.id)"
       >
-        <Image :src="item.image" width="170rpx" height="170rpx" />
+        <Image :src="item.image" width="150rpx" height="150rpx" round radius="30" />
         <FlexCol>
           <Text :fontSize="36" bold :text="`${item.name} ${item.sex === 0 ? '男' : '女'}`" />
           <Text :fontSize="26" :text="`手机:${item.mobile}`" />

+ 10 - 1
src/pages/dig/admin/volunteer.vue

@@ -131,7 +131,16 @@ const formDefine : FormDefine = {
       } as UploaderFieldProps,
     },
     { label: '地址', name: 'address', type: 'text', params: { placeholder: '请输入地址' } },
-    { label: '介绍', name: 'intro', type: 'textarea', params: { placeholder: '请输入介绍' } },
+    { 
+      label: '介绍', 
+      name: 'intro', 
+      type: 'textarea', 
+      params: { 
+        placeholder: '请输入介绍',
+        showWordLimit: true,
+        maxLength: 200,
+      } as FieldProps,
+    },
     { 
       label: '采集版块', name: 'collectModule', type: 'check-box-list', 
       params: {