li.shaoyi пре 3 недеља
родитељ
комит
e4116b8d99

+ 88 - 0
public/proto/mtp.js

@@ -52678,6 +52678,94 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
         id: 23
       }
     }
+  },
+  CreateDigitalWalletAddressReq: {
+    fields: {
+      Header: {
+        type: "MessageHead",
+        id: 1
+      },
+      DigitalAccountID: {
+        rule: "required",
+        type: "uint64",
+        id: 2
+      },
+      ChannelCode: {
+        rule: "required",
+        type: "string",
+        id: 3
+      },
+      ChainID: {
+        rule: "required",
+        type: "string",
+        id: 4
+      },
+      AddrType: {
+        type: "uint32",
+        id: 5
+      },
+      Address: {
+        type: "string",
+        id: 6
+      },
+      Memo: {
+        type: "string",
+        id: 7
+      },
+      SerialNumber: {
+        rule: "required",
+        type: "uint64",
+        id: 8
+      }
+    }
+  },
+  CreateDigitalWalletAddressRsp: {
+    fields: {
+      Header: {
+        type: "MessageHead",
+        id: 1
+      },
+      RetCode: {
+        type: "int32",
+        id: 2
+      },
+      RetDesc: {
+        type: "string",
+        id: 3
+      },
+      DigitalAccountID: {
+        rule: "required",
+        type: "uint64",
+        id: 4
+      },
+      ChannelCode: {
+        rule: "required",
+        type: "string",
+        id: 5
+      },
+      ChainID: {
+        rule: "required",
+        type: "string",
+        id: 6
+      },
+      AddrType: {
+        type: "uint32",
+        id: 7
+      },
+      Address: {
+        type: "string",
+        id: 8
+      },
+      Memo: {
+        type: "string",
+        id: 9
+      },
+      SerialNumber: {
+        rule: "required",
+        type: "uint64",
+        id: 10
+      }
+    }
   }
 });
 

+ 24 - 0
public/proto/mtp.proto

@@ -15868,3 +15868,27 @@ message TaAccountDigital {
 		optional uint32 TradeStatus = 22; // 交易状态-1:正常
 		optional uint64 Timestamp = 23; // 时间戳
 }
+// 创建数字钱包地址请求
+message CreateDigitalWalletAddressReq {
+	optional MessageHead Header = 1;
+		required uint64 DigitalAccountID = 2; // 数字账户ID
+		required string ChannelCode = 3; // 渠道代码
+		required string ChainID = 4; // 链ID
+		optional uint32 AddrType = 5; // 地址类型:1-充值;2-提现
+		optional string Address = 6; // 地址(提现类型必填)
+			optional string Memo = 7; // 地址备注(某些链需要)
+		required uint64 SerialNumber = 8; // 流水号
+}
+// 创建数字钱包地址应答
+message CreateDigitalWalletAddressRsp {
+	optional MessageHead Header = 1; // 消息头
+	optional int32 RetCode = 2; // 返回码
+	optional string RetDesc = 3; // 描述信息
+		required uint64 DigitalAccountID = 4; // 数字账户ID
+		required string ChannelCode = 5; // 渠道代码
+		required string ChainID = 6; // 链ID
+		optional uint32 AddrType = 7; // 地址类型:1-充值;2-提现
+		optional string Address = 8; // 地址
+			optional string Memo = 9; // 地址备注(某些链需要)
+		required uint64 SerialNumber = 10; // 流水号
+}

+ 6 - 0
src/constants/funcode.ts

@@ -168,4 +168,10 @@ export enum FunCode {
     DigitalOrderRsp = 196772, // 数字交易委托应答
     DigitalAccountActivateReq = 3014671, // 数字账户激活请求
     DigitalAccountActivateRsp = 3014672, // 数字账户激活应答
+    CreateDigitalWalletAddressReq = 3014674, // 创建数字钱包地址请求
+    CreateDigitalWalletAddressRsp = 3014675, // 创建数字钱包地址应答
+    DigitalAccountWithdrawApplyReq = 3014661, // 数字账户提现申请请求
+    DigitalAccountWithdrawApplyRsp = 3014662, // 数字账户提现申请应答
+    DigitalAccountWithdrawApplyCancelReq = 3014663, // 数字账户提现申请撤销请求
+    DigitalAccountWithdrawApplyCancelRsp = 3014664, // 数字账户提现申请撤销应答
 } 

