wupengfei
9 天以前 1bf39274d6b51540953f746c507b2cc70d3e0ed9
feat: 通知
5个文件已修改
135 ■■■■■ 已修改文件
apps/bMiniApp/config/dev.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/bMiniApp/src/subpackages/login/loginByForm/accountLoginForm.vue 69 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/underTakeMiniApp/.eslintrc-auto-import.json 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/underTakeMiniApp/auto-imports.d.ts 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/underTakeMiniApp/src/subpackages/login/loginByForm/accountLoginForm.vue 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/bMiniApp/config/dev.js
@@ -4,6 +4,7 @@
  env: {
    NODE_ENV: '"development"',
    BASE_URL: '"http://localhost:53780"',
    // BASE_URL: '"https://testfj.81812333.com"',
    BASE_URL_JX: '"https://api.jx818.com"',
    APP_ENV: '"development"',
apps/bMiniApp/src/subpackages/login/loginByForm/accountLoginForm.vue
@@ -43,22 +43,13 @@
      <LargeButton class="login-btn" @click="handleLogin" :loading="form.loading">登录</LargeButton>
    </template>
    <!-- <AccessOpenTypeButton
      type="primary"
      class="authorization-page-wechat-wrapper"
      open-type="getPhoneNumber"
      :access="policyChecked"
      @noAccess="noAccess"
      @getphonenumber="handleLogin"
    >
      <div class="authorization-page-wechat">登录</div>
    </AccessOpenTypeButton> -->
    <!-- <div class="go-register-btn" @click="goRegister">立即注册</div> -->
  </div>
</template>
<script setup lang="ts">
import { Message } from '@12333/utils';
import { AccessOpenTypeButton } from '@12333/components';
import { FormRules } from '@nutui/nutui-taro/dist/types/__VUE/form/types';
import { LargeButton } from '@/components';
import { useLoginedJump } from '@/hooks';
@@ -67,6 +58,7 @@
import Taro from '@tarojs/taro';
import * as authServices from '@12333/services/apiV2/auth';
import { subscribeMessageTemplateIdsForB } from '@12333/constants';
import { ButtonProps, CommonEventFunction } from '@tarojs/components';
defineOptions({
  name: 'AccountLoginForm',
@@ -103,20 +95,7 @@
  try {
    if (props.policyChecked) {
      userStore.loginSuccess(wxMiniAppUserLoginRes.value);
      Message.success('登录成功', {
        onClosed: async () => {
          if (!Taro.requestSubscribeMessage) {
            await Message.confirm({ message: '你的微信版本过低,不支持订阅消息,是否继续?' });
          }
          await Taro.requestSubscribeMessage({
            tmplIds: subscribeMessageTemplateIdsForB,
            success: function (res) {
              console.log('res: ', res);
            },
          });
          jump();
        },
      });
      handleLoginSuccess();
    } else {
      noAccess();
    }
@@ -135,16 +114,7 @@
          password: form.userPassword,
          code: loginRes.code,
        });
        if (!Taro.requestSubscribeMessage) {
          await Message.confirm({ message: '你的微信版本过低,不支持订阅消息,是否继续?' });
        }
        await Taro.requestSubscribeMessage({
          tmplIds: subscribeMessageTemplateIdsForB,
          success: function (res) {
            console.log('res: ', res);
          },
        });
        jump();
        handleLoginSuccess();
      }
    } else {
      noAccess();
@@ -159,6 +129,37 @@
  Message.warning('请先阅读并勾选协议');
}
async function handleLoginSuccess() {
  try {
    if (!Taro.requestSubscribeMessage) {
      await Message.confirm({ message: '你的微信版本过低,不支持订阅消息,是否继续?' });
    }
    const res = await Taro.getSetting({
      withSubscriptions: true,
    });
    let setting: boolean[] = [];
    if (res.subscriptionsSetting && res.subscriptionsSetting.itemSettings) {
      setting = subscribeMessageTemplateIdsForB
        .map((id) => res.subscriptionsSetting.itemSettings[id] !== 'accept')
        .filter(Boolean);
    }
    Taro.requestSubscribeMessage({
      tmplIds: subscribeMessageTemplateIdsForB,
      success: function (res) {
        console.log('res: ', res);
      },
    });
    console.log('setting: ', setting);
    Message.success('登录成功', {
      onClosed: () => {
        jump();
      },
    });
  } catch (error) {
    console.log('error: ', error);
  }
}
function goRegister() {
  console.log('RouterPath.registerForm: ', RouterPath.registerForm);
  Taro.navigateTo({
apps/underTakeMiniApp/.eslintrc-auto-import.json
@@ -125,6 +125,8 @@
    "DirectiveBinding": true,
    "MaybeRef": true,
    "MaybeRefOrGetter": true,
    "TabBarPageRouterList": true
    "TabBarPageRouterList": true,
    "APP_ENV": true,
    "NODE_ENV": true
  }
}
apps/underTakeMiniApp/auto-imports.d.ts
@@ -5,6 +5,7 @@
// Generated by unplugin-auto-import
export {}
declare global {
  const APP_ENV: typeof import('./src/constants/app')['APP_ENV']
  const AppLocalConfig: typeof import('./src/constants/app')['AppLocalConfig']
  const BackType: typeof import('./src/constants/enum')['BackType']
  const EffectScope: typeof import('vue')['EffectScope']
@@ -29,6 +30,7 @@
  const EnumUserStatus: typeof import('./src/constants/apiEnum')['EnumUserStatus']
  const EnumUserType: typeof import('./src/constants/apiEnum')['EnumUserType']
  const HomeOrderType: typeof import('./src/hooks/task')['HomeOrderType']
  const NODE_ENV: typeof import('./src/constants/app')['NODE_ENV']
  const OssAssets: typeof import('./src/constants/img')['OssAssets']
  const RouterPath: typeof import('./src/constants/router')['RouterPath']
  const TabBarPageRouter: typeof import('./src/constants/tabBar')['TabBarPageRouter']
@@ -134,9 +136,11 @@
import { UnwrapRef } from 'vue'
declare module 'vue' {
  interface ComponentCustomProperties {
    readonly APP_ENV: UnwrapRef<typeof import('./src/constants/app')['APP_ENV']>
    readonly AppLocalConfig: UnwrapRef<typeof import('./src/constants/app')['AppLocalConfig']>
    readonly BackType: UnwrapRef<typeof import('./src/constants/enum')['BackType']>
    readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
    readonly NODE_ENV: UnwrapRef<typeof import('./src/constants/app')['NODE_ENV']>
    readonly OssAssets: UnwrapRef<typeof import('./src/constants/img')['OssAssets']>
    readonly RouterPath: UnwrapRef<typeof import('./src/constants/router')['RouterPath']>
    readonly TabBarPageRouter: UnwrapRef<typeof import('./src/constants/tabBar')['TabBarPageRouter']>
apps/underTakeMiniApp/src/subpackages/login/loginByForm/accountLoginForm.vue
@@ -92,20 +92,7 @@
  try {
    if (props.policyChecked) {
      userStore.loginSuccess(wxMiniAppUserLoginRes.value);
      Message.success('登录成功', {
        onClosed: async () => {
          if (!Taro.requestSubscribeMessage) {
            await Message.confirm({ message: '你的微信版本过低,不支持订阅消息,是否继续?' });
          }
          await Taro.requestSubscribeMessage({
            tmplIds: subscribeMessageTemplateIdsForU,
            success: function (res) {
              console.log('res: ', res);
            },
          });
          jump();
        },
      });
      handleLoginSuccess();
    } else {
      noAccess();
    }
@@ -124,16 +111,7 @@
          password: form.userPassword,
          code: loginRes.code,
        });
        if (!Taro.requestSubscribeMessage) {
          await Message.confirm({ message: '你的微信版本过低,不支持订阅消息,是否继续?' });
        }
        await Taro.requestSubscribeMessage({
          tmplIds: subscribeMessageTemplateIdsForU,
          success: function (res) {
            console.log('res: ', res);
          },
        });
        jump();
        handleLoginSuccess();
      }
    } else {
      noAccess();
@@ -148,6 +126,37 @@
  Message.warning('请先阅读并勾选协议');
}
async function handleLoginSuccess() {
  try {
    if (!Taro.requestSubscribeMessage) {
      await Message.confirm({ message: '你的微信版本过低,不支持订阅消息,是否继续?' });
    }
    const res = await Taro.getSetting({
      withSubscriptions: true,
    });
    let setting: boolean[] = [];
    if (res.subscriptionsSetting && res.subscriptionsSetting.itemSettings) {
      setting = subscribeMessageTemplateIdsForU
        .map((id) => res.subscriptionsSetting.itemSettings[id] !== 'accept')
        .filter(Boolean);
    }
    Taro.requestSubscribeMessage({
      tmplIds: subscribeMessageTemplateIdsForU,
      success: function (res) {
        console.log('res: ', res);
      },
    });
    console.log('setting: ', setting);
    Message.success('登录成功', {
      onClosed: () => {
        jump();
      },
    });
  } catch (error) {
    console.log('error: ', error);
  }
}
function goRegister() {
  console.log('RouterPath.registerForm: ', RouterPath.registerForm);
  Taro.navigateTo({