Browse Source

修改原世界

tangning 2 năm trước cách đây
mục cha
commit
09bef3dfe9
3 tập tin đã thay đổi với 87 bổ sung27 xóa
  1. 19 1
      src/store/modules/locale.ts
  2. 27 26
      src/views/device/putModal.vue
  3. 41 0
      src/views/sys/login/Login.vue

+ 19 - 1
src/store/modules/locale.ts

@@ -14,7 +14,11 @@ const lsLocaleSetting = (ls.get(LOCALE_KEY) || localeSetting) as LocaleSetting;
 interface LocaleState {
   localInfo: LocaleSetting;
 }
-
+interface appItem {
+  name: string;
+  icon: string;
+  url: string;
+}
 export const useLocaleStore = defineStore({
   id: 'app-locale',
   state: (): LocaleState => ({
@@ -27,6 +31,20 @@ export const useLocaleStore = defineStore({
     getLocale(): LocaleType {
       return this.localInfo?.locale ?? 'zh_CN';
     },
+    getAppList(): appItem[] {
+      return [
+        {
+          name: 'iOS版',
+          url: 'http://fir.4dage.com/szysjios',
+          icon: 'uil:apple',
+        },
+        {
+          name: 'Android版',
+          url: 'http://fir.4dage.com/6cl5vk',
+          icon: 'uil:android',
+        },
+      ];
+    },
   },
   actions: {
     /**

+ 27 - 26
src/views/device/putModal.vue

@@ -40,36 +40,37 @@
       const { createMessage } = useMessage();
       const schemas: FormSchema[] = [
         {
-          field: 'wifiName',
+          field: 'authorizeCode ',
           component: 'Input',
-          label: 'wifi名称',
+          label: '相机授权码',
           colProps: {
             span: 18,
           },
-          helpMessage: 'wifi名称需包含前缀,如““4DKKPRO_”。',
-          defaultValue: '4DKKPRO_',
-          rules: [
-            {
-              required: true,
-              // @ts-ignore
-              validator: async (rule, value) => {
-                // var reg = /\S+@\S+\.\S+/;
-                if (!value) {
-                  return Promise.reject('请输入wifi名称');
-                }
-                var list: string[] = ['4DKKPRO_'];
-                const some = list.some((item) => {
-                  return value.indexOf(item) != -1;
-                });
-                console.log('validator', some);
-                if (!some) {
-                  return Promise.reject('wifi名称需包含前缀,如“4DKKPRO_”。');
-                }
-                return Promise.resolve();
-              },
-              trigger: 'change',
-            },
-          ],
+          required: true,
+          // helpMessage: 'wifi名称需包含前缀,如““4DKKPRO_”。',
+          // defaultValue: '4DKKPRO_',
+          // rules: [
+          //   {
+          //     required: true,
+          //     // @ts-ignore
+          //     validator: async (rule, value) => {
+          //       // var reg = /\S+@\S+\.\S+/;
+          //       if (!value) {
+          //         return Promise.reject('请输入wifi名称');
+          //       }
+          //       var list: string[] = ['4DKKPRO_'];
+          //       const some = list.some((item) => {
+          //         return value.indexOf(item) != -1;
+          //       });
+          //       console.log('validator', some);
+          //       if (!some) {
+          //         return Promise.reject('wifi名称需包含前缀,如“4DKKPRO_”。');
+          //       }
+          //       return Promise.resolve();
+          //     },
+          //     trigger: 'change',
+          //   },
+          // ],
         },
       ];
       const [registerForm, { validate, resetFields, setFieldsValue }] = useForm({

+ 41 - 0
src/views/sys/login/Login.vue

@@ -27,6 +27,20 @@
             <div class="mt-5 font-normal text-white text-md dark:text-gray-500 -enter-x">
               {{ t('sys.login.signInDesc') }}
             </div>
+            <div class="appcode">
+              <div v-for="item in getAppList" :key="item.name">
+                <QrCode
+                  :value="item.url"
+                  :options="{ margin: 2 }"
+                  class="enter-x flex justify-center xl:justify-start"
+                  :width="150"
+                />
+                <div class="title">
+                  <Icon :icon="item.icon" :size="20" />
+                  {{ item.name }}
+                </div>
+              </div>
+            </div>
           </div>
         </div>
         <div class="flex w-full h-full py-5 xl:h-auto xl:py-0 xl:my-0 xl:w-6/12">
@@ -70,6 +84,7 @@
   import RegisterForm from './RegisterForm.vue';
   import MobileForm from './MobileForm.vue';
   import QrCodeForm from './QrCodeForm.vue';
+  import { QrCode } from '/@/components/Qrcode/index';
   import { useGlobSetting } from '/@/hooks/setting';
   import { useI18n } from '/@/hooks/web/useI18n';
   import { useDesign } from '/@/hooks/web/useDesign';
@@ -86,7 +101,11 @@
   const { t } = useI18n();
   const localeStore = useLocaleStore();
   const showLocale = localeStore.getShowPicker;
+  const { getAppList } = localeStore;
   const title = computed(() => globSetting?.title ?? '');
+  defineExpose({
+    getAppList,
+  });
 </script>
 <style lang="less">
   @prefix-cls: ~'@{namespace}-login';
@@ -171,6 +190,28 @@
     }
 
     .container {
+      .my-auto {
+        .appcode {
+          margin-top: 1.25rem;
+          width: 340px;
+          display: flex;
+          justify-content: space-between;
+          img {
+            width: 150px;
+            padding: 2px;
+            background: #fff;
+          }
+          .title {
+            text-align: center;
+            margin-top: 10px;
+            background: rgb(130, 166, 230);
+            padding: 5px;
+            border-radius: 3px;
+            color: #fff;
+            font-size: 20px;
+          }
+        }
+      }
       .@{logo-prefix-cls} {
         display: flex;
         width: 60%;