From eb23a7c7faefe86330a88f9118b8211f6b86e75b Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 20 九月 2022 19:00:58 +0800
Subject: [PATCH] 1.点检项目开发( 除提交功能外完成)
---
plus/barcode.html | 284 ++++++++++++++++++++++++++++++--------------------------
1 files changed, 153 insertions(+), 131 deletions(-)
diff --git a/plus/barcode.html b/plus/barcode.html
index 2b0f601..1c470a8 100644
--- a/plus/barcode.html
+++ b/plus/barcode.html
@@ -1,151 +1,173 @@
<!DOCTYPE HTML>
<html>
<head>
- <meta charset="utf-8"/>
- <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
- <meta name="HandheldFriendly" content="true"/>
- <meta name="MobileOptimized" content="320"/>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
+ <meta name="HandheldFriendly" content="true" />
+ <meta name="MobileOptimized" content="320" />
<title>Hello H5+</title>
<script type="text/javascript" src="../js/common.js"></script>
<script type="text/javascript">
-var img = null;
-var blist = [];
-function scaned(t, r, f){
- var d = new Date();
- var h=d.getHours(),m=d.getMinutes(),s=d.getSeconds(),ms=d.getMilliseconds();
- if(h < 10){ h='0'+h; }
- if(m < 10){ m='0'+m; }
- if(s < 10){ s='0'+s; }
- if(ms < 10){ ms='00'+ms; }
- else if(ms < 100){ ms='0'+ms; }
- var ts = '['+h+':'+m+':'+s+'.'+ms+']';
- var li=null,hl = document.getElementById('history');
- if(blist.length > 0){
- li = document.createElement('li');
- li.className = 'ditem';
- hl.insertBefore(li, hl.childNodes[0]);
- } else{
- li = document.getElementById('nohistory');
- }
- li.id = blist.length;
- var html = '['+h+':'+m+':'+s+'.'+ms+']'+'銆�銆�'+t+'鐮�<div class="hdata">';
- html += r;
- html += '</div>';
- li.innerHTML = html;
- li.setAttribute('onclick', 'selected(id)');
- blist[blist.length] = {type:t,result:r,file:f};
- update(t, r, f);
-}
-function selected(id){
- var h = blist[id];
- update( h.type, h.result, h.file );
- if(h.result.indexOf('http://')==0 || h.result.indexOf('https://')==0){
- plus.nativeUI.confirm(h.result, function(i){
- if(i.index == 0){
- plus.runtime.openURL(h.result);
+ var img = null;
+ var blist = [];
+
+ function scaned(t, r, f) {
+ var d = new Date();
+ var h = d.getHours(),
+ m = d.getMinutes(),
+ s = d.getSeconds(),
+ ms = d.getMilliseconds();
+ if (h < 10) {
+ h = '0' + h;
+ }
+ if (m < 10) {
+ m = '0' + m;
+ }
+ if (s < 10) {
+ s = '0' + s;
+ }
+ if (ms < 10) {
+ ms = '00' + ms;
+ } else if (ms < 100) {
+ ms = '0' + ms;
+ }
+ var ts = '[' + h + ':' + m + ':' + s + '.' + ms + ']';
+ var li = null,
+ hl = document.getElementById('history');
+ if (blist.length > 0) {
+ li = document.createElement('li');
+ li.className = 'ditem';
+ hl.insertBefore(li, hl.childNodes[0]);
+ } else {
+ li = document.getElementById('nohistory');
+ }
+ li.id = blist.length;
+ var html = '[' + h + ':' + m + ':' + s + '.' + ms + ']' + '銆�銆�' + t + '鐮�<div class="hdata">';
+ html += r;
+ html += '</div>';
+ li.innerHTML = html;
+ li.setAttribute('onclick', 'selected(id)');
+ blist[blist.length] = {
+ type: t,
+ result: r,
+ file: f
+ };
+ update(t, r, f);
}
- }, '', ['鎵撳紑', '鍙栨秷']);
- } else{
- plus.nativeUI.alert(h.result);
- }
-}
-function update(t, r, f){
- outSet('鎵弿鎴愬姛锛�');
- outLine(t);
- outLine(r);
- outLine('\n鍥剧墖鍦板潃锛�'+f);
- if(!f || f=='null'){
- img.src = '../img/barcode.png';
- } else{
- plus.io.resolveLocalFileSystemURL(f, function(entry){
- img.src=entry.toLocalURL();
- });
- //img.src = 'http://localhost:13131/'+f;
- }
-}
-function onempty(){
- if(window.plus){
- plus.nativeUI.alert('鏃犳壂鎻忚褰�');
- } else {
- alert('鏃犳壂鎻忚褰�');
- }
-}
-function cleanHistroy(){
- if(blist.length > 0){
- var hl = document.getElementById('history');
- hl.innerHTML = '<li id="nohistory" class="ditem" onclick="onempty();">鏃犲巻鍙茶褰� </li>';
- }
- plus.io.resolveLocalFileSystemURL('_doc/barcode/', function(entry){
- entry.removeRecursively(function(){
- // Success
- }, function(e){
- //alert( "failed"+e.message );
- });
- });
-}
-// 鎵撳紑浜岀淮鐮佹壂鎻忕晫闈�
-function openBarcode(){
- createWithoutTitle('barcode_scan.html', {
- titleNView:{
- type: 'float',
- backgroundColor: 'rgba(215,75,40,0.3)',
- titleText: '鎵竴鎵�',
- titleColor: '#FFFFFF',
- autoBackButton: true,
- buttons: [{
- fontSrc: '_www/helloh5.ttf',
- text: '\ue302',
- fontSize: '18px',
- onclick: 'javascript:scanPicture()'
- }]
- }
- });
-}
-// 鎵撳紑鑷畾涔夋壂鎻忕晫闈�
-function openBarcodeCustom(){
- createWithoutTitle('barcode_custom.html', {
- titleNView:{
- type: 'float',
- backgroundColor: 'rgba(215,75,40,0.3)',
- titleText: '鎵竴鎵�',
- titleColor: '#FFFFFF',
- autoBackButton: true,
- buttons: [{
- fontSrc: '_www/helloh5.ttf',
- text: '\ue401',
- fontSize: '18px',
- onclick: 'javascript:switchFlash()'
- }]
- }
- });
-}
+
+ function selected(id) {
+ var h = blist[id];
+ update(h.type, h.result, h.file);
+ if (h.result.indexOf('http://') == 0 || h.result.indexOf('https://') == 0) {
+ plus.nativeUI.confirm(h.result, function(i) {
+ if (i.index == 0) {
+ plus.runtime.openURL(h.result);
+ }
+ }, '', ['鎵撳紑', '鍙栨秷']);
+ } else {
+ plus.nativeUI.alert(h.result);
+ }
+ }
+
+ function update(t, r, f) {
+ outSet('鎵弿鎴愬姛锛�');
+ outLine(t);
+ outLine(r);
+ outLine('\n鍥剧墖鍦板潃锛�' + f);
+ if (!f || f == 'null') {
+ img.src = '../img/barcode.png';
+ } else {
+ plus.io.resolveLocalFileSystemURL(f, function(entry) {
+ img.src = entry.toLocalURL();
+ });
+ //img.src = 'http://localhost:13131/'+f;
+ }
+ }
+
+ function onempty() {
+ if (window.plus) {
+ plus.nativeUI.alert('鏃犳壂鎻忚褰�');
+ } else {
+ alert('鏃犳壂鎻忚褰�');
+ }
+ }
+
+ function cleanHistroy() {
+ if (blist.length > 0) {
+ var hl = document.getElementById('history');
+ hl.innerHTML = '<li id="nohistory" class="ditem" onclick="onempty();">鏃犲巻鍙茶褰� </li>';
+ }
+ plus.io.resolveLocalFileSystemURL('_doc/barcode/', function(entry) {
+ entry.removeRecursively(function() {
+ // Success
+ }, function(e) {
+ //alert( "failed"+e.message );
+ });
+ });
+ }
+ // 鎵撳紑浜岀淮鐮佹壂鎻忕晫闈�
+ function openBarcode() {
+ createWithoutTitle('barcode_scan.html', {
+ titleNView: {
+ type: 'float',
+ backgroundColor: 'rgba(215,75,40,0.3)',
+ titleText: '鎵竴鎵�',
+ titleColor: '#FFFFFF',
+ autoBackButton: true,
+ buttons: [{
+ fontSrc: '_www/helloh5.ttf',
+ text: '\ue302',
+ fontSize: '18px',
+ onclick: 'javascript:scanPicture()'
+ }]
+ }
+ });
+ }
+ // 鎵撳紑鑷畾涔夋壂鎻忕晫闈�
+ function openBarcodeCustom() {
+ createWithoutTitle('barcode_custom.html', {
+ titleNView: {
+ type: 'float',
+ backgroundColor: 'rgba(215,75,40,0.3)',
+ titleText: '鎵竴鎵�',
+ titleColor: '#FFFFFF',
+ autoBackButton: true,
+ buttons: [{
+ fontSrc: '_www/helloh5.ttf',
+ text: '\ue401',
+ fontSize: '18px',
+ onclick: 'javascript:switchFlash()'
+ }]
+ }
+ });
+ }
</script>
- <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8"/>
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
<style type="text/css" media="screen">
-.hdata {
- color: #e1673e;
- font-size: 14px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
+ .hdata {
+ color: #e1673e;
+ font-size: 14px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
</style>
</head>
<body onload="img=document.getElementById('bimg')">
- <br/>
- <img style="width:40%" id="bimg" src="../img/barcode.png"/>
- <br/>
+ <br />
+ <img style="width:40%" id="bimg" src="../img/barcode.png" />
+ <br />
<div class="button" onclick="openBarcode()">鎵竴鎵�</div>
<div class="button" onclick="openBarcodeCustom()">鎵竴鎵紙鑷畾涔夛級</div>
- <br/>
+ <br />
<ul id="history" class="dlist" style="text-align:left;">
- <li id="nohistory" class="ditem" onclick="onempty()">鏃犲巻鍙茶褰� </li>
+ <li id="nohistory" class="ditem" onclick="onempty()">鏃犲巻鍙茶褰� </li>
</ul>
- <br/>
+ <br />
<div class="button button-waring" onclick="cleanHistroy()">娓呯┖鍘嗗彶璁板綍</div>
- <div id="outpos"/>
+ <div id="outpos" />
<div id="output">
-Barcode鎻愪緵浜岀淮鐮佹壂鎻忚瘑鍒姛鑳斤紝鏀寔璋冪敤鎽勫儚澶村嵆鏃舵壂鎻忎簩缁寸爜锛屼篃鍙洿鎺ヨ緭鍏ュ浘鐗囪繘琛屾壂鎻忚瘑鍒��
+ Barcode鎻愪緵浜岀淮鐮佹壂鎻忚瘑鍒姛鑳斤紝鏀寔璋冪敤鎽勫儚澶村嵆鏃舵壂鎻忎簩缁寸爜锛屼篃鍙洿鎺ヨ緭鍏ュ浘鐗囪繘琛屾壂鎻忚瘑鍒��
</div>
</body>
-</html>
\ No newline at end of file
+</html>
--
Gitblit v1.9.3