فهرست منبع

Merge branch 'master' of https://git.nanodreamtech.com/wkw/wallet_app

wkw 1 روز پیش
والد
کامیت
3e6012218b
5فایلهای تغییر یافته به همراه107 افزوده شده و 4 حذف شده
  1. 1 1
      src/hooks/use-copy.js
  2. 14 0
      src/i18n/zhHk/form.js
  3. 2 0
      src/i18n/zhHk/index.js
  4. 1 1
      src/plugins/storage.js
  5. 89 2
      src/views/login/createWallet/index.vue

+ 1 - 1
src/hooks/use-copy.js

@@ -6,7 +6,7 @@ import ClipboardJS from 'clipboard';
 export function useCopy(_class = '.im-copy-btn') {
   const clipboard = new ClipboardJS(_class);
   clipboard.on('success', (e) => {
-    $message({type: 'success', message: '已复制到剪切板!'});
+    $msg({type: 'success', message: '已复制到剪切板!'});
   });
   onUnmounted(() => {
     clipboard.destroy();

+ 14 - 0
src/i18n/zhHk/form.js

@@ -0,0 +1,14 @@
+export default {
+  Submit: "提交",
+  ConfirmCreation: "確定創建",
+  
+  WalletName: "錢包名稱",
+  WalletPassword: "錢包密碼",
+  ConfirmPassword: "確認密碼",
+  CreateWallet: "創建錢包",
+  PromptMessage: "提示信息",
+InconsistentPasswords: "兩次密碼不一致",
+
+
+  PleaseFillIn: "請填寫",
+};

+ 2 - 0
src/i18n/zhHk/index.js

@@ -1,7 +1,9 @@
 import login from './login'
 import global from './global'
 import router from './router'
+import form from './form'
 export default {
+  form,
   login,
   global,
   router,

+ 1 - 1
src/plugins/storage.js

@@ -2,7 +2,7 @@
 import { showNotify } from 'vant';
 import { i18n } from "@/i18n";
 export function setup() {
-  window["$message"] = showNotify
+  window["$msg"] = showNotify 
 
   window["$t"] = i18n.global.t;
 }

+ 89 - 2
src/views/login/createWallet/index.vue

@@ -1,3 +1,90 @@
 <template>
-  <div>123</div>
-</template>
+  <van-form @submit="onSubmit"  >
+    <van-cell-group inset>
+      <van-field
+        v-model="form.username"
+        name="username"
+        :label="$t('form.WalletName')"
+        :placeholder="$t('form.WalletName')"
+        :rules="[
+          {
+            required: true,
+            message: $t('form.PleaseFillIn') + $t('form.WalletName'),
+          },
+        ]"
+      />
+      <van-field
+        v-model="form.password"
+        type="password"
+        name="password"
+        :label="$t('form.WalletPassword')"
+        :placeholder="$t('form.WalletPassword')"
+        :rules="[
+          {
+            required: true,
+            message: $t('form.PleaseFillIn') + $t('form.WalletPassword'),
+          },
+        ]"
+      />
+
+      <van-field
+        v-model="form.confirmPassword"
+        type="password"
+        name="confirmPassword"
+        :label="$t('form.ConfirmPassword')"
+        :placeholder="$t('form.ConfirmPassword')"
+        :rules="[
+          {
+            required: true,
+            message: $t('form.PleaseFillIn') + $t('form.ConfirmPassword'),
+          },
+        ]"
+      />
+
+      <van-field
+        v-model="form.promptMessage"
+        name="promptMessage"
+        :label="$t('form.PromptMessage')"
+        :placeholder="$t('form.PromptMessage')"
+        :rules="[
+          {
+            required: true,
+            message: $t('form.PleaseFillIn') + $t('form.PromptMessage'),
+          },
+        ]"
+      />
+    </van-cell-group>
+    <div class="button-group"  >
+      <van-button round block type="primary" native-type="submit">
+        {{ $t("form.ConfirmCreation") }}
+      </van-button>
+    </div>
+  </van-form>
+</template>
+
+<script setup>
+const form = ref({});
+
+
+const onSubmit = ()=>{
+  if(form.value.password !== form.value.confirmPassword){
+    $msg({ type: 'warning', message: $t("form.InconsistentPasswords") })
+    return 
+  }
+
+  
+}
+
+</script>
+
+<style scoped lang="less">
+.van-cell-group{
+  margin-top: 16px;
+}
+.button-group{
+  width: calc(100% - 32px);
+  position: absolute;
+  left: 16px;
+  bottom: 70px;
+}
+</style>