PageSourceSearch

https://www.0i1c.cn/template/pc/skin/js/7165-ce75bfc422a2bf79.js

js 0i1c.cn collected 2026-10-09 04:34:47 UTC 9,344 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7165],{77165:function(e,n,a){a.d(n,{O:function(){return A}});var o=a(26042),t=a(69396),l=a(85893),s=a(67294),c=a(1653),d=a(84282),r=a(75348),i=a(69416),u=a(74489),p=a(94184),m=a.n(p),h=a(59359),v=a(11163),x=a(27361),_=a.n(x),b=a(72132),y=a(77055),f=a(85192),g=a(42259),j=a(17266),N=a(31474),Z=a(88156),C=a(30622),k=a(37315),w=a(28320),z=a(60429),q=a(54619),E=a(26330),S=a(37502),I=[{name:"alipay",logo:"/images/payment/alipay.png",label:"支付宝"},{name:"wechatpay",logo:"/images/payment/wechatpay.png",label:"微信"},],M={vendor:null,checkout:!1,qrcode:null,phone_code:"",phone_number:"",phoneError:!1,bizId:"",aggreedTc:!1,couponCode:"",couponCodeSuccess:!0,couponCodeError:null,showCoupon:!1,installmentNumber:null};function T(e,n){switch(n.type){case"set_vendor":return(0,t.Z)((0,o.Z)({},e),{vendor:n.payload});case"checkout":return(0,t.Z)((0,o.Z)({},e),{checkout:!0});case"back":return(0,t.Z)((0,o.Z)({},e),{checkout:!1,qrcode:null});case"set_qrcode":return(0,t.Z)((0,o.Z)({},e),{qrcode:n.payload});case"reset":return M;case"set_phone":return(0,t.Z)((0,o.Z)({},e),{phone_number:n.payload});case"set_phone_code":return(0,t.Z)((0,o.Z)({},e),{phone_code:n.payload});case"set_phone_error":return(0,t.Z)((0,o.Z)({},e),{phoneError:n.payload});case"set_biz_id":return(0,t.Z)((0,o.Z)({},e),{bizId:n.payload});case"aggree_tc":return(0,t.Z)((0,o.Z)({},e),{aggreedTc:n.payload});case"set_coupon_code":return(0,t.Z)((0,o.Z)({},e),{couponCode:n.payload});case"set_coupon_success":return(0,t.Z)((0,o.Z)({},e),{couponCodeSuccess:n.payload});case"set_coupon_error":return(0,t.Z)((0,o.Z)({},e),{couponCodeError:n.payload});case"toggle_coupon":return(0,t.Z)((0,o.Z)({},e),{showCoupon:n.payload});case"set_installment_number":return(0,t.Z)((0,o.Z)({},e),{installmentNumber:n.payload});default:return e}}var A=function(e){var n,a,p,x,A=e.product,F=e.isOpen,G=e.additionType,D=e.additionValue,J=(0,s.useReducer)(T,M),O=J[0],R=J[1],W=(0,v.useRouter)(),K=(0,Z.aC)().user,P=(0,k.I)(A),V=P.couponDiscountAmount,X=P.amount,B=P.checkCoupon,H=(0,s.useMemo)(function(){return X>0},[X]),L=(0,s.useCallback)(function(){var e;R({type:"checkout"}),(0,f.W)({url:"/v2/payment/getqrcode/".concat(null===(e=O.vendor)||void 0===e?void 0:e.name,"/").concat(null==A?void 0:A.id),data:{phone_code:O.phone_code,phone_number:O.phone_number,coupon_code:O.couponCodeSuccess?O.couponCode:void 0,cashier_url:(0,E.gK)(window.location.href),installment_number:O.installmentNumber,addition_type:G,addition_value:D},method:"post"}).then(function(e){e.success?(R({type:"set_qrcode",payload:e.data.data.url}),R({type:"set_biz_id",payload:e.data.data.biz_id})):b.Am.error(e.message)})},[G,D,null==A?void 0:A.id,O.couponCode,O.couponCodeSuccess,O.installmentNumber,O.phone_code,O.phone_number,null===(n=O.vendor)||void 0===n?void 0:n.name,]),Q=(0,s.useCallback)(function(){var e;(0,f.W)({url:"/v2/payment/h5pay/".concat(null===(e=O.vendor)||void 0===e?void 0:e.name,"/").concat(null==A?void 0:A.id),data:{phone_code:"86",phone_number:O.phone_number,coupon_code:O.couponCodeSuccess?O.couponCode:void 0,installment_number:O.installmentNumber,cashier_url:window.location.href,addition_type:G,addition_value:D},method:"post"}).then(function(e){if(e.success){var n,a;(null===(n=O.vendor)||void 0===n?void 0:n.name)==="wechatpay"?location.href=e.data.data:(null===(a=O.vendor)||void 0===a?void 0:a.name)==="alipay"&&document.write(e.data.data)}else b.Am.error(e.message)})},[null===(a=O.vendor)||void 0===a?void 0:a.name,O.phone_number,O.couponCodeSuccess,O.couponCode,O.installmentNumber,null==A?void 0:A.id,G,D,]),U=(0,s.useCallback)(function(){h.tq?Q():L()},[Q,L]),Y=(0,s.useCallback)(function(){R({type:"back"})},[]);(0,s.useEffect)(function(){F&&R({type:"reset"})},[F]);var $=(0,s.useMemo)(function(){return!O.aggreedTc||!O.vendor||!O.phone_number},[O.aggreedTc,O.phone_number,O.vendor]),ee=(0,s.useCallback)(function(){O.bizId&&(0,g.yv)(O.bizId).then(function(e){if("Success"!==e.data.data.status){alert("您的订单还未完成支付,请稍后再尝试!");return}W.push("/payment-status/?id=".concat(O.bizId))},function(e){alert("订单不存在")}).catch(function(e){alert("订单不存在")})},[W,O.bizId]);(0,s.useEffect)(function(){K&&F&&(R({type:"set_phone",payload:K.phone_number}),R({type:"set_phone_code",payload:K.phone_code}))},[F,K]),(0,s.useEffect)(function(){B({coupon_code:O.couponCode})},[B,O.couponCode]);var en=(0,s.useMemo)(function(){if(A){var e;if((null===(e=A.game_category)||void 0===e?void 0:e.code)==="hok")return X<1500?[]:[3,6];if((null==A?void 0:A.time_span_unit)==="Month"&&(null==A?void 0:A.time_span)){if
1((null==A?void 0:A.time_span)>=6)return[3,6];if((null==A?void 0:A.time_span)>=3)return[3]}else if((null==A?void 0:A.time_span_unit)==="Day"&&(null==A?void 0:A.time_span)){if((null==A?void 0:A.time_span)>=180)return[3,6];if((null==A?void 0:A.time_span)>=90)return[3]}}return[]},[A,X]),ea=(0,s.useMemo)(function(){var e;return(null===(e=O.vendor)||void 0===e?void 0:e.name)==="alipay"&&en.length?en.map(function(e){return{value:"".concat(e),label:"".concat(Math.floor(100*X/e)/100," x ").concat(e,"期")}}):[]},[null===(p=O.vendor)||void 0===p?void 0:p.name,en,X]),eo=(0,s.useCallback)(function(e){e?R({type:"set_installment_number",payload:e}):R({type:"set_installment_number",payload:null})},[]);return(0,l.jsx)(y.Z,(0,t.Z)((0,o.Z)({size:"small"},e),{children:(0,l.jsx)("div",{className:"pb-4 max-w-lg",children:(0,l.jsx)(j.J,{loading:!1,children:(0,l.jsxs)(l.Fragment,{children:[O.checkout?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("h3",{className:"text-lg text-black mb-4 text-center",children:["请使用",null===(x=O.vendor)||void 0===x?void 0:x.label,"扫码支付"]}),(0,l.jsx)("div",{className:"flex flex-row justify-center",children:O.qrcode?(0,l.jsx)("div",{className:"inline-block mx-auto",children:(0,l.jsx)(c.Z,{value:O.qrcode,size:150})}):(0,l.jsx)("span",{className:"my-6",children:(0,l.jsx)(i.J,{name:"spin",size:"large"})})})]}):(0,l.jsxs)(l.Fragment,{children:[A&&(0,l.jsxs)("div",{className:"mb-4",children:[(0,l.jsx)("div",{className:"text-xs text-gray-400 mb-2",children:"您正在购买"}),(0,l.jsx)("div",{className:"text-xl font-bold",children:A.name}),(0,l.jsx)("div",{className:"mt-1",children:A.sub_name})]}),(0,l.jsxs)("dl",{className:"flex flex-col px-3 my-3",children:[(0,l.jsxs)("div",{className:"flex justify-between border-b border-gray-200 py-2",children:[(0,l.jsx)("dt",{children:(0,l.jsx)("span",{className:"text-gray-400",children:"价格:"})}),(0,l.jsxs)("dd",{children:[(0,C.xG)(null==A?void 0:A.amount),"元"]})]}),(null==A?void 0:A.discount_amount)?(0,l.jsxs)("div",{className:"flex justify-between border-b border-gray-200 py-2",children:[(0,l.jsx)("dt",{children:(0,l.jsx)("span",{className:"text-gray-400",children:"优惠:"})}),(0,l.jsxs)("dd",{children:[(0,C.xG)(A.discount_amount-A.amount),"元"]})]}):null,V?(0,l.jsxs)("div",{className:"flex justify-between border-b border-gray-200 py-2",children:[(0,l.jsx)("dt",{children:(0,l.jsx)("span",{className:"text-gray-400",children:"折扣码:"})}),(0,l.jsxs)("dd",{children:["-",(0,C.xG)(V),"元"]})]}):null,(0,l.jsxs)("div",{className:"flex justify-between py-2 ",children:[(0,l.jsx)("dt",{children:(0,l.jsx)("span",{className:"text-base text-black",children:"合计:"})}),(0,l.jsx)("dd",{children:(0,l.jsxs)("span",{className:"text-base text-black",children:[(0,C.xG)(X),"元"]})})]})]}),A&&(0,l.jsx)(w.Z,{onSelect:function(e){e?R({type:"set_coupon_code",payload:e.code}):R({type:"set_coupon_code",payload:void 0})},className:"mx-2 mb-3",product:A}),H&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"text-[#333] mb-2",children:"请选择支付方式"}),(0,l.jsx)("div",{className:"flex items-stretch justify-center max-w-lg mx-auto p-2",children:I.map(function(e){var n,a;return(0,l.jsx)("div",{className:m()("flex-1 mx-4 px-2 py-6 border rounded-lg cursor-pointer hover:border-gold-200",(null===(n=O.vendor)||void 0===n?void 0:n.name)!==e.name&&"opacity-40",(null===(a=O.vendor)||void 0===a?void 0:a.name)===e.name&&"border-gold-400 shadow-md shadow-gold-500"),onClick:function(){R({type:"set_vendor",payload:e}),"alipay"!==e.name&&R({type:"set_installment_number",payload:null})},children:(0,l.jsx)(z.Z,{alt:e.name,src:e.logo})},e.name)})}),(0,l.jsxs)("form",{className:"py-4 text-left",children:[!!(null==ea?void 0:ea.length)&&(0,l.jsx)(d.g,{label:"使用花呗分期",children:(0,l.jsx)(S.v,{options:ea,onChange:eo})}),(0,l.jsx)(d.g,{children:(0,l.jsx)(r.X,{checkboxProps:{id:"agreement",checked:O.aggreedTc,onChange:function(e){R({type:"aggree_tc",payload:e.target.checked})}},label:(0,l.jsxs)("div",{className:"text-gray-800",children:["我已阅读并同意",(0,l.jsx)(N.Z,{href:(0,q.A)(_()(A,"class.id",""),_()(A,"game_category.code","")),target:"_blank",className:"text-gold-500",children:"相关协议"})]})})})]})]})]}),(0,l.jsx)("div",{children:(0,l.jsx)("div",{className:"text-center",children:O.checkout?(0,l.jsxs)("div",{className:"mt-10",children:[(0,l.jsx)(u.z,{variant:"base",size:"large",onClick:Y,children:"重新选择"}),(0,l.jsx)(u.z,{variant:"brand",size:"large",onClick:ee,className:"ml-2",children:"我已完成支付"})]}):(0,l.jsx)(u.z,{variant:"brand",size:"large",disabled:$,onClick:U,children:"立即支付"})})})]})})})}))}}}]);
2//# 

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.