pages-verification-verification.ab609950.js
3.9 KB
import{q as e,p as t,aj as s,ak as a,I as l,o,c,w as r,C as n,f as i,D as d,ac as u,g as f,t as p,h,u as _,v as m,P as g,l as v}from"./index-3b02b0cf.js";import{_ as x}from"./_plugin-vue_export-helper.1b428a4d.js";const y=x({__name:"verification",setup(x){const y=e({loadingShow:!1,scanText:"",tipMsg:"尝试识别中..."});e({reFresh:!0,showPlayBtn:!1,showFullBtn:!1});let b=e({arr:{name:123}}),w=t("");const C=()=>{var e=_();m.$api.user.checkconsumption({store_id:e.store_id,receive_no:j._value}).then((e=>{H(),console.log("res",e)}))};s((()=>{})),a((()=>{q()}));let j=t("");const k=e=>{var t,s;e&&(console.log("id",e),y.scanText=e,t=y.scanText,s=_(),m.$api.user.checkconsumption({store_id:s.store_id,receive_no:t}).then((e=>{console.log("res",e),H(),l({icon:"none",duration:2e3,title:e.msg})})))},q=()=>{$("https://blog.minhazav.dev/assets/research/html5qrcode/html5-qrcode.min.js"),setTimeout((()=>{F()}),1e3)},Q=()=>{html5QrCode.stop().then((e=>{console.log("QR Code scanning stopped.")})).catch((e=>{console.log("Unable to stop scanning.")}))},F=()=>{console.log("Html5Qrcode",Html5Qrcode),Html5Qrcode.getCameras().then((e=>{console.log("devices",e),e&&e.length&&(console.log("chufa"),w=e.length>1?e[1].id:e[0].id,console.log("chufa2"),new Html5Qrcode("qr-reader").start(w,{fps:10,qrbox:250},(e=>{e&&(l({title:"扫码成功",icon:"none"}),k(e),Q())}),(e=>{})).catch((e=>{l({title:`扫码失败:${e}`})})),console.log("chufa3"))})).catch((e=>{console.log("err",e),l({title:"启用相机失败",icon:"none"})}))},$=e=>new Promise(((t,s)=>{const a=document.createElement("script");a.src=e,a.type="text/javascript",document.body.appendChild(a),a.onload=()=>{t()}})),H=()=>{var e=_();m.$api.user.getverification_cancel({store_id:e.store_id}).then((e=>{console.log("res",e),e.data?b.arr=e.data:b.arr={}}))},T=()=>{m.$router.go("/pages/verification/allverification")};return(e,t)=>{const s=n,a=g,l=v;return o(),c(s,{class:""},{default:r((()=>[i(s,{class:"verifihead"},{default:r((()=>[i(s,{class:"fborder",style:{width:"80%",height:"80%"}},{default:r((()=>[i(s,{class:"sectionview"},{default:r((()=>[i(s,{id:"qr-reader",style:{width:"100%",height:"100%"}})])),_:1})])),_:1})])),_:1}),i(s,{class:"verifisearch"},{default:r((()=>[i(s,{class:"searchhead"},{default:r((()=>[i(s,{class:"ipt"},{default:r((()=>[i(a,{type:"text",modelValue:d(j),"onUpdate:modelValue":t[0]||(t[0]=e=>u(j)?j.value=e:j=e),placeholder:"请输入卡券编码进行核销",class:"inpCode"},null,8,["modelValue"])])),_:1}),i(l,{class:"confirmbtn",onClick:C},{default:r((()=>[f("确认")])),_:1})])),_:1}),i(s,{class:"",style:{"box-sizing":"border-box","background-color":"#F8F8F8"}},{default:r((()=>[i(s,{class:"verifilist",style:{"margin-bottom":"24rpx"}},{default:r((()=>[i(s,{class:"listhead",style:{"align-items":"center"}},{default:r((()=>[i(s,{class:"tle"},{default:r((()=>[f(" 核销记录 ")])),_:1}),i(s,{class:"",style:{display:"flex","align-items":"center"},onClick:T},{default:r((()=>[f(" 查看全部 "),i(s,{class:"",style:{"margin-left":"8rpx",width:"32rpx",height:"32rpx",display:"flex","align-items":"center","justify-content":"center"}})])),_:1})])),_:1}),d(b).arr?(o(),c(s,{key:0,class:"listbottom"},{default:r((()=>[i(s,{class:"",style:{display:"flex","justify-content":"space-between","margin-bottom":"8rpx","padding-top":"24rpx"}},{default:r((()=>[i(s,{class:""},{default:r((()=>[f(" 核销人员:"+p(d(b).arr.name),1)])),_:1}),i(s,{class:"statustab"},{default:r((()=>[f(" 已核销 ")])),_:1})])),_:1}),i(s,{class:"flex"},{default:r((()=>[i(s,{class:"tle"},{default:r((()=>{var e;return[f(p(null==(e=d(b).arr)?void 0:e.coupon_name),1)]})),_:1}),i(s,{class:""},{default:r((()=>[f(" 有效期 : "+p(d(b).arr.closetime),1)])),_:1})])),_:1}),i(s,{class:"flex"},{default:r((()=>[i(s,{class:"tle",style:{"font-size":"28rpx","font-weight":"500"}}),i(s,{class:""},{default:r((()=>[f(" 卡券码: "+p(d(b).arr.receive_no),1)])),_:1})])),_:1})])),_:1})):h("",!0)])),_:1})])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-03ba910c"]]);export{y as default};