1 line
10 KiB
JavaScript
1 line
10 KiB
JavaScript
"use strict";require("./sub-common/e4015d998cf50ca1ca7b34bced9738a8.js");require("./sub-common/cfc73dead13629e0abcc62d612a93153.js");require("./sub-common/6282fb780684154862180e9525dac2d7.js");require("./sub-common/e2d407e25a353e560c8c555756781936.js");require("./sub-common/cc2c447efc998eccbbebad7202359521.js");require("./sub-common/9ce39b63a0c3f09061d646af28d60d6b.js");require("./sub-common/13ff43d399499eb6183c40149aac27cf.js");(wx.webpackJsonp=wx.webpackJsonp||[]).push([[1400],{4703:function(e,n,o){var t=o(2180),c=o(4165),s=o(1413),l=o(5861),a=o(9439),i=o(1515),_=o(2954),d=o.n(_),r=o(7294),u=o(4184),m=o.n(u),h=o(1894),x=o(4749),f="linkBlueTooth-module__main___Of2Q5",p="linkBlueTooth-module__bluetooth_link___Riy9h",v="linkBlueTooth-module__link_status___KglDZ",j="linkBlueTooth-module__link_statused___YfobU",k="linkBlueTooth-module__link_statused_no___XOL43",N="linkBlueTooth-module__link_name___rnEo2",G="linkBlueTooth-module__link_name_no___Vq65B",g="linkBlueTooth-module__link_name_no_link___E0IP7",w="popup-module__popup___jlk50",b="popup-module__mask___i0abu",Z="popup-module__content___nP3fU",C="popup-module__title___WxouN",D="popup-module__list___FKjzc",S="popup-module__scroll___JhYMV",T="popup-module__item___fak4d",B="popup-module__link_success___q8aDN",L="popup-module__link_ing___OIvLF",M="popup-module__noDevice___A60VX",F="popup-module__n_item___U_uHM",E="popup-module__footer___LcClp",O="popup-module__finding___Qosy9",y="popup-module__footer_off___IGFdD",I=o(6384),P=o(5893),Q=(0,r.memo)((function(e){var n=e.state,o=e.show,t=void 0!==o&&o,c=e.onClose,s=e.onLink,l=e.onOff,_=e.onFind,d=(0,r.useState)(t),u=(0,a.Z)(d,2),m=u[0],h=u[1];(0,r.useEffect)((function(){h(t)}),[t]);return(0,P.jsx)(P.Fragment,{children:m&&(0,P.jsxs)(i.G7,{className:w,children:[(0,P.jsxs)(i.G7,{className:Z,children:[(0,P.jsx)(i.G7,{className:C,children:"搜索设备"}),(0,P.jsx)(i.G7,{className:D,children:(0,P.jsx)(i.pf,{scrollY:!0,className:S,children:n.devices&&n.devices.length>0&&(null==n?void 0:n.devices.map((function(e){return(0,P.jsxs)(i.G7,{className:T,onClick:function onClick(){return s(e)},children:[(0,P.jsx)(i.G7,{children:e.name}),!n.connecting&&!n.connected&&(0,P.jsx)(i.G7,{children:"链接"})||n.connecting&&e.deviceId==n.connecting.deviceId&&(0,P.jsx)(i.G7,{className:L,children:"正在链接..."})||n.connected&&e.deviceId==n.connected.deviceId&&(0,P.jsx)(i.G7,{className:B,children:"链接成功"})]})})))||(0,P.jsx)(i.G7,{className:M,children:!n.discovering&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(i.G7,{children:"暂无设备,请按以下条件检查"}),(0,P.jsx)(i.G7,{className:F,children:"1.请确保取色仪处于激活状态"}),(0,P.jsx)(i.G7,{className:F,children:"2.请确保取色仪没有链接其他设备"}),(0,P.jsx)(i.G7,{className:F,children:"3.请打开手机定位"})]})||(0,P.jsx)(i.G7,{children:"设备搜索中"})})})}),n.connected&&(0,P.jsx)(i.G7,{className:"".concat(E," ").concat(y),onClick:l,children:"断开链接"})||!n.connected&&n.discovering&&(0,P.jsxs)(i.G7,{className:"".concat(E," ").concat(O),children:["搜索中",(0,P.jsx)(I.Z,{width:30,color:"orange"})]})||(0,P.jsx)(i.G7,{className:E,onClick:_,children:"重新搜索"})]}),(0,P.jsx)(i.G7,{className:b,onClick:function onCloseListener(){c(!1)}})]})})})),V=o(6027),q=(0,r.memo)((function(){var e=(0,h.E)(),n=e.state,o=e.init,t=e.startScan,c=e.connect,s=e.disconnect;(0,r.useEffect)((function(){o()}),[]);var l=(0,r.useState)(1),_=(0,a.Z)(l,2),u=_[0],x=_[1];(0,r.useEffect)((function(){var e;n.available?n.available&&null!==(e=n.connected)&&void 0!==e&&e.name?x(3):x(2):x(1)}),[n.available,n.connected]);var w=(0,r.useMemo)((function(){var e;return(null===(e=n.connected)||void 0===e?void 0:e.localName)||""}),[n.connected]),b=(0,r.useState)(!1),Z=(0,a.Z)(b,2),C=Z[0],D=Z[1],S=function onFindEven(){n.discovering||n.connected||n.connecting||t()};return(0,P.jsx)(P.Fragment,{children:(0,P.jsxs)(i.G7,{className:f,children:[(0,P.jsx)(V.Z,{title:"蓝牙设备",showIcon:!0,showBorder:!1,children:(0,P.jsxs)(i.G7,{className:p,onClick:function onFindDevice(){1==u?d().showToast({title:"请打开蓝牙",icon:"none"}):(D(!0),S())},children:[(0,P.jsx)(i.G7,{className:m()(v,3==u&&j,2==u&&k)}),1==u&&(0,P.jsx)(i.G7,{className:m()(N,G),children:"请开启蓝牙"})||2==u&&(0,P.jsx)(i.G7,{className:m()(N,g),children:"未连接设备"})||3==u&&(0,P.jsx)(i.G7,{className:m()(N),children:w})]})}),(0,P.jsx)(Q,{state:n,show:C,onClose:function onClose(){return D(!1)},onLink:function onLink(e){return function onLinkListen(e){n.connected||n.connecting||c(e)}(e)},onOff:function onDisconnect(){s(),D(!1)},onFind:S})]})})})),H="index-module__body___QeoQh",U="index-module__contBox___zVQl4",R="index-module__firstBox___VoSnv",X="index-module__firstLeftName___P6mJI",Y="index-module__firstLeftbox___vY1z8",A="index-module__clickFont___w7vrT",J="index-module__color_bock___NHXkS",$="index-module__color_bocktwo___dgUGU",z="index-module__nameColor___rRMfI",K="index-module__reslutBox___dOcQX",W="index-module__reslutTitle___VSWPA",ee="index-module__titleLeft___e9pNc",ne="index-module__titleRiht___E9qMv",oe="index-module__titleRiht1___O00Tv",te="index-module__notResult___p5Dq3",ce="index-module__notBox___MjE3v",se="index-module__notLeft___qQv6q",le="index-module__notright___KdaU9",ae="index-module__bottomBox___Xt9P0",ie="index-module__leftBtn___o7ssb",_e="index-module__rightBtn___Vv58c",de=o(3182),re=o(9498);Page((0,t.createPageConfig)((function(){(0,re.av)("pages/sampleComparison/index");var e=(0,r.useState)({l1:"",a1:"",b1:"",l2:"",a2:"",b2:""}),n=(0,a.Z)(e,2),o=n[0],t=n[1],_=(0,r.useState)({one:null,two:null}),u=(0,a.Z)(_,2),f=u[0],p=u[1],v=(0,h.E)(),j=v.state,k=v.measureAndGetLab,N=function(){var e=(0,l.Z)((0,c.Z)().mark((function _callee(e){var n;return(0,c.Z)().wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:if(!j.connected){o.next=7;break}return o.next=3,k();case 3:n=o.sent,p(1===e?(0,s.Z)((0,s.Z)({},f),{},{one:n}):(0,s.Z)((0,s.Z)({},f),{},{two:n})),o.next=8;break;case 7:d().showToast({title:"请链接设备",icon:"none"});case 8:case"end":return o.stop()}}),_callee)})));return function getLab(n){return e.apply(this,arguments)}}(),G=function getNowTime(){var e=(new Date).getFullYear(),n=(new Date).getMonth()+1<10?"0".concat((new Date).getMonth()+1):(new Date).getMonth()+1,o=(new Date).getDate()<10?"0".concat((new Date).getDate()):(new Date).getDate(),t=(new Date).getHours()<10?"0".concat((new Date).getHours()):(new Date).getHours(),c=(new Date).getMinutes()<10?"0".concat((new Date).getMinutes()):(new Date).getMinutes(),s=(new Date).getSeconds()<10?"0".concat((new Date).getSeconds()):(new Date).getSeconds();return"".concat(e,"-").concat(n,"-").concat(o," ").concat(t,":").concat(c,":").concat(s)},g=(0,r.useState)(""),w=(0,a.Z)(g,2),b=w[0],Z=w[1],C=(0,r.useState)(""),D=(0,a.Z)(C,2),S=D[0],T=D[1],B=(0,r.useState)(""),L=(0,a.Z)(B,2),M=L[0],F=L[1],E=(0,r.useState)(""),O=(0,a.Z)(E,2),y=O[0],I=O[1];(0,r.useEffect)((function(){if(j.deviceLab){var e,n;if((null===(e=f.one)||void 0===e?void 0:e.constructor)===Object){var c,l,a,i=(0,x.$)([null===(c=f.one)||void 0===c?void 0:c.L,null===(l=f.one)||void 0===l?void 0:l.a,null===(a=f.one)||void 0===a?void 0:a.b]);Z("rgb(".concat(i[0],", ").concat(i[1],", ").concat(i[2],")")),F(G()),t((0,s.Z)((0,s.Z)({},o),{},{l1:i[0],a1:i[1],b1:i[2]}))}if((null===(n=f.two)||void 0===n?void 0:n.constructor)===Object){var _,d,r,u=(0,x.$)([null===(_=f.two)||void 0===_?void 0:_.L,null===(d=f.two)||void 0===d?void 0:d.a,null===(r=f.two)||void 0===r?void 0:r.b]);T("rgb(".concat(u[0],", ").concat(u[1],", ").concat(u[2],")")),I(G()),t((0,s.Z)((0,s.Z)({},o),{},{l2:u[0],a2:u[1],b2:u[2]}))}}}),[f]);var Q=(0,r.useState)(""),V=(0,a.Z)(Q,2),ue=V[0],me=V[1],he=(0,r.useState)(""),xe=(0,a.Z)(he,2),fe=xe[0],pe=xe[1],ve=(0,de.tH)().fetchData,je=function(){var e=(0,l.Z)((0,c.Z)().mark((function _callee2(){var e,n,t,l;return(0,c.Z)().wrap((function _callee2$(c){for(;;)switch(c.prev=c.next){case 0:if(""!==o.l1){c.next=3;break}return d().showToast({title:"请填充基础样品",icon:"none"}),c.abrupt("return");case 3:if(""!==o.l2){c.next=6;break}return d().showToast({title:"请填充对比样品",icon:"none"}),c.abrupt("return");case 6:return e=(0,s.Z)({},o),c.next=9,ve(e);case 9:(n=c.sent).data&&(me(n.data),t=[n.data.reddish&&"偏红",n.data.yellowish&&"偏黄",n.data.greenish&&"偏绿",n.data.bluish&&"偏蓝",n.data.whitish&&"偏亮",n.data.darker&&"偏暗"],l=t.filter((function(e){return e})).join(","),pe(l));case 11:case"end":return c.stop()}}),_callee2)})));return function handTake(){return e.apply(this,arguments)}}();return(0,P.jsxs)(i.G7,{className:H,children:[(0,P.jsx)(q,{}),(0,P.jsxs)(i.G7,{className:U,children:[(0,P.jsxs)(i.G7,{className:R,style:"margin-right:27px",children:[(0,P.jsx)(i.G7,{className:X,children:"基础样品"}),""===b&&(0,P.jsx)(i.G7,{className:Y,onClick:function onClick(){return N(1)},children:(0,P.jsx)(i.G7,{className:A,children:"点击取色"})}),b&&(0,P.jsx)(i.G7,{className:m()(J),onClick:function onClick(){return N(1)},style:{background:b}}),""===M&&(0,P.jsx)(i.G7,{className:z,children:"--"}),M&&(0,P.jsx)(i.G7,{className:z,children:M})]}),(0,P.jsxs)(i.G7,{className:R,children:[(0,P.jsx)(i.G7,{className:X,children:"对比样品"}),""===S&&(0,P.jsx)(i.G7,{className:Y,onClick:function onClick(){return N(2)},children:(0,P.jsx)(i.G7,{className:A,children:"点击取色"})}),S&&(0,P.jsx)(i.G7,{className:m()($),onClick:function onClick(){return N(2)},style:{background:S}}),""===y&&(0,P.jsx)(i.G7,{className:z,children:"--"}),y&&(0,P.jsx)(i.G7,{className:z,children:y})]})]}),(0,P.jsxs)(i.G7,{className:K,children:[(0,P.jsxs)(i.G7,{className:W,children:[(0,P.jsx)(i.G7,{className:ee,children:"测量结果"}),ue.ciede_2000>=1&&(0,P.jsx)(i.G7,{className:ne,children:"不合格"}),ue.ciede_2000<=1&&(0,P.jsx)(i.G7,{className:oe,children:"合格"})]}),""===ue&&(0,P.jsx)(i.G7,{className:te,children:"暂无数据"}),ue&&(0,P.jsxs)(i.G7,{className:ce,children:[(0,P.jsxs)(i.G7,{className:se,children:["色差值: ",ue.ciede_2000]}),!ue.reddish&&!ue.yellowish&&!ue.greenish&&!ue.bluish&&!ue.whitish&&!ue.darker&&(0,P.jsx)(i.G7,{className:le,children:"无明显色差"}),fe&&(0,P.jsx)(i.G7,{className:le,children:fe})]})]}),(0,P.jsxs)(i.G7,{className:ae,children:[(0,P.jsx)(i.G7,{className:ie,onClick:function onClick(){return function reset(){p({}),Z(""),T(""),F(""),I(""),me(""),pe("")}()},children:"重置"}),(0,P.jsx)(i.G7,{className:_e,onClick:function onClick(){return je()},children:"提交"})]})]})}),"pages/sampleComparison/index",{root:{cn:[]}},{navigationBarTitleText:"样品对比",enableShareAppMessage:!1}||{}))}},function(e){e.O(0,[8556,1515,8515,4730,3160,8743,5638,3901,2107,1216,8592],(function(){return n=4703,e(e.s=n);var n}));e.O()}]); |