Преглед изворни кода

Merge branch 'dev-5.3.1' of http://192.168.32.253:3000/Software/android-cloud-H5 into dev-5.3.1

huangxiaojing пре 2 година
родитељ
комит
ae0387f961

+ 4 - 2
.env.development

@@ -5,12 +5,14 @@ MODE = "development"
 API_PREFIX = "/api"
 API_HOST = "192.168.31.194"
 API_PORT = 80
+API_HTTPS = false
 
 # 文件服务器
 FILE_PREFIX = "/file"
 FILE_HOST = "file.phone.androidscloud.com"
-FILE_PORT = 8210
-FILE_UPLOAD_KEY = "13d0arghebcc4cm49cf04"
+FILE_PORT = 8121
+FILE_UPLOAD_KEY = "e858720c23ke455aa60e"
+FILE_HTTPS = true
 
 # 友盟统计
 UMENG_DATASOURCES_APP_KEY = "62ad961905844627b5b8638c"

+ 15 - 1
.env.production

@@ -1,4 +1,18 @@
 MODE = "production"
-API_PREFIX = "/api/"
+API_PREFIX = "/api"
 API_HOST = "client.phone.androidscloud.com"
 API_PORT = 443
+API_HTTPS = true
+
+# 文件服务器
+FILE_PREFIX = "/"
+FILE_HOST = "file.phone.androidscloud.com"
+FILE_PORT = 8210
+FILE_UPLOAD_KEY = "edv834e74a9c43eaac02"
+FILE_HTTPS = true
+
+# 友盟统计
+UMENG_DATASOURCES_APP_KEY = "62ad961905844627b5b8638c"
+
+# 百度统计
+BAIDU_TONGJI_KEY = "fb2fdf29d47485e36ea2ec253bf6ac06"

+ 15 - 1
.env.staging

@@ -1,5 +1,19 @@
 # 预生产环境变量
 MODE = "staging"
-API_PREFIX = "/api/"
+API_PREFIX = "/api"
 API_HOST = "prese.phone.androidscloud.com"
 API_PORT = 443
+API_HTTPS = true
+
+# 文件服务器
+FILE_PREFIX = "/"
+FILE_HOST = "file.phone.androidscloud.com"
+FILE_PORT = 8210
+FILE_UPLOAD_KEY = "347905r86eb745a1sc38"
+FILE_HTTPS = true
+
+# 友盟统计
+UMENG_DATASOURCES_APP_KEY = "62ad961905844627b5b8638c"
+
+# 百度统计
+BAIDU_TONGJI_KEY = "fb2fdf29d47485e36ea2ec253bf6ac06"

+ 14 - 1
.env.test

@@ -1,6 +1,19 @@
 # 测试环境变量
 MODE = "test"
-API_PREFIX = "/api/"
+API_PREFIX = "/api"
 API_HOST = "gntest.phone.androidscloud.com"
 API_PORT = 1280
+API_HTTPS = false
 
+# 文件服务器
+FILE_PREFIX = "/"
+FILE_HOST = "file.phone.androidscloud.com"
+FILE_PORT = 8210
+FILE_UPLOAD_KEY = "3dn9b4585511476691c6"
+FILE_HTTPS = true
+
+# 友盟统计
+UMENG_DATASOURCES_APP_KEY = "62ad961905844627b5b8638c"
+
+# 百度统计
+BAIDU_TONGJI_KEY = "fb2fdf29d47485e36ea2ec253bf6ac06"

BIN
assets/image/activity/invite-user/share-button@2x.png


+ 1 - 0
assets/style/variables.scss

@@ -3,3 +3,4 @@
 // The variables you want to modify
 // $font-size-root: 20px;
 // $c: red;
+$snackbar-bottom: env(safe-area-inset-bottom, 0px);

+ 30 - 0
modules/vee-validate/index.js