+ 14 - 12
src/packages/digital/views/account/certification/index.vue

@@ -24,13 +24,13 @@
                         <app-uploader @success="b_afterRead" />
                     </template>
                 </Field>
-                <Field name="cardbackphotourl" v-if="showCardBackPhoto === '1'"
-                    :label="$t('user.authentication.cardbackphoto')" :rules="formRules.cardbackphotourl">
+                <Field name="cardbackphotourl" v-if="showCardBackPhoto" :label="$t('user.authentication.cardbackphoto')"
+                    :rules="formRules.cardbackphotourl">
                     <template #input>
                         <app-uploader @success="f_afterRead" />
                     </template>
                 </Field>
-                <Field name="halfbodyphotourl" v-if="showHalfBodyPhoto === '1'" :label="halfBodyPhotoTitle"
+                <Field name="halfbodyphotourl" v-if="showHalfBodyPhoto" :label="halfBodyPhotoTitle"
                     :rules="formRules.halfbodyphotourl">
                     <template #input>
                         <app-uploader @success="h_afterRead" />
@@ -68,9 +68,9 @@ const { global: { t } } = i18n
 
 const cerTypePersonList = getCerTypePersonList() // 证件类型列表
 
-const showHalfBodyPhoto = shallowRef('0')
-const showCardBackPhoto = shallowRef('0')
-const halfBodyPhotoTitle = shallowRef(t('user.authentication.halfbodyphoto'))
+const showHalfBodyPhoto = shallowRef(false)
+const showCardBackPhoto = shallowRef(false)
+const halfBodyPhotoTitle = shallowRef('')
 
 // 获取网上开户配置
 useRequest(getWskhOpenAccountConfigs, {
@@ -78,10 +78,12 @@ useRequest(getWskhOpenAccountConfigs, {
         configs: '53,54,78'
     },
     onSuccess: (res) => {
+        const configMap = new Map(res.data.map((item) => [item.configid, item.configvalue]))
+
         /// 是否显示半身照和 证件背面照
-        showCardBackPhoto.value = res.data.filter(e => e.configid === 53)[0].configvalue ?? '0'
-        showHalfBodyPhoto.value = res.data.filter(e => e.configid === 54)[0].configvalue ?? '0'
-        halfBodyPhotoTitle.value = res.data.filter(e => e.configid === 78)[0].configvalue ?? t('user.authentication.halfbodyphoto')
+        showCardBackPhoto.value = configMap.get(53) === '1'
+        showHalfBodyPhoto.value = configMap.get(54) === '1'
+        halfBodyPhotoTitle.value = configMap.get(78) ?? t('user.authentication.halfbodyphoto')
     }
 })
 
@@ -135,13 +137,13 @@ const onSubmit = () => {
     fullloading((hideLoading) => {
         formSubmit().then((res) => {
             /// 失败
-            if (res.code.toString() != '0') {
-                showFailToast(res.message)
-            } else {
+            if (res.code.toString() === '0') {
                 hideLoading()
                 dialog(t("user.authentication.opensuccess")).then(() => {
                     router.back()
                 })
+            } else {
+                showFailToast(res.message)
             }
         }).catch((err) => {
             formData.cardnum = ''

+ 49 - 0
src/services/api/digital/index.ts

@@ -103,4 +103,53 @@ export function digitalAccountActivate(config: RequestConfig<Partial<Proto.Digit
         responseCode: 'DigitalAccountActivateRsp',
         marketId: 19
     })
+}
+
+/**
+ * 创建数字钱包地址请求
+ */
+export function createDigitalWalletAddress(config: RequestConfig<Partial<Proto.CreateDigitalWalletAddressReq>>) {
+    return http.mqRequest<Proto.CreateDigitalWalletAddressRsp>({
+        data: {
+            SerialNumber: 0,
+            ...config.data
+        },
+        requestCode: 'CreateDigitalWalletAddressReq',
+        responseCode: 'CreateDigitalWalletAddressRsp',
+        marketId: 20
+    })
+}
+
+/**
+ * 数字账户提现申请请求
+ */
+export function digitalAccountWithdrawApply(config: RequestConfig<Partial<Proto.DigitalAccountWithdrawApplyReq>>) {
+    return http.mqRequest<Proto.DigitalAccountWithdrawApplyRsp>({
+        data: {
+            UserID: getUserId(),
+            ClientTicket: v4(),
+            OperateSrc: 2,
+            ...config.data
+        },
+        requestCode: 'DigitalAccountWithdrawApplyReq',
+        responseCode: 'DigitalAccountWithdrawApplyRsp',
+        marketId: 20
+    })
+}
+
+/**
+ * 数字账户提现申请撤销请求
+ */
+export function digitalAccountWithdrawApplyCancel(config: RequestConfig<Partial<Proto.DigitalAccountWithdrawApplyCancelReq>>) {
+    return http.mqRequest<Proto.DigitalAccountWithdrawApplyCancelRsp>({
+        data: {
+            UserID: getUserId(),
+            ClientTicket: v4(),
+            OperateSrc: 2,
+            ...config.data
+        },
+        requestCode: 'DigitalAccountWithdrawApplyCancelReq',
+        responseCode: 'DigitalAccountWithdrawApplyCancelRsp',
+        marketId: 20
+    })
 }

+ 70 - 1
src/types/proto/digital.d.ts

@@ -71,7 +71,7 @@ declare global {
             ClientTicket: string; // 客户端流水号
             Remark?: string; // 备注
         }
-        
+
         /** 数字账户激活应答 */
         interface DigitalAccountActivateRsp {
             Header: IMessageHead;
@@ -108,5 +108,74 @@ declare global {
             TradeStatus: number; // 交易状态-1:正常
             Timestamp: number; // 时间戳
         }
+
+        /** 创建数字钱包地址请求 */
+        interface CreateDigitalWalletAddressReq {
+            Header?: IMessageHead;
+            DigitalAccountID: number; // 数字账户ID
+            ChannelCode: string; // 渠道代码
+            ChainID: string; // 链ID
+            AddrType?: number; // 地址类型:1-充值;2-提现
+            Address?: string; // 地址(提现类型必填)
+            Memo?: string; // 地址备注(某些链需要)
+            SerialNumber: number; // 流水号
+        }
+
+        /** 创建数字钱包地址应答 */
+        interface CreateDigitalWalletAddressRsp {
+            Header: IMessageHead;
+            RetCode: number; // 返回码
+            RetDesc: string; // 描述信息
+            DigitalAccountID: number; // 数字账户ID
+            ChannelCode: string; // 渠道代码
+            ChainID: string; // 链ID
+            AddrType: number; // 地址类型:1-充值;2-提现
+            Address: string; // 地址
+            Memo: string; // 地址备注(某些链需要)
+            SerialNumber: number; // 流水号
+        }
+
+        /** 数字账户提现申请请求 */
+        interface DigitalAccountWithdrawApplyReq {
+            Header?: IMessageHead;
+            UserID: number; // 用户ID
+            CurrencyID: number; // 币种ID
+            WalletID: number; // 钱包ID
+            DigitalAccountID: number; // 数字账户ID
+            Amount: number; // 金额(正值)
+            OperateSrc: number; // 操作来源-枚举"operatesrc"(1:管理端,2:终端)
+            ClientTicket: string; // 客户端流水号
+            Remark?: string; // 备注
+            ExtendInfo?: string; // 扩展信息(JSON串,按钱包类型区分)
+        }
+
+        /** 数字账户提现申请应答 */
+        interface DigitalAccountWithdrawApplyRsp {
+            Header: IMessageHead;
+            RetCode: number; // 返回码
+            RetDesc: string; // 描述信息
+            ApplyID: number; // 申请ID
+            ClientTicket: string; // 客户端流水号
+            Status: number; // 申请状态(1:待审核,2:审核中,3:审核通过,4:审核拒绝,5:审核失败,6:审核超时,7:已撤销)
+        }
+
+        /** 数字账户提现申请撤销请求 */
+        interface DigitalAccountWithdrawApplyCancelReq {
+            Header?: IMessageHead;
+            ApplyID: number; // 申请ID
+            UserID: number; // 用户ID
+            OperateSrc: number; // 操作来源-枚举"operatesrc"(1:管理端,2:终端)
+            ClientTicket: string; // 客户端流水号
+            Remark?: string; // 备注
+        }
+
+        /** 数字账户提现申请撤销应答 */
+        interface DigitalAccountWithdrawApplyCancelRsp {
+            Header: IMessageHead;
+            RetCode: number; // 返回码
+            RetDesc: string; // 描述信息
+            ApplyID: number; // 申请ID
+            ClientTicket: string; // 客户端流水号
+        }
     }
 }