ReceptionRegisterComponent

最低版本: 1.0.0最后更新: 2020/3/30

组件功能:

用于接待拍照阶段,根据拍照的图片去服务端注册人脸信息

支持平台

平台是否支持
豹小秘
豹花/大瓶
M平台

参数

参数名类型属性JS类型Java类型默认值必填说明最低版本
paramReceptionRegisterParamphotoSrcstringStringyes图片的路径1.0.0
guestNamestringStringyes访客名字1.0.0
taskIdstringStringyes任务ID1.0.0

结果码

返回结果描述
RESULT_SUCCESS32610001组件执行成功

错误码

返回错误描述
ERROR_PARAMS_PHOTO_PATH_INVALID-32610001照片路径参数无效
ERROR_PARAMS_GUEST_NAME_INVALID-32610002人物姓名参数无效
ERROR_PARAMS_TASK_ID_INVALID-32610003任务ID参数无效
ERROR_REMOTE_RECEPTION_REGISTER_FAILED-32640001注册失败
ERROR_RECEPTION_REGISTER_TIMEOUT-32600005注册超时

示例代码:

this.receptionRegisterParam = new ReceptionRegisterParam(

  task_id,respondent_name);

<ReceptionRegisterComponent

  param={this.receptionRegisterParam}

  onFinish={this.receptionRegisterOnFinish}

/>

public receptionRegisterOnFinish = (param?: ComponentEvent) => {

  console.log(

      'FaceCollectionViewModel',

      'receptionRegisterOnFinish',

      param

  );

  if (param && param.data && param.status) {

      switch (param.status) {

          case ComponentResultConst.RESULT_SUCCESS:

              let reason = JSON.parse(param.data);

              // let status = reason.status;

              let groupSize = reason.group_size;

              let checkCnt = reason.check_in_count;

              let isResubmit = reason.resubmit;

              let isStaff = reason.is_staff;

              console.log(

                  'FaceCollectionViewModel',

                  'receptionRegisterOnFinish',

                  ' groupSize ',

                  groupSize,

                  ',checkCnt ',

                  checkCnt,

                  ' isResubmit ',

                  isResubmit,

                  ' isStaff ',

                  isStaff

              );

              this.registerResult(

                  groupSize,

                  checkCnt,

                  isResubmit,

                  isStaff

              );

              break;

          case ComponentErrorConst.ERROR_PARAMS_PHOTO_PATH_INVALID:

          case ComponentErrorConst.ERROR_PARAMS_GUEST_NAME_INVALID:

          case ComponentErrorConst.ERROR_PARAMS_TASK_ID_INVALID:

          case ComponentErrorConst.ERROR_REMOTE_RECEPTION_REGISTER_FAILED:

          case ComponentErrorConst.ERROR_RECEPTION_REGISTER_TIMEOUT:

          default:

              let ttsText = '照片不合格,请重拍一张吧';

              speechApi.playText(-1, ttsText);

              this.faceCollectionState.message = ttsText;

              this.faceCollectionState.isShowMessage = true;

              break;

      }

  }

  return true;

};