zzzz
2024-04-14 6e6cd8e3315a3e26186d1d23f80b1465e1f03061
1
"use strict";(self["webpackChunkexchange"]=self["webpackChunkexchange"]||[]).push([[4487,5197],{57034:function(t,e,s){s.d(e,{A:function(){return c}});var i=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{attrs:{id:"normalHead"}},[s("van-nav-bar",{attrs:{border:!1,title:t.title,"left-arrow":""},on:{"click-left":t.onClickLeft},scopedSlots:t._u([{key:"right",fn:function(){return[t._t("default")]},proxy:!0}],null,!0)})],1)},a=[],n=(s(44114),{name:"normal-head",props:["title","goHome","goAssetsCenter","goPerpetualContract","backFunc"],methods:{onClickLeft(){this.goHome?this.$router.push("/"):this.goAssetsCenter?this.$router.push("/assetsCenter/assets"):this.goPerpetualContract?this.$router.go(-2):this.backFunc?this.backFunc():this.$router.go(-1)}}}),o=n,l=s(81656),r=(0,l.A)(o,i,a,!1,null,"2a1fae8d",null),c=r.exports},81174:function(t,e,s){s.d(e,{A:function(){return b}});var i=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"c2cTrade"},[i("normal-head",{attrs:{title:t.title}}),i("div",{staticClass:"w-full px-33 box-border relative tabBackground pb-20"},[i("div",{staticClass:"flex pt-34 box-border items-center"},[i("span",{staticClass:"text-grey font-26 mr-20"},[t._v(t._s(t.$t("单价")))]),i("span",{staticClass:"text-green font-26 mr-35"},[t._v(t._s(t.currencySymbol)+" "+t._s(t.detail.symbol_value))]),i("img",{staticClass:"w-24 h-24",staticStyle:{transition:"all ease 0.5s"},attrs:{src:s(65579),alt:""},on:{click:t.refresh}})]),i("div",{staticClass:"flex mt-22 box-border items-center"},[i("span",{staticClass:"text-grey font-26 mr-20"},[t._v(t._s(t.$t("限额")))]),i("span",{staticClass:"c2cColor font-26 mr-35"},[t._v(t._s(t.currencySymbol)+" "+t._s(t.detail.investment_min)+" - "+t._s(t.currencySymbol)+" "+t._s(t.detail.investment_max))])]),t._t("trade"),i("div",{staticClass:"h-80 px-32 mt-40 flex items-center rounded-lg tips c2cTipBackground"},[i("img",{staticClass:"w-28 h-28 mr-18",attrs:{src:s(36471),alt:""}}),i("p",{staticClass:"font-28 textColor"},[t._v(" "+t._s(t.$t("保护资产安全,请提高防范意识!"))+" ")])])],2),i("div",{staticClass:"px-40 pb-40 mt-31 border-bottom-1px c2cColor"},[i("div",{},[i("h2",{staticClass:"font-28 font-400"},[t._v(t._s(t.$t("交易信息")))]),i("div",{staticClass:"flex justify-between mt-40"},[i("span",{staticClass:"text-grey"},[t._v(t._s(t.$t("付款时限")))]),i("span",[t._v(t._s(t.detail.expire_time)+" "+t._s(t.$t("分钟")))])]),i("div",{staticClass:"flex justify-between mt-40"},[i("span",{staticClass:"text-grey"},[t._v(t._s(t.$t("卖家昵称")))]),i("div",[i("span",{staticClass:"mr-24"},[t._v(t._s(t.detail.nick_name))]),i("van-icon",{staticClass:"font-700 text-grey",attrs:{name:"arrow"}})],1)]),i("div",{staticClass:"flex justify-between mt-40"},[i("span",{staticClass:"text-grey"},[t._v(t._s(t.$t("交易方式")))]),i("div",{staticClass:"h-56 tabBackground rounded-md"},["buy"===t.detail.direction?[i("van-popover",{staticClass:"w-full h-full",attrs:{placement:"left-end",theme:t.$store.state.home.theme,trigger:"click",actions:t.payList},on:{select:t.onSelect},scopedSlots:t._u([{key:"reference",fn:function(){return[i("div",{staticClass:"flex justify-center items-center w-full h-full"},[i("div",{staticClass:"w-6 h-28 border-ra",staticStyle:{background:"#e7bb41"}}),"sell"===t.detail.direction?i("span",{staticClass:"ml-12 mr-16"},[t._v(t._s(t.fullMethodName))]):i("span",{staticClass:"ml-12 mr-16"},[t._v(t._s(t.methodName))]),i("img",{staticClass:"w-28 h-28",attrs:{src:s(78348),alt:""}})])]},proxy:!0}],null,!1,1890010702),model:{value:t.showPopover,callback:function(e){t.showPopover=e},expression:"showPopover"}})]:[i("div",{staticClass:"pl-10"},[t._v(" "+t._s(t.detail.pay_type_name&&t.detail.pay_type_name.replaceAll(","," | "))+" ")])]],2)])])]),i("div",{staticClass:"px-32"},[t._t("desc")],2)],1)},a=[],n=(s(50898),s(72615)),o=(s(57352),s(99502)),l=(s(94156),s(84458)),r=(s(81038),s(83244)),c=(s(63212),s(96874)),u=(s(44114),s(57034)),h=s(93518),d=s(80668),y=s(94348),m={name:"C2cTrade",props:{title:{},type:{},cid:{},bankCarNumber:{},detail:{type:Object,default(){return{}}}},data(){return{num:0,payList:[],payType:"",methodName:"",showPopover:!1,fullMethodName:""}},computed:{...(0,h.L8)(["theme"])},created(){"buy"===this.detail.direction?d.Ay.ctcPaymentMethodPayList({id:this.detail.id,language:this.$i18n.locale}).then((t=>{y.log("res",t),t.data.map((t=>{this.payList.push({value:t.id,text:t.methodName})})),this.payType=this.payList[0].value,this.methodName=this.payList[0].text})):(y.log(this.detail.id),d.Ay.ctcPaymentMethodUserPay({id:this.detail.id,language:this.$i18n.locale}).then((t=>{this.payList=t.data,this.payList.map((t=>{t.text=t.methodName,t.value=t.id})),this.payType=this.payList[0].value,this.methodName=this.payList[0].text}))),d.Ay.c2cGetPayCurrencyList().then((t=>{y.log(t.data)}))},watch:{payType(t){this.$emit("payType",t)}},methods:{refresh(t){this.num++,t.target.style.transform=`rotateZ(-${360*this.num}deg)`,this.$emit("refresh")},onSelect(t){this.payType=t.value,this.methodName=t.text}},computed:{...(0,h.aH)("home",["currency"]),...(0,h.L8)("c2c",["direction","currencySymbol"])},components:{[c.A.name]:c.A,[r.A.name]:r.A,[l.A.name]:l.A,[o.A.name]:o.A,[n.A.name]:n.A,NormalHead:u.A}},p=m,v=s(81656),f=(0,v.A)(p,i,a,!1,null,"fa8de6ec",null),b=f.exports},77758:function(t,e,s){s.r(e),s.d(e,{default:function(){return w}});var i=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"w-full"},["buy"===t.direction?s("c2c-buy"):s("c2c-sell")],1)},a=[],n=s(50119),o=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",[t.data.id?s("c2c-trade",{attrs:{title:t.$t("出售")+" "+t.$store.state.c2c.symbol,detail:t.data},scopedSlots:t._u([{key:"trade",fn:function(){return[s("div",{staticClass:"buy-item mt-40 w-full mainBackground c2cColor"},[s("div",{staticClass:"buy-item-title flex justify-between font-28 py-34 border-b-1 border-light-grey"},[s("div",{staticClass:"flex-1 text-center",class:{"text-grey":"num"===t.genre},on:{click:function(e){return t.typeSwitch("amount")}}},[t._v(" "+t._s(t.$t("按金额出售"))+" ")]),s("div",{staticClass:"flex-1 text-center",class:{"text-grey":"amount"===t.genre},on:{click:function(e){return t.typeSwitch("num")}}},[t._v(" "+t._s(t.$t("按数量出售"))+" ")])]),s("div",{staticClass:"px-32 mt-40"},[s("div",{directives:[{name:"show",rawName:"v-show",value:"amount"===t.genre,expression:"genre === 'amount'"}],staticClass:"w-full buy-item-input relative box-border"},[s("span",{staticClass:"font-28 absolute left-28 text font-700"},[t._v(t._s(t.currencySymbol))]),s("input",{directives:[{name:"model",rawName:"v-model",value:t.money,expression:"money"}],staticClass:"w-full font-36 h-110 border-none box-border pl-96",attrs:{type:"text",placeholder:t.data.investment_min+" - "+t.data.investment_max},domProps:{value:t.money},on:{input:[function(e){e.target.composing||(t.money=e.target.value)},t.changeVal]}}),s("span",{staticClass:"font-28 absolute right-19 text",staticStyle:{color:"#1a6ebd"},on:{click:t.all}},[t._v(t._s(t.$t("全部")))])]),s("div",{directives:[{name:"show",rawName:"v-show",value:"num"===t.genre,expression:"genre === 'num'"}],staticClass:"w-full mb-40 buy-item-input relative box-border"},[s("input",{directives:[{name:"model",rawName:"v-model",value:t.quantity,expression:"quantity"}],staticClass:"w-full font-36 h-110 border-none box-border pl-30 font-400",attrs:{type:"number",placeholder:t.$t("请输入数量")},domProps:{value:t.quantity},on:{input:[function(e){e.target.composing||(t.quantity=e.target.value)},t.changeValNum]}}),s("span",{staticClass:"font-28 absolute right-19 text"},[s("span",{staticClass:"mr-16",staticStyle:{color:"#b8bcc5"}},[t._v(t._s(t.$store.state.c2c.symbol))]),s("span",{staticStyle:{color:"#1a6ebd"},on:{click:t.all}},[t._v(t._s(t.$t("全部")))])])]),t.tips?s("div",{staticClass:"flex mt-12 text-red font-28"},[t._v(" "+t._s(t.tips)+" ")]):t._e(),s("div",{directives:[{name:"show",rawName:"v-show",value:"amount"===t.genre,expression:"genre === 'amount'"}],staticClass:"mt-18 font-20 text-grey"},[t._v(" "+t._s(t.$t("可用余额"))+" "+t._s(Math.floor(1e6*t.usableVolume)/1e6)+" "+t._s(t.$store.state.c2c.symbol)+" ≈ "+t._s((Math.floor(1e5*t.usableVolume)/1e5*t.data.symbol_value/1).toFixed(2))+" "+t._s(t.currencySymbol)+" ")]),s("div",{staticClass:"flex justify-between items-center w-full py-20 my-36 pl-30 pr-36 box-border rounded-md tabBackground",on:{click:t.toc2cCollection}},[s("div",[t.reciveInfo.id?s("div",{staticClass:"flex items-center font-30 c2cColor"},[s("div",{staticClass:"w-8 h-32 rounded-full",staticStyle:{background:"#e7bb41"}}),s("span",{staticClass:"mx-20"},[t._v(t._s(t.reciveInfo.methodName))]),s("span",[t._v(t._s(t.fullBankCarNumber))])]):s("span",{staticClass:"font-32",staticStyle:{color:"#b8bcc5"}},[t._v(t._s(t.$t("选择收款方式")))])]),s("van-icon",{staticClass:"font-700",attrs:{color:"#B8BCC5",name:"arrow"}})],1),s("div",{staticClass:"flex justify-between mb-12"},[s("span",{staticClass:"text-grey"},[t._v(t._s(t.$t("数量")))]),s("span",[t._v(t._s(t.totalQuantity)+" "+t._s(t.data.symbol&&t.data.symbol.toUpperCase()))])]),s("div",{staticClass:"flex justify-between"},[s("span",{staticClass:"text-grey"},[t._v(t._s(t.$t("总额")))]),s("span",[t._v(t._s(t.totalMoney)+" "+t._s(t.currencySymbol))])]),s("div",{staticClass:"w-full mt-24 pb-30"},[s("van-button",{staticClass:"w-full font-30 buy-button",attrs:{color:"#E35461",disabled:t.loading,type:"primary"},nativeOn:{click:function(e){return t.SellClick.apply(null,arguments)}}},[t.loading?s("van-loading",{attrs:{type:"spinner"}}):s("span",[t._v(t._s(t.$t("出售"))+" "+t._s(t.data.symbol&&t.data.symbol.toUpperCase()))])],1)],1)])])]},proxy:!0},{key:"desc",fn:function(){return[s("div",{staticClass:"mt-36"},[s("h2",{staticClass:"font-28 font-400 c2cColor"},[t._v(t._s(t.$t("交易条款")))]),s("div",{staticClass:"mt-30 font-26 text-grey"},[s("p",[t._v(t._s(t.data.transaction_terms))])])])]},proxy:!0}],null,!1,2068838172)}):t._e()],1)},l=[],r=(s(63212),s(96874)),c=(s(74884),s(91981)),u=(s(44114),s(93518)),h=s(80668),d=s(81174),y=(s(93068),s(49351)),m=s(94348),p={name:"c2cSell",props:["type"],data(){return{id:"",genre:"amount",amount:"",num:"",session_token:"",usableVolume:"",data:{},passwd:"",tips:"",money:"",quantity:"",totalMoney:"-",totalQuantity:"-",loading:!1,reciveInfo:{}}},created(){this.id=this.$store.state.c2c.adv_id;let{reciveType:t}=this.$route.query;t&&(t=JSON.parse(t),this.reciveInfo=t,m.log("reciveType",t),this.data=JSON.parse(this.$route.query.data),"amount"==this.$route.query.type?(this.money=this.$route.query.total,this.totalMoney=1*this.money,"USDT"!==this.symbol?(m.log(this.data.symbol_value),this.totalQuantity=Math.floor(this.totalMoney/this.data.symbol_value*1e6)/1e6):this.totalQuantity=Math.floor(this.totalMoney/this.data.symbol_value*100)/100):(this.quantity=1*this.$route.query.total,this.totalQuantity=this.quantity,"USDT"!==this.symbol?(m.log(this.quantity),m.log(this.data.symbol_value),this.totalMoney=(this.quantity*this.data.symbol_value).toFixed(6)):this.totalMoney=(this.quantity*this.data.symbol_value).toFixed(2)),this.genre=this.$route.query.type),this.initData(),(0,y.gV)().then((t=>{let e=t.extends,s=e.find((t=>t.symbol.toLowerCase()==this.$store.state.c2c.symbol.toLowerCase()));this.usableVolume=s.usable}))},mounted(){this.$bus.$on("returnPwd",(t=>{this.passwd=t}))},beforeDestroy(){this.$bus.$off("returnPwd")},methods:{toc2cCollection(){let t="";t="amount"==this.genre?this.money:this.quantity,this.$router.replace({path:"/c2cCollection",query:{id:this.data.id,type:this.genre,total:t,data:JSON.stringify(this.data)}})},initData(){h.Ay.ctcAdvertGetDetail({id:this.id,language:this.$i18n.locale}).then((t=>{this.data=t.data}))},typeSwitch(t){this.genre=t,this.tips="",this.money="",this.quantity="",this.totalMoney="-",this.totalQuantity="-"},changeVal(t){""==this.money?(this.tips="",this.totalMoney="-",this.totalQuantity="-"):1*this.money<1*this.data.investment_min?(this.tips=this.$t("最小金额")+this.data.investment_min+" "+this.exchangeCurrency,this.totalMoney="-",this.totalQuantity="-"):1*this.money>1*this.data.investment_max?(this.tips=this.$t("最大金额")+this.data.investment_max+" "+this.exchangeCurrency,this.totalMoney="-",this.totalQuantity="-"):(this.tips="",this.totalMoney=this.money,"USDT"!==this.symbol?this.totalQuantity=Math.floor(this.totalMoney/this.data.symbol_value*1e6)/1e6:this.totalQuantity=Math.floor(this.totalMoney/this.data.symbol_value*100)/100)},changeValNum(){if(""==this.quantity)this.tips="",this.totalMoney="-",this.totalQuantity="-";else{let t=Math.floor(this.data.investment_min/this.data.symbol_value*1e6)/1e6,e=Math.floor(this.data.investment_max/this.data.symbol_value*1e6)/1e6;1*this.quantity<1*t?(this.tips=this.$t("最小数量")+t+" ",this.totalMoney="-",this.totalQuantity="-"):1*this.quantity>1*e?(this.tips=this.$t("最大数量")+e+" ",this.totalMoney="-",this.totalQuantity="-"):(this.tips="",this.totalQuantity=this.quantity,"USDT"!==this.symbol?this.totalMoney=(this.quantity*this.data.symbol_value).toFixed(6):this.totalMoney=(this.quantity*this.data.symbol_value).toFixed(2))}},async SellClick(){if(!this.reciveInfo.id)return void(0,c.A)(this.$t("请选择收款方式"));m.log(this.exchangeCurrency),this.loading=!0;let t=await h.Ay.getSessionToken({currency:this.exchangeCurrency});this.session_token=t.data.session_token;const e={session_token:this.session_token,c2c_advert_id:this.data.id,payment_method_id:this.reciveInfo.id,direction:"sell",order_type:"amount"===this.genre?"by_amount":"by_num",amount:"amount"===this.genre?this.totalMoney/1:"",coin_amount:"amount"===this.genre?"":this.totalQuantity/1,remark:this.data.remark};h.Ay.ctcOrderOpen(e).then((t=>{this.loading=!1,this.$store.commit("c2c/SET_ORDER_NO",t.data.order_no),this.$router.push({path:"/sellGenerate"})})).catch((t=>{this.loading=!1}))},all(){this.tips="";let t=(Math.floor(1e5*this.usableVolume)/1e5*this.data.symbol_value/1).toFixed(2);1*t<=this.data.investment_max?(this.money=t,this.totalMoney=t,"USDT"!==this.symbol?(this.quantity=Math.floor(t/this.data.symbol_value*1e6)/1e6,this.totalQuantity=Math.floor(t/this.data.symbol_value*1e6)/1e6):(this.quantity=Math.floor(t/this.data.symbol_value*100)/100,this.totalQuantity=Math.floor(t/this.data.symbol_value*100)/100)):(this.money=this.data.investment_max,this.totalMoney=this.data.investment_max,"USDT"!==this.symbol?(this.quantity=Math.floor(this.data.investment_max/this.data.symbol_value*1e6)/1e6,this.totalQuantity=Math.floor(this.data.investment_max/this.data.symbol_value*1e6)/1e6):(this.quantity=Math.floor(this.data.investment_max/this.data.symbol_value*100)/100,this.totalQuantity=Math.floor(this.data.investment_max/this.data.symbol_value*100)/100))}},watch:{},computed:{...(0,u.aH)("home",["currency"]),...(0,u.L8)("c2c",["symbol","currencySymbol","exchangeCurrency"]),fullMethodName(){return this.paymentMethod?this.paymentMethod.methodName:""},fullBankCarNumber(){if(this.reciveInfo.id)return this.reciveInfo.paramValue1.replace(/^([0-9]{4})[0-9]*([0-9]{4})$/,"$1******$2")}},components:{[r.A.name]:r.A,C2cTrade:d.A}},v=p,f=s(81656),b=(0,f.A)(v,o,l,!1,null,"541ff62f",null),A=b.exports,_=s(94348),g={name:"c2cTradeBridge",computed:{...(0,u.L8)("c2c",["direction"])},components:{c2cBuy:n["default"],c2cSell:A},created(){_.log(this.direction)}},C=g,x=(0,f.A)(C,i,a,!1,null,"13d788cc",null),w=x.exports},50119:function(t,e,s){s.r(e),s.d(e,{default:function(){return g}});var i=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"c2cBuy w-full h-full"},[t.detail.id?s("c2c-trade",{attrs:{title:t.$t("购买")+" "+t.symbol,detail:t.detail},on:{refresh:t.fetchDetail,payType:function(e){t.payType=e}},scopedSlots:t._u([{key:"trade",fn:function(){return[s("div",{staticClass:"buy-item mt-40 w-full mainBackground c2cColor"},[s("div",{staticClass:"buy-item-title flex justify-between font-28 py-34 border-b-1 border-light-grey c2cColor"},[s("div",{staticClass:"flex-1 text-center",class:{"text-grey":"num"===t.type},on:{click:function(e){return t.typeSwitch("amount")}}},[t._v(" "+t._s(t.$t("按金额购买"))+" ")]),s("div",{staticClass:"flex-1 text-center",class:{"text-grey":"amount"===t.type},on:{click:function(e){return t.typeSwitch("num")}}},[t._v(" "+t._s(t.$t("按数量购买"))+" ")])]),s("div",{staticClass:"px-32 mt-40"},[s("div",{directives:[{name:"show",rawName:"v-show",value:"amount"===t.type,expression:"type === 'amount'"}],staticClass:"w-full buy-item-input relative box-border"},[s("span",{staticClass:"font-28 absolute left-28 text font-700 c2cColor"},[t._v(t._s(t.currencySymbol))]),s("input",{directives:[{name:"model",rawName:"v-model",value:t.money,expression:"money"}],staticClass:"w-full font-36 h-110 border-none box-border pl-96 c2cColor",attrs:{type:"number",placeholder:t.$t("请输入金额")},domProps:{value:t.money},on:{input:[function(e){e.target.composing||(t.money=e.target.value)},t.changeVal]}}),s("span",{staticClass:"font-28 absolute right-19 text c2cColor",on:{click:t.all}},[t._v(t._s(t.$t("全部")))])]),s("div",{directives:[{name:"show",rawName:"v-show",value:"num"===t.type,expression:"type === 'num'"}],staticClass:"w-full buy-item-input relative box-border"},[s("input",{directives:[{name:"model",rawName:"v-model",value:t.quantity,expression:"quantity"}],staticClass:"w-full font-36 h-110 border-none box-border pl-30 c2cColor",attrs:{type:"number",placeholder:t.$t("请输入数量")},domProps:{value:t.quantity},on:{input:[function(e){e.target.composing||(t.quantity=e.target.value)},t.changeValNum]}}),s("span",{staticClass:"font-28 absolute right-19 text"},[s("span",{staticClass:"mr-16",staticStyle:{color:"#B8BCC5"}},[t._v(t._s(t.symbol))]),s("span",{staticClass:"c2cColor",on:{click:t.all}},[t._v(t._s(t.$t("全部")))])])]),t.tips?s("div",{staticClass:"flex mt-12 text-red font-28"},[t._v(" "+t._s(t.tips)+" ")]):t._e(),s("div",{staticClass:"flex justify-between mt-40 mb-12 c2cColor"},[s("span",{staticClass:"text-grey"},[t._v(t._s(t.$t("数量")))]),s("span",[t._v(t._s(t.totalQuantity)+" "+t._s(t.symbol))])]),s("div",{staticClass:"flex justify-between c2cColor"},[s("span",{staticClass:"text-grey"},[t._v(t._s(t.$t("总额")))]),s("span",[t._v(t._s(t.totalMoney)+" "+t._s(t.currencySymbol))])]),s("div",{staticClass:"w-full mt-24 pb-30"},[s("van-button",{staticClass:"w-full font-30 buy-button",attrs:{disabled:t.loading,type:"primary"},nativeOn:{click:function(e){return t.buyClick.apply(null,arguments)}}},[t.loading?s("van-loading",{attrs:{type:"spinner"}}):s("span",[t._v(t._s(t.$t("购买"))+" "+t._s(t.symbol))])],1)],1)])])]},proxy:!0},{key:"desc",fn:function(){return[s("div",{staticClass:"mt-36"},[s("h2",{staticClass:"font-28 font-400 c2cColor"},[t._v(t._s(t.$t("交易信息")))]),s("div",{staticClass:"mt-30 font-26 text-grey"},[s("p",{staticClass:"lh-45"},[t._v(t._s(t.$t("请先阅读以下内容:")))]),s("p",{staticClass:"lh-45"},[t._v(t._s(t.$t("银行卡转账切勿备注,不然不给予放币和直接封其账号。付款后 需要提供打款后新的交易明细图(如果P图或者隐藏交易明细上报平台冻结账户)")))])])])]},proxy:!0}],null,!1,513482357)}):t._e()],1)},a=[],n=(s(76117),s(87555)),o=(s(57352),s(99502)),l=(s(94156),s(84458)),r=(s(22367),s(85324)),c=(s(72161),s(9471)),u=(s(93093),s(75187)),h=(s(86291),s(14189)),d=(s(63212),s(96874)),y=(s(44114),s(81174)),m=s(80668),p=s(93518),v=s(94348),f={name:"c2cBuy",data(){return{type:"amount",detail:{},payType:"",tips:"",money:"",quantity:"",totalMoney:"-",totalQuantity:"-",loading:!1}},created(){this.fetchDetail()},methods:{fetchDetail(){const t=this.$store.state.c2c.adv_id;m.Ay.ctcAdvertGetDetail({id:t,language:this.$i18n.locale}).then((t=>{t.data.symbol_value==this.detail.symbol_value&&this.$toast(this.$t("无价格更新")),this.detail=t.data}))},async submitOrder(){this.loading=!0;const t=await m.Ay.getSessionToken({currency:this.exchangeCurrency}),e={session_token:t.data.session_token,c2c_advert_id:this.detail.id,payment_method_id:this.payType,direction:"buy",order_type:"amount"===this.type?"by_amount":"by_num",amount:"amount"===this.type?this.totalMoney/1:"",coin_amount:"amount"===this.type?"":this.totalQuantity/1};m.Ay.ctcOrderOpen(e).then((t=>{this.loading=!1,this.$store.commit("c2c/SET_ORDER_NO",t.data.order_no),this.$router.push("/orderGeneration")})).catch((t=>{this.loading=!1}))},typeSwitch(t){this.type=t,this.tips="",this.money="",this.quantity="",this.totalMoney="-",this.totalQuantity="-"},changeVal(t){""==this.money?(this.tips="",this.totalMoney="-",this.totalQuantity="-"):1*this.money<1*this.detail.investment_min?(this.tips=this.$t("最小金额")+this.detail.investment_min+" "+this.exchangeCurrency,this.totalMoney="-",this.totalQuantity="-"):1*this.money>1*this.detail.investment_max?(this.tips=this.$t("最大金额")+this.detail.investment_max+" "+this.exchangeCurrency,this.totalMoney="-",this.totalQuantity="-"):(this.tips="",this.totalMoney=this.money,"USDT"!==this.symbol?this.totalQuantity=Math.floor(this.totalMoney/this.detail.symbol_value*1e6)/1e6:this.totalQuantity=Math.floor(this.totalMoney/this.detail.symbol_value*100)/100)},changeValNum(){if(""==this.quantity)this.tips="",this.totalMoney="-",this.totalQuantity="-";else{let t=Math.floor(this.detail.investment_min/this.detail.symbol_value*1e6)/1e6,e=Math.floor(this.detail.investment_max/this.detail.symbol_value*1e6)/1e6;1*this.quantity<1*t?(this.tips=this.$t("最小数量")+t+" ",this.totalMoney="-",this.totalQuantity="-"):1*this.quantity>1*e?(this.tips=this.$t("最大数量")+e+" ",this.totalMoney="-",this.totalQuantity="-"):(this.tips="",this.totalQuantity=this.quantity,"USDT"!==this.symbol?this.totalMoney=(this.quantity*this.detail.symbol_value).toFixed(6):this.totalMoney=(this.quantity*this.detail.symbol_value).toFixed(2))}},async buyClick(){"amount"==this.type?""==this.money?this.$toast(this.$t("请输入金额")):this.submitOrder():(v.log(this.quantity),""==this.quantity?this.$toast(this.$t("请输入数量")):this.submitOrder())},all(){this.tips="",this.money=this.detail.investment_max,this.totalMoney=this.detail.investment_max,"USDT"!==this.symbol?(this.quantity=Math.floor(this.detail.investment_max/this.detail.symbol_value*1e6)/1e6,this.totalQuantity=Math.floor(this.detail.investment_max/this.detail.symbol_value*1e6)/1e6):(this.quantity=Math.floor(this.detail.investment_max/this.detail.symbol_value*100)/100,this.totalQuantity=Math.floor(this.detail.investment_max/this.detail.symbol_value*100)/100)}},computed:{...(0,p.L8)("c2c",["symbol","currencySymbol","exchangeCurrency"])},components:{[d.A.name]:d.A,[h.A.name]:h.A,[u.A.name]:u.A,[c.A.name]:c.A,[r.A.name]:r.A,[l.A.name]:l.A,[o.A.name]:o.A,[n.A.name]:n.A,C2cTrade:y.A}},b=f,A=s(81656),_=(0,A.A)(b,i,a,!1,null,"ffcb3a72",null),g=_.exports},83244:function(t,e,s){var i=s(4250),a=s.n(i),n=s(47456),o=s(15827),l=(0,n.Y)("divider"),r=l[0],c=l[1];function u(t,e,s,i){var n;return t("div",a()([{attrs:{role:"separator"},style:{borderColor:e.borderColor},class:c((n={dashed:e.dashed,hairline:e.hairline},n["content-"+e.contentPosition]=s.default,n))},(0,o.IL)(i,!0)]),[s.default&&s.default()])}u.props={dashed:Boolean,hairline:{type:Boolean,default:!0},contentPosition:{type:String,default:"center"}},e.A=r(u)},81038:function(t,e,s){s(76952)},99502:function(t,e,s){var i=s(47456),a=s(48499),n=s(52835),o=s(99297),l=s(9471),r=s(96874),c=s(75187),u=(0,i.Y)("dropdown-item"),h=u[0],d=u[1];e.A=h({mixins:[(0,n.m)({ref:"wrapper"}),(0,o.b)("vanDropdownMenu")],props:{value:null,title:String,disabled:Boolean,titleClass:String,options:{type:Array,default:function(){return[]}},lazyRender:{type:Boolean,default:!0}},data:function(){return{transition:!0,showPopup:!1,showWrapper:!1}},computed:{displayTitle:function(){var t=this;if(this.title)return this.title;var e=this.options.filter((function(e){return e.value===t.value}));return e.length?e[0].text:""}},watch:{showPopup:function(t){this.bindScroll(t)}},beforeCreate:function(){var t=this,e=function(e){return function(){return t.$emit(e)}};this.onOpen=e("open"),this.onClose=e("close"),this.onOpened=e("opened")},methods:{toggle:function(t,e){void 0===t&&(t=!this.showPopup),void 0===e&&(e={}),t!==this.showPopup&&(this.transition=!e.immediate,this.showPopup=t,t&&(this.parent.updateOffset(),this.showWrapper=!0))},bindScroll:function(t){var e=this.parent.scroller,s=t?a.on:a.AU;s(e,"scroll",this.onScroll,!0)},onScroll:function(){this.parent.updateOffset()},onClickWrapper:function(t){this.getContainer&&t.stopPropagation()}},render:function(){var t=this,e=arguments[0],s=this.parent,i=s.zIndex,a=s.offset,n=s.overlay,o=s.duration,u=s.direction,h=s.activeColor,y=s.closeOnClickOverlay,m=this.options.map((function(s){var i=s.value===t.value;return e(l.A,{attrs:{clickable:!0,icon:s.icon,title:s.text},key:s.value,class:d("option",{active:i}),style:{color:i?h:""},on:{click:function(){t.showPopup=!1,s.value!==t.value&&(t.$emit("input",s.value),t.$emit("change",s.value))}}},[i&&e(r.A,{class:d("icon"),attrs:{color:h,name:"success"}})])})),p={zIndex:i};return"down"===u?p.top=a+"px":p.bottom=a+"px",e("div",[e("div",{directives:[{name:"show",value:this.showWrapper}],ref:"wrapper",style:p,class:d([u]),on:{click:this.onClickWrapper}},[e(c.A,{attrs:{overlay:n,position:"down"===u?"top":"bottom",duration:this.transition?o:0,lazyRender:this.lazyRender,overlayStyle:{position:"absolute"},closeOnClickOverlay:y},class:d("content"),on:{open:this.onOpen,close:this.onClose,opened:this.onOpened,closed:function(){t.showWrapper=!1,t.$emit("closed")}},model:{value:t.showPopup,callback:function(e){t.showPopup=e}}},[m,this.slots("default")])])])}})},57352:function(t,e,s){s(76952),s(69176),s(98992),s(22795),s(90504),s(65270)},84458:function(t,e,s){var i=s(47456),a=s(33448),n=s(32486),o=s(99297),l=s(26063),r=(0,i.Y)("dropdown-menu"),c=r[0],u=r[1];e.A=c({mixins:[(0,o.G)("vanDropdownMenu"),(0,l.f)({event:"click",method:"onClickOutside"})],props:{zIndex:[Number,String],activeColor:String,overlay:{type:Boolean,default:!0},duration:{type:[Number,String],default:.2},direction:{type:String,default:"down"},closeOnClickOverlay:{type:Boolean,default:!0}},data:function(){return{offset:0}},computed:{scroller:function(){return(0,n.Rm)(this.$el)},opened:function(){return this.children.some((function(t){return t.showWrapper}))},barStyle:function(){if(this.opened&&(0,a.C8)(this.zIndex))return{zIndex:1+this.zIndex}}},methods:{updateOffset:function(){if(this.$refs.bar){var t=this.$refs.bar.getBoundingClientRect();"down"===this.direction?this.offset=t.bottom:this.offset=window.innerHeight-t.top}},toggleItem:function(t){this.children.forEach((function(e,s){s===t?e.toggle():e.showPopup&&e.toggle(!1,{immediate:!0})}))},onClickOutside:function(){this.children.forEach((function(t){t.toggle(!1)}))}},render:function(){var t=this,e=arguments[0],s=this.children.map((function(s,i){return e("div",{attrs:{role:"button",tabindex:s.disabled?-1:0},class:u("item",{disabled:s.disabled}),on:{click:function(){s.disabled||t.toggleItem(i)}}},[e("span",{class:[u("title",{active:s.showPopup,down:s.showPopup===("down"===t.direction)}),s.titleClass],style:{color:s.showPopup?t.activeColor:""}},[e("div",{class:"van-ellipsis"},[s.slots("title")||s.displayTitle])])])}));return e("div",{class:u()},[e("div",{ref:"bar",style:this.barStyle,class:u("bar",{opened:this.opened})},[s]),this.slots("default")])}})},94156:function(t,e,s){s(76952)},77965:function(t,e,s){s.d(e,{Y:function(){return i}});var i={inject:{vanField:{default:null}},watch:{value:function(){var t=this.vanField;t&&(t.resetValidation(),t.validateWithTrigger("onChange"))}},created:function(){var t=this.vanField;t&&!t.children&&(t.children=this)}}},85324:function(t,e,s){s.d(e,{A:function(){return h}});var i=s(47456),a=s(83462),n={size:[Number,String],value:null,loading:Boolean,disabled:Boolean,activeColor:String,inactiveColor:String,activeValue:{type:null,default:!0},inactiveValue:{type:null,default:!1}},o=s(77965),l=s(90689),r=(0,i.Y)("switch"),c=r[0],u=r[1],h=c({mixins:[o.Y],props:n,computed:{checked:function(){return this.value===this.activeValue},style:function(){return{fontSize:(0,a._)(this.size),backgroundColor:this.checked?this.activeColor:this.inactiveColor}}},methods:{onClick:function(t){if(this.$emit("click",t),!this.disabled&&!this.loading){var e=this.checked?this.inactiveValue:this.activeValue;this.$emit("input",e),this.$emit("change",e)}},genLoading:function(){var t=this.$createElement;if(this.loading){var e=this.checked?this.activeColor:this.inactiveColor;return t(l.A,{class:u("loading"),attrs:{color:e}})}}},render:function(){var t=arguments[0],e=this.checked,s=this.loading,i=this.disabled;return t("div",{class:u({on:e,loading:s,disabled:i}),attrs:{role:"switch","aria-checked":String(e)},style:this.style,on:{click:this.onClick}},[t("div",{class:u("node")},[this.genLoading()])])}})},22367:function(t,e,s){s(76952),s(45396)},78348:function(t){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAcCAYAAACdz7SqAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAChSURBVHgB7c0xCoQwEEDRcVfEY+QqHmfZfmGxECtLS0uP4hU8Qo5gqUEctRAUTJwkFhbzIZBkBh4Ax3FPL9ANsrIS8RgKuKEJVZf+vu32DnWLcQ+AEdbLVYBXKJV6JfufwLReFJXA6N24wygHNSX5/yPJqB98DpJQN1gPklE72AxaoTT4GrRGzTANdELPYTrojB5hBBvQuxXOlgMcx3F3NAP3NGtpVw/LvAAAAABJRU5ErkJggg=="},36471:function(t){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAdCAYAAABWk2cPAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAICSURBVHgBxZdBctMwFIb/p3QGFgW6hxRPT5AjpBtYAiegvQCNT0B6Agcu0HTNoj1C2bAOG9Ye6AwsXWABQ+zHL7npJK1byYnr/jOKFVnSJz09Sc/AHUhCK0aJbkyBnjIrBk9tmQGyosDnNWCSxpKF9uWFdhPdYe+vme3fVI+DOeEgxl/35BDLQp8k2jcGB3ZmqCF2mPIxvAleCd18pyPC9rCKBKNvbySufjUnu265wRE8pgwVBz75XWA7u7TeZv5P3sFBU0Arzqi3Xk4ClVCadMihvfR19HwL+LRbpmdb8Irg/maigytQmjWiKd4iQA/v08kelOnRPQRJDRLLWIDSrEHAVTQ1bulKqBuBYge3LGvmDTqqg+YNOo5P6+UhQ/N28AItSbScoGEmQlsS9ByUXttDe4ocFHcgQ68KvpIag2qLUHsWOyhzJ2hJdNrUPtdEMNEaDT98KdMyKgTH9mlMAe9N35TyAh8d1MU2inFow7q3zIXI+BFL6qD2559iP9SLl7llZoxZ3kHtCDj1/ZDGZ3+A059lOvuLINFnhrNZWi2EK933ehRykdeRcnecDmR7vmzhROrk2JXzvdQI0MZIileXyyujwe5IE74ZYDXi+JciziqC8Gvj3scMshn32ogiQj2l0wLx91iOr6vgjfAdXHj5iifCtycbNz9DzsPM84nxH3XDqNKRvFfDAAAAAElFTkSuQmCC"},65579:function(t){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAZCAYAAADaILXQAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJ1SURBVHgBtVVdbtpAEJ7dNW5VKaqPwA1KT1BygjYnAKQ2UZ4CpX2AKsKoClRKgfYJxakE3ICeAHoDegJ8BB6pnd3tLDZm45qfkvBJYO969pvZ2Z1vCCAa7duReoKUs2r59AQ02HbPSh3N3xAwXqBBGgixAluYSJC/fY+P7cq5CwkwQtJsOHZ10ifP7y6k8IsAzFJsoe3SJEvwzzQZNFtO/4/H63EnNMnj5+tu1jzyp1JIG4cWbAG6y6OT0VXLyevzyjk0Wo6MIifUBin691eTsZTilyAwwW8zNcUozaDta23XASEldqX0rp5EPotF6nLBC5cfz8ewBmqXBmU9JEhrHvLV928HcXJ9rxOPpY7tUmEGW2B3epYp/RGuySyD9Dz+kq6xd3clXpCjnUdSx6DSFsAyTdpJjBwHBSG4GyfZlB6FZqebloJNl+PEyNFjj1E2iv9gCyolvIpSDjaSPwRcu2lBEREyhkcCN55OmPADWjgAmm1nioWcfvS06DgIOUZtHYS82eymIazyxYEqwSGE5AK34me1fPYN9oQwA7WMyFXB4D3OBlNElfDe5BRYTUbvEFaeXJXu1fWNDXug2bmtaQLmRjnnkpeW7yibtUb7Rw7+A8o+1P8F0Ek9Ig90Qw4ja6y0RuumuAvxl7ZzofcAJB1+Kp/2Dd3Io2YBpTO9kk7SaXx1chxk/fLD2TBOqrScMaMm7jcMd06DLPxToQnavNoMIRNcMMMtW0Ris463wEUP4Cd2Keila8tfHarKPewILJzvPkvZeg/YqC1KnwVnRQLkFRCZSTBx8RAHviH6y2h17CxcKl3sbr5wQLFJ+6ln7rZO9RcpRyCBNjPZ7AAAAABJRU5ErkJggg=="}}]);