2 lines
14 KiB
JavaScript
2 lines
14 KiB
JavaScript
import{c as t,w as s,v as e,o as i,a as o,b as a,r as n,n as r,d as l,i as h,e as c,f as d,g as u,h as p,j as m,s as f,k as g,l as k,m as y,p as b,q as w,t as A,u as C,x as S,y as T,z as x,A as R,B as _}from"./index-CMpkHqXW.js";class ${constructor(s,e){this.options=s,this.animation=t({...s}),this.currentStepAnimates={},this.next=0,this.$=e}_nvuePushAnimates(t,s){let e=this.currentStepAnimates[this.next],i={};if(i=e||{styles:{},config:{}},v.includes(t)){i.styles.transform||(i.styles.transform="");let e="";"rotate"===t&&(e="deg"),i.styles.transform+=`${t}(${s+e}) `}else i.styles[t]=`${s}`;this.currentStepAnimates[this.next]=i}_animateRun(t={},s={}){let e=this.$.$refs.ani.ref;if(e)return new Promise(((i,o)=>{nvueAnimation.transition(e,{styles:t,...s},(t=>{i()}))}))}_nvueNextAnimate(t,s=0,e){let i=t[s];if(i){let{styles:o,config:a}=i;this._animateRun(o,a).then((()=>{s+=1,this._nvueNextAnimate(t,s,e)}))}else this.currentStepAnimates={},"function"==typeof e&&e(),this.isEnd=!0}step(t={}){return this.animation.step(t),this}run(t){this.$.animationData=this.animation.export(),this.$.timer=setTimeout((()=>{"function"==typeof t&&t()}),this.$.durationTime)}}const v=["matrix","matrix3d","rotate","rotate3d","rotateX","rotateY","rotateZ","scale","scale3d","scaleX","scaleY","scaleZ","skew","skewX","skewY","translate","translate3d","translateX","translateY","translateZ"];function B(t,s){if(s)return clearTimeout(s.timer),new $(t,s)}v.concat(["opacity","backgroundColor"],["width","height","left","right","top","bottom"]).forEach((t=>{$.prototype[t]=function(...s){return this.animation[t](...s),this}}));const P=(t,s)=>{const e=t.__vccOpts||t;for(const[i,o]of s)e[i]=o;return e};const E=P({name:"uniTransition",emits:["click","change"],props:{show:{type:Boolean,default:!1},modeClass:{type:[Array,String],default:()=>"fade"},duration:{type:Number,default:300},styles:{type:Object,default:()=>({})},customClass:{type:String,default:""},onceRender:{type:Boolean,default:!1}},data:()=>({isShow:!1,transform:"",opacity:1,animationData:{},durationTime:300,config:{}}),watch:{show:{handler(t){t?this.open():this.isShow&&this.close()},immediate:!0}},computed:{stylesObject(){let t={...this.styles,"transition-duration":this.duration/1e3+"s"},s="";for(let e in t){s+=this.toLine(e)+":"+t[e]+";"}return s},transformStyles(){return"transform:"+this.transform+";opacity:"+this.opacity+";"+this.stylesObject}},created(){this.config={duration:this.duration,timingFunction:"ease",transformOrigin:"50% 50%",delay:0},this.durationTime=this.duration},methods:{init(t={}){t.duration&&(this.durationTime=t.duration),this.animation=B(Object.assign(this.config,t),this)},onClick(){this.$emit("click",{detail:this.isShow})},step(t,s={}){if(this.animation){for(let s in t)try{"object"==typeof t[s]?this.animation[s](...t[s]):this.animation[s](t[s])}catch(e){console.error(`方法 ${s} 不存在`)}return this.animation.step(s),this}},run(t){this.animation&&this.animation.run(t)},open(){clearTimeout(this.timer),this.transform="",this.isShow=!0;let{opacity:t,transform:s}=this.styleInit(!1);void 0!==t&&(this.opacity=t),this.transform=s,this.$nextTick((()=>{this.timer=setTimeout((()=>{this.animation=B(this.config,this),this.tranfromInit(!1).step(),this.animation.run(),this.$emit("change",{detail:this.isShow})}),20)}))},close(t){this.animation&&this.tranfromInit(!0).step().run((()=>{this.isShow=!1,this.animationData=null,this.animation=null;let{opacity:t,transform:s}=this.styleInit(!1);this.opacity=t||1,this.transform=s,this.$emit("change",{detail:this.isShow})}))},styleInit(t){let s={transform:""},e=(t,e)=>{"fade"===e?s.opacity=this.animationType(t)[e]:s.transform+=this.animationType(t)[e]+" "};return"string"==typeof this.modeClass?e(t,this.modeClass):this.modeClass.forEach((s=>{e(t,s)})),s},tranfromInit(t){let s=(t,s)=>{let e=null;"fade"===s?e=t?0:1:(e=t?"-100%":"0","zoom-in"===s&&(e=t?.8:1),"zoom-out"===s&&(e=t?1.2:1),"slide-right"===s&&(e=t?"100%":"0"),"slide-bottom"===s&&(e=t?"100%":"0")),this.animation[this.animationMode()[s]](e)};return"string"==typeof this.modeClass?s(t,this.modeClass):this.modeClass.forEach((e=>{s(t,e)})),this.animation},animationType:t=>({fade:t?0:1,"slide-top":`translateY(${t?"0":"-100%"})`,"slide-right":`translateX(${t?"0":"100%"})`,"slide-bottom":`translateY(${t?"0":"100%"})`,"slide-left":`translateX(${t?"0":"-100%"})`,"zoom-in":`scaleX(${t?1:.8}) scaleY(${t?1:.8})`,"zoom-out":`scaleX(${t?1:1.2}) scaleY(${t?1:1.2})`}),animationMode:()=>({fade:"opacity","slide-top":"translateY","slide-right":"translateX","slide-bottom":"translateY","slide-left":"translateX","zoom-in":"scale","zoom-out":"scale"}),toLine:t=>t.replace(/([A-Z])/g,"-$1").toLowerCase()}},[["render",function(t,c,d,u,p,m){const f=h;return s((i(),o(f,{ref:"ani",animation:p.animationData,class:r(d.customClass),style:l(m.transformStyles),onClick:m.onClick},{default:a((()=>[n(t.$slots,"default")])),_:3},8,["animation","class","style","onClick"])),[[e,p.isShow]])}]]);function z(t,s){return"string"==typeof t?s:t}const D=P({name:"uniPopup",components:{keypress:{name:"Keypress",props:{disable:{type:Boolean,default:!1}},mounted(){const t={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]};document.addEventListener("keyup",(s=>{if(this.disable)return;const e=Object.keys(t).find((e=>{const i=s.key,o=t[e];return o===i||Array.isArray(o)&&o.includes(i)}));e&&setTimeout((()=>{this.$emit(e,{})}),0)}))},render:()=>{}}},emits:["change","maskClick"],props:{animation:{type:Boolean,default:!0},type:{type:String,default:"center"},isMaskClick:{type:Boolean,default:null},maskClick:{type:Boolean,default:null},backgroundColor:{type:String,default:"none"},safeArea:{type:Boolean,default:!0},maskBackgroundColor:{type:String,default:"rgba(0, 0, 0, 0.4)"},borderRadius:{type:String}},watch:{type:{handler:function(t){this.config[t]&&this[this.config[t]](!0)},immediate:!0},isDesktop:{handler:function(t){this.config[t]&&this[this.config[this.type]](!0)},immediate:!0},maskClick:{handler:function(t){this.mkclick=t},immediate:!0},isMaskClick:{handler:function(t){this.mkclick=t},immediate:!0},showPopup(t){document.getElementsByTagName("body")[0].style.overflow=t?"hidden":"visible"}},data(){return{duration:300,ani:[],showPopup:!1,showTrans:!1,popupWidth:0,popupHeight:0,config:{top:"top",bottom:"bottom",center:"center",left:"left",right:"right",message:"top",dialog:"center",share:"bottom"},maskClass:{position:"fixed",bottom:0,top:0,left:0,right:0,backgroundColor:"rgba(0, 0, 0, 0.4)"},transClass:{backgroundColor:"transparent",borderRadius:this.borderRadius||"0",position:"fixed",left:0,right:0},maskShow:!0,mkclick:!0,popupstyle:"top"}},computed:{getStyles(){let t={backgroundColor:this.bg};return this.borderRadius,t=Object.assign(t,{borderRadius:this.borderRadius}),t},isDesktop(){return this.popupWidth>=500&&this.popupHeight>=500},bg(){return""===this.backgroundColor||"none"===this.backgroundColor?"transparent":this.backgroundColor}},mounted(){(()=>{const{windowWidth:t,windowHeight:s,windowTop:e,safeArea:i,screenHeight:o,safeAreaInsets:a}=m();this.popupWidth=t,this.popupHeight=s+(e||0),i&&this.safeArea?this.safeAreaInsets=a.bottom:this.safeAreaInsets=0})()},unmounted(){this.setH5Visible()},activated(){this.setH5Visible(!this.showPopup)},deactivated(){this.setH5Visible(!0)},created(){null===this.isMaskClick&&null===this.maskClick?this.mkclick=!0:this.mkclick=null!==this.isMaskClick?this.isMaskClick:this.maskClick,this.animation?this.duration=300:this.duration=0,this.messageChild=null,this.clearPropagation=!1,this.maskClass.backgroundColor=this.maskBackgroundColor},methods:{setH5Visible(t=!0){document.getElementsByTagName("body")[0].style.overflow=t?"visible":"hidden"},closeMask(){this.maskShow=!1},disableMask(){this.mkclick=!1},clear(t){t.stopPropagation(),this.clearPropagation=!0},open(t){if(this.showPopup)return;t&&-1!==["top","center","bottom","left","right","message","dialog","share"].indexOf(t)||(t=this.type),this.config[t]?(this[this.config[t]](),this.$emit("change",{show:!0,type:t})):console.error("缺少类型:",t)},close(t){this.showTrans=!1,this.$emit("change",{show:!1,type:this.type}),clearTimeout(this.timer),this.timer=setTimeout((()=>{this.showPopup=!1}),300)},touchstart(){this.clearPropagation=!1},onTap(){this.clearPropagation?this.clearPropagation=!1:(this.$emit("maskClick"),this.mkclick&&this.close())},top(t){this.popupstyle=this.isDesktop?"fixforpc-top":"top",this.ani=["slide-top"],this.transClass={position:"fixed",left:0,right:0,backgroundColor:this.bg,borderRadius:this.borderRadius||"0"},t||(this.showPopup=!0,this.showTrans=!0,this.$nextTick((()=>{this.messageChild&&"message"===this.type&&this.messageChild.timerClose()})))},bottom(t){this.popupstyle="bottom",this.ani=["slide-bottom"],this.transClass={position:"fixed",left:0,right:0,bottom:0,paddingBottom:this.safeAreaInsets+"px",backgroundColor:this.bg,borderRadius:this.borderRadius||"0"},t||(this.showPopup=!0,this.showTrans=!0)},center(t){this.popupstyle="center",this.ani=["zoom-out","fade"],this.transClass={position:"fixed",display:"flex",flexDirection:"column",bottom:0,left:0,right:0,top:0,justifyContent:"center",alignItems:"center",borderRadius:this.borderRadius||"0"},t||(this.showPopup=!0,this.showTrans=!0)},left(t){this.popupstyle="left",this.ani=["slide-left"],this.transClass={position:"fixed",left:0,bottom:0,top:0,backgroundColor:this.bg,borderRadius:this.borderRadius||"0",display:"flex",flexDirection:"column"},t||(this.showPopup=!0,this.showTrans=!0)},right(t){this.popupstyle="right",this.ani=["slide-right"],this.transClass={position:"fixed",bottom:0,right:0,top:0,backgroundColor:this.bg,borderRadius:this.borderRadius||"0",display:"flex",flexDirection:"column"},t||(this.showPopup=!0,this.showTrans=!0)}}},[["render",function(t,s,e,m,f,g){const k=z(c("uni-transition"),E),y=h,b=d("keypress");return f.showPopup?(i(),o(y,{key:0,class:r(["uni-popup",[f.popupstyle,g.isDesktop?"fixforpc-z-index":""]])},{default:a((()=>[u(y,{onTouchstart:g.touchstart},{default:a((()=>[f.maskShow?(i(),o(k,{key:"1",name:"mask","mode-class":"fade",styles:f.maskClass,duration:f.duration,show:f.showTrans,onClick:g.onTap},null,8,["styles","duration","show","onClick"])):p("",!0),u(k,{key:"2","mode-class":f.ani,name:"content",styles:f.transClass,duration:f.duration,show:f.showTrans,onClick:g.onTap},{default:a((()=>[u(y,{class:r(["uni-popup__wrapper",[f.popupstyle]]),style:l(g.getStyles),onClick:g.clear},{default:a((()=>[n(t.$slots,"default",{},void 0,!0)])),_:3},8,["style","class","onClick"])])),_:3},8,["mode-class","styles","duration","show","onClick"])])),_:3},8,["onTouchstart"]),f.maskShow?(i(),o(b,{key:0,onEsc:g.onTap},null,8,["onEsc"])):p("",!0)])),_:3},8,["class"])):p("",!0)}],["__scopeId","data-v-f0b957f8"]]),J=""+new URL("tips_bg-DPLO8ec5.png",import.meta.url).href,N=""+new URL("popup_btn-X0iV3SKS.png",import.meta.url).href,j=t=>{let s=new RegExp("(^|&)"+t+"=([^&]*)(&|$)","i"),e=window.location.search.substr(1).match(s);return null!=e?unescape(e[2]):null};function I(t){f({title:"加载中",mask:!0});let s={};return t.params&&(t.data=t.params,s["Content-Type"]="application/json"),new Promise(((e,i)=>{g({url:"https://zxjt.86698.cn"+t.url,method:t.method||"GET",data:t.data||{},header:{...s,...t.header},success:t=>{if(t.statusCode&&200!=t.statusCode)k().then((()=>{y({title:"api错误"+t.errMsg,icon:"none"})})),i();else{const s=t.data;200==s.code?(k(),e(s.data)):(k().then((()=>{y({title:"请求失败了,稍后再试",icon:"none"})})),i(t.msg))}},fail:t=>{k().then((()=>{y({title:t,icon:"none"})})),i(t)}})}))}console.log("https://zxjt.86698.cn");const X=P({__name:"index",setup(t){const s=b(null),e=b(0);w((()=>{if(!!j("code"))r();else{const t={tid:j("tid"),timeStamp:j("timeStamp"),sign:j("sign"),tradeNo:j("tradeNo")};A("orderInfo",JSON.stringify(t)),n()}}));const n=()=>{(t=>I({url:"/backend/zxjt_redpacket/orders/is_exist",method:"POST",...t}))({params:{tradeNo:j("tradeNo")}}).then((t=>{!0===t.status?l():C({title:"提示",content:"暂无可领取的红包!!!",showCancel:!1,success:function(t){t.confirm?console.log("用户点击确定"):t.cancel&&console.log("用户点击取消")}})})).catch((()=>{C({title:"提示",content:"暂无可领取的红包!!!",showCancel:!1,success:function(t){t.confirm?console.log("用户点击确定"):t.cancel&&console.log("用户点击取消")}})}))},r=()=>{const t=JSON.parse(S("orderInfo")),{tid:i,timeStamp:o,sign:a,tradeNo:n}=t;(t=>I({url:"/backend/zxjt_redpacket/orders/send_packet",method:"POST",...t}))({params:{tid:Number(i),code:j("code"),timeStamp:o,sign:a,tradeNo:n}}).then((t=>{e.value=t.amount/100,s.value.open()})).catch((t=>{console.log(t)}))},l=()=>{const t=JSON.parse(S("orderInfo")),{tid:s,timeStamp:e,sign:i,tradeNo:o}=t,a=`https://lsxdwx.access.86698.cn/?tid=${s}&tradeNo=${o}`;console.log(a),window.location.href=a},d=()=>{s.value.close()};return(t,n)=>{const r=R,l=h,p=_,m=z(c("uni-popup"),D);return i(),o(l,{class:"content"},{default:a((()=>[u(l,{class:"tips-area"},{default:a((()=>[u(r,{src:J,class:"tips-img",mode:"widthFix"})])),_:1}),u(m,{ref_key:"popupRef",ref:s,type:"center","is-mask-click":!1,"mask-click":!1},{default:a((()=>[u(l,{class:"popup-content"},{default:a((()=>[u(l,{class:"title"},{default:a((()=>[T("恭喜你提现成功!")])),_:1}),u(l,{class:"number"},{default:a((()=>[T(x(e.value),1),u(p,null,{default:a((()=>[T("元")])),_:1})])),_:1}),u(l,{class:"tips"},{default:a((()=>[T('*24小时内在微信"服务通知"中领取')])),_:1}),u(l,{class:"btn",onClick:d},{default:a((()=>[u(r,{src:N})])),_:1}),u(l,{class:"close"},{default:a((()=>[u(r,{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAAXNSR0IArs4c6QAAAk9JREFUSEvFl02oTVEUx39/A/lKyeilzGRIb4LkxoSBkhIzQkxNkY8BBgyZvuKFgZSSGJj4eJInJQMTGTAzkhKSgeUurfPa95y7z93uq2NP7uDsvX9r//d/rb2u+E9DJVwz83lbgJ3AJmANsCLWfgHeAy+AB8AzSTZq31awmS0ADgIngB/AHd8YeAd8js1XAmsjsD3AEuAiMC3pdy6ALNjMfLMbwHfgtKTno07h381sM3ABWArsl+RBNsZQsJntAK4HcKoEWJ9jZkcjgAOSHta/N8ABnQZ2S3o5DrRaY2YbgLt+XXX4ADjknQF2zRdag98Deqnsc+Aw0iwwJWkseXPqhOwu/cbKcCn4cJhh23zkbYE/drNKuupz/oIjT919h4a518wWA6tzDk1k9VRaJcnzemCE26956nmeV+AecEXS+mERx917/u6T9CQzx9PnPjAr6WRmzhvgmKSZCnwJ+CbpfItUW4Hbw+BmVkE/AEdyhcPMzgDLJB2vwO7ks7nTJFI24KXQuFJff05SrwJ/AiYl+W/rMLM5eL92vwp5W0+aBD7RT9XXkiYq8E9guaRfo8BJ5C77R+Btm7zpfma2EPgqadG4YL9TT49JYHtfukeFATfA/yJ1aqSbwK02t9dO3JC61FwN96Z3XmjOAXOVpFM2ZUrhw9JpVAHxiuTdRda9CXyvpKelBcRN1lYyvdXxWn6qrasI+DpJl4tKZqRI949EgL2/6v5ZDLj3Wd02AklZ836r29anBu+22Uvg3be3Cbz7hr5WY7v9C1Py4ow75w8phHsudUY80wAAAABJRU5ErkJggg==",onClick:d})])),_:1})])),_:1})])),_:1},512)])),_:1})}}},[["__scopeId","data-v-ebd11ddf"]]);export{X as default};
|