xyh пре 2 година
родитељ
комит
d1a665e14e
4 измењених фајлова са 25 додато и 23 уклоњено
  1. 1 1
      src/app.config.js
  2. 1 1
      src/pages/index/index.jsx
  3. 13 0
      src/pages/index/login/field/index.jsx
  4. 10 21
      src/pages/index/login/index.jsx

+ 1 - 1
src/app.config.js

@@ -1,7 +1,7 @@
 export default defineAppConfig({
   pages: [
-    'pages/list/index',
     'pages/index/index',
+    'pages/list/index',
     'pages/receive/index',
     'pages/deliver/index',
   ],

+ 1 - 1
src/pages/index/index.jsx

@@ -23,7 +23,7 @@ const btnList = [
 ];
 
 export default function App() {
-  const [visible, {toggle, setFalse}] = useBoolean();
+  const [visible, {toggle, setFalse}] = useBoolean(true);
 
   return (
     <>

+ 13 - 0
src/pages/index/login/field/index.jsx

@@ -0,0 +1,13 @@
+import {Input, Text, View} from '@tarojs/components';
+
+export default function Field({label}) {
+  return (
+    <View className='mt-3 first:mt-0'>
+      <Text className='block text-lg font-semibold'>{label}</Text>
+      <Input
+        placeholder={`请输入${label}`}
+        className='mt-1 border-0 border-b border-solid border-gray-200 py-2'
+      />
+    </View>
+  );
+}

+ 10 - 21
src/pages/index/login/index.jsx

@@ -1,6 +1,6 @@
 import {Popup, Button} from '@antmjs/vantui';
-import {Input, View} from '@tarojs/components';
-import classNames from 'classnames';
+import {View} from '@tarojs/components';
+import Field from './field';
 
 export default function Login({visible, onClose}) {
   return (
@@ -9,31 +9,20 @@ export default function Login({visible, onClose}) {
       position='bottom'
       closeable
       round
-      className='px-4 py-5 !pb-10'
+      className='px-4 py-5'
       onClose={onClose}
+      style={{height: '60vh'}}
     >
-      <View className='pt-9'>
-        <Input
-          className={classNames(
-            'border border-gray-300 border-solid rounded-lg',
-            'p-2 text-sm',
-          )}
-          placeholder='请输入用户名'
-        />
+      <View className='pt-9 pb-5 flex flex-col h-full'>
+        <Field label='用户名' />
+        <Field label='密码' />
 
-        <Input
-          className={classNames(
-            'border border-gray-300 border-solid rounded-lg',
-            'p-2 mt-4 text-sm',
-          )}
-          placeholder='请输入密码'
-          password
-        />
-        <View className='mt-12'>
+        <View className='mt-auto'>
           <Button
-            className='py-4 !border-none !text-base !h-12 !rounded-md'
+            className='py-4 !border-none !text-base !h-12 '
             block
             color='#58C6EA'
+            round
           >
             登录
           </Button>