@@ -0,0 +1,30 @@
+import path from 'path';
+import unpluginVueComponents from 'unplugin-vue-components/webpack';
+export default function (c, i) {
+  this.nuxt.hook('build:before', (nuxt, buildOptions) => {
+    buildOptions.plugins.push(
+      unpluginVueComponents({
+        resolvers: [
+          {
+            type: 'component',
+            resolve(componentName) {
+              if (componentName.startsWith('Validation')) {
+                // console.log(
+                //   '🚀 ~ file: nuxt.config.js ~ line 230 ~ resolve ~ componentName',
+                //   componentName,
+                // );
+                return {
+                  name: componentName,
+                  from: 'vee-validate',
+                  // sideEffects: getSideEffects(importName, options),
+                };
+              }
+            },
+          },
+        ],
+      }),
+    );
+  });
+
+  this.addPlugin(path.resolve(__dirname, 'plugin.js'));
+}

+ 32 - 0
modules/vee-validate/plugin.js

@@ -0,0 +1,32 @@
+import { extend, localize } from 'vee-validate';
+import * as rules from 'vee-validate/dist/rules';
+import zhCN from 'vee-validate/dist/locale/zh_CN';
+
+// localize({ zhCN });
+localize('zhCN', zhCN);
+Object.entries(rules).forEach(([name, value]) => {
+  extend(name, value);
+});
+
+extend('phone', {
+  computesRequired: true,
+  validate(value) {
+    if (/1\d{10}/.test(value)) {
+      return true;
+    }
+    return '请输入11位长度{_field_}';
+    // return {
+    //   valid: false,
+    //   required: true,
+    // };
+  },
+});
+extend('code', {
+  computesRequired: true,
+  validate(value) {
+    if (/\d{6}/.test(value)) {
+      return true;
+    }
+    return '请输入6位{_field_}';
+  },
+});

+ 36 - 7
nuxt.config.js

@@ -1,3 +1,4 @@
+// import unpluginVueComponents from 'unplugin-vue-components/webpack';
 // import colors from 'vuetify/es5/util/colors'
 import zhHans from 'vuetify/lib/locale/zh-Hans';
 import dotenv from 'dotenv';
