Google apps script 如何打开摄像头将二维码扫描到谷歌表单字段?

Google apps script 如何打开摄像头将二维码扫描到谷歌表单字段?,google-apps-script,camera,qr-code,google-forms,Google Apps Script,Camera,Qr Code,Google Forms,我们使用谷歌表单跟踪特定事件的进入。员工和与会者输入他们的身份证号码,该号码与二维码一起发放 我的任务是尝试找出如何使用iPad摄像头(我们使用iPad制作表单)扫描与会者的二维码,并将他们的身份证号码输入表单中的正确字段 我相信我们可以以某种方式使用Google Apps脚本,但我不确定。最近对iphone对话框进行了更改,以便与webapps一起使用,使我可以访问一个对话框,该对话框允许我选择文件上传的来源,其中一个选择是摄像头。我上传了一张应用程序中显示对话框的图像。我还包括了我的html

我们使用谷歌表单跟踪特定事件的进入。员工和与会者输入他们的身份证号码,该号码与二维码一起发放

我的任务是尝试找出如何使用iPad摄像头(我们使用iPad制作表单)扫描与会者的二维码,并将他们的身份证号码输入表单中的正确字段


我相信我们可以以某种方式使用Google Apps脚本,但我不确定。

最近对iphone对话框进行了更改,以便与webapps一起使用,使我可以访问一个对话框,该对话框允许我选择文件上传的来源,其中一个选择是摄像头。我上传了一张应用程序中显示对话框的图像。我还包括了我的html,以便您可以看到它只是一个文件上传。也许这会有所帮助

带有对话框的应用程序的图像:

这是我的html:

<!DOCTYPE html>
<html>
  <head>
    <base target="_top">
    <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
    <script>
      $(function(){
        google.script.run
        .withSuccessHandler(function(rObj){
          $('#dt').val(rObj.date);
        })
        .initForm();
        
      });
      function fileUploadJs(frmData) {
        var amt=$('#amt').val();
        var vndr=$('#vndr').val();
        var img=$('#img').val();
        if(!amt){
          window.alert('No amount provided');
          $('#amt').focus();
          return;
        }
        if(!vndr) {
          window.alert('No vendor provided');
          $('#vndr').focus();
          return;
        }
        if(!img) {
          window.alert('No image chosen');
          $('#img').focus();
        }
        document.getElementById('status').style.display ='inline';
        google.script.run
        .withSuccessHandler(function(hl){
          document.getElementById('status').innerHTML=hl;
        })
        .uploadTheForm(frmData)
      }
      console.log('My Code');
    </script>
    <style>
      input,textarea{margin:5px 5px 5px 0;}
    </style>
  </head>
   <body>
    <h3 id="main-heading">Receipt Information</h3>
    <div id="formDiv">
      <form id="myForm">
        <br /><input type="date" name="date" id="dt"/>
        <br /><input type="number" name="amount" placeholder="Amount" id="amt" />
        <br /><input type="text" name="vendor" placeholder="Vendor" id="vndr"/>
        <br /><textarea name="notes" cols="40" rows="2" placeholder="NOTES"></textarea>
        <br/>Receipt Image
        <br /><input type="file" name="receipt" id="img" />
        <br /><input type="button" value="Submit" onclick="fileUploadJs(this.parentNode)" />
      </form>
    </div>
  <div id="status" style="display: none">
  <!-- div will be filled with innerHTML after form submission. -->
  Uploading. Please wait...
  </div>  
</body>
</html>

$(函数(){
google.script.run
.withSuccessHandler(函数(rObj){
$('#dt').val(rObj.日期);
})
.initForm();
});
函数fileUploadJs(frmData){
var amt=$('#amt').val();
var vndr=$('#vndr').val();
var img=$('#img').val();
如果(!金额){
窗口警报(“未提供金额”);
$('#amt').focus();
返回;
}
如果(!vndr){
窗口警报(“未提供供应商”);
$('#vndr').focus();
返回;
}
如果(!img){
window.alert(“未选择图像”);
$('#img').focus();
}
document.getElementById('status').style.display='inline';
google.script.run
.withSuccessHandler(函数(hl){
document.getElementById('status')。innerHTML=hl;
})
.上传表单(frmData)
}
log(“我的代码”);
输入,文本区域{边距:5px 5px 5px 0;}
收据信息





收据图像

上传。请稍候。。。
最近对用于webapps的iphone对话框进行了更改,使我能够访问一个对话框,该对话框允许我选择文件上传的来源,其中一个选项是摄像头。我上传了一张应用程序中显示对话框的图像。我还包括了我的html,以便您可以看到它只是一个文件上传。也许这会有所帮助

带有对话框的应用程序的图像:

这是我的html:

<!DOCTYPE html>
<html>
  <head>
    <base target="_top">
    <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
    <script>
      $(function(){
        google.script.run
        .withSuccessHandler(function(rObj){
          $('#dt').val(rObj.date);
        })
        .initForm();
        
      });
      function fileUploadJs(frmData) {
        var amt=$('#amt').val();
        var vndr=$('#vndr').val();
        var img=$('#img').val();
        if(!amt){
          window.alert('No amount provided');
          $('#amt').focus();
          return;
        }
        if(!vndr) {
          window.alert('No vendor provided');
          $('#vndr').focus();
          return;
        }
        if(!img) {
          window.alert('No image chosen');
          $('#img').focus();
        }
        document.getElementById('status').style.display ='inline';
        google.script.run
        .withSuccessHandler(function(hl){
          document.getElementById('status').innerHTML=hl;
        })
        .uploadTheForm(frmData)
      }
      console.log('My Code');
    </script>
    <style>
      input,textarea{margin:5px 5px 5px 0;}
    </style>
  </head>
   <body>
    <h3 id="main-heading">Receipt Information</h3>
    <div id="formDiv">
      <form id="myForm">
        <br /><input type="date" name="date" id="dt"/>
        <br /><input type="number" name="amount" placeholder="Amount" id="amt" />
        <br /><input type="text" name="vendor" placeholder="Vendor" id="vndr"/>
        <br /><textarea name="notes" cols="40" rows="2" placeholder="NOTES"></textarea>
        <br/>Receipt Image
        <br /><input type="file" name="receipt" id="img" />
        <br /><input type="button" value="Submit" onclick="fileUploadJs(this.parentNode)" />
      </form>
    </div>
  <div id="status" style="display: none">
  <!-- div will be filled with innerHTML after form submission. -->
  Uploading. Please wait...
  </div>  
</body>
</html>

$(函数(){
google.script.run
.withSuccessHandler(函数(rObj){
$('#dt').val(rObj.日期);
})
.initForm();
});
函数fileUploadJs(frmData){
var amt=$('#amt').val();
var vndr=$('#vndr').val();
var img=$('#img').val();
如果(!金额){
窗口警报(“未提供金额”);
$('#amt').focus();
返回;
}
如果(!vndr){
窗口警报(“未提供供应商”);
$('#vndr').focus();
返回;
}
如果(!img){
window.alert(“未选择图像”);
$('#img').focus();
}
document.getElementById('status').style.display='inline';
google.script.run
.withSuccessHandler(函数(hl){
document.getElementById('status')。innerHTML=hl;
})
.上传表单(frmData)
}
log(“我的代码”);
输入,文本区域{边距:5px 5px 5px 0;}
收据信息





收据图像

上传。请稍候。。。