2023-05-12 11:43:37 +08:00

2 lines
16 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");/*! For license information please see index.js.LICENSE.txt */
(wx.webpackJsonp=wx.webpackJsonp||[]).push([["pages/sampleComparison/index"],{"./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/pages/sampleComparison/index.tsx":function(e,o,n){var t=n("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),l=n("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),s=n("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),a=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),i=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),c=n("./node_modules/@tarojs/taro/index.js"),d=n.n(c),u=n("./node_modules/react/cjs/react.production.min.js"),_=n("./node_modules/classnames/index.js"),r=n.n(_),m=n("./src/use/contextBlueTooth.tsx"),f=n("./src/common/bluetooth/color/colorSpace.js"),p=n("./src/pages/sampleComparison/compoents/bluetooth/LinkBlueTooth.tsx"),x=n("./src/pages/sampleComparison/index.module.scss"),h=n("./src/api/mine.ts"),j=n("./src/use/useCommon.ts"),w=n("./node_modules/react/cjs/react-jsx-runtime.production.min.js");o.default=function(){(0,j.useBuriedDataPoint)("pages/sampleComparison/index");var e=(0,u.useState)({l1:"",a1:"",b1:"",l2:"",a2:"",b2:""}),o=(0,a.default)(e,2),n=o[0],c=o[1],_=(0,u.useState)({one:null,two:null}),b=(0,a.default)(_,2),k=b[0],g=b[1],v=(0,m.useBluetooth)(),V=v.state,N=v.measureAndGetLab,B=function(){var e=(0,s.default)((0,t.default)().mark((function _callee(e){var o;return(0,t.default)().wrap((function _callee$(n){for(;;)switch(n.prev=n.next){case 0:if(!V.connected){n.next=7;break}return n.next=3,N();case 3:o=n.sent,g(1===e?(0,l.default)((0,l.default)({},k),{},{one:o}):(0,l.default)((0,l.default)({},k),{},{two:o})),n.next=8;break;case 7:d().showToast({title:"请链接设备",icon:"none"});case 8:case"end":return n.stop()}}),_callee)})));return function getLab(o){return e.apply(this,arguments)}}(),C=function getNowTime(){var e=(new Date).getFullYear(),o=(new Date).getMonth()+1<10?"0".concat((new Date).getMonth()+1):(new Date).getMonth()+1,n=(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(),l=(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(o,"-").concat(n," ").concat(t,":").concat(l,":").concat(s)},T=(0,u.useState)(""),L=(0,a.default)(T,2),D=L[0],S=L[1],y=(0,u.useState)(""),F=(0,a.default)(y,2),M=F[0],R=F[1],O=(0,u.useState)(""),I=(0,a.default)(O,2),E=I[0],P=I[1],Q=(0,u.useState)(""),U=(0,a.default)(Q,2),q=U[0],A=U[1];(0,u.useEffect)((function(){if(V.deviceLab){var e,o;if((null===(e=k.one)||void 0===e?void 0:e.constructor)===Object){var t,s,a,i=(0,f.toRgb)([null===(t=k.one)||void 0===t?void 0:t.L,null===(s=k.one)||void 0===s?void 0:s.a,null===(a=k.one)||void 0===a?void 0:a.b]);S("rgb(".concat(i[0],", ").concat(i[1],", ").concat(i[2],")")),P(C()),c((0,l.default)((0,l.default)({},n),{},{l1:i[0],a1:i[1],b1:i[2]}))}if((null===(o=k.two)||void 0===o?void 0:o.constructor)===Object){var d,u,_,r=(0,f.toRgb)([null===(d=k.two)||void 0===d?void 0:d.L,null===(u=k.two)||void 0===u?void 0:u.a,null===(_=k.two)||void 0===_?void 0:_.b]);R("rgb(".concat(r[0],", ").concat(r[1],", ").concat(r[2],")")),A(C()),c((0,l.default)((0,l.default)({},n),{},{l2:r[0],a2:r[1],b2:r[2]}))}}}),[k]);var H=(0,u.useState)(""),G=(0,a.default)(H,2),J=G[0],X=G[1],Y=(0,u.useState)(""),K=(0,a.default)(Y,2),z=K[0],W=K[1],Z=(0,h.productabsorbcontrast)().fetchData,$=function(){var e=(0,s.default)((0,t.default)().mark((function _callee2(){var e,o,s,a;return(0,t.default)().wrap((function _callee2$(t){for(;;)switch(t.prev=t.next){case 0:if(""!==n.l1){t.next=3;break}return d().showToast({title:"请填充基础样品",icon:"none"}),t.abrupt("return");case 3:if(""!==n.l2){t.next=6;break}return d().showToast({title:"请填充对比样品",icon:"none"}),t.abrupt("return");case 6:return e=(0,l.default)({},n),t.next=9,Z(e);case 9:(o=t.sent).data&&(X(o.data),s=[o.data.reddish&&"偏红",o.data.yellowish&&"偏黄",o.data.greenish&&"偏绿",o.data.bluish&&"偏蓝",o.data.whitish&&"偏亮",o.data.darker&&"偏暗"],a=s.filter((function(e){return e})).join(","),W(a));case 11:case"end":return t.stop()}}),_callee2)})));return function handTake(){return e.apply(this,arguments)}}();return(0,w.jsxs)(i.View,{className:x.default.body,children:[(0,w.jsx)(p.default,{}),(0,w.jsxs)(i.View,{className:x.default.contBox,children:[(0,w.jsxs)(i.View,{className:x.default.firstBox,style:"margin-right:27px",children:[(0,w.jsx)(i.View,{className:x.default.firstLeftName,children:"基础样品"}),""===D&&(0,w.jsx)(i.View,{className:x.default.firstLeftbox,onClick:function onClick(){return B(1)},children:(0,w.jsx)(i.View,{className:x.default.clickFont,children:"点击取色"})}),D&&(0,w.jsx)(i.View,{className:r()(x.default.color_bock),onClick:function onClick(){return B(1)},style:{background:D}}),""===E&&(0,w.jsx)(i.View,{className:x.default.nameColor,children:"--"}),E&&(0,w.jsx)(i.View,{className:x.default.nameColor,children:E})]}),(0,w.jsxs)(i.View,{className:x.default.firstBox,children:[(0,w.jsx)(i.View,{className:x.default.firstLeftName,children:"对比样品"}),""===M&&(0,w.jsx)(i.View,{className:x.default.firstLeftbox,onClick:function onClick(){return B(2)},children:(0,w.jsx)(i.View,{className:x.default.clickFont,children:"点击取色"})}),M&&(0,w.jsx)(i.View,{className:r()(x.default.color_bocktwo),onClick:function onClick(){return B(2)},style:{background:M}}),""===q&&(0,w.jsx)(i.View,{className:x.default.nameColor,children:"--"}),q&&(0,w.jsx)(i.View,{className:x.default.nameColor,children:q})]})]}),(0,w.jsxs)(i.View,{className:x.default.reslutBox,children:[(0,w.jsxs)(i.View,{className:x.default.reslutTitle,children:[(0,w.jsx)(i.View,{className:x.default.titleLeft,children:"测量结果"}),J.ciede_2000>=1&&(0,w.jsx)(i.View,{className:x.default.titleRiht,children:"不合格"}),J.ciede_2000<=1&&(0,w.jsx)(i.View,{className:x.default.titleRiht1,children:"合格"})]}),""===J&&(0,w.jsx)(i.View,{className:x.default.notResult,children:"暂无数据"}),J&&(0,w.jsxs)(i.View,{className:x.default.notBox,children:[(0,w.jsxs)(i.View,{className:x.default.notLeft,children:["色差值: ",J.ciede_2000]}),!J.reddish&&!J.yellowish&&!J.greenish&&!J.bluish&&!J.whitish&&!J.darker&&(0,w.jsx)(i.View,{className:x.default.notright,children:"无明显色差"}),z&&(0,w.jsx)(i.View,{className:x.default.notright,children:z})]})]}),(0,w.jsxs)(i.View,{className:x.default.bottomBox,children:[(0,w.jsx)(i.View,{className:x.default.leftBtn,onClick:function onClick(){return function reset(){g({}),S(""),R(""),P(""),A(""),X(""),W("")}()},children:"重置"}),(0,w.jsx)(i.View,{className:x.default.rightBtn,onClick:function onClick(){return $()},children:"提交"})]})]})}},"./src/pages/sampleComparison/compoents/bluetooth/LinkBlueTooth.tsx":function(e,o,n){var t=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),l=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),s=n("./node_modules/@tarojs/taro/index.js"),a=n.n(s),i=n("./node_modules/react/cjs/react.production.min.js"),c=n("./node_modules/classnames/index.js"),d=n.n(c),u=n("./src/pages/sampleComparison/css/linkBlueTooth.module.scss"),_=n("./src/pages/sampleComparison/compoents/bluetooth/Popup.tsx"),r=n("./src/use/contextBlueTooth.tsx"),m=n("./src/components/searchInput/index.tsx"),f=n("./node_modules/react/cjs/react-jsx-runtime.production.min.js");o.default=(0,i.memo)((function(){var e=(0,r.useBluetooth)(),o=e.state,n=e.init,s=e.startScan,c=e.connect,p=e.disconnect;(0,i.useEffect)((function(){n()}),[]);var x=(0,i.useState)(1),h=(0,t.default)(x,2),j=h[0],w=h[1];(0,i.useEffect)((function(){var e;o.available?o.available&&null!==(e=o.connected)&&void 0!==e&&e.name?w(3):w(2):w(1)}),[o.available,o.connected]);var b=(0,i.useMemo)((function(){var e;return(null===(e=o.connected)||void 0===e?void 0:e.localName)||""}),[o.connected]),k=(0,i.useState)(!1),g=(0,t.default)(k,2),v=g[0],V=g[1],N=function onFindEven(){o.discovering||o.connected||o.connecting||s()};return(0,f.jsx)(f.Fragment,{children:(0,f.jsxs)(l.View,{className:u.default.main,children:[(0,f.jsx)(m.default,{title:"蓝牙设备",showIcon:!0,showBorder:!1,children:(0,f.jsxs)(l.View,{className:u.default.bluetooth_link,onClick:function onFindDevice(){1==j?a().showToast({title:"请打开蓝牙",icon:"none"}):(V(!0),N())},children:[(0,f.jsx)(l.View,{className:d()(u.default.link_status,3==j&&u.default.link_statused,2==j&&u.default.link_statused_no)}),1==j&&(0,f.jsx)(l.View,{className:d()(u.default.link_name,u.default.link_name_no),children:"请开启蓝牙"})||2==j&&(0,f.jsx)(l.View,{className:d()(u.default.link_name,u.default.link_name_no_link),children:"未连接设备"})||3==j&&(0,f.jsx)(l.View,{className:d()(u.default.link_name),children:b})]})}),(0,f.jsx)(_.default,{state:o,show:v,onClose:function onClose(){return V(!1)},onLink:function onLink(e){return function onLinkListen(e){o.connected||o.connecting||c(e)}(e)},onOff:function onDisconnect(){p(),V(!1)},onFind:N})]})})}))},"./src/pages/sampleComparison/compoents/bluetooth/Popup.tsx":function(e,o,n){var t=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),l=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),s=n("./node_modules/react/cjs/react.production.min.js"),a=n("./src/pages/sampleComparison/css/popup.module.scss"),i=n("./src/components/loading/index.tsx"),c=n("./node_modules/react/cjs/react-jsx-runtime.production.min.js");o.default=(0,s.memo)((function(e){var o=e.state,n=e.show,d=void 0!==n&&n,u=e.onClose,_=e.onLink,r=e.onOff,m=e.onFind,f=(0,s.useState)(d),p=(0,t.default)(f,2),x=p[0],h=p[1];(0,s.useEffect)((function(){h(d)}),[d]);return(0,c.jsx)(c.Fragment,{children:x&&(0,c.jsxs)(l.View,{className:a.default.popup,children:[(0,c.jsxs)(l.View,{className:a.default.content,children:[(0,c.jsx)(l.View,{className:a.default.title,children:"搜索设备"}),(0,c.jsx)(l.View,{className:a.default.list,children:(0,c.jsx)(l.ScrollView,{scrollY:!0,className:a.default.scroll,children:o.devices&&o.devices.length>0&&(null==o?void 0:o.devices.map((function(e){return(0,c.jsxs)(l.View,{className:a.default.item,onClick:function onClick(){return _(e)},children:[(0,c.jsx)(l.View,{children:e.name}),!o.connecting&&!o.connected&&(0,c.jsx)(l.View,{children:"链接"})||o.connecting&&e.deviceId==o.connecting.deviceId&&(0,c.jsx)(l.View,{className:a.default.link_ing,children:"正在链接..."})||o.connected&&e.deviceId==o.connected.deviceId&&(0,c.jsx)(l.View,{className:a.default.link_success,children:"链接成功"})]})})))||(0,c.jsx)(l.View,{className:a.default.noDevice,children:!o.discovering&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(l.View,{children:"暂无设备,请按以下条件检查"}),(0,c.jsx)(l.View,{className:a.default.n_item,children:"1.请确保取色仪处于激活状态"}),(0,c.jsx)(l.View,{className:a.default.n_item,children:"2.请确保取色仪没有链接其他设备"}),(0,c.jsx)(l.View,{className:a.default.n_item,children:"3.请打开手机定位"})]})||(0,c.jsx)(l.View,{children:"设备搜索中"})})})}),o.connected&&(0,c.jsx)(l.View,{className:"".concat(a.default.footer," ").concat(a.default.footer_off),onClick:r,children:"断开链接"})||!o.connected&&o.discovering&&(0,c.jsxs)(l.View,{className:"".concat(a.default.footer," ").concat(a.default.finding),children:["搜索中",(0,c.jsx)(i.default,{width:30,color:"orange"})]})||(0,c.jsx)(l.View,{className:a.default.footer,onClick:m,children:"重新搜索"})]}),(0,c.jsx)(l.View,{className:a.default.mask,onClick:function onCloseListener(){u(!1)}})]})})}))},"./src/pages/sampleComparison/index.tsx":function(e,o,n){var t=n("./node_modules/@tarojs/runtime/dist/runtime.esm.js"),l=n("./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/pages/sampleComparison/index.tsx");Page((0,t.createPageConfig)(l.default,"pages/sampleComparison/index",{root:{cn:[]}},{navigationBarTitleText:"样品对比",enableShareAppMessage:!1}||{})),l.default},"./src/pages/sampleComparison/css/linkBlueTooth.module.scss":function(e,o){o.default={common_safe_area_y:"linkBlueTooth-module__common_safe_area_y___vIZSf",hoverClass:"linkBlueTooth-module__hoverClass___JwTOg","full-100":"linkBlueTooth-module__full-100___f2le2",main:"linkBlueTooth-module__main___Of2Q5",bluetooth_link:"linkBlueTooth-module__bluetooth_link___Riy9h",link_status:"linkBlueTooth-module__link_status___KglDZ",link_statused:"linkBlueTooth-module__link_statused___YfobU",link_statused_no:"linkBlueTooth-module__link_statused_no___XOL43",link_name:"linkBlueTooth-module__link_name___rnEo2",link_name_no:"linkBlueTooth-module__link_name_no___Vq65B",link_name_no_link:"linkBlueTooth-module__link_name_no_link___E0IP7"}},"./src/pages/sampleComparison/css/popup.module.scss":function(e,o){o.default={common_safe_area_y:"popup-module__common_safe_area_y___B086K",hoverClass:"popup-module__hoverClass___R0eQv","full-100":"popup-module__full-100___rQOka",popup:"popup-module__popup___jlk50",mask:"popup-module__mask___i0abu",content:"popup-module__content___nP3fU",title:"popup-module__title___WxouN",list:"popup-module__list___FKjzc",scroll:"popup-module__scroll___JhYMV",item:"popup-module__item___fak4d",link_success:"popup-module__link_success___q8aDN",link_ing:"popup-module__link_ing___OIvLF",noDevice:"popup-module__noDevice___A60VX",n_item:"popup-module__n_item___U_uHM",footer:"popup-module__footer___LcClp",finding:"popup-module__finding___Qosy9",footer_off:"popup-module__footer_off___IGFdD"}},"./src/pages/sampleComparison/index.module.scss":function(e,o){o.default={common_safe_area_y:"index-module__common_safe_area_y___kbBv7",hoverClass:"index-module__hoverClass___HBEGt","full-100":"index-module__full-100___uTCVS",body:"index-module__body___QeoQh",topBox:"index-module__topBox___HxsnQ",leftBox:"index-module__leftBox___BV4Mt",leftFont:"index-module__leftFont___EUJTk",borderBox:"index-module__borderBox___uX9bn",cricleBox:"index-module__cricleBox___pk_nx",notNet:"index-module__notNet___UY8G_",iconMore:"index-module__iconMore___Lquul",contBox:"index-module__contBox___zVQl4",firstBox:"index-module__firstBox___VoSnv",firstLeftName:"index-module__firstLeftName___P6mJI",firstLeftbox:"index-module__firstLeftbox___vY1z8",clickFont:"index-module__clickFont___w7vrT",color_bock:"index-module__color_bock___NHXkS",color_bocktwo:"index-module__color_bocktwo___dgUGU",nameColor:"index-module__nameColor___rRMfI",reslutBox:"index-module__reslutBox___dOcQX",reslutTitle:"index-module__reslutTitle___VSWPA",titleLeft:"index-module__titleLeft___e9pNc",titleRiht:"index-module__titleRiht___E9qMv",titleRiht1:"index-module__titleRiht1___O00Tv",notResult:"index-module__notResult___p5Dq3",notBox:"index-module__notBox___MjE3v",notLeft:"index-module__notLeft___qQv6q",notright:"index-module__notright___KdaU9",bottomBox:"index-module__bottomBox___Xt9P0",leftBtn:"index-module__leftBtn___o7ssb",rightBtn:"index-module__rightBtn___Vv58c"}}},function(e){e.O(0,["sub-common/410c8e73996856d00e42138bbed888ff","sub-common/e4015d998cf50ca1ca7b34bced9738a8","sub-common/cfc73dead13629e0abcc62d612a93153","sub-common/6282fb780684154862180e9525dac2d7","sub-common/e2d407e25a353e560c8c555756781936","sub-common/cc2c447efc998eccbbebad7202359521","sub-common/9ce39b63a0c3f09061d646af28d60d6b","sub-common/13ff43d399499eb6183c40149aac27cf","taro","vendors","common"],(function(){return o="./src/pages/sampleComparison/index.tsx",e(e.s=o);var o}));e.O()}]);