@@ -22,7 +23,7 @@ export default {
   // Global page headers: https://go.nuxtjs.dev/config-head
   head: {
     titleTemplate: '%s',
-    title: 'android-cloud-H5-nuxt',
+    title: '双子星云手机',
     htmlAttrs: {
       lang: 'zh-CN',
     },
@@ -78,6 +79,9 @@ export default {
     '~/plugins/native',
     '~/plugins/filters',
     '~/plugins/vue-data-dict',
+    { src: '~/plugins/v-mask', mode: 'client' },
+    { src: '~/plugins/vconsole', mode: 'client' },
+    { src: '~/plugins/callapp', mode: 'client' },
     // '~/plugins/jweixin',
     // '~/plugins/umeng-datasources',
     // '@/plugins/vant',
@@ -86,6 +90,7 @@ export default {
   // Auto import components: https://go.nuxtjs.dev/config-components
   components: [
     '~/components',
+
     // {
     //   path: 'vant/es',
     //   level: 1,
@@ -110,6 +115,7 @@ export default {
     // https://go.nuxtjs.dev/vuetify
     '@nuxtjs/vuetify',
     '@unocss/nuxt',
+    '~/modules/vee-validate',
     // '@nuxtjs/composition-api/module',
   ],
 
@@ -130,26 +136,26 @@ export default {
   // Axios module configuration: https://go.nuxtjs.dev/config-axios
   axios: {
     proxy: process.env.NODE_ENV === 'development',
-    // https: process.env.API_HTTPS === 'true',
+    https: process.env.API_HTTPS === 'true',
     //   // Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308
     //   baseURL: '/',
   },
   proxy: {
     '/api': {
       // target: 'http://gntest.phone.androidscloud.com:1280',
-      target: `http${process.env.API_PORT === '443' ? 's' : ''}://${
+      target: `http${process.env.API_HTTPS === 'true' ? 's' : ''}://${
         process.env.API_HOST
       }:${process.env.API_PORT}`,
       pathRewrite: {
-        // '^/api/': ''
+        // '^/api': ''
       },
     },
     '/file': {
-      target: `http${process.env.FILE_PORT === '443' ? 's' : ''}://${
+      target: `http${process.env.FILE_HTTPS === 'true' ? 's' : ''}://${
         process.env.FILE_HOST
       }:${process.env.FILE_PORT}`,
       pathRewrite: {
-        '^/file/': '',
+        '^/file': '',
       },
     },
   },
@@ -209,6 +215,7 @@ export default {
 
   // Build Configuration: https://go.nuxtjs.dev/config-build
   build: {
+    transpile: ['vee-validate/dist/rules'],
     // extend(config, { isClient, loaders: { less } }) {
     //   // console.log('🚀 ~ file: nuxt.config.js ~ line 197 ~ extend ~ less', less);
     //   less.lessOptions = {
@@ -219,8 +226,30 @@ export default {
     //     },
     //   };
     // },
+    plugins: [
+      // unpluginVueComponents({
+      //   resolvers: [
+      //     {
+      //       type: 'component',
+      //       resolve(componentName) {
+      //         if (componentName.startsWith('Validation')) {
+      //           console.log(
+      //             '🚀 ~ file: nuxt.config.js ~ line 230 ~ resolve ~ componentName',
+      //             componentName,
+      //           );
+      //           return {
+      //             name: componentName,
+      //             from: 'vee-validate',
+      //             // sideEffects: getSideEffects(importName, options),
+      //           };
+      //         }
+      //       },
+      //     },
+      //   ],
+      // }),
+    ],
     babel: {
-      plugins: [],
+      babelrc: false,
     },
     postcss: {
       plugins: {},

Разлика између датотеке није приказан због своје велике величине
+ 751 - 5274
package-lock.json


+ 5 - 0
package.json

@@ -24,7 +24,9 @@
     "@nuxtjs/auth-next": "5.0.0-1648802546.c9880dc",
     "@nuxtjs/axios": "^5.13.6",
     "axios": "^0.27.2",
+    "callapp-lib": "^3.5.2",
     "clipboard": "^2.0.11",
+    "clipboard-polyfill": "^4.0.0-rc1",
     "clipboardy": "^3.0.0",
     "core-js": "^3.19.3",
     "dayjs": "^1.11.3",
@@ -34,7 +36,10 @@
     "normalize.css": "^8.0.1",
     "numeral": "^2.0.6",
     "nuxt": "^2.15.8",
+    "v-mask": "^2.3.0",
     "vant": "^2.12.47",
+    "vconsole": "^3.14.6",
+    "vee-validate": "^3.4.14",
     "vue": "^2.6.14",
     "vue-data-dict": "^1.0.6",
     "vue-server-renderer": "^2.6.14",

+ 34 - 25
pages/activity/invite-user.vue

@@ -12,7 +12,9 @@
           <div class="cybz-content-text-item">邀请购买云机</div>
           <div class="cybz-content-text-item">返星币换现金</div>
         </div>
-        <v-btn class="share-button" rounded @click="share()"></v-btn>
+        <v-btn class="share-button" rounded @click="share()"
+          >分享好友赚星币</v-btn
+        >
         <!-- <button @click="share()">邀请</button> -->
       </div>
       <!-- <div class="h-40">13</div> -->
@@ -80,8 +82,9 @@
 </template>
 
 <script>
-import qs from 'qs';
-import clipboard from 'clipboardy/browser';
+// import qs from 'qs';
+// import clipboard from 'clipboardy/browser';
+import * as clipboard from 'clipboard-polyfill/text';
 import { getStarCoinOverview } from '~/api/activity/invite-user.js';
 
 export default {
@@ -98,12 +101,19 @@ export default {
         todayBuyOrderSuccessCount: 0,
         totalBuyOrderSuccessCount: 0,
         withdrawStarCoinNum: 0,
+        inviteUserName: null,
+        activityId: null,
+        status: 0,
       },
     };
   },
   async fetch() {
     //
-    this.data = (await getStarCoinOverview(this)).data;
+    try {
+      this.data = (await getStarCoinOverview(this)).data;
+    } catch (error) {
+      this.$toast.error(error.message);
+    }
   },
   head: {
     title: '邀请好友',
@@ -119,7 +129,7 @@ export default {
       return [
         { label: '今日收益(星币)', value: this.data.todayIncomeStarCoin },
         { label: '总收益(星币)', value: this.data.totalIncomeStarCoin },
-        { label: '今日购买订单数', value: this.data.totalBuyOrderCount },
+        { label: '今日购买订单数', value: this.data.todayBuyOrderSuccessCount },
         { label: '累计推广订单', value: this.data.totalBuyOrderCount },
         {
           label: '今日购买成功客户',
@@ -136,44 +146,40 @@ export default {
   mounted() {},
   methods: {
     async share() {
-      console.log(this);
+      // console.log(this);
+      if (this.data.status !== 1) {
+        throw new Error('当前活动已失效');
+      }
       this.$tongji.trackEvent('活动', '分享', '', 0);
-
       const url =
         location.origin +
         this.$router.resolve({
-          path: '/register-for-invite',
+          path: '/activity/invite-user/register',
           query: {
-            invitationUserName: this.$auth.user?.phone,
-            activityId: 1,
+            invitationUserName: this.data.inviteUserName,
+            activityId: this.data.activityId,
           },
         }).href;
 
       if (this.$userAgent.isMiniProgram) {
         // 小程序环境
-        await clipboard.write(url);
+        await clipboard.writeText(url);
         this.$toast.success('链接复制成功');
       } else if (this.$userAgent.isApp) {
         // app环境
         this.$native.share({
           title: '双子星APP',
           content: '分享好友购买云机套餐,返星币换现金',
-          gotoUrl: `${location.origin}${location.pathname}${qs.stringify(
-            { id: 666 },
-            { addQueryPrefix: true },
-          )}`,
-          shareImg: url,
+          gotoUrl: url,
+          shareImg: 'sdsa.png',
         });
       } else {
         // 浏览器环境
-        // await clipboard.write(url);
-        throw new Error('1231');
-        // this.$toast.success('链接复制成功');
+        await clipboard.writeText(url);
+        // throw new Error('1231');
+        this.$toast.success('链接复制成功');
       }
     },
-    share2() {
-      throw new Error('1231');
-    },
   },
 };
 </script>
@@ -251,12 +257,15 @@ export default {
   .share-button {
     display: block;
     margin: auto;
-    width: 302px;
-    height: 62px;
+    width: 302px !important;
+    height: 62px !important;
     background-image: url('~/assets/image/activity/invite-user/share-button@2x.png');
     background-size: 100% 100%;
     margin-top: 24px;
     // margin-bottom: 24px;
+    color: #dd1b0d;
+    font-size: 22px;
+    font-weight: bold;
   }
 }
 .box2 {
@@ -275,7 +284,7 @@ export default {
 .box4 {
   .box-main {
     // padding-left: 20px;
-    padding-top: 0;
+    // padding-top: 0;
   }
 }
 </style>

+ 214 - 0
pages/activity/invite-user/register.vue

@@ -0,0 +1,214 @@
+<template>
+  <v-container class="register-for-invite pa-0" fluid>
+    <div class="box box1">
+      <div class="box-header">快速注册</div>
+      <div class="box-main">
+        <validation-observer ref="observer" slim>
+          <v-form @submit.prevent="submit()">
+            <validation-provider
+              v-slot="{ errors }"
+              ref="providerPhome"
+              name="手机号码"
+              rules="phone"
+              slim
+            >
+              <v-text-field
+                v-model="form.phone"
+                v-mask="$mask.phone"
+                label=""
+                name="phone"
+                required
+                :error-messages="errors"
+                placeholder="请输入11位手机号"
+                solo
+                type="tel"
+                flat
+                maxlength="11"
+              />
+            </validation-provider>
+            <validation-provider
+              v-slot="{ errors }"
+              name="短信验证码"
+              rules="code"
+              slim
+            >
+              <v-text-field
+                v-model="form.code"
+                v-mask="'######'"
+                label=""
+                :error-messages="errors"
+                name="code"
+                maxlength="6"
+                required
+                placeholder="请输入验证码"
+                solo
+                flat
+                type="tel"
+              >
+                <template #append>
+                  <v-btn
+                    :loading="codeSending"
+                    :disabled="codeTime > 0"
+                    small
+                    depressed
+                    color="#8027E5"
+                    plain
+                    class="text-base"
+                    @click="sendSmsCode()"
+                  >
+                    <template v-if="codeTime > 0">{{ codeTime }}s</template>
+                    <template v-else>发送验证码</template>
+                  </v-btn>
+                </template>
+              </v-text-field>
+            </validation-provider>
+
+            <div class="">
+              <v-btn
+                type="submit"
+                :loading="submitting"
+                class="submit-btn"
+                rounded
+                >注册并下载APP</v-btn
+              >
+            </div>
+          </v-form>
+        </validation-observer>
+      </div>
+    </div>
+  </v-container>
+</template>
+
+<script>
+import { registerForInvite } from '~/api/user/client.js';
+import { sendSmsCode } from '~/api/message/phone.js';
+export default {
+  auth: false,
+  name: 'RegisterForInvite',
+  data() {
+    return {
+      form: {
+        phone: '',
+        code: '',
+        invitationUserName: null,
+        activityId: null,
+      },
+      codeSending: false,
+      codeTime: 0,
+      submitting: false,
+    };
+  },
+  fetch() {
+    this.form.invitationUserName = this.$route.query.invitationUserName;
+    this.form.activityId = this.$route.query.activityId;
+  },
+  head: {
+    title: '注册',
+  },
+  watch: {},
+  methods: {
+    maskPhone(value) {
+      return [/\d/, /\d/];
+    },
+    async submit() {
+      try {
+        this.submitting = true;
+        const valid = await this.$refs.observer.validate();
+        if (valid) {
+          this.$tongji.trackEvent('活动', '注册', '', 0);
+          const res = await registerForInvite(this, this.form);
+          this.$toast.success(res.msg);
+          this.openSzxApp();
+        }
+      } finally {
+        this.submitting = false;
+      }
+    },
+    openSzxApp() {
+      this.$callSzx.open({ param: {}, path: '' });
+    },
+    async sendSmsCode() {
+      try {
+        this.codeSending = true;
+        const validationResult = await this.$refs.providerPhome.validate();
+
+        if (validationResult.valid) {
+          this.$tongji.trackEvent('活动', '发送短信', '', 0);
+          const res = await sendSmsCode(this, {
+            type: 'common',
+            authorizationType: 4,
+            phone: this.form.phone,
+          });
+          this.codeTime = 60;
+          this.codeInterval = setInterval(
+            () => --this.codeTime <= 0 && clearInterval(this.codeInterval),
+            1000,
+          );
+          this.$toast.success(res.msg);
+        }
+      } finally {
+        this.codeSending = false;
+      }
+    },
+  },
+};
+</script>
+
+
+<style lang="scss" scoped>
+.register-for-invite {
+  color: #333;
+  background-image: url('~/assets/image/activity/invite-user/bg@2x.png');
+  background-size: 100% auto;
+  background-position-y: -44px;
+  overflow: hidden;
+  padding-bottom: 30px;
+  min-height: 100vh;
+}
+.box {
+  width: 373px;
+  box-sizing: border-box;
+  margin: auto;
+  border-image-source: url('~/assets/image/activity/invite-user/box@2x.png');
+  border-image-slice: 38 * 2 20 * 2 30 * 2 fill;
+
+  // border-image-width: 200px;
+  // border-image-slice: 200%;
+  border-width: 38px 15px 15px;
+  // border-width: 1px;
+  border-style: solid;
+  position: relative;
+  + .box {
+    margin-top: 30px;
+  }
+  .box-header {
+    position: absolute;
+    top: -30px;
+    // left: 141px;
+    left: 0;
+    right: 0;
+    text-align: center;
+    padding: 0 130px;
+    color: #fff;
+  }
+  .box-main {
+    padding: 30px 15px 20px;
+  }
+}
+.box1 {
+  margin-top: 275px;
+}
+.submit-btn {
+  display: block;
+  margin: auto;
+  width: 302px !important;
+  height: 62px !important;
+  background-image: url('~/assets/image/activity/invite-user/share-button@2x.png');
+  background-size: 100% 100%;
+  margin-top: 24px;
+  color: #dd1b0d !important;
+  font-size: 22px !important;
+  font-weight: bold !important;
+}
+</style>
+

+ 2 - 23
pages/index.vue

@@ -1,13 +1,8 @@
 <template>
   <div>
     <div>
-      <div>title</div>
       <div>
-        <button @click="$router.push('/inspire')">inspire</button>
-      </div>
-      <div class="justify-end">
-        <button @click="getContentByType()">getContentByType</button>
-        <button @click="message()">message</button>
+        <v-btn to="/inspire" nuxt>inspire</v-btn>
       </div>
     </div>
     <div class="">{{ FILE_PREFIX }}</div>
@@ -24,7 +19,6 @@
 </template>
 
 <script>
-import { getContentByType } from '~/api/public/agreement.js';
 export default {
   name: 'IndexPage',
   auth: false,
@@ -42,21 +36,6 @@ export default {
   },
   fetch() {},
   mounted() {},
-  methods: {
-    async getContentByType() {
-      const data = await getContentByType(this, 'XYPZYHXY2004', 1);
-      console.log(
-        '🚀 ~ file: index.vue ~ line 24 ~ getContentByType ~ data',
-        data,
-      );
-    },
-    message() {
-      this.$message({
-        app: true,
-        content: '123456798',
-        icon: '$success',
-      });
-    },
-  },
+  methods: {},
 };
 </script>

+ 2 - 2
pages/inspire.vue

@@ -6,8 +6,8 @@
         <div class="">{{ $auth.user }}</div>
       </div>
       <div class="justify-end">
-        <button v-if="$auth.loggedIn" @click="$auth.logout()">logout</button>
-        <button v-else @click="$auth.redirect('login')">login</button>
+        <v-btn v-if="$auth.loggedIn" @click="$auth.logout()">logout</v-btn>
+        <v-btn v-else @click="$auth.redirect('login')">login</v-btn>
       </div>
     </div>
   </div>

+ 60 - 18
pages/login.vue

@@ -1,16 +1,48 @@
 <template>
-  <div>
-    <div>
-      <div>
-        <input v-model="form.phone" />
-        <input v-model="form.password" />
-      </div>
-      <div>
-        <button v-if="$auth.loggedIn" @click="logout()">logout</button>
-        <button v-else @click="login()">login</button>
-      </div>
-    </div>
-  </div>
+  <v-container class="login-page" fluid>
+    <validation-observer ref="observer" v-slot="{ invalid }" slim>
+      <v-form @submit.prevent="submit()">
+        <validation-provider
+          v-slot="{ errors }"
+          ref="providerPhome"
+          name="手机号码"
+          rules="required|min:11|max:11"
+          slim
+        >
+          <v-text-field
+            v-model="form.phone"
+            label="手机号码"
+            name="phone"
+            required
+            :error-messages="errors"
+            maxlength="11"
+            type="tel"
+          />
+        </validation-provider>
+        <validation-provider
+          v-slot="{ errors }"
+          ref="providerPassword"
+          name="密码"
+          rules="required"
+          slim
+        >
+          <v-text-field
+            v-model="form.password"
+            label="手机号码"
+            name="phone"
+            required
+            :error-messages="errors"
+            type="password"
+          />
+        </validation-provider>
+        <div class="">
+          <v-btn type="submit" :disabled="invalid" :loading="submitting"
+            >login</v-btn
+          >
+        </div>
+      </v-form>
+    </validation-observer>
+  </v-container>
 </template>
 
 <script>
@@ -19,16 +51,26 @@ export default {
   data() {
     return {
       form: {
-        phone: '17600000010',
-        password: '1234567890',
+        phone: '',
+        password: '',
       },
+      submitting: false,
     };
   },
   methods: {
-    login() {
-      return this.$auth.loginWith('password', {
-        data: this.form,
-      });
+    async submit() {
+      try {
+        this.submitting = true;
+        const valid = await this.$refs.observer.validate();
+        if (valid) {
+          await this.login(this.form);
+        }
+      } finally {
+        this.submitting = false;
+      }
+    },
+    async login(data) {
+      await this.$auth.loginWith('password', data);
     },
     logout() {
       return this.$auth.logout();

+ 0 - 56
pages/register-for-invite.vue

@@ -1,56 +0,0 @@
-<template>
-  <div class="register-for-invite">
-    <div class="">注册</div>
-    <form @submit.prevent>
-      <input v-model="form.phone" label="phone" name="phone" />
-      <input v-model="form.code" label="code" name="code" maxlength="6" />
-      <div class="">
-        <button @click="register()">注册</button>
-        <button @click="sendSmsCode()">发送验证码</button>
-      </div>
-    </form>
-  </div>
-</template>
-
-<script>
-import { registerForInvite } from '~/api/user/client.js';
-import { sendSmsCode } from '~/api/message/phone.js';
-export default {
-  auth: false,
-  name: 'RegisterForInvite',
-  data() {
-    return {
-      form: {
-        phone: '17603013019',
-        code: '',
-        invitationUserName: null,
-        activityId: null,
-      },
-    };
-  },
-  fetch() {
-    this.form.invitationUserName = this.$route.query.invitationUserName;
-    this.form.activityId = this.$route.query.activityId;
-  },
-  head: {
-    title: '注册',
-  },
-  methods: {
-    async register() {
-      this.$tongji.trackEvent('活动', '注册', '', 0);
-      await registerForInvite(this, this.form);
-    },
-    async sendSmsCode() {
-      this.$tongji.trackEvent('活动', '发送短信', '', 0);
-      const res = await sendSmsCode(this, {
-        type: 'common',
-        authorizationType: 4,
-        phone: this.form.phone,
-      });
-      this.$message({ content: res.msg });
-    },
-  },
-};
-</script>
-
-

+ 23 - 0
pages/test-call-app.vue

@@ -0,0 +1,23 @@
+<template>
+  <v-container>
+    <div class="">
+      <v-btn @click="$callSzx.open({ path: '' })">唤起双子星</v-btn>
+      <v-btn @click="$callWechat.open({ path: '' })">唤起微信</v-btn>
+      <v-btn @click="$callWechat.open({ path: 'scanqrcode' })"
+        >唤起微信扫一扫</v-btn
+      >
+      <v-btn @click="$callAlipay.open({ path: '' })">唤起支付宝</v-btn>
+      <v-btn @click="$callAlipay.open({ param: { saId: 10000007 }, path: '' })"
+        >唤起支付宝扫一扫</v-btn
+      >
+    </div>
+  </v-container>
+</template>
+
+<script>
+export default {
+  auth: false,
+  methods: {},
+};
+</script>
+

+ 60 - 0
plugins/callapp.js

@@ -0,0 +1,60 @@
+import CallApp from 'callapp-lib';
+
+export default function (c, i) {
+  i(
+    'callSzx',
+    new CallApp({
+      scheme: {
+        protocol: 'SZXIosAPP',
+        host: '',
+        // port: 80,
+      },
+      intent: {
+        package: 'com.gemini.cloud.client',
+        // action: '',
+        // category: '',
+        // component: '',
+        scheme: 'SZXIosAPP',
+      },
+      timeout: 2000,
+      yingyongbao:
+        'https://a.app.qq.com/o/simple.jsp?pkgname=com.gemini.cloud.client',
+      appstore: 'https://www.pgyer.com/gemini6',
+      fallback: 'https://www.androidscloud.com',
+    }),
+  );
+  i(
+    'callWechat',
+    new CallApp({
+      scheme: {
+        protocol: 'weixin',
+        host: '',
+        // port: 80,
+      },
+      intent: {
+        package: 'com.tencent.mm',
+        scheme: 'weixin',
+      },
+      timeout: 2000,
+      appstore: 'https://apps.apple.com/cn/app/id414478124',
+      fallback: 'https://weixin.qq.com',
+    }),
+  );
+  i(
+    'callAlipay',
+    new CallApp({
+      scheme: {
+        protocol: 'alipayqr',
+        host: 'platformapi/startapp',
+        // port: 80,
+      },
+      intent: {
+        package: 'com.eg.android.AlipayGphone',
+        scheme: 'alipayqr',
+      },
+      timeout: 2000,
+      appstore: 'https://apps.apple.com/cn/app/id333206289',
+      fallback: 'https://www.alipay.com',
+    }),
+  );
+}

+ 1 - 0
plugins/toast/index.js

@@ -8,6 +8,7 @@ export default function (c, i) {
     isString(optios)
       ? {
           message: optios,
+          // bottom:true
         }
       : optios;
 

+ 2 - 1
plugins/toast/toast.vue

@@ -1,6 +1,7 @@
 <template>
   <v-snackbar
     app
+    bottom
     class="toast"
     :value.sync="value"
     color="rgba(0,0,0,.8)"
@@ -34,7 +35,7 @@ export default {
     attrs() {
       return Object.entries(this.$options.propsData).reduce(
         (o, [key, value]) => {
-          !Object.hasOwn(this.$props, key) && (o[key] = value);
+          !Object.prototype.hasOwnProperty.call(this.$props, key) && (o[key] = value);
           return o;
         },
         {},

+ 1 - 1
plugins/user-agent.js

@@ -7,7 +7,7 @@ export default function (c, i) {
       return /Android/i.test(navigator.userAgent);
     },
     get isApp() {
-      return /SZX/i.test(navigator.userAgent);
+      return /Szx/i.test(navigator.userAgent);
     },
     get isMobile() {
       return /Mobile/i.test(navigator.userAgent);

+ 38 - 0
plugins/v-mask.js

@@ -0,0 +1,38 @@
+import Vue from 'vue';
+import VueMask from 'v-mask';
+Vue.use(VueMask);
+
+// 身份证
+const idCard = [...Array.from({ length: 17 }).fill(/\d/), /(\d|X|x)/];
+
+const phone = [/1/, ...Array.from({ length: 10 }).fill(/\d/)];
+
+const phoneKebab = [
+  /1/,
+  ...Array.from({ length: 2 }).fill(/\d/),
+  '-',
+  ...Array.from({ length: 4 }).fill(/\d/),
+  '-',
+  ...Array.from({ length: 4 }).fill(/\d/),
+];
+
+const phoneNo = [
+  /1/,
+  ...Array.from({ length: 2 }).fill(/\d/),
+  ' ',
+  ...Array.from({ length: 4 }).fill(/\d/),
+  ' ',
+  ...Array.from({ length: 4 }).fill(/\d/),
+];
+
+const bankCard = Array.from({ length: 20 }).fill(/\d/);
+
+export default function (c, i) {
+  i('mask', {
+    idCard,
+    phone,
+    bankCard,
+    phoneKebab,
+    phoneNo,
+  });
+}

+ 8 - 0
plugins/vconsole.js

@@ -0,0 +1,8 @@
+import VConsole from 'vconsole';
+
+export default function (c, i) {
+  if (['development', 'test'].includes(process.env.MODE)) {
+    const vConsole = new VConsole();
+    i('vConsole', vConsole);
+  }
+}

+ 10 - 6
schemes/password.js

@@ -6,8 +6,12 @@ let publicKey;
 const encrypt = new JSEncrypt();
 
 export default class CustomScheme extends LocalScheme {
-  async login(endpoint, { reset = true } = {}) {
-    endpoint.data = Object.assign({}, endpoint.data);
+  async login(data, { reset = true } = {}) {
+    const endpoint = { data: Object.assign({}, data) };
+
+    // endpoint.data = Object.assign({}, endpoint.data);
+
+    // endpoint.data = endpoint.data;
 
     if (!this.options.endpoints.login) {
       return;
@@ -31,10 +35,10 @@ export default class CustomScheme extends LocalScheme {
       ).data.publicKey;
       encrypt.setPublicKey(publicKey);
     }
-    console.log(
-      '🚀 ~ file: password.js ~ line 37 ~ CustomScheme ~ login ~ publicKey',
-      publicKey,
-    );
+    // console.log(
+    //   '🚀 ~ file: password.js ~ line 37 ~ CustomScheme ~ login ~ publicKey',
+    //   publicKey,
+    // );
     const md5 = createHash('md5');
 
     endpoint.data.password = encrypt.encrypt(

Разлика између датотеке није приказан због своје велике величине
+ 1241 - 1157
static/screenAndroid/WXtrialInterface.html


Разлика између датотеке није приказан због своје велике величине
+ 1134 - 1172
static/screenIos/WXtrialInterface.html