Browse Source

临时测试语音功能

dev
陈鹏飞 3 years ago
parent
commit
11f3e581f5
  1. 1
      src/app/pages/login/login.component.html
  2. 6
      src/app/pages/login/login.component.ts

1
src/app/pages/login/login.component.html

@ -1,6 +1,7 @@
<div class="login" id="login">
<div class="card">
<h1 class="cardheader">欢迎登陆</h1>
<input type="text" [(ngModel)]="yuyinmsg"><button style="color: #000;" (click)="ceshiYuyin()">测试语音</button>
<form nz-form [formGroup]="validateForm" class="login-form" (ngSubmit)="submitForm()">
<nz-form-item>
<nz-form-control nzErrorTip="请输入账号!">

6
src/app/pages/login/login.component.ts

@ -6,6 +6,7 @@ import { CookieService } from 'ngx-cookie-service';//cookie插件
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NzMessageService } from 'ng-zorro-antd/message';
import { SpeakingTool } from 'src/app/babylon/tool/speaking-tool';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
@ -27,6 +28,11 @@ export class LoginComponent implements OnInit {
errmsg: string = ''; //错误信息
yuyinmsg: string;
ceshiYuyin() {
SpeakingTool.Instance.speak(this.yuyinmsg)
}
//跳转注册页面
toRegister() {

Loading…
Cancel
Save