Commit a64a420e by 李宁

1

1 parent 9bd90ea0
......@@ -3,9 +3,9 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>添加工单</title>
<title>江苏移动</title>
<link rel="stylesheet" href="css/vant.css"/>
<link rel="stylesheet" href="css/addOrder.css">
<link rel="stylesheet" href="css/addOrder.css?123123">
</head>
<body>
<div id="pageDiv" class="pageDiv">
......
......@@ -123,8 +123,9 @@ div{
position: fixed;
width: 7.02rem;
height: .88rem;
line-height: .88rem;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
color: #fff;
border-radius: .08rem;
background: #568FFE;
......@@ -171,9 +172,10 @@ div{
}
.outAlert .alertCon .butt div{
width: 50%;
text-align: center;
height: .98rem;
line-height: .98rem;
display: flex;
justify-content: center;
align-items: center;
}
.outAlert .alertCon .butt .right{
color: #568FFE;
......
......@@ -82,19 +82,39 @@ html,body{
display: flex;
align-items: center;
padding: .12rem .16rem;
border-radius: .4rem 0px 0px .4rem;
background: rgba(54, 54, 54, 0.90);
margin-right: -.24rem;
}
.conDiv .swUp .til .right img{
width: .32rem;
height: .32rem;
margin-right: .08rem;
margin-right: -.08rem;
display: none;
}
.conDiv .swUp .til .right div{
.conDiv .swUp .til .right .rli{
display: flex;
flex-direction: column;
align-items: center;
color: #fff;
font-size: .26rem;
font-weight: 500;
font-size: .2rem;
position: relative;
}
.conDiv .swUp .til .right .rli .rlii{
display: flex;
flex-direction: column;
align-items: center;
}
.conDiv .swUp .til .right .rli .open{
color: #FFAE00;
}
.conDiv .swUp .til .right .rli:nth-child(1){
margin-right: .34rem;
}
.conDiv .swUp .til .right .rli .img{
width: .4rem;
height: .4rem;
margin-bottom: .08rem;
}
.conDiv .swUp .til .right .rli .ts{
width: 3.6rem;
position: absolute;
top: .76rem;
right: -0.8rem;
display: none;
}
.conDiv .swUp .detail{
color: #fff;
......@@ -201,8 +221,9 @@ html,body{
.conDiv .swMiddle .butt .bclick{
width: 1.6rem;
height: .48rem;
line-height: .48rem;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
border-radius: .24rem;
color: #fff;
font-size: .28rem;
......@@ -234,7 +255,9 @@ html,body{
font-size: .32rem;
font-weight: 500;
height: .8rem;
line-height: .8rem;
display: flex;
align-items: center;
justify-content: center;
}
.conDiv .swDown .buttDiv .two{
display: flex;
......@@ -243,7 +266,9 @@ html,body{
.conDiv .swDown .buttDiv .two div{
width: 3.4rem;
height: .8rem;
line-height: .8rem;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
font-size: .32rem;
font-weight: 500;
......@@ -257,7 +282,9 @@ html,body{
.conDiv .swDown .buttDiv .three div{
width: 2.23rem;
height: .8rem;
line-height: .8rem;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
font-size: .32rem;
font-weight: 500;
......@@ -344,9 +371,10 @@ html,body{
.alertDiv .inner .bot button{
border-radius: 4px;
height: .88rem;
line-height: .88rem;
display: flex;
justify-content: center;
align-items: center;
width: 2.4rem;
text-align: center;
font-size: .32rem;
font-weight: 500;
}
......@@ -491,9 +519,10 @@ html,body{
}
.outAlert .alertCon .butt div{
width: 50%;
text-align: center;
height: .98rem;
line-height: .98rem;
display: flex;
justify-content: center;
align-items: center;
}
.outAlert .alertCon .butt .right{
color: #568FFE;
......@@ -573,13 +602,15 @@ html,body{
border-radius: .08rem;
background: #568FFE;
height: .88rem;
line-height: .88rem;
text-align: center;
color: #FFF;
font-size: .34rem;
font-weight: 500;
margin-top: .4rem;
margin-bottom: .32rem;
display: flex;
align-items: center;
justify-content: center;
}
......@@ -630,8 +661,9 @@ html,body{
border-radius: .08rem;
background: #568FFE;
height: .88rem;
line-height: .88rem;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
color: #FFF;
font-size: .34rem;
font-weight: 500;
......@@ -713,8 +745,9 @@ html,body{
background: #F6F6F6;
color: #666;
height: .88rem;
line-height: .88rem;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
width: 2.52rem;
}
.noShootCon .botBut .right{
......@@ -765,11 +798,101 @@ html,body{
background: #F6F6F6;
color: #666;
height: .88rem;
line-height: .88rem;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
width: 2.64rem;
}
.paiZhaoCon .botBut .right{
color: #fff;
background: #568FFE;
}
.outAlert .noTestCon{
display: flex;
justify-content: center;
flex-direction: column;
width: 6.4rem;
padding-bottom: .4rem;
}
.noTestCon .til{
padding: 0 .4rem;
color: #333;
font-size: .36rem;
font-weight: bold;
margin-top: .48rem;
margin-bottom: .4rem;
text-align: center;
}
.noTestCon .topTs{
color: #333;
font-size: .32rem;
line-height: .52rem;
margin-bottom: .48rem;
padding: 0 .48rem;
}
.noTestCon .cli{
padding: 0 .48rem;
margin-bottom: .48rem;
}
.noTestCon .cli .ctil{
display: flex;
align-items: center;
color: #666;
font-size: .28rem;
margin-bottom: .16rem;
}
.noTestCon .cli textarea{
width: 100%;
padding: .24rem .32rem;
border-radius: .08rem;
min-height: 1.6rem;
box-sizing: border-box;
border: 1px solid #d9d9d9;
outline: none;
font-size: .32rem;
}
.noTestCon .cli textarea::placeholder{
color: #999;
}
.noTestCon .know{
color: #fff;
background: #568FFE;
width: 5.44rem;
height: .88rem;
display: flex;
justify-content: center;
align-items: center;
font-size: .34rem;
font-weight: 500;
margin: auto;
border-radius: .08rem;
}
.noTestCon .close{
position: absolute;
bottom: -1.28rem;
width: .8rem;
height: .8rem;
left: 50%;
transform: translateX(-50%);
}
.noTestCon .cli .ctil img{
width: .14rem;
margin-right: .08rem;
}
.noTestCon .botTs{
color: #666;
font-size: .26rem;
line-height: .36rem;
margin-top: .2rem;
padding: 0 .48rem;
text-align: center;
}
div{
font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
\ No newline at end of file
......@@ -188,14 +188,26 @@ div{
border-bottom: 1px solid #F6F6F6;
display: flex;
justify-content: space-between;
align-items: center;
}
.orderList .orderli .ortil .gdid{
flex-grow: 1;
word-break: break-all;
line-height: 1.3;
margin-right: 0.2rem;
}
.orderList .orderli .ortil .icon{
padding: .1rem;
border-radius: .04rem;
background: rgba(86, 143, 254, 0.10);
color: #568FFE;
font-size: .3rem;
font-weight: 400;
height: .5rem;
width: 1.4rem;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.orderList .orderli .orcon{
padding: 0 .16rem;
......@@ -226,8 +238,9 @@ div{
border: 1px solid #DCDEE0;
width: 1.44rem;
height: .64rem;
text-align: center;
line-height: .64rem;
display: flex;
justify-content: center;
align-items: center;
color: #333;
font-size: .32rem;
}
......@@ -260,8 +273,9 @@ div{
}
.botButt div{
height: .88rem;
line-height: .88rem;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
color: #fff;
border-radius: .08rem;
background: #568FFE;
......@@ -379,8 +393,9 @@ div{
border-radius: .08rem;
background: #568FFE;
height: .88rem;
line-height: .88rem;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
color: #fff;
font-size: .34rem;
font-weight: 500;
......@@ -423,8 +438,9 @@ div{
border-radius: .08rem;
background: #568FFE;
height: .88rem;
line-height: .88rem;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
color: #fff;
font-size: .34rem;
font-weight: 500;
......@@ -532,12 +548,13 @@ div{
background: #568FFE;
width: 5.44rem;
height: .88rem;
line-height: .88rem;
display: flex;
justify-content: center;
align-items: center;
font-size: .34rem;
font-weight: 500;
margin: auto;
border-radius: .08rem;
text-align: center;
}
.modifyAddreCon .close{
position: absolute;
......@@ -597,9 +614,10 @@ div{
}
.feedbackConfirmCon .butt div{
width: 50%;
text-align: center;
height: .98rem;
line-height: .98rem;
display: flex;
justify-content: center;
align-items: center;
}
.feedbackConfirmCon .butt .right{
color: #568FFE;
......
......@@ -67,8 +67,9 @@ div{
.botButt{
width: 3.38rem;
height: .88rem;
line-height: .88rem;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
color: #fff;
border-radius: .08rem;
background: #568FFE;
......
......@@ -7,7 +7,7 @@
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>江苏移动</title>
<link rel="stylesheet" href="https://xpo.oss-cn-beijing.aliyuncs.com/huaian/css/vant.css"/>
<link rel="stylesheet" href="css/demo.css?3333">
<link rel="stylesheet" href="css/demo.css?0909019011131">
</head>
<body>
......@@ -33,9 +33,18 @@
<div>江苏移动</div>
</div>
<div class="right" id="cameraDiv">
<img src="https://xpo.oss-cn-beijing.aliyuncs.com/huaian/camera.png">
<div>镜头包</div>
<div class="right" id="toolDiv">
<div class="rli" id="lightOutDiv">
<div class="rlii" id="lightDiv">
<img id="lightImg" class="img" src="https://xpo.oss-cn-beijing.aliyuncs.com/huaian/light.png">
<div>手电筒</div>
</div>
<img id="lightShowTs" class="ts" src="https://xpo.oss-cn-beijing.aliyuncs.com/huaian/lightTs.png">
</div>
<div class="rli" id="cameraDiv">
<img class="img" src="https://xpo.oss-cn-beijing.aliyuncs.com/huaian/camera.png?123">
<div>镜头包</div>
</div>
</div>
</div>
<div class="detail" id="contextDiv"></div>
......@@ -157,8 +166,18 @@
<div class="alertCon">
<div class="info">因长时间未收到有效视频信息,质检流程暂时关闭。</div>
<div class="butt">
<div class="left" id="pageClose">关闭</div>
<div class="right" id="continueTest">继续质检</div>
<div class="left pageClose">关闭</div>
<div class="right continueTest">继续质检</div>
</div>
</div>
</div>
<div class="outAlert" id="beginFail">
<div class="alertCon">
<div class="info">启动失败,请刷新重试</div>
<div class="butt">
<div class="left pageClose">关闭</div>
<div class="right continueTest">刷新</div>
</div>
</div>
</div>
......@@ -295,7 +314,7 @@
<div class="outAlert" id="pictureShowAlert">
<div class="paiZhaoCon">
<div class="til">温馨提示</div>
<div class="ts">为确保准确识别串号,请拍清照片并确认串号清晰可见后,再提交。</div>
<div class="ts" id="picshowText">为确保准确识别串号,请拍清照片并确认串号清晰可见后,再提交。</div>
<img id="photoImg" src="http://xpo.oss-cn-beijing.aliyuncs.com/huaian/cameraSwitchGuide.png">
<div class="botBut">
<div class="left snAgain" key="photo">重新拍摄</div>
......@@ -304,6 +323,28 @@
</div>
</div>
<div class="outAlert" id="noShootReasonAlert">
<div class="alertCon noTestCon">
<div class="til">我要反馈</div>
<div class="topTs">如你出现无法拍摄的情况,比如反复拍摄无法识别,安装环境无法正常拍摄,你可填写原因和情况说明跳过此环节。</div>
<div class="cli">
<div class="ctil">
<img src="https://xpo.oss-cn-beijing.aliyuncs.com/huaian/xing.png" alt="">
<div>情况说明</div>
</div>
<textarea id="noShootReason" placeholder="请填写具体情况"></textarea>
</div>
<div class="know" id="noShootSave">保存</div>
<div class="botTs">提交后管理员会重点检查,并且您无法再次对该环节进行质检</div>
<img class="close" id="noShootClose" src="https://xpo.oss-cn-beijing.aliyuncs.com/huaian/close.png">
</div>
</div>
<!-- <script type="text/javascript" charset="utf-8" src="js/vconsole.min.js"></script>
<script>
var vConsole = new VConsole();
......@@ -313,11 +354,10 @@
<script src="js/jquery-3.4.1.min.js"></script>
<script src="js/axios.min.js"></script>
<script src="js/AgoraRTC_N.js"></script>
<script src="js/util.js?999999"></script>
<script src="js/util.js?1212"></script>
<script src="js/vue.min.js"></script>
<script src="js/vant.min.js"></script>
<script src="js/demo.js?126466499"></script>
</script>
<script src="js/demo.js?063347090"></script>
</body>
</html>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1745820752112" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2173" width="256" height="256" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M515.5 979.9c-19.33 0-35-15.67-35-35V782.8c0-19.33 15.67-35 35-35s35 15.67 35 35v162.1c0 19.33-15.67 35-35 35zM515.5 294c-19.33 0-35-15.67-35-35V96.9c0-19.33 15.67-35 35-35s35 15.67 35 35V259c0 19.33-15.67 35-35 35zM815.31 855.71c-8.96 0-17.91-3.42-24.75-10.25L675.94 730.84c-13.67-13.67-13.67-35.83 0-49.5 13.67-13.67 35.83-13.67 49.5 0l114.62 114.62c13.67 13.67 13.67 35.83 0 49.5a34.915 34.915 0 0 1-24.75 10.25zM330.31 370.71c-8.96 0-17.91-3.42-24.75-10.25L190.94 245.84c-13.67-13.67-13.67-35.83 0-49.5 13.67-13.67 35.83-13.67 49.5 0l114.62 114.62c13.67 13.67 13.67 35.83 0 49.5a34.915 34.915 0 0 1-24.75 10.25zM939.5 555.9H777.4c-19.33 0-35-15.67-35-35s15.67-35 35-35h162.1c19.33 0 35 15.67 35 35s-15.67 35-35 35zM253.6 555.9H91.5c-19.33 0-35-15.67-35-35s15.67-35 35-35h162.1c19.33 0 35 15.67 35 35s-15.67 35-35 35zM700.69 370.71c-8.96 0-17.91-3.42-24.75-10.25-13.67-13.67-13.67-35.83 0-49.5l114.62-114.62c13.67-13.67 35.83-13.67 49.5 0 13.67 13.67 13.67 35.83 0 49.5L725.44 360.46c-6.83 6.83-15.79 10.25-24.75 10.25zM215.69 855.71c-8.96 0-17.91-3.42-24.75-10.25-13.67-13.67-13.67-35.83 0-49.5l114.62-114.62c13.67-13.67 35.83-13.67 49.5 0s13.67 35.83 0 49.5L240.44 845.46a34.915 34.915 0 0 1-24.75 10.25z" p-id="2174" fill="#bfbfbf"></path></svg>
\ No newline at end of file
......@@ -3,9 +3,9 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>质检信息</title>
<title>江苏移动</title>
<link rel="stylesheet" href="https://xpo.oss-cn-beijing.aliyuncs.com/huaian/css/vant.css"/>
<link rel="stylesheet" href="css/index.css?14444">
<link rel="stylesheet" href="css/index.css?90909090">
</head>
<body>
<!-- <script>
......@@ -65,7 +65,7 @@
<div class="orderli" v-for="(item,index) in detail.devicessList
">
<div class="ortil">
<div>工单{{index+1}}:{{item.orderCode}}</div>
<div class="gdid">工单{{index+1}}:{{item.orderCode}}</div>
<div class="icon" v-show="item.isLocal==1">手动录入</div>
</div>
<div class="orcon">
......@@ -250,7 +250,7 @@
</div>
<div class="noData" v-if="noDataFlag">
<img src="https://xpo.oss-cn-beijing.aliyuncs.com/huaian/noData.png" alt="">
<img src="https://xpo.oss-cn-beijing.aliyuncs.com/huaian/noData.png?0909090" alt="">
</div>
</div>
......@@ -259,6 +259,6 @@
<script src="https://xpo.oss-cn-beijing.aliyuncs.com/huaian/js/vue.min.js"></script>
<script src="https://xpo.oss-cn-beijing.aliyuncs.com/huaian/js/vant.min.js"></script>
<script src="https://xpo.oss-cn-beijing.aliyuncs.com/huaian/js/util.js?11111"></script>
<script src="js/index.js?23111232388"></script>
<script src="js/index.js?999399"></script>
</body>
</html>
\ No newline at end of file
......@@ -135,8 +135,10 @@ var noShootClick = false
var jdhEaxmpleShow = false
var cgmExampleShow = false
var zgmExampleShow = false
var dartTsShow = false
var snInputNum
var noShootNum
var voiceUrl = ''
function getProcess(){
if(!window.location.href.includes('demo.html')){
......@@ -158,6 +160,7 @@ function getProcess(){
$("#confirmFlag").show()
return
}
if(res.checkStatus && res.checkStatus==1){
$('#waitting').show()
$("#mp3Source")[0].pause()
......@@ -232,13 +235,28 @@ function getProcess(){
window.location.replace('result.html?time='+ new Date().getTime())
}
});
$("#mp3Source")[0].addEventListener('error', e => {
if(voiceUrl){
("#mp3Source")[0].muted = false
$("#mp3Source").attr('src', voiceUrl)
$("#mp3Source")[0].play()
}
console.warn('解码失败', e.target.error);
});
}
ifListener = true
$("#mp3Source")[0].muted = res.voiceUrlMp3?false:true
$("#mp3Source").attr('src', res.voiceUrlMp3)
$("#mp3Source")[0].autoplay = true
$("#mp3Source")[0].play()
if(res.voiceUrlMp3){
$("#mp3Source")[0].pause()
$("#mp3Source")[0].muted = false
voiceUrl = res.voiceUrlMp3
setTimeout(()=>{
$("#mp3Source").attr('src', voiceUrl)
$("#mp3Source")[0].play()
},350)
}
audioSet(false)
if(stepId.includes('SN') && !res.contentSN){
......@@ -351,6 +369,28 @@ function audioSet(flag){
}
}
function getSnErrorInfo(code){
let key = code || stepId
let pageText = ''
let id = ''
if(key.startsWith('cgm')){
pageText = '1、请将摄像头近距离正面聚焦在 CMEI码上,确保整串字符完整清晰。'
id = 'cgm'
}else if(key.startsWith('jdh')){
pageText = '1、请将摄像头近距离正面聚焦在 STBID/SN 码上,确保整串字符完整清晰。'
id = 'jdh'
}else if(key.startsWith('poeSwitch')){
pageText = '1、请将摄像头近距离正面聚焦在 CMEI 码上,确保整串字符完整清晰。'
id = 'poeSwitch'
}
return {
pageText,
imgUrl: ('https://xpo.oss-cn-beijing.aliyuncs.com/huaian/'+id+'SnSbError.png'),
}
}
function getSnInfo(code){
let key = code || stepId
let pageText = ''
......@@ -386,6 +426,9 @@ function getSnInfo(code){
}else if(key.startsWith('complainZ')){
pageText = '请拍摄主光猫的指示灯,将镜头对准指示灯的亮灯情况,如图所示:'
id = 'complainZ'
}else if(key.startsWith('poeSwitch')){
pageText = '请拍摄POE交换机铭牌,将镜头对准要识别的号码,如图所示:'
id = 'poeSwitch'
}
return {
......@@ -438,6 +481,12 @@ function getNoShootInfo(code){
}else if(key.startsWith('Otv')){
pageText = '方法1:拍摄时请将正常播放画面的电视机置于屏幕中央。'
id = 'Otv'
}else if(key.startsWith('poePanel')){
pageText = '方法1:近距离聚焦拍摄POE面板的正面,露出移动的标识。'
id = 'poePanel'
}else if(key.startsWith('poeSwitchboard')){
pageText = '方法1:近距离聚焦拍摄POE交换机的正面,露出移动的标识。'
id = 'poeSwitchboard'
}
return {
......@@ -494,7 +543,7 @@ function detailTime(num) {
$("#videoSwitch").click(async function(e){
if(cams.length<=1){
toast('暂不支持')
util.toast('暂不支持')
}else{
if(!camsId){
if(cams.length == 2){
......@@ -526,7 +575,7 @@ $("#videoSwitch").click(async function(e){
function setStepButt(){
$('.none').hide()
if(stepId.startsWith("start_")){
$("#readButt").show()
$("#readButt").css('display','flex')
}
if(stepId.startsWith("account_") || stepId.includes("SN") || stepId.startsWith("complain")){
......@@ -553,16 +602,16 @@ function setStepButt(){
return false
}
let nArr = ["Ojdh","Olyq","Oinsf","Owsf"]
let nArr = ["Ojdh","Olyq","Oinsf","Owsf","Otv"]
if(fn(stepId,nArr)){
$("#shootButt2").css('display','flex')
}
let sArr = ["gongFu_","gongPai_","account_","env_","Ogm_","Ozgm_","Ocgm","Otv","lineSta_",,"cloudPcTer","cloudPcScreen"]
let sArr = ["gongFu_","gongPai_","account_","env_","Ogm_","Ozgm_","Ocgm","lineSta_",,"cloudPcTer","cloudPcScreen",'poePanel','poeSwitchboard']
if(fn(stepId,sArr)){
$("#shootButt").show()
$("#shootButt").css('display','flex')
}
if(stepId.includes('SN') || stepId.startsWith('complain')){
$("#shootButt").show()
$("#shootButt").css('display','flex')
}
if(stepId.startsWith("jdhAccType_")){
......@@ -618,7 +667,7 @@ $('.quit').click(()=>{
})
let clickButtFlag = false
$('.clickButt').click((e)=>{
$('.clickButt').click(async (e)=>{
if(clickButtFlag){
return
}
......@@ -627,20 +676,36 @@ $('.clickButt').click((e)=>{
clickButtFlag = false
},1000)
if(!stepId.startsWith('gongFu') && !stepId.startsWith('gongPai') && !dartTsShow && ifDark()){
dartTsShow = true
$('#lightShowTs').show()
}
$('#errorAlert').hide()
$('#noShootShowAlert').hide()
noShootClick = true
$('#pictureShowAlert').hide()
let key = $(e.target).attr('key')
if(key=='yiwancheng' && stepId.includes('SN')){
if(key=='yiwancheng' && (stepId.includes('SN') || stepId.includes('account'))){
paiZhao()
if(stepId.includes('account')){
$('#picshowText').text('为确保准确识别用户账号,请拍清照片并确认用户账号清晰可见后,再提交。')
}else{
$('#picshowText').text('为确保准确识别串号,请拍清照片并确认串号清晰可见后,再提交。')
}
$('#pictureShowAlert').show()
return
}
if(key == 'bunengpai'){
$('#noShootReasonAlert').show()
return
}
util.httpRequest({
url: '/button',
data: {
......@@ -654,32 +719,68 @@ $('.clickButt').click((e)=>{
})
})
$('#noShootSave').click(()=>{
let reason = $("#noShootReason").val()
if(!reason){
util.toast('请输入情况说明')
return
}
if(reason.replace(/[^\u4e00-\u9fa5]/g, '').length < 5){
util.toast('请至少输入5个汉字')
return
}
noShootClick = true
$('#noShootShowAlert').hide()
$('#noShootReasonAlert').hide()
$("#noShootReason").val('')
util.httpRequest({
url: '/button',
data: {
applyId: applyId,
callId: callId,
voiceCode: stepId,
button_name: 'bunengpai',
noShowReason: reason
}
}).then(res=>{
noShootClick = false
})
})
$('#noShootClose').click(()=>{
$('#noShootReasonAlert').hide()
})
var ifSnSubmitPicture = false
$('#submitPicture').click(()=>{
$('#loadingText').text('上传中,请稍候...')
$('#loading').show()
let fileFormData = new FormData()
fileFormData.append('imageFile', fileBlob, 'img.png')
fileFormData.append('applyId', applyId)
fileFormData.append('callId', callId)
fileFormData.append('voiceCode', stepId)
fileFormData.append('button_name', 'yiwancheng')
util.httpRequest({
url: '/takePhoto ',
time: 20000,
data: {
applyId: applyId,
callId: callId,
voiceCode: stepId,
button_name: 'yiwancheng',
picData: picCode
}
data: fileFormData
}).then(res=>{
submitPictureSucc()
if(res.code == 200){
$('#pictureShowAlert').hide()
}else{
toast(res.msg)
util.toast(res.msg)
}
}).catch(e=>{
$('#loading').hide()
toast('网络拥堵,请切换网络重新提交')
util.toast('网络拥堵,请切换网络重新提交')
})
})
......@@ -703,28 +804,38 @@ function inputCancel(){
$("#accountAlertDiv").hide()
}
function accountInputSubmit(){
if(!$("#accountValue").val()){
toast('请输入账号')
let acc = $("#accountValue").val()
if(!acc){
util.toast('请输入账号')
return
}
if(!/^1\d{10}$/.test(acc) && !acc.startsWith('80')){
util.toast('格式错误,输入用户账号(业务号码)')
return
}
util.httpRequest({
url: '/button',
url: '/snConfirmButton',
data: {
applyId: applyId,
callId: callId,
voiceCode: stepId,
button_name: 'accounttijiao',
account: $("#accountValue").val()
account: acc
}
}).then(res=>{})
$("#accountValue").val('')
$("#accountAlertDiv").hide()
}).then(res=>{
if(res.code == 200){
$("#accountValue").val('')
$("#accountAlertDiv").hide()
}else {
util.toast(res.msg)
}
})
}
function snInputSubmit(){
if(!$("#snValue").val()){
toast('请输入设备串号')
util.toast('请输入设备串号')
return
}
......@@ -738,7 +849,7 @@ function snInputSubmit(){
textSN: $("#snValue").val()
}
}).then(res=>{
if(res.code == 200){
if(res.code == 200 || res.code == 5004){
$("#snValue").val('')
$("#snAlertDiv").hide()
......@@ -749,7 +860,7 @@ function snInputSubmit(){
$('#snErrorTs').addClass('tsRed')
$("#snValue").addClass('red')
}else {
toast('网络异常,请重新提交')
util.toast('网络异常,请重新提交')
}
})
}
......@@ -766,46 +877,12 @@ function addSnInputEvent(){
});
}
var blackId = ''
function toast(str){
if (document.getElementById("blackDiv")) {
document.getElementById("blackSpan").innerHTML = str;
} else {
var blackDiv = document.createElement("div");
blackDiv.id = "blackDiv";
blackDiv.className = "blackts";
blackDiv.style.position = "fixed";
blackDiv.style.left = "0";
blackDiv.style.bottom = "20%";
blackDiv.style.width = "100%";
blackDiv.style.textAlign = "center";
blackDiv.style.zIndex = "999999";
var html = '<span id="blackSpan" style="background: rgba(42,45,50,.94);color: white;';
html += 'border-radius: .1rem;font-size: 0.32rem;padding: .2rem .6rem;">';
html += str + '</span>';
blackDiv.innerHTML = html;
document.getElementsByTagName("body")[0].appendChild(blackDiv);
}
if (blackId && blackId != "") {
clearTimeout(blackId);
}
blackId = setTimeout(function () {
if (document.getElementById("blackDiv")) {
document.getElementsByTagName("body")[0].removeChild(document.getElementById("blackDiv"));
}
}, 2000);
}
var localTrackState = {
audioTrackEnabled: true,
};
$("#audioClose").click(function (e) {
if(isHuaweiPhone() == '1'){
toast('暂不支持')
util.toast('暂不支持')
return
}
......@@ -838,7 +915,17 @@ async function setEnabled(type, state) {
}
}
var startZjFlag = true
async function init(){
$('#loadingText').text('开启中,请稍候...')
$('#loading').show()
setTimeout(()=>{
if(startZjFlag){
$('#loading').hide()
$('#beginFail').show()
}
},20000)
snInputNum = window.snInputNum||5
noShootNum = window.noShootNum||5
......@@ -856,7 +943,8 @@ async function init(){
})
if(data.code != '200'){
toast(data.msg)
$('#loading').hide()
util.toast(data.msg)
return
}
......@@ -866,7 +954,8 @@ async function init(){
let flag = await join()
if(!flag){
toast('加入频道失败')
$('#loading').hide()
util.toast('加入频道失败')
return
}
......@@ -875,7 +964,14 @@ async function init(){
await createTrackAndPublish()
$('#loading').hide()
startZjFlag = false
$("#videoSwitch").css('display', 'flex')
if(isHuaweiPhone() == '1'){
$('#lightOutDiv').hide()
}
$("#toolDiv").css('display', 'flex')
intervalStr = setInterval(() => {
getProcess()
}, 1000);
......@@ -893,10 +989,10 @@ function isIos() {
return userAgent.includes('iphone')?'1':'0'
}
$('#pageClose').click(()=>{
$('.pageClose').click(()=>{
window.history.go(-1)
})
$('#continueTest').click(()=>{
$('.continueTest').click(()=>{
window.location.reload()
})
......@@ -904,7 +1000,7 @@ release()
$('#videoBegin').click(()=>{
if(!AgoraRTC.checkSystemRequirements()){
toast('暂不支持')
util.toast('暂不支持')
return
}
......@@ -934,6 +1030,7 @@ $("#hidesnExampleAlert").click(()=>{
}
$("#snExampleAlert").hide()
})
$("#hideJdhSnSbErrorAlert").click(()=>{
$("#jdhSnSbErrorAlert").hide()
jdhAndCgmClickHide = true
......@@ -979,6 +1076,22 @@ $("#cameraDiv").click(()=>{
vm.reasonPickData.isShow = true
})
var lightIfOpen = false
$('#lightDiv').click(()=>{
if(!lightIfOpen){
openLight()
}else{
closeLight()
$('#lightImg').attr('src','https://xpo.oss-cn-beijing.aliyuncs.com/huaian/light.png')
$('#lightDiv div').removeClass('open')
lightIfOpen = false
}
})
$('#lightShowTs').click(()=>{
$('#lightShowTs').hide()
})
var vm = new Vue({
el: '#pageDiv',
......@@ -1039,100 +1152,119 @@ $(window).on('load', function() {
const canvas = document.getElementById('canvas');
const photo = document.getElementById('photoImg');
const viewfinder = document.getElementById('cameraArea');
var cavasCtx
var fileBlob
var picCode = ''
function paiZhao(){
async function paiZhao(){
let videoTest = $('#local-player video')[0]
// 设置canvas尺寸与视频相同
canvas.width = videoTest.videoWidth;
canvas.height = (videoTest.videoHeight*1.2)/3;
// 在canvas上绘制视频帧
const context = canvas.getContext('2d');
context.drawImage(videoTest, 0, videoTest.getBoundingClientRect().height*2.2/3, canvas.width, canvas.height,0,0,canvas.width,canvas.height);
// canvas.toBlob((blob) => {
// let sizeKB = (blob.size / 1024).toFixed(2);
if(!cavasCtx){
// 设置canvas尺寸与视频相同
canvas.width = videoTest.videoWidth;
canvas.height = (videoTest.videoHeight*1.2)/3;
// console.log(sizeKB)
// }, 'image/png', 0.92);
// 在canvas上绘制视频帧
cavasCtx = canvas.getContext('2d');
}
cavasCtx.drawImage(videoTest, 0, videoTest.getBoundingClientRect().height*2.2/3, canvas.width, canvas.height,0,0,canvas.width,canvas.height);
canvas.toBlob(async (blob) => {
fileBlob = blob
}, 'image/png', 0.92);
// 将照片转换为数据URL并显示
const data = canvas.toDataURL('image/png');
photo.setAttribute('src', data);
picCode = data
$('#phone').css('height','100%')
$('#phone').css('top','0')
}
function paiZhao2(){
//判断当前拍照的光线强弱
function ifDark(){
let videoTest = $('#local-player video')[0]
// 设置canvas尺寸为取景框大小
canvas.width = viewfinder.offsetWidth
canvas.height = viewfinder.offsetHeight
// 计算取景框在视频中的位置
const videoWidth = videoTest.videoWidth;
const videoHeight = videoTest.videoHeight;
const videoAspectRatio = videoWidth / videoHeight;
const containerWidth = videoTest.offsetWidth;
const containerHeight = videoTest.offsetHeight;
// 计算视频在容器中的实际显示尺寸
let drawWidth, drawHeight, offsetX, offsetY;
if (containerWidth / containerHeight > videoAspectRatio) {
// 视频高度占满容器
drawHeight = containerHeight;
drawWidth = drawHeight * videoAspectRatio;
offsetX = (containerWidth - drawWidth) / 2;
offsetY = 0;
} else {
// 视频宽度占满容器
drawWidth = containerWidth;
drawHeight = drawWidth / videoAspectRatio;
offsetX = 0;
offsetY = (containerHeight - drawHeight) / 2;
}
// 计算取景框在视频中的位置和尺寸(以视频实际像素为单位)
const viewfinderRect = viewfinder.getBoundingClientRect();
const videoRect = videoTest.getBoundingClientRect();
const scaleX = videoWidth / drawWidth;
const scaleY = videoHeight / drawHeight;
const captureX = (viewfinderRect.left - videoRect.left - offsetX) * scaleX;
const captureY = (viewfinderRect.top - videoRect.top - offsetY) * scaleY;
const captureWidth = viewfinderRect.width * scaleX;
const captureHeight = viewfinderRect.height * scaleY;
// 在canvas上绘制视频帧
const context = canvas.getContext('2d');
// context.drawImage(
// videoTest,
// captureX, captureY, captureWidth, captureHeight,0, 0, canvas.width, canvas.height);
context.drawImage(
videoTest,
0, captureY, videoWidth, captureHeight,0, 0, canvas.width, canvas.height);
canvas.toBlob((blob) => {
let sizeKB = (blob.size / 1024).toFixed(2);
if(!cavasCtx){
// 设置canvas尺寸与视频相同
canvas.width = videoTest.videoWidth;
canvas.height = (videoTest.videoHeight*1.2)/3;
alert(sizeKB)
}, 'image/png', 0.92);
// 将照片转换为数据URL并显示
const data = canvas.toDataURL('image/png');
photo.setAttribute('src', data);
picCode = data
// 在canvas上绘制视频帧
cavasCtx = canvas.getContext('2d');
}
cavasCtx.drawImage(videoTest, 0, videoTest.getBoundingClientRect().height*2.2/3, canvas.width, canvas.height,0,0,canvas.width,canvas.height);
let imgData = cavasCtx.getImageData(0, 0, canvas.width, canvas.height);
let data = imgData.data; // RGBA 连续数组
let sum = 0;
for (let i = 0; i < data.length; i += 4) {
// 把 RGB 转成灰度(人眼对绿色更敏感)
const gray = 0.299 * data[i] + 0.587 * data[i + 1] + 0.114 * data[i + 2];
sum += gray;
}
let avg = sum / (data.length / 4);
return avg < 60
if (avg < 60) return avg + '-dark';
if (avg > 195) return avg + '-bright';
return avg + '-normal';
}
var linghtStream
var linghtTrack
async function openLight(){
linghtStream = await navigator.mediaDevices.getUserMedia({
video: {
facingMode: { exact: "environment" },
width: { ideal: 160 }, // 极低分辨率
height: { ideal: 120 },
frameRate: { ideal: 5 }, // 低帧率
advanced: [{ torch: true }]
},
audio: false
});
linghtTrack = linghtStream.getVideoTracks()[0];
let hasTorch = false
try{
let capabilities = linghtTrack.getCapabilities()
hasTorch = 'torch' in capabilities
}catch(e){
console.log(e)
}
if(!hasTorch){
util.toast('设备不支持手电筒功能!')
linghtTrack.stop(); // 停止摄像头和闪光灯
linghtStream.getTracks().forEach(t => t.stop());
linghtTrack = null
linghtStream = null
return
}
await linghtTrack.applyConstraints({
advanced: [{ torch: true }],
width: { ideal: 160 },
height: { ideal: 120 },
frameRate: { ideal: 5 }
});
$('#lightImg').attr('src','https://xpo.oss-cn-beijing.aliyuncs.com/huaian/lightOpen.png')
$('#lightDiv div').addClass('open')
lightIfOpen = true
}
function closeLight(){
linghtTrack.applyConstraints({
advanced: [{ torch: false }]
});
linghtTrack.stop(); // 停止摄像头和闪光灯
linghtStream.getTracks().forEach(t => t.stop());
$('#phone').css('height','100%')
$('#phone').css('top','0')
linghtTrack = null
linghtStream = null
}
const script = document.createElement('script');
......
......@@ -65,7 +65,7 @@
if (document.getElementById("blackDiv")) {
document.getElementsByTagName("body")[0].removeChild(document.getElementById("blackDiv"));
}
}, 2000);
}, 3000);
},
/**
* zhijian/ha
......
......@@ -3,8 +3,8 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>添加工单</title>
<link rel="stylesheet" href="css/result.css?123123213">
<title>江苏移动</title>
<link rel="stylesheet" href="css/result.css?123123213455">
</head>
<body>
<div id="pageDiv" class="pageDiv">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!