Handy_Cao пре 3 година
родитељ
комит
8f80cf0138

+ 17 - 4
src/packages/mobile/views/account/certification/index.vue

@@ -5,17 +5,17 @@
         </template>
         <Form ref="formRef" class="g-form__container" @submit="onSubmit">
             <CellGroup inset>
-                <Field v-model="formData.username" name="username" label="姓名" placeholder="必填" :rules="formRules.username"/>
+                <Field v-model="formData.username" name="username" label="姓名" placeholder="请输入用户姓名" :rules="formRules.username"/>
                 <Field v-model="formData.cardtype" name="cardtype" label="证件类型" placeholder="请选择证件类型" is-link readonly @click="showPicker = true"/>
-                <Field v-model="formData.cardnum" name="cardnum" label="证件号码" placeholder="必填" :rules="formRules.cardnum"/>
+                <Field v-model="formData.cardnum" name="cardnum" label="证件号码" placeholder="请输入证件号码" :rules="formRules.cardnum"/>
                 <Field v-model="formData.cardbackphotourl" name="cardbackphotourl" label="证件正面照片" :rules="formRules.cardbackphotourl">
                     <template #input>
-                        <Uploader/>
+                        <Uploader v-model="backList" max-count="1" :after-read="afterRead" />
                     </template>
                 </Field>
                 <Field v-model="formData.cardfrontphotourl" name="cardfrontphotourl" label="证件反面照片" :rules="formRules.cardfrontphotourl">
                     <template #input>
-                        <Uploader />
+                        <Uploader v-model="frontList" max-count="1" :after-read="afterRead" />
                     </template>
                 </Field>
             </CellGroup>
@@ -44,10 +44,23 @@ const formRef = shallowRef<FormInstance>()
 const { formData, formSubmit } = addAuthReq()
 const showPicker = ref(false);
 const result = ref('');
+/// 证件正面地址
+const backList = ref([]);
+/// 证件背面地址
+const frontList = ref([]);
 
 /// 获取对应的证件枚举类型
 const enums = getCertificateTypeList().map(obj=>{ return obj.label })
 
+const afterRead = (file: any) => {
+    file.status = 'uploading';
+    file.message = '上传中...';
+
+    setTimeout(() => {
+    file.status = 'success';
+    file.message = '上传成功';
+    }, 1000);
+};
 
 // 表单验证规则
 const formRules: { [key in keyof Model.AddAuthReq]?: FieldRule[] } = {

+ 52 - 6
src/packages/mobile/views/bank/wallet/components/deposit/index.vue

@@ -1,25 +1,71 @@
 <template>
     <app-view>
-        <Form ref="formRef">
+        <Form ref="formRef" class="g-form__container" @submit="formSubmit">
             <CellGroup inset>
-                <Field label="充值金额" placeholder="请填写充值金额" />
+                <Field v-model="formData.Amount" label="充值金额" placeholder="请填写充值金额" :rules="formRules.Amount"/>
                 <Field label="凭证">
                     <template #input>
-                        <span>请上传银行充值流水截图</span>
-                        <Uploader />
+                        <Uploader v-model="fileList" name="fileList" :max-size="50 * 1024 * 1024" @oversize="onOversize" max-count="1" :after-read="afterRead" :rules="formRules.fileList"/>
                     </template>
                 </Field>
             </CellGroup>
         </Form>
         <template #footer>
-            <Button round block type="primary">确定</Button>
+            <Button round block type="primary" @click="formRef?.submit()">确定</Button>
         </template>
     </app-view>
 </template>
 
 <script lang="ts" setup>
 import { ref } from 'vue'
-import { Form, Field, CellGroup, Button, Uploader, FormInstance } from 'vant'
+import { Form, Field, CellGroup, Button, Uploader, FieldRule, FormInstance, Toast } from 'vant'
+import { doDeposit } from '@/business/bank'
+import { fullloading, dialog } from '@/utils/vant';
+import { useNavigation } from '@/hooks/navigation'
 
 const formRef = ref<FormInstance>()
+const { formData, onSubmit } = doDeposit('xxx')
+const {router}=useNavigation()
+
+/// 证件正面地址
+const fileList = ref([]);
+
+const afterRead = (file: any) => {
+    file.status = 'uploading';
+    file.message = '上传中...';
+
+    let params = new FormData()
+    params.append('file', file.file)
+    params.append('size', file.file.size)
+};
+
+const onOversize = () => {
+    Toast('图片大小不能超过 50Mb')
+};
+
+// 表单验证规则
+const formRules: { [key in keyof Proto.t2bBankDepositReq | 'fileList']?: FieldRule[] } = {
+    Amount: [{
+        required: true,
+        message: '请填写充值金额',
+    }],
+    fileList: [{
+        required: true,
+        message: '请上传转账凭证',
+    }]
+}
+
+const formSubmit = () => {
+    fullloading((hideLoading) => {
+        onSubmit().then(() => {
+            hideLoading()
+            dialog('充值申请提交成功,请等待审核。').then(() => {
+                router.back()
+            })
+        }).catch((err) => {
+            Toast.fail(err)
+        })
+    })
+}
+
 </script>

+ 2 - 2
src/packages/mobile/views/home/components/mine/index.vue

@@ -51,7 +51,7 @@
         <li @click="routerTo('mine-generalize')" style="align-items:flex-start">
           <app-iconfont icon="icon-wodetuiguang" label-direction="bottom">我的推广</app-iconfont>
         </li>
-        <li>
+        <!-- <li>
           <app-iconfont icon="icon-wodedingdan" label-direction="bottom">我的订单</app-iconfont>
         </li>
         <li>
@@ -62,7 +62,7 @@
         </li>
         <li @click="routerTo('mine-address')">
           <app-iconfont icon="icon-shouhuodizhi" label-direction="bottom">收货地址</app-iconfont>
-        </li>
+        </li> -->
       </ul>
     </div>
     <div class="g-navmenu">