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