(function(){"use strict";var t={217:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(2654),s=i(4300),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"0471d478",null),l=n.exports},346:function(t,e,i){Object.defineProperty(e,"B",{value:!0}),e.A=void 0,i(4114);var a=i(9252),s=i(9662);e.A={name:"AccountProductNew",data(){const t=(t,e,i)=>{"string"!==typeof e||0!==e.trim().length?i():i(new Error("内容不能全是空格"))},e=t=>{if("string"!==typeof t||0===t.length)return!1;const e=/[\u{1F300}-\u{1FAFF}]|[\u{1F1E6}-\u{1F1FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|[\u{FE0F}]|[\u{200D}]|[\u{20E3}]/u;return e.test(t)},i=(t,i,a)=>{"string"===typeof i&&e(i)?a(new Error("商品名称不能包含表情符号")):a()};return{submitting:!1,form:{name:"",type:0,coin:"",description:"",image:"",state:0,shopId:null},rules:{name:[{required:!0,message:"请输入商品名称",trigger:"blur"},{validator:t,trigger:"blur"},{validator:i,trigger:"blur"},{min:1,max:30,message:"商品名称长度在 2 到 30 个字符",trigger:"blur"}],type:[{required:!0,message:"请选择商品类型",trigger:"change"}],coin:[{required:!0,message:"请选择挖矿币种",trigger:"change"}],description:[{required:!0,message:"请输入商品描述",trigger:"blur"},{validator:t,trigger:"blur"},{min:1,max:100,message:"商品描述长度在 1 到 100 个字符",trigger:"blur"}],image:[],state:[{required:!0,message:"请选择商品状态",trigger:"change"}]}}},computed:{coinOptions(){return a.coinList||[{value:"nexa",label:"NEXA"},{value:"rxd",label:"RXD"},{value:"dgbo",label:"DGBO"},{value:"dgbq",label:"DGBQ"},{value:"dgbs",label:"DGBS"},{value:"alph",label:"ALPH"},{value:"enx",label:"ENX"},{value:"grs",label:"GRS"},{value:"mona",label:"MONA"}]}},created(){const t=this.$route.query.shopId;t&&(this.form.shopId=Number(t))},methods:{async fetchAddProduct(t){const e=await(0,s.createProduct)(t);!e||0!==e.code&&200!==e.code?this.$message({message:e&&e.msg?e.msg:"创建失败",type:"error",showClose:!0}):(this.$message({message:"商品创建成功",type:"success",showClose:!0}),this.$router.push("/account/products"))},async handleSubmit(){try{const t=await this.$refs.productForm.validate();if(!t)return;if(!this.form.shopId)return void this.$message({message:"缺少店铺ID,请从我的店铺页面进入",type:"error",showClose:!0});this.submitting=!0,this.fetchAddProduct(this.form)}catch(t){console.error("创建商品失败:",t)}finally{this.submitting=!1}},handleReset(){this.$refs.productForm.resetFields();const t=this.$route.query.shopId;t&&(this.form.shopId=Number(t))},handleCancel(){this.$router.push("/account/shops")}}}},460:function(t,e,i){var a=i(3999)["default"];Object.defineProperty(e,"B",{value:!0}),e.A=void 0;var s=i(4180),o=a(i(4073));e.A={name:"AccountOrders",components:{OrderList:o.default},data(){return{active:"7",orders:{7:[],8:[],9:[],11:[]},loading:!1}},created(){const t=this.$route&&this.$route.query&&this.$route.query.status?String(this.$route.query.status):null,e=localStorage.getItem("orderListActiveTab"),i=t||e||"7";this.active=i,this.fetchOrders(i)},methods:{async fetchCancelOrder(t){const e=await(0,s.cancelOrder)(t);e&&200===Number(e.code)?(this.$message({message:"取消订单成功",type:"success",showClose:!0}),this.fetchOrders(this.active)):this.$message({message:e&&e.msg||"取消失败",type:"error",showClose:!0})},handleCancelOrder({orderId:t}){t&&this.fetchCancelOrder({orderId:t})},handleTabClick(t){const e=t&&t.name?String(t.name):this.active;try{localStorage.setItem("orderListActiveTab",e)}catch(i){console.warn("保存标签页状态失败:",i)}this.fetchOrders(e)},async fetchOrders(t){const e=String(t);try{this.loading=!0;const i=await(0,s.getOrdersByStatus)({status:Number(t)}),a=null!=(i&&i.data)?i.data:i,o=Array.isArray(a)?a:Array.isArray(a&&a.rows)?a.rows:[];this.$set(this.orders,e,o)}catch(i){console.log(i,"获取订单失败")}finally{this.loading=!1}}}}},465:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.initNoEmojiGuard=void 0;const i=()=>{if("undefined"===typeof window)return;if(window.__noEmojiGuardInitialized)return;window.__noEmojiGuardInitialized=!0;const t=/[\u{1F300}-\u{1FAFF}]|[\u{1F1E6}-\u{1F1FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|[\u{FE0F}]|[\u{200D}]|[\u{20E3}]/gu,e=t=>{if(!t||!(t instanceof Element))return!1;if(t.getAttribute&&"true"===t.getAttribute("data-allow-emoji"))return!1;const e=t.tagName;if("INPUT"===e){const e=(t.getAttribute("type")||"text").toLowerCase(),i=["checkbox","radio","file","hidden","button","submit","reset","range","color","date","datetime-local","month","time","week"];return-1===i.indexOf(e)}return"TEXTAREA"===e},i=(t,e)=>{try{t.__noEmojiComposing=e}catch(i){}},a=t=>!(!t||!t.__noEmojiComposing);function s(e){const i=String(e.value??"");if(!i)return;if(!t.test(i))return;const a=e.selectionStart,s=e.selectionEnd,o=i.replace(t,"");if(o===i)return;e.value=o;try{if("number"===typeof a&&"number"===typeof s){const t=i.length-o.length,s=Math.max(0,a-t);e.setSelectionRange(s,s)}}catch(n){}const r=new Event("input",{bubbles:!0});e.dispatchEvent(r)}document.addEventListener("compositionstart",t=>{e(t.target)&&i(t.target,!0)},!0),document.addEventListener("compositionend",t=>{e(t.target)&&(i(t.target,!1),s(t.target))},!0),document.addEventListener("input",t=>{const i=t.target;e(i)&&(a(i)||s(i))},!0)};e.initNoEmojiGuard=i},631:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"cart-page"},[e("h1",{staticClass:"page-title"},[t._v("购物车")]),t.loading?e("div",{staticClass:"loading"},[e("i",{staticClass:"el-icon-loading",attrs:{"aria-label":"加载中",role:"img"}}),t._v(" 加载中... ")]):t.isCartEmpty?e("div",{staticClass:"empty-cart"},[e("div",{staticClass:"empty-icon"},[t._v("🛒")]),e("h2",[t._v("购物车是空的")]),e("p",[t._v("快去添加一些商品吧!")]),e("router-link",{staticClass:"shop-now-btn",attrs:{to:"/productList"}},[t._v(" 去购物 ")])],1):e("div",{staticClass:"cart-content"},[e("p",{staticStyle:{color:"#9E44F1","font-size":"14px","margin-bottom":"10px"}},[t._v("注意:各店铺支持多种支付方式,请选择店铺支付方式后提交订单结算")]),e("el-table",{ref:"shopTable",staticStyle:{width:"100%"},attrs:{data:t.shops,border:"","row-key":"id","expand-row-keys":t.expandedShopKeys,"header-cell-style":{textAlign:"left"},"cell-style":{textAlign:"left"}},on:{"expand-change":t.handleShopExpandChange}},[e("el-table-column",{attrs:{type:"expand",width:"46",expandable:()=>!1},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-table",{ref:"innerTable-"+i.row.id,staticStyle:{width:"100%"},attrs:{data:i.row.productMachineDtoList||[],size:"small",border:"","row-key":"id","reserve-selection":"","row-class-name":t.getMachineRowClassName,"header-cell-style":{textAlign:"left"},"cell-style":{textAlign:"left"}},on:{"selection-change":e=>t.handleShopInnerSelectionChange(i.row,e)}},[e("el-table-column",{attrs:{type:"selection",width:"46",selectable:e=>t.isRowSelectableByShop(i.row,e)}}),e("el-table-column",{attrs:{prop:"name",label:"商品名称"}}),e("el-table-column",{attrs:{prop:"type",label:"矿机种类",width:"80"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-tag",{class:["type-tag",t.typeClass(i.row.type)],attrs:{"disable-transitions":""}},[t._v(" "+t._s(t.formatMachineType(i.row.type))+" ")])]}}],null,!0)}),e("el-table-column",{attrs:{prop:"id",label:"机器ID",width:"80"}}),e("el-table-column",{attrs:{prop:"algorithm",label:"最大收益算法"}}),e("el-table-column",{attrs:{label:"可售数量","min-width":"40"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(Number(e.row.canSaleNumbers||0))+" ")]}}],null,!0)}),e("el-table-column",{attrs:{label:"购买数量","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-input-number",{attrs:{min:1,max:t.getRowMaxPurchaseForCart(i.row),precision:0,step:1,size:"mini",controls:!1,disabled:1===Number(i.row.type)},on:{change:e=>t.handleNumbersChange(i.row,e)},model:{value:i.row.numbers,callback:function(e){t.$set(i.row,"numbers",e)},expression:"scope.row.numbers"}})]}}],null,!0)}),e("el-table-column",{attrs:{label:"最大可租(天)","min-width":"50"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(null!=e.row.maxLeaseDays?e.row.maxLeaseDays:""))]}}],null,!0)}),e("el-table-column",{attrs:{label:"租赁天数",width:"145"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-input-number",{attrs:{min:1,max:t.getRowMaxLeaseDaysLocal(i.row),precision:0,step:1,size:"mini","controls-position":"right"},on:{change:function(e){return t.handleLeaseTimeChange(i.row)},input:function(e){return t.handleLeaseTimeInput(i.row,e)}},model:{value:i.row.leaseTime,callback:function(e){t.$set(i.row,"leaseTime",e)},expression:"scope.row.leaseTime"}})]}}],null,!0)}),e("el-table-column",{attrs:{prop:"price",width:"120"},scopedSlots:t._u([{key:"header",fn:function(){return[t._v("单价("+t._s(t.getSelectedCoinSymbolForShop(i.row)||"")+")")]},proxy:!0},{key:"default",fn:function(a){return[null!=t.getMachineUnitPriceBySelection(i.row,a.row)?[e("span",{staticClass:"price-strong"},[t.formatAmount(t.getMachineUnitPriceBySelection(i.row,a.row),t.getSelectedCoinSymbolForShop(i.row)).truncated?e("el-tooltip",{attrs:{content:t.formatAmount(t.getMachineUnitPriceBySelection(i.row,a.row),t.getSelectedCoinSymbolForShop(i.row)).full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(t.getMachineUnitPriceBySelection(i.row,a.row),t.getSelectedCoinSymbolForShop(i.row)).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(" "+t._s(t.formatAmount(t.getMachineUnitPriceBySelection(i.row,a.row),t.getSelectedCoinSymbolForShop(i.row)).text)+" ")])],1)]:[t._v("-")]]}}],null,!0)}),e("el-table-column",{attrs:{label:"机器状态",width:"110"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-tag",{attrs:{type:1===Number(i.row.del)||1===Number(i.row.state)?"info":"success"}},[t._v(" "+t._s(1===Number(i.row.del)||1===Number(i.row.state)?"下架":"上架")+" ")])]}}],null,!0)}),e("el-table-column",{attrs:{"min-width":"120"},scopedSlots:t._u([{key:"header",fn:function(){return[t._v("机器总价("+t._s(t.getSelectedCoinSymbolForShop(i.row)||"")+")")]},proxy:!0},{key:"default",fn:function(a){return[null!=t.getMachineUnitPriceBySelection(i.row,a.row)?[e("span",{staticClass:"price-strong"},[t.formatAmount(t.calculateMachineTotal(t.getMachineUnitPriceBySelection(i.row,a.row),a.row.leaseTime,a.row.numbers),t.getSelectedCoinSymbolForShop(i.row)).truncated?e("el-tooltip",{attrs:{content:t.formatAmount(t.calculateMachineTotal(t.getMachineUnitPriceBySelection(i.row,a.row),a.row.leaseTime,a.row.numbers),t.getSelectedCoinSymbolForShop(i.row)).full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(t.calculateMachineTotal(t.getMachineUnitPriceBySelection(i.row,a.row),a.row.leaseTime,a.row.numbers),t.getSelectedCoinSymbolForShop(i.row)).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(" "+t._s(t.formatAmount(t.calculateMachineTotal(t.getMachineUnitPriceBySelection(i.row,a.row),a.row.leaseTime,a.row.numbers),t.getSelectedCoinSymbolForShop(i.row)).text)+" ")])],1)]:[t._v("-")]]}}],null,!0)})],1)]}}])}),e("el-table-column",{attrs:{label:"店铺名称","min-width":"150"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",[t._v(t._s(i.row.name||i.row.shopName||i.row.shop?.name||"-"))])]}}])}),e("el-table-column",{attrs:{label:"机器总数",width:"100",align:"center"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",[t._v(t._s(t.countMachines(i.row)))])]}}])}),e("el-table-column",{attrs:{"min-width":"150",align:"right"},scopedSlots:t._u([{key:"header",fn:function(){return[e("span",[t._v("总价("+t._s(t.getSelectedCoinSymbolForShopHeader())+")")])]},proxy:!0},{key:"default",fn:function(i){return[e("span",{staticClass:"price-strong"},[t.formatAmount(t.displayShopTotalBySelection(i.row),t.getSelectedCoinSymbolForShop(i.row)).truncated?e("el-tooltip",{attrs:{content:t.formatAmount(t.displayShopTotalBySelection(i.row),t.getSelectedCoinSymbolForShop(i.row)).full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(t.displayShopTotalBySelection(i.row),t.getSelectedCoinSymbolForShop(i.row)).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(" "+t._s(t.formatAmount(t.displayShopTotalBySelection(i.row),t.getSelectedCoinSymbolForShop(i.row)).text)+" ")])],1)]}}])}),e("el-table-column",{attrs:{label:"支付方式"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-select",{staticStyle:{"min-width":"180px"},attrs:{placeholder:"请选择",size:"mini"},on:{change:e=>t.handleShopPayChange(i.row,e)},scopedSlots:t._u([{key:"prefix",fn:function(){return[t.getSelectedPayIcon(i.row)?e("img",{staticStyle:{width:"16px",height:"16px","margin-right":"6px","border-radius":"3px"},attrs:{src:t.getSelectedPayIcon(i.row),alt:t.getSelectedCoinSymbolForShop(i.row)}}):t._e()]},proxy:!0}],null,!0),model:{value:t.paySelectionMap[i.row.id],callback:function(e){t.$set(t.paySelectionMap,i.row.id,e)},expression:"paySelectionMap[scope.row.id]"}},t._l(t.getShopPayOptions(i.row),function(i,a){return e("el-option",{key:a,attrs:{value:i.value,label:i.label}},[e("div",{staticStyle:{display:"flex","align-items":"center",gap:"8px"}},[e("img",{staticStyle:{width:"18px",height:"18px","border-radius":"3px"},attrs:{src:i.icon,alt:i.label}}),e("span",[t._v(t._s(i.label))])])])}),1)]}}])})],1),e("div",{staticClass:"summary-actions",staticStyle:{"margin-top":"16px",display:"flex",gap:"12px","justify-content":"flex-end"}},[e("div",{staticClass:"summary-inline",staticStyle:{color:"#666"}},[t._v(" 已选机器:"),e("b",[t._v(t._s(t.selectedMachineCount))]),t._v(" 台 "),e("span",{staticStyle:{"margin-left":"12px"}},[t._v("金额合计:")]),Object.keys(t.selectedTotalByCoin||{}).length?t._l(t.selectedTotalByCoin,function(i,a){return e("span",{key:a,staticStyle:{"margin-left":"8px"}},[e("span",{staticClass:"price-strong"},[t.formatAmount(i,a).truncated?e("el-tooltip",{attrs:{content:t.formatAmount(i,a).full,placement:"top"}},[e("span",[t._v(" "+t._s(a)+": "+t._s(t.formatAmount(i,a).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(a)+": "+t._s(t.formatAmount(i,a).text))])],1)])}):[e("span",{staticClass:"price-strong"},[t._v("-")])]],2),e("div",{staticClass:"actions-inline",staticStyle:{display:"flex",gap:"12px"}},[e("el-button",{attrs:{type:"danger",disabled:!t.selectedMachineCount},on:{click:t.handleRemoveSelectedMachines}},[t._v("删除所选机器")]),e("el-button",{attrs:{type:"warning",plain:"",loading:t.clearOffLoading},on:{click:t.handleClearOffShelf}},[t._v("清除已下架商品")]),e("el-button",{attrs:{type:"primary",disabled:!t.selectedMachineCount},on:{click:t.handleCheckoutSelected}},[t._v("结算选中机器")])],1)]),e("el-dialog",{attrs:{visible:t.confirmDialog.visible,width:"80vw","close-on-click-modal":!1,title:`确认结算(共 ${t.confirmDialog.count} 台机器)`},on:{"update:visible":function(e){return t.$set(t.confirmDialog,"visible",e)}},scopedSlots:t._u([{key:"footer",fn:function(){return[e("el-button",{on:{click:t.handleConfirmDialogPrev}},[t._v("上一步")]),e("el-button",{on:{click:function(e){t.confirmDialog.visible=!1}}},[t._v("取消")]),e("el-button",{attrs:{type:"primary"},on:{click:t.confirmPay}},[t._v("确认结算")])]},proxy:!0}])},[e("div",[t._l(t.confirmDialog.shops,function(i){return e("div",{key:i.shopId,staticStyle:{"margin-bottom":"18px"}},[e("div",{staticStyle:{display:"flex","align-items":"center","justify-content":"space-between",margin:"8px 0 6px 0"}},[e("div",{staticStyle:{"font-weight":"600",color:"#2c3e50"}},[t._v(" 店铺:"+t._s(i.shopName||i.shopId)+" "),e("span",{staticStyle:{"margin-left":"12px",color:"#666","font-weight":"400"}},[t._v("支付方式:"+t._s(i.payLabel))])]),e("div",[i.coinSymbol?[i.enough?e("span",{staticStyle:{color:"#16a34a","font-weight":"600"}},[t._v(" 已满足起付额 "+t._s(t.formatAmount(i.deductibleAmount||0,i.coinSymbol).text)+" ")]):e("span",{staticStyle:{color:"#ef4444","font-weight":"600"}},[t._v(" 金额不足最低起付额 "+t._s(t.formatAmount(i.deductibleAmount||0,i.coinSymbol).text)+" ,收取手续费 "+t._s(t.formatAmount(i.fee||0,i.coinSymbol).text)+" ")])]:t._e()],2)]),e("el-table",{attrs:{data:i.items,"max-height":"260",border:"",stripe:"","header-cell-style":{textAlign:"left"},"cell-style":{textAlign:"left"}}},[e("el-table-column",{attrs:{label:"矿机种类","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-tag",{class:["type-tag",t.typeClass(i.row.type)],staticStyle:{"font-size":"14px"},attrs:{"disable-transitions":""}},[t._v(" "+t._s(t.formatMachineType(i.row.type))+" ")])]}}],null,!0)}),e("el-table-column",{attrs:{prop:"id",label:"机器ID","min-width":"160"}}),e("el-table-column",{attrs:{prop:"algorithm",label:"最大收益算法","min-width":"140"}}),e("el-table-column",{attrs:{prop:"unitPrice","min-width":"140"},scopedSlots:t._u([{key:"header",fn:function(){return[t._v("单价("+t._s(i.coinSymbol||"")+")")]},proxy:!0},{key:"default",fn:function(a){return[e("span",{staticClass:"price-strong"},[t.formatAmount(a.row.unitPrice,i.coinSymbol).truncated?e("el-tooltip",{attrs:{content:t.formatAmount(a.row.unitPrice,i.coinSymbol).full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(a.row.unitPrice,i.coinSymbol).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatAmount(a.row.unitPrice,i.coinSymbol).text))])],1)]}}],null,!0)}),e("el-table-column",{attrs:{prop:"leaseTime",label:"租赁天数","min-width":"120"}}),e("el-table-column",{attrs:{prop:"numbers",label:"购买数量","min-width":"120"}}),e("el-table-column",{attrs:{prop:"subtotal","min-width":"140"},scopedSlots:t._u([{key:"header",fn:function(){return[t._v("小计("+t._s(i.coinSymbol||"")+")")]},proxy:!0},{key:"default",fn:function(a){return[e("span",{staticClass:"price-strong"},[t.formatAmount(a.row.subtotal,i.coinSymbol).truncated?e("el-tooltip",{attrs:{content:t.formatAmount(a.row.subtotal,i.coinSymbol).full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(a.row.subtotal,i.coinSymbol).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatAmount(a.row.subtotal,i.coinSymbol).text))])],1)]}}],null,!0)})],1)],1)}),e("div",{staticStyle:{"margin-top":"12px","text-align":"right"}},[e("span",{staticStyle:{"margin-right":"8px"}},[t._v("总金额:")]),Object.keys(t.confirmDialog.totalsByCoin||{}).length?t._l(t.confirmDialog.totalsByCoin,function(i,a){return e("span",{key:a,staticStyle:{"margin-left":"12px"}},[t._v(" "+t._s(a)+": "),e("span",{staticClass:"price-strong"},[t.formatAmount(i,a).truncated?e("el-tooltip",{attrs:{content:t.formatAmount(i,a).full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(i,a).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatAmount(i,a).text))])],1)])}):[t._v("-")]],2)],2)]),e("el-dialog",{attrs:{visible:t.noticeDialog.visible,width:"60vw",title:"下单须知","show-close":!1,"close-on-click-modal":!1,"close-on-press-escape":!1},on:{"update:visible":function(e){return t.$set(t.noticeDialog,"visible",e)}},scopedSlots:t._u([{key:"footer",fn:function(){return[e("el-button",{attrs:{type:"primary",disabled:t.noticeDialog.countdown>0},on:{click:t.handleNoticeAcknowledge}},[t._v(" 同意并下单"+t._s(t.noticeDialog.countdown>0?`(${t.noticeDialog.countdown}s)`:"")+" ")])]},proxy:!0}])},[e("div",{staticClass:"notice-content"},[e("p",{staticClass:"notice-title"},[t._v('尊敬的客户,感谢您选择我们的服务。在您下单前,请务必仔细阅读并完全理解以下须知条款。一旦您点击" 同意并下单"或完成支付流程,即视为您已充分阅读、理解并同意接受本须知的全部内容约束。')]),e("ol",{staticClass:"notice-list"},[e("li",[e("b",[t._v("预授权冻结:")]),t._v("为保障订单顺利执行,在下单成功后,系统将立即对您数字钱包或账户中与订单全款总额等值的资金进行预授权冻结。此操作并非即时划转,而是为确保您有足够的资金用于每日支付。")]),e("li",[e("b",[t._v("每日结算支付:")]),t._v('本服务采用"按日结算"模式。冻结的资金将根据租赁协议约定的每日费用,每日自动划转相应的金额给卖家。划转操作通常在每个UTC日结束时自动执行。')]),e("li",[e("b",[t._v("资金解冻:")]),t._v("当租赁服务到期或因其他原因终止后,系统中剩余的、未被划转的冻结资金将立即解除冻结,并返还至您的可用余额中。")]),e("li",[e("b",[t._v("订单生效:")]),t._v(" 您的订单在支付流程完成且资金成功冻结后立即生效。系统将开始为您配置相应的矿机或算力资源。")]),e("li",[e("b",[t._v("不可取消政策:")]),t._v(" 鉴于算力服务一经提供即无法退回的特性,所有订单一旦生效,即不可取消、不可退款、不可转让。您无法在租赁期内单方面中止服务或要求退还已冻结及已支付的费用。")]),e("li",[e("b",[t._v("免责声明:")]),t._v("因不可抗力(如自然灾害、政策变动等)导致订单延迟或无法履行,我们不承担相应责任。")]),e("li",[e("b",[t._v("算力波动:")]),t._v("您所租赁的算力产生的收益取决于区块链网络难度、全球总算力、币价波动、矿池运气等多种外部因素。我们仅提供稳定的算力输出,不对您的最终收益做出任何承诺或保证。")])]),e("p",{staticClass:"notice-title"},[t._v("再次提醒:数字资产挖矿存在较高市场风险,收益波动巨大,过去业绩不代表未来表现。请根据自身的风险承受能力谨慎决策。您下单的行为即代表您已充分了解并自愿承担所有相关风险。")]),e("div",{staticClass:"notice-ack"},[e("el-checkbox",{staticStyle:{color:"#e74c3c"},model:{value:t.noticeDialog.checked,callback:function(e){t.$set(t.noticeDialog,"checked",e)},expression:"noticeDialog.checked"}},[t._v("我已阅读并同意上述注意事项")])],1)])]),e("el-dialog",{attrs:{visible:t.configDialog.visible,width:"80vw",title:"矿机配置","close-on-click-modal":!1,"close-on-press-escape":!1},on:{"update:visible":function(e){return t.$set(t.configDialog,"visible",e)}},scopedSlots:t._u([{key:"footer",fn:function(){return[e("el-button",{on:{click:t.handleConfigPrev}},[t._v("上一步")]),e("el-button",{on:{click:t.handleConfigCancel}},[t._v("取消")]),e("el-button",{attrs:{type:"primary"},on:{click:t.handleConfigConfirm}},[t._v(" "+t._s(t.unconfiguredMachinesList.length>0?"确认配置":"下一步")+" ")])]},proxy:!0}])},[e("div",[t.configDialog.selectedMachines&&t.configDialog.selectedMachines.length>0?e("div",[t.unconfiguredMachinesList.length>0?e("div",{staticStyle:{display:"flex","align-items":"center",gap:"12px","margin-bottom":"12px"}},[e("div",{staticStyle:{"font-weight":"600",color:"#2c3e50"}},[t._v("选择币种/算法")]),e("el-cascader",{staticStyle:{"min-width":"320px"},attrs:{options:t.configDialog.coinAlgoOptions,props:{checkStrictly:!1},clearable:"",placeholder:"请选择币种与算法",size:"small"},on:{change:t.handleCoinAlgoChange},model:{value:t.configDialog.coinAlgoValue,callback:function(e){t.$set(t.configDialog,"coinAlgoValue",e)},expression:"configDialog.coinAlgoValue"}}),e("div",{staticStyle:{"font-weight":"600",color:"#2c3e50","white-space":"nowrap"}},[t._v("选择矿池/模型")]),e("el-cascader",{staticStyle:{width:"240px"},attrs:{options:t.configDialog.poolOptions,props:{checkStrictly:!1},clearable:"",placeholder:"请选择矿池与模型",size:"small",disabled:!t.configDialog.coinAlgoValue||2!==t.configDialog.coinAlgoValue.length},on:{change:t.handlePoolValueChange},model:{value:t.configDialog.poolValue,callback:function(e){t.$set(t.configDialog,"poolValue",e)},expression:"configDialog.poolValue"}})],1):t._e(),t.unconfiguredMachinesList.length>0?e("div",[e("div",{staticStyle:{"font-weight":"600",color:"#2c3e50","margin-bottom":"8px","font-size":"14px"}},[t.configDialog.coinAlgoValue&&2===t.configDialog.coinAlgoValue.length?[t._v(" 支持该币种/算法的机器(共 "+t._s(t.unconfiguredMachinesList.length)+" 台) ")]:[t._v(" 待配置机器(共 "+t._s(t.unconfiguredMachinesList.length)+" 台) ")]],2),e("el-table",{ref:"configTable",attrs:{data:t.unconfiguredMachinesList,"max-height":"300",border:"",stripe:"","row-key":"id","reserve-selection":"","header-cell-style":{textAlign:"left",fontSize:"14px"},"cell-style":{textAlign:"left",fontSize:"14px"}},on:{"selection-change":t.handleConfigSelectionChange}},[e("el-table-column",{attrs:{type:"selection",width:"46"}}),e("el-table-column",{attrs:{label:"矿机种类",width:"120"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-tag",{class:["type-tag",t.typeClass(i.row.type)],staticStyle:{"font-size":"14px"},attrs:{"disable-transitions":""}},[t._v(" "+t._s(t.formatMachineType(i.row.type))+" ")])]}}],null,!1,2555332731)}),e("el-table-column",{attrs:{prop:"id",label:"机器ID",width:"120"}}),e("el-table-column",{attrs:{prop:"algorithm",label:"最大收益算法","min-width":"140"}}),null!==t.getCurrentWalletMining()?e("el-table-column",{attrs:{label:"矿工号","min-width":"160"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-input",{attrs:{placeholder:"矿工号",size:"mini",clearable:"",maxlength:"40"},on:{input:e=>t.handleMachineWorkerIdInput(i.row,e)},model:{value:i.row._workerId,callback:function(e){t.$set(i.row,"_workerId",e)},expression:"scope.row._workerId"}})]}}],null,!1,46571769)}):t._e()],1)],1):t._e(),null!==t.getCurrentWalletMining()?e("div",{staticStyle:{"margin-top":"16px"}},[!0===t.getCurrentWalletMining()?e("div",{staticStyle:{display:"flex","align-items":"center",gap:"12px"}},[e("label",{staticStyle:{"font-weight":"600",color:"#2c3e50","min-width":"100px"}},[t._v("钱包地址:")]),e("el-input",{staticStyle:{flex:"1","max-width":"500px"},attrs:{placeholder:"请输入钱包地址",clearable:"",maxlength:"95"},on:{input:t.handleWalletAddressInput},model:{value:t.configDialog.walletAddress,callback:function(e){t.$set(t.configDialog,"walletAddress",e)},expression:"configDialog.walletAddress"}})],1):t._e(),!1===t.getCurrentWalletMining()?e("div",{staticStyle:{display:"flex","align-items":"center",gap:"12px"}},[e("label",{staticStyle:{"font-weight":"600",color:"#2c3e50","min-width":"100px"}},[t._v("挖矿账户:")]),e("el-input",{staticStyle:{flex:"1","max-width":"500px"},attrs:{placeholder:"请输入挖矿账户",clearable:"",maxlength:"40"},on:{input:t.handleMiningAccountInput},model:{value:t.configDialog.miningAccount,callback:function(e){t.$set(t.configDialog,"miningAccount",e)},expression:"configDialog.miningAccount"}})],1):t._e()]):t.configDialog.coinAlgoValue&&2===t.configDialog.coinAlgoValue.length&&null===t.getCurrentWalletMining()?e("div",{staticStyle:{"margin-top":"16px",color:"#909399","font-size":"14px"}},[t._v(" 请先选择矿池/模型 ")]):t.configDialog.coinAlgoValue&&2===t.configDialog.coinAlgoValue.length&&0===t.unconfiguredMachinesList.length?e("div",{staticStyle:{"margin-bottom":"12px",color:"#909399","font-size":"14px"}},[t._v(" 当前选择的币种/算法下没有可配置的机器 ")]):t._e(),t.unsupportedMachinesList.length>0?e("div",{staticStyle:{"margin-top":"16px"}},[e("div",{staticStyle:{"font-weight":"600",color:"#f56c6c","margin-bottom":"8px","font-size":"14px"}},[t._v(" 不支持该币种/算法的机器(共 "+t._s(t.unsupportedMachinesList.length)+" 台) ")]),e("el-table",{attrs:{data:t.unsupportedMachinesList,"max-height":"200",border:"",stripe:"","header-cell-style":{textAlign:"left",fontSize:"14px"},"cell-style":{textAlign:"left",fontSize:"14px"}}},[e("el-table-column",{attrs:{label:"矿机种类",width:"120"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-tag",{class:["type-tag",t.typeClass(i.row.type)],staticStyle:{"font-size":"14px"},attrs:{"disable-transitions":""}},[t._v(" "+t._s(t.formatMachineType(i.row.type))+" ")])]}}],null,!1,2555332731)}),e("el-table-column",{attrs:{prop:"id",label:"机器ID",width:"120"}}),e("el-table-column",{attrs:{prop:"algorithm",label:"最大收益算法","min-width":"140"}})],1)],1):t._e()]):t._e(),t.configDialog.configuredMachines.length>0?e("div",{staticStyle:{"margin-top":"24px"}},[e("div",{staticStyle:{"font-weight":"600",color:"#2c3e50","margin-bottom":"12px","font-size":"16px"}},[t._v("已配置机器")]),e("el-table",{attrs:{data:t.configDialog.configuredMachines,"max-height":"300",border:"",stripe:"","header-cell-style":{textAlign:"left",fontSize:"14px"},"cell-style":{textAlign:"left",fontSize:"14px"}}},[e("el-table-column",{attrs:{label:"矿机种类",width:"120"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-tag",{class:["type-tag",t.typeClass(i.row.type)],staticStyle:{"font-size":"14px"},attrs:{"disable-transitions":""}},[t._v(" "+t._s(t.formatMachineType(i.row.type))+" ")])]}}],null,!1,2555332731)}),e("el-table-column",{attrs:{prop:"id",label:"机器ID",width:"120"}}),e("el-table-column",{attrs:{prop:"coin",label:"币种",width:"120"}}),e("el-table-column",{attrs:{prop:"algorithm",label:"算法","min-width":"140"}}),e("el-table-column",{attrs:{prop:"poolName",label:"矿池","min-width":"140"}}),e("el-table-column",{attrs:{prop:"modelName",label:"模型","min-width":"140"}}),e("el-table-column",{attrs:{label:"钱包地址","min-width":"200"},scopedSlots:t._u([{key:"default",fn:function(i){return[i.row.walletAddress?e("el-tooltip",{attrs:{content:i.row.walletAddress,placement:"top"}},[e("span",{staticClass:"mono-ellipsis",staticStyle:{"font-family":"monospace"}},[t._v(t._s(t.formatWalletAddress(i.row.walletAddress)))])]):e("span",[t._v("-")])]}}],null,!1,2449193566)}),t.hasConfiguredMiningAccount?e("el-table-column",{attrs:{prop:"miningAccount",label:"挖矿账户","min-width":"140"}}):t._e(),t.hasConfiguredWorkerId?e("el-table-column",{attrs:{prop:"workerId",label:"矿工号","min-width":"140"}}):t._e()],1)],1):t._e()])]),e("el-dialog",{attrs:{visible:t.googleCodeDialog.visible,width:"480px",title:"安全验证","show-close":!1,"close-on-click-modal":!1,"close-on-press-escape":!1},on:{"update:visible":function(e){return t.$set(t.googleCodeDialog,"visible",e)}},scopedSlots:t._u([{key:"footer",fn:function(){return[e("div",{staticClass:"dialog-footer"},[e("el-button",{on:{click:t.handleGoogleCodePrev}},[t._v("上一步")]),e("el-button",{on:{click:t.handleGoogleCodeCancel}},[t._v("取消")]),e("el-button",{attrs:{type:"primary",loading:t.googleCodeDialog.loading,disabled:!t.isGoogleCodeValid},on:{click:t.handleGoogleCodeSubmit}},[t._v(" "+t._s(t.googleCodeDialog.loading?"验证中...":"确认验证")+" ")])],1)]},proxy:!0}])},[e("div",{staticClass:"google-code-content"},[e("div",{staticClass:"verification-icon"},[e("i",{staticClass:"el-icon-lock",staticStyle:{"font-size":"48px",color:"#409EFF"}})]),e("div",{staticClass:"verification-title"},[e("h3",[t._v("请输入谷歌验证码")]),e("p",{staticClass:"verification-desc"},[t._v("为了保障您的账户安全,请输入您的谷歌验证器中的6位验证码")])]),e("div",{staticClass:"code-input-wrapper"},[e("el-input",{ref:"googleCodeInput",staticClass:"code-input",attrs:{placeholder:"请输入6位验证码",maxlength:"6",size:"large"},on:{input:t.handleGoogleCodeInput},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleGoogleCodeSubmit.apply(null,arguments)}},scopedSlots:t._u([{key:"prepend",fn:function(){return[e("i",{staticClass:"el-icon-key"})]},proxy:!0}]),model:{value:t.googleCodeDialog.code,callback:function(e){t.$set(t.googleCodeDialog,"code",e)},expression:"googleCodeDialog.code"}})],1),t.googleCodeDialog.error?e("div",{staticClass:"code-error"},[e("i",{staticClass:"el-icon-warning"}),e("span",[t._v(t._s(t.googleCodeDialog.error))])]):t._e()])])],1),e("el-dialog",{attrs:{visible:t.settlementSuccessfulVisible,width:"480px","append-to-body":"","close-on-click-modal":!1,"close-on-press-escape":!1},on:{"update:visible":function(e){t.settlementSuccessfulVisible=e},close:t.handleCloseSuccessDialog},scopedSlots:t._u([{key:"footer",fn:function(){return[e("el-button",{attrs:{type:"primary"},on:{click:t.handleCloseSuccessDialog}},[t._v("已知晓")])]},proxy:!0}])},[e("div",{staticStyle:{"text-align":"center",padding:"20px 0"}},[e("div",{staticStyle:{"font-size":"48px",color:"#52c41a","margin-bottom":"16px"}},[t._v("✓")]),e("div",{staticStyle:{"font-size":"18px",color:"#333","margin-bottom":"12px"}},[t._v("请求结算处理成功")]),e("div",{staticStyle:{color:"#666","line-height":"1.6"}},[t._v(" 请在订单列表页面查看结算状态"),e("br"),t._v(" 结算成功会自动更新钱包余额 ")])])])],1)},e.Yp=[]},669:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(4749),s=i(8567),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"44221ada",null),l=n.exports},799:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.statusLoading,expression:"statusLoading"}],staticClass:"security-settings"},[e("div",{staticClass:"security-item-wrapper"},[e("div",{staticClass:"security-item"},[t._m(0),e("div",{staticClass:"security-right"},[e("span",{staticClass:"security-status",class:t.getStatusClass},[t._v(" "+t._s(t.getStatusText)+" ")]),e("el-button",{staticClass:"security-btn two-factor-btn",attrs:{type:"text",loading:t.loading},on:{click:t.handleButtonClick}},[t._v(" "+t._s(t.getButtonText)+" ")])],1)]),e("div",{staticClass:"security-divider"})]),e("div",{staticClass:"security-item-wrapper"},[e("div",{staticClass:"security-item"},[t._m(1),e("div",{staticClass:"security-right"},[e("el-button",{staticClass:"security-btn change-password-btn",attrs:{type:"text"},on:{click:t.handleChangePassword}},[t._v(" 修改 ")])],1)]),e("div",{staticClass:"security-divider"})]),e("div",{staticClass:"security-item-wrapper"},[e("div",{staticClass:"security-item"},[t._m(2),e("div",{staticClass:"security-right"},[e("el-button",{staticClass:"security-btn delete-account-btn",attrs:{type:"text"},on:{click:t.handleDeleteAccount}},[t._v(" 注销 ")])],1)]),e("div",{staticClass:"security-divider"})]),e("el-dialog",{attrs:{title:"开启双重验证 - 步骤 1/2",visible:t.step1Visible,width:"600px","close-on-click-modal":!1},on:{"update:visible":function(e){t.step1Visible=e},close:t.handleStep1Close}},[e("div",{staticClass:"step1-content"},[e("div",{staticClass:"instruction-text"},[e("p",[t._v("请使用您手机上的谷歌身份验证器 (Google Authenticator) 或其它兼容应用程序扫描下方二维码,也可手动输入以下密钥。")])]),e("div",{staticClass:"qr-section"},[t.qrCodeUrl?e("div",{staticClass:"qr-code-wrapper"},[e("img",{staticClass:"qr-code",attrs:{src:t.getQrCodeSrc,alt:"二维码"}})]):e("div",{staticClass:"qr-loading"},[e("i",{staticClass:"el-icon-loading"}),e("span",[t._v("加载中...")])])]),e("div",{staticClass:"secret-key-section"},[e("div",{staticClass:"secret-key-label"},[t._v("或手动输入密钥:")]),e("div",{staticClass:"secret-key-input-group"},[e("el-input",{staticClass:"secret-key-input",attrs:{readonly:""},model:{value:t.secretKey,callback:function(e){t.secretKey=e},expression:"secretKey"}}),e("el-button",{attrs:{type:"primary",disabled:!t.secretKey},on:{click:t.handleCopySecret}},[t._v(" 复制 ")])],1)]),e("div",{staticClass:"warning-box"},[e("i",{staticClass:"el-icon-warning"}),e("div",{staticClass:"warning-text"},[e("p",[t._v("请妥善保存密钥,避免被盗或丢失。如遇手机丢失等情况,可通过该密钥恢复您的谷歌验证。如密钥丢失,需要提交工单通过人工客服重置,处理时间需7天。")])])])]),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.step1Visible=!1}}},[t._v("取消")]),e("el-button",{attrs:{type:"primary",disabled:!t.qrCodeUrl||!t.secretKey},on:{click:t.handleNextToStep2}},[t._v(" 下一步 ")])],1)]),e("el-dialog",{attrs:{title:"开启双重验证 - 步骤 2/2",visible:t.step2Visible,width:"500px","close-on-click-modal":!1},on:{"update:visible":function(e){t.step2Visible=e},close:t.handleStep2Close}},[e("el-form",{ref:"verifyForm",attrs:{model:t.verifyForm,rules:t.verifyRules,"label-position":"top"}},[e("el-form-item",{attrs:{label:"登录密码",prop:"password"}},[e("el-input",{attrs:{type:"password",placeholder:"请输入密码(8-32位)","show-password":"",clearable:""},model:{value:t.verifyForm.password,callback:function(e){t.$set(t.verifyForm,"password",e)},expression:"verifyForm.password"}}),e("div",{staticClass:"password-tip"},[e("i",{staticClass:"el-icon-info"}),e("span",[t._v("密码需包含大小写字母、数字和特殊字符,长度8-32位")])])],1),e("el-form-item",{attrs:{label:"邮箱验证码",prop:"emailCode"}},[e("div",{staticClass:"code-input-group"},[e("el-input",{staticClass:"code-input",attrs:{placeholder:"请输入邮箱验证码",maxlength:"10",clearable:""},model:{value:t.verifyForm.emailCode,callback:function(e){t.$set(t.verifyForm,"emailCode",e)},expression:"verifyForm.emailCode"}}),e("el-button",{attrs:{type:"primary",loading:t.sendingCode,disabled:t.countdown>0},on:{click:t.handleSendEmailCode}},[t._v(" "+t._s(t.countdown>0?`${t.countdown}秒后重试`:"发送验证码")+" ")])],1),e("div",{staticClass:"help-link"},[e("a",{attrs:{href:"javascript:void(0)"},on:{click:t.handleCannotGetCode}},[t._v("无法获取验证码?")])])]),e("el-form-item",{attrs:{label:"谷歌验证码",prop:"googleCode"}},[e("el-input",{attrs:{placeholder:"请输入6位动态口令",maxlength:"6"},on:{input:t.handleGoogleCodeInput},model:{value:t.verifyForm.googleCode,callback:function(e){t.$set(t.verifyForm,"googleCode",e)},expression:"verifyForm.googleCode"}}),e("div",{staticClass:"help-link"},[e("a",{attrs:{href:"javascript:void(0)"},on:{click:t.handleCannotGetGoogleCode}},[t._v("无法获取验证码?")])])],1)],1),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:t.handleBackToStep1}},[t._v("上一步")]),e("el-button",{attrs:{type:"primary",loading:t.submitting},on:{click:t.handleConfirm}},[t._v(" 确定 ")])],1)],1),e("el-dialog",{attrs:{title:"关闭双重验证",visible:t.closeDialogVisible,width:"500px","close-on-click-modal":!1},on:{"update:visible":function(e){t.closeDialogVisible=e},close:t.handleCloseDialogClose}},[e("el-form",{ref:"closeForm",attrs:{model:t.closeForm,rules:t.closeRules,"label-position":"top"}},[e("el-form-item",{attrs:{label:"邮箱验证码",prop:"emailCode"}},[e("div",{staticClass:"code-input-group"},[e("el-input",{staticClass:"code-input",attrs:{placeholder:"请输入邮箱验证码",maxlength:"10",clearable:""},model:{value:t.closeForm.emailCode,callback:function(e){t.$set(t.closeForm,"emailCode",e)},expression:"closeForm.emailCode"}}),e("el-button",{attrs:{type:"primary",loading:t.sendingCloseCode,disabled:t.closeCountdown>0},on:{click:t.handleSendCloseEmailCode}},[t._v(" "+t._s(t.closeCountdown>0?`${t.closeCountdown}秒后重试`:"发送验证码")+" ")])],1)]),e("el-form-item",{attrs:{label:"谷歌验证码",prop:"googleCode"}},[e("el-input",{attrs:{placeholder:"请输入6位动态口令",maxlength:"6",clearable:""},on:{input:t.handleCloseGoogleCodeInput},model:{value:t.closeForm.googleCode,callback:function(e){t.$set(t.closeForm,"googleCode",e)},expression:"closeForm.googleCode"}})],1)],1),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.closeDialogVisible=!1}}},[t._v("取消")]),e("el-button",{attrs:{type:"primary",loading:t.closing},on:{click:t.handleConfirmClose}},[t._v(" 确定 ")])],1)],1),e("el-dialog",{attrs:{title:"开启双重验证",visible:t.openDialogVisible,width:"500px","close-on-click-modal":!1},on:{"update:visible":function(e){t.openDialogVisible=e},close:t.handleOpenDialogClose}},[e("el-form",{ref:"openForm",attrs:{model:t.openForm,rules:t.openRules,"label-position":"top"}},[e("el-form-item",{attrs:{label:"邮箱验证码",prop:"emailCode"}},[e("div",{staticClass:"code-input-group"},[e("el-input",{staticClass:"code-input",attrs:{placeholder:"请输入邮箱验证码",maxlength:"10",clearable:""},model:{value:t.openForm.emailCode,callback:function(e){t.$set(t.openForm,"emailCode",e)},expression:"openForm.emailCode"}}),e("el-button",{attrs:{type:"primary",loading:t.sendingOpenCode,disabled:t.openCountdown>0},on:{click:t.handleSendOpenEmailCode}},[t._v(" "+t._s(t.openCountdown>0?`${t.openCountdown}秒后重试`:"发送验证码")+" ")])],1)]),e("el-form-item",{attrs:{label:"谷歌验证码",prop:"googleCode"}},[e("el-input",{attrs:{placeholder:"请输入6位动态口令",maxlength:"6",clearable:""},on:{input:t.handleOpenGoogleCodeInput},model:{value:t.openForm.googleCode,callback:function(e){t.$set(t.openForm,"googleCode",e)},expression:"openForm.googleCode"}})],1)],1),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.openDialogVisible=!1}}},[t._v("取消")]),e("el-button",{attrs:{type:"primary",loading:t.opening},on:{click:t.handleConfirmOpen}},[t._v(" 确定 ")])],1)],1),e("el-dialog",{attrs:{title:"修改密码",visible:t.changePasswordDialogVisible,width:"500px","close-on-click-modal":!1},on:{"update:visible":function(e){t.changePasswordDialogVisible=e},close:t.handleChangePasswordDialogClose}},[e("el-form",{ref:"changePasswordForm",attrs:{model:t.changePasswordForm,rules:t.changePasswordRules,"label-position":"top"}},[e("el-form-item",{attrs:{label:"用户邮箱"}},[e("el-input",{staticClass:"email-display",attrs:{value:t.userEmail,readonly:"",disabled:""}})],1),e("el-form-item",{attrs:{label:"邮箱验证码",prop:"emailCode"}},[e("div",{staticClass:"code-input-group"},[e("el-input",{staticClass:"code-input",attrs:{placeholder:"请输入邮箱验证码",maxlength:"10",clearable:""},model:{value:t.changePasswordForm.emailCode,callback:function(e){t.$set(t.changePasswordForm,"emailCode",e)},expression:"changePasswordForm.emailCode"}}),e("el-button",{attrs:{type:"primary",loading:t.sendingChangePasswordCode,disabled:t.changePasswordCountdown>0},on:{click:t.handleSendChangePasswordCode}},[t._v(" "+t._s(t.changePasswordCountdown>0?`${t.changePasswordCountdown}秒后重试`:"获取验证码")+" ")])],1)]),e("el-form-item",{attrs:{label:"新密码",prop:"password"}},[e("el-input",{attrs:{type:"password",placeholder:"请输入新密码(8-32位)","show-password":"",clearable:""},model:{value:t.changePasswordForm.password,callback:function(e){t.$set(t.changePasswordForm,"password",e)},expression:"changePasswordForm.password"}}),e("div",{staticClass:"password-tip"},[e("i",{staticClass:"el-icon-info"}),e("span",[t._v("密码需包含大小写字母、数字和特殊字符,长度8-32位")])])],1),e("el-form-item",{attrs:{label:"确认新密码",prop:"confirmPassword"}},[e("el-input",{attrs:{type:"password",placeholder:"请再次输入新密码","show-password":"",clearable:""},model:{value:t.changePasswordForm.confirmPassword,callback:function(e){t.$set(t.changePasswordForm,"confirmPassword",e)},expression:"changePasswordForm.confirmPassword"}})],1),e("el-form-item",{attrs:{label:"谷歌验证码",prop:"googleCode"}},[e("el-input",{attrs:{placeholder:"请输入6位动态口令",maxlength:"6",clearable:""},on:{input:t.handleChangePasswordGoogleCodeInput},model:{value:t.changePasswordForm.googleCode,callback:function(e){t.$set(t.changePasswordForm,"googleCode",e)},expression:"changePasswordForm.googleCode"}})],1)],1),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.changePasswordDialogVisible=!1}}},[t._v("取消")]),e("el-button",{attrs:{type:"primary",loading:t.changingPassword},on:{click:t.handleConfirmChangePassword}},[t._v(" 确认修改 ")])],1)],1),e("el-dialog",{attrs:{title:"注销账号",visible:t.deleteAccountDialogVisible,width:"500px","close-on-click-modal":!1},on:{"update:visible":function(e){t.deleteAccountDialogVisible=e},close:t.handleDeleteAccountDialogClose}},[e("el-form",{ref:"deleteAccountForm",attrs:{model:t.deleteAccountForm,rules:t.deleteAccountRules,"label-position":"top"}},[e("el-form-item",{attrs:{label:"用户邮箱"}},[e("el-input",{staticClass:"email-display",attrs:{value:t.userEmail,readonly:"",disabled:""}})],1),e("el-form-item",{attrs:{label:"邮箱验证码",prop:"emailCode"}},[e("div",{staticClass:"code-input-group"},[e("el-input",{staticClass:"code-input",attrs:{placeholder:"请输入邮箱验证码",maxlength:"10",clearable:""},model:{value:t.deleteAccountForm.emailCode,callback:function(e){t.$set(t.deleteAccountForm,"emailCode",e)},expression:"deleteAccountForm.emailCode"}}),e("el-button",{attrs:{type:"primary",loading:t.sendingDeleteAccountCode,disabled:t.deleteAccountCountdown>0},on:{click:t.handleSendDeleteAccountCode}},[t._v(" "+t._s(t.deleteAccountCountdown>0?`${t.deleteAccountCountdown}秒后重试`:"获取验证码")+" ")])],1)]),e("el-form-item",{attrs:{label:"谷歌验证码",prop:"googleCode"}},[e("el-input",{attrs:{placeholder:"请输入6位动态口令",maxlength:"6",clearable:""},on:{input:t.handleDeleteAccountGoogleCodeInput},model:{value:t.deleteAccountForm.googleCode,callback:function(e){t.$set(t.deleteAccountForm,"googleCode",e)},expression:"deleteAccountForm.googleCode"}})],1)],1),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.deleteAccountDialogVisible=!1}}},[t._v("取消")]),e("el-button",{attrs:{type:"danger",loading:t.deletingAccount},on:{click:t.handleConfirmDeleteAccount}},[t._v(" 确定注销 ")])],1)],1)],1)},e.Yp=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"security-left"},[e("div",{staticClass:"security-icon"},[e("i",{staticClass:"el-icon-lock"})]),e("div",{staticClass:"security-info"},[e("div",{staticClass:"security-title"},[t._v("双重验证")]),e("p",{staticClass:"security-desc"},[t._v("用于登录帐户、结算订单、提现、修改登录密码等,涉及账户安全的重要操作。")])])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"security-left"},[e("div",{staticClass:"security-icon"},[e("i",{staticClass:"el-icon-edit"})]),e("div",{staticClass:"security-info"},[e("div",{staticClass:"security-title"},[t._v("修改密码")]),e("p",{staticClass:"security-desc"},[t._v("定期修改密码可以提高账户安全性,建议使用强密码并定期更换。")])])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"security-left"},[e("div",{staticClass:"security-icon"},[e("i",{staticClass:"el-icon-warning"})]),e("div",{staticClass:"security-info"},[e("div",{staticClass:"security-title"},[t._v("注销账号")]),e("p",{staticClass:"security-desc"},[t._v("注销账号将永久删除您的账户和所有相关数据,此操作不可恢复,请谨慎操作。")])])])}]},954:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"wallet-container"},[e("div",{staticClass:"wallet-toolbar",attrs:{role:"region","aria-label":"钱包操作"}},[e("el-button",{staticClass:"create-wallet-btn",attrs:{type:"primary"},on:{click:t.openCreateWallet}},[e("i",{staticClass:"el-icon-plus",staticStyle:{"margin-right":"6px"}}),t._v("充值 ")])],1),e("section",{staticClass:"wallet-card-section"},t._l(t.walletList,function(i){return e("div",{key:i.id,staticClass:"wallet-card"},[e("div",{staticClass:"wallet-header"},[e("h2",{staticClass:"wallet-title"},[e("i",{staticClass:"el-icon-wallet"}),t._v(" 我的钱包 "),e("el-tag",{staticStyle:{"margin-left":"8px"},attrs:{size:"mini",effect:"dark"}},[t._v(" "+t._s((i.fromChain||i.chain||"").toUpperCase())+" "+t._s((i.fromSymbol||i.coin||"").toUpperCase())+" ")])],1),e("div",{staticClass:"wallet-balance"},[e("div",{staticClass:"balance-item"},[e("span",{staticClass:"balance-label"},[t._v("可用余额")]),e("span",{staticClass:"balance-amount"},[t._v(t._s(i.walletBalance||i.balance||0)+" "+t._s(t.displaySymbol(i)))])]),e("div",{staticClass:"balance-item"},[e("el-tooltip",{attrs:{placement:"top",effect:"dark"}},[e("div",{attrs:{slot:"content"},slot:"content"},[t._v(" 冻结金额不能使用或提现,以下情况会冻结钱包余额:"),e("br"),t._v(" 1. 下单机器后会冻结订单对应金额"),e("br"),t._v(" 2. 提交提现后,金额正在提现中 ")]),e("i",{staticClass:"el-icon-question balance-tip-icon"})]),e("span",{staticClass:"balance-label"},[t._v("冻结余额")]),e("span",{staticClass:"balance-amount frozen"},[t._v(t._s(i.blockedBalance||0)+" "+t._s(t.displaySymbol(i)))])],1),e("el-button",{staticClass:"withdraw-inline-btn",attrs:{type:"success",size:"mini"},on:{click:function(e){return t.handleWithdraw(i)}}},[t._v(" 提现 ")])],1)])])}),0),e("div",{staticClass:"transaction-section"},[e("h3",{staticClass:"section-title"},[t._v("最近交易")]),e("div",{staticClass:"transaction-list"},[t._l(t.recentTransactions,function(i){return e("div",{key:i.id,staticClass:"transaction-item"},[e("div",{staticClass:"transaction-info"},[e("span",{staticClass:"transaction-type"},[t._v(t._s(i.type))]),e("span",{staticClass:"transaction-time"},[t._v(t._s(i.time))]),e("el-tag",{staticClass:"transaction-status",attrs:{size:"mini",type:i.statusTagType||"info"}},[t._v(" "+t._s(i.statusText||"-")+" ")])],1),e("div",{staticClass:"transaction-amount",class:i.amount>0?"positive":"negative"},[t._v(" "+t._s(i.amount>0?"+":"")+t._s(i.amountText)),i.coin?e("span",[t._v(" "+t._s(i.coin))]):t._e()])])}),0===t.recentTransactions.length?e("div",{staticClass:"empty-state"},[t._v(" 暂无交易记录 ")]):t._e()],2)]),e("el-dialog",{attrs:{title:"钱包余额充值",visible:t.rechargeDialogVisible,width:"660px"},on:{"update:visible":function(e){t.rechargeDialogVisible=e},close:t.resetRechargeForm}},[e("div",{staticClass:"recharge-content"},[e("div",{staticClass:"wallet-address-section"},[e("h4",{staticClass:"section-title"},[t._v("钱包地址")]),e("div",{staticClass:"charge-meta"},[e("el-tag",{staticClass:"meta-tag",attrs:{size:"small",effect:"dark",type:"warning"}},[e("i",{staticClass:"el-icon-link"}),e("span",{staticClass:"meta-title"},[t._v("充值链:")]),e("span",{staticClass:"meta-val"},[t._v(t._s((t.WalletData.fromChain||t.WalletData.chain||"").toString().toUpperCase()))])]),e("el-tag",{staticClass:"meta-tag",attrs:{size:"small",effect:"dark",type:"warning"}},[e("i",{staticClass:"el-icon-coin"}),e("span",{staticClass:"meta-title"},[t._v("充值币种:")]),e("span",{staticClass:"meta-val"},[t._v(t._s((t.WalletData.fromSymbol||t.WalletData.coin||"").toString().toUpperCase()))])])],1),e("div",{staticClass:"address-container"},[e("el-input",{staticClass:"address-input",attrs:{readonly:"",disabled:!0},model:{value:t.WalletData.fromAddress,callback:function(e){t.$set(t.WalletData,"fromAddress",e)},expression:"WalletData.fromAddress"}}),e("el-button",{staticClass:"copy-btn",attrs:{type:"primary",size:"small"},on:{click:function(e){return t.copyAddress(t.WalletData.fromAddress)}}},[t._v(" 复制 ")])],1),e("p",{staticClass:"address-tip"},[t._v("请向此地址转账非"+t._s(t.displaySymbol(t.WalletData))+"资产,否则资产将无法找回.")])]),e("div",{staticClass:"qr-code-section"},[e("h4",{staticClass:"section-title"},[t._v("扫码充值")]),e("div",{staticClass:"qr-code-container"},[e("div",{ref:"qrCodeRef",staticClass:"qr-code"}),e("p",{staticClass:"qr-tip"},[t._v("使用支持"+t._s(t.displaySymbol(t.WalletData))+"的钱包扫描二维码")])])]),e("div",{staticClass:"recharge-notice"},[e("h4",{staticClass:"section-title"},[t._v("充值说明")]),e("ul",{staticClass:"notice-list"},[e("li",[t._v("充值后请耐心等待余额更新或在资金流水页面查看最新充值记录")]),e("li",[t._v("最小充值金额:10 "+t._s(t.displaySymbol(t.WalletData)))])])])]),e("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.rechargeDialogVisible=!1}}},[t._v("关闭")])],1)]),e("el-dialog",{attrs:{title:"提现",visible:t.withdrawDialogVisible,width:"720px","close-on-click-modal":!1,"close-on-press-escape":!1},on:{"update:visible":function(e){t.withdrawDialogVisible=e},close:t.resetWithdrawForm}},[e("el-form",{ref:"withdrawForm",attrs:{model:t.withdrawForm,rules:t.withdrawRules,"label-width":"120px"}},[e("el-form-item",{attrs:{label:"提现链"}},[e("el-input",{staticStyle:{width:"100%"},attrs:{value:(t.WalletData.fromChain||t.WalletData.chain||t.withdrawForm.toChain||"").toString().toUpperCase(),disabled:!0}})],1),e("el-form-item",{attrs:{label:"提现币种"}},[e("el-input",{staticStyle:{width:"100%"},attrs:{value:t.displayWithdrawSymbol,disabled:!0}})],1),e("el-form-item",{attrs:{label:"提现金额",prop:"amount"}},[e("el-input",{staticStyle:{width:"100%"},attrs:{placeholder:"请输入提现金额",inputmode:"decimal"},on:{input:t.handleAmountInput},model:{value:t.withdrawForm.amount,callback:function(e){t.$set(t.withdrawForm,"amount",e)},expression:"withdrawForm.amount"}},[e("template",{slot:"append"},[t._v(t._s(t.displayWithdrawSymbol))])],2),e("div",{staticClass:"balance-info"},[e("div",{staticClass:"balance-total"},[t._v("钱包总余额:"+t._s(t.totalBalance)+" "+t._s(t.displayWithdrawSymbol))]),e("div",{staticClass:"balance-row"},[e("span",[t._v("可用余额:"+t._s(t.availableWithdrawBalance)+" "+t._s(t.displayWithdrawSymbol))]),e("span",{staticClass:"divider"},[t._v("|")]),e("span",{staticClass:"frozen-info"},[e("el-tooltip",{attrs:{placement:"top",effect:"dark"}},[e("div",{attrs:{slot:"content"},slot:"content"},[t._v(" 冻结金额不能使用或提现,以下情况会冻结钱包余额:"),e("br"),t._v(" 1. 下单机器后会冻结订单对应金额"),e("br"),t._v(" 2. 提交提现后,金额正在提现中 ")]),e("i",{staticClass:"el-icon-question frozen-tip-icon"})]),t._v(" 冻结余额:"+t._s(t.WalletData.blockedBalance||0)+" "+t._s(t.displayWithdrawSymbol)+" "),e("span",{staticClass:"frozen-tip"},[t._v("(购买机器下单后冻结,不可提现)")])],1)])])],1),e("el-form-item",{attrs:{label:"手续费"}},[e("el-input",{staticStyle:{width:"100%"},attrs:{placeholder:"手续费",disabled:!0},model:{value:t.withdrawForm.fee,callback:function(e){t.$set(t.withdrawForm,"fee",e)},expression:"withdrawForm.fee"}},[e("template",{slot:"append"},[t._v(t._s(t.displayWithdrawSymbol))])],2),e("div",{staticClass:"fee-info"},[t._v(" 网络手续费:"+t._s(t.withdrawForm.fee||"0.00")+" "+t._s(t.displayWithdrawSymbol)+" ")])],1),e("el-form-item",{attrs:{label:"实际到账"}},[e("el-input",{staticStyle:{width:"100%"},attrs:{placeholder:"实际到账金额",disabled:!0},model:{value:t.actualAmount,callback:function(e){t.actualAmount=e},expression:"actualAmount"}},[e("template",{slot:"append"},[t._v(t._s(t.displayWithdrawSymbol))])],2),e("div",{staticClass:"actual-amount-info"},[t._v(" 实际到账:"+t._s(t.actualAmount)+" "+t._s(t.displayWithdrawSymbol)+" ")])],1),e("el-form-item",{attrs:{label:"收款地址",prop:"toAddress"}},[e("el-input",{staticStyle:{width:"100%"},attrs:{type:"textarea",rows:3,placeholder:"请输入收款钱包地址"},model:{value:t.withdrawForm.toAddress,callback:function(e){t.$set(t.withdrawForm,"toAddress",e)},expression:"withdrawForm.toAddress"}}),e("div",{staticClass:"address-tip"},[t._v(" 请确保地址正确,错误地址将导致资产丢失 ")])],1),e("el-form-item",{attrs:{label:"谷歌验证码",prop:"googleCode"}},[e("el-input",{ref:"googleCodeInput",staticStyle:{width:"100%"},attrs:{placeholder:"请输入6位谷歌验证码",maxlength:"6"},on:{input:t.handleGoogleCodeInput},model:{value:t.withdrawForm.googleCode,callback:function(e){t.$set(t.withdrawForm,"googleCode",e)},expression:"withdrawForm.googleCode"}},[e("template",{slot:"prepend"},[e("i",{staticClass:"el-icon-key"})])],2),e("div",{staticClass:"google-code-tip"},[t._v(" 为了保障您的账户安全,请输入您的谷歌验证器中的6位验证码 ")])],1)],1),e("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.withdrawDialogVisible=!1}}},[t._v("取消")]),e("el-button",{attrs:{type:"primary",loading:t.withdrawLoading},on:{click:t.confirmWithdraw}},[t._v("确认提现")])],1)],1),e("el-dialog",{attrs:{title:"链上充值",visible:t.createDialogVisible,"close-on-click-modal":!1,"close-on-press-escape":!1,width:"520px"},on:{"update:visible":function(e){t.createDialogVisible=e}}},[e("el-form",{attrs:{"label-width":"120px"}},[e("el-form-item",{attrs:{label:"选择充值链/币种"}},[e("el-cascader",{staticStyle:{width:"100%"},attrs:{options:t.options},model:{value:t.createValue,callback:function(e){t.createValue=e},expression:"createValue"}})],1)],1),e("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.createDialogVisible=!1}}},[t._v("取消")]),e("el-button",{attrs:{type:"primary",loading:t.createLoading},on:{click:t.confirmCreateWallet}},[t._v("确定")])],1)],1)],1)},e.Yp=[]},1029:function(t,e,i){Object.defineProperty(e,"B",{value:!0}),e.A=void 0,i(8111),i(7588),i(1701);var a=i(9662),s=i(1193);e.A={name:"AccountProductDetail",data(){return{loading:!1,product:null,ranges:[],machineList:[],productId:null,confirmVisible:!1,stateSnapshot:{},fieldSnapshot:{},updateLoading:!1,unitOptions:["KH/S","MH/S","GH/S","TH/S","PH/S"]}},created(){this.productId=Number(this.$route.params.id),this.productId&&(this.fetchDetail({id:this.productId}),this.fetchMachineList({id:this.productId}))},methods:{handlePayTypeChange(t){const e=this.machineList&&this.machineList[t];if(!e)return;const i=Number(e._selectedPayIndex||0),a=Array.isArray(e.priceList)?e.priceList:[],s=a[i]||{};this.$set(this.machineList,t,{...e,_priceEditing:String(s.price??"")})},isRowDisabled(t){return!!t&&1===Number(t.saleState)},handleOpenConfirm(){this.machineList&&this.machineList.length?this.confirmVisible=!0:this.$message.warning("没有可提交的数据")},async fetchDetail(t){this.loading=!0;try{const e=await(0,a.getMachineInfoById)(t),i=e?.data||{};this.product=i,this.ranges=Array.isArray(i.productMachineRangeList)?i.productMachineRangeList:[]}catch(e){console.error("获取商品详情失败",e),console.log("获取商品详情失败")}finally{this.loading=!1}},async fetchMachineList(t){const e=await(0,s.getMachineListForUpdate)(t);if(e&&200===e.code){const t=Array.isArray(e.rows)?e.rows:[];this.machineList=t.map(t=>{const e=Array.isArray(t.priceList)?t.priceList:[],i=0,a=e[i]||{};return{...t,_selectedPayIndex:i,_priceEditing:String(a.price??"")}}),this.refreshStateSnapshot(),this.refreshFieldSnapshot()}},refreshStateSnapshot(){const t={},e=Array.isArray(this.machineList)?this.machineList:[];for(let i=0;i{t&&(s[String(t.payTypeId??"")]=String(t.price??""))}),t[a.id]={theoryPower:String(a.theoryPower??""),powerDissipation:String(a.powerDissipation??""),type:String(a.type??""),priceMap:s,maxLeaseDays:String(a.maxLeaseDays??"")}}this.fieldSnapshot=t},isCellChanged(t,e){if(!t||"undefined"===typeof t.id)return!1;const i=this.fieldSnapshot[t.id]||{};if("price"===e){const e=Number(t._selectedPayIndex||0),a=Array.isArray(t.priceList)&&t.priceList[e]?t.priceList[e]:null,s=String(a&&a.payTypeId?a.payTypeId:e),o=String(a&&null!=a.price?a.price:""),r=String(i.priceMap&&i.priceMap[s]||"");return o!==r}const a=String(t[e]??""),s=String(i[e]??"");return a!==s},restoreStateSnapshot(){if(this.machineList&&this.machineList.length)for(let t=0;t6&&(r=r.slice(0,6)),n&&(n=n.slice(0,4)),i=n.length?`${r}.${n}`:s?`${r}.`:r,this.$set(this.machineList,t,{...this.machineList[t],theoryPower:i})},handleNumericCell(t,e){const i=this.machineList&&this.machineList[t];if(!i||this.isRowDisabled(i))return;let a=String("price"===e?this.machineList[t]._priceEditing??"":this.machineList[t][e]??"");a=a.replace(/[^0-9.]/g,"");const s=a.indexOf(".");if(-1!==s&&(a=a.slice(0,s+1)+a.slice(s+1).replace(/\./g,"")),"powerDissipation"===e){const t=a.endsWith("."),e=a.split(".");let i=e[0]||"",s=e[1]||"";i.length>6&&(i=i.slice(0,6)),s&&(s=s.slice(0,4)),a=s.length?`${i}.${s}`:t?`${i}.`:i}else if("price"===e){const e=a.endsWith("."),i=a.split(".");let s=i[0]||"",o=i[1]||"";s.length>12&&(s=s.slice(0,12)),o&&(o=o.slice(0,2)),a=o.length?`${s}.${o}`:e?`${s}.`:s,this.$set(this.machineList[t],"_priceEditing",a);const r=this.machineList[t],n=Number(r._selectedPayIndex||0);Array.isArray(r.priceList)&&r.priceList[n]&&this.$set(r.priceList[n],"price",a)}else if(-1!==s){const[t,e]=a.split(".");a=t+"."+(e?e.slice(0,6):"")}if("price"!==e){const i={...this.machineList[t],[e]:a};this.$set(this.machineList,t,i)}},handlePriceBlur(t){const e=String(this.machineList[t]._priceEditing??""),i=/^\d{1,12}(\.\d{1,2})?$/;if(!e||Number(e)<=0||!i.test(e)){this.$message.warning("单价必须大于0,整数最多12位,小数最多2位"),this.$set(this.machineList[t],"_priceEditing","");const e=this.machineList[t],i=Number(e._selectedPayIndex||0);Array.isArray(e.priceList)&&e.priceList[i]&&this.$set(e.priceList[i],"price","")}},handleMaxLeaseDaysInput(t){const e=this.machineList&&this.machineList[t];if(!e||this.isRowDisabled(e))return;let i=String(this.machineList[t].maxLeaseDays??"");i=i.replace(/\D/g,""),i.length>3&&(i=i.slice(0,3));const a={...this.machineList[t],maxLeaseDays:i};this.$set(this.machineList,t,a)},handleMaxLeaseDaysBlur(t){const e=String(this.machineList[t].maxLeaseDays??"");if(!/^\d{1,3}$/.test(e)){this.$message.warning("最大租赁天数需为 1-365 的整数");const e={...this.machineList[t],maxLeaseDays:""};return void this.$set(this.machineList,t,e)}const i=Number(e);if(!Number.isInteger(i)||i<1||i>365){this.$message.warning("最大租赁天数需为 1-365 的整数");const e={...this.machineList[t],maxLeaseDays:""};this.$set(this.machineList,t,e)}},handleTheoryPowerBlur(t){const e=String(this.machineList[t].theoryPower??""),i=/^\d{1,6}(\.\d{1,4})?$/;if(!e||Number(e)<=0||!i.test(e)){this.$message.warning("理论算力必须大于0");const e={...this.machineList[t],theoryPower:""};this.$set(this.machineList,t,e)}},handlePowerDissipationBlur(t){const e=String(this.machineList[t].powerDissipation??""),i=/^\d{1,6}(\.\d{1,4})?$/;if(!e||Number(e)<=0||!i.test(e)){this.$message.warning("功耗必须大于0");const e={...this.machineList[t],powerDissipation:""};this.$set(this.machineList,t,e)}},handleTypeCell(t){const e=this.machineList&&this.machineList[t];if(!e||this.isRowDisabled(e))return;const i={...this.machineList[t],type:this.machineList[t].type};this.$set(this.machineList,t,i)},handleStateChange(t){const e=this.machineList&&this.machineList[t];if(!e||this.isRowDisabled(e))return;const i={...this.machineList[t],state:this.machineList[t].state};this.$set(this.machineList,t,i)},async handleDeleteMachine(t){if(t&&t.id)if(this.isRowDisabled(t))this.$message.warning("该矿机已售出,无法删除");else try{await this.$confirm("确定删除该矿机吗?删除后不可恢复","提示",{confirmButtonText:"删除",cancelButtonText:"取消",type:"warning"});const e=await(0,s.deleteMachine)({id:t.id});e&&200===e.code&&(this.$message.success("删除成功"),this.fetchMachineList({id:this.productId}))}catch(e){}},async handleSubmitMachines(){if(this.machineList&&this.machineList.length)try{const t=/^\d{1,6}(\.\d{1,4})?$/,e=/^\d{1,12}(\.\d{1,2})?$/,i=t=>"string"===typeof t&&0===t.trim().length&&t.length>0;for(let s=0;s365)return void this.$message.warning(`第${s+1}行(机器:${o}) 最大租赁天数需为 1-365 的整数`);if(l&&i(l))return void this.$message.warning(`第${s+1}行(机器:${o}) 型号不能全是空格`)}const a=this.machineList.map(t=>({id:t.id,powerDissipation:Number(t.powerDissipation??0),priceList:Array.isArray(t.priceList)?t.priceList.map(t=>({...t,price:Number(t&&null!=t.price&&""!==t.price?t.price:0)})):[],state:Number(t.state??0),theoryPower:Number(t.theoryPower??0),type:t.type||"",maxLeaseDays:Number(t.maxLeaseDays??0),unit:t.unit||""}));this.confirmVisible=!1,console.log(a,"payload"),await this.updateMachineList(a)}catch(t){}else this.$message.warning("没有可提交的数据")},handleBack(){this.$router.back()}}}},1117:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(6404),s=i(1977),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"23615580",null),l=n.exports},1182:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(2038),s=i(7570),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,null,null),l=n.exports},1193:function(t,e,i){var a=i(3999)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e.addAsicMachine=h,e.addSingleOrBatchMachine=o,e.deleteMachine=r,e.downloadClient=u,e.getMachineListForUpdate=d,e.getSupportAlgo=m,e.getSupportCoin=p,e.getUserMachineList=n,e.getUserMinersList=l,e.updateMachine=c;var s=a(i(5720));function o(t){return(0,s.default)({url:"/lease/product/machine/addSingleOrBatchMachine",method:"post",data:t})}function r(t){return(0,s.default)({url:"/lease/product/machine/delete",method:"post",data:t})}function n(t){return(0,s.default)({url:"/lease/product/machine/getUserMachineList",method:"post",data:t})}function l(t){return(0,s.default)({url:"/lease/product/machine/getUserMinersList",method:"post",data:t})}function c(t){return(0,s.default)({url:"/lease/product/machine/updateMachine",method:"post",data:t})}function d(t){return(0,s.default)({url:"/lease/product/machine/getMachineListForUpdate",method:"post",data:t})}function u(){return(0,s.default)({url:"/lease/user/downloadClient",method:"get",responseType:"blob"})}function h(t){return(0,s.default)({url:"/lease/v2/product/machine/addAsicMachine",method:"post",data:t})}function p(){return(0,s.default)({url:"/lease/v2/product/machine/getSupportCoin",method:"get"})}function m(t){return(0,s.default)({url:"/lease/v2/product/machine/getSupportAlgo",method:"get",params:{coin:t}})}},1218:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"panel"},[e("h2",{staticClass:"panel-title"},[t._v("新增店铺")]),e("div",{staticClass:"panel-body"},[e("div",{staticClass:"row"},[e("label",{staticClass:"label required"},[t._v("店铺名称")]),e("el-input",{attrs:{placeholder:"请输入店铺名称",maxlength:30,"show-word-limit":""},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),e("div",{staticClass:"row"},[e("label",{staticClass:"label"},[t._v("店铺描述")]),e("div",{staticClass:"textarea-wrapper"},[e("el-input",{attrs:{type:"textarea",rows:4,maxlength:300,placeholder:"请输入店铺描述","show-word-limit":""},on:{input:t.handleDescriptionInput},model:{value:t.form.description,callback:function(e){t.$set(t.form,"description",e)},expression:"form.description"}})],1)]),e("div",{staticClass:"row"},[e("label",{staticClass:"label required"},[t._v("手续费比例")]),e("el-input",{staticClass:"fee-rate-input",attrs:{placeholder:"1 - 10"},on:{input:t.handleFeeRateInput},model:{value:t.form.feeRate,callback:function(e){t.$set(t.form,"feeRate",e)},expression:"form.feeRate"}},[e("template",{slot:"append"},[t._v("%")])],2)],1),t._m(0),e("div",{staticClass:"row",staticStyle:{"margin-top":"16px"}},[e("label",{staticClass:"label"},[t._v("专用网络")]),e("div",{staticClass:"network-card"},[e("div",{staticClass:"network-line"},[e("span",{staticClass:"network-label"},[t._v("是否开启")]),e("el-switch",{model:{value:t.form.isOpen,callback:function(e){t.$set(t.form,"isOpen",e)},expression:"form.isOpen"}}),e("span",{staticClass:"network-fee"},[t._v(" 网络手续费 "),e("span",{staticClass:"fee-value",class:{on:t.form.isOpen}},[t._v(t._s(t.networkFeeText))])])],1),e("div",{staticClass:"network-hint"},[t._v("专用网络会增加2%的手续费,建议无法直连矿池的用户开启")])])]),e("div",{staticClass:"row",staticStyle:{"margin-top":"50px"}},[e("div",{staticClass:"actions-center"},[e("el-button",{staticClass:"btn-wide",attrs:{type:"primary"},on:{click:t.handleCreate}},[t._v("创建店铺")])],1)])])])},e.Yp=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"row",staticStyle:{"margin-top":"-6px"}},[e("div"),e("div",{staticStyle:{color:"#909399","font-size":"12px","text-align":"left"}},[t._v(" 该手续费为商家向平台支付的交易佣金,比例越高店铺排名越靠前。 ")])])}]},1220:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(5508),s=i(1872),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"9935370e",null),l=n.exports},1259:function(t,e,i){Object.defineProperty(e,"B",{value:!0}),e.A=void 0,i(4114),i(8111),i(3579);e.A={name:"AccountPage",data(){return{activeIndex:"1",userEmail:"",activeRole:"seller",buyerLinks:[{label:"我的钱包",to:"/account/wallet"},{label:"挖矿信息",to:"/account/purchased-machine-config"},{label:"订单列表",to:"/account/orders"},{label:"资金流水",to:"/account/funds-flow"}],sellerLinks:[{label:"我的店铺",to:"/account/shops"},{label:"商品列表",to:"/account/products"},{label:"已售出订单",to:"/account/seller-orders"},{label:"资金流水",to:"/account/seller-funds-flow"}]}},computed:{userInitial(){const t=(this.userEmail||"").trim();return t?t[0].toUpperCase():"?"},displayedLinks(){return"buyer"===this.activeRole?this.buyerLinks:this.sellerLinks},isSecuritySettingsPage(){const t=this.$route&&this.$route.path||"";return"/account/security-settings"===t}},mounted(){const t=t=>{const e=localStorage.getItem(t);if(null==e)return null;try{return JSON.parse(e)}catch(i){return e}},e=t("leasEmail")||"";this.userEmail="string"===typeof e?e:String(e);const i=t("accountActiveRole");"buyer"!==i&&"seller"!==i||(this.activeRole=i),this.setActiveRoleByRoute()},methods:{handleClickRole(t){if("buyer"===t||"seller"===t){this.activeRole=t;try{localStorage.setItem("accountActiveRole",JSON.stringify(t))}catch(e){}try{const e="buyer"===t?this.buyerLinks&&this.buyerLinks[0]&&this.buyerLinks[0].to:this.sellerLinks&&this.sellerLinks[0]&&this.sellerLinks[0].to;e&&this.$route&&this.$route.path!==e&&this.$router.push(e)}catch(e){}}},setActiveRoleByRoute(){const t=this.$route&&this.$route.path||"";if(0===t.indexOf("/account/order-detail")){const t=this.$route&&this.$route.query&&this.$route.query.from||"";let e=t;if(!e)try{e=sessionStorage.getItem("orderDetailFrom")||""}catch(r){e=""}const i="seller"===e?"seller":"buyer";if(this.activeRole!==i){this.activeRole=i;try{localStorage.setItem("accountActiveRole",JSON.stringify(i))}catch(r){}}return}const e=["/account/wallet","/account/purchased-machine-config","/account/purchased-machine-detail","/account/orders","/account/funds-flow"],i=["/account/shops","/account/shop-new","/account/product-new","/account/products","/account/product-detail","/account/product-machine-add","/account/seller-orders","/account/seller-funds-flow","/account/receipt-record","/account/withdraw-record","/account/shop-config"];if("/account/security-settings"===t)return void(this.activeRole=null);const a=e.some(e=>0===t.indexOf(e)),s=i.some(e=>0===t.indexOf(e)),o=a?"buyer":s?"seller":this.activeRole;if(this.activeRole!==o){this.activeRole=o;try{localStorage.setItem("accountActiveRole",JSON.stringify(o))}catch(r){}}},isActiveLink(t){const e=this.$route&&this.$route.path||"";if(!t)return!1;if(0===e.indexOf("/account/order-detail")){const e=this.$route&&this.$route.query&&this.$route.query.from||"";let i=e;if(!i)try{i=sessionStorage.getItem("orderDetailFrom")||""}catch(s){i=""}return"seller"===i&&"/account/seller-orders"===t||"/account/orders"===t}const i={"/account/seller-orders":["/account/seller-orders"],"/account/products":["/account/products","/account/product-detail"],"/account/purchased-machine-config":["/account/purchased-machine-config","/account/purchased-machine-detail"]},a=i[t];return Array.isArray(a)?a.some(t=>e===t||("/account/product-detail"===t||"/account/purchased-machine-detail"===t)&&0===e.indexOf(t)):e===t}},watch:{"$route.path":{immediate:!0,handler(){this.setActiveRoleByRoute()}}}}},1296:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(954),s=i(6616),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"38cc4cbe",null),l=n.exports},1353:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(8285),s=i(5787),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"698701ea",null),l=n.exports},1373:function(t,e,i){Object.defineProperty(e,"B",{value:!0}),e.A=void 0,i(4114);var a=i(2549),s=i(6966),o=i(2032);e.A={name:"RegisterPage",data(){const t=(t,e,i)=>{if(!e)return void i(new Error("请输入邮箱"));const a=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$/;a.test(e)?i():i(new Error("请输入有效的邮箱地址"))},e=(0,o.createPasswordValidator)({emptyMessage:"请输入密码"}),i=(t,e,i)=>{e?e===this.registerForm.password?i():i(new Error("两次输入的密码不一致")):i(new Error("请再次输入密码"))},a=(t,e,i)=>{e?i():i(new Error("请阅读并同意用户协议"))};return{registerForm:{email:"",code:"",password:"",confirmPassword:"",agree:!1},registerRules:{email:[{required:!0,validator:t,trigger:"blur"}],code:[{required:!0,message:"请输入验证码",trigger:"blur"},{min:1,max:10,message:"验证码长度为1-10位",trigger:"blur"}],password:[{required:!0,validator:e,trigger:"blur"}],confirmPassword:[{required:!0,validator:i,trigger:"blur"}],agree:[{required:!0,validator:a,trigger:"change"}]},loading:!1,sendingCode:!1,countdown:0,timer:null}},computed:{passwordStrength(){const t=this.registerForm.password;if(!t)return 0;let e=0;return t.length>=6&&(e+=1),t.length>=10&&(e+=1),/\d/.test(t)&&(e+=1),/[a-z]/.test(t)&&(e+=1),/[A-Z]/.test(t)&&(e+=1),/[^a-zA-Z0-9]/.test(t)&&(e+=1),e},passwordStrengthText(){const t=this.passwordStrength;return t<=2?"弱":t<=4?"中":"强"},passwordStrengthClass(){const t=this.passwordStrength;return t<=2?"weak":t<=4?"medium":"strong"}},beforeDestroy(){this.timer&&(clearInterval(this.timer),this.timer=null)},methods:{handleEmailChange(){this.registerForm.email=this.registerForm.email.trim()},goToShop(){"/productList"!==this.$route.path?this.$router.push("/productList"):this.$router.go(-1)},async handleSendCode(){const t=(this.registerForm.email||"").trim();if(!t)return this.$message.warning("请输入邮箱地址"),void this.$refs.registerForm.validateField("email");const e=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;if(!e.test(t))return this.$message.warning("请输入有效的邮箱地址"),void this.$refs.registerForm.validateField("email");this.sendingCode=!0;try{const e=await(0,a.sendEmailCode)({email:t});e&&200===e.code?(this.$message.success(e.msg||"验证码已发送,请查收邮箱"),this.startCountdown()):this.$message.error(e.msg||"发送验证码失败")}catch(i){console.error("发送验证码失败:",i),this.$message.error(i.message||"发送验证码失败,请重试")}finally{this.sendingCode=!1}},startCountdown(){this.countdown=60,this.timer=setInterval(()=>{this.countdown--,this.countdown<=0&&(clearInterval(this.timer),this.timer=null)},1e3)},async handleRegister(){try{await this.$refs.registerForm.validate()}catch(t){return}this.loading=!0;try{const t=(this.registerForm.email||"").trim(),e=(this.registerForm.password||"").trim(),i=(this.registerForm.code||"").trim(),o=e;let r=o;const n=(0,s.rsaEncryptSync)(o);if(n)r=n;else{const t=await(0,s.rsaEncrypt)(o);if(!t)return this.$message.error("密码加密失败,请重试"),void(this.loading=!1);r=t}const l=await(0,a.register)({code:i,password:r,userEmail:t});l&&200===l.code?(this.$message.success("注册成功,请登录"),this.$router.push({path:"/login",query:{email:t}})):this.$message.error(l.msg||"注册失败")}catch(t){console.error("注册失败:",t),this.$message.error("注册失败,请重试")}finally{this.loading=!1}}}}},1406:function(t,e,i){var a=i(3999)["default"],s=a(i(5471)),o=a(i(9197)),r=a(i(9325)),n=a(i(1052));i(1475);var l=i(465),c=i(5720);console.log=()=>{},console.debug=()=>{},console.info=()=>{},s.default.config.productionTip=!1,s.default.use(n.default),(0,l.initNoEmojiGuard)();const d=new s.default({router:r.default,render:t=>t(o.default),beforeDestroy(){(0,c.cleanupRequestListeners)()}}).$mount("#app");window.vm=d},1507:function(t,e,i){var a=i(3999)["default"];Object.defineProperty(e,"B",{value:!0}),e.A=void 0;var s=i(5952),o=a(i(9146));e.A={mixins:[o.default],name:"ProductList",mounted(){},methods:{formatPayType(t){try{const e=(t&&t.chain?String(t.chain):"").toUpperCase(),i=(t&&t.coin?String(t.coin):"").toUpperCase();return e&&i?`${e}-${i}`:e||i||""}catch(e){return""}},handleAddToCart(t){try{(0,s.addToCart)({id:t.id,title:t.title,price:t.price,image:t.image,quantity:1}),this.$message({message:"已添加到购物车",type:"success",showClose:!0})}catch(e){console.error("添加到购物车失败:",e),console.log("添加到购物车失败,请稍后重试")}}}}},1561:function(t,e,i){Object.defineProperty(e,"B",{value:!0}),e.A=void 0,i(4114);var a=i(5705);e.A={data(){return{form:{name:"",description:"",image:"",feeRate:"",isOpen:!1,networkFee:0}}},computed:{networkFeeText(){return this.form.isOpen?"2%":"0"}},mounted(){},methods:{hasEmoji(t){if(!t||"string"!==typeof t)return!1;const e=/[\u{1F300}-\u{1F6FF}\u{1F900}-\u{1F9FF}\u{1FA70}-\u{1FAFF}\u2600-\u27BF]/u;return e.test(t)},handleFeeRateInput(t){let e=String(t??this.form.feeRate??"");e=e.replace(/[^0-9.]/g,"");const i=e.indexOf(".");-1!==i&&(e=e.slice(0,i+1)+e.slice(i+1).replace(/\./g,""));const a=e.endsWith("."),s=e.split(".");let o=s[0]||"",r=s[1]||"";r.length>6&&(r=r.slice(0,6)),o&&"0"!==o&&(o=String(Number(o))),this.form.feeRate=a&&-1!==i?`${o||"0"}.`:r?`${o||"0"}.${r}`:o||""},async fetchAddShop(){const t=await(0,a.getAddShop)(this.form);t&&200==t.code&&(this.$message({message:"店铺创建成功",type:"success",showClose:!0}),this.$router.push("/account/shops"))},handleDescriptionInput(t){t&&t.length>300&&(this.form.description=t.substring(0,300),this.$message({message:"店铺描述不能超过300个字符",type:"warning",showClose:!0}))},handleCreate(){const t=t=>"string"===typeof t&&t.length>0&&0===t.trim().length;if(!this.form.name||t(this.form.name))return void this.$message({message:"店铺名称不能为空或全是空格",type:"warning",showClose:!0});if(this.hasEmoji(this.form.name))return void this.$message({message:"店铺名称不能包含表情符号",type:"warning",showClose:!0});if(this.form.name&&this.form.name.length>30)return void this.$message({message:"店铺名称不能超过30个字符",type:"warning",showClose:!0});if(t(this.form.description))return void this.$message({message:"店铺描述不能全是空格",type:"warning",showClose:!0});if(this.form.description&&this.form.description.length>300)return void this.$message({message:"店铺描述不能超过300个字符",type:"warning",showClose:!0});if(this.$route.query&&"1"===this.$route.query.hasShop)return this.$message({message:"每个用户仅允许一个店铺,无法新建",type:"warning",showClose:!0}),void this.$router.replace("/account/shops");if(!this.form.name)return void this.$message.error("店铺名称不能为空");const e=String(this.form.feeRate||"").trim();if(!e)return void this.$message({message:"请填写店铺手续费比例(1 - 10,最多6位小数)",type:"warning",showClose:!0});const i=Number(e),a=!e.includes(".")||(e.split(".")[1]||"").length<=6;!Number.isFinite(i)||i<1||i>10||!a?this.$message({message:"手续费比例需在 1 - 10 之间,且小数位不超过6位",type:"warning",showClose:!0}):(this.form.feeRate=(i/100).toString(),this.form.networkFee=this.form.isOpen?.02:0,this.fetchAddShop(this.form))}}}},1673:function(t,e,i){var a=i(3999)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e.bindGoogle=r,e.closeStepTwo=l,e.getBindInfo=o,e.getGoogleStatus=d,e.openStepTwo=u,e.sendCloseGoogleCode=c,e.sendOpenGoogleCode=n;var s=a(i(5720));function o(t){return(0,s.default)({url:"/lease/auth/getBindInfo",method:"post",data:t})}function r(t){return(0,s.default)({url:"/lease/auth/bindGoogle",method:"post",data:t})}function n(t){return(0,s.default)({url:"/lease/auth/sendOpenGoogleCode",method:"post",data:t})}function l(t){return(0,s.default)({url:"/lease/auth/closeStepTwo",method:"post",data:t})}function c(t){return(0,s.default)({url:"/lease/auth/sendCloseGoogleCode",method:"post",data:t})}function d(t){return(0,s.default)({url:"/lease/auth/getGoogleStatus",method:"post",data:t})}function u(t){return(0,s.default)({url:"/lease/auth/openStepTwo",method:"post",data:t})}},1750:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(7686),s=i(9814),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"5245f0be",null),l=n.exports},1840:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"purchased-machine-detail"},[e("div",{staticClass:"toolbar"},[e("div",{staticClass:"left-area"},[e("el-button",{staticClass:"back-btn",attrs:{type:"text",icon:"el-icon-arrow-left"},on:{click:t.handleBack}},[t._v(" 返回 ")]),e("h2",{staticClass:"page-title"},[t._v("挖矿信息详情")])],1)]),e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"detail-content"},[t.detailData?e("el-card",{staticClass:"detail-card"},[e("div",{staticClass:"card-header",attrs:{slot:"header"},slot:"header"},[e("span",[t._v("基本信息")])]),e("el-descriptions",{attrs:{column:2,border:""}},[e("el-descriptions-item",{attrs:{label:"挖矿账户"}},[t._v(" "+t._s(t.detailData.poolUser||"—")+" ")]),e("el-descriptions-item",{attrs:{label:"矿池名称"}},[t._v(" "+t._s(t.detailData.pool||"—")+" ")]),e("el-descriptions-item",{attrs:{label:"矿池挖矿地址"}},[t.detailData.poolUrl?e("div",{staticClass:"address-item"},[e("span",{staticClass:"mono-ellipsis"},[t._v(t._s(t.detailData.poolUrl))]),e("el-button",{staticClass:"copy-btn",attrs:{type:"text",size:"mini",icon:"el-icon-document-copy"},on:{click:function(e){return t.handleCopy(t.detailData.poolUrl,"矿池挖矿地址")}}},[t._v(" 复制 ")])],1):e("span",[t._v("—")])]),e("el-descriptions-item",{attrs:{label:"矿池所挖币种"}},[t._v(" "+t._s(t.detailData.coin||"—")+" ")]),e("el-descriptions-item",{attrs:{label:"币种对应算法"}},[t._v(" "+t._s(t.detailData.algorithm||"—")+" ")]),e("el-descriptions-item",{attrs:{label:"收款钱包"}},[t.detailData.walletAddress?e("div",{staticClass:"address-item"},[e("span",{staticClass:"mono-ellipsis",staticStyle:{"font-family":"monospace"}},[t._v(t._s(t.detailData.walletAddress))]),e("el-button",{staticClass:"copy-btn",attrs:{type:"text",size:"mini",icon:"el-icon-document-copy"},on:{click:function(e){return t.handleCopy(t.detailData.walletAddress,"收款钱包")}}},[t._v(" 复制 ")])],1):e("span",[t._v("—")])]),t.detailData.watchUrl?e("el-descriptions-item",{attrs:{label:"挖矿信息页面地址"}},[e("div",{staticClass:"address-item"},[e("span",{staticClass:"mono-ellipsis"},[t._v(t._s(t.detailData.watchUrl))]),e("el-button",{staticClass:"copy-btn",attrs:{type:"text",size:"mini",icon:"el-icon-document-copy"},on:{click:function(e){return t.handleCopy(t.detailData.watchUrl,"挖矿信息页面地址")}}},[t._v(" 复制 ")])],1)]):t._e()],1)],1):t._e(),t.detailData?e("el-card",{staticClass:"detail-card"},[e("div",{staticClass:"card-header",attrs:{slot:"header"},slot:"header"},[e("span",[t._v("矿机信息")])]),t.purchasedMachinesList&&t.purchasedMachinesList.length>0?e("el-table",{staticStyle:{width:"100%"},attrs:{data:t.purchasedMachinesList,border:"",stripe:"","header-cell-style":{textAlign:"left"},"cell-style":{textAlign:"left"}}},[e("el-table-column",{attrs:{prop:"workerId",label:"矿工号","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",[t._v(t._s(i.row.workerId||"—"))])]}}],null,!1,3323832681)}),e("el-table-column",{attrs:{prop:"power",label:"实时算力","min-width":"140"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",[t._v(t._s(t.formatPowerWithUnit(i.row&&i.row.power,i.row&&i.row.unit)))])]}}],null,!1,427761386)}),e("el-table-column",{attrs:{prop:"recordTime",label:"最近实时算力记录时间","min-width":"180"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",[t._v(t._s(t.formatDateTime(i.row.recordTime)))])]}}],null,!1,889773213)}),e("el-table-column",{attrs:{prop:"startTime",label:"挖矿开始时间","min-width":"160"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",[t._v(t._s(t.formatDateTime(i.row.startTime)))])]}}],null,!1,1820455728)}),e("el-table-column",{attrs:{prop:"endTime",label:"挖矿结束时间","min-width":"160"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",[t._v(t._s(t.formatDateTime(i.row.endTime)))])]}}],null,!1,1075225151)}),e("el-table-column",{attrs:{prop:"status",label:"状态",width:"140"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-tag",{attrs:{type:t.getStatusType(i.row.status)}},[t._v(" "+t._s(t.getStatusText(i.row.status))+" ")])]}}],null,!1,2263538733)})],1):e("div",{staticClass:"empty-table"},[e("p",[t._v("暂无矿机信息")])])],1):t._e(),t.loading||t.detailData?t._e():e("div",{staticClass:"empty-state"},[e("p",[t._v("未找到详情信息")])])],1)])},e.Yp=[]},1872:function(t,e){Object.defineProperty(e,"B",{value:!0}),e.A=void 0;e.A={name:"Content"}},1968:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{attrs:{id:"app"}},[e("router-view")],1)},e.Yp=[]},1977:function(t,e,i){var a=i(3999)["default"];Object.defineProperty(e,"B",{value:!0}),e.A=void 0;var s=i(4180),o=a(i(4073));e.A={name:"AccountSellerOrders",components:{OrderList:o.default},data(){return{active:"7",orders:{7:[],8:[],11:[]},loading:!1}},created(){const t=this.$route&&this.$route.query&&this.$route.query.status?String(this.$route.query.status):null,e=localStorage.getItem("sellerOrderListActiveTab"),i=t||e||"7";this.active=i,this.fetchOrders(i)},methods:{handleTabClick(t){const e=t&&t.name?String(t.name):this.active;try{localStorage.setItem("sellerOrderListActiveTab",e)}catch(i){}this.fetchOrders(e)},async fetchOrders(t){const e=String(t);try{this.loading=!0;const i=await(0,s.getOrdersByStatusForSeller)({status:Number(t)}),a=null!=(i&&i.data)?i.data:i,o=Array.isArray(a)?a:Array.isArray(a&&a.rows)?a.rows:[];this.$set(this.orders,e,o)}catch(i){console.error("获取卖家订单失败",i)}finally{this.loading=!1}}}}},2003:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(9967),s=i(1259),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"504f3f5f",null),l=n.exports},2032:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.createPasswordValidator=void 0;const i=(t={})=>{const e=t.emptyMessage||"请输入密码";return(t,i,a)=>{if(!i)return void a(new Error(e));const s=String(i),o=[{test:t=>t.length>=8&&t.length<=32,msg:"密码长度应为8-32位"},{test:t=>/[a-z]/.test(t),msg:"密码应包含小写字母"},{test:t=>/[A-Z]/.test(t),msg:"密码应包含大写字母"},{test:t=>/\d/.test(t),msg:"密码应包含数字"},{test:t=>/[\W_]/.test(t),msg:"密码应包含特殊字符(如 !@#$%^&*)"},{test:t=>!/[\u4e00-\u9fa5]/.test(t),msg:"密码不能包含中文字符"}];for(const e of o)if(!e.test(s))return void a(new Error(e.msg));a()}};e.createPasswordValidator=i},2038:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("el-container",{staticClass:"containerApp",staticStyle:{width:"100vw",height:"100vh"}},[e("el-header",{staticClass:"el-header"},[e("comHeard")],1),e("el-main",{staticClass:"el-main"},[e("appMain")],1)],1)},e.Yp=[]},2278:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(2835),s=i(9660),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"454c7c84",null),l=n.exports},2515:function(t,e,i){Object.defineProperty(e,"B",{value:!0}),e.A=void 0,i(8111),i(1701),i(7642),i(8004),i(3853),i(5876),i(2475),i(5024),i(1698);var a=i(6299),s=i(4981);e.A={name:"AccountFundsFlow",data(){return{active:"recharge",loading:{recharge:!1,withdraw:!1,consume:!1},rechargeRows:[],withdrawRows:[],consumeRows:[],expandedKeys:new Set,total:0,pageSizes:[10,20,50],currentPage:1,pagination:{pageNum:1,pageSize:10,status:2}}},mounted(){const t=this.$route&&this.$route.query&&this.$route.query.tab||"recharge";["recharge","withdraw","consume"].includes(t)&&(this.active=t),this.pagination.status=this.getStatusByTab(this.active),this.loadList()},methods:{formatAmount(t,e){return(0,s.truncateAmountByCoin)(t,e)},handleTab(t,e){this.expandedKeys.clear(),this.expandedKeys=new Set(this.expandedKeys);const i=t&&t.name||this.active;this.pagination.status=this.getStatusByTab(i),this.pagination.pageNum=1,this.currentPage=1,this.loadList()},getRowKey(t,e){const i=null!=e?`#${e}`:"";if(!t)return String(null!=e?e:"");const a=t.__key||t.id||t.txHash||t.orderId||`${t.createTime||""}-${t.updateTime||""}`;return null==a||""===a?String(null!=e?e:""):`${String(a)}${i}`},isExpanded(t,e,i){const a=`${t}-${this.getRowKey(e,i)}`;return this.expandedKeys.has(a)},toggleExpand(t,e,i){const a=`${t}-${this.getRowKey(e,i)}`;this.expandedKeys.has(a)?this.expandedKeys.clear():(this.expandedKeys.clear(),this.expandedKeys.add(a)),this.expandedKeys=new Set(this.expandedKeys)},async loadList(){const t=Number(this.pagination.status),e=this.getTypeKeyByStatus(t);if(e){this.loading[e]=!0;try{const e=await(0,a.transactionRecord)({pageNum:this.pagination.pageNum,pageSize:this.pagination.pageSize,status:t}),i=e?.rows||e?.data?.rows||[];this.total=e?.total||e?.data?.total||(Array.isArray(i)?i.length:0);const s=(Array.isArray(i)?i:[]).map((t,e)=>({...t,__key:t.id||t.txHash||t.orderId||`${e}`}));2===t?this.rechargeRows=s:1===t?this.withdrawRows=s:this.consumeRows=s,this.expandedKeys.clear(),this.expandedKeys=new Set(this.expandedKeys)}finally{this.loading[e]=!1}}},loadByStatus(t){return this.pagination.status=t,this.active=this.getTabByStatus(t),this.pagination.pageNum=1,this.currentPage=1,this.loadList()},loadRecharge(){return this.loadByStatus(2)},loadWithdraw(){return this.loadByStatus(1)},loadConsume(){return this.loadByStatus(0)},statusClass(t){return{0:"failed",1:"success",2:"pending"}[t]||"neutral"},getRechargeStatusType(t){return{0:"danger",1:"success",2:"warning"}[t]||"info"},getRechargeStatusText(t){return{0:"充值失败",1:"充值成功",2:"充值中",3:"证书校验失败"}[t]||"未知"},getWithdrawStatusType(t){return{0:"danger",1:"success",2:"warning"}[t]||"info"},getWithdrawStatusText(t){return{0:"提现失败",1:"提现成功",2:"提现中",3:"证书校验失败"}[t]||"未知"},getPayStatusType(t){return{0:"danger",1:"success",2:"warning",3:"danger"}[t]||"info"},getPayStatusText(t){return{0:"支付失败",1:"支付成功",2:"待校验",3:"证书校验失败"}[t]||"未知"},formatChain(t){if(!t)return"";const e=String(t).toLowerCase(),i={tron:"TRON",trx:"TRON",eth:"ETH",ethereum:"ETH",bsc:"BSC",polygon:"POLYGON",matic:"POLYGON"};return(i[e]||String(t)).toUpperCase()},formatFullTime(t){if(!t)return"";try{return new Date(t).toLocaleString("zh-CN")}catch(e){return String(t)}},formatTime(t){return this.formatFullTime(t)},formatTrunc(t,e=2){const i=Number(t);if(!Number.isFinite(i))return"0";const a=Math.max(0,Number(e)||0),s=Math.pow(10,a),o=Math.trunc(i*s)/s,r=String(o);if(0===a)return r;const[n,l=""]=r.split("."),c=l.padEnd(a,"0");return`${n}.${c}`},handleSizeChange(t){console.log(`每页 ${t} 条`),this.pagination.pageSize=t,this.pagination.pageNum=1,this.currentPage=1,this.loadList()},handleCurrentChange(t){console.log(`当前页: ${t}`),this.pagination.pageNum=t,this.loadList()},async handleCopy(t,e="内容"){try{const i=String(t||"");if(navigator&&navigator.clipboard&&navigator.clipboard.writeText)await navigator.clipboard.writeText(i);else{const t=document.createElement("textarea");t.value=i,t.style.position="fixed",t.style.left="-9999px",document.body.appendChild(t),t.focus(),t.select(),document.execCommand("copy"),document.body.removeChild(t)}this.$message.success(`${e}已复制`)}catch(i){this.$message.error("复制失败,请手动选择复制")}},getStatusByTab(t){return"recharge"===t?2:"withdraw"===t?1:0},getTabByStatus(t){return 2===Number(t)?"recharge":1===Number(t)?"withdraw":"consume"},getTypeKeyByStatus(t){return 2===Number(t)?"recharge":1===Number(t)?"withdraw":0===Number(t)?"consume":""}}}},2549:function(t,e,i){var a=i(3999)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e.closeAccount=h,e.getLogin=r,e.getLogout=n,e.register=o,e.sendCloseAccount=p,e.sendEmailCode=c,e.sendLoginCode=l,e.sendUpdatePwdCode=d,e.updatePassword=u,e.updatePasswordInCenter=m;var s=a(i(5720));function o(t){return(0,s.default)({url:"/lease/auth/register",method:"post",data:t})}function r(t){return(0,s.default)({url:"/lease/auth/login",method:"post",data:t})}function n(t){return(0,s.default)({url:"/lease/auth/logout",method:"post",data:t})}function l(t){return(0,s.default)({url:"/lease/auth/sendLoginCode",method:"post",data:t})}function c(t){return(0,s.default)({url:"/lease/auth/sendRegisterCode",method:"post",data:t})}function d(t){return(0,s.default)({url:"/lease/auth/sendUpdatePwdCode",method:"post",data:t})}function u(t){return(0,s.default)({url:"/lease/auth/updatePassword",method:"post",data:t})}function h(t){return(0,s.default)({url:"/lease/auth/closeAccount",method:"post",data:t})}function p(t){return(0,s.default)({url:"/lease/auth/sendCloseAccount",method:"post",data:t})}function m(t){return(0,s.default)({url:"/lease/auth/updatePasswordInCenter",method:"post",data:t})}},2570:function(t,e,i){Object.defineProperty(e,"B",{value:!0}),e.A=void 0,i(4114),i(8111),i(2489),i(1701);var a=i(5705),s=i(9252),o=i(6299),r=i(6966),n=i(1673);e.A={name:"AccountMyShops",data(){return{loaded:!1,defaultCover:"https://dummyimage.com/120x120/eee/999.png&text=Shop",shop:{id:0,name:"",image:"",description:"",feeRate:"",networkFee:0,isOpen:!1,del:!0,state:0},visibleEdit:!1,editForm:{id:"",name:"",image:"",description:"",feeRate:"",gCode:"",isOpen:!1,networkFee:0},shopConfigs:[],visibleConfigEdit:!1,configForm:{id:"",chainLabel:"",chainValue:"",payAddress:"",payCoins:[],payCoin:"",googleCode:""},productOptions:[],coinOptions:s.coinList||[],editCoinOptionsApi:[],chainOptions:[{label:"Tron (TRC20)",value:"tron"},{label:"Ethereum (ERC20)",value:"ethereum"},{label:"BSC (BEP20)",value:"bsc"},{label:"Nexa",value:"nexa"}],shopLoading:!1,withdrawDialogVisible:!1,withdrawLoading:!1,currentWithdrawRow:{},withdrawForm:{amount:"",toAddress:"",fee:"0.00",googleCode:""},withdrawAddressEditable:!1,withdrawRules:{}}},computed:{shopStateText(){return 0===this.shop.state?"待审核":1===this.shop.state?"店铺开启":2===this.shop.state?"店铺关闭":"未知状态"},shopStateTagType(){return 0===this.shop.state?"warning":1===this.shop.state?"success":(this.shop.state,"info")},shopNetworkFeeText(){const t=Number(this.shop.networkFee),e=Number.isFinite(t)&&t>0,i=this.normalizeIsOpen(this.shop.isOpen);if(!i)return"0";const a=e?t:0;if(!a)return"0";const s=100*a,o=s.toFixed(6);return`${o.replace(/\.?0+$/,"")}%`},hasShop(){return!!(this.shop&&Number(this.shop.id)>0)},canCreateShop(){return!this.hasShop},editCoinOptions(){return Array.isArray(this.editCoinOptionsApi)&&this.editCoinOptionsApi.length?this.editCoinOptionsApi:this.coinOptions},selectedCoinLabels(){const t=new Map((this.editCoinOptions||[]).map(t=>[String(t.value),String(t.label).toUpperCase()]));return(this.configForm.payCoins||[]).map(e=>t.get(String(e))||String(e).toUpperCase())},editNetworkFeeText(){return this.editForm.isOpen?"2%":"0"},withdrawDialogTitle(){const t=String(this.currentWithdrawRow&&this.currentWithdrawRow.payCoin||"").toUpperCase()||"";return`${t}提现`},displayWithdrawSymbol(){return String(this.currentWithdrawRow&&this.currentWithdrawRow.payCoin||"").toUpperCase()},availableWithdrawBalance(){const t=Number(this.currentWithdrawRow&&this.currentWithdrawRow.balance||0);return this.formatDec6(t)},actualAmount(){const t=this.toScaledInt(this.withdrawForm.amount),e=this.toScaledInt(this.withdrawForm.fee);if(!Number.isFinite(t)||!Number.isFinite(e))return"0";const i=t-e;return i>0?this.formatDec6FromInt(i):"0"}},created(){this.fetchMyShop()},methods:{normalizeIsOpen(t){if(!0===t||1===t)return!0;if("string"===typeof t){const e=t.trim().toLowerCase();return"true"===e||"1"===e}return!1},normalizeShopData(t){let e=t&&null!=t.data?t.data:t;if(Array.isArray(e))return e[0]||{};if("string"===typeof e)try{const t=JSON.parse(e);return Array.isArray(t)?t[0]||{}:t||{}}catch(i){return{}}return e||{}},handleEditShopGoogleCodeInput(t){this.editForm.gCode=String(t||"").replace(/\D/g,"").slice(0,6)},async ensureGoogleStatusEnabledForWalletOp(t){try{const e=await(0,n.getGoogleStatus)();if(!e||0!==e.code&&200!==e.code)return this.$message.error("获取双重验证状态失败,请稍后重试"),!1;const i=e&&e.data&&null!=e.data.status?e.data.status:e.data??1;if(0===Number(i))return!0;const a="安全提示",s=1===Number(i)?"您尚未绑定双重验证":"您已关闭双重验证",o=`\n
\n
${s}
\n
\n 请先在安全设置中绑定并开启双重验证后,才可以进行${t||"该"}操作。\n
\n
\n `;return await this.$confirm(o,a,{confirmButtonText:"去安全设置",cancelButtonText:"取消",type:"warning",dangerouslyUseHTMLString:!0,customClass:"google-2fa-guard-dialog"}),this.$router.push("/account/security-settings"),!1}catch(e){return!1}},formatBalance(t){try{const e=Number(t&&t.balance),i=Number.isFinite(e),a=String(t&&t.payCoin?t.payCoin:"").toUpperCase();if(!i)return"-";const s=String(e);return a?`${s} ${a}`:s}catch(e){return"-"}},formatAmount(t){try{const e=Number(t&&t.balance);return Number.isFinite(e)?String(e):"-"}catch(e){return"-"}},formatCoin(t){return String(t&&t.payCoin?t.payCoin:"").toUpperCase()},async handleWithdraw(t){const e=await this.ensureGoogleStatusEnabledForWalletOp("提现");if(!e)return;this.currentWithdrawRow=t||{};const i=Number(t&&(null!=t.serviceCharge?t.serviceCharge:t.charge));this.withdrawForm.fee=Number.isFinite(i)?this.formatDec6(i):"0.00",this.withdrawForm.amount="",this.withdrawForm.toAddress=t&&t.payAddress?t.payAddress:"",this.withdrawForm.googleCode="",this.withdrawAddressEditable=!1,this.withdrawRules={amount:[{required:!0,message:"请输入提现金额",trigger:"blur"},{validator:this.validateWithdrawAmount,trigger:"blur"}],toAddress:[{required:!0,message:"请输入收款钱包地址",trigger:"blur"},{validator:this.validateWithdrawToAddress,trigger:"blur"}],googleCode:[{required:!0,message:"请输入谷歌验证码",trigger:"blur"},{validator:this.validateGoogleCode,trigger:"blur"}]},this.withdrawDialogVisible=!0},handleEditAddressClick(){this.withdrawAddressEditable=!0,this.$nextTick(()=>{const t=this.$refs.withdrawToAddressInput;t&&t.focus&&t.focus()})},handleAmountInput(t){let e=String(t||"");e=e.replace(/[^0-9.]/g,"");const i=e.indexOf(".");if(-1!==i){e=e.slice(0,i+1)+e.slice(i+1).replace(/\./g,"");const[t,a=""]=e.split(".");e=t+"."+a.slice(0,6)}this.withdrawForm.amount=e},handleGoogleCodeInput(t){this.withdrawForm.googleCode=String(t||"").replace(/\D/g,"")},confirmWithdraw(){this.$refs.withdrawForm.validate(async t=>{if(t){this.withdrawLoading=!0;try{const t=this.currentWithdrawRow||{},e=String(this.withdrawForm.toAddress||"").trim(),i=String(t.payAddress||this.withdrawForm.toAddress||"").trim();let a=e;if(a){const t=(0,r.rsaEncryptSync)(a);if(t)a=t;else{const t=await(0,r.rsaEncrypt)(a);if(!t)return void this.$message.error("钱包地址加密失败,请重试");a=t}}let s=i;if(s){const t=(0,r.rsaEncryptSync)(s);if(t)s=t;else{const t=await(0,r.rsaEncrypt)(s);if(!t)return void this.$message.error("钱包地址加密失败,请重试");s=t}}const n={toChain:t.chain,toSymbol:t.payCoin,amount:Number(this.withdrawForm.amount),toAddress:a,fromAddress:s,code:this.withdrawForm.googleCode,serviceCharge:Number(this.withdrawForm.fee)||0},l=await(0,o.withdrawBalanceForSeller)(n);!l||0!==l.code&&200!==l.code||(this.$message.success("提现申请已提交,请等待处理"),this.withdrawDialogVisible=!1,this.fetchShopConfigs(this.shop.id))}catch(e){console.error("卖家提现失败",e)}finally{this.withdrawLoading=!1}}})},formatDec6(t){if(null===t||void 0===t||""===t)return"0";let e=String(t);if(/e/i.test(e)){const i=Number(t);if(!Number.isFinite(i))return"0";e=i.toFixed(20).replace(/\.0+$/,"").replace(/(\.\d*?)0+$/,"$1")}const i=e.match(/^(-?)(\d+)(?:\.(\d+))?$/);if(!i)return e;let a=i[2],s=i[3]||"";return s.length>6&&(s=s.slice(0,6)),s?`${a}.${s}`:a},toScaledInt(t,e=6){if(null===t||void 0===t)return 0;const i=String(t).trim();if(""===i)return 0;const a=new RegExp(`^\\d+(?:\\.(\\d{0,${e}}))?$`),s=i.match(a);if(!s){const t=Number(i);if(!Number.isFinite(t))return 0;const a=Math.pow(10,e);return Math.round(t*a)}const[o,r]=i.split("."),n=(r||"").padEnd(e,"0").slice(0,e),l=Math.pow(10,e);return Number(o)*l+Number(n)},formatDec6FromInt(t){const e=t<0?"-":"",i=Math.abs(t),a=Math.pow(10,6),s=Math.floor(i/a),o=String(i%a).padStart(6,"0"),r=`${e}${s}.${o}`;return r.replace(/\.0+$/,"").replace(/(\.\d*?)0+$/,"$1")},validateWithdrawAmount(t,e,i){const a=this.toScaledInt(e);if(!Number.isFinite(a)||a<=0)return void i(new Error("请输入有效的金额"));const s=this.toScaledInt(this.withdrawForm.fee),o=this.toScaledInt(this.currentWithdrawRow&&this.currentWithdrawRow.balance||0);if(a>o)return void i(new Error("提现金额不能大于可用余额"));if(a<=s)return void i(new Error("提现金额必须大于手续费"));const r=a-s;r<=0?i(new Error("提现金额扣除手续费后必须大于0")):a<1e6?i(new Error("最小提现金额为 1")):i()},validateGoogleCode(t,e,i){const a=String(e||"");/^\d{6}$/.test(a)?i():i(new Error("谷歌验证码必须是6位数字"))},validateWithdrawToAddress(t,e,i){const a=String(e||"").trim();a?i():i(new Error("请输入收款钱包地址"))},formatFeeRate(t){if(null===t||void 0===t||""===t)return"-";const e=Number(t);if(!Number.isFinite(e))return"-";const i=100*e,a=i.toFixed(6);return`${a.replace(/\.?0+$/,"")}%`},handleEditFeeRateInput(t){let e=String(t??this.editForm.feeRate??"");e=e.replace(/[^0-9.]/g,"");const i=e.indexOf(".");-1!==i&&(e=e.slice(0,i+1)+e.slice(i+1).replace(/\./g,""));const a=e.endsWith("."),s=e.split(".");let o=s[0]||"",r=s[1]||"";r.length>6&&(r=r.slice(0,6)),o&&"0"!==o&&(o=String(Number(o))),this.editForm.feeRate=a&&-1!==i?`${o||"0"}.`:r?`${o||"0"}.${r}`:o||""},hasEmoji(t){if(!t||"string"!==typeof t)return!1;const e=/[\u{1F300}-\u{1F6FF}\u{1F900}-\u{1F9FF}\u{1FA70}-\u{1FAFF}\u2600-\u27BF]/u;return e.test(t)},resetShopState(){this.shop={id:0,name:"",image:"",description:"",feeRate:"",networkFee:0,isOpen:!1,del:!0,state:0},this.shopConfigs=[]},async fetchMyShop(){try{const t=await(0,a.getMyShop)();if(t&&(0===t.code||200===t.code)&&t.data){const e=this.normalizeShopData(t.data),i=Number(e.networkFee),a=Number.isFinite(i)&&i>0,s=this.normalizeIsOpen(e.isOpen)||a;this.shop={id:e.id,name:e.name,image:e.image,description:e.description,feeRate:e.feeRate,networkFee:a?i:0,isOpen:s,del:!!e.del,state:Number(e.state||0)},this.fetchShopConfigs(e.id)}else this.resetShopState(),t&&t.msg&&console.warn("获取店铺数据失败:",t.msg)}catch(t){console.error("获取店铺信息失败:",t),this.resetShopState()}finally{this.loaded=!0}},async fetchShopConfigs(t){if(!t||t<=0)this.shopConfigs=[];else try{const e=await(0,o.getShopConfigV2)({id:t});e&&(0===e.code||200===e.code)&&Array.isArray(e.data)?this.shopConfigs=e.data:this.shopConfigs=[]}catch(e){console.warn("获取店铺配置失败:",e),this.shopConfigs=[]}},async updateShopConfig(t){const e=await(0,a.updateShopConfig)(t);!e||0!==e.code&&200!==e.code||(this.$message.success("保存成功"),this.visibleConfigEdit=!1,this.fetchShopConfigs(this.shop.id))},async deleteShopConfig(t){const e=await(0,a.deleteShopConfig)(t);!e||0!==e.code&&200!==e.code||(this.$message.success("删除成功"),this.fetchShopConfigs(this.shop.id))},async handleEditConfig(t){const e=await this.ensureGoogleStatusEnabledForWalletOp("修改");if(e)try{const e=await(0,a.getChainAndCoin)({id:t.id});if(e&&(0===e.code||200===e.code)&&e.data){const i=e.data||{},a=Array.isArray(i.children)?i.children:[];this.editCoinOptionsApi=a.map(t=>({label:t.label,value:t.value}));const s=a.filter(t=>1===Number(t.hasBind)).map(t=>t.value);this.configForm={id:t.id,chainLabel:i.label||"",chainValue:i.value||"",payAddress:i.address||"",payCoins:s,payCoin:s.join(","),googleCode:""}}else{this.editCoinOptionsApi=[];const e=t.chain||"",i=String(t.payCoin||""),a=i?i.split(","):[];this.configForm={id:t.id,chainLabel:e,chainValue:t.chain||"",payAddress:t.payAddress||"",payCoins:a,payCoin:a.join(","),googleCode:""}}this.visibleConfigEdit=!0}catch(i){this.visibleConfigEdit=!0}},async handleDeleteConfig(t){const e=await this.ensureGoogleStatusEnabledForWalletOp("删除");if(e)try{const{value:e}=await this.$prompt("请输入 6 位谷歌验证码以删除该钱包绑定配置","安全验证",{confirmButtonText:"确认删除",cancelButtonText:"取消",type:"warning",inputPlaceholder:"6位数字验证码",inputPattern:/^\d{6}$/,inputErrorMessage:"谷歌验证码必须是6位数字"}),i=String(e||"").trim();if(!/^\d{6}$/.test(i))return void this.$message.warning("谷歌验证码必须是6位数字");await this.deleteShopConfig({id:t.id,gCode:i})}catch(i){}},handleConfigGoogleCodeInput(t){this.configForm.googleCode=String(t||"").replace(/\D/g,"")},handleConfigEditClose(){this.configForm.googleCode=""},async submitConfigEdit(){const t=(this.configForm.payAddress||"").trim();if(!t)return void this.$message.warning("请输入钱包地址");const e=String(this.configForm.googleCode||"").trim();if(!e)return void this.$message.warning("请输入谷歌验证码");if(!/^\d{6}$/.test(e))return void this.$message.warning("谷歌验证码必须是6位数字");let i=t;if(i){const t=(0,r.rsaEncryptSync)(i);if(t)i=t;else{const t=await(0,r.rsaEncrypt)(i);if(!t)return void this.$message.error("钱包地址加密失败,请重试");i=t}}const a={id:this.configForm.id,chain:this.configForm.chainValue||this.configForm.chainLabel||"",payAddress:i,gcode:e};try{const t=await(0,o.updateShopConfigV2)(a);!t||0!==t.code&&200!==t.code||(this.$message.success("保存成功"),this.visibleConfigEdit=!1,this.fetchShopConfigs(this.shop.id))}catch(s){console.error("修改配置失败",s)}},removeSelectedCoin(t){const e=String(t||"").toLowerCase(),i=new Map((this.editCoinOptions||[]).map(t=>[String(t.label).toLowerCase(),String(t.value)])),a=i.get(e);a&&(this.configForm.payCoins=(this.configForm.payCoins||[]).filter(t=>String(t)!==String(a)))},async handleOpenEdit(){const t=await this.ensureGoogleStatusEnabledForWalletOp("修改店铺");if(t)try{this.visibleEdit=!0;const t=await(0,a.queryShop)({id:this.shop.id});if(!t||0!==t.code&&200!==t.code){const e=Number(this.shop.feeRate),i=Number.isFinite(e)?100*e:"";this.editForm={id:this.shop.id,name:this.shop.name,image:this.shop.image,description:this.shop.description,feeRate:""===i?"":String(i),gCode:"",isOpen:!1,networkFee:0},this.$message.warning(t&&t.msg?t.msg:"未获取到店铺详情")}else{const e=this.normalizeShopData(t.data),i=Number(e.networkFee),a=Number.isFinite(i)&&i>0,s=this.normalizeIsOpen(e.isOpen)||a,o=Number(e.feeRate),r=Number.isFinite(o)?100*o:"";this.editForm={id:e.id,name:e.name,image:e.image,description:e.description,feeRate:""===r?"":String(r),gCode:"",isOpen:s,networkFee:a?i:0}}}catch(e){const t=Number(this.shop.feeRate),i=Number.isFinite(t)?100*t:"";this.editForm={id:this.shop.id,name:this.shop.name,image:this.shop.image,description:this.shop.description,feeRate:""===i?"":String(i),gCode:"",isOpen:!1,networkFee:0},console.error("查询店铺详情失败:",e)}},async submitEdit(){try{const{name:t,image:e,description:i}=this.editForm,s=t=>"string"===typeof t&&t.length>0&&0===t.trim().length;if(s(t))return void this.$message.error("店铺名称不能全是空格");if(!t)return void this.$message.error("店铺名称不能为空");if(this.hasEmoji(t))return void this.$message.warning("店铺名称不能包含表情符号");if(s(e))return void this.$message.error("店铺封面不能全是空格");if(s(i))return void this.$message.error("店铺描述不能全是空格");if(t&&t.length>30)return void this.$message.warning("店铺名称不能超过30个字符");if(i&&i.length>300)return void this.$message.warning("店铺描述不能超过300个字符");const o=String(this.editForm.feeRate||"").trim();if(!o)return void this.$message.warning("请填写店铺手续费比例(1 - 10,最多6位小数)");const r=Number(o),n=!o.includes(".")||(o.split(".")[1]||"").length<=6;if(!Number.isFinite(r)||r<1||r>10||!n)return void this.$message.warning("手续费比例需在 1 - 10 之间,且小数位不超过6位");this.editForm.feeRate=(r/100).toString();const l=String(this.editForm.gCode||"").trim();if(!/^\d{6}$/.test(l))return void this.$message.warning("请输入6位谷歌验证码");const c=Number(this.editForm.networkFee);this.editForm.networkFee=this.editForm.isOpen?Number.isFinite(c)&&c>0?c:.02:0;const d={...this.editForm,gCode:l},u=await(0,a.updateShop)(d);!u||0!==u.code&&200!==u.code?this.$message({message:u.msg||"保存失败",type:"error",showClose:!0}):(this.$message({message:"已保存",type:"success",showClose:!0}),this.visibleEdit=!1,this.fetchMyShop())}catch(t){console.error("更新店铺失败:",t),console.log("更新店铺失败,请稍后重试")}},async handleDelete(){const t=await this.ensureGoogleStatusEnabledForWalletOp("删除店铺");if(t)try{const{value:t}=await this.$prompt("删除店铺将不可恢复,请输入 6 位谷歌验证码确认删除","安全验证",{confirmButtonText:"确认删除",cancelButtonText:"取消",type:"warning",inputPlaceholder:"6位数字验证码",inputPattern:/^\d{6}$/,inputErrorMessage:"谷歌验证码必须是6位数字"}),e=String(t||"").trim();if(!/^\d{6}$/.test(e))return void this.$message.warning("谷歌验证码必须是6位数字");const i=await(0,a.deleteShop)(this.shop.id,e);!i||0!==i.code&&200!==i.code||(this.$message({message:"删除成功",type:"success",showClose:!0}),this.resetShopState(),this.loaded=!1,setTimeout(()=>{this.fetchMyShop()},500))}catch(e){}},async handleToggleShop(){try{const t=2===this.shop.state,e=t?"确定开启店铺吗?":"确定关闭该店铺吗?关闭后用户将无法访问";await this.$confirm(e,"提示",{type:"warning"});const i=await(0,a.closeShop)(this.shop.id);!i||0!==i.code&&200!==i.code?console.log("操作失败"):(this.$message({message:t?"店铺已开启":"店铺已关闭",type:"success",showClose:!0}),this.fetchMyShop())}catch(t){}},handleGoNew(){this.canCreateShop?this.$router.push("/account/shop-new"):this.$message({message:"每个用户仅允许一个店铺,无法新建",type:"warning",showClose:!0})},handleAddProduct(){this.hasShop?this.$router.push({path:"/account/product-machine-add",query:{shopId:this.shop.id}}):this.$message({message:"请先创建店铺",type:"warning",showClose:!0})},handleWalletBind(){this.hasShop?this.$router.push("/account/shop-config"):this.$message({message:"请先创建店铺",type:"warning",showClose:!0})}}}},2654:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"receipt-page"},[e("div",{staticClass:"card",attrs:{"aria-label":"收款记录",tabindex:"0"}},[t._m(0),t.loading?e("div",{staticClass:"loading"},[e("i",{staticClass:"el-icon-loading",attrs:{"aria-label":"加载中",role:"img"}}),t._v(" 加载中... ")]):e("div",[e("el-table",{ref:"receiptTable",staticStyle:{width:"100%","table-layout":"fixed"},attrs:{data:t.rows,border:"",stripe:"",size:"small","row-key":t.getRowKey,"expand-row-keys":t.expandedRowKeys,"row-class-name":t.getRowClassName,"header-cell-style":{textAlign:"left"},"cell-style":{textAlign:"left"}},on:{"row-click":t.handleRowClick,"expand-change":t.handleExpandChange}},[t.rows.length>0?e("el-table-column",{attrs:{type:"expand",width:"46"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("div",{staticClass:"detail-panel"},[e("div",{staticClass:"detail-grid"},[e("div",{staticClass:"detail-item"},[e("span",{staticClass:"detail-label"},[t._v("付款网络/币种")]),e("span",{staticClass:"detail-value"},[e("span",{staticClass:"badge"},[t._v(t._s(t.formatChain(i.row.fromChain)||"-"))]),e("span",{staticClass:"badge badge-blue"},[t._v(t._s(String(i.row.fromSymbol||i.row.coin||"").toUpperCase()))])])]),e("div",{staticClass:"detail-item"},[e("span",{staticClass:"detail-label"},[t._v("订单号")]),e("span",{staticClass:"detail-value mono"},[t._v(t._s(i.row.orderId||"-"))])]),e("div",{staticClass:"detail-item"},[e("span",{staticClass:"detail-label"},[t._v("实收金额")]),e("span",{staticClass:"detail-value"},[t._v(t._s(t.formatAmount(i.row.receivedAmount,i.row.toSymbol||i.row.coin||"").text))])]),e("div",{staticClass:"detail-item"},[e("span",{staticClass:"detail-label"},[t._v("应收金额")]),e("span",{staticClass:"detail-value"},[t._v(t._s(t.formatAmount(i.row.realAmount,i.row.toSymbol||i.row.coin||"").text))])]),e("div",{staticClass:"detail-item"},[e("span",{staticClass:"detail-label"},[t._v("手续费")]),e("span",{staticClass:"detail-value"},[t._v(t._s(t.formatAmount(i.row.fee,i.row.toSymbol||i.row.coin||"").text))])]),e("div",{staticClass:"detail-item"},[e("span",{staticClass:"detail-label"},[t._v("手续费比例")]),e("span",{staticClass:"detail-value"},[t._v(t._s(t.formatFeeRate(i.row.feeRate)))])])])])]}}],null,!1,1687925686)}):t._e(),e("el-table-column",{attrs:{label:"支付时间",width:"160"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatFullTime(e.row.createTime)))]}}])}),e("el-table-column",{attrs:{label:"实收金额",width:"140",align:"right"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",{staticClass:"amount-green"},[t.formatAmount(i.row.receivedAmount,i.row.toSymbol||i.row.coin||"").truncated?e("el-tooltip",{attrs:{content:`+${t.formatAmount(i.row.receivedAmount,i.row.toSymbol||i.row.coin||"").full} ${(i.row.toSymbol||i.row.coin||"").toUpperCase()}`,placement:"top"}},[e("span",[t._v(" +"+t._s(t.formatAmount(i.row.receivedAmount,i.row.toSymbol||i.row.coin||"").text)+" "+t._s((i.row.toSymbol||i.row.coin||"").toUpperCase())+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(" +"+t._s(t.formatAmount(i.row.receivedAmount,i.row.toSymbol||i.row.coin||"").text)+" "+t._s((i.row.toSymbol||i.row.coin||"").toUpperCase())+" ")])],1)]}}])}),e("el-table-column",{attrs:{label:"收款网络",width:"140"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatChain(e.row.toChain)))]}}])}),e("el-table-column",{attrs:{label:"收款币种",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(String(e.row.coin||"").toUpperCase()))]}}])}),e("el-table-column",{attrs:{label:"支付状态",width:"120"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-tag",{attrs:{type:t.getStatusType(i.row.status),size:"small"}},[t._v(t._s(t.getStatusText(i.row.status)))])]}}])}),e("el-table-column",{attrs:{label:"状态更新时间",width:"160"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatFullTime(e.row.updateTime)))]}}])})],1),t.rows.length?t._e():e("div",{staticClass:"empty"},[e("div",{staticClass:"empty-icon"},[t._v("💳")]),e("div",{staticClass:"empty-text"},[t._v("暂无收款记录")])]),e("div",{staticClass:"pagination"},[e("el-pagination",{attrs:{background:"",layout:"prev, pager, next, jumper","current-page":t.page,"page-size":t.pageSize,total:t.total},on:{"update:currentPage":function(e){t.page=e},"update:current-page":function(e){t.page=e},"current-change":t.fetchList}})],1)],1)])])},e.Yp=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"card-header"},[e("h3",{staticClass:"card-title"},[t._v("收款记录")])])}]},2835:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"order-detail-page"},[e("h2",{staticClass:"title"},[t._v("订单详情")]),t.loading?e("div",{staticClass:"loading"},[t._v("加载中...")]):e("div",[e("el-card",{staticClass:"section"},[e("div",{staticClass:"row"},[e("span",{staticClass:"label"},[t._v("订单ID:")]),e("span",{staticClass:"value mono"},[t._v(t._s(t.order.id||"—"))])]),e("div",{staticClass:"row"},[e("span",{staticClass:"label"},[t._v("订单号:")]),e("span",{staticClass:"value mono"},[t._v(t._s(t.order.orderNumber||"—"))])]),e("div",{staticClass:"row"},[e("span",{staticClass:"label"},[t._v("状态:")]),e("span",{staticClass:"value"},[t._v(t._s(t.getOrderStatusText(t.order.status)))])]),e("div",{staticClass:"row"},[e("span",{staticClass:"label"},[t._v("店铺:")]),e("span",{staticClass:"value"},[t._v(t._s(t.order.shopName||"—"))])]),e("div",{staticClass:"row"},[e("span",{staticClass:"label"},[t._v("订单总价"),t.order.payCoin?e("span",[t._v("("+t._s(t.order.payCoin)+")")]):t._e(),t._v(":")]),e("span",{staticClass:"value strong"},[t._v(t._s(t.order.totalPrice))])]),e("div",{staticClass:"row"},[e("span",{staticClass:"label"},[t._v("实际支付总金额"),t.order.payCoin?e("span",[t._v("("+t._s(t.order.payCoin)+")")]):t._e(),t._v(":")]),e("span",{staticClass:"value strong"},[t._v(t._s(null!==t.order.totalPayAmount&&void 0!==t.order.totalPayAmount?t.order.totalPayAmount:""))])]),e("div",{staticClass:"row"},[e("span",{staticClass:"label"},[e("el-tooltip",{attrs:{content:"当前为平均算力值,实际算力值以最终结算为准。",placement:"top"}},[e("i",{staticClass:"el-icon-question tip-icon"})]),t._v(" 平均算力 : ")],1),e("span",{staticClass:"value"},[t._v(t._s(t.formatPowerWithUnit(t.order.totalPracticalPower,t.order.unit)))])]),e("div",{staticClass:"row"},[e("span",{staticClass:"label"},[t._v("理论总算力:")]),e("span",{staticClass:"value"},[t._v(t._s(t.formatPowerWithUnit(t.order.totalTheoryPower,t.order.unit)))])]),e("div",{staticClass:"row"},[e("span",{staticClass:"label"},[t._v("实际/理论算力比值:")]),e("span",{staticClass:"value"},[t._v(t._s(t.formatPowerRatio(t.order.powerRatio)))])]),e("div",{staticClass:"row"},[e("span",{staticClass:"label"},[t._v("创建时间:")]),e("span",{staticClass:"value"},[t._v(t._s(t.formatDateTime(t.order.createTime)))])]),8===Number(t.order.status)?e("div",{staticClass:"row"},[e("span",{staticClass:"label"},[t._v("订单完成时间:")]),e("span",{staticClass:"value"},[t._v(t._s(t.formatDateTime(t.order.endTime)))])]):t._e()]),e("el-card",{staticClass:"section",staticStyle:{"margin-top":"12px"}},[e("div",{staticClass:"sub-title"},[t._v("机器列表")]),e("el-table",{staticStyle:{width:"100%"},attrs:{data:t.items,border:"",size:"small","header-cell-style":{textAlign:"left"},"cell-style":{textAlign:"left"}}},[e("el-table-column",{attrs:{prop:"productMachineId",label:"机器ID","min-width":"120"}}),e("el-table-column",{attrs:{label:"矿机类型","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatMachineType(e.row&&e.row.type)))]}}])}),e("el-table-column",{attrs:{"min-width":"120"},scopedSlots:t._u([{key:"header",fn:function(){return[e("span",[e("el-tooltip",{attrs:{content:"当前为平均算力值,实际算力值以最终结算为准。",placement:"top"}},[e("i",{staticClass:"el-icon-question tip-icon"})]),t._v(" 平均算力 ")],1)]},proxy:!0},{key:"default",fn:function(e){return[t._v(t._s(t.formatPowerWithUnit(e.row&&e.row.practicalPower,e.row&&e.row.unit)))]}}])}),e("el-table-column",{attrs:{label:"理论算力","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatPowerWithUnit(e.row&&e.row.theoryPower,e.row&&e.row.unit)))]}}])}),e("el-table-column",{attrs:{label:"实际/理论算力比值","min-width":"160"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatPowerRatio(e.row&&e.row.powerRatio)))]}}])}),e("el-table-column",{attrs:{prop:"leaseTime",label:"租赁天数","min-width":"100"}}),e("el-table-column",{attrs:{label:"购买数量","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row&&null!=e.row.numbers?e.row.numbers:"—"))]}}])}),e("el-table-column",{attrs:{prop:"price",label:"单价","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(i){return[t._v(" "+t._s(i.row&&null!=i.row.price?i.row.price:"")),i.row&&i.row.payCoin?e("span",[t._v(" "+t._s(i.row.payCoin))]):t._e()]}}])}),e("el-table-column",{attrs:{prop:"payAmount",label:"实际支付金额","min-width":"140"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",{staticClass:"value strong"},[t._v(t._s(i.row&&null!=i.row.payAmount?i.row.payAmount:""))]),i.row&&i.row.payCoin?e("span",[t._v(" "+t._s(i.row.payCoin))]):t._e()]}}])})],1)],1),e("div",{staticClass:"actions"},[e("el-button",{on:{click:function(e){return t.$router.back()}}},[t._v("返回")])],1)],1)])},e.Yp=[]},2921:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(5868),s=i(2570),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"25b9db76",null),l=n.exports},2935:function(t,e,i){Object.defineProperty(e,"B",{value:!0}),e.A=void 0,i(4114);i(4180);var a=i(4981);e.A={name:"OrderList",props:{items:{type:Array,default:()=>[]},emptyText:{type:String,default:"暂无数据"},showCheckout:{type:Boolean,default:!1},isSeller:{type:Boolean,default:!1},showEndTime:{type:Boolean,default:!1},onCancel:{type:Function,default:null}},data(){return{payLoading:!1,orderDialog:{visible:!1,qrContent:"",coin:"",amount:"",address:""},dialogVisible:!1,paymentDialog:{totalPrice:"",payAmount:"",noPayAmount:"",img:"",payCoin:""}}},computed:{safeItems(){return Array.isArray(this.items)?this.items:[]}},methods:{formatAmount(t,e){return(0,a.truncateAmountByCoin)(t,e)},buildQrSrc(t){if(!t)return"";try{const e=String(t).trim();return e.startsWith("data:")?e:`data:image/png;base64,${e}`}catch(e){return""}},formatDateTime(t){if(!t)return"—";try{const e=String(t);return e.includes("T")?e.replace("T"," "):e}catch(e){return String(t)}},formatMachineType(t){if(null===t||void 0===t)return"—";const e=Number(t);return 0===e?"ASIC":1===e?"GPU":"—"},async handleCheckout(t){if(t)try{this.payLoading=!0,this.paymentDialog={totalPrice:t.totalPrice,payAmount:t.payAmount,noPayAmount:t.noPayAmount,img:t.img,payCoin:t.payCoin||""},this.paymentDialog.img?(this.paymentDialog.img=this.buildQrSrc(this.paymentDialog.img),this.dialogVisible=!0):this.$message({message:"未返回支付二维码",type:"error",showClose:!0})}catch(e){console.log(e,"创建支付订单失败")}finally{this.payLoading=!1}},handleGoDetail(t){const e=t&&(null!=t.id?t.id:t.orderId);if(null==e)return void this.$message({message:"订单ID缺失",type:"error",showClose:!0});const i=this.isSeller?"seller":"buyer";try{sessionStorage.setItem("orderDetailFrom",i)}catch(a){}try{this.$router.push({path:`/account/order-detail/${e}`,query:{from:i}})}catch(a){this.$message({message:"无法跳转到详情页",type:"error",showClose:!0})}},handleCancel(t){if(!t||!this.onCancel)return;const e=t.id;null!=e?this.$confirm("确认取消该订单吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{try{this.onCancel({orderId:e})}catch(t){}}).catch(()=>null):this.$message({message:"订单ID缺失",type:"error",showClose:!0})},shouldShowActions(t){if(console.log(t,"飞机飞机覅附件s"),!this.showCheckout)return!1;const e=Number(t&&t.status);return console.log(e,"飞机飞机覅附件s"),0===e||6===e||10===e}}}},3225:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(631),s=i(8732),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"2a3c63db",null),l=n.exports},3466:function(t,e,i){var a=i(3999)["default"];Object.defineProperty(e,"B",{value:!0}),e.A=void 0,i(4114),i(8111),i(2489),i(7588),i(1701),i(7642),i(8004),i(3853),i(5876),i(2475),i(5024),i(1698);var s=i(1193),o=i(9662),r=a(i(5720));e.A={name:"AccountProductMachineAdd",data(){return{form:{productId:Number(this.$route.query.productId)||null,coin:this.$route.query.coin||"",productName:this.$route.query.name||"",machineCategory:"ASIC",sellCount:"",coinAndAlgoList:[{coin:"",algorithm:"",theoryPower:"",unit:"TH/S"}],powerDissipation:null,type:"",cost:"",costMap:{},maxLeaseDays:""},confirmVisible:!1,confirmData:{coin:"",algorithm:"",maxLeaseDays:"",saleNumbers:"",priceList:[]},rules:{productName:[{required:!0,message:"商品名称不能为空",trigger:"change"}],type:[{required:!0,message:"矿机型号不能为空",trigger:"blur"},{validator:(t,e,i)=>{const a=String(e||"");a&&0===a.trim().length?i(new Error("矿机型号不能全是空格")):i()},trigger:"blur"}],coinAndAlgoList:[{validator:(t,e,i)=>this.validateCoinAlgoRows(t,e,i),trigger:"blur"}],sellCount:[{validator:(t,e,i)=>{if("ASIC"!==this.form.machineCategory)return void i();const a=String(e??"");if(""===a)return void i(new Error("请输入出售机器数量"));if(!/^\d{1,4}$/.test(a))return void i(new Error("请输入 0-9999 的整数"));const s=Number(a);!Number.isInteger(s)||s<0||s>9999?i(new Error("范围需在 0-9999")):i()},trigger:"blur"}],powerDissipation:[{required:!0,message:"功耗不能为空",trigger:"blur"},{validator:(t,e,i)=>{const a=String(e||"");if(!a)return void i(new Error("功耗不能为空"));const s=/^\d{1,6}(\.\d{1,4})?$/;s.test(a)?Number(a)<=0?i(new Error("功耗必须大于0")):i():i(new Error("功耗整数最多6位,小数最多4位"))},trigger:"blur"}],cost:[{validator(t,e,i){if(Array.isArray(this.payTypeDefs)&&this.payTypeDefs.length>0)return void i();const a=String(e||"");if(!a)return void i(new Error("请填写机器成本"));const s=/^\d{1,12}(\.\d{1,2})?$/;s.test(a)?Number(a)<=0?i(new Error("成本必须大于 0")):i():i(new Error("成本整数最多12位,小数最多2位"))},trigger:"blur"}],maxLeaseDays:[{required:!0,message:"请填写最大租赁天数",trigger:"blur"},{validator:(t,e,i)=>{const a=String(e??"");if(!a)return void i(new Error("请填写最大租赁天数"));if(!/^\d{1,3}$/.test(a))return void i(new Error("仅允许整数,范围 1-365"));const s=Number(a);!Number.isInteger(s)||s<1||s>365?i(new Error("范围需在 1-365 天")):i()},trigger:"blur"}]},miners:[],minersLoading:!1,selectedMiner:"",machineOptions:[],machinesLoading:!1,selectedMachines:[],selectedMachineRows:[],saving:!1,lastCostBaseline:0,lastCostMapBaseline:{},lastTypeBaseline:"",lastMaxLeaseDaysBaseline:0,lastPowerDissipationBaseline:0,lastTheoryPowerBaseline:0,lastUnitBaseline:"TH/S",gpuDialogVisible:!1,clientDownloadUrl:{NODE_ENV:"production",VUE_APP_BASE_API:"https://test.m2pool.com/api/",VUE_APP_BASE_URL:"'https://test.m2pool.com/'",VUE_APP_TITLE:"m2pool",BASE_URL:"/"}.VUE_APP_GPU_CLIENT_URL||"",hasDownloadedClient:!1,payTypeDefs:[],coinOptions:[],algoOptionsMap:{},loadingCoins:!1,loadingAlgos:{},walletBindDialogVisible:!1,params:{cost:353400,powerDissipation:.01,theoryPower:1e3,type:"",unit:"TH/S",productId:1,productMachineURDVos:[{user:"lx_888",miner:"iusfhufhu",price:353400,type:"",state:0},{user:"lx_888",miner:"iusfhufhu2",price:353400,type:"",state:0}]},userEmail:""}},created(){this.initPayTypesFromRoute(),this.lastTypeBaseline=this.form.type,this.rules&&this.rules.cost&&this.$set(this.rules,"cost",[{validator:this.validateCost,trigger:"blur"}]),this.$set(this.rules,"costMap",[{validator:this.validateCostMap,trigger:"blur"}]),this.getPayTypes(),this.loadSupportCoins(),this.userEmail=this.getLeasEmailFromStorage()},methods:{getLeasEmailFromStorage(){const t=localStorage.getItem("leasEmail");if(!t)return"";const e=String(t).trim();if(!e)return"";if(!e.startsWith("{")&&!e.startsWith("[")&&!e.startsWith('"'))return e;try{const t=JSON.parse(e);if("string"===typeof t)return t.trim();if(t&&"object"===typeof t){const e=t.email||t.leasEmail||t.userEmail;return e?String(e).trim():""}return""}catch(i){return e}},validateCoinAlgoRows(t,e,i){try{const t=Array.isArray(this.form.coinAndAlgoList)?this.form.coinAndAlgoList:[];if(!t.length)return void i(new Error("请至少添加一行币种/算法/算力/单位"));const e=/^\d{1,6}(\.\d{1,4})?$/;for(let a=0;a"string"===typeof t?t:t.coin||t.name||t).filter(Boolean):e&&"object"===typeof e&&(this.coinOptions=Object.keys(e).map(t=>{const i=e[t];return"string"===typeof i?i:i.coin||i.name||t}).filter(Boolean)),this.coinOptions=[...new Set(this.coinOptions)].sort()}}catch(t){console.error("加载币种列表失败",t)}finally{this.loadingCoins=!1}},async handleCoinChange(t,e){this.$set(this.form.coinAndAlgoList[t],"algorithm",""),e&&await this.loadAlgorithmsForCoin(e,t)},async loadAlgorithmsForCoin(t,e){if(t&&!(this.algoOptionsMap[t]&&this.algoOptionsMap[t].length>0)){this.$set(this.loadingAlgos,e,!0);try{const e=await(0,s.getSupportAlgo)(t);if(e&&(0===e.code||200===e.code)){const i=e.data||[];let a=[];Array.isArray(i)?a=i.map(t=>"string"===typeof t?t:t.algorithm||t.algo||t.name||t).filter(Boolean):i&&"object"===typeof i&&(a=Object.keys(i).map(t=>{const e=i[t];return"string"===typeof e?e:e.algorithm||e.algo||e.name||t}).filter(Boolean)),this.$set(this.algoOptionsMap,t,[...new Set(a)].sort())}}catch(i){console.error(`加载币种 ${t} 的算法列表失败`,i),this.$set(this.algoOptionsMap,t,[])}finally{this.$set(this.loadingAlgos,e,!1)}}},handleCoinRowTheoryInput(t){let e=String(this.form.coinAndAlgoList[t].theoryPower??"");e=e.replace(/[^0-9.]/g,"");const i=e.indexOf(".");-1!==i&&(e=e.slice(0,i+1)+e.slice(i+1).replace(/\./g,""));const a=e.endsWith("."),s=e.split(".");let o=s[0]||"",r=s[1]||"";o.length>6&&(o=o.slice(0,6)),r&&(r=r.slice(0,4)),e=r.length?`${o}.${r}`:a?`${o}.`:o,this.$set(this.form.coinAndAlgoList[t],"theoryPower",e)},handleCoinRowUnitChange(t,e){this.$set(this.form.coinAndAlgoList[t],"unit",e)},handleAddCoinAlgoRow(){if(this.form.coinAndAlgoList.length>=10)return void this.$message.warning("最多添加 10 行");const t=this.form.coinAndAlgoList[this.form.coinAndAlgoList.length-1]||{unit:"TH/S"},e=this.form.coinAndAlgoList.length;this.form.coinAndAlgoList.push({coin:"",algorithm:"",theoryPower:"",unit:t.unit||"TH/S"}),this.$set(this.loadingAlgos,e,!1)},handleRemoveCoinAlgoRow(t){this.form.coinAndAlgoList.length<=1||this.form.coinAndAlgoList.splice(t,1)},buildCoinCsvFromRows(){const t=new Set,e=Array.isArray(this.form.coinAndAlgoList)?this.form.coinAndAlgoList:[];return e.forEach(e=>{const i=String(e.coin||"").split(/[,\s,、]+/).map(t=>t.trim().toUpperCase()).filter(Boolean);i.forEach(e=>t.add(e))}),Array.from(t).join(",")},buildAlgoCsvFromRows(){const t=new Set,e=Array.isArray(this.form.coinAndAlgoList)?this.form.coinAndAlgoList:[];return e.forEach(e=>{const i=String(e.algorithm||"").split(/[,\s,、]+/).map(t=>t.trim().toUpperCase()).filter(Boolean);i.forEach(e=>t.add(e))}),Array.from(t).join(",")},handleCoinsInput(){let t=String(this.form.coinsInput||"");t=t.replace(/[\u4e00-\u9fa5]/g,""),this.form.coinsInput=t},handleAlgorithmsInput(){let t=String(this.form.algorithmsInput||"");t=t.replace(/[\u4e00-\u9fa5]/g,""),this.form.algorithmsInput=t},normalizeCsv(t,e=!0){const i=String(t||"").split(/[,\s,、]+/).map(t=>t.trim()).filter(Boolean),a=e?i.map(t=>t.toUpperCase()):i;return a.join(",")},buildPriceList(){const t=[],e=Array.isArray(this.payTypeDefs)?this.payTypeDefs:[];return e.forEach(e=>{const i=e.key,a=this.form.costMap?this.form.costMap[i]:"",s=Number(a);!Number.isFinite(s)||s<=0||t.push({chain:e.chain,coin:e.coin,price:s})}),t},async getPayTypes(){try{const t=await(0,o.getPayTypes)();if(!t||0!==t.code&&200!==t.code)this.walletBindDialogVisible=!0;else{const e=Array.isArray(t.data)?t.data:[],i=[],a=new Set;e.forEach(t=>{const e=String(t&&t.payChain?t.payChain:"").toUpperCase(),s=String(t&&t.payCoin?t.payCoin:"").toUpperCase();if(!e&&!s)return;const o=[e,s].filter(Boolean).join("-");a.has(o)||(a.add(o),i.push({chain:e,coin:s,key:o,label:o,image:t&&t.payCoinImage?String(t.payCoinImage):""}))}),this.payTypeDefs=i;const s={};this.payTypeDefs.forEach(t=>{s[t.key]=this.form.costMap&&this.form.costMap[t.key]||""}),this.form.costMap=s,0===i.length&&(this.walletBindDialogVisible=!0)}}catch(t){this.walletBindDialogVisible=!0}},handleGoToWalletBind(){this.$router.push("/account/shop-config")},handleSellCountInput(){let t=String(this.form.sellCount??"");if(t=t.replace(/\D/g,""),t.length>4&&(t=t.slice(0,4)),t){const e=Number(t);e>9999&&(t="9999")}this.form.sellCount=t,t&&""!==t||this.$nextTick(()=>{this.$refs.machineForm&&this.$refs.machineForm.clearValidate("sellCount")})},handleSellCountBlur(){const t=String(this.form.sellCount??"");if(""===t)return;const e=Number(t);(!Number.isInteger(e)||e<0||e>9999)&&(this.$message.warning("出售机器数量需为 0-9999 的整数"),this.form.sellCount="")},handleMachineCategoryChange(t){},handleDownloadClient(t){const e=this.getLeasEmailFromStorage();if(console.log(e,"userEmail"),!e)return void this.$message.warning("未获取到登录邮箱,无法下载客户端,请重新登录后再试");this.downloadUrl=`${r.default.defaults.baseURL}/lease/user/downloadClient?userEmail=${encodeURIComponent(e)}&type=${encodeURIComponent(t||"")}`;let i=document.createElement("a");i.href=this.downloadUrl,i.click()},handleGpuClientStarted(){this.$router.push("/account/products")},validateCost(t,e,i){if(Array.isArray(this.payTypeDefs)&&this.payTypeDefs.length>0)return this.validateCostMap(t,e,i);const a=String(e||"");if(!a)return void i(new Error("请填写机器成本"));const s=/^\d{1,12}(\.\d{1,2})?$/;s.test(a)?Number(a)<=0?i(new Error("成本必须大于 0")):i():i(new Error("成本整数最多12位,小数最多2位"))},validateCostMap(t,e,i){try{const t=Array.isArray(this.payTypeDefs)?this.payTypeDefs:[];if(!t.length)return void i();const e=/^\d{1,12}(\.\d{1,2})?$/;for(let a=0;a{const e=String(t&&t.chain?t.chain:"").toUpperCase(),a=String(t&&t.coin?t.coin:"").toUpperCase();if(!e&&!a)return;const s=[e,a].filter(Boolean).join("-"),o=s;i.push({chain:e,coin:a,key:s,label:o})});const a=new Map;i.forEach(t=>{a.has(t.key)||a.set(t.key,t)}),this.payTypeDefs=Array.from(a.values());const s={};this.payTypeDefs.forEach(t=>{s[t.key]=""}),this.form.costMap=s,this.lastCostMapBaseline={...s}}catch(t){this.payTypeDefs=[]}},handleBack(){this.$router.back()},handleNumeric(t){let e=String(this.form[t]??"");e=e.replace(/[^0-9.]/g,"");const i=e.indexOf(".");-1!==i&&(e=e.slice(0,i+1)+e.slice(i+1).replace(/\./g,""));const a=e.endsWith(".");if("cost"===t){const t=e.split(".");let i=t[0]||"",s=t[1]||"";i.length>12&&(i=i.slice(0,12)),s&&(s=s.slice(0,2)),e=s.length?`${i}.${s}`:a?`${i}.`:i}else if("powerDissipation"===t||"theoryPower"===t){const t=e.split(".");let i=t[0]||"",s=t[1]||"";i.length>6&&(i=i.slice(0,6)),s&&(s=s.slice(0,4)),e=s.length?`${i}.${s}`:a?`${i}.`:i}else{if("maxLeaseDays"===t)return e=e.replace(/\D/g,""),e.length>3&&(e=e.slice(0,3)),this.form[t]=e,void this.syncMaxLeaseDaysToRows();if(-1!==i){const[t,i]=e.split(".");e=t+"."+(i?i.slice(0,6):"")}}this.form[t]=e},handleCostMapInput(t,e){let i=String(e??this.form.costMap[t]??"");i=i.replace(/[^0-9.]/g,"");const a=i.indexOf(".");-1!==a&&(i=i.slice(0,a+1)+i.slice(a+1).replace(/\./g,""));const s=i.endsWith("."),o=i.split(".");let r=o[0]||"",n=o[1]||"";r.length>12&&(r=r.slice(0,12)),n&&(n=n.slice(0,2)),i=n.length?`${r}.${n}`:s?`${r}.`:r,this.$set(this.form.costMap,t,i)},handleTypeInput(){"string"===typeof this.form.type&&this.form.type.length>20&&(this.form.type=this.form.type.slice(0,20)),this.form.type&&""!==this.form.type.trim()||this.$nextTick(()=>{this.$refs.machineForm&&this.$refs.machineForm.clearValidate("type")})},syncCostToRows(){const t=Number(this.form.cost);if(!Number.isFinite(t))return;const e=this.lastCostBaseline;this.selectedMachineRows=this.selectedMachineRows.map(i=>{const a=Number(i.price);return Number.isFinite(a)&&a!==e?i:{...i,price:t}}),this.lastCostBaseline=t},updateMachineType(){this.lastTypeBaseline=this.form.type},handleRowPowerDissipationInput(t){let e=String(this.selectedMachineRows[t].powerDissipation??"");e=e.replace(/[^0-9.]/g,"");const i=e.indexOf(".");-1!==i&&(e=e.slice(0,i+1)+e.slice(i+1).replace(/\./g,""));const a=e.endsWith("."),s=e.split(".");let o=s[0]||"",r=s[1]||"";o.length>6&&(o=o.slice(0,6)),r&&(r=r.slice(0,4)),e=r.length?`${o}.${r}`:a?`${o}.`:o,this.$set(this.selectedMachineRows[t],"powerDissipation",e)},handleRowPowerDissipationBlur(t){const e=String(this.selectedMachineRows[t].powerDissipation??""),i=/^\d{1,6}(\.\d{1,4})?$/;(!e||Number(e)<=0||!i.test(e))&&(this.$message.warning("功耗需大于0,整数最多6位,小数最多4位"),this.$set(this.selectedMachineRows[t],"powerDissipation",""))},handleRowTheoryPowerInput(t){let e=String(this.selectedMachineRows[t].theoryPower??"");e=e.replace(/[^0-9.]/g,"");const i=e.indexOf(".");-1!==i&&(e=e.slice(0,i+1)+e.slice(i+1).replace(/\./g,""));const a=e.endsWith("."),s=e.split(".");let o=s[0]||"",r=s[1]||"";o.length>6&&(o=o.slice(0,6)),r&&(r=r.slice(0,4)),e=r.length?`${o}.${r}`:a?`${o}.`:o,this.$set(this.selectedMachineRows[t],"theoryPower",e)},handleRowTheoryPowerBlur(t){const e=String(this.selectedMachineRows[t].theoryPower??""),i=/^\d{1,6}(\.\d{1,4})?$/;(!e||Number(e)<=0||!i.test(e))&&(this.$message.warning("理论算力需大于0,整数最多6位,小数最多4位"),this.$set(this.selectedMachineRows[t],"theoryPower",""))},handleRowUnitChange(t,e){this.$set(this.selectedMachineRows[t],"unit",e)},syncMaxLeaseDaysToRows(){const t=this.form.maxLeaseDays,e=Number(t);if(!Number.isInteger(e))return;const i=this.lastMaxLeaseDaysBaseline;this.selectedMachineRows=this.selectedMachineRows.map(t=>{const a=Number(t.maxLeaseDays);return Number.isInteger(a)&&a!==i?t:{...t,maxLeaseDays:e}}),this.lastMaxLeaseDaysBaseline=e},handleRowMaxLeaseDaysInput(t){let e=String(this.selectedMachineRows[t].maxLeaseDays??"");e=e.replace(/\D/g,""),e.length>3&&(e=e.slice(0,3)),this.$set(this.selectedMachineRows[t],"maxLeaseDays",e)},handleRowMaxLeaseDaysBlur(t){const e=String(this.selectedMachineRows[t].maxLeaseDays??"");if(!/^\d{1,3}$/.test(e))return this.$message.warning("最大租赁天数需为 1-365 的整数"),void this.$set(this.selectedMachineRows[t],"maxLeaseDays","");const i=Number(e);(!Number.isInteger(i)||i<1||i>365)&&(this.$message.warning("最大租赁天数需为 1-365 的整数"),this.$set(this.selectedMachineRows[t],"maxLeaseDays",""))},handleRowPriceInput(t){let e=String(this.selectedMachineRows[t].price??"");e=e.replace(/[^0-9.]/g,"");const i=e.indexOf(".");-1!==i&&(e=e.slice(0,i+1)+e.slice(i+1).replace(/\./g,""));const a=e.endsWith("."),s=e.split(".");let o=s[0]||"",r=s[1]||"";o.length>12&&(o=o.slice(0,12)),r&&(r=r.slice(0,2)),e=r.length?`${o}.${r}`:a?`${o}.`:o,this.$set(this.selectedMachineRows[t],"price",e)},handleRowPriceMapInput(t,e){const i=this.selectedMachineRows[t],a={...i.priceMap||{}};let s=String(a[e]??"");s=s.replace(/[^0-9.]/g,"");const o=s.indexOf(".");-1!==o&&(s=s.slice(0,o+1)+s.slice(o+1).replace(/\./g,""));const r=s.endsWith("."),n=s.split(".");let l=n[0]||"",c=n[1]||"";l.length>12&&(l=l.slice(0,12)),c&&(c=c.slice(0,2)),s=c.length?`${l}.${c}`:r?`${l}.`:l,a[e]=s,this.$set(this.selectedMachineRows[t],"priceMap",a)},handleRowPriceMapBlur(t,e){const i=this.selectedMachineRows[t],a=String((i.priceMap&&i.priceMap[e])??""),s=/^\d{1,12}(\.\d{1,2})?$/;if(!a||Number(a)<=0||!s.test(a)){this.$message.warning("价格必须大于0,整数最多12位,小数最多2位");const a={...i.priceMap||{}};a[e]="",this.$set(this.selectedMachineRows[t],"priceMap",a)}},handleRowPriceBlur(t){const e=String(this.selectedMachineRows[t].price??""),i=/^\d{1,12}(\.\d{1,2})?$/;(!e||Number(e)<=0||!i.test(e))&&(this.$message.warning("价格必须大于0,整数最多12位,小数最多2位"),this.$set(this.selectedMachineRows[t],"price",""))},handleRowTypeInput(t){const e=String(this.selectedMachineRows[t].type||""),i=e.length>20?e.slice(0,20):e;this.$set(this.selectedMachineRows[t],"type",i)},handleRowTypeBlur(t){const e=this.selectedMachineRows[t].type,i=t=>"string"===typeof t&&t.length>0&&0===t.trim().length;i(e)&&(this.$message.warning("矿机型号不能全是空格"),this.$set(this.selectedMachineRows[t],"type",""))},handleToggleState(t){const e=this.selectedMachineRows[t].state;this.$set(this.selectedMachineRows[t],"state",0===e?1:0)},async fetchMiners(){this.minersLoading=!0;try{const t=await getUserMinersList({coin:this.form.coin||""}),e=t?.data;let i=[];Array.isArray(e)?i=e:e&&"object"===typeof e?Object.keys(e).forEach(t=>{const a=Array.isArray(e[t])?e[t]:[];a.forEach(t=>{t&&t.user&&t.coin&&i.push({user:t.user,coin:t.coin,miner:t.miner||null})})}):e&&e.additionalProperties1&&(i=[e.additionalProperties1]),this.form.coin&&(i=i.filter(t=>t.coin===this.form.coin)),this.miners=i}catch(t){console.error("获取挖矿账户失败",t)}finally{this.minersLoading=!1}},async handleMinerChange(t){if(this.selectedMachines=[],!t)return void(this.machineOptions=[]);const[e,i]=t.split("|");this.machinesLoading=!0;try{const t={coin:i,user:e},a=await getUserMachineList(t),s=a?.data||[];this.machineOptions=Array.isArray(s)?s:[],console.log("选择挖矿账户:",{user:e,coin:i}),console.log("获取机器列表响应:",a),console.log("机器列表数据:",this.machineOptions)}catch(a){console.error("获取机器列表失败",a)}finally{this.machinesLoading=!1}},async handleSave(){try{const t=await this.$refs.machineForm.validate();if(!t)return}catch(s){return}{const t=String(this.form.sellCount??"");if(""===t)return void this.$message.warning("请输入出售机器数量");const e=Number(t);if(!Number.isInteger(e)||e<0||e>9999)return void this.$message.warning("出售机器数量需为 0-9999 的整数");if(0===e)return void this.$message.warning("出售机器数量为 0,无需提交")}const t=t=>"string"===typeof t&&t.length>0&&0===t.trim().length;if(t(this.form.type))return void this.$message.warning("矿机型号不能全是空格");const e=this.selectedMachineRows.findIndex(e=>t(e.type));if(-1!==e)return void this.$message.warning("存在行的矿机型号全是空格,请修正后再试");const i=this.buildCoinCsvFromRows(),a=this.buildAlgoCsvFromRows();this.confirmData={coin:i||"-",algorithm:a||"-",maxLeaseDays:this.form.maxLeaseDays,saleNumbers:this.form.sellCount,priceList:this.buildPriceList()},this.confirmVisible=!0},async doSubmit(){this.saving=!0;try{const t=(this.form.coinAndAlgoList||[]).map(t=>({coin:String(t.coin||"").toUpperCase().trim(),algorithm:String(t.algorithm||"").toUpperCase().trim(),theoryPower:Number(t.theoryPower)||0,unit:t.unit})),e={coinAndAlgoList:t,maxLeaseDays:Number(this.form.maxLeaseDays)||0,name:this.form.type,powerDissipation:Number(this.form.powerDissipation)||0,saleNumbers:Number(this.form.sellCount)||0,priceList:this.buildPriceList()};e.priceList=(e.priceList||[]).filter(t=>Number(t.price)>0),console.log(e,"请求参数");const i=await(0,s.addAsicMachine)(e);!i||0!==i.code&&200!==i.code||(this.$message({message:"创建成功",duration:3e3,showClose:!0,type:"success"}),this.confirmVisible=!1,this.$router.push("/account/products"))}catch(t){console.error("创建商品失败",t),console.log("创建失败")}finally{this.saving=!1}}}}},3468:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(1218),s=i(1561),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"22b0f65e",null),l=n.exports},3574:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"product-new"},[e("el-card",{staticClass:"product-form-card"},[e("div",{staticClass:"card-header",attrs:{slot:"header"},slot:"header"},[e("h2",[t._v("新增商品")]),e("p",{staticClass:"subtitle"},[t._v("创建新的商品信息")])]),e("el-form",{ref:"productForm",staticClass:"product-form",attrs:{model:t.form,rules:t.rules,"label-width":"120px"}},[e("el-form-item",{attrs:{label:"商品名称",prop:"name"}},[e("el-input",{attrs:{placeholder:"请输入商品名称,如:Nexa-M2-Miner",maxlength:"30","show-word-limit":""},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),e("el-form-item",{staticClass:"align-like-input",attrs:{label:"商品类型",prop:"type"}},[e("el-radio-group",{model:{value:t.form.type,callback:function(e){t.$set(t.form,"type",e)},expression:"form.type"}},[e("el-radio",{attrs:{label:0}},[t._v("矿机")])],1)],1),e("el-form-item",{attrs:{label:"挖矿币种",prop:"coin"}},[e("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择挖矿币种"},model:{value:t.form.coin,callback:function(e){t.$set(t.form,"coin",e)},expression:"form.coin"}},t._l(t.coinOptions,function(t){return e("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})}),1)],1),e("el-form-item",{attrs:{label:"商品描述",prop:"description"}},[e("el-input",{attrs:{type:"textarea",rows:4,placeholder:"请输入商品描述",maxlength:"100","show-word-limit":""},model:{value:t.form.description,callback:function(e){t.$set(t.form,"description",e)},expression:"form.description"}})],1),e("el-form-item",{staticClass:"align-like-input",attrs:{label:"商品状态",prop:"state"}},[e("el-radio-group",{model:{value:t.form.state,callback:function(e){t.$set(t.form,"state",e)},expression:"form.state"}},[e("el-radio",{attrs:{label:0}},[t._v("上架")]),e("el-radio",{attrs:{label:1}},[t._v("下架")])],1)],1),e("el-form-item",{staticClass:"actions-row"},[e("div",{staticClass:"form-actions"},[e("el-button",{attrs:{type:"primary",size:"medium",loading:t.submitting},on:{click:t.handleSubmit}},[t._v("创建商品")]),e("el-button",{attrs:{size:"medium"},on:{click:t.handleReset}},[t._v("重置")]),e("el-button",{attrs:{size:"medium"},on:{click:t.handleCancel}},[t._v("取消")])],1)])],1)],1)],1)},e.Yp=[]},3723:function(t,e,i){var a=i(3999)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e.productRoutes=e.mainRoutes=e["default"]=e.childrenRoutes=e.checkoutRoutes=e.cartRoutes=e.authRoutes=e.accountRoutes=void 0;var s=a(i(1774));const o=e.authRoutes=[{path:"/login",name:"Login",component:()=>Promise.resolve().then(()=>(0,s.default)(i(669))),meta:{title:"用户登录",description:"登录到您的账户",requiresAuth:!1}},{path:"/register",name:"Register",component:()=>Promise.resolve().then(()=>(0,s.default)(i(8949))),meta:{title:"用户注册",description:"创建新账户",requiresAuth:!1}},{path:"/reset-password",name:"ResetPassword",component:()=>Promise.resolve().then(()=>(0,s.default)(i(6886))),meta:{title:"重置密码",description:"重置您的账户密码",requiresAuth:!1}}],r=e.productRoutes=[{path:"/productList",name:"productList",component:()=>Promise.resolve().then(()=>(0,s.default)(i(8235))),meta:{title:"商品列表",description:"浏览所有可用商品",allAuthority:["all"]}},{path:"/product/:id",name:"productDetail",component:()=>Promise.resolve().then(()=>(0,s.default)(i(3886))),meta:{title:"商品详情",description:"查看商品详细信息",allAuthority:["all"]}}],n=e.cartRoutes=[{path:"/cart",name:"cart",component:()=>Promise.resolve().then(()=>(0,s.default)(i(3225))),meta:{title:"购物车",description:"管理购物车商品",allAuthority:["all"]}}],l=e.checkoutRoutes=[{path:"/checkout",name:"checkout",component:()=>Promise.resolve().then(()=>(0,s.default)(i(5638))),meta:{title:"订单结算",description:"完成订单结算",allAuthority:["all"]}}],c=e.accountRoutes=[{path:"/account",name:"account",component:()=>Promise.resolve().then(()=>(0,s.default)(i(2003))),redirect:"/account/shops",meta:{title:"个人中心",description:"管理个人资料和店铺",allAuthority:["all"]},children:[{path:"wallet",name:"Wallet",component:()=>Promise.resolve().then(()=>(0,s.default)(i(1296))),meta:{title:"我的钱包",description:"查看钱包余额、充值和提现",allAuthority:["all"]}},{path:"rechargeRecord",name:"RechargeRecord",component:()=>Promise.resolve().then(()=>(0,s.default)(i(1353))),meta:{title:"充值记录",description:"查看充值记录",allAuthority:["all"]}},{path:"withdrawalHistory",name:"WithdrawalHistory",component:()=>Promise.resolve().then(()=>(0,s.default)(i(4060))),meta:{title:"提现记录",description:"查看提现记录",allAuthority:["all"]}},{path:"receipt-record",name:"accountReceiptRecord",component:()=>Promise.resolve().then(()=>(0,s.default)(i(217))),meta:{title:"收款记录",description:"卖家收款流水记录",allAuthority:["all"]}},{path:"withdraw-record",name:"accountWithdrawRecord",component:()=>Promise.resolve().then(()=>(0,s.default)(i(6505))),meta:{title:"提现记录",description:"卖家提现流水记录",allAuthority:["all"]}},{path:"shop-new",name:"accountShopNew",component:()=>Promise.resolve().then(()=>(0,s.default)(i(3468))),meta:{title:"新增店铺",description:"创建新的店铺",allAuthority:["all"]}},{path:"shop-config",name:"accountShopConfig",component:()=>Promise.resolve().then(()=>(0,s.default)(i(6034))),meta:{title:"钱包绑定",description:"绑定店铺收款钱包",allAuthority:["all"]}},{path:"shops",name:"accountMyShops",component:()=>Promise.resolve().then(()=>(0,s.default)(i(2921))),meta:{title:"我的店铺",description:"查看我的店铺信息",allAuthority:["all"]}},{path:"product-new",name:"accountProductNew",component:()=>Promise.resolve().then(()=>(0,s.default)(i(9266))),meta:{title:"新增商品",description:"创建新的商品",allAuthority:["all"]}},{path:"products",name:"accountProducts",component:()=>Promise.resolve().then(()=>(0,s.default)(i(5097))),meta:{title:"商品列表",description:"管理店铺下的商品列表",allAuthority:["all"]}},{path:"purchased-machine-config",name:"accountPurchasedMachineConfig",component:()=>Promise.resolve().then(()=>(0,s.default)(i(5402))),meta:{title:"挖矿信息",description:"查看已购买的矿机配置信息",allAuthority:["all"]}},{path:"purchased-machine-detail/:id",name:"purchasedMachineDetail",component:()=>Promise.resolve().then(()=>(0,s.default)(i(7585))),meta:{title:"挖矿信息详情",description:"查看已购买的矿机详细信息",allAuthority:["all"]}},{path:"funds-flow",name:"accountFundsFlow",component:()=>Promise.resolve().then(()=>(0,s.default)(i(9510))),meta:{title:"资金流水",description:"充值/提现/消费记录切换查看",allAuthority:["all"]}},{path:"seller-funds-flow",name:"accountSellerFundsFlow",component:()=>Promise.resolve().then(()=>(0,s.default)(i(6754))),meta:{title:"资金流水",description:"卖家收款/提现流水记录",allAuthority:["all"]}},{path:"orders",name:"accountOrders",component:()=>Promise.resolve().then(()=>(0,s.default)(i(3852))),meta:{title:"订单列表",description:"查看与管理订单(按状态筛选)",allAuthority:["all"]}},{path:"seller-orders",name:"accountSellerOrders",component:()=>Promise.resolve().then(()=>(0,s.default)(i(1117))),meta:{title:"已售出订单",description:"卖家侧订单列表",allAuthority:["all"]}},{path:"order-detail/:id",name:"accountOrderDetail",component:()=>Promise.resolve().then(()=>(0,s.default)(i(2278))),meta:{title:"订单详情",description:"查看订单详细信息",allAuthority:["all"]}},{path:"product-detail/:id",name:"accountProductDetail",component:()=>Promise.resolve().then(()=>(0,s.default)(i(5355))),meta:{title:"商品详情",description:"个人中心 - 商品详情",allAuthority:["all"]}},{path:"product-machine-add",name:"accountProductMachineAdd",component:()=>Promise.resolve().then(()=>(0,s.default)(i(9594))),meta:{title:"添加出售机器",description:"为商品添加出售机器",allAuthority:["all"]}},{path:"security-settings",name:"accountSecuritySettings",component:()=>Promise.resolve().then(()=>(0,s.default)(i(6282))),meta:{title:"安全设置",description:"管理账户安全选项",allAuthority:["all"]}}]}],d=e.childrenRoutes=[...r,...n,...l,...c],u=e.mainRoutes=[...o,{path:"/",name:"Home",component:()=>Promise.resolve().then(()=>(0,s.default)(i(1182))),redirect:"/productList",children:d},{path:"*",redirect:"/productList"}];e["default"]=u},3831:function(t,e,i){Object.defineProperty(e,"B",{value:!0}),e.A=void 0,i(4114);var a=i(2549),s=i(6966),o=i(2032);e.A={name:"ResetPasswordPage",data(){const t=(t,e,i)=>{if(!e)return void i(new Error("请输入邮箱"));const a=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;a.test(e)?i():i(new Error("请输入有效的邮箱地址"))},e=(0,o.createPasswordValidator)({emptyMessage:"请输入新密码"}),i=(t,e,i)=>{e?e===this.resetForm.password?i():i(new Error("两次输入的密码不一致")):i(new Error("请再次输入新密码"))};return{resetForm:{email:"",code:"",password:"",confirmPassword:""},resetRules:{email:[{required:!0,validator:t,trigger:"blur"}],code:[{required:!0,message:"请输入验证码",trigger:"blur"},{min:1,max:10,message:"验证码长度为1-10位",trigger:"blur"}],password:[{required:!0,validator:e,trigger:"blur"}],confirmPassword:[{required:!0,validator:i,trigger:"blur"}]},loading:!1,sendingCode:!1,countdown:0,timer:null}},computed:{passwordStrength(){const t=this.resetForm.password;if(!t)return 0;let e=0;return t.length>=6&&(e+=1),t.length>=10&&(e+=1),/\d/.test(t)&&(e+=1),/[a-z]/.test(t)&&(e+=1),/[A-Z]/.test(t)&&(e+=1),/[^a-zA-Z0-9]/.test(t)&&(e+=1),e},passwordStrengthText(){const t=this.passwordStrength;return t<=2?"弱":t<=4?"中":"强"},passwordStrengthClass(){const t=this.passwordStrength;return t<=2?"weak":t<=4?"medium":"strong"}},beforeDestroy(){this.timer&&(clearInterval(this.timer),this.timer=null)},methods:{handleEmailChange(){this.resetForm.email=this.resetForm.email.trim()},goToShop(){"/productList"!==this.$route.path?this.$router.push("/productList"):this.$router.go(-1)},async handleSendCode(){const t=(this.resetForm.email||"").trim();if(!t)return this.$message.warning("请输入邮箱地址"),void this.$refs.resetForm.validateField("email");const e=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;if(!e.test(t))return this.$message.warning("请输入有效的邮箱地址"),void this.$refs.resetForm.validateField("email");this.sendingCode=!0;try{const e=await(0,a.sendUpdatePwdCode)({email:t});e&&200===e.code?(this.$message.success(e.msg||"验证码已发送,请查收邮箱"),this.startCountdown()):this.$message.error(e.msg||"发送验证码失败")}catch(i){console.error("发送验证码失败:",i),this.$message.error(i.message||"发送验证码失败,请重试")}finally{this.sendingCode=!1}},startCountdown(){this.countdown=60,this.timer=setInterval(()=>{this.countdown--,this.countdown<=0&&(clearInterval(this.timer),this.timer=null)},1e3)},async handleReset(){try{await this.$refs.resetForm.validate()}catch(t){return}this.loading=!0;try{const t=(this.resetForm.email||"").trim(),e=(this.resetForm.password||"").trim(),i=(this.resetForm.code||"").trim(),o=e;let r=o;const n=(0,s.rsaEncryptSync)(o);if(n)r=n;else{const t=await(0,s.rsaEncrypt)(o);if(!t)return this.$message.error("密码加密失败,请重试"),void(this.loading=!1);r=t}const l=await(0,a.updatePassword)({email:t,code:i,password:r});l&&200===l.code?(this.$message.success(l.msg||"密码重置成功,请使用新密码登录"),setTimeout(()=>{this.$router.push({path:"/login",query:{email:t}})},1500)):this.$message.error(l.msg||"密码重置失败")}catch(t){console.error("密码重置失败:",t),this.$message.error("密码重置失败,请重试")}finally{this.loading=!1}}}}},3852:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(3922),s=i(460),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"fbb1a9f4",null),l=n.exports},3886:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(4554),s=i(7692),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"1ac53d06",null),l=n.exports},3922:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"orders-page"},[e("h2",{staticClass:"title"},[t._v("订单列表")]),e("el-tabs",{on:{"tab-click":t.handleTabClick},model:{value:t.active,callback:function(e){t.active=e},expression:"active"}},[e("el-tab-pane",{attrs:{label:"订单进行中",name:"7"}},[e("order-list",{attrs:{items:t.orders[7],"show-checkout":!0,"show-end-time":!1,"on-cancel":t.handleCancelOrder,"empty-text":"暂无进行中的订单"}})],1),e("el-tab-pane",{attrs:{label:"订单已完成",name:"8"}},[e("order-list",{attrs:{items:t.orders[8],"show-checkout":!1,"show-end-time":!0,"empty-text":"暂无已完成的订单"}})],1),e("el-tab-pane",{attrs:{label:"订单生成失败",name:"11"}},[e("div",{staticClass:"order-fail-reason"},[t._v("失败原因:无法连接矿池,导致生成订单失败")]),e("order-list",{attrs:{items:t.orders[11],"show-checkout":!1,"show-end-time":!1,"empty-text":"暂无订单生成失败记录"}})],1)],1)],1)},e.Yp=[]},3944:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"withdrawal-history-container"},[t._m(0),e("div",{staticClass:"tab-container"},[e("el-tabs",{on:{"tab-click":t.handleTabClick},model:{value:t.activeTab,callback:function(e){t.activeTab=e},expression:"activeTab"}},[e("el-tab-pane",{attrs:{label:"提现中",name:"pending"}},[e("div",{staticClass:"tab-content"},[e("div",{staticClass:"list-header"},[e("span",{staticClass:"list-title"},[t._v("提现中 ("+t._s(t.total)+")")]),e("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.refreshData}},[e("i",{staticClass:"el-icon-refresh"}),t._v(" 刷新 ")])],1),e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"withdrawal-list"},[t._l(t.pendingWithdrawals,function(i){return e("div",{key:i.id,staticClass:"withdrawal-item pending",on:{click:function(e){return t.showDetail(i)}}},[e("div",{staticClass:"item-main"},[e("div",{staticClass:"item-left"},[e("div",{staticClass:"amount"},[t._v(t._s(i.amount)+" "+t._s(i.toSymbol||"USDT"))]),e("div",{staticClass:"chain"},[t._v(t._s(t.getChainName(i.toChain)))])]),e("div",{staticClass:"item-right"},[e("div",{staticClass:"status pending-status"},[e("i",{staticClass:"el-icon-loading"}),t._v(" "+t._s(t.getStatusText(i.status))+" ")]),e("div",{staticClass:"time"},[t._v(t._s(t.formatTime(i.createTime)))])])]),e("div",{staticClass:"item-footer"},[e("div",{staticClass:"footer-left"},[e("span",{staticClass:"address"},[t._v(t._s(t.formatAddress(i.toAddress)))]),i.txHash?e("span",{staticClass:"tx-hash"},[e("i",{staticClass:"el-icon-link"}),t._v(" "+t._s(t.formatAddress(i.txHash))+" ")]):t._e()]),e("i",{staticClass:"el-icon-arrow-right"})])])}),0===t.pendingWithdrawals.length?e("div",{staticClass:"empty-state"},[e("i",{staticClass:"el-icon-document"}),e("p",[t._v("暂无提现中的记录")])]):t._e()],2)])]),e("el-tab-pane",{attrs:{label:"提现成功",name:"success"}},[e("div",{staticClass:"tab-content"},[e("div",{staticClass:"list-header"},[e("span",{staticClass:"list-title"},[t._v("提现成功 ("+t._s(t.total)+")")]),e("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.refreshData}},[e("i",{staticClass:"el-icon-refresh"}),t._v(" 刷新 ")])],1),e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"withdrawal-list"},[t._l(t.successWithdrawals,function(i){return e("div",{key:i.id,staticClass:"withdrawal-item success",on:{click:function(e){return t.showDetail(i)}}},[e("div",{staticClass:"item-main"},[e("div",{staticClass:"item-left"},[e("div",{staticClass:"amount"},[t._v(t._s(i.amount)+" "+t._s(i.toSymbol||""))]),e("div",{staticClass:"chain"},[t._v(t._s(t.getChainName(i.toChain)))])]),e("div",{staticClass:"item-right"},[e("div",{staticClass:"status success-status"},[e("i",{staticClass:"el-icon-check"}),t._v(" "+t._s(t.getStatusText(i.status))+" ")]),e("div",{staticClass:"time"},[t._v(t._s(t.formatTime(i.createTime)))])])]),e("div",{staticClass:"item-footer"},[e("div",{staticClass:"footer-left"},[e("span",{staticClass:"address"},[t._v(t._s(t.formatAddress(i.toAddress)))]),i.txHash?e("span",{staticClass:"tx-hash"},[e("i",{staticClass:"el-icon-link"}),t._v(" "+t._s(t.formatAddress(i.txHash))+" ")]):t._e()]),e("i",{staticClass:"el-icon-arrow-right"})])])}),0===t.successWithdrawals.length?e("div",{staticClass:"empty-state"},[e("i",{staticClass:"el-icon-document"}),e("p",[t._v("暂无提现成功的记录")])]):t._e()],2)])]),e("el-tab-pane",{attrs:{label:"提现失败",name:"failed"}},[e("div",{staticClass:"tab-content"},[e("div",{staticClass:"list-header"},[e("span",{staticClass:"list-title"},[t._v("提现失败 ("+t._s(t.total)+")")]),e("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.refreshData}},[e("i",{staticClass:"el-icon-refresh"}),t._v(" 刷新 ")])],1),e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"withdrawal-list"},[t._l(t.failedWithdrawals,function(i){return e("div",{key:i.id,staticClass:"withdrawal-item failed",on:{click:function(e){return t.showDetail(i)}}},[e("div",{staticClass:"item-main"},[e("div",{staticClass:"item-left"},[e("div",{staticClass:"amount"},[t._v(t._s(i.amount)+" "+t._s(i.toSymbol||""))]),e("div",{staticClass:"chain"},[t._v(t._s(t.getChainName(i.toChain)))])]),e("div",{staticClass:"item-right"},[e("div",{staticClass:"status failed-status"},[e("i",{staticClass:"el-icon-close"}),t._v(" "+t._s(t.getStatusText(i.status))+" ")]),e("div",{staticClass:"time"},[t._v(t._s(t.formatTime(i.createTime)))])])]),e("div",{staticClass:"item-footer"},[e("div",{staticClass:"footer-left"},[e("span",{staticClass:"address"},[t._v(t._s(t.formatAddress(i.toAddress)))]),i.txHash?e("span",{staticClass:"tx-hash"},[e("i",{staticClass:"el-icon-link"}),t._v(" "+t._s(t.formatAddress(i.txHash))+" ")]):t._e()]),e("i",{staticClass:"el-icon-arrow-right"})])])}),0===t.failedWithdrawals.length?e("div",{staticClass:"empty-state"},[e("i",{staticClass:"el-icon-document"}),e("p",[t._v("暂无提现失败的记录")])]):t._e()],2)])])],1),e("el-row",[e("el-col",{staticStyle:{display:"flex","justify-content":"center"},attrs:{span:24}},[e("el-pagination",{staticStyle:{margin:"0 auto","margin-top":"10px"},attrs:{"current-page":t.currentPage,"page-sizes":t.pageSizes,"page-size":t.pagination.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:t.total},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange,"update:currentPage":function(e){t.currentPage=e},"update:current-page":function(e){t.currentPage=e}}})],1)],1)],1),e("el-dialog",{attrs:{title:"提现详情",visible:t.detailDialogVisible,width:"600px"},on:{"update:visible":function(e){t.detailDialogVisible=e},close:t.closeDetail}},[t.selectedItem?e("div",{staticClass:"detail-content"},[e("div",{staticClass:"detail-section"},[e("h3",{staticClass:"section-title"},[t._v("基本信息")]),e("div",{staticClass:"detail-list"},[e("div",{staticClass:"detail-row"},[e("span",{staticClass:"detail-label"},[t._v("提现ID")]),e("span",{staticClass:"detail-value"},[t._v(t._s(t.selectedItem.id))])]),e("div",{staticClass:"detail-row"},[e("span",{staticClass:"detail-label"},[t._v("提现金额")]),e("span",{staticClass:"detail-value amount"},[t._v(t._s(t.selectedItem.amount)+" "+t._s(t.selectedItem.toSymbol||""))])]),e("div",{staticClass:"detail-row"},[e("span",{staticClass:"detail-label"},[t._v("区块链网络")]),e("span",{staticClass:"detail-value"},[t._v(t._s(t.getChainName(t.selectedItem.toChain)))])]),e("div",{staticClass:"detail-row"},[e("span",{staticClass:"detail-label"},[t._v("提现状态")]),e("span",{staticClass:"detail-value"},[e("el-tag",{attrs:{type:t.getStatusType(t.selectedItem.status)}},[t._v(" "+t._s(t.getStatusText(t.selectedItem.status))+" ")])],1)])])]),e("div",{staticClass:"detail-section"},[e("h3",{staticClass:"section-title"},[t._v("地址信息")]),e("div",{staticClass:"detail-list"},[e("div",{staticClass:"detail-row"},[e("span",{staticClass:"detail-label"},[t._v("收款地址")]),e("div",{staticClass:"address-container"},[e("span",{staticClass:"detail-value address"},[t._v(t._s(t.selectedItem.toAddress))]),e("el-button",{attrs:{type:"text",size:"small"},on:{click:function(e){return t.copyAddress(t.selectedItem.toAddress)}}},[t._v(" 复制 ")])],1)]),e("div",{staticClass:"detail-row"},[e("span",{staticClass:"detail-label"},[t._v("交易哈希")]),e("div",{staticClass:"address-container"},[e("span",{staticClass:"detail-value address"},[t._v(t._s(t.selectedItem.txHash))]),t.selectedItem.txHash?e("el-button",{attrs:{type:"text",size:"small"},on:{click:function(e){return t.copyAddress(t.selectedItem.txHash)}}},[t._v(" 复制 ")]):t._e()],1)])])]),e("div",{staticClass:"detail-section"},[e("h3",{staticClass:"section-title"},[t._v("时间信息")]),e("div",{staticClass:"detail-list"},[e("div",{staticClass:"detail-row"},[e("span",{staticClass:"detail-label"},[t._v("提现时间")]),e("span",{staticClass:"detail-value"},[t._v(t._s(t.formatFullTime(t.selectedItem.createTime)))])]),t.selectedItem.updateTime?e("div",{staticClass:"detail-row"},[e("span",{staticClass:"detail-label"},[t._v("完成时间")]),e("span",{staticClass:"detail-value"},[t._v(t._s(t.formatFullTime(t.selectedItem.updateTime)))])]):t._e()])])]):t._e(),e("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:t.closeDetail}},[t._v("关闭")])],1)])],1)},e.Yp=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"page-header"},[e("h1",{staticClass:"page-title"},[t._v("提现记录")]),e("p",{staticClass:"page-subtitle"},[t._v("查看您的提现申请和交易状态")])])}]},4027:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.payLoading,expression:"payLoading"}]},[t.safeItems.length?e("el-table",{attrs:{data:t.safeItems,border:"","header-cell-style":{textAlign:"left"},"cell-style":{textAlign:"left"}}},[e("el-table-column",{attrs:{type:"expand",width:"46"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-table",{attrs:{data:i.row.orderItemDtoList||[],size:"small",border:"","header-cell-style":{textAlign:"left"},"cell-style":{textAlign:"left"},"row-key":"productMachineId"}},[e("el-table-column",{attrs:{prop:"productMachineId",label:"机器ID","min-width":"120"}}),e("el-table-column",{attrs:{label:"矿机类型","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatMachineType(e.row&&e.row.type)))]}}],null,!0)}),e("el-table-column",{attrs:{prop:"payCoin",label:"币种","min-width":"100"}}),e("el-table-column",{attrs:{prop:"leaseTime",label:"租赁天数","min-width":"100"}}),e("el-table-column",{attrs:{label:"购买数量","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row&&null!=e.row.numbers?e.row.numbers:"—"))]}}],null,!0)}),e("el-table-column",{attrs:{prop:"price",label:"单价","min-width":"240"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",{staticClass:"value strong"},[t.formatAmount(i.row.price,i.row.payCoin||"").truncated?e("el-tooltip",{attrs:{content:t.formatAmount(i.row.price,i.row.payCoin||"").full+(i.row.payCoin?" "+i.row.payCoin:""),placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(i.row.price,i.row.payCoin||"").text)),i.row.payCoin?e("span",[t._v(" "+t._s(i.row.payCoin))]):t._e(),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatAmount(i.row.price,i.row.payCoin||"").text)),i.row.payCoin?e("span",[t._v(" "+t._s(i.row.payCoin))]):t._e()])],1)]}}],null,!0)})],1)]}}])}),e("el-table-column",{attrs:{label:"店铺",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row&&e.row.shopName||"—"))]}}])}),e("el-table-column",{attrs:{label:"订单号","min-width":"220"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",{staticClass:"value mono"},[t._v(t._s(i.row&&i.row.orderNumber||"—"))])]}}])}),e("el-table-column",{attrs:{label:"创建时间",width:"160"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatDateTime(e.row&&e.row.createTime)))]}}])}),e("el-table-column",{attrs:{label:"商品数","min-width":"70"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(Array.isArray(e.row&&e.row.orderItemDtoList)?e.row.orderItemDtoList.length:0))]}}])}),e("el-table-column",{attrs:{label:"总金额",width:"120"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",{staticClass:"value strong"},[t.formatAmount(i.row&&i.row.totalPrice,i.row&&i.row.payCoin||"").truncated?e("el-tooltip",{attrs:{content:t.formatAmount(i.row&&i.row.totalPrice,i.row&&i.row.payCoin||"").full+(i.row&&i.row.payCoin?" "+i.row.payCoin:""),placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(i.row&&i.row.totalPrice,i.row&&i.row.payCoin||"").text)),i.row&&i.row.payCoin?e("span",[t._v(" "+t._s(i.row.payCoin))]):t._e(),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatAmount(i.row&&i.row.totalPrice,i.row&&i.row.payCoin||"").text)),i.row&&i.row.payCoin?e("span",[t._v(" "+t._s(i.row.payCoin))]):t._e()])],1)]}}])}),e("el-table-column",{attrs:{width:"160"},scopedSlots:t._u([{key:"header",fn:function(){return[e("el-tooltip",{attrs:{placement:"top",effect:"dark"}},[e("div",{attrs:{slot:"content"},slot:"content"},[t._v(" 实际支付金额/理论支付金额:"),e("br"),t._v(" 1. 实际支付金额是按照矿机实际算力计算支付金额"),e("br"),t._v(" 2. 理论支付金额是卖家定义出售价格 ")]),e("span",{staticStyle:{display:"inline-flex","align-items":"center",gap:"6px"}},[e("i",{staticClass:"el-icon-question",staticStyle:{color:"#909399"},attrs:{"aria-label":"说明",role:"img"}}),t._v(" 已支付金额 ")])])]},proxy:!0},{key:"default",fn:function(i){return[e("span",{staticClass:"value strong"},[t.formatAmount(i.row&&i.row.payAmount,i.row&&i.row.payCoin||"").truncated?e("el-tooltip",{attrs:{content:t.formatAmount(i.row&&i.row.payAmount,i.row&&i.row.payCoin||"").full+(i.row&&i.row.payCoin?" "+i.row.payCoin:""),placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(i.row&&i.row.payAmount,i.row&&i.row.payCoin||"").text)),i.row&&i.row.payCoin?e("span",[t._v(" "+t._s(i.row.payCoin))]):t._e(),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatAmount(i.row&&i.row.payAmount,i.row&&i.row.payCoin||"").text)),i.row&&i.row.payCoin?e("span",[t._v(" "+t._s(i.row.payCoin))]):t._e()])],1)]}}])}),t.showEndTime?e("el-table-column",{attrs:{label:"订单完成时间",width:"160"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatDateTime(e.row&&e.row.endTime)))]}}],null,!1,2293356106)}):t._e(),e("el-table-column",{attrs:{label:"操作","min-width":"60",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-button",{staticStyle:{"margin-right":"8px"},attrs:{size:"mini"},on:{click:function(e){return t.handleGoDetail(i.row)}}},[t._v("详情")]),t.shouldShowActions(i.row)?[e("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(e){return t.handleCheckout(i.row)}}},[t._v("去结算")])]:t._e()]}}])})],1):e("div",{staticClass:"empty"},[t._v(t._s(t.emptyText))]),e("el-dialog",{attrs:{visible:t.dialogVisible,width:"520px",title:"请扫码支付"},on:{"update:visible":function(e){t.dialogVisible=e}}},[e("div",{staticStyle:{"text-align":"left","margin-bottom":"12px",color:"#666"}},[e("div",{staticStyle:{"margin-bottom":"6px"}},[t._v("总金额"),t.paymentDialog.payCoin?e("span",[t._v("("+t._s(t.paymentDialog.payCoin)+")")]):t._e(),t._v(": "),e("b",[t.formatAmount(t.paymentDialog.totalPrice,t.paymentDialog.payCoin||"").truncated?e("el-tooltip",{attrs:{content:t.formatAmount(t.paymentDialog.totalPrice,t.paymentDialog.payCoin||"").full+(t.paymentDialog.payCoin?" "+t.paymentDialog.payCoin:""),placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(t.paymentDialog.totalPrice,t.paymentDialog.payCoin||"").text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatAmount(t.paymentDialog.totalPrice,t.paymentDialog.payCoin||"").text))])],1)]),e("div",{staticStyle:{"margin-bottom":"6px",display:"flex","align-items":"center",gap:"6px"}},[e("el-tooltip",{attrs:{placement:"top",effect:"dark"}},[e("div",{attrs:{slot:"content"},slot:"content"},[t._v(" 实际支付金额/理论支付金额:"),e("br"),t._v(" 1. 实际支付金额是按照矿机实际算力计算支付金额"),e("br"),t._v(" 2. 理论支付金额是卖家定义出售价格 ")]),e("i",{staticClass:"el-icon-question",staticStyle:{color:"#909399"},attrs:{"aria-label":"说明",role:"img"}})]),e("span",[t._v("已支付金额"),t.paymentDialog.payCoin?e("span",[t._v("("+t._s(t.paymentDialog.payCoin)+")")]):t._e(),t._v(":")]),e("b",{staticClass:"value strong"},[t.formatAmount(t.paymentDialog.payAmount,t.paymentDialog.payCoin||"").truncated?e("el-tooltip",{attrs:{content:t.formatAmount(t.paymentDialog.payAmount,t.paymentDialog.payCoin||"").full+(t.paymentDialog.payCoin?" "+t.paymentDialog.payCoin:""),placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(t.paymentDialog.payAmount,t.paymentDialog.payCoin||"").text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatAmount(t.paymentDialog.payAmount,t.paymentDialog.payCoin||"").text))])],1)],1),e("div",{staticStyle:{"margin-bottom":"6px"}},[t._v("待支付金额"),t.paymentDialog.payCoin?e("span",[t._v("("+t._s(t.paymentDialog.payCoin)+")")]):t._e(),t._v(": "),e("b",{staticClass:"value strong"},[t.formatAmount(t.paymentDialog.noPayAmount,t.paymentDialog.payCoin||"").truncated?e("el-tooltip",{attrs:{content:t.formatAmount(t.paymentDialog.noPayAmount,t.paymentDialog.payCoin||"").full+(t.paymentDialog.payCoin?" "+t.paymentDialog.payCoin:""),placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(t.paymentDialog.noPayAmount,t.paymentDialog.payCoin||"").text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatAmount(t.paymentDialog.noPayAmount,t.paymentDialog.payCoin||"").text))])],1)])]),e("div",{staticStyle:{"text-align":"center"}},[t.paymentDialog.img?e("img",{staticStyle:{width:"180px",height:"180px","margin-top":"18px"},attrs:{src:t.paymentDialog.img,alt:"支付二维码"}}):e("div",{staticStyle:{color:"#666"}},[t._v("未返回支付二维码")])]),e("p",{staticStyle:{"margin-bottom":"6px",color:"red","text-align":"left"}},[t._v("注意:如果已经支付对应金额,不要在重复支付,待系统确认后会自动更新订单状态。因个人原因重复支付导致无法退款,平台不承担任何责任。")]),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.dialogVisible=!1}}},[t._v("关闭")])],1)])],1)},e.Yp=[]},4060:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(3944),s=i(8284),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"ee3500fc",null),l=n.exports},4073:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(4027),s=i(2935),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"566ecf06",null),l=n.exports},4180:function(t,e,i){var a=i(3999)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e.addOrders=o,e.addOrdersV2=m,e.cancelOrder=r,e.getChainAndListForSeller=d,e.getCoinPrice=u,e.getMachineSupportCoinAndAlgorithm=h,e.getMachineSupportPool=p,e.getOrdersByIds=n,e.getOrdersByStatus=l,e.getOrdersByStatusForSeller=c,e.getPurchasedInfoV2=f,e.getPurchasedItems=g;var s=a(i(5720));function o(t){return(0,s.default)({url:"/lease/order/info/addOrders",method:"post",data:t})}function r(t){return(0,s.default)({url:"/lease/order/info/cancelOrder",method:"post",data:t})}function n(t){return(0,s.default)({url:"/lease/order/info/getOrdersByIds",method:"post",data:t})}function l(t){return(0,s.default)({url:"/lease/order/info/getOrdersByStatus",method:"post",data:t})}function c(t){return(0,s.default)({url:"/lease/order/info/getOrdersByStatusForSeller",method:"post",data:t})}function d(t){return(0,s.default)({url:"/lease/shop/getChainAndListForSeller",method:"post",data:t})}function u(t){return(0,s.default)({url:"/lease/order/info/getCoinPrice",method:"post",data:t})}function h(t){return(0,s.default)({url:"/lease/v2/order/info/getMachineSupportCoinAndAlgorithm",method:"post",data:t})}function p(t){return(0,s.default)({url:"/lease/v2/order/info/getMachineSupportPool",method:"post",data:t})}function m(t){return(0,s.default)({url:"/lease/v2/order/info/addOrdersV2",method:"post",data:t})}function g(t){return(0,s.default)({url:"/lease/v2/order/info/getPurchasedItems",method:"post",data:t})}function f(t){return(0,s.default)({url:"/lease/v2/order/info/getPurchasedInfo",method:"post",data:t})}},4300:function(t,e,i){Object.defineProperty(e,"B",{value:!0}),e.A=void 0,i(8111),i(1701);var a=i(6299),s=i(4981);e.A={name:"AccountReceiptRecord",data(){return{loading:!1,rows:[],page:1,pageSize:10,total:0,range:[],keyword:"",expandedRowKeys:[]}},mounted(){this.fetchList(),this.rows=this.withKeys(this.rows)},methods:{formatAmount(t,e){return(0,s.truncateAmountByCoin)(t,e)},withKeys(t){const e=Array.isArray(t)?t:[];return e.map((t,e)=>({...t,__rowKey:t&&t.__rowKey?t.__rowKey:`${t&&(t.txHash||t.orderId||t.updateTime||"")}_${e}`}))},getRowKey(t){return t&&t.__rowKey},handleRowClick(t){const e=this.getRowKey(t),i=this.expandedRowKeys.includes(e);this.expandedRowKeys=i?[]:[e]},handleExpandChange(t,e){Array.isArray(e)?this.expandedRowKeys=e.length?[this.getRowKey(e[e.length-1])]:[]:this.expandedRowKeys=[]},getRowClassName(){return"clickable-row"},formatTrunc(t,e=2){const i=Number(t);if(!Number.isFinite(i))return"0";const a=Math.max(0,Number(e)||0),s=Math.pow(10,a),o=Math.trunc(i*s)/s,r=String(o);if(0===a)return r;const[n,l=""]=r.split("."),c=l.padEnd(a,"0");return`${n}.${c}`},formatFullTime(t){if(!t)return"";try{return`${t.split("T")[0]} ${t.split("T")[1].split(".")[0]}`}catch(e){return console.log(e,"时间"),t}},formatChain(t){const e={tron:"Tron (TRC20)",ethereum:"Ethereum (ERC20)",bsc:"BSC (BEP20)",polygon:"Polygon"};return e[t]||t||"-"},formatFeeRate(t){if(null===t||void 0===t||""===t)return"-";const e=Number(t);if(!Number.isFinite(e))return"-";const i=100*e,a=i.toFixed(6);return`${a.replace(/\.?0+$/,"")}%`},getStatusType(t){const e={0:"danger",1:"success",2:"warning",3:"danger"};return e[t]||"info"},getStatusText(t){const e={0:"支付失败",1:"支付成功",2:"待校验",3:"证书校验失败"};return e[t]||"未知"},copy(t){if(!t)return;try{if(navigator.clipboard&&navigator.clipboard.writeText)return navigator.clipboard.writeText(t),void this.$message.success("已复制")}catch(i){}const e=document.createElement("textarea");e.value=t,document.body.appendChild(e),e.select();try{document.execCommand("copy"),this.$message.success("已复制")}catch(i){}document.body.removeChild(e)},handleRangeChange(){this.page=1},async fetchList(){this.loading=!0;try{const t={page:this.page,pageSize:this.pageSize},e=await(0,a.sellerReceiptList)(t),i=e&&(e.data||e),s=Array.isArray(i&&i.rows)?i.rows:Array.isArray(i)?i:[];this.rows=this.withKeys(s),this.total=e.total}catch(t){this.rows=[],this.total=0}finally{this.loading=!1}}}}},4405:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"receipt-page"},[e("div",{staticClass:"card",attrs:{"aria-label":"提现记录",tabindex:"0"}},[t._m(0),t.loading?e("div",{staticClass:"loading"},[e("i",{staticClass:"el-icon-loading",attrs:{"aria-label":"加载中",role:"img"}}),t._v(" 加载中... ")]):e("div",[e("div",{staticClass:"table-wrap"},[e("el-table",{staticClass:"withdraw-table",attrs:{data:t.rows,border:"",stripe:"",size:"small","header-cell-style":{textAlign:"left"},"cell-style":{textAlign:"left"}}},[e("el-table-column",{attrs:{label:"申请时间",width:"140"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatFullTime(e.row.createTime)))]}}])}),e("el-table-column",{attrs:{label:"提现金额",width:"70","show-overflow-tooltip":"",align:"right"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",{staticClass:"amount-red"},[t.formatAmount(i.row.amount,i.row.coin||i.row.toSymbol||"").truncated?e("el-tooltip",{attrs:{content:`-${t.formatAmount(i.row.amount,i.row.coin||i.row.toSymbol||"").full}`,placement:"top"}},[e("span",[t._v(" -"+t._s(t.formatAmount(i.row.amount,i.row.coin||i.row.toSymbol||"").text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(" -"+t._s(t.formatAmount(i.row.amount,i.row.coin||i.row.toSymbol||"").text)+" ")])],1)]}}])}),e("el-table-column",{attrs:{label:"手续费",width:"70","show-overflow-tooltip":"",align:"right"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",{staticClass:"mono"},[t._v(t._s(t.formatAmount(i.row.serviceCharge,i.row.coin||i.row.toSymbol||"").text))])]}}])}),e("el-table-column",{attrs:{label:"提现链",width:"100","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatChain(e.row.toChain||e.row.chain)))]}}])}),e("el-table-column",{attrs:{label:"币种",width:"80","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(String(e.row.coin||e.row.toSymbol||"").toUpperCase()))]}}])}),e("el-table-column",{attrs:{label:"收款地址","min-width":"320"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("div",{staticClass:"address-cell"},[e("el-tooltip",{attrs:{content:i.row.toAddress,placement:"top"}},[e("span",{staticClass:"mono-ellipsis address-text"},[t._v(t._s(i.row.toAddress))])]),e("el-button",{staticClass:"address-copy",attrs:{type:"text",size:"mini"},on:{click:function(e){return e.stopPropagation(),t.copy(i.row.toAddress)}}},[t._v("复制")])],1)]}}])}),e("el-table-column",{attrs:{label:"交易HASH",width:"300"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("div",{staticClass:"hash-cell"},[e("el-tooltip",{attrs:{content:i.row.txHash,placement:"top"}},[e("span",{staticClass:"mono-ellipsis hash-text"},[t._v(t._s(i.row.txHash))])]),i.row.txHash?e("el-button",{staticClass:"hash-copy",attrs:{type:"text",size:"mini"},on:{click:function(e){return e.stopPropagation(),t.copy(i.row.txHash)}}},[t._v("复制")]):t._e()],1)]}}])}),e("el-table-column",{attrs:{label:"状态",width:"90"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-tag",{attrs:{type:t.getStatusType(i.row.status),size:"small"}},[t._v(t._s(t.getStatusText(i.row.status)))])]}}])}),e("el-table-column",{attrs:{label:"状态更新时间",width:"140"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatFullTime(e.row.updateTime)))]}}])})],1)],1),t.rows.length?t._e():e("div",{staticClass:"empty"},[e("div",{staticClass:"empty-text"},[t._v("暂无提现记录")])]),e("div",{staticClass:"pagination"},[e("el-pagination",{attrs:{background:"",layout:"prev, pager, next, jumper","current-page":t.pageNum,"page-size":t.pageSize,total:t.total},on:{"update:currentPage":function(e){t.pageNum=e},"update:current-page":function(e){t.pageNum=e},"current-change":t.fetchList}})],1)])])])},e.Yp=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"card-header"},[e("h3",{staticClass:"card-title"},[t._v("提现记录")])])}]},4408:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"product-machine-add"},[e("div",{staticClass:"header"},[e("el-button",{attrs:{type:"text"},on:{click:t.handleBack}},[t._v("返回")]),e("h2",{staticClass:"title"},[t._v("创建商品")])],1),e("el-card",{staticClass:"form-card",attrs:{shadow:"never"}},[e("el-form",{ref:"machineForm",attrs:{model:t.form,rules:t.rules,"label-width":"160px",size:"small"}},[e("el-form-item",{attrs:{label:"矿机种类"}},[e("el-radio-group",{on:{change:t.handleMachineCategoryChange},model:{value:t.form.machineCategory,callback:function(e){t.$set(t.form,"machineCategory",e)},expression:"form.machineCategory"}},[e("el-radio",{attrs:{label:"ASIC"}},[t._v("ASIC")]),e("el-radio",{attrs:{label:"GPU"}},[t._v("GPU")])],1)],1),"GPU"===t.form.machineCategory?e("div",{staticClass:"gpu-guide-section"},[e("el-card",{staticClass:"gpu-guide-card",attrs:{shadow:"never"}},[e("div",{staticClass:"gpu-guide-content"},[e("div",{staticClass:"gpu-guide-title"},[t._v("注意事项:")]),e("ol",{staticClass:"gpu-guide-list"},[e("li",[t._v(" GPU商品需先点击下方按钮,下载并在GPU所在主机启动客户端,在下载包中会有启动客户端的操作指引文档 ")]),e("li",[t._v(" 成功在GPU主机启动客户端后,GPU信息会自行添加至商品列表中,点击下方前往商品列表按钮可以前往该页面 ")]),e("li",[t._v(" 客户端和您的卖家账号绑定,如果您需要在本卖家账号"),t.userEmail?e("span",[t._v(" ("+t._s(t.userEmail)+")")]):t._e(),t._v("添加多个GPU商品,可通过下列两种方法实现:"),e("br"),t._v(" 方法一:点击下方下载客户端按钮,将下载好的完整客户端包复制到不同的GPU主机并且启动,启动后客户端所在主机的GPU数据会自动添加到商品列表中 (推荐) "),e("br"),t._v(" 方法二:在不同的客户端主机登陆您的卖家账号,进入本页面,点击下载对应操作系统客户端,成功启动客户端后也可自动添加GPU数据到商品列表中 ")]),e("li",[t._v("目前只支持NVIDIA系列GPU")])]),e("div",{staticClass:"gpu-guide-buttons"},[e("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.handleDownloadClient("windows")}}},[t._v("Windows 客户端下载")]),e("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.handleDownloadClient("linux")}}},[t._v("Linux 客户端下载")]),e("el-button",{attrs:{type:"success"},on:{click:t.handleGpuClientStarted}},[t._v("前往商品列表")])],1)])])],1):t._e(),"ASIC"===t.form.machineCategory?e("el-form-item",{attrs:{label:"币种/算法/算力/单位",prop:"coinAndAlgoList",required:!0}},[e("div",{staticClass:"coin-algo-rows"},t._l(t.form.coinAndAlgoList,function(i,a){return e("div",{key:a,staticClass:"coin-algo-line"},[e("el-select",{staticClass:"coin-input",attrs:{placeholder:"请选择币种",loading:t.loadingCoins,filterable:"",clearable:""},on:{change:function(e){return t.handleCoinChange(a,e)}},model:{value:i.coin,callback:function(e){t.$set(i,"coin",e)},expression:"row.coin"}},t._l(t.coinOptions,function(t){return e("el-option",{key:t,attrs:{label:t,value:t}})}),1),e("el-select",{staticClass:"algo-input",attrs:{placeholder:"请选择算法",loading:t.loadingAlgos[a],disabled:!i.coin,filterable:"",clearable:""},model:{value:i.algorithm,callback:function(e){t.$set(i,"algorithm",e)},expression:"row.algorithm"}},t._l(t.algoOptionsMap[i.coin]||[],function(t){return e("el-option",{key:t,attrs:{label:t,value:t}})}),1),e("el-input",{staticClass:"power-input",attrs:{placeholder:"理论算力",inputmode:"decimal"},on:{input:function(e){return t.handleCoinRowTheoryInput(a)}},model:{value:i.theoryPower,callback:function(e){t.$set(i,"theoryPower",e)},expression:"row.theoryPower"}}),e("el-select",{staticClass:"unit-select",attrs:{placeholder:"单位"},on:{change:function(e){return t.handleCoinRowUnitChange(a,e)}},model:{value:i.unit,callback:function(e){t.$set(i,"unit",e)},expression:"row.unit"}},[e("el-option",{attrs:{label:"KH/S",value:"KH/S"}}),e("el-option",{attrs:{label:"MH/S",value:"MH/S"}}),e("el-option",{attrs:{label:"GH/S",value:"GH/S"}}),e("el-option",{attrs:{label:"TH/S",value:"TH/S"}}),e("el-option",{attrs:{label:"PH/S",value:"PH/S"}})],1),e("el-button",{staticClass:"op-btn",attrs:{type:"primary",icon:"el-icon-plus",circle:"","aria-label":"新增一行"},on:{click:t.handleAddCoinAlgoRow}}),t.form.coinAndAlgoList.length>1?e("el-button",{staticClass:"op-btn",attrs:{icon:"el-icon-minus",circle:"","aria-label":"删除该行"},on:{click:function(e){return t.handleRemoveCoinAlgoRow(a)}}}):t._e()],1)}),0)]):t._e(),"ASIC"===t.form.machineCategory?e("el-form-item",{attrs:{label:"矿机型号",prop:"type",required:!0}},[e("el-input",{staticStyle:{width:"50%"},attrs:{placeholder:"示例:龍珠",maxlength:20},on:{input:t.handleTypeInput},model:{value:t.form.type,callback:function(e){t.$set(t.form,"type",e)},expression:"form.type"}})],1):t._e(),"ASIC"===t.form.machineCategory?e("el-form-item",{attrs:{label:"最大租赁天数",prop:"maxLeaseDays"}},[e("el-input",{staticStyle:{width:"50%"},attrs:{placeholder:"1-365",inputmode:"numeric"},on:{input:function(e){return t.handleNumeric("maxLeaseDays")}},model:{value:t.form.maxLeaseDays,callback:function(e){t.$set(t.form,"maxLeaseDays",e)},expression:"form.maxLeaseDays"}},[e("template",{slot:"append"},[t._v("天")])],2)],1):t._e(),"ASIC"===t.form.machineCategory?e("el-form-item",{attrs:{label:"功耗",prop:"powerDissipation"}},[e("el-input",{staticStyle:{width:"50%"},attrs:{inputmode:"decimal"},on:{input:function(e){return t.handleNumeric("powerDissipation")}},model:{value:t.form.powerDissipation,callback:function(e){t.$set(t.form,"powerDissipation",e)},expression:"form.powerDissipation"}},[e("template",{slot:"append"},[t._v("kw/h")])],2)],1):t._e(),"ASIC"===t.form.machineCategory?e("el-form-item",{attrs:{label:"统一售价",prop:t.payTypeDefs&&t.payTypeDefs.length?"costMap":"cost",required:!0}},[e("span",{attrs:{slot:"label"},slot:"label"},[t._v("统一售价")]),t.payTypeDefs&&t.payTypeDefs.length?e("div",{staticClass:"cost-multi"},t._l(t.payTypeDefs,function(i){return e("div",{key:i.key,staticClass:"cost-item"},[e("el-input",{staticStyle:{width:"50%"},attrs:{placeholder:"请输入价格",inputmode:"decimal"},on:{input:e=>t.handleCostMapInput(i.key,e)},model:{value:t.form.costMap[i.key],callback:function(e){t.$set(t.form.costMap,i.key,e)},expression:"form.costMap[pt.key]"}},[e("template",{slot:"append"},[t._v(t._s(i.label))])],2)],1)}),0):e("el-input",{staticStyle:{width:"50%"},attrs:{placeholder:"请输入成本",inputmode:"decimal"},on:{input:function(e){return t.handleNumeric("cost")}},model:{value:t.form.cost,callback:function(e){t.$set(t.form,"cost",e)},expression:"form.cost"}},[e("template",{slot:"append"},[t._v("USDT")])],2)],1):t._e(),"ASIC"===t.form.machineCategory?e("el-form-item",{attrs:{label:"出售机器数量(台)",prop:"sellCount",required:!0}},[e("el-input",{staticStyle:{width:"50%"},attrs:{placeholder:"1 - 9999",inputmode:"numeric"},on:{input:t.handleSellCountInput,blur:t.handleSellCountBlur},model:{value:t.form.sellCount,callback:function(e){t.$set(t.form,"sellCount",e)},expression:"form.sellCount"}})],1):t._e()],1)],1),"ASIC"===t.form.machineCategory?e("div",{staticClass:"actions"},[e("el-button",{on:{click:t.handleBack}},[t._v("取消")]),e("el-button",{attrs:{type:"primary",loading:t.saving},on:{click:t.handleSave}},[t._v("确认创建")])],1):t._e(),e("el-dialog",{staticClass:"wallet-bind-dialog",attrs:{title:"提示",visible:t.walletBindDialogVisible,width:"400px","close-on-click-modal":!1,"show-close":!1,"close-on-press-escape":!1},on:{"update:visible":function(e){t.walletBindDialogVisible=e}}},[e("div",{staticClass:"wallet-bind-content"},[e("i",{staticClass:"el-icon-warning wallet-warning-icon"}),e("p",{staticClass:"wallet-bind-message"},[t._v(" 请先在我的店铺绑定钱包地址后才能创建商品 ")]),e("el-button",{staticClass:"wallet-bind-btn",attrs:{type:"primary"},on:{click:t.handleGoToWalletBind}},[t._v(" 去绑定钱包 ")])],1)]),e("el-dialog",{attrs:{title:"请确认上架信息",visible:t.confirmVisible,width:"560px"},on:{"update:visible":function(e){t.confirmVisible=e}}},[e("div",{staticStyle:{"text-align":"left","line-height":"1.9"}},[e("div",[t._v(" 币种:"),e("b",[t._v(t._s(t.confirmData.coin))])]),e("div",[t._v(" 算法:"),e("b",[t._v(t._s(t.confirmData.algorithm))])]),e("div",[t._v(" 最大租赁天数:"),e("b",[t._v(t._s(t.confirmData.maxLeaseDays||"-"))])]),e("div",[t._v(" 出售机器数量:"),e("b",[t._v(t._s(t.confirmData.saleNumbers||"-"))])]),e("div",{staticStyle:{"margin-top":"8px"}},[t._v("售价:")]),e("el-table",{staticStyle:{width:"100%"},attrs:{data:t.confirmData.priceList,border:"",size:"mini"}},[e("el-table-column",{attrs:{prop:"chain",label:"链",width:"120"}}),e("el-table-column",{attrs:{prop:"coin",label:"币种",width:"120"}}),e("el-table-column",{attrs:{label:"价格"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.price)+" ")]}}])})],1),e("p",{staticStyle:{color:"#666","margin-top":"12px"}},[t._v(" 请仔细确认以上参数无误后提交。 ")])],1),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.confirmVisible=!1}}},[t._v("取消")]),e("el-button",{attrs:{type:"primary",loading:t.saving},on:{click:t.doSubmit}},[t._v("确认提交")])],1)])],1)},e.Yp=[]},4487:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=void 0,i(4114),i(8111),i(2489),i(116),i(2912),i(7588),i(1701),i(8237),i(3579),i(7642),i(8004),i(3853),i(5876),i(2475),i(5024),i(1698);var a=i(7723),s=i(9662),o=i(4981),r=i(5844);e["default"]={name:"ProductDetail",data(){return{product:null,loading:!1,expandedRowKeys:[],selectedMap:{},machineList:[],paymentMethodList:[],selectedPayKey:null,filters:{chain:"",coin:"",minPrice:null,maxPrice:null,minPower:null,maxPower:null,minPowerDissipation:null,maxPowerDissipation:null,unit:"GH/S",keyword:""},powerUnitOptions:["KH/S","MH/S","GH/S","TH/S","PH/S"],sortStates:{priceSort:!0,powerSort:!0,powerDissipationSort:!0},activeSortField:"",payFilterDefaultApplied:!1,params:{id:"",pageNum:1,pageSize:10},confirmAddDialog:{visible:!1,items:[]},cartMachineIdSet:new Set,cartCompositeKeySet:new Set,cartLoaded:!1,machinesLoaded:!1,productListData:[],tableData:[],productDetailLoading:!1,pageSizes:[10,20,50],currentPage:1,total:0,dynamicMeta:{},dynamicColumns:[],dynamicRows:[],dynamicSearch:{visible:!1,keyword:""},machineType:1}},mounted(){try{const t=Number(window&&window.localStorage?window.localStorage.getItem("pl_machineType"):NaN);0!==t&&1!==t||(this.machineType=t)}catch(e){}const t=this.$route&&this.$route.params&&(this.$route.params.shopId||this.$route.params.id)||this.$route&&this.$route.query&&this.$route.query.shopId;t?(this.params.id=t,this.product=!0,this.fetchGetMachineInfo(this.buildQueryParams()),this.fetchPayTypes()):(this.$message.warning("缺少店铺ID(shopId),无法加载商品列表"),this.product=!1)},methods:{isMaxDailyIncomeColumn(t){try{if(!t)return!1;const e=String(t.label||""),i=String(t.key||"").toLowerCase();return!(!e.includes("最大日收益")&&!e.includes("最大日收入"))||(!(!i.includes("maxday")&&!i.includes("maxdaily"))||(!(!i.includes("dayincome")&&!i.includes("dailyincome"))||!(!i.includes("dayprofit")&&!i.includes("dailyprofit"))))}catch(e){return!1}},formatDynamicCell(t,e){try{let i=t[e.key];if(null===i||void 0===i||""===i)return{text:"—",full:"—",truncated:!1};if("amount"===e.type){if("price"===e.key){if(Array.isArray(t.priceList)&&t.priceList.length){const e=this.getDisplayPrice(t),a=this.getDisplayPriceCoin(t);null!==e&&void 0!==e&&(i=e);const s=i,r=(0,o.truncateTo6)(s),n=(a||"").toString().toUpperCase();return{text:n?`${r.text} ${n}`:r.text,full:n?`${r.full} ${n}`:r.full,truncated:r.truncated}}const e=(0,o.truncateTo6)(i);return{text:e.text,full:e.full,truncated:e.truncated}}const a=(e.currency||"").toString().toUpperCase();if("USDT"===a){const t=(0,o.truncateTo6)(i);return this.isMaxDailyIncomeColumn(e)?{text:t.text,full:t.full,truncated:t.truncated}:{text:`${t.text} USDT`,full:`${t.full} USDT`,truncated:t.truncated}}const s=(0,o.truncateTo6)(i);return{text:s.text,full:s.full,truncated:s.truncated}}if("hashrate"===e.type){const t=String(i||"");return{text:t,full:t,truncated:!1}}if("days"===e.type){const t=Number(i);if(!Number.isFinite(t))return{text:String(i),full:String(i),truncated:!1};const e=`${Math.floor(t)} 天`;return{text:e,full:e,truncated:!1}}const a=String(i);return{text:a,full:a,truncated:!1}}catch(i){return{text:"—",full:"—",truncated:!1}}},ensureDefaultPayFilterFromPrices(){try{if(this.payFilterDefaultApplied)return;const t=Array.isArray(this.dynamicRows)?this.dynamicRows:[],e=t.find(t=>Array.isArray(t&&t.priceList)&&t.priceList.length);if(!e)return;const i=e.priceList[0],a=String(i&&i.chain||"").trim(),s=String(i&&i.coin||"").trim();if(!a&&!s)return;this.selectedPayKey=`${a}|${s}`,this.filters.chain=a,this.filters.coin=s,this.payFilterDefaultApplied=!0}catch(t){}},getDisplayPrice(t){try{const e=Array.isArray(t&&t.priceList)?t.priceList:[];if(!e.length)return t&&t.price;const i=this.selectedPayKey;if(i){const[t,a]=String(i).split("|"),s=String(t||"").toUpperCase().trim(),o=String(a||"").toUpperCase().trim(),r=e.find(t=>String(t&&t.chain).toUpperCase().trim()===s&&String(t&&t.coin).toUpperCase().trim()===o);if(r&&void 0!==r.price&&null!==r.price)return r.price}const a=e[0];return a&&void 0!==a.price&&null!==a.price?a.price:t&&t.price}catch(e){return t&&t.price}},getDisplayPriceCoin(t){try{const e=Array.isArray(t&&t.priceList)?t.priceList:[];if(!e.length)return"";const i=this.selectedPayKey;if(i){const[t,a]=String(i).split("|"),s=String(t||"").toUpperCase().trim(),o=String(a||"").toUpperCase().trim(),r=e.find(t=>String(t&&t.chain).toUpperCase().trim()===s&&String(t&&t.coin).toUpperCase().trim()===o);if(r&&r.coin)return String(r.coin)}const a=e[0];return a&&a.coin?String(a.coin):""}catch(e){return""}},_truncate(t,e=2){try{const i=Math.pow(10,e);return(Math.floor(Number(t)*i)/i).toFixed(e)}catch(i){return String(t)}},isLastHashrateColumn(t){try{const e=this.getRenderedColumns();for(let i=e.length-1;i>=0;i--)if("hashrate"===String(e[i]&&e[i].type).toLowerCase())return i===t;return!1}catch(e){return!1}},getRenderedColumns(){try{const t=Array.isArray(this.dynamicColumns)?this.dynamicColumns:[],e=t.filter(t=>"hashrate"===String(t&&t.type).toLowerCase()).slice(0,8),i=t.filter(t=>"hashrate"!==String(t&&t.type).toLowerCase());return[...e,...i]}catch(t){return[]}},handleOpenDynamicSearch(){this.dynamicSearch.visible=!0,this.dynamicSearch.keyword=""},async handleConfirmDynamicSearch(){const t=(this.dynamicSearch.keyword||"").trim();if(!t)return void this.$message.warning("请输入币种代码或算法关键词");this.dynamicSearch.visible=!1,this.filters.keyword=t,this.params.pageNum=1,this.currentPage=1;const e=this.buildQueryParams();await this.fetchGetMachineInfo(e)},async fetchDynamicTable(t){try{if(!t||!t.keyword)return;const e=String(t.keyword).toUpperCase(),i=(this.dynamicColumns||[]).filter(t=>["model","price","maxLeaseDays","monthIncome"].includes(t.key)),a=(this.dynamicColumns||[]).filter(t=>String(t.label||t.key).toUpperCase().includes(e)),s=[...i.length?i:[this.dynamicColumns[0]||[]],...a];s.length&&(this.dynamicColumns=s)}catch(e){console.warn("fetchDynamicTable mock error",e)}},handleMachineTypeChange(){try{Array.isArray(this.dynamicRows)&&this.dynamicRows.forEach(t=>{t&&this.$set(t,"_selected",!1)}),this.confirmAddDialog&&(this.confirmAddDialog.items=[],this.confirmAddDialog.visible=!1)}catch(t){}this.fetchGetMachineInfo(this.buildQueryParams()),this.fetchPayTypes();try{window&&window.localStorage&&window.localStorage.setItem("pl_machineType",String(this.machineType))}catch(t){}},getRowCoin(t){try{const e=t&&(t.payCoin||t.coin)||this.getPriceCoinSymbol()||"";return String(e).toUpperCase()}catch(e){return""}},formatAmount(t,e){return(0,o.truncateAmountByCoin)(t,e)},formatNum6(t){return(0,o.truncateTo6)(t)},ensureDefaultPayFilterSelection(){try{if(this.payFilterDefaultApplied)return;const t=Array.isArray(this.paymentMethodList)?this.paymentMethodList:[];if(!t.length)return;const e=this.getPriceCoinSymbol&&this.getPriceCoinSymbol()||"";if(!e)return;const i=t.find(t=>String(t&&t.payCoin).toUpperCase()===String(e).toUpperCase());if(!i)return;const a=`${i.payChain||""}|${i.payCoin||""}`;this.selectedPayKey=a,this.filters.chain=String(i.payChain||"").trim(),this.filters.coin=String(i.payCoin||"").trim(),this.payFilterDefaultApplied=!0}catch(t){}},handleToggleSort(t){try{this.sortStates||(this.sortStates={}),this.activeSortField!==t?(Object.keys(this.sortStates).forEach(t=>{this.sortStates[t]=!0}),this.activeSortField=t,this.sortStates[t]=!1):this.sortStates[t]=!this.sortStates[t];const e=this.buildQueryParams();this.fetchGetMachineInfo(e)}catch(e){}},buildQueryParams(){const t={shopId:this.params.id,type:this.machineType};try{this.params&&null!=this.params.pageNum&&(t.pageNum=this.params.pageNum),this.params&&null!=this.params.pageSize&&(t.pageSize=this.params.pageSize)}catch(i){}const e=(e,i,a)=>{const s=e[i];if(null===s||void 0===s||""===s)return;const o=String(s).trim();if(""===o||"."===o)return;const r=Number(o);Number.isFinite(r)&&r>=0&&(t[a]=r)};this.filters.chain&&String(this.filters.chain).trim()&&(t.chain=String(this.filters.chain).trim()),this.filters.coin&&String(this.filters.coin).trim()&&(t.coin=String(this.filters.coin).trim()),this.filters.unit&&String(this.filters.unit).trim()&&(t.unit=String(this.filters.unit).trim()),e(this.filters,"minPrice","minPrice"),e(this.filters,"maxPrice","maxPrice"),e(this.filters,"minPower","minPower"),e(this.filters,"maxPower","maxPower"),e(this.filters,"minPowerDissipation","minPowerDissipation"),e(this.filters,"maxPowerDissipation","maxPowerDissipation"),this.filters.keyword&&String(this.filters.keyword).trim()&&(t.keyword=String(this.filters.keyword).trim());try{if(this.activeSortField){const e=this.sortStates||{};t[this.activeSortField]=!!e[this.activeSortField]}}catch(i){}return t},async fetchPayTypes(){try{const t=await(0,s.getPayTypes)({shopId:this.params.id,productId:this.params.id});if(t&&(0===t.code||200===t.code)){const e=Array.isArray(t.data)?t.data:[];this.paymentMethodList=e,this.ensureDefaultPayFilterSelection()}}catch(t){this.paymentMethodList=[]}},async fetchGetMachineInfo(t){this.productDetailLoading=!0;const e=await(0,s.getShopMachineList)(t);if(e&&(200===e.code||0===e.code)){const t=e&&e.data?e.data:e,a=Array.isArray(t.columns)?t.columns:Array.isArray(e.columns)?e.columns:[],s=Array.isArray(t.rows)?t.rows:Array.isArray(e.rows)?e.rows:[],o=Number(null!=t.total?t.total:null!=e.total?e.total:0);this.total=Number.isFinite(o)?o:0,this.dynamicColumns=a,this.dynamicRows=s.map(t=>({saleNumbers:0,saleOutNumbers:0,leaseTime:1,purchaseQuantity:1,_selected:!1,...t})),this.ensureDefaultPayFilterFromPrices();try{const e=t&&t.payConfigList;Array.isArray(e)&&e.length&&(this.paymentMethodList=e,this.ensureDefaultPayFilterSelection())}catch(i){}}this.productDetailLoading=!1},async loadProduct(){try{this.loading=!0;const t=this.$route.params.id;this.product=await(0,a.getProductById)(t),this.product||this.$message({message:"商品不存在",type:"error",showClose:!0})}catch(t){console.error("加载商品详情失败:",t),this.$message({message:"加载商品详情失败,请稍后重试",type:"error",showClose:!0})}finally{this.loading=!1}},async fetchAddCart(t){const e=await addCart(t);return e},async fetchGetGoodsList(t){const e=await(0,r.getGoodsListV2)(t);try{const t=this.params&&this.params.id?Number(this.params.id):Number(this.$route.params.id),a=Array.isArray(e&&e.rows)?e.rows:Array.isArray(e&&e.data&&e.data.rows)?e.data.rows:Array.isArray(e&&e.data)?e.data:[],s=a.length&&a[0]&&Array.isArray(a[0].shoppingCartInfoDtoList)?a.flatMap(t=>Array.isArray(t.shoppingCartInfoDtoList)?t.shoppingCartInfoDtoList:[]):a,o=s.filter(e=>Number(e.productId)===t),r=new Set,n=new Set;o.forEach(t=>{const e=Array.isArray(t.productMachineDtoList)?t.productMachineDtoList:[];e.forEach(t=>{t&&(void 0!==t.id&&null!==t.id&&r.add(String(t.id)),t.user&&t.miner&&n.add(`${String(t.user)}|${String(t.miner)}`))})}),this.cartMachineIdSet=r,this.cartCompositeKeySet=n;try{const t=s.reduce((t,e)=>t+(Array.isArray(e&&e.productMachineDtoList)?e.productMachineDtoList.length:0),0);Number.isFinite(t)&&window.dispatchEvent(new CustomEvent("cart-updated",{detail:{count:t}}))}catch(i){}this.$nextTick(()=>{this.cartLoaded=!0,this.autoSelectAndDisable()})}catch(i){console.warn("解析购物车数据失败",i)}},handleBack(){this.$router.push("/productList")},handleSeriesRowClick(t){const e=t.id,i=Object.keys(this.selectedMap).filter(t=>(this.selectedMap[t]||[]).length>0),a=this.expandedRowKeys.includes(e);this.expandedRowKeys=a?i:Array.from(new Set([e,...i]))},handleGetSeriesRowClassName(){return"series-clickable-row"},handleInnerSelectionChange(t,e){const i=t.id;this.$set(this.selectedMap,i,e);const a=Object.keys(this.selectedMap).filter(t=>(this.selectedMap[t]||[]).length>0),s=new Set(this.expandedRowKeys);a.forEach(t=>s.add(t)),this.expandedRowKeys=Array.from(s).filter(t=>a.includes(t)||t===i||this.expandedRowKeys.includes(t))},handleExpandChange(t,e){},autoSelectAndDisable(){},isSelectable(t,e){return!0},isSelectedByParent(t,e){const i=t&&t.id,a=i&&this.selectedMap[i]||[];return!!a.find(t=>t&&t.id===e.id)},handleManualSelect(t,e,i){if(e&&(1===e.saleState||2===e.saleState))return this.$message.warning("该机器已售出或售出中,无法选择"),void this.$set(e,"_selected",!1);try{const t=Array.isArray(e&&e.priceList)&&e.priceList.some(t=>t&&null!==t.price&&void 0!==t.price)||e&&null!==e.price&&void 0!==e.price&&""!==e.price;if(!t)return this.$message.warning("该机器暂无价格,无法选择"),void this.$set(e,"_selected",!1)}catch(r){}const a=t.id,s=this.selectedMap[a]&&[...this.selectedMap[a]]||[],o=s.findIndex(t=>t&&t.id===e.id);i&&-1===o&&s.push(e),!i&&o>-1&&s.splice(o,1),this.$set(this.selectedMap,a,s),this.$set(e,"_selected",!!i)},handleGetInnerRowClass({row:t}){return t&&(1===t.saleState||2===t.saleState)?"sold-row":""},handleDecreaseVariantQuantity(t,e){const i=this.productListData[t].variants[e];i.quantity>1&&i.quantity--},handleIncreaseVariantQuantity(t,e){const i=this.productListData[t].variants[e];i.quantity<99&&i.quantity++},handleVariantQuantityInput(t,e){const i=this.productListData[t].variants[e],a=Number(i.quantity);(!a||a<1)&&(i.quantity=1),a>99&&(i.quantity=99)},handleAddVariantToCart(t){if(t&&t.onlyKey)try{addToCart({id:t.onlyKey,title:t.model,price:t.price,quantity:t.quantity}),this.$message.success("已添加到购物车"),t.quantity=1}catch(e){console.error("添加到购物车失败:",e)}},handleAddSelectedToCart(){const t=Object.values(this.selectedMap).flat().filter(Boolean);if(t.length)try{t.forEach(t=>{addToCart({id:t.onlyKey||t.id,title:t.type||t.model||"矿机",price:t.price,quantity:1,leaseTime:Number(t.leaseTime||1)})}),this.$message.success("已添加到购物车"),this.selectedMap={}}catch(e){console.error("统一加入购物车失败",e)}else this.$message.warning("请先勾选至少一台矿机")},handleOpenAddToCartDialog(){const t=Array.isArray(this.dynamicRows)?this.dynamicRows:[],e=t.filter(t=>!!t&&!!t._selected);e.length?(this.confirmAddDialog.items=e.map(t=>({...t,leaseTime:Number(t.leaseTime||1),purchaseQuantity:Number(t.purchaseQuantity||1)})),this.confirmAddDialog.visible=!0):this.$message.warning("请先勾选至少一台矿机")},async handleConfirmAddSelectedToCart(){const t=Array.isArray(this.confirmAddDialog.items)?this.confirmAddDialog.items.filter(Boolean):[];if(t.length)try{const i=t.map(t=>{const e={id:t.id,leaseTime:Number(t.leaseTime||1)};return 0===this.machineType&&(e.numbers=Number(t.purchaseQuantity||1)),e}),a=await(0,s.addGoodsV2)(i);if(a&&(0===a.code||200===a.code)){this.$message({message:"已添加到购物车",type:"success",duration:3e3,showClose:!0});try{await this.fetchGetMachineInfo(this.buildQueryParams())}catch(e){}}this.confirmAddDialog.visible=!1;try{(this.dynamicRows||[]).forEach(t=>{t&&this.$set(t,"_selected",!1)})}catch(e){}try{window.dispatchEvent(new CustomEvent("cart-updated"))}catch(e){}}catch(e){console.error("addGoodsV2 error:",e),this.$message.error("加入购物车失败,请稍后重试")}else this.$message.warning("请先勾选至少一台矿机")},clearAllSelections(){try{if(this.selectedMap={},Array.isArray(this.machineList)&&this.machineList.length)return void this.machineList.forEach(t=>{t&&this.$set(t,"_selected",!1)});const t=Array.isArray(this.productListData)?this.productListData:[];t.forEach(t=>{const e=Array.isArray(t.productMachines)?t.productMachines:[];e.forEach(t=>{t&&this.$set(t,"_selected",!1)})})}catch(t){}},handleDecreaseQuantity(t){this.tableData[t].quantity>1&&this.tableData[t].quantity--},handleIncreaseQuantity(t){this.tableData[t].quantity<99&&this.tableData[t].quantity++},handleQuantityInput(t){const e=this.tableData[t].quantity;e<1?this.tableData[t].quantity=1:e>99&&(this.tableData[t].quantity=99)},handleQuantityBlur(t){const e=this.tableData[t].quantity;!e||e<1?this.tableData[t].quantity=1:e>99&&(this.tableData[t].quantity=99)},handleAddToCart(t){if(!t||t.quantity<1)this.$message.warning("请选择有效的数量");else try{addToCart({id:t.date,title:t.date,price:t.price,quantity:t.quantity,leaseTime:Number(t.leaseTime||1)}),this.$message.success("已添加到购物车"),t.quantity=1}catch(e){console.error("添加到购物车失败:",e),this.$message.error("添加到购物车失败,请稍后重试")}},handleSizeChange(t){console.log(`每页 ${t} 条`),this.params.pageSize=t,this.params.pageNum=1,this.currentPage=1,this.fetchGetMachineInfo(this.buildQueryParams())},handleCurrentChange(t){console.log(`当前页: ${t}`),this.params.pageNum=t,this.fetchGetMachineInfo(this.buildQueryParams())}}}},4551:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=e.SecureStorage=void 0,i(6573),i(8100),i(7936),i(9577),i(1549),i(9797),i(9631),i(5623),i(4979);const a="power-leasing-2024-secure-key-v1";function s(t){const e=new TextEncoder;return e.encode(t)}function o(t){const e=new TextDecoder;return e.decode(t)}function r(t){const e=new Uint8Array(t);let i="";for(let a=0;at.handleManualSelectFlat(i,e)},model:{value:i._selected,callback:function(e){t.$set(i,"_selected",e)},expression:"row._selected"}})]}}],null,!1,1048063571)}),e("el-table-column",{attrs:{label:"购物车",width:"68","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function({row:i}){return[i&&i.inCart?e("el-tag",{staticClass:"cart-flag",attrs:{size:"mini"}},[t._v("已添加")]):e("el-tag",{attrs:{size:"mini",type:"info"}},[t._v("未添加")])]}}],null,!1,659372970)}),t._l(t.getRenderedColumns(),function(i,a){return e("el-table-column",{key:i.key||a,attrs:{prop:i.key,label:i.label,fixed:i.fixed||!1,"show-overflow-tooltip":""},scopedSlots:t._u([{key:"header",fn:function(){return[e("div",{staticClass:"col-header",attrs:{title:i.label}},[i.icon?e("img",{staticClass:"col-icon",attrs:{src:i.icon,alt:""}}):t._e(),e("span",[t._v(t._s(i.label))]),t.isLastHashrateColumn(a)?e("el-button",{staticClass:"more-action",attrs:{type:"text"},on:{click:function(e){return e.stopPropagation(),t.handleOpenDynamicSearch.apply(null,arguments)}}},[t._v("更多")]):t._e()],1)]},proxy:!0},{key:"default",fn:function({row:a}){return[e("span",{class:t.getCellClass(i)},[t.formatDynamicCell(a,i).truncated?e("el-tooltip",{attrs:{content:t.formatDynamicCell(a,i).full,placement:"top"}},[e("span",[t._v(t._s(t.formatDynamicCell(a,i).text))])]):e("span",[t._v(t._s(t.formatDynamicCell(a,i).text))])],1)]}}],null,!0)})}),0===t.machineType?e("el-table-column",{attrs:{prop:"saleNumbers",label:"总机器数"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",[t._v(t._s(null!=i.row.saleNumbers?i.row.saleNumbers:"—"))])]}}],null,!1,1658856336)}):t._e(),0===t.machineType?e("el-table-column",{attrs:{prop:"saleOutNumbers",label:"已售数量"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",[t._v(t._s(null!=i.row.saleOutNumbers?i.row.saleOutNumbers:"—"))])]}}],null,!1,1678042608)}):t._e(),e("el-table-column",{attrs:{prop:"leaseTime",label:"租赁天数(天)"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-input-number",{staticClass:"input-full",attrs:{min:1,max:t.getRowMaxLeaseDays(i.row),precision:0,step:1,controls:!1,size:"mini"},on:{change:e=>t.handleLeaseDaysChange(i.row,e)},model:{value:i.row.leaseTime,callback:function(e){t.$set(i.row,"leaseTime",e)},expression:"scope.row.leaseTime"}})]}}],null,!1,1697156763)}),0===t.machineType?e("el-table-column",{attrs:{prop:"purchaseQuantity",label:"购买数量"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-input-number",{staticClass:"input-full",attrs:{min:1,max:t.getRowMaxPurchase(i.row),precision:0,step:1,controls:!1,size:"mini",disabled:t.getRowMaxPurchase(i.row)<=0},on:{change:e=>t.handlePurchaseQuantityChange(i.row,e)},model:{value:i.row.purchaseQuantity,callback:function(e){t.$set(i.row,"purchaseQuantity",e)},expression:"scope.row.purchaseQuantity"}})]}}],null,!1,3016046336)}):t._e(),e("el-table-column",{attrs:{prop:"totalAmount",label:"总价","header-align":"left",align:"left"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",{staticClass:"price-strong"},[t._v(t._s(t.formatConfirmTotalText(i.row)))])]}}],null,!1,1059681298)})],2),e("el-dialog",{attrs:{title:"搜索币种/算法",visible:t.dynamicSearch.visible,width:"420px"},on:{"update:visible":function(e){return t.$set(t.dynamicSearch,"visible",e)}}},[e("div",{staticClass:"dynamic-search-bar",staticStyle:{display:"flex",gap:"10px","align-items":"center"}},[e("el-input",{attrs:{placeholder:"输入币种代码或算法关键词",clearable:""},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleConfirmDynamicSearch.apply(null,arguments)}},model:{value:t.dynamicSearch.keyword,callback:function(e){t.$set(t.dynamicSearch,"keyword",e)},expression:"dynamicSearch.keyword"}}),e("el-button",{attrs:{type:"primary"},on:{click:t.handleConfirmDynamicSearch}},[t._v("搜索")])],1)])],1):t._e(),e("div",{staticStyle:{margin:"18px","text-align":"right"}},[e("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.handleOpenAddToCartDialog}},[t._v("加入购物车")])],1),e("el-dialog",{attrs:{visible:t.confirmAddDialog.visible,width:"70vw",title:`确认加入购物车(共 ${t.confirmAddDialog.items.length} 台)`},on:{"update:visible":function(e){return t.$set(t.confirmAddDialog,"visible",e)}},scopedSlots:t._u([{key:"footer",fn:function(){return[e("el-button",{on:{click:function(e){t.confirmAddDialog.visible=!1}}},[t._v("取消")]),e("el-button",{attrs:{type:"primary"},on:{click:t.handleConfirmAddSelectedToCart}},[t._v("确认加入")])]},proxy:!0}])},[e("div",[e("el-table",{attrs:{data:t.confirmAddDialog.items,height:"360",border:"",stripe:"","header-cell-style":{textAlign:"left"},"cell-style":{textAlign:"left"}}},[e("el-table-column",{attrs:{prop:"model",label:"型号","header-align":"left",align:"left"}}),e("el-table-column",{attrs:{prop:"price",label:"价格","header-align":"left",align:"left"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",{staticClass:"price-strong"},[t.formatDynamicCell(i.row,{key:"price",type:"amount"}).truncated?e("el-tooltip",{attrs:{content:t.formatDynamicCell(i.row,{key:"price",type:"amount"}).full,placement:"top"}},[e("span",[t._v(t._s(t.formatDynamicCell(i.row,{key:"price",type:"amount"}).text))])]):e("span",[t._v(t._s(t.formatDynamicCell(i.row,{key:"price",type:"amount"}).text))])],1)]}}])}),e("el-table-column",{attrs:{prop:"leaseTime",label:"租赁天数(天)","header-align":"left",align:"left"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(Number(e.row.leaseTime||1)))]}}])}),0===t.machineType?e("el-table-column",{attrs:{prop:"purchaseQuantity",label:"购买数量","header-align":"left",align:"left"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(Number(e.row.purchaseQuantity||0)))]}}],null,!1,1092190239)}):t._e(),e("el-table-column",{attrs:{prop:"totalAmount",label:"总价","header-align":"left",align:"left"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",{staticClass:"price-strong"},[t._v(t._s(t.formatConfirmTotalText(i.row)))])]}}])})],1)],1)]),e("el-row",{staticStyle:{"margin-bottom":"20px"}},[e("el-col",{staticStyle:{display:"flex","justify-content":"center"},attrs:{span:24}},[e("el-pagination",{staticStyle:{margin:"0 auto","margin-top":"10px"},attrs:{"current-page":t.currentPage,"page-sizes":t.pageSizes,"page-size":t.params.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:t.total},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange,"update:currentPage":function(e){t.currentPage=e},"update:current-page":function(e){t.currentPage=e}}})],1)],1)],1):e("div",{staticClass:"not-found"},[e("h2",[t._v("商品不存在")]),e("p",[t._v("抱歉,您查找的商品不存在或已被删除。")]),e("button",{staticClass:"back-btn",on:{click:t.handleBack}},[t._v("返回商品列表")])])])},e.Yp=[]},4601:function(t,e,i){Object.defineProperty(e,"B",{value:!0}),e.A=void 0,i(4114),i(8111),i(2489),i(7588),i(1701);i(5705);var a=i(6299),s=i(6966);e.A={name:"AccountShopConfig",data(){return{productOptions:[],form:{chain:"",payAddress:"",payCoin:""},shop:{id:0,name:"",image:"",description:"",del:!0,state:0},value:[],currentChain:"",cascaderProps:{multiple:!0,checkStrictly:!1,emitPath:!0,value:"value",label:"label",children:"children"},options:[],loading:!1,preCheck:{visible:!1,rows:[],prices:{},rowPrices:{}}}},mounted(){this.getChainAndList()},methods:{handleRemoveSelectedCoin(t){const e=String(t||"").toLowerCase(),i=(this.value||[]).filter(t=>Array.isArray(t)&&String(t[1]).toLowerCase()!==e);this.handleChange(i)},handleItemClick(t,e){if(t)if(t.isLeaf){const e=t.path.map(t=>t.value),i=e[0],a=e[1];this.currentChain=String(i||"");let s=Array.isArray(this.value)?this.value.slice():[];const o=s.length?s[s.length-1]:null,r=Array.isArray(o)?o[0]:null;r&&r!==i&&(s=[]);const n=s.findIndex(t=>Array.isArray(t)&&t[0]===i&&t[1]===a);n>=0?s.splice(n,1):s.push([i,a]),this.handleChange(s)}else{const i=e&&e.value;t.expanded||t.expand(),i&&(this.currentChain=String(i),this.value=[],this.form.chain=String(i),this.form.payCoin="")}},handleExpandChange(t){const e=Array.isArray(t)&&t[0]||"";e&&(this.currentChain=String(e))},validateAddressByChain(t,e){const i=String(t||"").toLowerCase(),a=String(e||"").trim();if(!a)return{ok:!1,message:"请输入收款地址"};if(i.includes("tron")||"tron"===i){const t=/^T[A-Za-z1-9]{33}$/.test(a);return t?{ok:!0}:{ok:!1,message:"请输入正确的 TRON 地址:以 T 开头的 34 位字符"}}if(i.includes("ethereum")||"ethereum"===i||i.includes("eth")||i.includes("bsc")||"bsc"===i||i.includes("polygon")||"polygon"===i||i.includes("erc")||i.includes("bep")){const t=/^0x[a-fA-F0-9]{40}$/.test(a);return t?{ok:!0}:{ok:!1,message:"请输入正确的以太坊/EVM 兼容链地址:以 0x 开头 + 40 位十六进制"}}return a.length<=10?{ok:!1,message:"请输入正确的收款地址格式"}:{ok:!0}},async getChainAndList(){this.loading=!0;const t=await(0,a.getChainAndList)();t&&(0===t.code||200===t.code)&&t.data&&(this.options=this.toUpperOptions(t.data)),this.loading=!1},toUpperOptions(t){const e=Array.isArray(t)?t:[];return e.map(t=>{const e={...t},i=t&&(null!=t.label?t.label:t.value)||"";return e.label=String(i).toUpperCase(),Array.isArray(t&&t.children)&&(e.children=this.toUpperOptions(t.children)),e})},async FetchAddWalletShopConfig(t){this.loading=!0;let e=t.payAddress;if(t.payAddress){const i=(0,s.rsaEncryptSync)(t.payAddress);if(i)e=i;else{const i=await(0,s.rsaEncrypt)(t.payAddress);if(!i)return this.$message.error("钱包地址加密失败,请重试"),void(this.loading=!1);e=i}}const i={...t,payAddress:e},o=await(0,a.addWalletShopConfig)(i);!o||0!==o.code&&200!==o.code||(this.$message.success("绑定成功"),this.$router.push("/account/shops")),this.loading=!1},handleChange(t){const e=Array.isArray(t)?t:[];if(0===e.length)return this.form.chain="",this.form.payCoin="",void(this.value=[]);const i=e[e.length-1],a=Array.isArray(i)?i[0]:"",s=this.currentChain||a,o=e.filter(t=>Array.isArray(t)&&t[0]===s);this.value=o,this.form.chain=s||"",this.form.payCoin=o.map(t=>t[1]).filter(Boolean).join(",")},handleSave(){const t=Array.isArray(this.value)?this.value:[];if(this.form.chain=t.length?t[0]&&t[0][0]:"",this.form.payCoin=t.map(t=>t&&t[1]).filter(Boolean).join(","),!this.form.chain)return void this.$message.warning("请选择链");if(!this.form.payCoin)return void this.$message.warning("请选择币种");if(!this.form.payAddress)return void this.$message.warning("请输入钱包地址");const{ok:e,message:i}=this.validateAddressByChain(this.form.chain,this.form.payAddress);e?this.preCheckBeforeBind():this.$message.warning(i||"钱包地址格式不正确")},async preCheckBeforeBind(){try{this.loading=!0,this.preCheck.visible=!1,this.preCheck.rows=[];const t={chain:this.form.chain,payCoin:this.form.payCoin},e=await(0,a.getProductListForShopWalletConfig)(t),i=e&&(0===e.code||200===e.code);if(!i)return void await this.submitBindWithPrice([]);const s=Array.isArray(e&&e.data)?e.data:Array.isArray(e&&e.rows)?e.rows:[];if(Array.isArray(s)&&s.length>0){this.preCheck.rows=s;const t=(this.form.payCoin||"").split(",").map(t=>t.trim().toUpperCase()).filter(Boolean),e={};t.forEach(t=>{t in this.preCheck.prices||(e[t]="")}),this.preCheck.prices={...e,...this.preCheck.prices},this.preCheck.rowPrices=this.preCheck.rowPrices||{},this.preCheck.rows.forEach((e,i)=>{const a=this.getRowKey(e,i);this.preCheck.rowPrices[a]||this.$set(this.preCheck.rowPrices,a,{}),t.forEach(t=>{t in this.preCheck.rowPrices[a]||this.$set(this.preCheck.rowPrices[a],t,"")})}),this.preCheck.visible=!0}else this.preCheck.visible=!1,this.preCheck.rows=[],await this.submitBindWithPrice([])}catch(t){this.preCheck.visible=!1,this.preCheck.rows=[],await this.submitBindWithPrice([])}finally{this.loading=!1}},handleConfirmBindAfterPreview(){const t=(this.form.payCoin||"").split(",").map(t=>t.trim().toUpperCase()).filter(Boolean);for(let i=0;i{null!=e&&""!==e&&t.push(e)};return(t||[]).forEach((t,a)=>{const s=[];Array.isArray(t&&t.machineList)&&t.machineList.forEach(t=>i(s,t&&(null!=t.productMachineId?t.productMachineId:t.id))),Array.isArray(t&&t.productMachineIdList)&&t.productMachineIdList.forEach(t=>i(s,t)),t&&null!=t.productMachineId&&i(s,t.productMachineId),Array.isArray(t&&t.productMachineDtoList)&&t.productMachineDtoList.forEach(t=>i(s,t&&(null!=t.productMachineId?t.productMachineId:t.id))),Array.isArray(t&&t.machines)&&t.machines.forEach(t=>i(s,t&&(null!=t.productMachineId?t.productMachineId:t.id))),Array.isArray(t&&t.items)&&t.items.forEach(t=>i(s,t&&(null!=t.productMachineId?t.productMachineId:t.id)));const o=this.getRowKey(t,a);e.push({key:o,machineIds:s})}),e},getRowKey(t,e){return t&&null!=t.productId?String(t.productId):t&&null!=t.id?`p-${t.id}`:`idx-${e}`},async submitBindWithPrice(t){try{this.loading=!0;const e=(this.form.payCoin||"").split(",").map(t=>t.trim().toUpperCase()).filter(Boolean),i=[];Array.isArray(t)&&t.length&&t.forEach(t=>{const a=this.preCheck.rowPrices&&this.preCheck.rowPrices[t.key]||{},s=e.map(t=>a[t]||"").join(",");(t.machineIds||[]).forEach(t=>{i.push({productMachineId:t,price:s})})});let o=this.form.payAddress;if(this.form.payAddress){const t=(0,s.rsaEncryptSync)(this.form.payAddress);if(t)o=t;else{const t=await(0,s.rsaEncrypt)(this.form.payAddress);if(!t)return this.$message.error("钱包地址加密失败,请重试"),void(this.loading=!1);o=t}}const r={chain:this.form.chain,symbol:this.form.payCoin,payAddress:o,productMachineForWalletConfigVoList:i},n=await(0,a.updateProductListForShopWalletConfig)(r);!n||0!==n.code&&200!==n.code?(this.preCheck.visible=!1,this.resetPreCheckPrices()):(this.preCheck.visible=!1,this.resetPreCheckPrices(),this.$message.success("绑定成功"),this.$router.push("/account/shops"))}catch(e){}finally{this.loading=!1}},handleReset(){this.form={chain:"",payAddress:"",payCoin:""},this.value=[]},resetPreCheckPrices(){try{this.preCheck.prices={},this.preCheck.rowPrices={}}catch(t){}},handlePreCheckClose(){this.resetPreCheckPrices()}},computed:{coinsForBind(){return(this.form.payCoin||"").split(",").map(t=>t.trim().toUpperCase()).filter(Boolean)},canSubmitPreCheck(){if(!this.preCheck||!this.preCheck.visible)return!1;const t=this.coinsForBind;if(!t.length)return!1;for(let e=0;e<(this.preCheck.rows||[]).length;e++){const i=this.preCheck.rows[e],a=this.getRowKey(i,e),s=this.preCheck.rowPrices&&this.preCheck.rowPrices[a]||{};for(const e of t){const t=s[e];if(!t||Number(t)<=0)return!1}}return!0},selectedCoinsDisplay(){const t=Array.isArray(this.value)?this.value:[],e=t.map(t=>t&&t[1]).filter(Boolean).map(t=>String(t).toUpperCase());return e.join("、")},selectedCoins(){const t=Array.isArray(this.value)?this.value:[];return t.map(t=>t&&t[1]).filter(Boolean).map(t=>String(t).toUpperCase())}}}},4749:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"auth-container"},[t._m(0),e("div",{staticClass:"auth-card"},[e("div",{staticClass:"close-btn",attrs:{title:"返回商城"},on:{click:t.goToShop}},[e("i",{staticClass:"el-icon-close"})]),t._m(1),e("el-form",{ref:"loginForm",staticClass:"auth-form",attrs:{model:t.loginForm,rules:t.loginRules},nativeOn:{submit:function(e){return e.preventDefault(),t.handleLogin.apply(null,arguments)}}},[e("el-form-item",{attrs:{prop:"email"}},[e("el-input",{attrs:{placeholder:"请输入邮箱","prefix-icon":"el-icon-message",size:"large",clearable:""},on:{change:t.handleEmailChange},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleLogin.apply(null,arguments)}},model:{value:t.loginForm.email,callback:function(e){t.$set(t.loginForm,"email",e)},expression:"loginForm.email"}})],1),e("el-form-item",{attrs:{prop:"password"}},[e("el-input",{attrs:{type:"password",placeholder:"请输入密码(8-32位)","prefix-icon":"el-icon-lock",size:"large","show-password":"",clearable:""},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleLogin.apply(null,arguments)}},model:{value:t.loginForm.password,callback:function(e){t.$set(t.loginForm,"password",e)},expression:"loginForm.password"}}),e("div",{staticClass:"password-tip"},[e("i",{staticClass:"el-icon-info"}),e("span",[t._v("密码需包含大小写字母、数字和特殊字符,长度8-32位")])])],1),e("el-form-item",{attrs:{prop:"code"}},[e("div",{staticClass:"code-input-wrapper"},[e("el-input",{attrs:{placeholder:"请输入邮箱验证码","prefix-icon":"el-icon-key",size:"large",maxlength:"10",clearable:""},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleLogin.apply(null,arguments)}},model:{value:t.loginForm.code,callback:function(e){t.$set(t.loginForm,"code",e)},expression:"loginForm.code"}}),e("el-button",{staticClass:"send-code-btn",attrs:{type:"primary",size:"large",disabled:t.countdown>0,loading:t.sendingCode},on:{click:t.handleSendCode}},[t._v(" "+t._s(t.countdown>0?`${t.countdown}秒后重试`:"获取验证码")+" ")])],1)]),e("div",{staticClass:"auth-options"},[e("span"),e("router-link",{staticClass:"link-text",attrs:{to:"/reset-password"}},[t._v(" 忘记密码? ")])],1),e("el-form-item",[e("el-button",{staticClass:"auth-submit-btn",attrs:{type:"primary",size:"large",loading:t.loading},on:{click:t.handleLogin}},[t._v(" "+t._s(t.loading?"登录中...":"登录")+" ")])],1),e("div",{staticClass:"auth-footer"},[e("span",{staticClass:"footer-text"},[t._v("还没有账号?")]),e("router-link",{staticClass:"link-text link-primary",attrs:{to:"/register"}},[t._v(" 立即注册 ")])],1)],1)],1)])},e.Yp=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"auth-background"},[e("div",{staticClass:"bg-circle circle-1"}),e("div",{staticClass:"bg-circle circle-2"}),e("div",{staticClass:"bg-circle circle-3"})])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"auth-header"},[e("h1",{staticClass:"auth-title"},[t._v("欢迎登录")]),e("p",{staticClass:"auth-subtitle"},[t._v("Power Leasing - 算力租赁平台")])])}]},4792:function(t,e,i){var a=i(3999)["default"];Object.defineProperty(e,"B",{value:!0}),e.A=void 0;var s=a(i(217)),o=a(i(6505));e.A={name:"AccountSellerFundsFlow",components:{AccountReceiptRecord:s.default,AccountWithdrawRecord:o.default},data(){return{activeTab:"receipt"}},computed:{activeComponentName(){return"withdraw"===this.activeTab?"AccountWithdrawRecord":"AccountReceiptRecord"}},created(){this.syncTabFromRoute()},watch:{"$route.query.tab":{immediate:!1,handler(){this.syncTabFromRoute()}}},methods:{syncTabFromRoute(){const t=String(this.$route&&this.$route.query&&this.$route.query.tab||"");this.activeTab="withdraw"===t?"withdraw":"receipt"},handleTabClick(){const t="withdraw"===this.activeTab?"withdraw":"receipt",e=String(this.$route&&this.$route.query&&this.$route.query.tab||"");e!==t&&this.$router.replace({query:{...this.$route.query||{},tab:t}})}}}},4981:function(t,e){function i(){return 6}function a(t,e){if(null===t||void 0===t)return{text:"0",truncated:!1,full:"0"};const i=String(t);if(!i)return{text:"0",truncated:!1,full:"0"};if(!/^-?\d+(\.\d+)?$/.test(i))return{text:i,truncated:!1,full:i};const a=i.startsWith("-"),s=a?i.slice(1):i,[o,r=""]=s.split("."),n=r.slice(0,Math.max(0,e)),l=r.length>e,c=(a?"-":"")+(n?`${o}.${n}`:o);return{text:c,truncated:l,full:i}}function s(t,e){const s=i(e);return a(t,s)}function o(t){return a(t,6)}Object.defineProperty(e,"__esModule",{value:!0}),e.getMaxDecimalsByCoin=i,e.truncateAmountByCoin=s,e.truncateAmountRaw=a,e.truncateTo6=o},4994:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=void 0,i(4114),i(8111),i(7588);class a{constructor(){this.loadingStates=new Map,this.setupListeners()}setupListeners(){window.addEventListener("network-retry-complete",()=>{this.resetAllLoadingStates()})}setLoading(t,e,i){const a=`${t}:${e}`;this.loadingStates.set(a,{value:i,timestamp:Date.now()})}getLoading(t,e){const i=`${t}:${e}`,a=this.loadingStates.get(i);return!!a&&a.value}resetAllLoadingStates(){const t=[];this.loadingStates.forEach((e,i)=>{if(!0===e.value){const[e,a]=i.split(":");t.push({componentId:e,stateKey:a}),this.loadingStates.set(i,{value:!1,timestamp:Date.now()})}}),window.dispatchEvent(new CustomEvent("reset-loading-states",{detail:{componentsToUpdate:t}}))}resetComponentLoadingStates(t){const e=[];return this.loadingStates.forEach((i,a)=>{if(a.startsWith(`${t}:`)&&!0===i.value){const i=a.split(":")[1];e.push({componentId:t,stateKey:i}),this.loadingStates.set(a,{value:!1,timestamp:Date.now()})}}),e}}const s=new a;e["default"]=s},5097:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(8224),s=i(6163),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"b7bcb2b4",null),l=n.exports},5355:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(8466),s=i(1029),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"69d09b20",null),l=n.exports},5367:function(t,e,i){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.productListLoading,expression:"productListLoading"}],staticClass:"product-list"},[e("section",{staticClass:"container"},[e("h1",{staticClass:"page-title"},[t._v("商品列表")]),e("section",{staticClass:"filter-section"},[e("div",{staticClass:"filter-row"},[e("el-input",{staticClass:"search-input",attrs:{size:"middle",placeholder:"输入币种或算法搜索",clearable:""},on:{clear:t.handleAlgorithmClear},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleAlgorithmSearch.apply(null,arguments)}},scopedSlots:t._u([{key:"append",fn:function(){return[e("el-button",{attrs:{type:"primary"},on:{click:t.handleAlgorithmSearch}},[t._v("搜索")])]},proxy:!0}]),model:{value:t.searchAlgorithm,callback:function(e){t.searchAlgorithm=e},expression:"searchAlgorithm"}})],1)]),e("div",{staticClass:"product-list-grid"},[t._l(t.products,function(a,s){return e("div",{key:a.shopId||a.id||s,staticClass:"product-item",attrs:{tabindex:"0","aria-label":"查看详情"},on:{click:function(e){return t.handleProductClick(a)}}},[e("img",{staticClass:"product-image",attrs:{src:i(6278),alt:a.name}}),e("div",{staticClass:"product-info"},[e("h4",{staticClass:"title-line"},[e("span",{staticClass:"label"},[t._v("店铺:")]),e("span",{staticClass:"value ellipsis",attrs:{title:a.shopName||a.name}},[t._v(t._s(a.shopName||a.name))])]),e("p",{staticClass:"info-line coin-line"},[e("span",{staticClass:"label"},[t._v("币种:")]),e("el-tooltip",{attrs:{content:a.coin,placement:"top","open-delay":80}},[e("span",{staticClass:"value ellipsis",attrs:{tabindex:"0","aria-label":`币种 ${a.coin}`}},[t._v(t._s(a.coin))])])],1),e("p",{staticClass:"info-line algorithm-line"},[e("span",{staticClass:"label"},[t._v("算法:")]),e("el-tooltip",{attrs:{content:a.algorithm,placement:"top","open-delay":80}},[e("span",{staticClass:"value ellipsis",attrs:{tabindex:"0","aria-label":`算法 ${a.algorithm}`}},[t._v(t._s(a.algorithm))])])],1),e("div",{staticClass:"product-footer"},[e("div",{staticClass:"paytypes"},[e("span",{staticClass:"paytypes-label"},[t._v("支付方式:")]),t._l(a.payTypes||[],function(i,a){return e("el-tooltip",{key:a,attrs:{content:t.formatPayType(i),placement:"top","open-delay":80}},[e("img",{staticClass:"paytype-icon",attrs:{src:i.image,alt:t.formatPayType(i)}})])})],2),e("div",{staticClass:"right-meta"},[e("span",{staticClass:"product-sold",attrs:{"aria-label":"已售数量"}},[t._v("已售:"+t._s(a&&null!=a.saleNumber?a.saleNumber:0))])])])])])}),0!==t.products.length||t.productListLoading?t._e():e("div",{staticClass:"empty-state"},[e("i",{staticClass:"el-icon-goods"}),e("p",[t._v("暂无商品数据")]),e("p",{staticStyle:{"font-size":"12px",color:"#999","margin-top":"8px"}},[t._v("请检查网络连接或联系管理员")])])],2)])])},e.Yp=[]},5402:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(9668),s=i(6087),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"93f5ba42",null),l=n.exports},5502:function(t,e,i){Object.defineProperty(e,"B",{value:!0}),e.A=void 0,i(4114);var a=i(1673),s=i(6966),o=i(2549),r=i(2032);e.A={name:"SecuritySettings",data(){const t=(t,e,i)=>{if(!e)return void i(new Error("请输入密码"));const a=/^(?!.*[\u4e00-\u9fa5])(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_]+$)(?![a-z0-9]+$)(?![a-z\W_]+$)(?![0-9\W_]+$)[a-zA-Z0-9\W_]{8,32}$/;a.test(e)?i():i(new Error("密码应包含大小写字母、数字和特殊字符,长度8-32位"))};return{isEnabled:!1,loading:!1,statusLoading:!1,step1Visible:!1,step2Visible:!1,step1ClosingForStepTransition:!1,closeDialogVisible:!1,openDialogVisible:!1,deleteAccountDialogVisible:!1,changePasswordDialogVisible:!1,userEmail:"",qrCodeUrl:"",secretKey:"",sendingCode:!1,countdown:0,countdownTimer:null,sendingCloseCode:!1,closeCountdown:0,closeCountdownTimer:null,sendingOpenCode:!1,openCountdown:0,openCountdownTimer:null,sendingDeleteAccountCode:!1,deleteAccountCountdown:0,deleteAccountCountdownTimer:null,deletingAccount:!1,sendingChangePasswordCode:!1,changePasswordCountdown:0,changePasswordCountdownTimer:null,changingPassword:!1,closing:!1,opening:!1,submitting:!1,verifyForm:{password:"",emailCode:"",googleCode:""},closeForm:{emailCode:"",googleCode:""},openForm:{emailCode:"",googleCode:""},deleteAccountForm:{emailCode:"",googleCode:""},changePasswordForm:{emailCode:"",password:"",confirmPassword:"",googleCode:""},verifyRules:{password:[{required:!0,validator:t,trigger:"blur"}],emailCode:[{required:!0,message:"请输入邮箱验证码",trigger:"blur"},{min:1,max:10,message:"验证码长度为1-10位",trigger:"blur"}],googleCode:[{required:!0,message:"请输入谷歌验证码",trigger:"blur"},{pattern:/^\d{6}$/,message:"请输入6位数字",trigger:"blur"}]},closeRules:{emailCode:[{required:!0,message:"请输入邮箱验证码",trigger:"blur"},{min:1,max:10,message:"验证码长度为1-10位",trigger:"blur"}],googleCode:[{required:!0,message:"请输入谷歌验证码",trigger:"blur"},{pattern:/^\d{6}$/,message:"请输入6位数字",trigger:"blur"}]},openRules:{emailCode:[{required:!0,message:"请输入邮箱验证码",trigger:"blur"},{min:1,max:10,message:"验证码长度为1-10位",trigger:"blur"}],googleCode:[{required:!0,message:"请输入谷歌验证码",trigger:"blur"},{pattern:/^\d{6}$/,message:"请输入6位数字",trigger:"blur"}]},deleteAccountRules:{emailCode:[{required:!0,message:"请输入邮箱验证码",trigger:"blur"},{min:1,max:10,message:"验证码长度为1-10位",trigger:"blur"}],googleCode:[{required:!0,message:"请输入谷歌验证码",trigger:"blur"},{pattern:/^\d{6}$/,message:"请输入6位数字",trigger:"blur"}]},changePasswordRules:{},googleStatus:1}},computed:{getQrCodeSrc(){return this.qrCodeUrl?this.qrCodeUrl.startsWith("data:")?this.qrCodeUrl:`data:image/png;base64,${this.qrCodeUrl}`:""},getStatusText(){switch(this.googleStatus){case 0:return"已开启";case 1:return"未绑定";case 2:return"已关闭";default:return"未绑定"}},getButtonText(){switch(this.googleStatus){case 0:return"关闭";case 1:return"设置";case 2:return"开启";default:return"设置"}},getStatusClass(){return{"status-enabled":0===this.googleStatus,"status-bound":2===this.googleStatus}},getButtonType(){switch(this.googleStatus){case 0:return"danger";case 1:return"primary";case 2:return"primary";default:return"primary"}}},mounted(){this.check2FAStatus(),this.loadUserEmail(),this.initChangePasswordRules()},beforeDestroy(){this.countdownTimer&&clearInterval(this.countdownTimer),this.closeCountdownTimer&&clearInterval(this.closeCountdownTimer),this.openCountdownTimer&&clearInterval(this.openCountdownTimer),this.deleteAccountCountdownTimer&&clearInterval(this.deleteAccountCountdownTimer)},methods:{initChangePasswordRules(){const t=(0,r.createPasswordValidator)({emptyMessage:"请输入密码"});this.changePasswordRules={emailCode:[{required:!0,message:"请输入邮箱验证码",trigger:"blur"},{min:1,max:10,message:"验证码长度为1-10位",trigger:"blur"}],password:[{required:!0,validator:t,trigger:"blur"}],confirmPassword:[{required:!0,validator:this.validateConfirmPassword,trigger:"blur"}],googleCode:[{required:!0,message:"请输入谷歌验证码",trigger:"blur"},{pattern:/^\d{6}$/,message:"请输入6位数字",trigger:"blur"}]}},async ensureGoogleStatusEnabledForSensitiveOp(t){try{const e=await(0,a.getGoogleStatus)();if(!e||0!==e.code&&200!==e.code)return this.$message.error("获取双重验证状态失败,请稍后重试"),!1;const i=e.data?.status??e.data??1;if(this.googleStatus=i,this.isEnabled=0===Number(i),0===Number(i))return!0;const s=1===Number(i)?"您尚未绑定双重验证":"您已关闭双重验证",o=`\n
\n
${s}
\n
\n 请先在安全设置中绑定并开启双重验证后,才可以进行${t||"该"}操作。\n
\n
\n `;return await this.$confirm(o,"安全提示",{confirmButtonText:"去开启双重验证",cancelButtonText:"取消",type:"warning",dangerouslyUseHTMLString:!0,customClass:"google-2fa-guard-dialog"}),await this.handleEnable2FA(),!1}catch(e){return!1}},async check2FAStatus(){this.statusLoading=!0;try{const t=await(0,a.getGoogleStatus)();if(!t||0!==t.code&&200!==t.code)this.googleStatus=1,this.isEnabled=!1;else{const e=t.data?.status??t.data??1;this.googleStatus=e,this.isEnabled=0===e}}catch(t){console.error("查询谷歌绑定状态失败",t),this.googleStatus=1,this.isEnabled=!1}finally{this.statusLoading=!1}},handleButtonClick(){switch(this.googleStatus){case 0:this.handleDisable2FA();break;case 1:this.handleEnable2FA();break;case 2:this.handleEnable2FA();break;default:this.handleEnable2FA()}},async handleEnable2FA(){if(1===this.googleStatus){this.loading=!0;try{const t=await(0,a.getBindInfo)();!t||0!==t.code&&200!==t.code?this.$message.error(t?.message||t?.msg||"获取绑定信息失败"):(this.qrCodeUrl=t.data?.img||"",this.secretKey=t.data?.secret||"",console.log("getBindInfo 返回数据:",t.data),console.log("保存的 secretKey:",this.secretKey),this.qrCodeUrl||this.secretKey?this.step1Visible=!0:this.$message.error("获取绑定信息失败,请稍后重试"))}catch(t){console.error("获取绑定信息失败",t),this.$message.error("获取绑定信息失败,请稍后重试")}finally{this.loading=!1}}else this.openDialogVisible=!0},handleDisable2FA(){this.closeDialogVisible=!0},async handleSendCloseEmailCode(){if(!(this.closeCountdown>0)){this.sendingCloseCode=!0;try{const t=await(0,a.sendCloseGoogleCode)();!t||0!==t.code&&200!==t.code?this.$message.error(t?.message||t?.msg||"发送验证码失败"):(this.$message.success("验证码已发送到您的邮箱"),this.startCloseCountdown())}catch(t){console.error("发送验证码失败",t),this.$message.error("发送验证码失败,请稍后重试")}finally{this.sendingCloseCode=!1}}},startCloseCountdown(){this.closeCountdown=60,this.closeCountdownTimer=setInterval(()=>{this.closeCountdown--,this.closeCountdown<=0&&(clearInterval(this.closeCountdownTimer),this.closeCountdownTimer=null)},1e3)},handleCloseGoogleCodeInput(t){this.closeForm.googleCode=t.replace(/\D/g,"").slice(0,6)},async handleConfirmClose(){try{const t=await this.$refs.closeForm.validate();if(!t)return;this.closing=!0;const e={eCode:this.closeForm.emailCode,gCode:this.closeForm.googleCode},i=await(0,a.closeStepTwo)(e);!i||0!==i.code&&200!==i.code?this.$message.error(i?.message||i?.msg||"关闭失败,请检查输入信息"):(this.$message.success("双重验证已关闭"),this.closeDialogVisible=!1,this.googleStatus=2,this.isEnabled=!1,this.handleCloseDialogClose(),this.check2FAStatus())}catch(t){console.error("关闭双重验证失败",t),this.$message.error("关闭失败,请稍后重试")}finally{this.closing=!1}},handleCloseDialogClose(){this.closeForm={emailCode:"",googleCode:""},this.$refs.closeForm&&this.$refs.closeForm.clearValidate()},async handleSendOpenEmailCode(){if(!(this.openCountdown>0)){this.sendingOpenCode=!0;try{const t=await(0,a.sendOpenGoogleCode)();!t||0!==t.code&&200!==t.code?this.$message.error(t?.message||t?.msg||"发送验证码失败"):(this.$message.success("验证码已发送到您的邮箱"),this.startOpenCountdown())}catch(t){console.error("发送验证码失败",t),this.$message.error("发送验证码失败,请稍后重试")}finally{this.sendingOpenCode=!1}}},startOpenCountdown(){this.openCountdown=60,this.openCountdownTimer=setInterval(()=>{this.openCountdown--,this.openCountdown<=0&&(clearInterval(this.openCountdownTimer),this.openCountdownTimer=null)},1e3)},handleOpenGoogleCodeInput(t){this.openForm.googleCode=t.replace(/\D/g,"").slice(0,6)},async handleConfirmOpen(){try{const t=await this.$refs.openForm.validate();if(!t)return;this.opening=!0;const e={eCode:this.openForm.emailCode,gCode:this.openForm.googleCode},i=await(0,a.openStepTwo)(e);!i||0!==i.code&&200!==i.code?this.$message.error(i?.message||i?.msg||"开启失败,请检查输入信息"):(this.$message.success("双重验证已开启"),this.openDialogVisible=!1,this.googleStatus=0,this.isEnabled=!0,this.handleOpenDialogClose(),this.check2FAStatus())}catch(t){console.error("开启双重验证失败",t),this.$message.error("开启失败,请稍后重试")}finally{this.opening=!1}},handleOpenDialogClose(){this.openForm={emailCode:"",googleCode:""},this.$refs.openForm&&this.$refs.openForm.clearValidate()},handleCopySecret(){if(!this.secretKey)return;const t=document.createElement("input");t.value=this.secretKey,document.body.appendChild(t),t.select();try{document.execCommand("copy"),this.$message.success("密钥已复制到剪贴板")}catch(e){this.$message.error("复制失败,请手动复制")}document.body.removeChild(t)},handleStep1Close(){this.step1ClosingForStepTransition?this.step1ClosingForStepTransition=!1:(this.qrCodeUrl="",this.secretKey="")},handleNextToStep2(){this.qrCodeUrl||this.secretKey?(this.step1ClosingForStepTransition=!0,this.step1Visible=!1,this.step2Visible=!0):this.$message.warning("请先获取二维码或密钥")},handleBackToStep1(){this.step2Visible=!1,this.step1Visible=!0},handleStep2Close(){this.verifyForm={password:"",emailCode:"",googleCode:""},this.$refs.verifyForm&&this.$refs.verifyForm.clearValidate()},async handleSendEmailCode(){if(!(this.countdown>0)){this.sendingCode=!0;try{const t=await(0,a.sendOpenGoogleCode)();!t||0!==t.code&&200!==t.code?this.$message.error(t?.message||t?.msg||"发送验证码失败"):(this.$message.success("验证码已发送到您的邮箱"),this.startCountdown())}catch(t){console.error("发送验证码失败",t),this.$message.error("发送验证码失败,请稍后重试")}finally{this.sendingCode=!1}}},startCountdown(){this.countdown=60,this.countdownTimer=setInterval(()=>{this.countdown--,this.countdown<=0&&(clearInterval(this.countdownTimer),this.countdownTimer=null)},1e3)},handleGoogleCodeInput(t){this.verifyForm.googleCode=t.replace(/\D/g,"").slice(0,6)},async handleConfirm(){try{const t=await this.$refs.verifyForm.validate();if(!t)return;if(!this.secretKey)return void this.$message.warning("密钥不存在,请重新获取");const e=(this.verifyForm.password||"").trim(),i=(this.verifyForm.emailCode||"").trim(),o=(this.verifyForm.googleCode||"").trim();if(!e)return void this.$message.warning("请输入密码");this.submitting=!0;const r=await(0,s.rsaEncrypt)(e);if(!r)return this.$message.error("密码加密失败,请稍后重试"),void(this.submitting=!1);const n={eCode:i,gCode:o,pwd:r,secret:this.secretKey};console.log("提交参数:",n);const l=await(0,a.bindGoogle)(n);!l||0!==l.code&&200!==l.code?this.$message.error(l?.message||l?.msg||"绑定失败,请检查输入信息"):(this.$message.success("双重验证已成功开启"),this.step2Visible=!1,this.googleStatus=0,this.isEnabled=!0,this.handleStep2Close())}catch(t){console.error("绑定失败",t)}finally{this.submitting=!1}},handleCannotGetCode(){this.$message.info("请检查邮箱垃圾箱,或联系客服")},handleCannotGetGoogleCode(){this.$message.info("请确保已正确扫描二维码或输入密钥,并检查时间同步")},async handleChangePassword(){if(!this.userEmail)return void this.$message.warning("无法获取用户邮箱,请重新登录");const t=await this.ensureGoogleStatusEnabledForSensitiveOp("修改密码");t&&(this.changePasswordDialogVisible=!0)},async handleSendChangePasswordCode(){if(!(this.changePasswordCountdown>0))if(this.userEmail){this.sendingChangePasswordCode=!0;try{const t=await(0,o.sendUpdatePwdCode)({email:this.userEmail});!t||0!==t.code&&200!==t.code?this.$message.error(t?.message||t?.msg||"发送验证码失败"):(this.$message.success("验证码已发送到您的邮箱"),this.startChangePasswordCountdown())}catch(t){console.error("发送验证码失败",t),this.$message.error("发送验证码失败,请稍后重试")}finally{this.sendingChangePasswordCode=!1}}else this.$message.warning("无法获取用户邮箱,请重新登录")},startChangePasswordCountdown(){this.changePasswordCountdown=60,this.changePasswordCountdownTimer=setInterval(()=>{this.changePasswordCountdown--,this.changePasswordCountdown<=0&&(clearInterval(this.changePasswordCountdownTimer),this.changePasswordCountdownTimer=null)},1e3)},handleChangePasswordGoogleCodeInput(t){this.changePasswordForm.googleCode=t.replace(/\D/g,"").slice(0,6)},validateConfirmPassword(t,e,i){const a=(e||"").trim(),s=(this.changePasswordForm.password||"").trim();a?a===s?i():i(new Error("两次输入的密码不一致")):i(new Error("请再次输入新密码"))},async handleConfirmChangePassword(){try{const t=await this.$refs.changePasswordForm.validate();if(!t)return;this.changingPassword=!0;const e=(this.userEmail||"").trim(),i=(this.changePasswordForm.password||"").trim(),a=(this.changePasswordForm.emailCode||"").trim(),r=(this.changePasswordForm.googleCode||"").trim(),n=await(0,s.rsaEncrypt)(i);if(!n)return this.$message.error("密码加密失败,请稍后重试"),void(this.changingPassword=!1);const l={code:a,email:e,password:n,gcode:r},c=await(0,o.updatePasswordInCenter)(l);!c||0!==c.code&&200!==c.code||(this.$message.success("密码修改成功"),this.changePasswordDialogVisible=!1,this.handleChangePasswordDialogClose())}catch(t){console.error("修改密码失败",t)}finally{this.changingPassword=!1}},handleChangePasswordDialogClose(){this.changePasswordForm={emailCode:"",password:"",confirmPassword:"",googleCode:""},this.$refs.changePasswordForm&&this.$refs.changePasswordForm.clearValidate()},loadUserEmail(){try{const t=t=>{const e=localStorage.getItem(t);if(null==e)return null;try{return JSON.parse(e)}catch(i){return e}},e=t("leasEmail")||"",i="string"===typeof e?e:String(e);this.userEmail=i.trim()}catch(t){console.error("读取用户邮箱失败",t),this.userEmail=""}},async handleDeleteAccount(){if(!this.userEmail)return void this.$message.warning("无法获取用户邮箱,请重新登录");const t=await this.ensureGoogleStatusEnabledForSensitiveOp("注销账号");t&&(this.deleteAccountDialogVisible=!0)},async handleSendDeleteAccountCode(){if(!(this.deleteAccountCountdown>0))if(this.userEmail){this.sendingDeleteAccountCode=!0;try{const t=await(0,o.sendCloseAccount)({email:this.userEmail});!t||0!==t.code&&200!==t.code?this.$message.error(t?.message||t?.msg||"发送验证码失败"):(this.$message.success("验证码已发送到您的邮箱"),this.startDeleteAccountCountdown())}catch(t){console.error("发送验证码失败",t),this.$message.error("发送验证码失败,请稍后重试")}finally{this.sendingDeleteAccountCode=!1}}else this.$message.warning("无法获取用户邮箱,请重新登录")},startDeleteAccountCountdown(){this.deleteAccountCountdown=60,this.deleteAccountCountdownTimer=setInterval(()=>{this.deleteAccountCountdown--,this.deleteAccountCountdown<=0&&(clearInterval(this.deleteAccountCountdownTimer),this.deleteAccountCountdownTimer=null)},1e3)},handleDeleteAccountGoogleCodeInput(t){this.deleteAccountForm.googleCode=t.replace(/\D/g,"").slice(0,6)},async handleConfirmDeleteAccount(){try{const t=await this.$refs.deleteAccountForm.validate();if(!t)return;this.$confirm("注销账号将永久删除您的账户和所有相关数据,包括订单、余额、店铺等所有信息,此操作不可恢复。确定要继续吗?","警告",{confirmButtonText:"确定注销",cancelButtonText:"取消",type:"warning",dangerouslyUseHTMLString:!1}).then(async()=>{this.deletingAccount=!0;try{const t={eCode:this.deleteAccountForm.emailCode,gCode:this.deleteAccountForm.googleCode},e=await(0,o.closeAccount)(t);!e||0!==e.code&&200!==e.code||(this.$message.success("账号已成功注销"),this.deleteAccountDialogVisible=!1,this.handleDeleteAccountDialogClose(),localStorage.removeItem("leasToken"),localStorage.removeItem("leasEmail"),localStorage.removeItem("userInfo"),window.dispatchEvent(new CustomEvent("login-status-changed")),this.$router.push("/login"))}catch(t){console.error("注销账号失败",t),this.$message.error("注销失败,请稍后重试")}finally{this.deletingAccount=!1}}).catch(()=>{})}catch(t){console.error("表单验证失败",t)}},handleDeleteAccountDialogClose(){this.deleteAccountForm={emailCode:"",googleCode:""},this.$refs.deleteAccountForm&&this.$refs.deleteAccountForm.clearValidate()}}}},5508:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"content-container"},[e("router-view")],1)},e.Yp=[]},5638:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(9628),s=i(7370),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"c3bf12ce",null),l=n.exports},5705:function(t,e,i){var a=i(3999)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e.addShopConfig=h,e.closeShop=d,e.deleteShop=l,e.deleteShopConfig=m,e.getAddShop=o,e.getChainAndCoin=g,e.getMyShop=r,e.getShopConfig=u,e.queryShop=c,e.updateShop=n,e.updateShopConfig=p;var s=a(i(5720));function o(t){return(0,s.default)({url:"/lease/shop/addShop",method:"post",data:t})}function r(t){return(0,s.default)({url:"/lease/shop/getShopByUserEmail",method:"get",params:t})}function n(t){return(0,s.default)({url:"/lease/shop/updateShop",method:"post",data:t})}function l(t,e){if(t&&"object"===typeof t){const e=t;return(0,s.default)({url:"/lease/shop/deleteShop",method:"post",data:e})}return(0,s.default)({url:"/lease/shop/deleteShop",method:"post",data:null!=e?{id:t,gCode:e}:{id:t}})}function c(t){return(0,s.default)({url:"/lease/shop/getShopById",method:"post",data:t})}function d(t){return(0,s.default)({url:"/lease/shop/closeShop",method:"post",data:{id:t}})}function u(t){return(0,s.default)({url:"/lease/shop/getShopConfig",method:"post",data:{id:t}})}function h(t){return(0,s.default)({url:"/lease/shop/addShopConfig",method:"post",data:t})}function p(t){return(0,s.default)({url:"/lease/shop/updateShopConfig",method:"post",data:t})}function m(t){return(0,s.default)({url:"/lease/shop/deleteShopConfig",method:"post",data:t})}function g(t){return(0,s.default)({url:"/lease/shop/getChainAndCoin",method:"post",data:t})}},5720:function(t,e,i){var a=i(3999)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e.cleanupRequestListeners=k,e.clearToken=m,e["default"]=void 0,e.getToken=g,e.updateToken=p,i(4114),i(8111),i(7588);var s=a(i(6425)),o=a(i(9526)),r=i(1052),n=a(i(4994)),l=a(i(7465)),c=a(i(4551));let d=null,u=null;async function h(){try{const t=await c.default.getItem("leasToken");if(t)return void(d=JSON.parse(t))}catch(t){0}try{const t=localStorage.getItem("leasToken");if(t)try{if(d=JSON.parse(t),d&&"string"===typeof d){0;try{await c.default.setItem("leasToken",JSON.stringify(d));0}catch(e){0}return}}catch(i){0,localStorage.removeItem("leasToken"),d=null}}catch(a){0}}async function p(t){try{if(t){try{const e=await c.default.setItem("leasToken",JSON.stringify(t));if(e)return void(d=t)}catch(e){0}try{localStorage.setItem("leasToken",JSON.stringify(t)),d=t}catch(i){console.error("[Token缓存] ❌ 明文存储也失败,可能 localStorage 不可用:",i),d=t}}else await m()}catch(a){console.error("[Token缓存] ❌ 更新失败:",a)}}async function m(){try{c.default.removeItem("leasToken"),localStorage.removeItem("leasToken"),d=null}catch(t){console.error("[Token缓存] ❌ 清除失败:",t)}}function g(t=!1){if(t&&u)return u.then(()=>d);if(null!==d)return d;try{const t=localStorage.getItem("leasToken");if(t)try{const e=JSON.parse(t);if(e&&"string"===typeof e)return e}catch(e){}}catch(e){0}return null}u=h().finally(()=>{u=null});const f=new Map;function y(t){const{url:e,method:i,params:a,data:s}=t;return[e,i,JSON.stringify(a),JSON.stringify(s)].join("&")}const w=s.default.create({baseURL:"https://test.m2pool.com/api/",timeout:1e4}),v=6e4,C=3;let b=new Map,S=0,_={online:0,offline:0},A=!1;async function x(t){while(S>=C)await new Promise(t=>setTimeout(t,100));S++;try{const e=await w(t.config);return e}finally{S--}}const D=async()=>{const t=Date.now();if(A)return void 0;if(A=!0,t-_.online>3e4){_.online=t;try{window.vm&&window.vm.$message&&window.vm.$message({message:window.vm.$i18n.t("home.networkReconnected")||"网络已重新连接,正在恢复数据...",type:"success",duration:5e3,showClose:!0})}catch(i){0}}else 0;const e=[];b.forEach(async(i,a)=>{if(t-i.timestamp<=v)try{const t=x(i);e.push(t),t.then(t=>{i.callback&&"function"===typeof i.callback&&i.callback(t),window.vm&&(i.config.url.includes("getPoolPower")&&t&&t.data?window.dispatchEvent(new CustomEvent("chart-data-updated",{detail:{type:"poolPower",data:t.data}})):i.config.url.includes("getNetPower")&&t&&t.data?window.dispatchEvent(new CustomEvent("chart-data-updated",{detail:{type:"netPower",data:t.data}})):i.config.url.includes("getBlockInfo")&&t&&t.rows&&window.dispatchEvent(new CustomEvent("chart-data-updated",{detail:{type:"blockInfo",data:t.rows}}))),b.delete(a)}).catch(t=>{b.delete(a)})}catch(s){0,b.delete(a)}else b.delete(a)}),Promise.allSettled(e).then(()=>{if(n.default&&n.default.resetAllLoadingStates(),window.vm){const t=["minerChartLoading","reportBlockLoading","apiPageLoading","MiningLoading","miniLoading","bthLoading","editLoading"];t.forEach(t=>{"undefined"!==typeof window.vm[t]&&(window.vm[t]=!1)}),Object.keys(window.vm).forEach(t=>{t.endsWith("Loading")&&(window.vm[t]=!1)})}window.dispatchEvent(new CustomEvent("network-retry-complete")),setTimeout(()=>{A=!1},5e3)})},$=()=>{window.vm&&window.vm.$message&&l.default.canShowError("networkOffline")&&window.vm.$message({message:window.vm.$i18n.t("home.networkOffline")||"网络连接已断开,系统将在恢复连接后自动重试",type:"error",duration:5e3,showClose:!0})};function k(){window.removeEventListener("online",D),window.removeEventListener("offline",$)}window.addEventListener("online",D),window.addEventListener("offline",$),w.defaults.retry=2,w.defaults.retryDelay=2e3,w.defaults.shouldRetry=t=>"Network Error"===t.message||t.message.includes("timeout"),localStorage.setItem("superReportError","");let P=localStorage.getItem("superReportError");window.addEventListener("setItem",()=>{P=localStorage.getItem("superReportError")}),w.interceptors.request.use(async t=>{P="",localStorage.setItem("superReportError",""),u&&await u;const e=g();if(e&&(t.headers["Authorization"]=e),"get"==t.method&&t.data&&(t.params=t.data),"get"===t.method&&t.params){let e=t.url+"?";for(const a of Object.keys(t.params)){const s=t.params[a];var i=encodeURIComponent(a)+"=";if(null!==s&&"undefined"!==typeof s)if("object"===typeof s){for(const t of Object.keys(s))if(null!==s[t]&&"undefined"!==typeof s[t]){let i=a+"["+t+"]",o=encodeURIComponent(i)+"=";e+=o+encodeURIComponent(s[t])+"&"}}else e+=i+encodeURIComponent(s)+"&"}e=e.slice(0,-1),t.params={},t.url=e}const a=y(t);if(f.has(a)){const t=f.get(a);t(),f.delete(a)}return t.cancelToken=new s.default.CancelToken(t=>{f.set(a,t)}),t},t=>{Promise.reject(t)}),w.interceptors.response.use(t=>{const e=y(t.config);if(f.delete(e),"blob"===t.config.responseType||t.data instanceof Blob)return t.status>=200&&t.status<300?t:Promise.reject(new Error(`下载失败,状态码: ${t.status}`));const i=t.data.code||200,a=o.default[i]||t.data.msg||o.default["default"];if(421===i){if(localStorage.setItem("cs_disconnect_all",Date.now().toString()),m(),window.dispatchEvent(new CustomEvent("login-status-changed")),P=localStorage.getItem("superReportError"),!P){P=421,localStorage.setItem("superReportError",P);const t=(t,e)=>window.vm&&window.vm.$i18n&&window.vm.$i18n.t(t)||e,e=()=>window.vm&&window.vm.$i18n&&window.vm.$i18n.locale?`/${window.vm.$i18n.locale}/login`:"/login",i=()=>window.vm&&window.vm.$i18n&&window.vm.$i18n.locale?`/${window.vm.$i18n.locale}/`:"/";r.MessageBox.confirm(t("user.loginExpired","登录状态已过期"),t("user.overduePrompt","您的登录状态已过期,请重新登录"),{distinguishCancelAndClose:!0,confirmButtonText:t("user.login","登录"),cancelButtonText:t("user.Home","返回首页"),closeOnClickModal:!1,showClose:!1,type:"warning"}).then(()=>{window.vm&&window.vm.$router?window.vm.$router.push(e()):window.location.href=e(),localStorage.removeItem("token"),localStorage.removeItem("superReportError")}).catch(()=>{window.vm&&window.vm.$router?window.vm.$router.push(i()):window.location.href=i(),m(),localStorage.removeItem("superReportError")})}return Promise.reject("登录状态已过期")}if(!(i>=500)||P)return 200!==i?(r.Notification.error({title:a}),Promise.reject("error")):t.data;P=500,localStorage.setItem("superReportError",P),(0,r.Message)({dangerouslyUseHTMLString:!0,message:a,type:"error",showClose:!0})},t=>{if("ERR_CANCELED"===t.code||t.message&&t.message.includes("canceled")||t.message?.includes("Request aborted"))return new Promise(()=>{});if(t.config){const e=y(t.config);f.delete(e)}let{message:e}=t;if("Network Error"==e||e.includes("timeout"))if(navigator.onLine){if(t.config.__retryCount=t.config.__retryCount||0,t.config.__retryCount{setTimeout(()=>{e(w(t.config))},w.defaults.retryDelay)});console.log(`[请求失败] ${t.config.url} - 已达到最大重试次数`)}else{const e=JSON.stringify({url:t.config.url,method:t.config.method,params:t.config.params,data:t.config.data});let i=null;t.config.url.includes("getPoolPower")?i=t=>{window.vm&&(window.vm.minerChartLoading=!1)}:t.config.url.includes("getBlockInfo")&&(i=t=>{window.vm&&(window.vm.reportBlockLoading=!1)}),b.has(e)||(b.set(e,{config:t.config,timestamp:Date.now(),retryCount:0,callback:i}),console.log("请求已加入断网重连队列:",t.config.url))}return P||(P="error",localStorage.setItem("superReportError",P),l.default.canShowError(e)?"Network Error"==e?(0,r.Message)({message:window.vm.$i18n.t("home.NetworkError"),type:"error",duration:4e3,showClose:!0}):e.includes("timeout")?(0,r.Message)({message:window.vm.$i18n.t("home.requestTimeout"),type:"error",duration:5e3,showClose:!0}):e.includes("Request failed with status code")?(0,r.Message)({message:"系统接口"+e.substr(e.length-3)+"异常",type:"error",duration:5e3,showClose:!0}):(0,r.Message)({message:e,type:"error",duration:5e3,showClose:!0}):console.log("[错误提示] 已抑制重复错误:",e)),Promise.reject(t)});e["default"]=w},5787:function(t,e,i){Object.defineProperty(e,"B",{value:!0}),e.A=void 0,i(8111),i(2489);var a=i(6299);e.A={name:"RechargeRecord",data(){return{activeTab:"pending",detailDialogVisible:!1,selectedItem:null,rechargeRecords:[],pagination:{pageNum:1,pageSize:1,total:0,totalPage:0},loading:!1,statusFilter:"",total:0,pageSizes:[10,20,50],currentPage:1}},computed:{pendingRecharges(){return this.rechargeRecords.filter(t=>2===t.status)},successRecharges(){return this.rechargeRecords.filter(t=>1===t.status)},failedRecharges(){return this.rechargeRecords.filter(t=>0===t.status)}},mounted(){this.activeTab="pending",this.statusFilter=2},methods:{async loadRechargeRecords(){this.loading=!0;try{const t={pageNum:this.pagination.pageNum,pageSize:this.pagination.pageSize};""!==this.statusFilter&&(t.status=this.statusFilter);const e=await(0,a.balanceRechargeList)(t);!e||0!==e.code&&200!==e.code||(this.rechargeRecords=e.rows||[],this.pagination.total=e.total||0,this.pagination.totalPage=e.totalPage||0,this.total=e.total||0,console.log("充值记录加载成功:",{records:this.rechargeRecords,pagination:this.pagination}))}catch(t){console.error("加载充值记录失败:",t)}finally{this.loading=!1}},handleTabClick(t){this.activeTab=t.name,"pending"===t.name?this.statusFilter=2:"success"===t.name?this.statusFilter=1:"failed"===t.name&&(this.statusFilter=0),this.pagination.pageNum=1,this.currentPage=1,this.pagination.pageSize=10,this.loadRechargeRecords()},showDetail(t){this.selectedItem=t,this.detailDialogVisible=!0},closeDetail(){this.detailDialogVisible=!1,this.selectedItem=null},getChainName(t){const e={tron:"Tron (TRC20)",ethereum:"Ethereum (ERC20)",bsc:"BSC (BEP20)",polygon:"Polygon (MATIC)"};return e[t]||t},getStatusType(t){const e={0:"danger",1:"success",2:"warning"};return e[t]||"info"},formatAddress(t){return t?t.length>20?`${t.slice(0,10)}...${t.slice(-10)}`:t:""},formatTime(t){if(!t)return"";const e=new Date(t),i=new Date,a=i-e;return a<6e4?"刚刚":a<36e5?`${Math.floor(a/6e4)}分钟前`:a<864e5?`${Math.floor(a/36e5)}小时前`:e.toLocaleDateString()},formatFullTime(t){return t?new Date(t).toLocaleString("zh-CN"):""},copyAddress(t){navigator.clipboard?navigator.clipboard.writeText(t).then(()=>{this.$message({message:"地址已复制到剪贴板",type:"success",showClose:!0})}).catch(()=>{this.fallbackCopyAddress(t)}):this.fallbackCopyAddress(t)},fallbackCopyAddress(t){const e=document.createElement("textarea");e.value=t,document.body.appendChild(e),e.select();try{document.execCommand("copy"),this.$message({message:"地址已复制到剪贴板",type:"success",showClose:!0})}catch(i){console.log("复制失败,请手动复制")}document.body.removeChild(e)},refreshData(){this.loadRechargeRecords()},viewOnExplorer(t,e){const i={tron:`https://tronscan.org/#/transaction/${t}`,ethereum:`https://etherscan.io/tx/${t}`,bsc:`https://bscscan.com/tx/${t}`,polygon:`https://polygonscan.com/tx/${t}`},a=i[e];a?window.open(a,"_blank"):this.$message.error("不支持的区块链网络")},getStatusText(t){const e={0:"充值失败",1:"充值成功",2:"充值中"};return e[t]||"未知状态"},handleSizeChange(t){console.log(`每页 ${t} 条`),this.pagination.pageSize=t,this.pagination.pageNum=1,this.currentPage=1,this.loadRechargeRecords()},handleCurrentChange(t){console.log(`当前页: ${t}`),this.pagination.pageNum=t,this.loadRechargeRecords()}}}},5844:function(t,e,i){var a=i(3999)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e.addCart=o,e.deleteBatchGoods=n,e.deleteBatchGoodsForIsDelete=l,e.deleteBatchGoodsForIsDeleteV2=d,e.deleteBatchGoodsV2=u,e.getGoodsList=r,e.getGoodsListV2=c;var s=a(i(5720));function o(t){return(0,s.default)({url:"/lease/shopping/cart/addGoods",method:"post",data:t})}function r(t){return(0,s.default)({url:"/lease/shopping/cart/getGoodsList",method:"post",data:t})}function n(t){return(0,s.default)({url:"/lease/shopping/cart/deleteBatchGoods",method:"post",data:t})}function l(t){return(0,s.default)({url:"/lease/shopping/cart/deleteBatchGoodsForIsDelete",method:"post",data:t})}function c(t){return(0,s.default)({url:"/lease/v2/shopping/cart/getGoodsListV2",method:"post",data:t})}function d(t){return(0,s.default)({url:"/lease/v2/shopping/cart/deleteBatchGoodsForIsDeleteV2",method:"post",data:t})}function u(t){return(0,s.default)({url:"/lease/v2/shopping/cart/deleteBatchGoodsV2",method:"post",data:t})}},5868:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"panel"},[e("h2",{staticClass:"panel-title"},[t._v("我的店铺")]),e("div",{staticClass:"panel-body"},[e("el-card",{staticClass:"guide-card",staticStyle:{"margin-bottom":"16px"},attrs:{shadow:"never"}},[e("div",{staticClass:"guide-header",attrs:{slot:"header"},slot:"header"},[t._v("店铺层级说明")]),e("div",{staticClass:"guide-content"},[e("p",{staticClass:"hierarchy"},[t._v("层级结构:店铺 → 商品 → 出售机器")]),e("ol",{staticClass:"guide-steps"},[e("li",[e("b",[t._v("店铺(唯一)")]),t._v(":每个用户在平台"),e("strong",[t._v("仅能创建一个店铺")]),t._v("。创建成功后, 请在本页点击 "),e("b",[t._v("钱包绑定")]),t._v(",配置自己的收款地址(支持不同链与币种)。 ")]),e("li",[e("b",[t._v("创建商品")]),t._v(":完成钱包绑定后,即可在“我的店铺”页面 点击"),e("b",[t._v("新增商品")]),t._v("按钮。 "),e("ul",{staticClass:"guide-substeps"},[e("li",[e("b",[t._v("ASIC 商品创建")]),t._v(":选择矿机种类为 ASIC,填写页面商品信息后创建,商品可按 "),e("b",[t._v("币种")]),t._v(" 进行分类管理,创建的商品会在商城对买家展示; 商品可理解为“不同算法、币种的机器集合分类”。 ")]),e("li",[e("b",[t._v("GPU 商品创建")]),t._v(":选择矿机种类为 GPU,查看页面注意事项并下载对应客户端,启动后读取自动创建。创建完成请进入 "),e("b",[t._v("商品列表")]),t._v(" 为该商品手动配置售价等相关信息并上架。 ")])])])]),e("div",{staticClass:"guide-note"},[t._v("提示:建议先创建店铺 → 完成钱包绑定 → 创建商品的顺序,避免漏配导致无法收款或无法下单。")])])]),t.loaded&&t.hasShop?e("el-card",{staticClass:"shop-card",attrs:{shadow:"hover"}},[e("div",{staticClass:"shop-row"},[e("div",{staticClass:"shop-cover"},[e("img",{attrs:{src:t.shop.image||t.defaultCover,alt:"店铺封面"}})]),e("div",{staticClass:"shop-info"},[e("div",{staticClass:"shop-title"},[e("span",{staticClass:"name"},[t._v(t._s(t.shop.name||"未命名店铺"))]),e("el-tag",{attrs:{size:"small",type:t.shopStateTagType}},[t._v(" "+t._s(t.shopStateText)+" ")])],1),e("div",{staticClass:"desc"},[t._v(t._s(t.shop.description||"这家店还没有描述~"))]),e("div",{staticClass:"meta"},[e("span",[t._v("手续费率:"+t._s(t.formatFeeRate(t.shop.feeRate)))]),e("span",[t._v("网络手续费:"+t._s(t.shopNetworkFeeText))])]),e("div",{staticClass:"actions"},[e("el-button",{attrs:{size:"small",type:"primary"},on:{click:t.handleOpenEdit}},[t._v("修改店铺")]),e("el-button",{attrs:{size:"small",type:"warning"},on:{click:t.handleToggleShop}},[t._v(" "+t._s(2===t.shop.state?"开启店铺":"关闭店铺")+" ")]),e("el-button",{attrs:{size:"small",type:"danger"},on:{click:t.handleDelete}},[t._v("删除店铺")]),e("el-button",{attrs:{size:"small",type:"success"},on:{click:t.handleAddProduct}},[t._v("新增商品")]),e("el-button",{attrs:{size:"small",type:"success"},on:{click:t.handleWalletBind}},[t._v("钱包绑定")])],1)])])]):t._e(),t.loaded&&t.hasShop?e("el-card",{staticClass:"shop-config-card",staticStyle:{"margin-top":"16px"},attrs:{shadow:"never"}},[e("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[e("span",[t._v("已绑定钱包")])]),e("el-table",{staticStyle:{width:"100%"},attrs:{data:t.shopConfigs,border:""}},[e("el-table-column",{attrs:{prop:"chain",label:"链",width:"120"}}),e("el-table-column",{attrs:{label:"支付币种",width:"120"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("div",{staticClass:"coin-list"},[Array.isArray(i.row.children)&&i.row.children.length?t._l(i.row.children,function(i,a){return e("el-tooltip",{key:a,attrs:{content:String(i&&i.payCoin?i.payCoin:"").toUpperCase(),placement:"top"}},[i&&i.image?e("img",{staticClass:"coin-img",attrs:{src:i.image,alt:(i.payCoin||"").toUpperCase()}}):t._e()])}):[t._v(" "+t._s(String(i.row.payCoin||"").toUpperCase())+" ")]],2)]}}],null,!1,569036476)}),e("el-table-column",{attrs:{prop:"payAddress",label:"收款钱包地址","show-overflow-tooltip":""}}),e("el-table-column",{attrs:{label:"余额"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",{staticClass:"balance-num"},[t._v(t._s(t.formatAmount(i.row)))]),e("span",{staticClass:"balance-unit"},[t._v(" "+t._s(t.formatCoin(i.row)))])]}}],null,!1,59971880)}),e("el-table-column",{attrs:{label:"操作",width:"240",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-button",{staticStyle:{color:"#409EFF"},attrs:{type:"text"},on:{click:function(e){return t.handleWithdraw(i.row)}}},[t._v("提现")]),e("el-divider",{attrs:{direction:"vertical"}}),e("el-button",{attrs:{type:"text"},on:{click:function(e){return t.handleEditConfig(i.row)}}},[t._v("修改")]),e("el-divider",{attrs:{direction:"vertical"}}),e("el-button",{staticStyle:{color:"#e74c3c"},attrs:{type:"text"},on:{click:function(e){return t.handleDeleteConfig(i.row)}}},[t._v("删除")])]}}],null,!1,1325460802)})],1)],1):t.loaded&&!t.hasShop?e("div",{staticClass:"no-shop"},[e("el-empty",{attrs:{description:"暂无店铺"}},[e("el-button",{attrs:{type:"primary"},on:{click:t.handleGoNew}},[t._v("新建店铺")])],1)],1):e("el-empty",{attrs:{description:"正在加载店铺信息..."}}),e("el-dialog",{attrs:{title:t.withdrawDialogTitle,visible:t.withdrawDialogVisible,width:"720px","close-on-click-modal":!1,"close-on-press-escape":!1},on:{"update:visible":function(e){t.withdrawDialogVisible=e}}},[e("el-form",{ref:"withdrawForm",attrs:{model:t.withdrawForm,rules:t.withdrawRules,"label-width":"120px"}},[e("el-form-item",{attrs:{label:"提现链"}},[e("el-input",{attrs:{value:String(t.currentWithdrawRow.chain||"").toUpperCase(),disabled:!0}})],1),e("el-form-item",{attrs:{label:"提现币种"}},[e("el-input",{attrs:{value:t.displayWithdrawSymbol,disabled:!0}})],1),e("el-form-item",{attrs:{label:"提现金额",prop:"amount"}},[e("el-input",{attrs:{placeholder:"请输入提现金额",inputmode:"decimal"},on:{input:t.handleAmountInput},model:{value:t.withdrawForm.amount,callback:function(e){t.$set(t.withdrawForm,"amount",e)},expression:"withdrawForm.amount"}},[e("template",{slot:"append"},[t._v(t._s(t.displayWithdrawSymbol))])],2),e("div",{staticClass:"balance-info"},[t._v(" 可用余额: "+t._s(t.availableWithdrawBalance)+" "+t._s(t.displayWithdrawSymbol)+" ")])],1),e("el-form-item",{attrs:{label:"手续费"}},[e("el-input",{attrs:{disabled:!0},model:{value:t.withdrawForm.fee,callback:function(e){t.$set(t.withdrawForm,"fee",e)},expression:"withdrawForm.fee"}},[e("template",{slot:"append"},[t._v(t._s(t.displayWithdrawSymbol))])],2),e("div",{staticClass:"fee-info"},[t._v("网络手续费: "+t._s(t.withdrawForm.fee||"0")+" "+t._s(t.displayWithdrawSymbol))])],1),e("el-form-item",{attrs:{label:"实际到账"}},[e("el-input",{attrs:{value:t.actualAmount,disabled:!0}},[e("template",{slot:"append"},[t._v(t._s(t.displayWithdrawSymbol))])],2),e("div",{staticClass:"actual-amount-info"},[t._v("实际到账: "+t._s(t.actualAmount)+" "+t._s(t.displayWithdrawSymbol))])],1),e("el-form-item",{attrs:{label:"收款地址",prop:"toAddress"}},[e("el-input",{ref:"withdrawToAddressInput",attrs:{placeholder:"请输入收款钱包地址",disabled:!t.withdrawAddressEditable},model:{value:t.withdrawForm.toAddress,callback:function(e){t.$set(t.withdrawForm,"toAddress",e)},expression:"withdrawForm.toAddress"}},[e("template",{slot:"append"},[e("el-button",{attrs:{type:"text"},on:{click:t.handleEditAddressClick}},[t._v("修改")])],1)],2),e("div",{staticClass:"address-tip"},[t._v("请确认地址正确,错误地址将导致资产丢失")])],1),e("el-form-item",{attrs:{label:"谷歌验证码",prop:"googleCode"}},[e("el-input",{attrs:{placeholder:"请输入6位谷歌验证码",maxlength:"6"},on:{input:t.handleGoogleCodeInput},model:{value:t.withdrawForm.googleCode,callback:function(e){t.$set(t.withdrawForm,"googleCode",e)},expression:"withdrawForm.googleCode"}},[e("template",{slot:"prepend"},[e("i",{staticClass:"el-icon-key"})])],2)],1)],1),e("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.withdrawDialogVisible=!1}}},[t._v("取消")]),e("el-button",{attrs:{type:"primary",loading:t.withdrawLoading},on:{click:t.confirmWithdraw}},[t._v("确认提现")])],1)],1),e("el-dialog",{attrs:{title:"修改店铺",visible:t.visibleEdit,width:"520px"},on:{"update:visible":function(e){t.visibleEdit=e}}},[e("div",{staticClass:"row"},[e("label",{staticClass:"label"},[t._v("店铺名称")]),e("el-input",{attrs:{placeholder:"请输入店铺名称",maxlength:30,"show-word-limit":""},model:{value:t.editForm.name,callback:function(e){t.$set(t.editForm,"name",e)},expression:"editForm.name"}})],1),e("div",{staticClass:"row"},[e("label",{staticClass:"label"},[t._v("店铺描述")]),e("el-input",{attrs:{type:"textarea",rows:3,placeholder:"请输入描述",maxlength:300,"show-word-limit":""},model:{value:t.editForm.description,callback:function(e){t.$set(t.editForm,"description",e)},expression:"editForm.description"}})],1),e("div",{staticClass:"row"},[e("label",{staticClass:"label"},[t._v("手续费比例")]),e("el-input",{staticClass:"fee-rate-input",attrs:{placeholder:"1 - 10"},on:{input:t.handleEditFeeRateInput},model:{value:t.editForm.feeRate,callback:function(e){t.$set(t.editForm,"feeRate",e)},expression:"editForm.feeRate"}},[e("template",{slot:"append"},[t._v("%")])],2)],1),e("div",{staticClass:"row"},[e("label",{staticClass:"label"},[t._v("专用网络")]),e("div",{staticClass:"edit-network"},[e("div",{staticClass:"edit-network-line"},[e("span",{staticClass:"edit-network-label"},[t._v("是否开启")]),e("el-switch",{model:{value:t.editForm.isOpen,callback:function(e){t.$set(t.editForm,"isOpen",e)},expression:"editForm.isOpen"}}),e("span",{staticClass:"edit-network-fee"},[t._v(" 网络手续费 "),e("span",{staticClass:"edit-fee-value",class:{on:t.editForm.isOpen}},[t._v(t._s(t.editNetworkFeeText))])])],1),e("div",{staticClass:"edit-network-hint"},[t._v("专用网络会增加2%的手续费,建议无法直连矿池的用户开启")])])]),e("div",{staticClass:"row"},[e("label",{staticClass:"label"},[t._v("谷歌验证码")]),e("el-input",{attrs:{placeholder:"请输入6位谷歌验证码",maxlength:"6"},on:{input:t.handleEditShopGoogleCodeInput},model:{value:t.editForm.gCode,callback:function(e){t.$set(t.editForm,"gCode",e)},expression:"editForm.gCode"}})],1),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.visibleEdit=!1}}},[t._v("取消")]),e("el-button",{attrs:{type:"primary"},on:{click:t.submitEdit}},[t._v("保存")])],1)]),e("el-dialog",{attrs:{title:"修改配置",visible:t.visibleConfigEdit,width:"560px"},on:{"update:visible":function(e){t.visibleConfigEdit=e},close:t.handleConfigEditClose}},[e("div",{staticClass:"row"},[e("label",{staticClass:"label"},[t._v("钱包地址")]),e("el-input",{attrs:{placeholder:"请输入钱包地址"},model:{value:t.configForm.payAddress,callback:function(e){t.$set(t.configForm,"payAddress",e)},expression:"configForm.payAddress"}})],1),e("div",{staticClass:"row"},[e("label",{staticClass:"label"},[t._v("谷歌验证码")]),e("el-input",{attrs:{placeholder:"请输入6位谷歌验证码",maxlength:"6"},on:{input:t.handleConfigGoogleCodeInput},model:{value:t.configForm.googleCode,callback:function(e){t.$set(t.configForm,"googleCode",e)},expression:"configForm.googleCode"}},[e("template",{slot:"prepend"},[e("i",{staticClass:"el-icon-key"})])],2)],1),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.visibleConfigEdit=!1}}},[t._v("取消")]),e("el-button",{attrs:{type:"primary"},on:{click:t.submitConfigEdit}},[t._v("确认修改")])],1)])],1)])},e.Yp=[]},5952:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.updateQuantity=e.removeFromCart=e.readCart=e["default"]=e.computeSummary=e.clearCart=e.addToCart=void 0,i(8111),i(2489),i(1701),i(8237);const a="power_leasing_cart_v1",s=()=>{try{const t=window.localStorage.getItem(a);if(!t)return[];const e=JSON.parse(t);return Array.isArray(e)?e.filter(Boolean):[]}catch(t){return console.error("[cartManager] readCart error:",t),[]}};e.readCart=s;const o=t=>{try{window.localStorage.setItem(a,JSON.stringify(t));try{const e=t.reduce((t,e)=>t+Number(e.quantity||0),0);window.dispatchEvent(new CustomEvent("cart-updated",{detail:{count:e}}))}catch(e){}}catch(i){console.error("[cartManager] writeCart error:",i)}},r=t=>{if(!t||!t.id)return s();const e=s(),i=e.findIndex(e=>e.id===t.id);if(i>=0){const a=[...e];return a[i]={...a[i],quantity:Math.max(1,Number(a[i].quantity||0)+Number(t.quantity||1))},o(a),a}const a=[...e,{...t,quantity:Math.max(1,Number(t.quantity||1))}];return o(a),a};e.addToCart=r;const n=(t,e)=>{const i=s(),a=i.map(i=>i.id===t?{...i,quantity:Math.max(1,Number(e)||1)}:i);return o(a),a};e.updateQuantity=n;const l=t=>{const e=s(),i=e.filter(e=>e.id!==t);return o(i),i};e.removeFromCart=l;const c=()=>(o([]),[]);e.clearCart=c;const d=()=>{const t=s(),e=t.reduce((t,e)=>t+Number(e.quantity||0),0),i=t.reduce((t,e)=>t+Number(e.quantity||0)*Number(e.price||0),0);return{totalQuantity:e,totalPrice:i}};e.computeSummary=d;e["default"]={readCart:s,addToCart:r,updateQuantity:n,removeFromCart:l,clearCart:c,computeSummary:d}},6034:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(9099),s=i(4601),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"14de5279",null),l=n.exports},6067:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.mainNavigation=e.getPageTitle=e.getPageDescription=e.getBreadcrumb=e["default"]=e.checkRoutePermission=e.breadcrumbConfig=void 0,i(8111),i(3579);const a=e.mainNavigation=[{path:"/productList",name:"商城",icon:"🛍️",description:"浏览所有商品"},{path:"/cart",name:"购物车",icon:"🛒",description:"管理购物车商品"},{path:"/account",name:"个人中心",icon:"👤",description:"管理个人资料和店铺"}],s=e.breadcrumbConfig={"/productList":["首页","商品列表"],"/product":["首页","商品列表","商品详情"],"/cart":["首页","购物车"],"/checkout":["首页","购物车","订单结算"],"/account":["首页","个人中心"],"/account/wallet":["首页","个人中心","我的钱包"],"/account/shop-new":["首页","个人中心","新增店铺"],"/account/shop-config":["首页","个人中心","店铺配置"],"/account/shops":["首页","个人中心","我的店铺"],"/account/product-new":["首页","个人中心","新增商品"],"/account/products":["首页","个人中心","商品列表"]},o=t=>t.startsWith("/product/")?s["/product"]:s[t]||["首页"];e.getBreadcrumb=o;const r=(t,e=[])=>{if(!t.meta||!t.meta.allAuthority)return!0;const i=t.meta.allAuthority;return!!i.includes("all")||i.some(t=>e.includes(t))};e.checkRoutePermission=r;const n=t=>t.meta&&t.meta.title?`${t.meta.title} - Power Leasing`:"Power Leasing - 电商系统";e.getPageTitle=n;const l=t=>t.meta&&t.meta.description?t.meta.description:"Power Leasing 电商系统 - 专业的电力设备租赁平台";e.getPageDescription=l;e["default"]={mainNavigation:a,breadcrumbConfig:s,getBreadcrumb:o,checkRoutePermission:r,getPageTitle:n,getPageDescription:l}},6087:function(t,e,i){Object.defineProperty(e,"B",{value:!0}),e.A=void 0,i(4114);var a=i(4180);e.A={name:"AccountPurchasedMachineConfig",data(){return{loading:!1,tableData:[],pagination:{pageNum:1,pageSize:10},total:0,totalPage:0}},created(){this.fetchTableData()},methods:{async fetchTableData(){this.loading=!0;try{const t={pageNum:this.pagination.pageNum,pageSize:this.pagination.pageSize},e=await(0,a.getPurchasedItems)(t);!e||0!==e.code&&200!==e.code?(this.tableData=[],this.total=0,this.totalPage=0):(this.tableData=Array.isArray(e.rows)?e.rows:[],this.total=Number(e.total||0),this.totalPage=Number(e.totalPage||0))}catch(t){console.error("获取已购矿机配置失败",t),this.tableData=[],this.total=0,this.totalPage=0}finally{this.loading=!1}},handleSizeChange(t){this.pagination.pageSize=t,this.pagination.pageNum=1,this.fetchTableData()},handleCurrentChange(t){this.pagination.pageNum=t,this.fetchTableData()},formatDateTime(t){if(!t)return"—";try{const e=String(t);return e.includes("T")?e.replace("T"," "):e}catch(e){return String(t)}},async handleCopy(t,e="内容"){if(t)try{const a=String(t).trim();if(navigator&&navigator.clipboard&&navigator.clipboard.writeText)await navigator.clipboard.writeText(a),this.$message({message:`${e}已复制到剪贴板`,type:"success",showClose:!0});else{const t=document.createElement("textarea");t.value=a,t.style.position="fixed",t.style.left="-9999px",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy"),this.$message({message:`${e}已复制到剪贴板`,type:"success",showClose:!0})}catch(i){this.$message({message:"复制失败,请手动复制",type:"error",showClose:!0})}document.body.removeChild(t)}}catch(a){console.error("复制失败",a),this.$message({message:"复制失败,请手动复制",type:"error",showClose:!0})}else this.$message({message:`${e}为空,无法复制`,type:"warning",showClose:!0})},handleViewDetail(t){console.log("查看详情,行数据:",t);const e=t.id||t.productMachineId||t.machineId;if(console.log("提取的ID:",e),e)try{this.$router.push({name:"purchasedMachineDetail",params:{id:e}})}catch(i){console.error("路由跳转失败:",i),this.$message.error("跳转失败,请稍后重试")}else console.warn("行数据中缺少ID字段:",t),this.$message.warning("无法获取详情,缺少ID信息")},getStatusText(t){const e=Number(t);return 0===e?"租约已到期":1===e?"挖矿中":2===e?"卖家矿机启动中":!0===t?"挖矿中":"未知状态"},getStatusType(t){const e=Number(t);return 0===e?"info":1===e?"success":2===e?"warning":!0===t?"success":"info"}}}},6122:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"auth-container"},[t._m(0),e("div",{staticClass:"auth-card"},[e("div",{staticClass:"close-btn",attrs:{title:"返回商城"},on:{click:t.goToShop}},[e("i",{staticClass:"el-icon-close"})]),t._m(1),e("el-form",{ref:"registerForm",staticClass:"auth-form",attrs:{model:t.registerForm,rules:t.registerRules},nativeOn:{submit:function(e){return e.preventDefault(),t.handleRegister.apply(null,arguments)}}},[e("el-form-item",{attrs:{prop:"email"}},[e("el-input",{attrs:{placeholder:"请输入邮箱","prefix-icon":"el-icon-message",size:"large",clearable:""},on:{change:t.handleEmailChange},model:{value:t.registerForm.email,callback:function(e){t.$set(t.registerForm,"email",e)},expression:"registerForm.email"}})],1),e("el-form-item",{attrs:{prop:"code"}},[e("div",{staticClass:"code-input-wrapper"},[e("el-input",{attrs:{placeholder:"请输入邮箱验证码","prefix-icon":"el-icon-key",size:"large",maxlength:"10",clearable:""},model:{value:t.registerForm.code,callback:function(e){t.$set(t.registerForm,"code",e)},expression:"registerForm.code"}}),e("el-button",{staticClass:"send-code-btn",attrs:{type:"primary",size:"large",disabled:t.countdown>0,loading:t.sendingCode},on:{click:t.handleSendCode}},[t._v(" "+t._s(t.countdown>0?`${t.countdown}秒后重试`:"获取验证码")+" ")])],1)]),e("el-form-item",{attrs:{prop:"password"}},[e("el-input",{attrs:{type:"password",placeholder:"请输入密码(8-32位)","prefix-icon":"el-icon-lock",size:"large","show-password":"",clearable:""},model:{value:t.registerForm.password,callback:function(e){t.$set(t.registerForm,"password",e)},expression:"registerForm.password"}}),e("div",{staticClass:"password-tip"},[e("i",{staticClass:"el-icon-info"}),e("span",[t._v("密码需包含大小写字母、数字和特殊字符,长度8-32位")])]),t.registerForm.password?e("div",{staticClass:"password-strength"},[e("span",{staticClass:"strength-label"},[t._v("密码强度:")]),e("span",{class:["strength-bar",t.passwordStrengthClass]},[t._v(" "+t._s(t.passwordStrengthText)+" ")])]):t._e()],1),e("el-form-item",{attrs:{prop:"confirmPassword"}},[e("el-input",{attrs:{type:"password",placeholder:"请再次输入密码","prefix-icon":"el-icon-lock",size:"large","show-password":"",clearable:""},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleRegister.apply(null,arguments)}},model:{value:t.registerForm.confirmPassword,callback:function(e){t.$set(t.registerForm,"confirmPassword",e)},expression:"registerForm.confirmPassword"}})],1),e("el-form-item",{attrs:{prop:"agree"}},[e("el-checkbox",{model:{value:t.registerForm.agree,callback:function(e){t.$set(t.registerForm,"agree",e)},expression:"registerForm.agree"}},[t._v(" 我已阅读并同意 "),e("a",{staticClass:"link-text",attrs:{href:"#"},on:{click:function(t){t.preventDefault()}}},[t._v("《用户协议》")]),t._v(" 和 "),e("a",{staticClass:"link-text",attrs:{href:"#"},on:{click:function(t){t.preventDefault()}}},[t._v("《隐私政策》")])])],1),e("el-form-item",[e("el-button",{staticClass:"auth-submit-btn",attrs:{type:"primary",size:"large",loading:t.loading},on:{click:t.handleRegister}},[t._v(" "+t._s(t.loading?"注册中...":"立即注册")+" ")])],1),e("div",{staticClass:"auth-footer"},[e("span",{staticClass:"footer-text"},[t._v("已有账号?")]),e("router-link",{staticClass:"link-text link-primary",attrs:{to:"/login"}},[t._v(" 立即登录 ")])],1)],1)],1)])},e.Yp=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"auth-background"},[e("div",{staticClass:"bg-circle circle-1"}),e("div",{staticClass:"bg-circle circle-2"}),e("div",{staticClass:"bg-circle circle-3"})])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"auth-header"},[e("h1",{staticClass:"auth-title"},[t._v("欢迎注册")]),e("p",{staticClass:"auth-subtitle"},[t._v("创建您的 Power Leasing 账号")])])}]},6163:function(t,e,i){Object.defineProperty(e,"B",{value:!0}),e.A=void 0,i(4114),i(8111),i(2489),i(116),i(7588),i(1701),i(3579),i(7642),i(8004),i(3853),i(5876),i(2475),i(5024),i(1698);var a=i(9662),s=i(1193);const o="account_products_machine_type";e.A={name:"AccountProducts",data(){return{loading:!1,searchKeyword:"",tableData:[],payTypes:[],selectedPayKey:"",shopMachineList:[],pagination:{pageNum:1,pageSize:10,total:0},coinOptions:[],algoOptionsMap:{},loadingCoins:!1,loadingAlgos:{},editDialog:{visible:!1,saving:!1,form:null,priceList:[]},total:0,userEmail:"",listParams:{type:0,pageNum:1,pageSize:10},updateArr:[],updateMap:{},unitCoin:""}},created(){this.initOptions();try{const t=localStorage.getItem(o),e=null!=t?parseInt(t,10):null;0!==e&&1!==e||(this.listParams.type=e)}catch(t){}this.fetchTableData(),this.getPayTypesList().then(()=>{!this.selectedPayKey&&Array.isArray(this.payTypes)&&this.payTypes.length&&(this.selectedPayKey=this.buildPayKey(this.payTypes[0]))})},watch:{"listParams.type"(t){this.shopMachineList=[],this.updateMap={},this.updateArr=[],this.ensureGpuDraft()},payTypes:{handler(){this.ensureGpuDraft(),this.computeUnitFromFirstRow()},deep:!0},shopMachineList:{handler(){this.ensureGpuDraft(),this.computeUnitFromFirstRow()},deep:!0},selectedPayKey(){this.computeUnitFromFirstRow()}},computed:{searchPlaceholder(){return 1===this.listParams.type?"输入显卡型号搜索":"输入币种或算法关键字后回车/搜索"},headerCoinSymbol(){if(this.selectedPayKey){const t=String(this.selectedPayKey).split("|"),e=(t[1]||"").trim().toUpperCase();if(e)return e}if(Array.isArray(this.payTypes)&&this.payTypes.length){const t=this.payTypes[0]||{},e=(t.payCoin||t.coin||"").toString().trim().toUpperCase();if(e)return e}const t=Array.isArray(this.shopMachineList)?this.shopMachineList:[];if(t.length){const e=Array.isArray(t[0].priceList)?t[0].priceList:[];if(e.length){const t=e[0]||{},i=(t.coin||t.payCoin||"").toString().trim().toUpperCase();if(i)return i}}return""}},methods:{normalizePowerInput(t){if(null===t||void 0===t)return"";let e=String(t).replace(/[^\d.]/g,"");const i=e.indexOf(".");-1!==i&&(e=e.slice(0,i+1)+e.slice(i+1).replace(/\./g,""));const a=e.endsWith(".");let[s,o=""]=e.split(".");return s.length>1&&(s=s.replace(/^0+/,"")||"0"),o.length>8&&(o=o.slice(0,8)),o.length?`${s}.${o}`:a?`${s}.`:s},normalizeSaleNumbersInput(t){if(null===t||void 0===t)return"";let e=String(t).replace(/[^\d]/g,"");if(!e)return"";if(e=e.replace(/^0+/,""),!e)return"";const i=parseInt(e,10);return!Number.isFinite(i)||i<1?"":i>9999?"9999":String(i)},async loadSupportCoins(){this.loadingCoins=!0;try{const t=await(0,s.getSupportCoin)();if(t&&(0===t.code||200===t.code)){const e=t.data||[];Array.isArray(e)?this.coinOptions=e.map(t=>"string"===typeof t?t:t.coin||t.name||t).filter(Boolean):e&&"object"===typeof e&&(this.coinOptions=Object.keys(e).map(t=>{const i=e[t];return"string"===typeof i?i:i.coin||i.name||t}).filter(Boolean)),this.coinOptions=[...new Set(this.coinOptions)].sort()}}catch(t){console.error("加载币种列表失败",t)}finally{this.loadingCoins=!1}},async editHandleCoinChange(t,e){this.$set(this.editDialog.form.coinAndAlgoList[t],"algorithm",""),e&&await this.editLoadAlgorithmsForCoin(e,t)},async editLoadAlgorithmsForCoin(t,e){if(t&&!(this.algoOptionsMap[t]&&this.algoOptionsMap[t].length>0)){this.$set(this.loadingAlgos,e,!0);try{const e=await(0,s.getSupportAlgo)(t);if(e&&(0===e.code||200===e.code)){const i=e.data||[];let a=[];Array.isArray(i)?a=i.map(t=>"string"===typeof t?t:t.algorithm||t.algo||t.name||t).filter(Boolean):i&&"object"===typeof i&&(a=Object.keys(i).map(t=>{const e=i[t];return"string"===typeof e?e:e.algorithm||e.algo||e.name||t}).filter(Boolean)),this.$set(this.algoOptionsMap,t,[...new Set(a)].sort())}}catch(i){console.error(`加载币种 ${t} 的算法列表失败`,i),this.$set(this.algoOptionsMap,t,[])}finally{this.$set(this.loadingAlgos,e,!1)}}},editHandleRowTheoryInput(t){let e=String(this.editDialog.form.coinAndAlgoList[t].theoryPower??"");e=e.replace(/[^0-9.]/g,"");const i=e.indexOf(".");-1!==i&&(e=e.slice(0,i+1)+e.slice(i+1).replace(/\./g,""));const a=e.endsWith("."),s=e.split(".");let o=s[0]||"",r=s[1]||"";o.length>6&&(o=o.slice(0,6)),r&&(r=r.slice(0,4)),e=r.length?`${o}.${r}`:a?`${o}.`:o,this.$set(this.editDialog.form.coinAndAlgoList[t],"theoryPower",e)},editHandleRowUnitChange(t,e){this.$set(this.editDialog.form.coinAndAlgoList[t],"unit",e)},editHandleAddRow(){const t=this.editDialog.form.coinAndAlgoList||[];if(t.length>=10)return void this.$message.warning("最多添加 10 行");const e=t[t.length-1]||{unit:"TH/S"},i=t.length;t.push({coin:"",algorithm:"",theoryPower:"",unit:e.unit||"TH/S",coinAndPowerId:null}),this.$set(this.editDialog.form,"coinAndAlgoList",t),this.$set(this.loadingAlgos,i,!1)},editHandleRemoveRow(t){const e=this.editDialog.form.coinAndAlgoList||[];e.length<=1||(e.splice(t,1),this.$set(this.editDialog.form,"coinAndAlgoList",e))},getRowCoinText(t){try{const e=Array.isArray(t&&t.coinAndAlgoList)?t.coinAndAlgoList:[];if(e.length){const t=e.map(t=>String(t&&t.coin?t.coin:"").trim()).filter(Boolean),i=Array.from(new Set(t));if(i.length)return i.join(",")}const i=String(t&&t.coin?t.coin:"").trim();return i||"-"}catch(e){return String(t&&t.coin?t.coin:"").trim()||"-"}},getRowAlgorithmText(t){try{const e=Array.isArray(t&&t.coinAndAlgoList)?t.coinAndAlgoList:[];if(e.length){const t=e.map(t=>String(t&&t.slogithm?t.slogithm:t&&t.algorithm?t.algorithm:"").trim()).filter(Boolean),i=Array.from(new Set(t));if(i.length)return i.join(",")}const i=String(t&&t.algorithm?t.algorithm:"").trim();return i||"-"}catch(e){return String(t&&t.algorithm?t.algorithm:"").trim()||"-"}},computeUnitFromFirstRow(){try{const t=Array.isArray(this.shopMachineList)?this.shopMachineList:[];if(!t.length)return void(this.unitCoin="");const e=t[0]||{},i=Array.isArray(e.priceList)?e.priceList:[];if(!i.length)return void(this.unitCoin="");let a="",s="";if(this.selectedPayKey){const t=String(this.selectedPayKey).split("|");a=(t[0]||"").trim().toUpperCase(),s=(t[1]||"").trim().toUpperCase()}let o=null;(a||s)&&(o=i.find(t=>{const e=String(t.chain||t.payChain||"").trim().toUpperCase(),i=String(t.coin||t.payCoin||"").trim().toUpperCase();return(!a||e===a)&&(!s||i===s)})||null),o||(o=i[0]||null);const r=o&&(o.coin||o.payCoin)||"";this.unitCoin=String(r||"").trim().toUpperCase()}catch(t){this.unitCoin=""}},buildPayKey(t){const e=(t&&(t.payChain||t.chain)?String(t.payChain||t.chain):"").trim().toUpperCase(),i=(t&&(t.payCoin||t.coin)?String(t.payCoin||t.coin):"").trim().toUpperCase();return[e,i].filter(Boolean).join("|")},handlePayTypeChange(){},getPayTypeByKey(t){try{if(!t)return null;const e=String(t).split("|"),i=(e[0]||"").trim().toUpperCase(),a=(e[1]||"").trim().toUpperCase();return(this.payTypes||[]).find(t=>String(t.payChain||t.chain||"").trim().toUpperCase()===i&&String(t.payCoin||t.coin||"").trim().toUpperCase()===a)||null}catch(e){return null}},getSelectedPayImage(){const t=this.getPayTypeByKey(this.selectedPayKey);if(!t)return"";const e=t.payCoinImage||t.image||"";return String(e||"").trim()},getSelectedCoinSymbol(){try{const t=this.getPayTypeByKey(this.selectedPayKey);if(t){const e=t.payCoin||t.coin||"";return String(e||"").trim().toUpperCase()}if(this.selectedPayKey){const t=String(this.selectedPayKey).split("|"),e=(t[1]||"").trim().toUpperCase();if(e)return e}if(Array.isArray(this.payTypes)&&this.payTypes.length){const t=this.payTypes[0],e=t&&(t.payCoin||t.coin);return String(e||"").trim().toUpperCase()}return""}catch(t){return""}},getRowPriceBySelected(t){try{const e=Array.isArray(t&&t.priceList)?t.priceList:[];if(!e.length)return"-";let i="",a="";if(this.selectedPayKey){const t=String(this.selectedPayKey).split("|");i=(t[0]||"").toUpperCase(),a=(t[1]||"").toUpperCase()}if(!i&&!a){const t=e[0]||{},i=t&&null!=t.price?String(t.price):"";return i||"-"}const s=e.find(t=>{const e=String(t.chain||t.payChain||"").toUpperCase(),s=String(t.coin||t.payCoin||"").toUpperCase();return e===i&&s===a});return s&&null!=s.price?String(s.price):"-"}catch(e){return"-"}},getRowPriceText(t){try{const e=Array.isArray(t&&t.priceList)?t.priceList:[];if(!e.length)return"-";let i="",a="";if(this.selectedPayKey){const t=String(this.selectedPayKey).split("|");i=(t[0]||"").trim().toUpperCase(),a=(t[1]||"").trim().toUpperCase()}let s=null;if((i||a)&&(s=e.find(t=>{const e=String(t.chain||t.payChain||"").trim().toUpperCase(),s=String(t.coin||t.payCoin||"").trim().toUpperCase();return(!i||e===i)&&(!a||s===a)})||null),s||(s=e[0]||null),!s)return"-";const o=null!=s.price?String(s.price):"",r=(s.coin||s.payCoin||"").toString().trim().toUpperCase();return o?r?`${o} ${r}`:o:"-"}catch(e){return"-"}},getFirstPriceText(t){try{const e=Array.isArray(t&&t.priceList)?t.priceList:[];if(!e.length)return"-";const i=e[0]||{},a=null!=i.price?i.price:null!=i.amount?i.amount:"";return""===a||null==a?"-":String(a)}catch(e){return"-"}},getTheoryText(t){try{const e=Array.isArray(t&&t.coinAndAlgoList)?t.coinAndAlgoList:[];if(e.length){const t=e.map(t=>{const e=t&&null!=t.theoryPower?String(t.theoryPower):"",i=t&&(t.unit||t.Unit)?String(t.unit||t.Unit).trim().toUpperCase():"",a=e?i?`${e} ${i}`:e:"";return a}).filter(Boolean);if(t.length)return t.join(", ")}const i=t&&null!=t.theoryPower?String(t.theoryPower):"";if(!i)return"-";const a=(t&&t.unit?String(t.unit):"").trim().toUpperCase();return a?`${i} ${a}`:i}catch(e){const i=t&&null!=t.theoryPower?String(t.theoryPower):"";if(!i)return"-";const a=(t&&t.unit?String(t.unit):"").trim().toUpperCase();return a?`${i} ${a}`:i}},getPowerDissText(t){const e=t&&null!=t.powerDissipation?String(t.powerDissipation):"";return e||"-"},getRowId(t){if(t)return null!=t.id?t.id:null!=t.productMachineId?t.productMachineId:null!=t.produceMachineId?t.produceMachineId:null!=t.machineId?t.machineId:null!=t.__key?t.__key:void 0},async updateGpuMachineInfo(t){const e=await(0,a.updateGpuMachine)(t);!e||0!==e.code&&200!==e.code||(this.$message.success("更新成功"),await this.fetchTableData())},async getPayTypesList(){const t=await(0,a.getPayTypes)();if(t&&(0===t.code||200===t.code)){const e=Array.isArray(t.data)?t.data:[];this.payTypes=e,!this.selectedPayKey&&this.payTypes.length&&(this.selectedPayKey=this.buildPayKey(this.payTypes[0]))}},async fetchShopMachineListForSeller(t){const e=await(0,a.getShopMachineListForSeller)(t);console.log(e,"res"),!e||0!==e.code&&200!==e.code||(this.shopMachineList=Array.isArray(e.rows)?e.rows:[],this.total=Number(e.total||e.data&&e.data.total||e.data&&e.data.totalCount||0),this.ensureGpuDraft(),this.computeUnitFromFirstRow())},handleTypeChange(t){this.pagination.pageNum=1,this.listParams.type=t,this.listParams.pageNum=1,this.listParams.keyword=(this.searchKeyword||"").trim()||void 0;try{localStorage.setItem(o,String(t))}catch(e){}this.shopMachineList=[],this.updateMap={},this.updateArr=[],this.fetchTableData()},ensureGpuDraft(){if(1!==this.listParams.type)return;if(!Array.isArray(this.shopMachineList)||!this.shopMachineList.length)return;if(!Array.isArray(this.payTypes)||!this.payTypes.length)return;const t={},e=this.payTypes.map(t=>({chain:(t.payChain||t.chain||"").toString(),coin:(t.payCoin||t.coin||"").toString()})),i=(t=[],i=[])=>e.map(e=>{const a=(Array.isArray(t)?t:[]).find(t=>t.chain===e.chain&&t.coin===e.coin),s=(Array.isArray(i)?i:[]).find(t=>t.chain===e.chain&&t.coin===e.coin);return{chain:e.chain,coin:e.coin,price:a?a.price??"":s?s.price??"":"",payTypeId:a?a.payTypeId??"":s?s.payTypeId??"":""}});this.shopMachineList.forEach((e,a)=>{let s=this.getRowId(e);null==s&&(s=`k_${a}_${e&&(e.name||e.miner||"")}`,this.$set(e,"__key",s));const o=this.updateMap[s];if(o){const a={...o};e&&"undefined"!==typeof e.maxLeaseDays&&(a.maxLeaseDays=e.maxLeaseDays),!e||0!==e.state&&1!==e.state?a.state=1:a.state=e.state,!e||0!==e.effect&&1!==e.effect?void 0===a.effect&&(a.effect=1):a.effect=e.effect,a.priceList=i(e&&e.priceList,o.priceList),t[s]=a}else{const a=!e||0!==e.state&&1!==e.state?1:e.state;t[s]={id:s,maxLeaseDays:e&&"undefined"!==typeof e.maxLeaseDays?e.maxLeaseDays:"",priceList:i(e&&e.priceList,[]),state:a,effect:!e||0!==e.effect&&1!==e.effect?1:e.effect}}}),this.updateMap=t,this.updateArr=Object.values(this.updateMap)},getPriceValue(t,e){const i=this.updateMap[t];if(!i||!Array.isArray(i.priceList))return"";const a=(e.payChain||e.chain||"").toString(),s=(e.payCoin||e.coin||"").toString(),o=i.priceList.find(t=>t.chain===a&&t.coin===s);return o?o.price:""},ensurePriceObj(t,e,i){const a=this.updateMap[t];if(!a)return null;let s=a.priceList.find(t=>t.chain===e&&t.coin===i);return s||(s={chain:e,coin:i,price:"",payTypeId:""},a.priceList.push(s)),s},normalizeGpuPrice(t,e=!1){if(null==t)return"";let i=String(t).replace(/[^\d.]/g,"");const a=i.indexOf(".");-1!==a&&(i=i.slice(0,a+1)+i.slice(a+1).replace(/\./g,""));const s=-1!==a;s&&i.endsWith(".");let o,[r,n=""]=i.split(".");if(r.length>1&&(r=r.replace(/^0+/,"")),""===r&&(r="0"),r.length>10&&(r=r.slice(0,10)),n.length>6&&(n=n.slice(0,6)),o=s?n?`${r}.${n}`:e?r:`${r}.`:r,e){const t=Number(o);if(!(Number.isFinite(t)&&t>0))return"";if(!n&&String(r).length>1&&String(r).startsWith("0")){const t=String(r).replace(/^0+/,"")||"0";o=t}}return o},handlePriceInput(t,e,i){const a=this.getRowId(t)||t.__key,s=(e.payChain||e.chain||"").toString(),o=(e.payCoin||e.coin||"").toString(),r=this.normalizeGpuPrice(i,!1),n=this.ensurePriceObj(a,s,o);n&&(n.price=r),this.updateArr=Object.values(this.updateMap)},handlePriceBlur(t,e){const i=this.getRowId(t)||t.__key,a=(e.payChain||e.chain||"").toString(),s=(e.payCoin||e.coin||"").toString(),o=this.ensurePriceObj(i,a,s),r=o?o.price:"",n=this.normalizeGpuPrice(r,!0);o&&(o.price=n),""===n&&this.$message.warning("价格需为>0,整数最多10位,小数最多6位,且整数部分不可以0开头"),this.updateArr=Object.values(this.updateMap)},handleMaxLeaseDaysInput(t,e){const i=this.getRowId(t)||t.__key,a=String(e||"").replace(/[^\d]/g,"");let s=a?parseInt(a,10):"";"number"!==typeof s||Number.isNaN(s)||(s<1&&(s=1),s>365&&(s=365)),this.updateMap[i]&&(this.updateMap[i].maxLeaseDays=s),this.updateArr=Object.values(this.updateMap)},handleToggleState(t,e){const i=this.getRowId(t)||t.__key;if(0===e){let e=1;if(!t||0!==t.effect&&1!==t.effect?!this.updateMap[i]||0!==this.updateMap[i].effect&&1!==this.updateMap[i].effect||(e=this.updateMap[i].effect):e=t.effect,0===e)return this.$message.warning("本网站暂时不支持该矿机币种及算法,暂时不能上架!"),this.updateMap[i]&&(this.updateMap[i].state=1),void(this.updateArr=Object.values(this.updateMap))}this.updateMap[i]&&(this.updateMap[i].state=e,!t||0!==t.effect&&1!==t.effect||(this.updateMap[i].effect=t.effect)),this.updateArr=Object.values(this.updateMap)},handleUpdateGpu(){if(1!==this.listParams.type)return;const t=Object.values(this.updateMap).map(t=>({id:t.id,maxLeaseDays:t.maxLeaseDays,priceList:Array.isArray(t.priceList)?t.priceList.map(t=>({chain:t.chain,coin:t.coin,price:t.price,payTypeId:t.payTypeId||""})):[],state:t.state})),e=Array.isArray(this.payTypes)?this.payTypes.length:0;if(e>0){const i=t.some(t=>!Array.isArray(t.priceList)||t.priceList.length!==e||t.priceList.some(t=>{const e=t&&null!=t.price?String(t.price).trim():"";if(""===e)return!0;const i=this.normalizeGpuPrice(e,!0);return""===i}));if(i)return void this.$message.warning("请填写合法售价(>0,整数最多10位,小数最多6位,且每种支付方式均需填写)")}const i=t.some(t=>!(Number.isInteger(t.maxLeaseDays)&&t.maxLeaseDays>=1&&t.maxLeaseDays<=365));i?this.$message.warning("请检查最大租赁天数(1-365天的整数)"):this.updateGpuMachineInfo(t)},formatPayType(t){try{const e=(t&&t.chain?String(t.chain):"").toUpperCase(),i=(t&&t.coin?String(t.coin):"").toUpperCase();return e&&i?`${e}-${i}`:e||i||""}catch(e){return""}},formatPayTypeHead(t){try{const e=(t&&(t.payChain||t.chain)?String(t.payChain||t.chain):"").toUpperCase(),i=(t&&(t.payCoin||t.coin)?String(t.payCoin||t.coin):"").toUpperCase();return e&&i?`${e}-${i}`:e||i||""}catch(e){return""}},getPayImage(t){const e=t&&(t.payCoinImage||t.image)?String(t.payCoinImage||t.image):"";return e.trim()},initOptions(){try{const{coinList:t}=i(9252);this.coinOptions=Array.isArray(t)?t:[]}catch(t){this.coinOptions=[]}},async fetchMachineInfo(t){const e=await(0,a.getMachineInfo)(t);!e||0!==e.code&&200!==e.code||(this.editDialog.form=e.data,console.log(e.data,"res.data"))},async fetchTableData(){this.loading=!0;try{await this.fetchShopMachineListForSeller(this.listParams)}catch(t){console.error("获取列表失败",t)}finally{this.loading=!1}},handleSearch(){this.pagination.pageNum=1,this.listParams.pageNum=1,this.listParams.keyword=(this.searchKeyword||"").trim()||void 0,this.fetchTableData()},handleReset(){this.searchKeyword="",this.pagination.pageNum=1,this.pagination.pageSize=10,this.listParams={type:this.listParams.type,pageNum:1,pageSize:10,keyword:void 0},this.fetchTableData()},handleView(t){t&&t.id?this.$router.push(`/account/product-detail/${t.id}`):this.$message({message:"缺少商品ID",type:"warning",showClose:!0})},handleEdit(t){const e=Array.isArray(t.coinAndAlgoList)?t.coinAndAlgoList:[],i=e.length?e.map(t=>({coin:String(t&&(t.coin||"")).trim(),algorithm:String(t&&(t.slogithm||t.algorithm||"")).trim(),theoryPower:t&&null!=t.theoryPower?String(t.theoryPower):"",unit:String(t&&(t.unit||"")).trim()||"TH/S",coinAndPowerId:t&&null!=t.coinAndPowerId?t.coinAndPowerId:null})):[{coin:String(t.coin||"").trim(),algorithm:String(t.algorithm||"").trim(),theoryPower:t&&null!=t.theoryPower?String(t.theoryPower):"",unit:String(t.unit||"TH/S").trim(),coinAndPowerId:null}],a={id:t.id,name:t.name||"",coinAndAlgoList:i,maxLeaseDays:t.maxLeaseDays||"",powerDissipation:t.powerDissipation||t.powerDissipation||"",saleNumbers:t.saleNumbers||"",state:!t||0!==t.state&&1!==t.state?0:t.state},s=Array.isArray(t.priceList)?t.priceList:[],o=(this.payTypes||[]).map(t=>({chain:(t.payChain||t.chain||"").toString(),coin:(t.payCoin||t.coin||"").toString(),payTypeId:t.payTypeId||t.id||0}));this.editDialog.priceList=o.map(e=>{const i=s.find(t=>String(t.chain||t.payChain||"")===e.chain&&String(t.coin||t.payCoin||"")===e.coin);return{chain:e.chain,coin:e.coin,price:i?i.price??"":"",payTypeId:i?i.payTypeId??e.payTypeId??0:e.payTypeId??0,productMachineId:t.productMachineId||t.id||0}}),this.editDialog.form=a,this.editDialog.visible=!0,this.loadSupportCoins(),a.coinAndAlgoList&&a.coinAndAlgoList.length>0&&a.coinAndAlgoList.forEach((t,e)=>{t.coin&&this.editLoadAlgorithmsForCoin(t.coin,e)})},handleEditPriceInput(t,e){const i=String(e||"").replace(/[^\d.]/g,"");this.editDialog.priceList&&this.editDialog.priceList[t]&&this.$set(this.editDialog.priceList[t],"price",i)},async handleSaveEdit(){if(!this.editDialog.form)return;const t=this.editDialog.form;if(!String(t.name||"").trim())return void this.$message.warning("矿机型号不能为空");const e=String(t.powerDissipation??"").trim();if(!e)return void this.$message.warning("请填写功耗后提交");const i=Number(String(e).replace(/[^\d.]/g,""));if(!Number.isFinite(i))return void this.$message.warning("请填写功耗后提交");if(!(i>0))return void this.$message.warning("功耗必须大于0");const s=Array.isArray(t.coinAndAlgoList)?t.coinAndAlgoList:[];if(!s.length)return void this.$message.warning("请至少添加一行币种/算法/算力/单位");const o=/^[A-Za-z0-9]{1,10}$/,r=/^[A-Za-z0-9-]{2,20}$/,n=/^\d{1,6}(\.\d{1,4})?$/;for(let a=0;a=1&&l<=365))return void this.$message.warning("最大租赁天数需为1-365的整数");const c=String(t.saleNumbers??"").trim(),d=parseInt(c.replace(/[^\d]/g,""),10);if(!Number.isInteger(d)||d<1||d>9999)return void this.$message.warning("出售数量需为1-9999的整数");const u={id:t.id,coinAndAlgoList:(t.coinAndAlgoList||[]).map(t=>({coin:String(t.coin||"").trim().toUpperCase(),algorithm:String(t.algorithm||"").trim().toUpperCase(),theoryPower:Number(t.theoryPower)||0,unit:t.unit,coinAndPowerId:t.coinAndPowerId||null})),maxLeaseDays:l,name:String(t.name||"").trim(),powerDissipation:i,priceList:(this.editDialog.priceList||[]).map(e=>({chain:e.chain,coin:e.coin,payTypeId:e.payTypeId||0,price:Number(String(e.price||"0").replace(/[^\d.]/g,""))||0,productMachineId:e.productMachineId||t.id||0})),saleNumbers:d,state:(t&&(t.credentials,t.state))??0},h=Array.isArray(u.priceList)&&u.priceList.some(t=>t.price>0);if(h){this.editDialog.saving=!0;try{const t=await(0,a.updateAsicMachine)(u);!t||0!==t.code&&200!==t.code?this.$message.error(t?.msg||"修改失败"):(this.$message.success("修改成功"),this.editDialog.visible=!1,await this.fetchTableData())}catch(p){console.error("更新失败",p)}finally{this.editDialog.saving=!1}}else this.$message.warning("请至少填写一种支付方式的售价")},handleDelete(t){if(!t)return;const e=this.getRowId(t)||t.id;null!=e&&""!==e?this.$confirm("确认删除该商品吗?删除后不可恢复","提示",{confirmButtonText:"删除",cancelButtonText:"取消",type:"warning"}).then(async()=>{try{const t=await(0,a.deleteMachine)({id:e});!t||0!==t.code&&200!==t.code||(this.$message.success("删除成功"),1===this.tableData.length&&this.pagination.pageNum>1&&(this.pagination.pageNum-=1),this.fetchTableData())}catch(t){console.error("删除商品失败",t),console.log("删除失败")}}).catch(()=>{}):this.$message.warning("缺少可删除的ID")},handleSizeChange(t){this.pagination.pageSize=t,this.pagination.pageNum=1,this.listParams.pageSize=t,this.listParams.pageNum=1,this.fetchTableData()},handleCurrentChange(t){this.pagination.pageNum=t,this.listParams.pageNum=t,this.fetchTableData()},handleClear(){this.searchKeyword="",this.pagination.pageNum=1,this.listParams.pageNum=1,this.listParams.keyword=void 0,this.fetchTableData()},handleAddMachine(t){if(!t||!t.id)return void this.$message.warning("缺少商品ID");let e="";try{const i=Array.isArray(t.payTypes)?t.payTypes:[];e=encodeURIComponent(JSON.stringify(i))}catch(i){e=""}this.$router.push({path:"/account/product-machine-add",query:{productId:t.id,coin:t.coin,name:t.name,payTypes:e}})}}}},6278:function(t,e,i){t.exports=i.p+"img/commodity.0dddb787.png"},6282:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(799),s=i(5502),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"4a1d6682",null),l=n.exports},6283:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"funds-page"},[e("h3",{staticClass:"title"},[t._v("资金流水")]),e("div",{staticClass:"tabs-card",attrs:{"aria-label":"资金流水tab",tabindex:"0"}},[e("el-tabs",{on:{"tab-click":t.handleTabClick},model:{value:t.activeTab,callback:function(e){t.activeTab=e},expression:"activeTab"}},[e("el-tab-pane",{attrs:{label:"收款记录",name:"receipt"}}),e("el-tab-pane",{attrs:{label:"提现记录",name:"withdraw"}})],1),e("keep-alive",[e(t.activeComponentName,{tag:"component"})],1)],1)])},e.Yp=[]},6299:function(t,e,i){var a=i(3999)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e.addWalletShopConfig=d,e.balanceRechargeList=n,e.balanceWithdrawList=l,e.balanceWithdrawListV2=v,e.bindWallet=p,e.getChainAndList=u,e.getProductListForShopWalletConfig=b,e.getRecentlyTransaction=g,e.getShopConfig=h,e.getShopConfigV2=y,e.getWalletInfo=o,e.sellerReceiptList=c,e.transactionRecord=m,e.updateProductListForShopWalletConfig=f,e.updateShopConfigV2=C,e.withdrawBalance=r,e.withdrawBalanceForSeller=w;var s=a(i(5720));function o(t){return(0,s.default)({url:"/lease/user/getWalletInfo",method:"post",data:t})}function r(t){return(0,s.default)({url:"/lease/user/withdrawBalance",method:"post",data:t})}function n(t){return(0,s.default)({url:"/lease/user/balanceRechargeList",method:"post",data:t})}function l(t){return(0,s.default)({url:"/lease/user/balanceWithdrawList",method:"post",data:t})}function c(t){return(0,s.default)({url:"/lease/user/balancePayList",method:"post",data:t})}function d(t){return(0,s.default)({url:"/lease/shop/addShopConfig",method:"post",data:t})}function u(t){return(0,s.default)({url:"/lease/shop/getChainAndList",method:"post",data:t})}function h(t){return(0,s.default)({url:"/lease/shop/getShopConfig",method:"post",data:t})}function p(t){return(0,s.default)({url:"/lease/user/bindWallet",method:"post",data:t})}function m(t){return(0,s.default)({url:"/lease/user/transactionRecord",method:"post",data:t})}function g(t){return(0,s.default)({url:"/lease/user/getRecentlyTransaction",method:"post",data:t})}function f(t){return(0,s.default)({url:"/lease/product/updateProductListForShopWalletConfig",method:"post",data:t})}function y(t){return(0,s.default)({url:"/lease/v2/shop/getShopConfigV2",method:"post",data:t})}function w(t){return(0,s.default)({url:"/lease/v2/shop/withdrawBalanceForSeller",method:"post",data:t})}function v(t){return(0,s.default)({url:"/lease/v2/shop/balanceWithdrawList",method:"post",data:t})}function C(t){return(0,s.default)({url:"/lease/v2/shop/updateShopConfigV2",method:"post",data:t})}function b(t){return(0,s.default)({url:"/lease/v2/product/machine/getProductListForShopWalletConfig",method:"post",data:t})}},6404:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"orders-page"},[e("h2",{staticClass:"title"},[t._v("已售出订单")]),e("el-tabs",{on:{"tab-click":t.handleTabClick},model:{value:t.active,callback:function(e){t.active=e},expression:"active"}},[e("el-tab-pane",{attrs:{label:"订单进行中",name:"7"}},[e("order-list",{attrs:{items:t.orders[7],"show-checkout":!1,"show-end-time":!1,"is-seller":!0,"empty-text":"暂无进行中的订单"}})],1),e("el-tab-pane",{attrs:{label:"订单已完成",name:"8"}},[e("order-list",{attrs:{items:t.orders[8],"show-checkout":!1,"show-end-time":!0,"is-seller":!0,"empty-text":"暂无已完成的订单"}})],1),e("el-tab-pane",{attrs:{label:"订单生成失败",name:"11"}},[e("div",{staticClass:"order-fail-reason"},[t._v("失败原因:无法连接矿池,导致生成订单失败")]),e("order-list",{attrs:{items:t.orders[11],"show-checkout":!1,"show-end-time":!1,"is-seller":!0,"empty-text":"暂无订单生成失败记录"}})],1)],1)],1)},e.Yp=[]},6505:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(4405),s=i(7082),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"1a92afce",null),l=n.exports},6616:function(t,e,i){Object.defineProperty(e,"B",{value:!0}),e.A=void 0,i(4114),i(8111),i(1701),i(3579);var a=i(6299),s=i(6299),o=i(6966),r=i(1673);e.A={name:"WalletPage",data(){return{walletBalance:0,blockedBalance:0,walletList:[],WalletData:{},rechargeDialogVisible:!1,qrCodeGenerated:!1,withdrawDialogVisible:!1,withdrawLoading:!1,withdrawForm:{toChain:"tron",toSymbol:"",amount:"",toAddress:"",fee:"1.00",googleCode:""},withdrawRules:{toChain:[{required:!0,message:"请选择区块链网络",trigger:"change"}],toSymbol:[{required:!0,message:"请选择提现币种",trigger:"change"}],amount:[{required:!0,message:"请输入提现金额",trigger:"blur"},{validator:this.validateWithdrawAmount,trigger:"blur"}],toAddress:[{required:!0,message:"请输入收款地址",trigger:"blur"},{validator:this.validateAddress,trigger:"blur"}],googleCode:[{required:!0,message:"请输入谷歌验证码",trigger:"blur"},{validator:this.validateGoogleCode,trigger:"blur"}]},chainOptions:[{label:"Tron (TRC20)",value:"tron"}],options:[],loading:!1,createDialogVisible:!1,createLoading:!1,createValue:[],tokenOptions:{tron:[]},recentTransactions:[]}},computed:{availableTokens(){return this.tokenOptions[this.withdrawForm.toChain]||[]},actualAmount(){const t=this.toScaledInt(this.withdrawForm.amount),e=this.toScaledInt(this.withdrawForm.fee);if(!Number.isFinite(t)||!Number.isFinite(e))return"0";const i=t-e;return i<=0?"0":this.formatDec6FromInt(i)},totalBalance(){const t=parseFloat(this.WalletData.walletBalance||this.WalletData.balance||this.walletBalance||0)||0,e=parseFloat(this.WalletData.blockedBalance||this.blockedBalance||0)||0;return(t+e).toFixed(2)},availableWithdrawBalance(){return this.WalletData.walletBalance||this.WalletData.balance||0},displayWithdrawSymbol(){const t=this.WalletData&&(this.WalletData.fromSymbol||this.WalletData.coin||this.withdrawForm.toSymbol)||"";return String(t).toUpperCase()}},mounted(){this.fetchWalletInfo(),this.updateFeeByChain(),this.getChainAndList(),this.fetchRecentlyTransaction()},methods:{async ensureGoogleStatusEnabledForWalletOp(t){try{const e=await(0,r.getGoogleStatus)();if(!e||0!==e.code&&200!==e.code)return this.$message.error("获取双重验证状态失败,请稍后重试"),!1;const i=e.data?.status??e.data??1;if(0===Number(i))return!0;const a=1===Number(i)?"您尚未绑定双重验证":"您已关闭双重验证",s=`\n
\n
${a}
\n
\n 请先在安全设置中绑定并开启双重验证后,才可以进行${t||"该"}操作。\n
\n
\n `;return await this.$confirm(s,"安全提示",{confirmButtonText:"去安全设置",cancelButtonText:"取消",type:"warning",dangerouslyUseHTMLString:!0,customClass:"google-2fa-guard-dialog"}),this.$router.push("/account/security-settings"),!1}catch(e){return!1}},displaySymbol(t){const e=t&&(t.fromSymbol||t.toSymbol||t.coin)||"";return String(e).toUpperCase()},openCreateWallet(){this.createDialogVisible=!0,Array.isArray(this.options)&&0!==this.options.length||this.getChainAndList()},async confirmCreateWallet(){const t=this.createValue||[];if(!Array.isArray(t)||t.length<2)return void this.$message.warning("请先选择链与币种");const[e,i]=t;if(e&&i)try{this.createLoading=!0;const t=await(0,s.bindWallet)({chain:e,coin:i});if(t&&(0===t.code||200===t.code)){const e=t.data;if(e){const t=Array.isArray(e)?e[0]||{}:e;this.WalletData=t,this.rechargeDialogVisible=!0,this.qrCodeGenerated=!1,this.$nextTick(()=>{this.generateQRCode()})}this.fetchWalletInfo(),this.createDialogVisible=!1,this.createValue=[]}}catch(a){console.error("获取充值信息失败",a)}finally{this.createLoading=!1}else this.$message.warning("请选择完整的链与币种")},async getChainAndList(){this.loading=!0;const t=await(0,s.getChainAndList)();t&&(0===t.code||200===t.code)&&t.data&&(this.options=t.data),this.loading=!1},async fetchRecentlyTransaction(){try{const t=await(0,a.getRecentlyTransaction)();if(t&&(0===t.code||200===t.code)){const e=Array.isArray(t.data)?t.data:[],i=e.map((t,e)=>{const i=Number(t&&t.amount),a=Number.isFinite(i)?i:0,s=Number(t&&t.type),o=1===s?Math.abs(a):-Math.abs(a),r=1===s?"充值":2===s?"提现":"支付",n=Number(t&&t.status),l={0:"失败",1:"成功",2:"处理中",3:"校验失败"},c={0:"danger",1:"success",2:"warning",3:"danger"};return{id:`${t&&t.updateTime||""}-${e}`,type:r,amount:o,amountText:this.formatDec6(Math.abs(o)),time:this.formatApiTime(t&&t.updateTime),status:n,statusText:l[n]||"-",statusTagType:c[n]||"info",coin:t&&null!=t.coin?String(t.coin).toUpperCase():""}});this.recentTransactions=i}}catch(t){}},formatApiTime(t){const e=String(t||"");return e?e.replace("T"," ").replace("Z",""):""},formatDec6(t){if(null===t||void 0===t||""===t)return"0";let e=String(t);if(/e/i.test(e)){const i=Number(t);if(!Number.isFinite(i))return"0";e=i.toFixed(20).replace(/\.0+$/,"").replace(/(\.\d*?)0+$/,"$1")}const i=e.match(/^(-?)(\d+)(?:\.(\d+))?$/);if(!i)return e;let a=i[2],s=i[3]||"";return s.length>6&&(s=s.slice(0,6)),s?`${a}.${s}`:a},toScaledInt(t,e=6){if(null===t||void 0===t)return 0;const i=String(t).trim();if(""===i)return 0;const a=new RegExp(`^\\d+(?:\\.(\\d{0,${e}}))?$`),s=i.match(a);if(!s){const t=Number(i);if(!Number.isFinite(t))return 0;const a=Math.pow(10,e);return Math.round(t*a)}const[o,r]=i.split("."),n=(r||"").padEnd(e,"0").slice(0,e),l=Math.pow(10,e);return Number(o)*l+Number(n)},scaledIntToString(t,e=6){const i=t<0?"-":"",a=Math.abs(t),s=Math.pow(10,e),o=Math.floor(a/s),r=String(a%s).padStart(e,"0");return`${i}${o}.${r}`},formatDec6FromInt(t){const e=this.scaledIntToString(t,6);return e.replace(/\.0+$/,"").replace(/(\.\d*?)0+$/,"$1")},async fetchWalletInfo(t){try{const e=await(0,a.getWalletInfo)(t);if(e&&(0===e.code||200===e.code)){const t=e.data;if(Array.isArray(t)){this.walletList=t;const e=t[0]||{};this.walletBalance=e.walletBalance||e.balance||0,this.blockedBalance=e.blockedBalance||0,this.rechargeDialogVisible||(this.WalletData=e)}else t&&"object"===typeof t?(this.walletList=[t],this.walletBalance=t.walletBalance||t.balance||0,this.blockedBalance=t.blockedBalance||0,this.rechargeDialogVisible||(this.WalletData=t)):(this.walletList=[],this.walletBalance=0,this.blockedBalance=0,this.WalletData={})}}catch(e){console.error("获取钱包信息失败:",e)}},async fetchBalanceRechargeList(t={}){try{const e={pageNum:1,pageSize:20,...t};console.log("获取充值记录参数:",e);const i=await(0,a.balanceRechargeList)(e);if(!i||0!==i.code&&200!==i.code)return this.$message({message:i?.msg||"获取充值记录失败",type:"error",showClose:!0}),null;{const t={list:i.data.rows||[],total:i.data.total||0,totalPage:i.data.totalPage||0,currentPage:e.pageNum,pageSize:e.pageSize,status:e.status};return console.log("充值记录获取成功:",t),t}}catch(e){return console.error("获取充值记录失败:",e),null}},async fetchBalanceWithdrawList(t){const e=await(0,a.balanceWithdrawList)(t);!e||0!==e.code&&200!==e.code||(this.balanceWithdrawList=e.data)},handleRecharge(t){t&&"object"===typeof t&&(this.WalletData=t),this.rechargeDialogVisible=!0,this.qrCodeGenerated=!1,this.$nextTick(()=>{this.generateQRCode()})},async handleWithdraw(t){const e=await this.ensureGoogleStatusEnabledForWalletOp("提现");if(e){if(t){this.WalletData=t;const e=t.fromChain||t.chain||this.withdrawForm.toChain,i=t.fromSymbol||t.coin||this.withdrawForm.toSymbol;this.withdrawForm.toChain=e,this.withdrawForm.toSymbol=i,this.updateFeeByChain()}this.withdrawDialogVisible=!0}},copyAddress(t){const e=t||this.WalletData.fromAddress;e?navigator.clipboard?navigator.clipboard.writeText(e).then(()=>{this.$message({message:"钱包地址已复制到剪贴板",type:"success",showClose:!0})}).catch(()=>{this.fallbackCopyAddress(e)}):this.fallbackCopyAddress(e):this.$message({message:"钱包地址不存在",type:"error",showClose:!0})},fallbackCopyAddress(t){const e=document.createElement("textarea");e.value=t,document.body.appendChild(e),e.select();try{document.execCommand("copy"),this.$message({message:"钱包地址已复制到剪贴板",type:"success",showClose:!0})}catch(i){console.log("复制失败,请手动复制")}document.body.removeChild(e)},generateQRCode(){if(!this.qrCodeGenerated)if(this.WalletData.qrcode){const t=this.$refs.qrCodeRef;if(t){t.innerHTML="";const e=document.createElement("img");e.src=`data:image/png;base64,${this.WalletData.qrcode}`,e.alt="充值二维码",e.style.width="160px",e.style.height="160px",e.style.borderRadius="4px",e.onerror=()=>{t.innerHTML='
二维码加载失败
'},t.appendChild(e),this.qrCodeGenerated=!0}}else{const t=this.$refs.qrCodeRef;t&&(t.innerHTML='
暂无二维码数据
')}},onChainChange(){const t=this.tokenOptions[this.withdrawForm.toChain]||[],e=t.some(t=>"USDT"===t.value);this.withdrawForm.toSymbol=e?"USDT":"",this.updateFeeByChain()},updateFeeByChain(){const t=this.WalletData&&(null!=this.WalletData.charge?this.WalletData.charge:this.WalletData.fee);if(null!=t&&""!==t){const e=Number(t);return void(this.withdrawForm.fee=Number.isFinite(e)?e.toFixed(2):String(t))}const e={tron:"1.00",ethereum:"5.00",bsc:"0.50",polygon:"0.10"};this.withdrawForm.fee=e[this.withdrawForm.toChain]||"1.00"},async confirmWithdraw(){this.$refs.withdrawForm.validate(async t=>{if(t){this.withdrawLoading=!0;try{const t=String(this.withdrawForm.toAddress||"").trim(),e=String(this.WalletData&&this.WalletData.fromAddress||"").trim();let i=t;if(i){const t=(0,o.rsaEncryptSync)(i);if(t)i=t;else{const t=await(0,o.rsaEncrypt)(i);if(!t)return void this.$message.error("钱包地址加密失败,请重试");i=t}}let s=e;if(s){const t=(0,o.rsaEncryptSync)(s);if(t)s=t;else{const t=await(0,o.rsaEncrypt)(s);if(!t)return void this.$message.error("钱包地址加密失败,请重试");s=t}}const r=await(0,a.withdrawBalance)({toChain:this.WalletData&&(this.WalletData.fromChain||this.WalletData.chain)||this.withdrawForm.toChain,toSymbol:this.WalletData&&(this.WalletData.fromSymbol||this.WalletData.coin)||this.withdrawForm.toSymbol,amount:parseFloat(this.withdrawForm.amount),toAddress:i,fromAddress:s,code:this.withdrawForm.googleCode});!r||0!==r.code&&200!==r.code||(this.$message({message:"提现申请已提交,请等待处理",type:"success",showClose:!0}),await this.fetchWalletInfo(),this.withdrawDialogVisible=!1,this.resetWithdrawForm())}catch(e){console.error("提现申请失败:",e),console.log("网络错误,请重试")}finally{this.withdrawLoading=!1}}})},resetRechargeForm(){this.qrCodeGenerated=!1,this.fetchWalletInfo()},resetWithdrawForm(){this.withdrawForm={toChain:"tron",toSymbol:"",amount:"",toAddress:"",fee:"1.00",googleCode:""},this.withdrawLoading=!1,this.$nextTick(()=>{this.$refs.withdrawForm&&this.$refs.withdrawForm.clearValidate()})},validateWithdrawAmount(t,e,i){if(!e)return void i(new Error("请输入提现金额"));const a=this.toScaledInt(e);if(!Number.isFinite(a)||a<=0)return void i(new Error("请输入有效的金额"));const s=this.toScaledInt(this.withdrawForm.fee),o=this.WalletData&&(this.WalletData.walletBalance||this.WalletData.balance)||0,r=this.toScaledInt(o);if(a>r)return void i(new Error("提现金额不能大于可用余额"));if(a<1e6)return void i(new Error("最小提现金额为1"));if(a<=s)return void i(new Error("提现金额必须大于手续费"));const n=a-s;n<=0?i(new Error("提现金额扣除手续费后必须大于0")):i()},handleGoogleCodeInput(t){this.withdrawForm.googleCode=t.replace(/\D/g,"")},handleAmountInput(t){let e=String(t||"");e=e.replace(/[^0-9.]/g,"");const i=e.indexOf(".");if(-1!==i&&(e=e.slice(0,i+1)+e.slice(i+1).replace(/\./g,"")),-1!==i){const[t,i]=e.split(".");e=t+"."+(i?i.slice(0,6):"")}const a=e.split(".");a[0]&&a[0].length>12&&(a[0]=a[0].slice(0,12)),e=a.join("."),this.withdrawForm.amount=e},validateGoogleCode(t,e,i){e?/^\d{6}$/.test(e)?i():i(new Error("谷歌验证码必须是6位数字")):i(new Error("请输入谷歌验证码"))},validateAddress(t,e,i){const a="string"===typeof e?e.trim():"";if(!a)return void i(new Error("请输入收款地址"));const s=this.withdrawForm.toChain;let o=!1;switch(s){case"tron":o=/^T[A-Za-z1-9]{33}$/.test(a);break;case"ethereum":o=/^0x[a-fA-F0-9]{40}$/.test(a);break;case"bsc":o=/^0x[a-fA-F0-9]{40}$/.test(a);break;case"polygon":o=/^0x[a-fA-F0-9]{40}$/.test(a);break;default:o=a.length>10}o?i():i(new Error("请输入正确的收款地址格式"))},addTransactionRecord(t,e){const i=new Date,a=`${i.getFullYear()}-${String(i.getMonth()+1).padStart(2,"0")}-${String(i.getDate()).padStart(2,"0")} ${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}`;this.recentTransactions.unshift({id:Date.now(),type:t,amount:e,time:a}),this.recentTransactions.length>10&&(this.recentTransactions=this.recentTransactions.slice(0,10))}}}},6754:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(6283),s=i(4792),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"0184b4e8",null),l=n.exports},6886:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(9532),s=i(3831),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"f62bdade",null),l=n.exports},6966:function(t,e,i){var a=i(3999)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e.rsaEncrypt=c,e.rsaEncryptSync=l;var s=a(i(7703));const o="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsQVIKYozXCfnXUw8+omYLdcdL1pTzmQh35YPsvn22wM4SQJKvMmXmcS6bI5Bu+5zCjL0F56DzfKz0BNZEwb46UshUOO+KFBUr8CxjYE8NOgIsoe5FUn57O6er9/KySaWlkpGZX49K+l3e90R+dFUEfRE/ijYpeZWkLRwcgWZ+2u6HGpl9h/eF6XD0aW9asDjdAbxUQ48TlaWgfP+OHC+Zy2GKGQG16EcDMczrN6a2HbFnwRIUKrFP67UqyRq11BTUziOhXLY8J0MFuwXUk2OY4VpqjrJjHHjlHYADjIL/5K4Io2AhRU9+QSsKFR2wGxi4e8vw2IXDzscrDuah/7YSwIDAQAB",r=`-----BEGIN PUBLIC KEY-----\n${o}\n-----END PUBLIC KEY-----`;function n(){return s.default?s.default:"undefined"!==typeof window&&window.JSEncrypt?window.JSEncrypt:null}function l(t){if(!t||"string"!==typeof t)return console.error("RSA 加密:输入必须是非空字符串"),null;try{const e=n();if(!e)return console.error("JSEncrypt 未加载"),null;const i=new e;i.setPublicKey(r);const a=i.encrypt(t);return a||(console.error("RSA 加密失败:返回值为空"),null)}catch(e){return console.error("RSA 加密异常:",e),null}}async function c(t){if(!t||"string"!==typeof t)return console.error("RSA 加密:输入必须是非空字符串"),null;try{const e=n();if(!e)return console.error("JSEncrypt 未加载"),null;const i=new e;i.setPublicKey(r);const a=i.encrypt(t);return a||(console.error("RSA 加密失败:返回值为空"),null)}catch(e){return console.error("RSA 加密异常:",e),null}}},7082:function(t,e,i){Object.defineProperty(e,"B",{value:!0}),e.A=void 0;var a=i(6299),s=i(4981);e.A={name:"AccountWithdrawRecord",data(){return{loading:!1,rows:[],useMockRows:!1,mockRows:[{createTime:"2026-01-23T09:12:30.000Z",amount:"1289.12345678",serviceCharge:"1.23",toChain:"ethereum",coin:"usdt",toAddress:"0x2c1f3C6c9F0a2D7b8e9fA1b2C3D4e5F67890aBcD9f7a3d1c0b5e6f8a9c0d1e2f3a4b5c6d7e8f9012",txHash:"0x9f7a3d1c0b5e6f8a9c0d1e2f3a4b5c6d7e8f90123456789abcdef1234567890",status:2,updateTime:"2026-01-23T10:18:45.000Z"},{createTime:"2026-01-22T15:06:12.000Z",amount:"56.78",serviceCharge:"0.12",toChain:"tron",coin:"usdt",toAddress:"TYD4xXGZf6hRk8JQ2q4mE3s9J8zY6pU2qA7q9s8d7f6g5h4j3k2l1zXcVbN",txHash:"0xabc123def456",status:1,updateTime:"2026-01-22T15:20:00.000Z"}],pageNum:1,pageSize:20,total:0}},mounted(){this.fetchList()},methods:{formatAmount(t,e){return(0,s.truncateAmountByCoin)(t,e)},formatFullTime(t){if(!t)return"";try{return`${t.split("T")[0]} ${t.split("T")[1].split(".")[0]}`}catch(e){return t}},formatChain(t){const e={tron:"Tron (TRC20)",ethereum:"Ethereum (ERC20)",bsc:"BSC (BEP20)",polygon:"Polygon",ETH:"ETH",TRON:"TRON"},i="string"===typeof t?t.toLowerCase():t;return e[i]||t||"-"},getStatusType(t){const e={0:"danger",1:"success",2:"warning",3:"danger"};return e[t]||"info"},getStatusText(t){const e={0:"失败",1:"成功",2:"处理中",3:"校验失败"};return e[t]||"未知"},copy(t){if(!t)return;try{if(navigator.clipboard&&navigator.clipboard.writeText)return navigator.clipboard.writeText(t),void this.$message.success("已复制")}catch(i){}const e=document.createElement("textarea");e.value=t,document.body.appendChild(e),e.select();try{document.execCommand("copy"),this.$message.success("已复制")}catch(i){}document.body.removeChild(e)},async fetchList(){this.loading=!0;try{if(this.useMockRows)return console.info("[withdrawRecord] 使用模拟数据展示效果"),this.rows=Array.isArray(this.mockRows)?this.mockRows:[],void(this.total=this.rows.length);const t=await(0,a.balanceWithdrawListV2)({pageNum:this.pageNum,pageSize:this.pageSize}),e=t&&(t.data||t),i=Array.isArray(e&&e.rows)?e.rows:Array.isArray(e)?e:[];this.rows=i;const s=Number(e&&(null!=e.total?e.total:t.total));this.total=Number.isFinite(s)?s:0}catch(t){this.rows=[],this.total=0}finally{this.loading=!1}}}}},7370:function(t,e,i){Object.defineProperty(e,"B",{value:!0}),e.A=void 0,i(4114);var a=i(5952);e.A={name:"Checkout",data(){return{cartItems:[],loading:!1,submitting:!1,form:{name:"",phone:"",address:"",note:""},errors:{}}},computed:{summary(){return(0,a.computeSummary)()}},mounted(){this.loadCart()},methods:{loadCart(){try{this.loading=!0,this.cartItems=(0,a.readCart)(),0===this.cartItems.length&&this.$message.warning("购物车为空,请先添加商品")}catch(t){console.error("加载购物车失败:",t),console.log("加载购物车失败,请稍后重试")}finally{this.loading=!1}},validateForm(){return this.errors={},this.form.name.trim()||(this.errors.name="请输入收货人姓名"),this.form.phone.trim()?/^1[3-9]\d{9}$/.test(this.form.phone.trim())||(this.errors.phone="请输入正确的手机号码"):this.errors.phone="请输入联系电话",this.form.address.trim()||(this.errors.address="请输入收货地址"),0===Object.keys(this.errors).length},async handleSubmit(){if(this.validateForm())try{this.submitting=!0,await new Promise(t=>setTimeout(t,2e3));const t={id:`ORDER_${Date.now()}`,items:this.cartItems,total:this.summary.totalPrice,customer:{name:this.form.name,phone:this.form.phone,address:this.form.address,note:this.form.note},createTime:(new Date).toISOString()};console.log("订单提交成功:",t),(0,a.clearCart)(),this.$message.success("订单提交成功!"),setTimeout(()=>{this.$router.push("/productList")},1500)}catch(t){console.error("提交订单失败:",t),console.log("提交订单失败,请稍后重试")}finally{this.submitting=!1}else this.$message.error("请完善收货信息")}}}},7465:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=void 0,i(8111),i(7588);class a{constructor(){this.recentErrors=new Map,this.throttleTime=3e4,this.errorTypes={"Network Error":"network",timeout:"timeout","Request failed with status code":"statusCode",networkReconnected:"networkStatus",NetworkError:"network"}}getErrorType(t){for(const[e,i]of Object.entries(this.errorTypes))if(t.includes(e))return i;return"unknown"}canShowError(t){const e=this.getErrorType(t),i=Date.now();if(this.recentErrors.has(e)){const t=this.recentErrors.get(e);if(i-t{t-e>this.throttleTime&&this.recentErrors.delete(i)})}}const s=new a;e["default"]=s},7570:function(t,e,i){var a=i(3999)["default"];Object.defineProperty(e,"B",{value:!0}),e.A=void 0;var s=a(i(1774));e.A={components:{comHeard:()=>Promise.resolve().then(()=>(0,s.default)(i(1750))),appMain:()=>Promise.resolve().then(()=>(0,s.default)(i(1220)))}}},7585:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(1840),s=i(8586),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"6f6965ba",null),l=n.exports},7686:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"header-container"},[e("nav",{staticClass:"navbar"},[e("div",{staticClass:"nav-left"},t._l(t.navigation,function(i){return e("router-link",{key:i.path,staticClass:"nav-btn",class:{active:t.isNavActive(i.path)},attrs:{to:i.path,title:i.description}},[e("span",{staticClass:"nav-icon"},[t._v(t._s(i.icon))]),e("span",{staticClass:"nav-text"},[t._v(t._s(i.name))]),"/cart"===i.path?e("span",{staticClass:"cart-count"},[t._v("("+t._s(t.cartItemCount)+")")]):t._e()])}),1),e("div",{staticClass:"nav-right"},[t.isLoginStatusLoading?e("div",{staticClass:"auth-loading"},[e("span",{staticClass:"loading-placeholder"})]):t.isLoggedIn?e("div",{staticClass:"user-info"},[e("span",{staticClass:"user-email"},[t._v(t._s(t.userEmail))]),e("router-link",{staticClass:"security-link",attrs:{to:"/account/security-settings","active-class":"active"}},[t._v(" 安全设置 ")]),e("el-button",{staticClass:"logout-btn",attrs:{type:"text",size:"small"},on:{click:t.handleLogout}},[t._v(" 退出 ")])],1):e("div",{staticClass:"auth-buttons"},[e("button",{staticClass:"auth-btn register-btn",on:{click:t.goToRegister}},[t._v(" 注册 ")]),e("button",{staticClass:"auth-btn login-btn",on:{click:t.goToLogin}},[t._v(" 登录 ")])])])])])},e.Yp=[]},7692:function(t,e,i){var a=i(3999)["default"];Object.defineProperty(e,"B",{value:!0}),e.A=void 0,i(4114),i(8111),i(2489),i(116),i(1701),i(3579);var s=a(i(4487));e.A={name:"ProductDetail",mixins:[s.default],methods:{getCellClass(t){try{if(!t)return"num-strong";if("amount"===String(t.type).toLowerCase())return"price-strong";const e=String(t.key||"").toLowerCase();if(e.includes("price")||e.includes("amount"))return"price-strong";const i=String(t.label||"");return i.includes("价")||i.includes("金额")?"price-strong":"num-strong"}catch(e){return"num-strong"}},multiplyAsDecimal(t){const e=t=>{const e=String(t||0).trim();if(!e.includes("."))return{int:BigInt(e||"0"),scale:0};const[i,a]=e.split("."),s=(a||"").replace(/[^0-9]/g,""),o=(i||"0").replace(/[^0-9-]/g,""),r=o.startsWith("-")?"-":"",n=(r?o.slice(1):o)+s,l=n.replace(/^0+(?=\d)/,"")||"0";return{int:BigInt(r+l),scale:s.length}};let i=1n,a=0;for(const d of t){const{int:t,scale:s}=e(d);i*=t,a+=s}const s=i<0n,o=(s?-i:i).toString();if(0===a)return(s?"-":"")+o;const r=a-o.length,n=r>0?"0".repeat(r)+o:o,l=n.length-a;let c=n.slice(0,l)+"."+n.slice(l);return c=c.replace(/^(-?)0+(?=\d)/,"$1"),c=c.replace(/\.?0+$/,""),c.startsWith(".")&&(c="0"+c),""!==c&&"-"!==c||(c="0"),(s?"-":"")+c},truncateDecimalString(t,e=6){const i=String(t||"0");if(!i.includes("."))return i;const[a,s]=i.split(".");return s.length<=e?i:`${a}.${s.slice(0,e)}`},formatConfirmTotalText(t){try{const e=this.getDisplayPrice?this.getDisplayPrice(t):t&&t.price,i=this.getDisplayPriceCoin&&this.getDisplayPriceCoin(t)||"",a=Number(t&&t.leaseTime)||1,s=[e,a];if(0===this.machineType){const e=Number(t&&t.purchaseQuantity)||1;s.push(e)}const o=this.multiplyAsDecimal(s),r=this.truncateDecimalString(o,6),n=(i||"").toString().toUpperCase();return n?`${r} ${n}`:r}catch(e){return"—"}},getRowMaxPurchase(t){try{const e=Number(t&&t.saleNumbers),i=Number(t&&t.saleOutNumbers);if(!Number.isFinite(e)||e<0)return 0;if(!Number.isFinite(i)||i<0)return Math.floor(e);const a=e-i;return Math.max(0,Math.floor(a))}catch(e){return 0}},handlePurchaseQuantityChange(t,e){try{const i=this.getRowMaxPurchase(t);let a=Number(e);Number.isFinite(a)||(a=1),a<1&&(a=1),i>0&&a>i&&(a=i),a=Math.floor(a),this.$set(t,"purchaseQuantity",a)}catch(i){this.$set(t,"purchaseQuantity",1)}},hasAnyPrice(t){try{if(!t)return console.log("[hasAnyPrice] 行数据为空"),!1;if(Array.isArray(t.priceList)&&t.priceList.length){const e=t.priceList.some(t=>t&&null!==t.price&&void 0!==t.price);return e||console.log(`[hasAnyPrice] 机器ID ${t.id||"unknown"} priceList 中无有效价格:`,t.priceList),e}const e=t.price,i=null!==e&&void 0!==e&&""!==e;return i||console.log(`[hasAnyPrice] 机器ID ${t.id||"unknown"} row.price 无效:`,e),i}catch(e){return console.error("[hasAnyPrice] 异常:",e,t),!1}},isRowDisabled(t){try{if(!t)return console.log("[isRowDisabled] 行数据为空"),!0;if(1===t.saleState||2===t.saleState)return console.log(`[isRowDisabled] 机器ID ${t.id||"unknown"} 已售出或售出中, saleState:`,t.saleState),!0;const e=this.hasAnyPrice(t);return e||console.log(`[isRowDisabled] 机器ID ${t.id||"unknown"} 无价格:`,{priceList:t.priceList,price:t.price,hasPriceList:Array.isArray(t.priceList)&&t.priceList.length>0}),!e}catch(e){return console.error("[isRowDisabled] 异常:",e,t),!0}},getRowMaxLeaseDays(t){const e=t&&(t.maxLeaseDays||t.maxLeaseDay||t.max_lease_days)||365,i=Number(e);return Number.isFinite(i)?i<1?1:i>365?365:Math.floor(i):365},getPayImageUrl(t){try{const e=t&&t.payCoinImage?String(t.payCoinImage):"";return e.trim()}catch(e){return""}},getSelectedPayIcon(){try{const t=this.selectedPayKey;if(!t)return"";const[e,i]=String(t).split("|"),a=Array.isArray(this.paymentMethodList)?this.paymentMethodList:[],s=a.find(t=>String(t&&t.payChain).toUpperCase()===String(e).toUpperCase()&&String(t&&t.payCoin).toUpperCase()===String(i).toUpperCase());return this.getPayImageUrl(s)}catch(t){return""}},handlePayFilterChange(t){try{const e="string"===typeof t?t:"";if(e){const[t,i]=e.split("|");this.filters.chain=(t||"").trim(),this.filters.coin=(i||"").trim()}else this.filters.chain="",this.filters.coin="";this.handleSearchFilters()}catch(e){}},handleSearchFilters(){const t=this.buildQueryParams();this.fetchGetMachineInfo(t)},handleMinPriceInput(t){let e=String(t||"");e=e.replace(/[^0-9.]/g,"");const i=e.indexOf(".");-1!==i&&(e=e.slice(0,i+1)+e.slice(i+1).replace(/\./g,""));const a=e.endsWith(".");if(-1!==i){const[t,i=""]=e.split("."),s=i.slice(0,8);e=s?`${t}.${s}`:a?`${t}.`:t}this.filters.minPrice=""===e?null:e},handleMaxPriceInput(t){let e=String(t||"");e=e.replace(/[^0-9.]/g,"");const i=e.indexOf(".");-1!==i&&(e=e.slice(0,i+1)+e.slice(i+1).replace(/\./g,""));const a=e.endsWith(".");if(-1!==i){const[t,i=""]=e.split("."),s=i.slice(0,8);e=s?`${t}.${s}`:a?`${t}.`:t}this.filters.maxPrice=""===e?null:e},handleResetFilters(){this.filters.minPrice=null,this.filters.maxPrice=null,this.filters.keyword="",this.dynamicSearch.keyword="",this.handleSearchFilters()},getFirstCoinSymbol(){try{const t=Array.isArray(this.machineList)?this.machineList:[],e=t.length&&t[0]&&t[0].coin?String(t[0].coin):"";return e?e.toUpperCase():""}catch(t){return""}},getPriceCoinSymbol(){try{const t=Array.isArray(this.machineList)?this.machineList:[],e=t.find(t=>t&&t.payCoin),i=e&&e.payCoin?String(e.payCoin):"";return i?i.toUpperCase():""}catch(t){return""}},handleLeaseDaysChange(t,e){const i=this.getRowMaxLeaseDays(t);let a=Number(e);Number.isFinite(a)||(a=1),a<1&&(a=1),a>i&&(a=i),a=Math.floor(a),this.$set(t,"leaseTime",a)},formatPayTooltip(t){try{if(!t)return"";const e=(t.payChain||"").toString().trim(),i=(t.payCoin||"").toString().trim();return e&&i?`${e} - ${i}`:e||i||""}catch(e){return console.error("formatPayTooltip error:",e),""}},handlePayIconKeyDown(t){try{if(!t)return;console.debug("[pay-icon-keydown]",t.payChain)}catch(e){console.error("handlePayIconKeyDown error:",e)}},handleManualSelectFlat(t,e){try{if(!t)return;if(1===t.saleState||2===t.saleState)return this.$message.warning("该机器已售出或售出中,无法选择"),void this.$set(t,"_selected",!1);this.$set(t,"_selected",!!e)}catch(i){console.error("handleManualSelectFlat error:",i)}},handleGetRowClass({row:t}){return t&&(1===t.saleState||2===t.saleState)?"sold-row":""},handleOpenAddToCartDialog(){const t=Array.isArray(this.dynamicRows)?this.dynamicRows:[],e=t.filter(t=>!!t&&!!t._selected);e.length?(this.confirmAddDialog.items=e.map(t=>({...t,leaseTime:Number(t.leaseTime||1),purchaseQuantity:Number(t.purchaseQuantity||0)})),this.confirmAddDialog.visible=!0):this.$message.warning("请先勾选至少一台矿机")}}}},7723:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.listProducts=e.getProductById=e["default"]=void 0;const i=[],a=async()=>Promise.resolve(i);e.listProducts=a;const s=async t=>{const e=i.find(e=>e.id===t);return Promise.resolve(e)};e.getProductById=s;e["default"]={listProducts:a,getProductById:s}},8224:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"account-products"},[e("div",{staticClass:"toolbar"},[t._m(0),e("div",{staticClass:"right-area"},[e("el-input",{staticClass:"mr-12",staticStyle:{width:"280px"},attrs:{placeholder:t.searchPlaceholder,size:"small",clearable:""},on:{clear:t.handleClear},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleSearch.apply(null,arguments)}},model:{value:t.searchKeyword,callback:function(e){t.searchKeyword=e},expression:"searchKeyword"}}),e("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.handleSearch}},[t._v("搜索")]),e("el-button",{staticClass:"ml-8",attrs:{size:"small"},on:{click:t.handleReset}},[t._v("重置")])],1)]),t.payTypes&&t.payTypes.length?e("div",{staticClass:"paytypes-bar"},[e("span",{staticClass:"pt-label"},[t._v("支持结算方式:")]),e("div",{staticClass:"pt-icons"},t._l(t.payTypes,function(i,a){return e("el-tooltip",{key:a,attrs:{content:t.formatPayTypeHead(i),placement:"top","open-delay":80}},[e("img",{staticClass:"paytype-icon",attrs:{src:t.getPayImage(i),alt:t.formatPayTypeHead(i)}})])}),1)]):t._e(),e("div",{staticClass:"list-actions-row"},[e("div",{staticClass:"machine-type-switch"},[e("el-button",{class:{active:0===t.listParams.type},attrs:{size:"small",type:0===t.listParams.type?"primary":"default"},on:{click:function(e){return t.handleTypeChange(0)}}},[t._v(" ASIC ")]),e("el-button",{class:{active:1===t.listParams.type},attrs:{size:"small",type:1===t.listParams.type?"primary":"default"},on:{click:function(e){return t.handleTypeChange(1)}}},[t._v(" GPU ")])],1),0===t.listParams.type&&t.payTypes&&t.payTypes.length?e("div",{staticClass:"price-select-bar inline"},[e("span",{staticClass:"price-label"},[t._v("筛选售价:")]),e("el-select",{staticStyle:{width:"220px"},attrs:{size:"small",placeholder:"选择价格展示币种"},on:{change:t.handlePayTypeChange},model:{value:t.selectedPayKey,callback:function(e){t.selectedPayKey=e},expression:"selectedPayKey"}},[e("template",{slot:"prefix"},[t.getSelectedPayImage()?e("img",{staticClass:"paytype-icon",staticStyle:{width:"16px",height:"16px","border-radius":"3px","margin-right":"6px"},attrs:{src:t.getSelectedPayImage()}}):t._e()]),t._l(t.payTypes,function(i,a){return e("el-option",{key:"pt-opt-top-"+a,attrs:{label:t.formatPayTypeHead(i),value:t.buildPayKey(i)}},[e("span",{staticStyle:{display:"inline-flex","align-items":"center",gap:"6px"}},[e("img",{staticClass:"paytype-icon",attrs:{src:t.getPayImage(i)}}),e("span",[t._v(t._s(t.formatPayTypeHead(i)))])])])})],2)],1):t._e()]),0===t.listParams.type?e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],key:"asic-table",staticStyle:{width:"100%"},attrs:{data:t.shopMachineList||[],border:"",stripe:""}},[e("el-table-column",{attrs:{label:"矿机类型",width:"100"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-tag",{attrs:{type:0==i.row.type?"warning":"success"}},[t._v(" "+t._s(0==i.row.type?"ASIC":"GPU")+" ")])]}}],null,!1,1255276155)}),e("el-table-column",{attrs:{label:"币种","min-width":"140","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(i){return[e("div",{staticClass:"ellipsis-cell"},[t._v(t._s(t.getRowCoinText(i.row)))])]}}],null,!1,3296547820)}),e("el-table-column",{attrs:{label:"算法","min-width":"160","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(i){return[e("div",{staticClass:"ellipsis-cell"},[t._v(t._s(t.getRowAlgorithmText(i.row)))])]}}],null,!1,1057179176)}),e("el-table-column",{attrs:{prop:"name",label:"矿机型号","show-overflow-tooltip":""}}),e("el-table-column",{attrs:{label:"理论算力","min-width":"170","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(i){return[e("div",{staticClass:"ellipsis-cell"},[t._v(t._s(t.getTheoryText(i.row)))])]}}],null,!1,4122576080)}),e("el-table-column",{attrs:{label:"功耗(kw/h)","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",[t._v(t._s(t.getPowerDissText(i.row)))])]}}],null,!1,2386465872)}),e("el-table-column",{attrs:{prop:"saleNumbers",width:"70",label:"总机器数量"}}),e("el-table-column",{attrs:{prop:"saleOutNumbers",label:"已售数量"}}),e("el-table-column",{attrs:{prop:"maxLeaseDays",width:"70",label:"最大租赁天数"}}),e("el-table-column",{scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",{staticClass:"price-strong"},[t._v(t._s(t.getRowPriceText(i.row)))])]}}],null,!1,1822165360)},[e("template",{slot:"header"},[e("div",{staticStyle:{display:"flex","align-items":"center",gap:"8px"}},[e("span",[t._v("售价")])])])],2),e("el-table-column",{attrs:{label:"状态",width:"80"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-tag",{attrs:{type:0===i.row.state?"success":"info"}},[t._v(" "+t._s(0===i.row.state?"上架":"下架")+" ")])]}}],null,!1,4131197732)}),e("el-table-column",{attrs:{label:"操作",fixed:"right",width:"140"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-button",{attrs:{type:"text",size:"small",disabled:1===Number(i.row.saleState)},on:{click:function(e){return t.handleEdit(i.row)}}},[t._v("修改")]),e("el-button",{staticStyle:{color:"#f56c6c"},attrs:{type:"text",size:"small"},on:{click:function(e){return t.handleDelete(i.row)}}},[t._v("删除")])]}}],null,!1,425743758)})],1):e("el-table",{key:"gpu-table-"+String(t.listParams.type),staticStyle:{width:"100%"},attrs:{data:t.shopMachineList||[],border:"",stripe:""}},[e("el-table-column",{attrs:{label:"矿机类型",width:"100"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-tag",{attrs:{type:1==i.row.type?"success":"warning"}},[t._v(" "+t._s(1==i.row.type?"GPU":"ASIC")+" ")])]}}])}),e("el-table-column",{attrs:{prop:"miner",label:"矿机编号","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",[t._v(t._s(i.row.miner||"-"))])]}}])}),e("el-table-column",{attrs:{prop:"name",label:"显卡型号","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",[t._v(t._s(i.row.name||"-"))])]}}])}),e("el-table-column",{attrs:{label:"状态",width:"120"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("div",{staticClass:"gpu-state"},[e("el-switch",{attrs:{"active-value":0,"inactive-value":1,value:null!=(t.updateMap[t.getRowId(i.row)]&&t.updateMap[t.getRowId(i.row)].state)?t.updateMap[t.getRowId(i.row)].state:1,disabled:1===Number(i.row.saleState)},on:{change:function(e){return t.handleToggleState(i.row,e)}}}),e("span",{staticClass:"gpu-state-text",class:{on:0===(t.updateMap[t.getRowId(i.row)]&&t.updateMap[t.getRowId(i.row)].state)}},[t._v(" "+t._s(0===(t.updateMap[t.getRowId(i.row)]&&t.updateMap[t.getRowId(i.row)].state)?"上架":"下架")+" ")])],1)]}}])}),e("el-table-column",{attrs:{label:"售价",width:"220"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("div",{staticClass:"gpu-price-row"},t._l(t.payTypes,function(a,s){return e("div",{key:s,staticClass:"gpu-price-item"},[e("span",{staticClass:"gpu-price-label"},[t._v(t._s(t.formatPayTypeHead(a)))]),e("el-input",{staticClass:"gpu-price-input",staticStyle:{width:"100px"},attrs:{size:"small",value:t.getPriceValue(t.getRowId(i.row),a),placeholder:"价格",disabled:1===Number(i.row.saleState)},on:{input:function(e){return t.handlePriceInput(i.row,a,e)},blur:function(e){return t.handlePriceBlur(i.row,a)}}})],1)}),0)]}}])}),e("el-table-column",{attrs:{label:"最大租赁天数",width:"80"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-input",{attrs:{size:"small",value:String(t.updateMap[t.getRowId(i.row)]&&t.updateMap[t.getRowId(i.row)].maxLeaseDays||""),placeholder:"1-365",disabled:1===Number(i.row.saleState)},on:{input:function(e){return t.handleMaxLeaseDaysInput(i.row,e)}}})]}}])}),e("el-table-column",{attrs:{label:"操作",fixed:"right",width:"120"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-button",{staticStyle:{color:"#f56c6c"},attrs:{type:"text",size:"small",disabled:1===Number(i.row.saleState)},on:{click:function(e){return t.handleDelete(i.row)}}},[t._v("删除")])]}}])})],1),0===t.listParams.type?e("div",{staticClass:"pagination"},[e("el-pagination",{attrs:{background:"",layout:"total, sizes, prev, pager, next, jumper",total:t.total,"current-page":t.pagination.pageNum,"page-sizes":[10,20,50,100],"page-size":t.pagination.pageSize},on:{"update:currentPage":function(e){return t.$set(t.pagination,"pageNum",e)},"update:current-page":function(e){return t.$set(t.pagination,"pageNum",e)},"update:pageSize":function(e){return t.$set(t.pagination,"pageSize",e)},"update:page-size":function(e){return t.$set(t.pagination,"pageSize",e)},"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1):e("div",{staticStyle:{"margin-top":"12px",display:"flex","justify-content":"space-between","align-items":"center"}},[e("el-button",{attrs:{type:"primary"},on:{click:t.handleUpdateGpu}},[t._v("更新商品信息")]),e("el-pagination",{attrs:{background:"",layout:"total, sizes, prev, pager, next, jumper",total:t.total,"current-page":t.pagination.pageNum,"page-sizes":[10,20,50,100],"page-size":t.pagination.pageSize},on:{"update:currentPage":function(e){return t.$set(t.pagination,"pageNum",e)},"update:current-page":function(e){return t.$set(t.pagination,"pageNum",e)},"update:pageSize":function(e){return t.$set(t.pagination,"pageSize",e)},"update:page-size":function(e){return t.$set(t.pagination,"pageSize",e)},"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1),e("el-dialog",{attrs:{visible:t.editDialog.visible,"close-on-click-modal":!1,width:"70VW",title:"编辑商品 - "+(t.editDialog.form&&t.editDialog.form.name?t.editDialog.form.name:"")},on:{"update:visible":function(e){return t.$set(t.editDialog,"visible",e)}},scopedSlots:t._u([{key:"footer",fn:function(){return[e("el-button",{on:{click:function(e){t.editDialog.visible=!1}}},[t._v("取消")]),e("el-button",{attrs:{type:"primary",loading:t.editDialog.saving},on:{click:t.handleSaveEdit}},[t._v("确认修改")])]},proxy:!0}])},[t.editDialog.form?e("el-form",{ref:"editForm",staticClass:"edit-form",attrs:{model:t.editDialog.form,"label-width":"160px"}},[e("el-form-item",{attrs:{label:"矿机型号"}},[e("el-input",{attrs:{maxlength:"60"},model:{value:t.editDialog.form.name,callback:function(e){t.$set(t.editDialog.form,"name","string"===typeof e?e.trim():e)},expression:"editDialog.form.name"}})],1),e("el-form-item",{attrs:{label:"币种/算法/算力/单位"}},[e("div",{staticClass:"coin-algo-rows"},t._l(t.editDialog.form.coinAndAlgoList,function(i,a){return e("div",{key:"edit-ca-"+a,staticClass:"coin-algo-line"},[e("el-select",{staticClass:"coin-input",attrs:{placeholder:"请选择币种",loading:t.loadingCoins,filterable:"",clearable:""},on:{change:function(e){return t.editHandleCoinChange(a,e)}},model:{value:i.coin,callback:function(e){t.$set(i,"coin",e)},expression:"row.coin"}},t._l(t.coinOptions,function(t){return e("el-option",{key:t,attrs:{label:t,value:t}})}),1),e("el-select",{staticClass:"algo-input",attrs:{placeholder:"请选择算法",loading:t.loadingAlgos[a],disabled:!i.coin,filterable:"",clearable:""},model:{value:i.algorithm,callback:function(e){t.$set(i,"algorithm",e)},expression:"row.algorithm"}},t._l(t.algoOptionsMap[i.coin]||[],function(t){return e("el-option",{key:t,attrs:{label:t,value:t}})}),1),e("el-input",{staticClass:"power-input",attrs:{placeholder:"理论算力",inputmode:"decimal"},on:{input:function(e){return t.editHandleRowTheoryInput(a)}},model:{value:i.theoryPower,callback:function(e){t.$set(i,"theoryPower",e)},expression:"row.theoryPower"}}),e("el-select",{staticClass:"unit-select",attrs:{placeholder:"单位"},on:{change:function(e){return t.editHandleRowUnitChange(a,e)}},model:{value:i.unit,callback:function(e){t.$set(i,"unit",e)},expression:"row.unit"}},[e("el-option",{attrs:{label:"KH/S",value:"KH/S"}}),e("el-option",{attrs:{label:"MH/S",value:"MH/S"}}),e("el-option",{attrs:{label:"GH/S",value:"GH/S"}}),e("el-option",{attrs:{label:"TH/S",value:"TH/S"}}),e("el-option",{attrs:{label:"PH/S",value:"PH/S"}})],1),e("el-button",{staticClass:"op-btn",attrs:{type:"primary",icon:"el-icon-plus",circle:"","aria-label":"新增一行"},on:{click:t.editHandleAddRow}}),(t.editDialog.form.coinAndAlgoList||[]).length>1?e("el-button",{staticClass:"op-btn",attrs:{icon:"el-icon-minus",circle:"","aria-label":"删除该行"},on:{click:function(e){return t.editHandleRemoveRow(a)}}}):t._e()],1)}),0)]),e("el-form-item",{attrs:{label:"最大租赁天数"}},[e("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"1-365"},on:{input:function(e){t.editDialog.form.maxLeaseDays=String(t.editDialog.form.maxLeaseDays||"").replace(/[^\d]/g,"")}},model:{value:t.editDialog.form.maxLeaseDays,callback:function(e){t.$set(t.editDialog.form,"maxLeaseDays",e)},expression:"editDialog.form.maxLeaseDays"}})],1),e("el-form-item",{staticClass:"align-like-input",attrs:{label:"状态"}},[e("el-radio-group",{model:{value:t.editDialog.form.state,callback:function(e){t.$set(t.editDialog.form,"state",e)},expression:"editDialog.form.state"}},[e("el-radio",{attrs:{label:0}},[t._v("上架")]),e("el-radio",{attrs:{label:1}},[t._v("下架")])],1)],1),e("el-form-item",{attrs:{label:"功耗(kw/h)"}},[e("el-input",{staticStyle:{width:"200px"},attrs:{type:"number",min:"0",step:"0.00000001",inputmode:"decimal",placeholder:"功耗"},on:{input:function(e){t.editDialog.form.powerDissipation=t.normalizePowerInput(t.editDialog.form.powerDissipation)}},model:{value:t.editDialog.form.powerDissipation,callback:function(e){t.$set(t.editDialog.form,"powerDissipation",e)},expression:"editDialog.form.powerDissipation"}})],1),e("el-form-item",{attrs:{label:"出售数量(台)"}},[e("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"整数"},on:{input:function(e){t.editDialog.form.saleNumbers=t.normalizeSaleNumbersInput(t.editDialog.form.saleNumbers)}},model:{value:t.editDialog.form.saleNumbers,callback:function(e){t.$set(t.editDialog.form,"saleNumbers",e)},expression:"editDialog.form.saleNumbers"}})],1),e("el-form-item",{attrs:{label:"售价(多币种)"}},[e("div",{staticClass:"gpu-price-row"},t._l(t.editDialog.priceList,function(i,a){return e("div",{key:"ep-"+a,staticClass:"gpu-price-item"},[e("span",{staticClass:"gpu-price-label"},[t._v(t._s(t.formatPayTypeHead(i)))]),e("el-input",{staticClass:"gpu-price-input",attrs:{size:"small",value:i.price,placeholder:"价格"},on:{input:function(e){return t.handleEditPriceInput(a,e)}}})],1)}),0)])],1):t._e()],1)],1)},e.Yp=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"left-area"},[e("h2",{staticClass:"page-title"},[t._v("商品列表")])])}]},8235:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(5367),s=i(1507),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"6b6c93c3",null),l=n.exports},8284:function(t,e,i){Object.defineProperty(e,"B",{value:!0}),e.A=void 0,i(8111),i(2489);var a=i(6299);e.A={name:"WithdrawalHistory",data(){return{activeTab:"pending",detailDialogVisible:!1,selectedItem:null,withdrawalRecords:[],pagination:{pageNum:1,pageSize:10,totalPage:0},loading:!1,statusFilter:"",total:0,pageSizes:[10,20,50],currentPage:1}},computed:{pendingWithdrawals(){return this.withdrawalRecords.filter(t=>2===t.status)},successWithdrawals(){return this.withdrawalRecords.filter(t=>1===t.status)},failedWithdrawals(){return this.withdrawalRecords.filter(t=>0===t.status)}},mounted(){this.activeTab="pending",this.statusFilter=2,this.loadWithdrawalRecords()},methods:{async fetchBalanceWithdrawList(t={}){try{const e={pageNum:1,pageSize:20,...t};console.log("获取提现记录参数:",e);const i=await(0,a.balanceWithdrawList)(e);!i||0!==i.code&&200!==i.code?this.$message({message:i?.msg||"获取提现记录失败",type:"error",showClose:!0}):(this.withdrawalRecords=i.rows||[],this.pagination.totalPage=i.totalPage||0,this.total=i.total||0,console.log("提现记录获取成功:",{records:this.withdrawalRecords,pagination:this.pagination}))}catch(e){console.error("获取提现记录失败:",e)}},async loadWithdrawalRecords(){this.loading=!0;try{const t={pageNum:this.pagination.pageNum,pageSize:this.pagination.pageSize};""!==this.statusFilter&&(t.status=this.statusFilter),await this.fetchBalanceWithdrawList(t)}finally{this.loading=!1}},handleTabClick(t){this.activeTab=t.name,"pending"===t.name?this.statusFilter=2:"success"===t.name?this.statusFilter=1:"failed"===t.name&&(this.statusFilter=0),this.currentPage=1,this.pagination.pageSize=10,this.pagination.pageNum=1,this.loadWithdrawalRecords()},showDetail(t){this.selectedItem=t,this.detailDialogVisible=!0},closeDetail(){this.detailDialogVisible=!1,this.selectedItem=null},getChainName(t){const e={tron:"Tron (TRC20)",ethereum:"Ethereum (ERC20)",bsc:"BSC (BEP20)",polygon:"Polygon (MATIC)"};return e[t]||t},getStatusType(t){const e={0:"danger",1:"success",2:"warning"};return e[t]||"info"},formatAddress(t){return t?t.length>20?`${t.slice(0,10)}...${t.slice(-10)}`:t:""},formatTime(t){if(!t)return"";const e=new Date(t),i=new Date,a=i-e;return a<6e4?"刚刚":a<36e5?`${Math.floor(a/6e4)}分钟前`:a<864e5?`${Math.floor(a/36e5)}小时前`:e.toLocaleDateString()},formatFullTime(t){return t?new Date(t).toLocaleString("zh-CN"):""},copyAddress(t){navigator.clipboard?navigator.clipboard.writeText(t).then(()=>{this.$message.success("地址已复制到剪贴板")}).catch(()=>{this.fallbackCopyAddress(t)}):this.fallbackCopyAddress(t)},fallbackCopyAddress(t){const e=document.createElement("textarea");e.value=t,document.body.appendChild(e),e.select();try{document.execCommand("copy"),this.$message.success("地址已复制到剪贴板")}catch(i){this.$message.error("复制失败,请手动复制")}document.body.removeChild(e)},viewOnExplorer(t,e){const i={tron:`https://tronscan.org/#/transaction/${t}`,ethereum:`https://etherscan.io/tx/${t}`,bsc:`https://bscscan.com/tx/${t}`,polygon:`https://polygonscan.com/tx/${t}`},a=i[e];a?window.open(a,"_blank"):this.$message.error("不支持的区块链网络")},refreshData(){this.loadWithdrawalRecords()},getStatusText(t){const e={0:"提现失败",1:"提现成功",2:"提现中"};return e[t]||"未知状态"},handleSizeChange(t){console.log(`每页 ${t} 条`),this.pagination.pageSize=t,this.pagination.pageNum=1,this.currentPage=1,this.loadWithdrawalRecords()},handleCurrentChange(t){console.log(`当前页: ${t}`),this.pagination.pageNum=t,this.loadWithdrawalRecords()}}}},8285:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"recharge-record-container"},[t._m(0),e("div",{staticClass:"tab-container"},[e("el-tabs",{on:{"tab-click":t.handleTabClick},model:{value:t.activeTab,callback:function(e){t.activeTab=e},expression:"activeTab"}},[e("el-tab-pane",{attrs:{label:"充值中",name:"pending"}},[e("div",{staticClass:"tab-content"},[e("div",{staticClass:"list-header"},[e("span",{staticClass:"list-title"},[t._v("充值中 ("+t._s(t.pendingRecharges.length)+")")]),e("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.refreshData}},[e("i",{staticClass:"el-icon-refresh"}),t._v(" 刷新 ")])],1),e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"recharge-list"},[t._l(t.pendingRecharges,function(i){return e("div",{key:i.id,staticClass:"recharge-item pending",on:{click:function(e){return t.showDetail(i)}}},[e("div",{staticClass:"item-main"},[e("div",{staticClass:"item-left"},[e("div",{staticClass:"amount"},[t._v(" "+t._s(i.amount)+" "+t._s(i.fromSymbol||"")+" ")]),e("div",{staticClass:"chain"},[t._v(t._s(t.getChainName(i.fromChain)))])]),e("div",{staticClass:"item-right"},[e("div",{staticClass:"status pending-status"},[e("i",{staticClass:"el-icon-loading"}),t._v(" "+t._s(t.getStatusText(i.status))+" ")]),e("div",{staticClass:"time"},[t._v(t._s(t.formatTime(i.createTime)))])])]),e("div",{staticClass:"item-footer"},[e("div",{staticClass:"footer-left"},[e("span",{staticClass:"address"},[t._v(t._s(t.formatAddress(i.address)))]),i.txHash?e("span",{staticClass:"tx-hash"},[e("i",{staticClass:"el-icon-link"}),t._v(" "+t._s(t.formatAddress(i.txHash))+" ")]):t._e()]),e("i",{staticClass:"el-icon-arrow-right"})])])}),0===t.pendingRecharges.length?e("div",{staticClass:"empty-state"},[e("i",{staticClass:"el-icon-document"}),e("p",[t._v("暂无充值中的记录")])]):t._e()],2)])]),e("el-tab-pane",{attrs:{label:"充值成功",name:"success"}},[e("div",{staticClass:"tab-content"},[e("div",{staticClass:"list-header"},[e("span",{staticClass:"list-title"},[t._v("充值成功 ("+t._s(t.successRecharges.length)+")")]),e("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.refreshData}},[e("i",{staticClass:"el-icon-refresh"}),t._v(" 刷新 ")])],1),e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"recharge-list"},[t._l(t.successRecharges,function(i){return e("div",{key:i.id,staticClass:"recharge-item success",on:{click:function(e){return t.showDetail(i)}}},[e("div",{staticClass:"item-main"},[e("div",{staticClass:"item-left"},[e("div",{staticClass:"amount"},[t._v(" "+t._s(i.amount)+" "+t._s(i.fromSymbol||"")+" ")]),e("div",{staticClass:"chain"},[t._v(t._s(t.getChainName(i.fromChain)))])]),e("div",{staticClass:"item-right"},[e("div",{staticClass:"status success-status"},[e("i",{staticClass:"el-icon-check"}),t._v(" "+t._s(t.getStatusText(i.status))+" ")]),e("div",{staticClass:"time"},[t._v(t._s(t.formatTime(i.createTime)))])])]),e("div",{staticClass:"item-footer"},[e("div",{staticClass:"footer-left"},[e("span",{staticClass:"address"},[t._v(t._s(t.formatAddress(i.address)))]),i.txHash?e("span",{staticClass:"tx-hash"},[e("i",{staticClass:"el-icon-link"}),t._v(" "+t._s(t.formatAddress(i.txHash))+" ")]):t._e()]),e("i",{staticClass:"el-icon-arrow-right"})])])}),0===t.successRecharges.length?e("div",{staticClass:"empty-state"},[e("i",{staticClass:"el-icon-document"}),e("p",[t._v("暂无充值成功的记录")])]):t._e()],2)])]),e("el-tab-pane",{attrs:{label:"充值失败",name:"failed"}},[e("div",{staticClass:"tab-content"},[e("div",{staticClass:"list-header"},[e("span",{staticClass:"list-title"},[t._v("充值失败 ("+t._s(t.failedRecharges.length)+")")]),e("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.refreshData}},[e("i",{staticClass:"el-icon-refresh"}),t._v(" 刷新 ")])],1),e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"recharge-list"},[t._l(t.failedRecharges,function(i){return e("div",{key:i.id,staticClass:"recharge-item failed",on:{click:function(e){return t.showDetail(i)}}},[e("div",{staticClass:"item-main"},[e("div",{staticClass:"item-left"},[e("div",{staticClass:"amount"},[t._v(" "+t._s(i.amount)+" "+t._s(i.fromSymbol||"")+" ")]),e("div",{staticClass:"chain"},[t._v(t._s(t.getChainName(i.fromChain)))])]),e("div",{staticClass:"item-right"},[e("div",{staticClass:"status failed-status"},[e("i",{staticClass:"el-icon-close"}),t._v(" "+t._s(t.getStatusText(i.status))+" ")]),e("div",{staticClass:"time"},[t._v(t._s(t.formatTime(i.createTime)))])])]),e("div",{staticClass:"item-footer"},[e("div",{staticClass:"footer-left"},[e("span",{staticClass:"address"},[t._v(t._s(t.formatAddress(i.address)))]),i.txHash?e("span",{staticClass:"tx-hash"},[e("i",{staticClass:"el-icon-link"}),t._v(" "+t._s(t.formatAddress(i.txHash))+" ")]):t._e()]),e("i",{staticClass:"el-icon-arrow-right"})])])}),0===t.failedRecharges.length?e("div",{staticClass:"empty-state"},[e("i",{staticClass:"el-icon-document"}),e("p",[t._v("暂无充值失败的记录")])]):t._e()],2)])])],1),e("el-row",[e("el-col",{staticStyle:{display:"flex","justify-content":"center"},attrs:{span:24}},[e("el-pagination",{staticStyle:{margin:"0 auto","margin-top":"10px"},attrs:{"current-page":t.currentPage,"page-sizes":t.pageSizes,"page-size":t.pagination.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:t.total},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange,"update:currentPage":function(e){t.currentPage=e},"update:current-page":function(e){t.currentPage=e}}})],1)],1)],1),e("el-dialog",{attrs:{title:"充值详情",visible:t.detailDialogVisible,width:"600px"},on:{"update:visible":function(e){t.detailDialogVisible=e},close:t.closeDetail}},[t.selectedItem?e("div",{staticClass:"detail-content"},[e("div",{staticClass:"detail-section"},[e("h3",{staticClass:"section-title"},[t._v("基本信息")]),e("div",{staticClass:"detail-list"},[e("div",{staticClass:"detail-row"},[e("span",{staticClass:"detail-label"},[t._v("充值ID")]),e("span",{staticClass:"detail-value"},[t._v(t._s(t.selectedItem.id))])]),e("div",{staticClass:"detail-row"},[e("span",{staticClass:"detail-label"},[t._v("充值金额")]),e("span",{staticClass:"detail-value amount"},[t._v(t._s(t.selectedItem.amount)+" "+t._s(t.selectedItem.fromSymbol||""))])]),e("div",{staticClass:"detail-row"},[e("span",{staticClass:"detail-label"},[t._v("区块链网络")]),e("span",{staticClass:"detail-value"},[t._v(t._s(t.getChainName(t.selectedItem.fromChain)))])]),e("div",{staticClass:"detail-row"},[e("span",{staticClass:"detail-label"},[t._v("充值状态")]),e("span",{staticClass:"detail-value"},[e("el-tag",{attrs:{type:t.getStatusType(t.selectedItem.status)}},[t._v(" "+t._s(t.getStatusText(t.selectedItem.status))+" ")])],1)])])]),e("div",{staticClass:"detail-section"},[e("h3",{staticClass:"section-title"},[t._v("地址信息")]),e("div",{staticClass:"detail-list"},[e("div",{staticClass:"detail-row"},[e("span",{staticClass:"detail-label"},[t._v("充值地址")]),e("div",{staticClass:"address-container"},[e("span",{staticClass:"detail-value address"},[t._v(t._s(t.selectedItem.address))]),e("el-button",{attrs:{type:"text",size:"small"},on:{click:function(e){return t.copyAddress(t.selectedItem.address)}}},[t._v(" 复制 ")])],1)]),t.selectedItem.txHash?e("div",{staticClass:"detail-row"},[e("span",{staticClass:"detail-label"},[t._v("交易哈希")]),e("div",{staticClass:"address-container"},[e("span",{staticClass:"detail-value address"},[t._v(t._s(t.selectedItem.txHash))]),e("el-button",{attrs:{type:"text",size:"small"},on:{click:function(e){return t.copyAddress(t.selectedItem.txHash)}}},[t._v(" 复制 ")])],1)]):t._e()])]),e("div",{staticClass:"detail-section"},[e("h3",{staticClass:"section-title"},[t._v("时间信息")]),e("div",{staticClass:"detail-list"},[e("div",{staticClass:"detail-row"},[e("span",{staticClass:"detail-label"},[t._v("充值时间")]),e("span",{staticClass:"detail-value"},[t._v(t._s(t.formatFullTime(t.selectedItem.createTime)))])])])])]):t._e(),e("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:t.closeDetail}},[t._v("关闭")])],1)])],1)},e.Yp=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"page-header"},[e("h1",{staticClass:"page-title"},[t._v("充值记录")]),e("p",{staticClass:"page-subtitle"},[t._v("查看您的充值申请和到账状态")])])}]},8452:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"funds-page"},[e("h3",{staticClass:"title",staticStyle:{"margin-bottom":"18px","text-align":"left"}},[t._v("资金流水")]),e("div",{staticClass:"tabs-card"},[e("el-tabs",{on:{"tab-click":t.handleTab},model:{value:t.active,callback:function(e){t.active=e},expression:"active"}},[e("el-tab-pane",{attrs:{label:"充值记录",name:"recharge"}},[e("div",{staticClass:"list-wrap"},[e("div",{staticClass:"list-header"},[e("span",{staticClass:"list-title"},[t._v("全部充值 ("+t._s(t.rechargeRows.length)+")")]),e("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.loadRecharge}},[t._v("刷新")])],1),e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading.recharge,expression:"loading.recharge"}],staticClass:"record-list"},[t._l(t.rechargeRows,function(i,a){return e("div",{key:t.getRowKey(i,a),staticClass:"record-item",class:t.statusClass(i.status),on:{click:function(e){return t.toggleExpand("recharge",i,a)}}},[e("div",{staticClass:"item-main"},[e("div",{staticClass:"item-left"},[e("div",{staticClass:"amount"},[t.formatAmount(i.amount,i.fromSymbol).truncated?e("el-tooltip",{attrs:{content:`${t.formatAmount(i.amount,i.fromSymbol).full} ${(i.fromSymbol||"").toUpperCase()}`,placement:"top"}},[e("span",[t._v(" + "+t._s(t.formatAmount(i.amount,i.fromSymbol).text)+" "+t._s((i.fromSymbol||"").toUpperCase())+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(" + "+t._s(t.formatAmount(i.amount,i.fromSymbol).text)+" "+t._s((i.fromSymbol||"").toUpperCase())+" ")])],1),e("div",{staticClass:"chain"},[t._v(t._s(t.formatChain(i.fromChain)))])]),e("div",{staticClass:"item-right"},[e("div",{staticClass:"status"},[e("el-tag",{attrs:{type:t.getRechargeStatusType(i.status),size:"small"}},[t._v(t._s(t.getRechargeStatusText(i.status)))])],1),e("div",{staticClass:"time"},[t._v(t._s(t.formatFullTime(i.createTime)))])])]),e("div",{directives:[{name:"show",rawName:"v-show",value:t.isExpanded("recharge",i,a),expression:"isExpanded('recharge', row, idx)"}],staticClass:"expand-panel"},[e("div",{staticClass:"expand-grid"},[e("div",{staticClass:"expand-item"},[e("span",{staticClass:"label"},[t._v("充值地址")]),e("div",{staticClass:"value value-row"},[e("span",{staticClass:"mono-ellipsis",attrs:{title:i.fromAddress}},[t._v(t._s(i.fromAddress))]),e("el-button",{attrs:{type:"text",size:"mini",icon:"el-icon-document-copy"},on:{click:function(e){return e.stopPropagation(),t.handleCopy(i.fromAddress,"充值地址")}}},[t._v("复制")])],1)]),i.txHash?e("div",{staticClass:"expand-item"},[e("span",{staticClass:"label"},[t._v("交易哈希")]),e("div",{staticClass:"value value-row"},[e("span",{staticClass:"mono-ellipsis",attrs:{title:i.txHash}},[t._v(t._s(i.txHash))]),e("el-button",{attrs:{type:"text",size:"mini",icon:"el-icon-document-copy"},on:{click:function(e){return e.stopPropagation(),t.handleCopy(i.txHash,"交易哈希")}}},[t._v("复制")])],1)]):t._e()])])])}),t.rechargeRows.length?t._e():e("div",{staticClass:"empty"},[t._v("暂无充值记录")])],2)])]),e("el-tab-pane",{attrs:{label:"提现记录",name:"withdraw"}},[e("div",{staticClass:"list-wrap"},[e("div",{staticClass:"list-header"},[e("span",{staticClass:"list-title"},[t._v("全部提现 ("+t._s(t.withdrawRows.length)+")")]),e("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.loadWithdraw}},[t._v("刷新")])],1),e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading.withdraw,expression:"loading.withdraw"}],staticClass:"record-list"},[t._l(t.withdrawRows,function(i,a){return e("div",{key:t.getRowKey(i,a),staticClass:"record-item",class:t.statusClass(i.status),on:{click:function(e){return t.toggleExpand("withdraw",i,a)}}},[e("div",{staticClass:"item-main"},[e("div",{staticClass:"item-left"},[e("div",{staticClass:"amount"},[t.formatAmount(i.amount,i.toSymbol).truncated?e("el-tooltip",{attrs:{content:`${t.formatAmount(i.amount,i.toSymbol).full} ${(i.toSymbol||"").toUpperCase()}`,placement:"top"}},[e("span",[t._v(" - "+t._s(t.formatAmount(i.amount,i.toSymbol).text)+" "+t._s((i.toSymbol||"").toUpperCase())+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(" - "+t._s(t.formatAmount(i.amount,i.toSymbol).text)+" "+t._s((i.toSymbol||"").toUpperCase())+" ")])],1),e("div",{staticClass:"chain"},[t._v(t._s(t.formatChain(i.toChain)))])]),e("div",{staticClass:"item-right"},[e("div",{staticClass:"status"},[e("el-tag",{attrs:{type:t.getWithdrawStatusType(i.status),size:"small"}},[t._v(t._s(t.getWithdrawStatusText(i.status)))])],1),e("div",{staticClass:"time"},[t._v(t._s(t.formatFullTime(i.createTime)))])])]),e("div",{directives:[{name:"show",rawName:"v-show",value:t.isExpanded("withdraw",i,a),expression:"isExpanded('withdraw', row, idx)"}],staticClass:"expand-panel"},[e("div",{staticClass:"expand-grid"},[e("div",{staticClass:"expand-item"},[e("span",{staticClass:"label"},[t._v("收款地址")]),e("div",{staticClass:"value value-row"},[e("span",{staticClass:"mono-ellipsis",attrs:{title:i.toAddress}},[t._v(t._s(i.toAddress))]),e("el-button",{attrs:{type:"text",size:"mini",icon:"el-icon-document-copy"},on:{click:function(e){return e.stopPropagation(),t.handleCopy(i.toAddress,"收款地址")}}},[t._v("复制")])],1)]),i.txHash?e("div",{staticClass:"expand-item"},[e("span",{staticClass:"label"},[t._v("交易哈希")]),e("div",{staticClass:"value value-row"},[e("span",{staticClass:"mono-ellipsis",attrs:{title:i.txHash}},[t._v(t._s(i.txHash))]),e("el-button",{attrs:{type:"text",size:"mini",icon:"el-icon-document-copy"},on:{click:function(e){return e.stopPropagation(),t.handleCopy(i.txHash,"交易哈希")}}},[t._v("复制")])],1)]):t._e()])])])}),t.withdrawRows.length?t._e():e("div",{staticClass:"empty"},[t._v("暂无提现记录")])],2)])]),e("el-tab-pane",{attrs:{label:"消费记录",name:"consume"}},[e("div",{staticClass:"list-wrap"},[e("div",{staticClass:"list-header"},[e("span",{staticClass:"list-title"},[t._v("全部消费 ("+t._s(t.consumeRows.length)+")")]),e("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.loadConsume}},[t._v("刷新")])],1),e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading.consume,expression:"loading.consume"}],staticClass:"record-list"},[t._l(t.consumeRows,function(i,a){return e("div",{key:t.getRowKey(i,a),staticClass:"record-item",class:t.statusClass(i.status),on:{click:function(e){return t.toggleExpand("consume",i,a)}}},[e("div",{staticClass:"item-main"},[e("div",{staticClass:"item-left"},[e("div",{staticClass:"amount"},[t.formatAmount(i.realAmount,i.fromSymbol).truncated?e("el-tooltip",{attrs:{content:`${t.formatAmount(i.realAmount,i.fromSymbol).full} ${(i.fromSymbol||"").toUpperCase()}`,placement:"top"}},[e("span",[t._v(" - "+t._s(t.formatAmount(i.realAmount,i.fromSymbol).text)+" "+t._s((i.fromSymbol||"").toUpperCase())+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(" - "+t._s(t.formatAmount(i.realAmount,i.fromSymbol).text)+" "+t._s((i.fromSymbol||"").toUpperCase())+" ")])],1),e("div",{staticClass:"chain"},[t._v(t._s(t.formatChain(i.fromChain)))])]),e("div",{staticClass:"item-right"},[e("div",{staticClass:"status"},[e("el-tag",{attrs:{type:t.getPayStatusType(i.status),size:"small"}},[t._v(t._s(t.getPayStatusText(i.status)))])],1),e("div",{staticClass:"time"},[t._v(t._s(t.formatFullTime(i.createTime||i.time)))])])]),e("div",{directives:[{name:"show",rawName:"v-show",value:t.isExpanded("consume",i,a),expression:"isExpanded('consume', row, idx)"}],staticClass:"expand-panel"},[e("div",{staticClass:"expand-grid"},[e("div",{staticClass:"expand-item"},[e("span",{staticClass:"label"},[t._v("订单号")]),e("div",{staticClass:"value value-row"},[e("span",{staticClass:"mono-ellipsis",attrs:{title:i.orderId}},[t._v(t._s(i.orderId||""))]),e("el-button",{attrs:{type:"text",size:"mini",icon:"el-icon-document-copy"},on:{click:function(e){return e.stopPropagation(),t.handleCopy(i.orderId,"订单号")}}},[t._v("复制")])],1)]),e("div",{staticClass:"expand-item"},[e("span",{staticClass:"label"},[t._v("支付地址")]),e("div",{staticClass:"value value-row"},[e("span",{staticClass:"mono-ellipsis",attrs:{title:i.fromAddress}},[t._v(t._s(i.fromAddress||""))]),e("el-button",{attrs:{type:"text",size:"mini",icon:"el-icon-document-copy"},on:{click:function(e){return e.stopPropagation(),t.handleCopy(i.fromAddress,"支付地址")}}},[t._v("复制")])],1)]),e("div",{staticClass:"expand-item"},[e("span",{staticClass:"label"},[t._v("收款地址")]),e("div",{staticClass:"value value-row"},[e("span",{staticClass:"mono-ellipsis",attrs:{title:i.toAddress}},[t._v(t._s(i.toAddress||""))]),e("el-button",{attrs:{type:"text",size:"mini",icon:"el-icon-document-copy"},on:{click:function(e){return e.stopPropagation(),t.handleCopy(i.toAddress,"收款地址")}}},[t._v("复制")])],1)]),i.txHash?e("div",{staticClass:"expand-item"},[e("span",{staticClass:"label"},[t._v("交易哈希")]),e("div",{staticClass:"value value-row"},[e("span",{staticClass:"mono-ellipsis",attrs:{title:i.txHash}},[t._v(t._s(i.txHash))]),e("el-button",{attrs:{type:"text",size:"mini",icon:"el-icon-document-copy"},on:{click:function(e){return e.stopPropagation(),t.handleCopy(i.txHash,"交易哈希")}}},[t._v("复制")])],1)]):t._e()])])])}),t.consumeRows.length?t._e():e("div",{staticClass:"empty"},[t._v("暂无消费记录")])],2)])])],1),e("el-row",[e("el-col",{staticStyle:{display:"flex","justify-content":"center"},attrs:{span:24}},[e("el-pagination",{staticStyle:{margin:"0 auto","margin-top":"10px"},attrs:{"current-page":t.currentPage,"page-sizes":t.pageSizes,"page-size":t.pagination.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:t.total},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange,"update:currentPage":function(e){t.currentPage=e},"update:current-page":function(e){t.currentPage=e}}})],1)],1)],1)])},e.Yp=[]},8466:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"account-product-detail"},[e("div",{staticClass:"header"},[e("el-button",{attrs:{type:"text"},on:{click:t.handleBack}},[t._v("返回")]),e("h2",{staticClass:"title"},[t._v("商品详情")])],1),e("el-card",{staticClass:"detail-card",attrs:{shadow:"never"}},[e("el-form",{staticClass:"detail-form",attrs:{model:t.product,"label-width":"90px",size:"small"}},[e("el-row",{attrs:{gutter:16}},[e("el-col",{attrs:{span:12}},[e("el-form-item",{attrs:{label:"商品ID"}},[e("el-input",{attrs:{value:t.product&&t.product.id,disabled:""}})],1)],1),e("el-col",{attrs:{span:12}},[e("el-form-item",{attrs:{label:"店铺ID"}},[e("el-input",{attrs:{value:t.product&&t.product.shopId,disabled:""}})],1)],1),e("el-col",{attrs:{span:12}},[e("el-form-item",{attrs:{label:"名称"}},[e("el-input",{attrs:{value:t.product&&t.product.name,disabled:""}})],1)],1),e("el-col",{attrs:{span:12}},[e("el-form-item",{attrs:{label:"币种"}},[e("el-input",{attrs:{value:t.product&&t.product.coin,disabled:""}})],1)],1),e("el-col",{attrs:{span:12}},[e("el-form-item",{attrs:{label:"算法"}},[e("el-input",{attrs:{value:t.product&&t.product.algorithm,disabled:""}})],1)],1),e("el-col",{attrs:{span:12}},[e("el-form-item",{attrs:{label:"类型"}},[e("el-input",{attrs:{value:t.product&&(1===t.product.type?"算力套餐":"挖矿机器"),disabled:""}})],1)],1),e("el-col",{attrs:{span:12}},[e("el-form-item",{attrs:{label:"状态"}},[e("el-input",{attrs:{value:t.product&&(1===t.product.state?"下架":"上架"),disabled:""}})],1)],1),e("el-col",{attrs:{span:12}}),e("el-col",{attrs:{span:24}},[e("el-form-item",{attrs:{label:"描述"}},[e("el-input",{attrs:{type:"textarea",rows:3,value:t.product&&t.product.description,disabled:""}})],1)],1)],1)],1)],1),e("el-card",{directives:[{name:"loading",rawName:"v-loading",value:t.updateLoading,expression:"updateLoading"}],staticClass:"detail-card",attrs:{shadow:"never"}},[e("div",{staticClass:"section-title",attrs:{slot:"header"},slot:"header"},[t._v("机器组合")]),t.machineList&&t.machineList.length?e("div",[e("el-table",{staticStyle:{width:"100%"},attrs:{data:t.machineList,border:"",stripe:""}},[e("el-table-column",{attrs:{prop:"user",label:"挖矿账户"}}),e("el-table-column",{attrs:{prop:"id",label:"矿机ID"}}),e("el-table-column",{attrs:{prop:"miner",label:"机器编号"}}),e("el-table-column",{attrs:{label:"实际算力",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.computingPower)+" "+t._s(e.row.unit||""))]}}],null,!1,881627289)},[e("template",{slot:"header"},[e("el-tooltip",{attrs:{content:"实际算力为该机器在本矿池过去24H的平均算力",effect:"dark",placement:"top"}},[e("i",{staticClass:"el-icon-question label-help",attrs:{"aria-label":"帮助",tabindex:"0"}})]),e("span",[t._v("实际算力")])],1)],2),e("el-table-column",{attrs:{label:"理论算力","min-width":"140"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-input",{class:{"changed-input":t.isCellChanged(i.row,"theoryPower")},staticStyle:{"max-width":"260px"},attrs:{size:"small",inputmode:"decimal",disabled:t.isRowDisabled(i.row)},on:{input:function(e){return t.handleTheoryPowerInput(i.$index)},blur:function(e){return t.handleTheoryPowerBlur(i.$index)}},model:{value:i.row.theoryPower,callback:function(e){t.$set(i.row,"theoryPower",e)},expression:"scope.row.theoryPower"}},[e("template",{slot:"append"},[e("el-select",{staticClass:"append-select append-select--unit",staticStyle:{width:"90px"},attrs:{size:"mini",disabled:t.isRowDisabled(i.row)},model:{value:i.row.unit,callback:function(e){t.$set(i.row,"unit",e)},expression:"scope.row.unit"}},t._l(t.unitOptions,function(t){return e("el-option",{key:t,attrs:{label:t,value:t}})}),1)],1)],2)]}}],null,!1,1615065668)}),e("el-table-column",{attrs:{label:"功耗(kw/h)"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-input",{class:{"changed-input":t.isCellChanged(i.row,"powerDissipation")},staticStyle:{"max-width":"260px"},attrs:{size:"small",inputmode:"decimal",disabled:t.isRowDisabled(i.row)},on:{input:function(e){return t.handleNumericCell(i.$index,"powerDissipation")},blur:function(e){return t.handlePowerDissipationBlur(i.$index)}},model:{value:i.row.powerDissipation,callback:function(e){t.$set(i.row,"powerDissipation",e)},expression:"scope.row.powerDissipation"}})]}}],null,!1,2013801812)}),e("el-table-column",{attrs:{label:"型号"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-input",{class:{"changed-input":t.isCellChanged(i.row,"type")},staticStyle:{"max-width":"180px"},attrs:{size:"small",maxlength:20,disabled:t.isRowDisabled(i.row)},on:{input:function(e){return t.handleTypeCell(i.$index)}},model:{value:i.row.type,callback:function(e){t.$set(i.row,"type",e)},expression:"scope.row.type"}})]}}],null,!1,4182654038)}),e("el-table-column",{attrs:{label:"售价",width:"188"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-input",{class:{"changed-input":t.isCellChanged(i.row,"price")},staticStyle:{"max-width":"260px"},attrs:{size:"small",inputmode:"decimal",disabled:t.isRowDisabled(i.row)},on:{input:function(e){return t.handleNumericCell(i.$index,"price")},blur:function(e){return t.handlePriceBlur(i.$index)}},model:{value:i.row._priceEditing,callback:function(e){t.$set(i.row,"_priceEditing",e)},expression:"scope.row._priceEditing"}},[e("template",{slot:"append"},[e("el-select",{staticClass:"append-select append-select--coin",staticStyle:{width:"120px"},attrs:{size:"mini"},on:{change:function(e){return t.handlePayTypeChange(i.$index)}},model:{value:i.row._selectedPayIndex,callback:function(e){t.$set(i.row,"_selectedPayIndex",e)},expression:"scope.row._selectedPayIndex"}},t._l(i.row.priceList||[],function(t,i){return e("el-option",{key:t.payTypeId||i,attrs:{label:[String(t.chain||"").toUpperCase(),String(t.coin||"").toUpperCase()].filter(Boolean).join("-"),value:i}})}),1)],1)],2)]}}],null,!1,3035245774)},[e("template",{slot:"header"},[e("el-tooltip",{attrs:{effect:"dark",placement:"top"}},[e("div",{attrs:{slot:"content"},slot:"content"},[t._v(" 卖家最终收款金额 = 机器售价 × 波动率"),e("br"),t._v(" 波动率规则:"),e("br"),t._v(" 1)0% - 5%(包含5%):波动率 = 1(按售价结算)"),e("br"),t._v(" 2)5%以上:波动率 = 实际算力 / 理论算力,且不会超过 1,即最终结算时不会超过机器售价 ")]),e("i",{staticClass:"el-icon-question label-help",attrs:{"aria-label":"帮助",tabindex:"0"}})]),e("span",[t._v("售价(按结算币种)")])],1)],2),e("el-table-column",{attrs:{label:"最大租赁天数(天)",width:"100"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-input",{class:{"changed-input":t.isCellChanged(i.row,"maxLeaseDays")},staticStyle:{"max-width":"260px"},attrs:{size:"small",inputmode:"numeric",disabled:t.isRowDisabled(i.row)},on:{input:function(e){return t.handleMaxLeaseDaysInput(i.$index)},blur:function(e){return t.handleMaxLeaseDaysBlur(i.$index)}},model:{value:i.row.maxLeaseDays,callback:function(e){t.$set(i.row,"maxLeaseDays",e)},expression:"scope.row.maxLeaseDays"}},[e("template",{slot:"append"},[t._v("天")])],2)]}}],null,!1,3414109227)}),e("el-table-column",{attrs:{label:"上下架","min-width":"140"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-switch",{attrs:{"active-value":0,"inactive-value":1,"active-text":"上架","inactive-text":"下架",disabled:t.isRowDisabled(i.row)},on:{change:function(e){return t.handleStateChange(i.$index)}},model:{value:i.row.state,callback:function(e){t.$set(i.row,"state",e)},expression:"scope.row.state"}})]}}],null,!1,1620801377)}),e("el-table-column",{attrs:{label:"售出状态","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-tag",{attrs:{type:0===i.row.saleState?"info":1===i.row.saleState?"danger":"warning"}},[t._v(" "+t._s(0===i.row.saleState?"未售出":1===i.row.saleState?"已售出":"售出中")+" ")])]}}],null,!1,1904393654)}),e("el-table-column",{attrs:{label:"操作",fixed:"right","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-button",{staticStyle:{color:"#f56c6c"},attrs:{type:"text",size:"small",disabled:t.isRowDisabled(i.row)},on:{click:function(e){return t.handleDeleteMachine(i.row)}}},[t._v("删除")])]}}],null,!1,979761678)})],1)],1):e("div",{staticClass:"empty-text"},[t._v("暂无组合数据")])]),t.machineList&&t.machineList.length?e("div",{staticClass:"actions"},[e("el-button",{attrs:{type:"primary"},on:{click:t.handleOpenConfirm}},[t._v("提交修改机器")])],1):t._e(),e("el-dialog",{attrs:{title:"确认提交修改",visible:t.confirmVisible,width:"520px"},on:{"update:visible":function(e){t.confirmVisible=e}}},[e("div",[e("p",[t._v("请仔细确认已选择机器机器组合里的机器价格及相关参数定义。")]),e("p",[t._v("机器修改上架后,一经售出,在机器出售期间不能修改价格及机器参数。")])]),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.confirmVisible=!1}}},[t._v("取消")]),e("el-button",{attrs:{type:"primary"},on:{click:t.handleSubmitMachines}},[t._v("确认提交修改")])],1)])],1)},e.Yp=[]},8567:function(t,e,i){Object.defineProperty(e,"B",{value:!0}),e.A=void 0,i(4114);var a=i(2549),s=i(6966),o=i(5720),r=i(2032);e.A={name:"LoginPage",data(){const t=(t,e,i)=>{if(!e)return void i(new Error("请输入邮箱"));const a=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;a.test(e)?i():i(new Error("请输入有效的邮箱地址"))},e=(0,r.createPasswordValidator)({emptyMessage:"请输入密码"});return{loginForm:{email:"",password:"",code:""},loginRules:{email:[{required:!0,validator:t,trigger:"blur"}],password:[{required:!0,validator:e,trigger:"blur"}],code:[{required:!0,message:"请输入验证码",trigger:"blur"},{min:1,max:10,message:"验证码长度为1-10位",trigger:"blur"}]},loading:!1,sendingCode:!1,countdown:0,timer:null}},mounted(){this.$route.query.email&&(this.loginForm.email=this.$route.query.email)},beforeDestroy(){this.timer&&(clearInterval(this.timer),this.timer=null)},methods:{goToShop(){"/productList"!==this.$route.path?this.$router.push("/productList"):this.$router.go(-1)},handleEmailChange(){this.loginForm.email=this.loginForm.email.trim()},async handleSendCode(){const t=(this.loginForm.email||"").trim();if(!t)return this.$message.warning("请输入邮箱地址"),void this.$refs.loginForm.validateField("email");const e=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;if(!e.test(t))return this.$message.warning("请输入有效的邮箱地址"),void this.$refs.loginForm.validateField("email");this.sendingCode=!0;try{const e=await(0,a.sendLoginCode)({email:t});e&&200===e.code?(this.$message.success(e.msg||"验证码已发送,请查收邮箱"),this.startCountdown()):this.$message.error(e.msg||"发送验证码失败")}catch(i){console.error("发送验证码失败:",i)}finally{this.sendingCode=!1}},startCountdown(){this.countdown=60,this.timer=setInterval(()=>{this.countdown--,this.countdown<=0&&(clearInterval(this.timer),this.timer=null)},1e3)},async handleLogin(){try{await this.$refs.loginForm.validate()}catch(t){return}this.loading=!0;try{const t=(this.loginForm.email||"").trim(),e=(this.loginForm.password||"").trim(),i=e;let r=i;const n=(0,s.rsaEncryptSync)(i);if(n)r=n;else{const t=await(0,s.rsaEncrypt)(i);if(!t)return this.$message.error("密码加密失败,请重试"),void(this.loading=!1);r=t}const l=await(0,a.getLogin)({email:t,password:r,code:this.loginForm.code.trim()});if(l&&200===l.code){const e=l.data.access_token;e&&await(0,o.updateToken)(e);const i={userName:l.data.userName||t,expires_in:l.data.expires_in||null};localStorage.setItem("userInfo",JSON.stringify(i)),localStorage.setItem("leasEmail",t),window.dispatchEvent(new CustomEvent("login-status-changed")),this.$message({message:"登录成功",type:"success",duration:3e3,showClose:!0});const a=this.$route.query.redirect||"/productList";this.$router.push(a)}else this.$message.error(l.msg||"登录失败")}catch(t){console.error("登录失败:",t),this.$message.error("登录失败,请重试")}finally{this.loading=!1}}}}},8586:function(t,e,i){Object.defineProperty(e,"B",{value:!0}),e.A=void 0;var a=i(4180);e.A={name:"PurchasedMachineDetail",data(){return{loading:!1,detailData:null}},created(){this.fetchDetail()},computed:{purchasedMachinesList(){return this.detailData&&Array.isArray(this.detailData.purchasedMachines)?this.detailData.purchasedMachines:[]}},methods:{async fetchDetail(){const t=this.$route.params.id;if(!t)return this.$message.error("缺少ID参数"),void this.handleBack();this.loading=!0;try{const e={id:t},i=await(0,a.getPurchasedInfoV2)(e);if(!i||0!==i.code&&200!==i.code){const t=i&&i.msg||"获取详情失败";this.$message.error(t)}else this.detailData=i.data||i,this.detailData||this.$message.warning("未找到对应的详情信息")}catch(e){console.error("获取详情失败",e),this.$message.error("获取详情失败,请稍后重试")}finally{this.loading=!1}},handleBack(){this.$router.go(-1)},formatDateTime(t){if(!t)return"—";try{const e=String(t);return e.includes("T")?e.replace("T"," "):e}catch(e){return String(t)}},formatPowerWithUnit(t,e){if(null===t||void 0===t||""===t)return"—";const i=null!=e?String(e).trim():"";return i?`${t} ${i}`:String(t)},async handleCopy(t,e="内容"){if(t)try{const a=String(t).trim();if(navigator&&navigator.clipboard&&navigator.clipboard.writeText)await navigator.clipboard.writeText(a),this.$message({message:`${e}已复制到剪贴板`,type:"success",showClose:!0});else{const t=document.createElement("textarea");t.value=a,t.style.position="fixed",t.style.left="-9999px",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy"),this.$message({message:`${e}已复制到剪贴板`,type:"success",showClose:!0})}catch(i){this.$message({message:"复制失败,请手动复制",type:"error",showClose:!0})}document.body.removeChild(t)}}catch(a){console.error("复制失败",a),this.$message({message:"复制失败,请手动复制",type:"error",showClose:!0})}else this.$message({message:`${e}为空,无法复制`,type:"warning",showClose:!0})},getStatusText(t){const e=Number(t);return 0===e?"租约已到期":1===e?"挖矿中":2===e?"卖家矿机启动中":!0===t?"挖矿中":"未知状态"},getStatusType(t){const e=Number(t);return 0===e?"info":1===e?"success":2===e?"warning":!0===t?"success":"info"}}}},8732:function(t,e,i){Object.defineProperty(e,"B",{value:!0}),e.A=void 0,i(4114),i(8111),i(1148),i(2489),i(116),i(7588),i(1701),i(8237),i(3579),i(7642),i(8004),i(3853),i(5876),i(2475),i(5024),i(1698);var a=i(5844),s=i(4180),o=i(4981),r=i(6966),n=i(1673);e.A={name:"Cart",data(){return{loading:!1,shops:[],groups:[],selectedGroups:[],selectedMachinesMap:{},confirmDialog:{visible:!1,shops:[],count:0,totalsByCoin:{}},expandedGroupKeys:[],expandedShopKeys:[],creatingOrder:!1,successDialog:{visible:!1},noticeDialog:{visible:!1,checked:!1,countdown:5},noticeTimer:null,pendingCheckoutShop:null,pendingCheckoutAll:null,googleCodeDialog:{visible:!1,code:"",error:"",loading:!1},machineSupportData:[],configDialog:{visible:!1,coin:"",algorithm:"",coinOptions:[],algorithmOptions:[],coinAlgoOptions:[],coinAlgoValue:[],selectedMachines:[],poolOptions:[],poolValue:[],poolRawData:[],selectedMachineIds:[],walletAddress:"",miningAccount:"",workerId:"",configuredMachines:[]},options:[],payDialog:{visible:!1,value:[],loading:!1},selectedChain:"",selectedCoin:"",selectedPrice:0,paySelectionMap:{},clearOffLoading:!1,settlementSuccessfulVisible:!1,paramsV2:{pageNum:1,pageSize:20}}},computed:{isAllSelected(){return this.selectedGroups.length&&this.selectedGroups.length===this.groups.length},isCartEmpty(){const t=Array.isArray(this.shops)&&this.shops.length>0,e=Array.isArray(this.groups)&&this.groups.length>0;return!t&&!e},selectedMachineCount(){return Object.values(this.selectedMachinesMap).reduce((t,e)=>t+(e?e.size:0),0)},selectedTotal(){const t=this.selectedTotalByCoin;let e=0;return Object.values(t||{}).forEach(t=>{e+=Number(t||0)}),e},selectedTotalByCoin(){const t=new Map,e=Array.isArray(this.shops)?this.shops:[];e.forEach(e=>{const i=this.selectedMachinesMap[e.id];if(!i||!i.size)return;const a=this.paySelectionMap[e.id]||"",[s,o]=String(a).split("|"),r=this.toUpperText(o||"");if(!r)return;const n=Array.isArray(e.productMachineDtoList)?e.productMachineDtoList:[];n.forEach(a=>{if(i.has(a.id)){const i=this.getMachineUnitPriceBySelection(e,a);if(null!=i){const e=this.calculateMachineTotal(i,a.leaseTime,a.numbers),s=t.get(r)||0;t.set(r,s+e)}}})});const i={};return t.forEach((t,e)=>{i[e]=t}),i},canCheckout(){return this.selectedMachineCount>0||this.selectedGroups.length>0},isGoogleCodeValid(){const t=this.googleCodeDialog.code;return/^\d{6}$/.test(t)},payCoinSymbol(){return(this.selectedCoin||"").toUpperCase()},unconfiguredMachinesList(){const t=this.configDialog.selectedMachines||[],e=new Set((this.configDialog.configuredMachines||[]).map(t=>t.id)),i=t.filter(t=>!e.has(t.id)),a=Array.isArray(this.configDialog.coinAlgoValue)?this.configDialog.coinAlgoValue:[];if(2!==a.length)return i;const s=a[0],o=a[1],r=(this.machineSupportData||[]).find(t=>String(t&&t.coin)===String(s));if(!r)return[];const n=(r.algorithmList||[]).find(t=>String(t&&t.algorithm)===String(o));if(!n)return[];const l=new Set((n.machineIds||[]).map(t=>Number(t)));return i.filter(t=>l.has(Number(t.id)))},unsupportedMachinesList(){const t=this.configDialog.selectedMachines||[],e=new Set((this.configDialog.configuredMachines||[]).map(t=>t.id)),i=t.filter(t=>!e.has(t.id)),a=Array.isArray(this.configDialog.coinAlgoValue)?this.configDialog.coinAlgoValue:[];if(2!==a.length)return[];const s=a[0],o=a[1],r=(this.machineSupportData||[]).find(t=>String(t&&t.coin)===String(s));if(!r)return[];const n=(r.algorithmList||[]).find(t=>String(t&&t.algorithm)===String(o));if(!n)return[];const l=new Set((n.machineIds||[]).map(t=>Number(t)));return i.filter(t=>!l.has(Number(t.id)))},canProceedToNextStep(){const t=this.configDialog,e=this.unconfiguredMachinesList;if(e.length>0){const e=t.selectedMachineIds||[],i=Array.isArray(e)&&e.length>0,a=Array.isArray(t.coinAlgoValue)?t.coinAlgoValue:[],s=Array.isArray(t.poolValue)?t.poolValue:[],o=String(t.walletAddress||"").trim(),r=String(t.miningAccount||"").trim(),n=2===a.length,l=2===s.length,c=o.length>0,d=r.length>0,u=n&&l&&c&&d,h=i&&u;return h||console.log("按钮禁用原因:",{hasSelection:i,selectedIds:e,coinAlgo:a,coinAlgoValid:n,pool:s,poolValid:l,wallet:o,walletValid:c,account:r,accountValid:d,formValid:u}),h}const i=new Set((t.selectedMachines||[]).map(t=>t.id)),a=new Set((t.configuredMachines||[]).map(t=>t.id)),s=Array.from(i).every(t=>a.has(t));return s},hasConfiguredMiningAccount(){const t=this.configDialog.configuredMachines||[];return t.some(t=>t.miningAccount&&String(t.miningAccount).trim().length>0)},hasConfiguredWorkerId(){const t=this.configDialog.configuredMachines||[];return t.some(t=>t.workerId&&String(t.workerId).trim().length>0)}},mounted(){this.fetchGetGoodsListV2(this.paramsV2)},watch:{shops:{handler(t){Array.isArray(t)&&t.length>0&&this.$nextTick(()=>{try{const e=t.map(t=>String(t.id));this.expandedShopKeys=e}catch(e){this.expandedShopKeys=[]}})},immediate:!0},"noticeDialog.visible"(t){if(t)this.startNoticeCountdown(),this.$nextTick(()=>this.reapplySelectionsForPendingShop());else if(this.noticeTimer){try{clearInterval(this.noticeTimer)}catch(e){}this.noticeTimer=null}},"confirmDialog.visible"(t){this.$nextTick(()=>this.reapplySelectionsForPendingShop())},"payDialog.visible"(t){this.$nextTick(()=>this.reapplySelectionsForPendingShop())},"googleCodeDialog.visible"(t){this.$nextTick(()=>this.reapplySelectionsForPendingShop())},"configDialog.coinAlgoValue"(){this.$forceUpdate()},"configDialog.poolValue"(){this.$forceUpdate()},"configDialog.walletAddress"(){this.$forceUpdate()},"configDialog.miningAccount"(){this.$forceUpdate()},"configDialog.workerId"(){this.$forceUpdate()},"configDialog.selectedMachineIds"(){this.$forceUpdate()}},beforeDestroy(){try{this.noticeTimer&&clearInterval(this.noticeTimer)}catch(t){}this.noticeTimer=null},methods:{async ensureGoogleStatusEnabledForCheckout(t){try{const e=await(0,n.getGoogleStatus)();if(!e||0!==e.code&&200!==e.code)return this.$message.error("获取双重验证状态失败,请稍后重试"),!1;const i=e.data?.status??e.data??1;if(0===Number(i))return!0;const a=1===Number(i)?"您尚未绑定双重验证":"您已关闭双重验证",s=`\n
\n
${a}
\n
\n 请先在安全设置中绑定并开启双重验证后,才可以进行${t||"该"}操作。\n
\n
\n `;return await this.$confirm(s,"安全提示",{confirmButtonText:"去安全设置",cancelButtonText:"取消",type:"warning",dangerouslyUseHTMLString:!0,customClass:"google-2fa-guard-dialog"}),this.$router.push("/account/security-settings"),!1}catch(e){return!1}},async fetchGetMachineSupportPool(t,e){const i={coin:t||"",algorithm:e||""},a=await(0,s.getMachineSupportPool)(i);if(a&&(0===a.code||200===a.code)&&Array.isArray(a.data)){this.configDialog.poolRawData=a.data||[];const t=(a.data||[]).map(t=>({label:t&&t.poolName?String(t.poolName):"",value:t&&null!=t.poolId?t.poolId:"",children:Array.isArray(t&&t.miningCoinInfoList)?t.miningCoinInfoList.map(t=>({label:t&&t.modelName?String(t.modelName):"",value:t&&null!=t.coinConfigId?t.coinConfigId:"",raw:t})):[]}));this.configDialog.poolOptions=t,this.configDialog.poolValue=[]}else this.configDialog.poolOptions=[],this.configDialog.poolValue=[],this.configDialog.poolRawData=[]},async fetchGetMachineSupportCoinAndAlgorithm(t=[]){const e=Array.isArray(t)?t.filter(t=>null!=t):[],i=await(0,s.getMachineSupportCoinAndAlgorithm)(e);console.log(i,"res"),i&&(0===i.code||200===i.code)&&i.data&&(this.machineSupportData=Array.isArray(i.data)?i.data:[])},async fetchGetGoodsListV2(t){try{const i=await(0,a.getGoodsListV2)(t),s=i&&i.data?i.data:i,o=Array.isArray(s&&s.rows)?s.rows:Array.isArray(s)?s:[],r=o.map((t,e)=>{const i=Array.isArray(t&&t.cartMachineInfoDtoList)?t.cartMachineInfoDtoList:Array.isArray(t&&t.productMachineDtoList)?t.productMachineDtoList:[];try{i.forEach(t=>{t&&null==t._origLeaseTime&&(t._origLeaseTime=Number(t.leaseTime||1)),t&&null==t._origNumbers&&(t._origNumbers=Number(t.numbers||1))})}catch(o){}const a=this.sortMachinesByShelfStatus(i),s={...t,id:t&&null!=t.id?String(t.id):`shop-${e}`,name:t&&(t.name||t.shopName||t.shop?.name||""),shopName:t&&(t.shopName||t.name||t.shop?.name||""),productMachineDtoList:a};return s});this.shops=r;try{this.shops.forEach(t=>this.ensureDefaultPaySelection(t))}catch(e){}this.$nextTick(()=>{try{const t=r.map(t=>String(t.id));this.expandedShopKeys=t}catch(e){this.expandedShopKeys=[]}});try{const t=r.reduce((t,e)=>t+(Array.isArray(e.productMachineDtoList)?e.productMachineDtoList.length:0),0);window.dispatchEvent(new CustomEvent("cart-updated",{detail:{count:t}}))}catch(e){}}catch(e){this.shops=[]}},formatAmount(t,e){return(0,o.truncateAmountByCoin)(t,e)},formatNum6(t){return(0,o.truncateTo6)(t)},toCents(t){if(null===t||void 0===t)return 0;let e=String(t).trim();if(""===e)return 0;let i=1;"-"===e[0]&&(i=-1,e=e.slice(1));const a=e.split("."),s=parseInt(a[0]||"0",10)||0,o=(a[1]||"").replace(/[^0-9]/g,""),r=o.length>=2?o.slice(0,2):o.padEnd(2,"0"),n=100*s+(parseInt(r||"0",10)||0);return i*n},toMicroUnits(t){if(null===t||void 0===t)return 0;let e=String(t).trim();if(""===e)return 0;let i=1;"-"===e[0]&&(i=-1,e=e.slice(1));const a=e.split("."),s=parseInt(a[0]||"0",10)||0,o=(a[1]||"").replace(/[^0-9]/g,""),r=o.length>=6?o.slice(0,6):o.padEnd(6,"0"),n=1e6*s+(parseInt(r||"0",10)||0);return i*n},microUnitsToAmount(t){const e=t<0?-1:1,i=Math.abs(Number(t)||0),a=Math.floor(i/1e6),s=i%1e6,o=String(s).padStart(6,"0"),r=o.replace(/0+$/,"");return""===r?e*a:e*parseFloat(`${a}.${r}`)},calculateMachineTotal(t,e,i){if(!t||null===t||void 0===t)return 0;const a=Math.max(1,Math.floor(Number(e||1))),s=Math.max(1,Math.floor(Number(i||1))),o=this.toMicroUnits(t),r=o*a*s;return this.microUnitsToAmount(r)},centsToText(t){const e=t<0?"-":"",i=Math.abs(Number(t)||0),a=Math.floor(i/100),s=String(i%100).padStart(2,"0");return`${e}${a}.${s}`},isRowSelectable(t,e){return!(1===Number(t&&t.del)||1===Number(t&&t.state))},isOnShelf(t){return!(1===Number(t&&t.del)||1===Number(t&&t.state))},sortMachinesByShelfStatus(t){return Array.isArray(t)?[...t].sort((t,e)=>{const i=this.isOnShelf(t),a=this.isOnShelf(e);return i===a?0:i?-1:1}):[]},getMachineRowClassName({row:t}){return this.isOnShelf(t)?"":"off-shelf-row"},getRowMaxLeaseDaysLocal(t){const e=t&&t.maxLeaseDays,i=Number(e);return Number.isFinite(i)?i<1?1:i>365?365:Math.floor(i):365},formatTrunc(t,e=2){const i=Number(t);if(!Number.isFinite(i))return"0";const a=Math.max(0,Number(e)||0),s=Math.pow(10,a),o=Math.trunc(i*s)/s,r=String(o);if(0===a)return r;const[n,l=""]=r.split("."),c=l.padEnd(a,"0");return`${n}.${c}`},async fetchChainAndListForSeller(t){if(!t)return this.options=[],void(this.loading=!1);this.loading=!0;const e=await(0,s.getChainAndListForSeller)({id:t});e&&(0===e.code||200===e.code)&&e.data&&(this.options=this.toUpperOptions(e.data)),this.loading=!1},toUpperOptions(t){const e=Array.isArray(t)?t:[];return e.map(t=>{const e={...t},i=t&&(null!=t.label?t.label:t.value)||"";return e.label=String(i).toUpperCase(),Array.isArray(t&&t.children)&&(e.children=this.toUpperOptions(t.children)),e})},getAllGroups(){return[]},getShopPayOptions(t){const e=Array.isArray(t&&t.payConfigList)?t.payConfigList:[];return e.map(t=>{const e=t&&t.payChain?String(t.payChain):"",i=t&&t.payCoin?String(t.payCoin):"",a=`${e}|${i}`;return{label:`${e} - ${this.toUpperText(i)}`,value:a,icon:t&&t.payCoinImage?t.payCoinImage:""}})},hasMachinePriceForSelection(t,e){if(!t||!e)return!1;const i=this.paySelectionMap[t.id]||"",[a,s]=String(i).split("|"),o=Array.isArray(e.priceList)?e.priceList:[];return o.some(t=>String(t.chain)===a&&String(t.coin)===s)},getSelectedCoinSymbolForShop(t){const e=this.paySelectionMap[t?t.id:void 0];if(!e)return"";const i=String(e).split("|");return this.toUpperText(i[1])},getSelectedCoinSymbolForShopHeader(){const t=Array.isArray(this.shops)&&this.shops.length?this.shops[0]:null;return t?(this.ensureDefaultPaySelection(t),this.getSelectedCoinSymbolForShop(t)):""},getSelectedPayIcon(t){if(!t)return"";this.ensureDefaultPaySelection(t);const e=this.paySelectionMap[t.id]||"",[i,a]=String(e).split("|"),s=Array.isArray(t&&t.payConfigList)?t.payConfigList:[],o=s.find(t=>String(t.payChain)===i&&String(t.payCoin)===a);return o&&o.payCoinImage?o.payCoinImage:""},ensureDefaultPaySelection(t){if(!t)return;const e=this.getShopPayOptions(t);e.length&&!this.paySelectionMap[t.id]&&this.$set(this.paySelectionMap,t.id,e[0].value)},handleShopPayChange(t,e){if(!t)return;this.$set(this.paySelectionMap,t.id,e);const i=this.selectedMachinesMap[t.id];if(i&&i.size){const e=Array.isArray(t.productMachineDtoList)?t.productMachineDtoList:[];e.forEach(e=>{i.has(e.id)&&!this.hasMachinePriceForSelection(t,e)&&i.delete(e.id)}),this.$nextTick(()=>this.applyInnerSelectionFromSet(t))}},displayShopTotalBySelection(t){if(!t)return 0;if(this.ensureDefaultPaySelection(t),this.isShopLeaseChanged(t)||this.isShopNumbersChanged(t))try{const e=Array.isArray(t.productMachineDtoList)?t.productMachineDtoList:[];let i=0;return e.forEach(e=>{const a=this.getMachineUnitPriceBySelection(t,e);if(null!=a){const t=this.calculateMachineTotal(a,e.leaseTime,e.numbers);i+=t}}),i}catch(r){}const e=this.paySelectionMap[t.id]||"",[i,a]=e.split("|"),s=Array.isArray(t.totalPriceList)?t.totalPriceList:[],o=s.find(t=>String(t.chain)===i&&String(t.coin)===a);return o&&null!=o.price?Number(o.price||0):Number(t.totalPrice||0)},isShopLeaseChanged(t){try{const e=Array.isArray(t&&t.productMachineDtoList)?t.productMachineDtoList:[];return e.some(t=>{const e=t&&null!=t._origLeaseTime?Number(t._origLeaseTime):Number(t&&t.leaseTime),i=Math.max(1,Math.floor(Number(t&&t.leaseTime)||1));return e!==i})}catch(e){return!1}},isShopNumbersChanged(t){try{const e=Array.isArray(t&&t.productMachineDtoList)?t.productMachineDtoList:[];return e.some(t=>{const e=t&&null!=t._origNumbers?Number(t._origNumbers):Number(t&&t.numbers||1),i=Math.max(1,Math.floor(Number(t&&t.numbers||1)));return e!==i})}catch(e){return!1}},getMachineUnitPriceBySelection(t,e){if(!t||!e)return Number(e.price||0);this.ensureDefaultPaySelection(t);const i=this.paySelectionMap[t.id]||"",[a,s]=i.split("|"),o=Array.isArray(e.priceList)?e.priceList:[],r=o.find(t=>String(t.chain)===a&&String(t.coin)===s);return r&&null!=r.price?Number(r.price||0):null},isRowSelectableByShop(t,e){return!!this.isOnShelf(e)&&this.hasMachinePriceForSelection(t,e)},computeShopTotal(t){if(!t)return 0;const e=Array.isArray(t.productMachineDtoList)?t.productMachineDtoList:[];if(!e.length)return Number(t.totalPrice||0);let i=0;for(const a of e){const t=this.toCents(a&&a.price),e=Math.max(1,Math.floor(Number(a&&a.leaseTime)||1));i+=t*e}return i/100},computeShopTotalDisplay(t){const e=Array.isArray(t&&t.productMachineDtoList)?t.productMachineDtoList:[],i=Number(t&&t.totalPrice),a=Number.isFinite(i);let s=!1;for(const r of e){const t=r&&null!=r._origLeaseTime?Number(r._origLeaseTime):Number(r&&r.leaseTime),e=Math.max(1,Math.floor(Number(r&&r.leaseTime)||1));if(t!==e){s=!0;break}}if(a&&!s||!e.length&&a)return this.formatTrunc(i,2);let o=0;for(const r of e){const t=this.toCents(r&&r.price),e=Math.max(1,Math.floor(Number(r&&r.leaseTime)||1));o+=t*e}return this.centsToText(o)},buildDeletePayload(){const t=[],e=Array.isArray(this.shops)?this.shops:[];return e.forEach(e=>{const i=this.selectedMachinesMap[e.id];if(!i||0===i.size)return;const a=Array.isArray(e.productMachineDtoList)?e.productMachineDtoList:[];a.forEach(e=>{i.has(e.id)&&null!=e.cartInfoId&&t.push({cartInfoId:e.cartInfoId})})}),t.filter(t=>t&&null!=t.cartInfoId)},async fetchAddOrdersV2(t,e,i){try{const a={code:i,orderInfoVoList:t,orderMiningInfoDtoList:e},o=await(0,s.addOrdersV2)(a);return o}catch(a){return{code:-1,msg:"网络异常",data:null}}},async fetchDeleteBatchGoods(t){try{const e=await(0,a.deleteBatchGoodsV2)(t);return e}catch(e){return{code:-1,msg:"网络异常"}}},async handleClearOffShelf(){if(!this.clearOffLoading){this.clearOffLoading=!0;try{const t=await(0,a.deleteBatchGoodsForIsDeleteV2)();t&&200===Number(t.code)?(this.$message({message:"已清除下架商品",type:"success",showClose:!0}),await this.fetchGetGoodsListV2(this.paramsV2)):this.$message({message:t&&t.msg||"清除失败",type:"error",showClose:!0})}catch(t){this.$message({message:"网络异常",type:"error",showClose:!0})}finally{this.clearOffLoading=!1}}},toUpperText(t){return null==t?"":String(t).toUpperCase()},handleOuterExpandChange(t,e){try{const t=Array.isArray(e)?e.map(t=>t&&(null!=t.id?String(t.id):void 0)).filter(Boolean):[];this.expandedGroupKeys=t}catch(i){this.expandedGroupKeys=[]}},handleShopExpandChange(t,e){try{const i=Array.isArray(e)?e.map(t=>t&&(null!=t.id?String(t.id):void 0)).filter(Boolean):[];this.expandedShopKeys=i;const a=i.includes(String(t.id));a&&this.$nextTick(()=>this.applyInnerSelectionFromSet(t))}catch(i){this.expandedShopKeys=[]}},async fetchGetGoodsList(t){try{this.loading=!0;const i=await(0,a.getGoodsList)(t),s=Array.isArray(i&&i.rows)?i.rows:Array.isArray(i&&i.data&&i.data.rows)?i.data.rows:Array.isArray(i&&i.data)?i.data:[];if(!s||0===s.length)return this.shops=[],this.groups=[],this.expandedShopKeys=[],this.expandedGroupKeys=[],this.selectedMachinesMap={},this.selectedGroups=[],void window.dispatchEvent(new CustomEvent("cart-updated",{detail:{count:0}}));if(s.length&&s[0].productMachineDtoList){const t=s.map((t,e)=>({...t,id:null!=t.id?String(t.id):`shop-${e}`}));try{t.forEach(t=>this.ensureDefaultPaySelection(t))}catch(e){}try{t.forEach(t=>{const e=Array.isArray(t.productMachineDtoList)?t.productMachineDtoList:[];e.forEach(t=>{t&&null==t._origLeaseTime&&(t._origLeaseTime=Number(t.leaseTime||1)),t&&null==t._origNumbers&&(t._origNumbers=Number(t.numbers||1))}),t.productMachineDtoList=this.sortMachinesByShelfStatus(e)})}catch(e){}this.shops=t,this.groups=[],this.expandedGroupKeys=[];try{this.expandedShopKeys=t.map(t=>String(t.id))}catch(e){this.expandedShopKeys=[]}const i=t.reduce((t,e)=>t+(Array.isArray(e.productMachineDtoList)?e.productMachineDtoList.length:0),0);return void window.dispatchEvent(new CustomEvent("cart-updated",{detail:{count:i}}))}const o=s.map((t,e)=>({...t,id:t&&(null!=t.id?t.id:null!=t.productId?t.productId:`g-${e}`)}));this.groups=o,this.shops=[],this.expandedShopKeys=[],this.expandedGroupKeys=(this.expandedGroupKeys||[]).filter(t=>o.some(e=>String(e.id)===String(t)));try{const t=o.reduce((t,e)=>t+(Array.isArray(e.productMachineDtoList)?e.productMachineDtoList.length:0),0);window.dispatchEvent(new CustomEvent("cart-updated",{detail:{count:t}}))}catch(e){}}catch(e){console.log(e,"e")}finally{this.loading=!1}},handleGroupSelectionChange(){},handleGroupSelectionChangeForShop(){},applyInnerSelection(t,e,i=0){const a=this.$refs["innerTable-"+t.id],s=Array.isArray(t.productMachineDtoList)?t.productMachineDtoList:[];if(a&&"function"===typeof a.clearSelection){try{a.clearSelection()}catch(o){}e&&s.forEach(t=>{try{a.toggleRowSelection(t,!0)}catch(o){}})}else i>=5||this.$nextTick(()=>this.applyInnerSelection(t,e,i+1))},applyInnerSelectionFromSet(t,e=0){if(!t)return;const i=this.$refs["innerTable-"+t.id],a=Array.isArray(t.productMachineDtoList)?t.productMachineDtoList:[],s=this.selectedMachinesMap[t.id];if(i&&"function"===typeof i.clearSelection){try{i.clearSelection()}catch(o){}s&&s.size&&a.forEach(t=>{if(s.has(t.id))try{i.toggleRowSelection(t,!0)}catch(o){}})}else e>=5||this.$nextTick(()=>this.applyInnerSelectionFromSet(t,e+1))},reapplySelectionsForPendingShop(){const t=this.pendingCheckoutShop&&this.pendingCheckoutShop.shop;t&&this.applyInnerSelectionFromSet(t)},handleShopInnerSelectionChange(t,e){const i=new Set((e||[]).map(t=>t.id));this.$set(this.selectedMachinesMap,t.id,i)},toggleSelectAll(){const t=this.$refs.outerTable;t&&(this.isAllSelected?t.clearSelection():this.groups.forEach(e=>t.toggleRowSelection(e,!0)))},calcGroupTotal(t){const e=Array.isArray(t&&t.productMachineDtoList)?t.productMachineDtoList:[];return e.reduce((t,e)=>{const i=Number(e.price||0),a=Number(e.leaseTime||1);return t+i*a},0)},countMachines(t){const e=Array.isArray(t&&t.productMachineDtoList)?t.productMachineDtoList:[];return e.length},async handleCheckoutShop(t){if(!t)return;const e=t.id,i=Array.isArray(t.productMachineDtoList)?t.productMachineDtoList:[];if(0===i.length)return void this.$message({message:"该店铺暂无可结算的机器",type:"warning",showClose:!0});const a=Array.isArray(this.expandedShopKeys)&&this.expandedShopKeys.includes(String(e)),s=[];if(a){const t=this.selectedMachinesMap[e];if(!t||0===t.size)return void this.$message({message:"请先在该店铺下勾选要结算的机器",type:"warning",showClose:!0});if(i.forEach(i=>{t.has(i.id)&&this.isOnShelf(i)&&s.push({leaseTime:Number(i.leaseTime||1),machineId:i.id,productId:i.productId,shopId:e})}),!s.length)return void this.$message({message:"所选机器均已下架,无法结算",type:"warning",showClose:!0})}else{const t=i.filter(t=>this.isOnShelf(t));if(!t.length)return void this.$message({message:"该店铺暂无上架机器可结算",type:"warning",showClose:!0});t.forEach(t=>{s.push({leaseTime:Number(t.leaseTime||1),machineId:t.id,productId:t.productId,shopId:e})})}await this.fetchChainAndListForSeller(e),this.pendingCheckoutShop={shop:t,payload:s},this.noticeDialog.visible=!0,this.noticeDialog.checked=!1,this.startNoticeCountdown()},async executeCheckout(t){if(!this.pendingCheckoutShop&&!this.pendingCheckoutAll)return!1;const e=this.configDialog.configuredMachines||[];if(!e.length)return this.$message.warning("请先完成机器配置"),!1;const i=[],a=[],s=[];if(this.pendingCheckoutAll&&this.pendingCheckoutAll.length)this.pendingCheckoutAll.forEach(({shop:t,items:e})=>{(e||[]).forEach(e=>{s.push({shop:t,machine:e})})});else if(this.pendingCheckoutShop){const{shop:t,payload:e}=this.pendingCheckoutShop,i=Array.isArray(t.productMachineDtoList)?t.productMachineDtoList:[],a=new Set(e.map(t=>t.machineId));i.forEach(e=>{a.has(e.id)&&s.push({shop:t,machine:e})})}s.forEach(({shop:t,machine:s})=>{const o=this.paySelectionMap[t.id]||"",[r,n]=String(o).split("|"),l=e.find(t=>t.id===s.id);if(!l)return void console.warn(`机器 ${s.id} 未找到配置信息`);i.push({chain:r||"",coin:n||"",leaseTime:Number(s.leaseTime||1),machineId:s.id,numbers:Number(s.numbers||1),type:Number(s.type||0),shopId:t.id});const c=l.coinConfigId;if(!c)return void console.warn(`机器 ${s.id} 的 coinConfigId 为空`);const d=String(l.walletAddress||"").trim(),u=String(l.miningAccount||"").trim(),h=String(l.workerId||"").trim();a.push({coinConfigId:c,coin:l.coin||"",algorithm:l.algorithm||l.originalAlgorithm||"",poolName:l.poolName||"",poolUser:u,walletAddress:d,walletMining:l.walletMining||!1,workerId:h,machineId:String(s.id)})});for(const n of a||[]){const t=String(n&&n.walletAddress?n.walletAddress:"").trim();if(!t)continue;let e=(0,r.rsaEncryptSync)(t);if(e||(e=await(0,r.rsaEncrypt)(t)),!e)return this.$message.error("钱包地址加密失败,请重试"),this.reapplySelectionsForPendingShop(),!1;n.walletAddress=e}this.creatingOrder=!0;try{const e=await this.fetchAddOrdersV2(i,a,t);let s=!1;if(e&&200===Number(e.code)){const t=String(e.data||"");return s=t.includes("成功"),s?(this.$message({message:"结算成功,订单状态请在订单列表中查看",type:"success",duration:3e3,showClose:!0}),this.settlementSuccessfulVisible=!0,await this.fetchGetGoodsListV2(this.paramsV2),this.pendingCheckoutShop=null,this.pendingCheckoutAll=null,!0):(this.reapplySelectionsForPendingShop(),!1)}return this.reapplySelectionsForPendingShop(),!1}catch(o){return console.log("网络错误,请重试",o),this.$message({message:"网络错误,请重试",type:"error",duration:3e3,showClose:!0}),this.reapplySelectionsForPendingShop(),!1}finally{this.creatingOrder=!1}},async handleCheckoutSelected(){const t=await this.ensureGoogleStatusEnabledForCheckout("结算");if(!t)return;if(!this.selectedMachineCount)return void this.$message({message:"请先勾选要结算的机器",type:"warning",showClose:!0});const e=Array.isArray(this.shops)?this.shops:[],i=[];if(e.forEach(t=>{const e=this.selectedMachinesMap[t.id];if(!e||!e.size)return;const a=Array.isArray(t.productMachineDtoList)?t.productMachineDtoList:[],s=a.filter(t=>e.has(t.id)&&this.isOnShelf(t));s.length&&i.push({shop:t,items:s})}),i.length){try{const t=[];if(i.forEach(({items:e})=>{(e||[]).forEach(e=>{e&&null!=e.id&&t.push(e.id)})}),t.length&&(await this.fetchGetMachineSupportCoinAndAlgorithm(t),!this.machineSupportData||0===this.machineSupportData.length))return void this.$message({message:"加载配置信息失败,请重试",type:"error",showClose:!0})}catch(a){return void this.$message({message:"加载配置信息失败,请重试",type:"error",showClose:!0})}this.pendingCheckoutAll=i,this.noticeDialog.visible=!0,this.noticeDialog.checked=!1,this.startNoticeCountdown()}else this.$message({message:"未找到可结算的上架机器",type:"warning",showClose:!0})},handleRemoveSelectedMachines(){const t=this.buildDeletePayload();t.length?this.$confirm("确定删除所选机器吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(async()=>{const e=await this.fetchDeleteBatchGoods(t);if(e&&200===Number(e.code)){this.$message({message:"已删除选中的机器",type:"success",duration:3e3,showClose:!0}),await this.fetchGetGoodsListV2(this.paramsV2),this.selectedMachinesMap={},this.selectedGroups=[];try{this.getAllGroups().forEach(t=>{const e=this.$refs["innerTable-"+t.id];if(e&&"function"===typeof e.clearSelection)try{e.clearSelection()}catch(i){}})}catch(i){}}}).catch(()=>null):this.$message({message:"请先勾选需要删除的机器或商品",type:"warning",showClose:!0})},confirmPay(){this.confirmDialog.visible=!1,this.showGoogleCodeDialog()},handleConfirmDialogPrev(){this.confirmDialog.visible=!1,this.configDialog.visible=!0},handleCloseSuccessDialog(){try{this.settlementSuccessfulVisible=!1}catch(t){}this.$router.push({path:"/account/orders",query:{status:"7"}})},startNoticeCountdown(){try{this.noticeTimer&&clearInterval(this.noticeTimer)}catch(t){}this.noticeDialog.countdown=5,this.noticeTimer=setInterval(()=>{this.noticeDialog.countdown>0?this.noticeDialog.countdown-=1:(clearInterval(this.noticeTimer),this.noticeTimer=null)},1e3)},async handleNoticeAcknowledge(){this.noticeDialog.countdown>0||(this.noticeDialog.checked?(this.noticeDialog.visible=!1,this.$nextTick(()=>this.reapplySelectionsForPendingShop()),this.openConfigDialog()):this.$message({message:'请先勾选"我已阅读并同意上述注意事项"',type:"warning",showClose:!0}))},openConfigDialog(){if(!this.machineSupportData||0===this.machineSupportData.length)return void this.$message({message:"加载配置信息失败,请重试",type:"error",showClose:!0});this.configDialog.configuredMachines=[];const t=Array.isArray(this.machineSupportData)?this.machineSupportData:[],e=t.map(t=>({label:this.toUpperText(t&&t.coin),value:t&&t.coin}));this.configDialog.coinOptions=e,this.configDialog.coinAlgoOptions=(t||[]).map(t=>({label:this.toUpperText(t&&t.coin),value:t&&t.coin,children:Array.isArray(t&&t.algorithmList)?t.algorithmList.map(t=>({label:t&&t.algorithm?String(t.algorithm):"",value:t&&t.algorithm?String(t.algorithm):""})):[]})),this.$set(this.configDialog,"coin",""),this.$set(this.configDialog,"algorithm",""),this.$set(this.configDialog,"coinAlgoValue",[]),this.configDialog.selectedMachines=this.buildSelectedMachinesForConfig(),this.$set(this.configDialog,"selectedMachineIds",[]),this.$set(this.configDialog,"walletAddress",""),this.$set(this.configDialog,"miningAccount",""),this.$set(this.configDialog,"workerId",""),this.$set(this.configDialog,"poolValue",[]),this.$set(this.configDialog,"poolOptions",[]),this.$set(this.configDialog,"poolRawData",[]),this.configDialog.visible=!0},refreshAlgorithmOptions(){const t=this.configDialog.coin,e=(this.machineSupportData||[]).find(e=>String(e&&e.coin)===String(t)),i=Array.isArray(e&&e.algorithmList)?e.algorithmList:[];this.configDialog.algorithmOptions=i.map(t=>({label:t&&t.algorithm?String(t.algorithm):"",value:t&&t.algorithm?String(t.algorithm):"",machineIds:Array.isArray(t&&t.machineIds)?t.machineIds:[]})),!this.configDialog.algorithm&&this.configDialog.algorithmOptions.length?this.configDialog.algorithm=this.configDialog.algorithmOptions[0].value:this.configDialog.algorithm&&!this.configDialog.algorithmOptions.some(t=>t.value===this.configDialog.algorithm)&&(this.configDialog.algorithm=this.configDialog.algorithmOptions.length?this.configDialog.algorithmOptions[0].value:"")},handleConfigCoinChange(){this.configDialog.algorithm="",this.refreshAlgorithmOptions();try{this.configDialog.coin&&this.configDialog.algorithm?this.fetchGetMachineSupportPool(this.configDialog.coin,this.configDialog.algorithm):(this.configDialog.poolOptions=[],this.configDialog.poolValue=[],this.configDialog.poolRawData=[])}catch(t){}},handleConfigAlgorithmChange(){try{this.configDialog.coin&&this.configDialog.algorithm?this.fetchGetMachineSupportPool(this.configDialog.coin,this.configDialog.algorithm):(this.configDialog.poolOptions=[],this.configDialog.poolValue=[],this.configDialog.poolRawData=[])}catch(t){}},handleCoinAlgoChange(t){const e=Array.isArray(t)?t:[],i=e[0]||"",a=e[1]||"";this.$set(this.configDialog,"coin",i),this.$set(this.configDialog,"algorithm",a),this.$set(this.configDialog,"coinAlgoValue",e),this.$set(this.configDialog,"selectedMachineIds",[]),this.$nextTick(()=>{try{const t=this.$refs.configTable;t&&"function"===typeof t.clearSelection&&t.clearSelection()}catch(t){}this.$forceUpdate()}),this.$set(this.configDialog,"walletAddress",""),this.$set(this.configDialog,"miningAccount",""),i&&a?this.fetchGetMachineSupportPool(i,a):(this.$set(this.configDialog,"poolOptions",[]),this.$set(this.configDialog,"poolValue",[]),this.$set(this.configDialog,"poolRawData",[]))},handlePoolValueChange(t){this.$set(this.configDialog,"poolValue",t||[]);const e=Array.isArray(t)?t:[];if(2===e.length){const t=e[0],i=e[1],a=(this.configDialog.poolOptions||[]).find(e=>e.value===t);if(a){const t=(a.children||[]).find(t=>t.value===i);if(t&&t.raw){const e=t.raw.walletMining||!1;this.$set(this.configDialog,"walletAddress",""),this.$set(this.configDialog,"miningAccount","");const i=this.unconfiguredMachinesList;i.forEach(t=>{this.$set(t,"_walletMining",e),this.$set(t,"_workerId","")})}}}else this.$set(this.configDialog,"walletAddress",""),this.$set(this.configDialog,"miningAccount","");this.$nextTick(()=>{this.$forceUpdate()})},getCurrentWalletMining(){const t=Array.isArray(this.configDialog.poolValue)?this.configDialog.poolValue:[];if(2!==t.length)return null;const e=t[0],i=t[1],a=(this.configDialog.poolOptions||[]).find(t=>t.value===e);if(a){const t=(a.children||[]).find(t=>t.value===i);if(t&&t.raw)return t.raw.walletMining||!1}return null},handleMachineWalletAddressInput(t,e){if(!e)return void this.$set(t,"_walletAddress","");let i=e.replace(/[\u4e00-\u9fa5\u3400-\u4dbf\u3000-\u303f\uff00-\uffef]/g,"");i.length>95&&(i=i.substring(0,95)),this.$set(t,"_walletAddress",i)},handleMachineMiningAccountInput(t,e){if(!e)return void this.$set(t,"_miningAccount","");let i=String(e);i.length>40&&(i=i.substring(0,40)),this.$set(t,"_miningAccount",i)},handleMachineWorkerIdInput(t,e){if(!e)return void this.$set(t,"_workerId","");let i=String(e);i.length>40&&(i=i.substring(0,40)),this.$set(t,"_workerId",i)},handleWalletAddressInput(t){if(!t)return void this.$set(this.configDialog,"walletAddress","");const e=String(t),i=e.replace(/[\u4e00-\u9fa5\u3400-\u4dbf\u3000-\u303f\uff00-\uffef]/g,"");this.$set(this.configDialog,"walletAddress",i),this.$nextTick(()=>{this.$forceUpdate()})},handleMiningAccountInput(t){if(!t)return void this.$set(this.configDialog,"miningAccount","");let e=t.replace(/[^\u0020-\u007E]/g,"");e=e.replace(/[^a-zA-Z0-9\-_]/g,""),e.length>50&&(e=e.substring(0,50)),this.$set(this.configDialog,"miningAccount",e),this.$nextTick(()=>{this.$forceUpdate()})},handleConfigSelectionChange(t){const e=(t||[]).map(t=>t&&t.id).filter(t=>null!=t);this.$set(this.configDialog,"selectedMachineIds",e),this.$nextTick(()=>{this.$forceUpdate()}),console.log("机器选择变化:",{selectionCount:t?t.length:0,selectedIds:e,allSelected:t||[]})},buildSelectedMachinesForConfig(){const t=[];if(this.pendingCheckoutAll&&this.pendingCheckoutAll.length)this.pendingCheckoutAll.forEach(({shop:e,items:i})=>{(i||[]).forEach(i=>{t.push({id:i.id,product:e&&(e.name||""),user:i.user,miner:i.miner,type:i.type,algorithm:i.algorithm})})});else if(this.pendingCheckoutShop&&this.pendingCheckoutShop.shop&&Array.isArray(this.pendingCheckoutShop.payload)){const e=this.pendingCheckoutShop.shop,i=Array.isArray(e.productMachineDtoList)?e.productMachineDtoList:[],a=new Set(this.pendingCheckoutShop.payload.map(t=>t.machineId));i.forEach(i=>{a.has(i.id)&&t.push({id:i.id,product:e&&(e.name||""),user:i.user,miner:i.miner,type:i.type,algorithm:i.algorithm})})}return t},isConfigFormValid(){const t=Array.isArray(this.configDialog.coinAlgoValue)?this.configDialog.coinAlgoValue:[],e=Array.isArray(this.configDialog.poolValue)?this.configDialog.poolValue:[],i=String(this.configDialog.walletAddress||"").trim(),a=String(this.configDialog.miningAccount||"").trim(),s=2===t.length,o=2===e.length,r=i.length>0,n=a.length>0,l=s&&o&&r&&n;return l||console.log("表单验证失败:",{coinAlgo:t,coinAlgoValid:s,pool:e,poolValid:o,wallet:i,walletValid:r,account:a,accountValid:n}),l},handleConfigConfirm(){const t=this.unconfiguredMachinesList;if(t.length>0){let i=[];try{const t=this.$refs.configTable;if(t&&"function"===typeof t.selection){const e=t.selection()||[];i=e.map(t=>t&&t.id).filter(t=>null!=t)}else t&&Array.isArray(t.selection)&&(i=t.selection.map(t=>t&&t.id).filter(t=>null!=t))}catch(e){i=this.configDialog.selectedMachineIds||[]}if(0===i.length&&(i=this.configDialog.selectedMachineIds||[]),!Array.isArray(i)||0===i.length)return void this.$message.warning("请至少勾选一台机器进行配置");const a=Array.isArray(this.configDialog.coinAlgoValue)?this.configDialog.coinAlgoValue:[],s=Array.isArray(this.configDialog.poolValue)?this.configDialog.poolValue:[];if(2!==a.length)return void this.$message.warning("请选择币种和算法");if(2!==s.length)return void this.$message.warning("请选择矿池和模型");const o=t.filter(t=>i.includes(t.id));if(0===o.length)return void this.$message.warning("所选机器已配置,请选择未配置的机器");const r=this.configDialog.poolValue||[],n=r[0],l=r[1];let c="",d="",u=!1;const h=(this.configDialog.poolOptions||[]).find(t=>t.value===n);if(h){c=h.label||"";const t=(h.children||[]).find(t=>t.value===l);t&&t.raw&&(d=t.label||"",u=t.raw.walletMining||!1)}if(u){const t=String(this.configDialog.walletAddress||"").trim();if(!t||0===t.length)return void this.$message.warning("请输入钱包地址");if(t.length<26||t.length>95)return void this.$message.warning("钱包地址长度应在26-95个字符之间")}else{const t=String(this.configDialog.miningAccount||"").trim();if(!t||0===t.length)return void this.$message.warning("请输入挖矿账户")}for(const t of o){const e=String(t._workerId||"").trim();if(!e||0===e.length)return void this.$message.warning(`机器ID ${t.id} 请输入矿工号`)}const p=this.toUpperText(a[0]||""),m=String(a[1]||""),g=u?String(this.configDialog.walletAddress||"").trim():"",f=u?"":String(this.configDialog.miningAccount||"").trim();o.forEach(t=>{this.configDialog.configuredMachines.push({id:t.id,coin:p,algorithm:m,poolName:c,modelName:d,walletAddress:g,miningAccount:f,workerId:String(t._workerId||"").trim(),walletMining:u,type:t.type,poolId:n,coinConfigId:l,originalAlgorithm:t.algorithm,machineData:t})});const y=new Set((this.configDialog.selectedMachines||[]).map(t=>t.id)),w=new Set((this.configDialog.configuredMachines||[]).map(t=>t.id)),v=Array.from(y).filter(t=>!w.has(t));v.length>0?this.fetchGetMachineSupportCoinAndAlgorithm(v).then(()=>{if(!this.machineSupportData||0===this.machineSupportData.length)return void this.$message({message:"加载配置信息失败,请重试",type:"error",showClose:!0});const t=Array.isArray(this.machineSupportData)?this.machineSupportData:[];this.configDialog.coinAlgoOptions=(t||[]).map(t=>({label:this.toUpperText(t&&t.coin),value:t&&t.coin,children:Array.isArray(t&&t.algorithmList)?t.algorithmList.map(t=>({label:t&&t.algorithm?String(t.algorithm):"",value:t&&t.algorithm?String(t.algorithm):""})):[]})),0===this.configDialog.coinAlgoOptions.length&&(this.configDialog.coinAlgoOptions=[])}).catch(t=>{console.error("重新获取币种/算法支持数据失败:",t),this.$message({message:"加载配置信息失败,请重试",type:"error",showClose:!0})}):this.configDialog.coinAlgoOptions=[],this.$set(this.configDialog,"selectedMachineIds",[]),this.$set(this.configDialog,"poolValue",[]),this.$set(this.configDialog,"coinAlgoValue",[]),this.$set(this.configDialog,"coin",""),this.$set(this.configDialog,"algorithm",""),this.$set(this.configDialog,"walletAddress",""),this.$set(this.configDialog,"miningAccount","");const C=this.unconfiguredMachinesList;C.forEach(t=>{this.$set(t,"_workerId",""),this.$set(t,"_walletMining",null)}),this.$nextTick(()=>{try{const t=this.$refs.configTable;t&&"function"===typeof t.clearSelection&&t.clearSelection()}catch(e){}});const b=this.unconfiguredMachinesList;b.length>0&&this.$message.success(`已配置 ${o.length} 台机器,还有 ${b.length} 台待配置`)}else{const t=new Set((this.configDialog.selectedMachines||[]).map(t=>t.id)),i=new Set((this.configDialog.configuredMachines||[]).map(t=>t.id)),a=Array.from(t).every(t=>i.has(t));if(!a)return void this.$message.warning("请完成所有机器的配置");if(this.configDialog.visible=!1,this.pendingCheckoutAll&&this.pendingCheckoutAll.length)this.showConfirmDialogAll();else{try{const t=this.pendingCheckoutShop&&this.pendingCheckoutShop.shop;if(t){const e=this.paySelectionMap[t.id]||"",[i,a]=String(e).split("|");this.selectedChain=i||"",this.selectedCoin=a||""}else this.selectedChain="",this.selectedCoin=""}catch(e){this.selectedChain="",this.selectedCoin=""}this.showConfirmDialog()}}},handleConfigCancel(){this.configDialog.visible=!1,this.configDialog.configuredMachines=[],this.configDialog.selectedMachineIds=[],this.configDialog.walletAddress="",this.configDialog.miningAccount="",this.configDialog.workerId="",this.configDialog.poolValue=[],this.configDialog.poolRawData=[],this.configDialog.coinAlgoValue=[],this.reapplySelectionsForPendingShop()},handleConfigPrev(){this.configDialog.visible=!1,this.noticeDialog.visible=!0,this.noticeDialog.checked=!1,this.startNoticeCountdown()},openPaySelectDialog(){},showConfirmDialog(){if(!this.pendingCheckoutShop)return;const{shop:t,payload:e}=this.pendingCheckoutShop;this.$nextTick(()=>this.reapplySelectionsForPendingShop());const i=Array.isArray(t.productMachineDtoList)?t.productMachineDtoList:[],a=(new Map,new Set(e.map(t=>t.machineId))),s=[];i.forEach(e=>{if(a.has(e.id)&&this.isOnShelf(e)){const i=this.getMachineUnitPriceBySelection(t,e);if(null==i)return;const a=Math.max(1,Math.floor(Number(e.leaseTime||1))),o=Number(i||0),r=Math.max(1,Math.floor(Number(e.numbers||1))),n=this.calculateMachineTotal(o,a,r);s.push({id:e.id,type:e.type,algorithm:e.algorithm||"",unitPrice:Number(o||0),leaseTime:a,numbers:r,subtotal:Number(n||0)})}});const o=this.paySelectionMap[t.id]||"",[r,n]=String(o).split("|"),l=this.toUpperText(n||""),c=`${r} - ${l}`,d=Array.isArray(t&&t.payConfigList)?t.payConfigList:[],u=d.find(t=>String(t&&t.payChain).toUpperCase()===String(r).toUpperCase()&&String(t&&t.payCoin).toUpperCase()===String(n).toUpperCase()),h=Number(u&&u.deductibleAmount||0),p=Number(u&&u.fee||0),m=s.reduce((t,e)=>t+Number(e.subtotal||0),0),g=m>=h||h<=0,f={shopId:t.id,shopName:t.name||"",coinSymbol:l,payLabel:c,items:s,deductibleAmount:h,fee:p,enough:g,groupSubtotal:m};this.confirmDialog.shops=[f],this.confirmDialog.count=s.length;const y={},w=(t,e)=>t+this.toCents(e);if(l){let t=s.reduce((t,e)=>w(t,e.subtotal||0),0);!g&&p>0&&(t+=this.toCents(p)),y[l]=Number(this.centsToText(t))}this.confirmDialog.totalsByCoin=y,this.confirmDialog.visible=!0},showConfirmDialogAll(){const t=[],e=new Map;let i=0;const a=Array.isArray(this.shops)?this.shops:[];a.forEach(a=>{const s=this.selectedMachinesMap[a.id];if(!s||!s.size)return;const o=this.paySelectionMap[a.id]||"",[r,n]=String(o).split("|"),l=this.toUpperText(n||""),c=`${r} - ${l}`,d=Array.isArray(a&&a.payConfigList)?a.payConfigList:[],u=d.find(t=>String(t&&t.payChain).toUpperCase()===String(r).toUpperCase()&&String(t&&t.payCoin).toUpperCase()===String(n).toUpperCase()),h=Number(u&&u.deductibleAmount||0),p=Number(u&&u.fee||0),m=[],g=Array.isArray(a.productMachineDtoList)?a.productMachineDtoList:[];let f=0;if(g.forEach(t=>{if(!s.has(t.id)||!this.isOnShelf(t))return;const o=this.getMachineUnitPriceBySelection(a,t);if(null==o)return;const r=Math.max(1,Math.floor(Number(t.leaseTime||1))),n=Number(o||0),c=Math.max(1,Math.floor(Number(t.numbers||1))),d=this.calculateMachineTotal(n,r,c);m.push({id:t.id,type:t.type,algorithm:t.algorithm||"",unitPrice:n,leaseTime:r,numbers:c,subtotal:d}),f+=d;const u=e.get(l)||0;e.set(l,u+this.toCents(d)),i+=1}),m.length){const i=f>=h||h<=0;if(!i&&p>0){const t=e.get(l)||0;e.set(l,t+this.toCents(p))}t.push({shopId:a.id,shopName:a.name||"",coinSymbol:l,payLabel:c,items:m,deductibleAmount:h,fee:p,enough:i,groupSubtotal:f})}});const s={};e.forEach((t,e)=>{s[e]=Number(this.centsToText(t))}),this.confirmDialog.shops=t,this.confirmDialog.count=i,this.confirmDialog.totalsByCoin=s,this.confirmDialog.visible=!0},showGoogleCodeDialog(){this.googleCodeDialog.visible=!0,this.googleCodeDialog.code="",this.googleCodeDialog.error="",this.googleCodeDialog.loading=!1,this.$nextTick(()=>{this.$refs.googleCodeInput&&this.$refs.googleCodeInput.focus()})},handleGoogleCodeInput(t){this.googleCodeDialog.code=t.replace(/\D/g,""),this.googleCodeDialog.error&&(this.googleCodeDialog.error="")},async handleGoogleCodeSubmit(){if(this.isGoogleCodeValid){this.googleCodeDialog.loading=!0,this.googleCodeDialog.error="";try{const t=await this.executeCheckout(this.googleCodeDialog.code);t?(this.googleCodeDialog.visible=!1,this.googleCodeDialog.code="",this.googleCodeDialog.error=""):this.googleCodeDialog.error="订单创建失败,请检查后重试"}catch(t){this.googleCodeDialog.error="订单创建失败,请重试",console.error("订单创建异常:",t)}finally{this.googleCodeDialog.loading=!1}}else this.googleCodeDialog.error="请输入6位数字验证码"},handleGoogleCodeCancel(){this.googleCodeDialog.visible=!1,this.googleCodeDialog.code="",this.googleCodeDialog.error="",this.googleCodeDialog.loading=!1,this.reapplySelectionsForPendingShop(),this.pendingCheckoutShop=null},handleGoogleCodePrev(){this.googleCodeDialog.visible=!1,this.googleCodeDialog.code="",this.googleCodeDialog.error="",this.googleCodeDialog.loading=!1,this.pendingCheckoutAll&&this.pendingCheckoutAll.length?this.showConfirmDialogAll():this.showConfirmDialog()},handleLeaseTimeChange(t){t.leaseTime<1?t.leaseTime=1:t.leaseTime>365?t.leaseTime=365:t.leaseTime=Math.floor(t.leaseTime)},getRowMaxPurchaseForCart(t){const e=Number(t&&t.canSaleNumbers);return!Number.isFinite(e)||e<1?1:Math.floor(e)},handleNumbersChange(t,e){if(!t)return;if(1===Number(t.type)){try{this.$set(t,"numbers",Number(t.numbers||1))}catch(s){t.numbers=1}return}let i=Number(e);Number.isFinite(i)||(i=1),i<1&&(i=1);const a=this.getRowMaxPurchaseForCart(t);i>a&&(i=a),i=Math.floor(i);try{this.$set(t,"numbers",i)}catch(s){t.numbers=i}},handleLeaseTimeInput(t,e){if(""===e||null===e||void 0===e)return void(t.leaseTime=1);const i=Number(e);isNaN(i)?t.leaseTime=1:t.leaseTime=i%1===0?i<1?1:i>365?365:i:Math.floor(i)},handleProductExpandChange(t,e,i){const a=this.$refs["productTable-"+(t&&t.id)];if(!a||!e)return;const s=a.selection||[],o=Array.isArray(s)&&s.some(t=>t&&t.id===e.id);o&&this.$nextTick(()=>{this.applyInnerSelection(e,!0)})},isProductSelected(t,e){const i=this.$refs["productTable-"+(t&&t.id)];if(!i||!e)return!1;const a=i.selection||[];return Array.isArray(a)&&a.some(t=>t&&t.id===e.id)},formatPayTooltip(t){return`${t.payChain} - ${this.toUpperText(t.payCoin)}`},formatMachineType(t){const e=Number(t);return 0===e?"ASIC":1===e?"GPU":""},formatWalletAddress(t){if(!t||"string"!==typeof t)return"-";const e=t.trim();return e.length<=20?e:`${e.substring(0,10)}...${e.substring(e.length-10)}`},typeClass(t){const e=Number(t);return 1===e?"gpu":0===e?"asic":""}}}},8949:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(6122),s=i(1373),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"57d53cdc",null),l=n.exports},9099:function(t,e,i){e.Yp=e.XX=void 0,i(8111),i(1701);e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"panel"},[e("h2",{staticClass:"panel-title page-title"},[t._v("钱包绑定")]),e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"panel-body"},[e("el-form",{staticClass:"config-form",attrs:{model:t.form,"label-width":"120px"}},[e("el-form-item",{attrs:{label:"选择链/币种"}},[e("el-cascader",{staticStyle:{width:"420px"},attrs:{options:t.options,props:t.cascaderProps,"show-all-levels":!1,clearable:"",filterable:""},on:{change:t.handleChange,"expand-change":t.handleExpandChange},scopedSlots:t._u([{key:"default",fn:function({node:i,data:a}){return[e("span",{staticClass:"custom-node",attrs:{"aria-label":"cascader-item",tabindex:"0"},on:{click:function(e){return e.stopPropagation(),t.handleItemClick(i,a)}}},[e("span",{staticClass:"node-label"},[t._v(t._s(a.label))]),i.isLeaf&&i.checked?e("span",{staticClass:"leaf-checked",attrs:{"aria-hidden":"true"}},[t._v("✓")]):t._e()])]}}]),model:{value:t.value,callback:function(e){t.value=e},expression:"value"}})],1),e("el-form-item",{attrs:{label:"已选择币种"}},[e("div",{staticClass:"selected-coins",attrs:{"aria-label":"selected-coins",tabindex:"0"}},[t._l(t.selectedCoins,function(i){return e("el-tag",{key:i,attrs:{type:"warning",effect:"light",closable:"","disable-transitions":""},on:{close:function(e){return t.handleRemoveSelectedCoin(i)}}},[t._v(" "+t._s(i)+" ")])}),0===t.selectedCoins.length?e("span",{staticClass:"placeholder"},[t._v("未选择")]):t._e()],2)]),e("el-form-item",{attrs:{label:"收款钱包地址"}},[e("el-input",{attrs:{placeholder:"请输入"},model:{value:t.form.payAddress,callback:function(e){t.$set(t.form,"payAddress",e)},expression:"form.payAddress"}})],1),e("el-form-item",[e("el-button",{staticStyle:{width:"200px"},attrs:{type:"primary"},on:{click:t.handleSave}},[t._v("确认绑定")])],1)],1),e("el-dialog",{attrs:{visible:t.preCheck.visible,width:"80vw","close-on-click-modal":!1,title:"检测到关联商品"},on:{"update:visible":function(e){return t.$set(t.preCheck,"visible",e)},close:t.handlePreCheckClose},scopedSlots:t._u([{key:"footer",fn:function(){return[e("el-button",{on:{click:function(e){t.preCheck.visible=!1}}},[t._v("取消")]),e("el-button",{attrs:{type:"primary",disabled:!t.canSubmitPreCheck},on:{click:t.handleConfirmBindAfterPreview}},[t._v("继续绑定")])]},proxy:!0}])},[e("div",{staticStyle:{"margin-bottom":"10px"}},[e("el-alert",{attrs:{type:"warning",closable:!1,"show-icon":"",description:"检测到以下商品与本次绑定的链/币相关。继续绑定后,可能需要为这些商品配置该新链下的价格。是否继续?"}})],1),e("p",{staticStyle:{color:"red","font-size":"12px","margin-top":"6px","text-align":"right"}},[t._v("* 请填写每个商品对应币种的价格,商品包含机器统一设置价格,如需单台修改请在商品列表-详情页操作")]),e("el-table",{attrs:{data:t.preCheck.rows,height:"360",border:"","header-cell-style":{textAlign:"left"},"cell-style":{textAlign:"left"}}},[e("el-table-column",{attrs:{label:"商品类型","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(0===Number(e.row.type)?"ASIC":1===Number(e.row.type)?"GPU":"-"))]}}])}),e("el-table-column",{attrs:{label:"矿工账号","min-width":"160"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.user||"-"))]}}])}),e("el-table-column",{attrs:{label:"矿机编号","min-width":"160"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.miner||"-"))]}}])}),e("el-table-column",{attrs:{label:"链","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(){return[t._v(" "+t._s((t.form.chain||"").toUpperCase())+" ")]},proxy:!0}])}),e("el-table-column",{attrs:{label:"币种","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(){return[t._v(" "+t._s(t.form.payCoin.split(",").map(t=>t.trim().toUpperCase()).join(","))+" ")]},proxy:!0}])}),e("el-table-column",{attrs:{label:"商品状态","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(1===Number(e.row.state)?"下架":"上架"))]}}])}),t._l(t.coinsForBind,function(i){return e("el-table-column",{key:"price-"+i,attrs:{label:i+" 价格","min-width":"160"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-input",{staticClass:"price-input",attrs:{size:"mini",placeholder:"请输入",inputmode:"decimal"},scopedSlots:t._u([{key:"append",fn:function(){return[t._v(t._s(i))]},proxy:!0}],null,!0),model:{value:t.preCheck.rowPrices[t.getRowKey(a.row,a.$index)][i],callback:function(e){t.$set(t.preCheck.rowPrices[t.getRowKey(a.row,a.$index)],i,e)},expression:"preCheck.rowPrices[getRowKey(scope.row, scope.$index)][sym]"}})]}}],null,!0)})})],2)],1)],1)])},e.Yp=[]},9146:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=void 0,i(4114);var a=i(9662);e["default"]={name:"ProductList",data(){return{products:[],loading:!1,powerList:[],currencyList:[{path:"nexaAccess",value:"nexa",label:"nexa",imgUrl:"https://m2pool.com/img/nexa.png",name:"course.NEXAcourse",show:!0,amount:1e4},{path:"grsAccess",value:"grs",label:"grs",imgUrl:"https://m2pool.com/img/grs.svg",name:"course.GRScourse",show:!0,amount:1},{path:"monaAccess",value:"mona",label:"mona",imgUrl:"https://m2pool.com/img/mona.svg",name:"course.MONAcourse",show:!0,amount:1},{path:"dgbsAccess",value:"dgbs",label:"dgb(skein)",imgUrl:"https://m2pool.com/img/dgb.svg",name:"course.dgbsCourse",show:!0,amount:1},{path:"dgbqAccess",value:"dgbq",label:"dgb(qubit)",imgUrl:"https://m2pool.com/img/dgb.svg",name:"course.dgbqCourse",show:!0,amount:1},{path:"dgboAccess",value:"dgbo",label:"dgb(odocrypt)",imgUrl:"https://m2pool.com/img/dgb.svg",name:"course.dgboCourse",show:!0,amount:1},{path:"rxdAccess",value:"rxd",label:"radiant(rxd)",imgUrl:"https://m2pool.com/img/rxd.png",name:"course.RXDcourse",show:!0,amount:100},{path:"enxAccess",value:"enx",label:"Entropyx(enx)",imgUrl:"https://m2pool.com/img/enx.svg",name:"course.ENXcourse",show:!0,amount:5e3},{path:"alphminingPool",value:"alph",label:"alephium",imgUrl:"https://m2pool.com/img/alph.svg",name:"course.alphCourse",show:!0,amount:1}],screenCurrency:"",searchAlgorithm:"",params:{pageNum:"1",pageSize:"10",keyword:""},productListLoading:!1}},mounted(){this.fetchShopList()},methods:{async fetchShopList(t){this.productListLoading=!0;try{const e={pageNum:this.params.pageNum,pageSize:this.params.pageSize},i=t&&"object"===typeof t?t.keyword:this.params.keyword;i&&(e.keyword=i);const s=await(0,a.getShopList)(e);!s||0!==s.code&&200!==s.code?this.products=[]:this.products=Array.isArray(s.rows)?s.rows:[]}catch(e){console.error("获取店铺列表失败:",e),this.products=[]}this.productListLoading=!1},handleAlgorithmSearch(){const t=(this.searchAlgorithm||"").trim();this.params.keyword=t,this.fetchShopList(t?{keyword:t}:void 0)},handleAlgorithmClear(){this.searchAlgorithm="",this.params.keyword="",this.fetchShopList()},handleProductClick(t){const e=t&&(null!=t.shopId?t.shopId:t.id);void 0!==e&&null!==e&&this.$router.push(`/product/${e}`)}}}},9197:function(t,e,i){i.r(e),i.d(e,{default:function(){return n}});var a=i(1968),s=i(845),o={},r=(0,s.A)(o,a.XX,a.Yp,!1,null,null,null),n=r.exports},9252:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.coinList=void 0;e.coinList=[{path:"nexaAccess",value:"nexa",label:"nexa",imgUrl:"https://m2pool.com/img/nexa.png",name:"course.NEXAcourse",show:!0,amount:1e4},{path:"grsAccess",value:"grs",label:"grs",imgUrl:"https://m2pool.com/img/grs.svg",name:"course.GRScourse",show:!0,amount:1},{path:"monaAccess",value:"mona",label:"mona",imgUrl:"https://m2pool.com/img/mona.svg",name:"course.MONAcourse",show:!0,amount:1},{path:"dgbsAccess",value:"dgbs",label:"dgb(skein)",imgUrl:"https://m2pool.com/img/dgb.svg",name:"course.dgbsCourse",show:!0,amount:1},{path:"dgbqAccess",value:"dgbq",label:"dgb(qubit)",imgUrl:"https://m2pool.com/img/dgb.svg",name:"course.dgbqCourse",show:!0,amount:1},{path:"dgboAccess",value:"dgbo",label:"dgb(odocrypt)",imgUrl:"https://m2pool.com/img/dgb.svg",name:"course.dgboCourse",show:!0,amount:1},{path:"rxdAccess",value:"rxd",label:"radiant(rxd)",imgUrl:"https://m2pool.com/img/rxd.png",name:"course.RXDcourse",show:!0,amount:100},{path:"enxAccess",value:"enx",label:"Entropyx(enx)",imgUrl:"https://m2pool.com/img/enx.svg",name:"course.ENXcourse",show:!0,amount:5e3},{path:"alphminingPool",value:"alph",label:"alephium",imgUrl:"https://m2pool.com/img/alph.svg",name:"course.alphCourse",show:!0,amount:1}]},9266:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(3574),s=i(346),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"538996de",null),l=n.exports},9325:function(t,e,i){var a=i(3999)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=void 0;var s=a(i(5471)),o=a(i(1973)),r=i(3723);s.default.use(o.default);const n=new o.default({mode:"history",base:"/",routes:r.mainRoutes});n.beforeEach((t,e,i)=>{t.meta&&t.meta.title?document.title=`${t.meta.title} - Power Leasing`:document.title="Power Leasing - 电商系统",t.meta&&t.meta.allAuthority&&console.log(`访问页面: ${t.meta.title}, 权限: ${t.meta.allAuthority.join(", ")}`),i()}),n.onError(t=>{console.error("路由错误:",t)});e["default"]=n},9510:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(8452),s=i(2515),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"24338a9f",null),l=n.exports},9526:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=void 0;e["default"]={401:"认证失败,无法访问系统资源,请重新登录",403:"当前操作没有权限",404:"访问资源不存在",default:"系统未知错误,请反馈给管理员"}},9532:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"auth-container"},[t._m(0),e("div",{staticClass:"auth-card"},[e("div",{staticClass:"close-btn",attrs:{title:"返回商城"},on:{click:t.goToShop}},[e("i",{staticClass:"el-icon-close"})]),t._m(1),e("el-form",{ref:"resetForm",staticClass:"auth-form",attrs:{model:t.resetForm,rules:t.resetRules},nativeOn:{submit:function(e){return e.preventDefault(),t.handleReset.apply(null,arguments)}}},[e("el-form-item",{attrs:{prop:"email"}},[e("el-input",{attrs:{placeholder:"请输入注册时的邮箱","prefix-icon":"el-icon-message",size:"large",clearable:""},model:{value:t.resetForm.email,callback:function(e){t.$set(t.resetForm,"email",e)},expression:"resetForm.email"}})],1),e("el-form-item",{attrs:{prop:"code"}},[e("div",{staticClass:"code-input-wrapper"},[e("el-input",{attrs:{placeholder:"请输入邮箱验证码","prefix-icon":"el-icon-key",size:"large",maxlength:"10",clearable:""},on:{change:t.handleEmailChange},model:{value:t.resetForm.code,callback:function(e){t.$set(t.resetForm,"code",e)},expression:"resetForm.code"}}),e("el-button",{staticClass:"send-code-btn",attrs:{type:"primary",size:"large",disabled:t.countdown>0,loading:t.sendingCode},on:{click:t.handleSendCode}},[t._v(" "+t._s(t.countdown>0?`${t.countdown}秒后重试`:"获取验证码")+" ")])],1)]),e("el-form-item",{attrs:{prop:"password"}},[e("el-input",{attrs:{type:"password",placeholder:"请输入新密码(8-32位)","prefix-icon":"el-icon-lock",size:"large","show-password":"",clearable:""},model:{value:t.resetForm.password,callback:function(e){t.$set(t.resetForm,"password",e)},expression:"resetForm.password"}}),e("div",{staticClass:"password-tip"},[e("i",{staticClass:"el-icon-info"}),e("span",[t._v("密码需包含大小写字母、数字和特殊字符,长度8-32位")])]),t.resetForm.password?e("div",{staticClass:"password-strength"},[e("span",{staticClass:"strength-label"},[t._v("密码强度:")]),e("span",{class:["strength-bar",t.passwordStrengthClass]},[t._v(" "+t._s(t.passwordStrengthText)+" ")])]):t._e()],1),e("el-form-item",{attrs:{prop:"confirmPassword"}},[e("el-input",{attrs:{type:"password",placeholder:"请再次输入新密码","prefix-icon":"el-icon-lock",size:"large","show-password":"",clearable:""},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleReset.apply(null,arguments)}},model:{value:t.resetForm.confirmPassword,callback:function(e){t.$set(t.resetForm,"confirmPassword",e)},expression:"resetForm.confirmPassword"}})],1),e("el-form-item",[e("el-button",{staticClass:"auth-submit-btn",attrs:{type:"primary",size:"large",loading:t.loading},on:{click:t.handleReset}},[t._v(" "+t._s(t.loading?"重置中...":"确认重置")+" ")])],1),e("div",{staticClass:"auth-footer"},[e("router-link",{staticClass:"link-text link-primary",attrs:{to:"/login"}},[e("i",{staticClass:"el-icon-back"}),t._v(" 返回登录 ")])],1)],1)],1)])},e.Yp=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"auth-background"},[e("div",{staticClass:"bg-circle circle-1"}),e("div",{staticClass:"bg-circle circle-2"}),e("div",{staticClass:"bg-circle circle-3"})])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"auth-header"},[e("h1",{staticClass:"auth-title"},[t._v("重置密码")]),e("p",{staticClass:"auth-subtitle"},[t._v("通过邮箱验证码重置您的密码")])])}]},9594:function(t,e,i){i.r(e),i.d(e,{__esModule:function(){return s.B},default:function(){return l}});var a=i(4408),s=i(3466),o=s.A,r=i(845),n=(0,r.A)(o,a.XX,a.Yp,!1,null,"67a28a08",null),l=n.exports},9628:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"checkout-page"},[e("h1",{staticClass:"page-title"},[t._v("订单结算")]),t.loading?e("div",{staticClass:"loading"},[e("el-loading-spinner"),t._v(" 加载中... ")],1):0===t.cartItems.length?e("div",{staticClass:"empty-cart"},[e("div",{staticClass:"empty-icon"},[t._v("🛒")]),e("h2",[t._v("购物车是空的")]),e("p",[t._v("请先添加商品到购物车")]),e("router-link",{staticClass:"shop-now-btn",attrs:{to:"/productList"}},[t._v(" 去购物 ")])],1):e("div",{staticClass:"checkout-content"},[e("div",{staticClass:"order-summary"},[e("h2",{staticClass:"section-title"},[t._v("订单摘要")]),e("div",{staticClass:"order-items"},t._l(t.cartItems,function(i){return e("div",{key:i.id,staticClass:"order-item"},[e("div",{staticClass:"item-image"},[e("img",{attrs:{src:i.image,alt:i.title}})]),e("div",{staticClass:"item-info"},[e("h3",{staticClass:"item-title"},[t._v(t._s(i.title))]),e("div",{staticClass:"item-price"},[t._v("¥"+t._s(i.price))])]),e("div",{staticClass:"item-quantity"},[e("span",{staticClass:"quantity-label"},[t._v("数量:")]),e("span",{staticClass:"quantity-value"},[t._v(t._s(i.quantity))])]),e("div",{staticClass:"item-total"},[e("span",{staticClass:"total-label"},[t._v("小计:")]),e("span",{staticClass:"total-price"},[t._v("¥"+t._s((i.price*i.quantity).toFixed(2)))])])])}),0),e("div",{staticClass:"order-total"},[e("div",{staticClass:"total-row"},[e("span",[t._v("商品总数:")]),e("span",[t._v(t._s(t.summary.totalQuantity)+" 件")])]),e("div",{staticClass:"total-row"},[e("span",[t._v("商品种类:")]),e("span",[t._v(t._s(t.cartItems.length)+" 种")])]),e("div",{staticClass:"total-row final-total"},[e("span",[t._v("订单总计:")]),e("span",{staticClass:"final-amount"},[t._v("¥"+t._s(t.summary.totalPrice.toFixed(2)))])])])]),e("div",{staticClass:"checkout-form"},[e("h2",{staticClass:"section-title"},[t._v("收货信息")]),e("form",{staticClass:"form",on:{submit:function(e){return e.preventDefault(),t.handleSubmit.apply(null,arguments)}}},[e("div",{staticClass:"form-row"},[e("div",{staticClass:"form-group"},[e("label",{staticClass:"form-label",attrs:{for:"name"}},[t._v("收货人姓名 *")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.form.name,expression:"form.name"}],staticClass:"form-input",attrs:{id:"name",type:"text",required:"",placeholder:"请输入收货人姓名","aria-describedby":"name-error"},domProps:{value:t.form.name},on:{input:function(e){e.target.composing||t.$set(t.form,"name",e.target.value)}}}),t.errors.name?e("div",{staticClass:"error-message",attrs:{id:"name-error"}},[t._v(" "+t._s(t.errors.name)+" ")]):t._e()]),e("div",{staticClass:"form-group"},[e("label",{staticClass:"form-label",attrs:{for:"phone"}},[t._v("联系电话 *")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.form.phone,expression:"form.phone"}],staticClass:"form-input",attrs:{id:"phone",type:"tel",required:"",placeholder:"请输入联系电话","aria-describedby":"phone-error"},domProps:{value:t.form.phone},on:{input:function(e){e.target.composing||t.$set(t.form,"phone",e.target.value)}}}),t.errors.phone?e("div",{staticClass:"error-message",attrs:{id:"phone-error"}},[t._v(" "+t._s(t.errors.phone)+" ")]):t._e()])]),e("div",{staticClass:"form-group"},[e("label",{staticClass:"form-label",attrs:{for:"address"}},[t._v("收货地址 *")]),e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.form.address,expression:"form.address"}],staticClass:"form-textarea",attrs:{id:"address",rows:"3",required:"",placeholder:"请输入详细收货地址","aria-describedby":"address-error"},domProps:{value:t.form.address},on:{input:function(e){e.target.composing||t.$set(t.form,"address",e.target.value)}}}),t.errors.address?e("div",{staticClass:"error-message",attrs:{id:"address-error"}},[t._v(" "+t._s(t.errors.address)+" ")]):t._e()]),e("div",{staticClass:"form-group"},[e("label",{staticClass:"form-label",attrs:{for:"note"}},[t._v("备注")]),e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.form.note,expression:"form.note"}],staticClass:"form-textarea",attrs:{id:"note",rows:"2",placeholder:"可选:订单备注信息"},domProps:{value:t.form.note},on:{input:function(e){e.target.composing||t.$set(t.form,"note",e.target.value)}}})]),e("div",{staticClass:"form-actions"},[e("router-link",{staticClass:"back-btn",attrs:{to:"/cart"}},[t._v(" 返回购物车 ")]),e("button",{staticClass:"submit-btn",attrs:{type:"submit",disabled:t.submitting,"aria-label":"提交订单"}},[t.submitting?e("span",[t._v("提交中...")]):e("span",[t._v("提交订单")])])],1)])])])])},e.Yp=[]},9660:function(t,e,i){Object.defineProperty(e,"B",{value:!0}),e.A=void 0;var a=i(4180);e.A={name:"AccountOrderDetail",data(){return{loading:!1,order:{},items:[]}},created(){this.load()},methods:{async load(){const t=this.$route.params.id;if(t)try{this.loading=!0;const e=await(0,a.getOrdersByIds)({orderId:t}),i=null!=(e&&e.data)?e.data:e;let s={};Array.isArray(i)&&i.length?s=i[0]:i&&"object"===typeof i?s=i:Array.isArray(e&&e.rows)&&e.rows.length&&(s=e.rows[0]),this.order=s||{},this.items=Array.isArray(s&&s.orderItemDtoList)?s.orderItemDtoList:[]}catch(e){console.log("获取订单详情失败")}finally{this.loading=!1}else this.$message({message:"订单ID缺失",type:"error",showClose:!0})},getOrderStatusText(t){const e=Number(t);return 7===e?"进行中":8===e?"已完成":String(null==t?"":t)},formatDateTime(t){if(!t)return"—";try{const e=String(t);return e.includes("T")?e.replace("T"," "):e}catch(e){return String(t)}},formatMachineType(t){if(null===t||void 0===t)return"—";const e=Number(t);return 0===e?"ASIC":1===e?"GPU":"—"},formatPowerRatio(t){if(null===t||void 0===t||""===t)return"—";const e=Number(t);if(!Number.isFinite(e))return"—";const i=100*e,a=i.toFixed(2);return`${a.replace(/\.?0+$/,"")}%`},formatPowerWithUnit(t,e){if(null===t||void 0===t||""===t)return"—";const i=null!=e?String(e).trim():"";return i?`${t} ${i}`:String(t)}}}},9662:function(t,e,i){var a=i(3999)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e.addGoodsV2=b,e.createProduct=r,e.deleteMachine=w,e.deleteProduct=c,e.getList=o,e.getMachineInfo=d,e.getMachineInfoById=p,e.getOwnedById=h,e.getOwnedList=u,e.getPayTypes=m,e.getProductList=n,e.getShopList=v,e.getShopMachineList=C,e.getShopMachineListForSeller=g,e.updateAsicMachine=y,e.updateGpuMachine=f,e.updateProduct=l;var s=a(i(5720));function o(t){return(0,s.default)({url:"/lease/product/getList",method:"get",data:t})}function r(t){return(0,s.default)({url:"/lease/product/add",method:"post",data:t})}function n(t){return(0,s.default)({url:"/lease/product/getList",method:"post",data:t})}function l(t){return(0,s.default)({url:"/lease/product/update",method:"post",data:t})}function c(t){return(0,s.default)({url:"/lease/product/delete",method:"post",data:{id:t}})}function d(t){return(0,s.default)({url:"/lease/product/getMachineInfo",method:"post",data:t})}function u(t){return(0,s.default)({url:"/lease/product/getOwnedList",method:"post",data:t})}function h(t){return(0,s.default)({url:"/lease/product/getOwnedById",method:"post",data:t})}function p(t){return(0,s.default)({url:"/lease/product/getMachineInfoById",method:"post",data:t})}function m(t){return(0,s.default)({url:"/lease/product/getPayTypes",method:"post",data:t})}function g(t){return(0,s.default)({url:"/lease/v2/product/machine/getShopMachineListForSeller",method:"post",data:t})}function f(t){return(0,s.default)({url:"/lease/v2/product/machine/updateGpuMachine",method:"post",data:t})}function y(t){return(0,s.default)({url:"/lease/v2/product/machine/updateAsicMachine",method:"post",data:t})}function w(t){return(0,s.default)({url:"/lease/v2/product/machine/deleteMachine",method:"post",data:t})}function v(t){return(0,s.default)({url:"/lease/v2/product/machine/getShopList",method:"post",data:t})}function C(t){return(0,s.default)({url:"/lease/v2/product/machine/getShopMachineList",method:"post",data:t})}function b(t){return(0,s.default)({url:"/lease/v2/shopping/cart/addGoodsV2",method:"post",data:t})}},9668:function(t,e){e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"account-purchased-machine-config"},[t._m(0),e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:t.tableData,border:"",stripe:"","header-cell-style":{textAlign:"left"},"cell-style":{textAlign:"left"}}},[e("el-table-column",{attrs:{prop:"coin",label:"币种",width:"100"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",[t._v(t._s(i.row.coin||"—"))])]}}])}),e("el-table-column",{attrs:{prop:"algorithm",label:"算法","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",[t._v(t._s(i.row.algorithm||"—"))])]}}])}),e("el-table-column",{attrs:{prop:"pool",label:"矿池","min-width":"140"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",[t._v(t._s(i.row.pool||"—"))])]}}])}),e("el-table-column",{attrs:{prop:"walletAddress",label:"钱包地址","min-width":"200"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("div",{staticClass:"address-cell"},[i.row.walletAddress?e("span",{staticClass:"mono-ellipsis",staticStyle:{"font-family":"monospace"}},[t._v(t._s(i.row.walletAddress))]):e("span",[t._v("—")]),i.row.walletAddress?e("el-button",{staticClass:"copy-btn",attrs:{type:"text",size:"mini",icon:"el-icon-document-copy"},on:{click:function(e){return t.handleCopy(i.row.walletAddress,"钱包地址")}}},[t._v(" 复制 ")]):t._e()],1)]}}])}),e("el-table-column",{attrs:{prop:"poolUrl",label:"矿池地址","min-width":"200"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("div",{staticClass:"address-cell"},[i.row.poolUrl?e("span",{staticClass:"mono-ellipsis"},[t._v(t._s(i.row.poolUrl))]):e("span",[t._v("—")]),i.row.poolUrl?e("el-button",{staticClass:"copy-btn",attrs:{type:"text",size:"mini",icon:"el-icon-document-copy"},on:{click:function(e){return t.handleCopy(i.row.poolUrl,"矿池地址")}}},[t._v(" 复制 ")]):t._e()],1)]}}])}),e("el-table-column",{attrs:{label:"操作",width:"120",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(e){return t.handleViewDetail(i.row)}}},[t._v(" 详情 ")])]}}])})],1),e("div",{staticClass:"pagination"},[e("el-pagination",{attrs:{background:"",layout:"total, sizes, prev, pager, next, jumper",total:t.total,"current-page":t.pagination.pageNum,"page-sizes":[10,20,50,100],"page-size":t.pagination.pageSize},on:{"update:currentPage":function(e){return t.$set(t.pagination,"pageNum",e)},"update:current-page":function(e){return t.$set(t.pagination,"pageNum",e)},"update:pageSize":function(e){return t.$set(t.pagination,"pageSize",e)},"update:page-size":function(e){return t.$set(t.pagination,"pageSize",e)},"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1)],1)},e.Yp=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"toolbar"},[e("div",{staticClass:"left-area"},[e("h2",{staticClass:"page-title"},[t._v("挖矿信息")])])])}]},9814:function(t,e,i){var a=i(3999)["default"];Object.defineProperty(e,"B",{value:!0}),e.A=void 0;var s=a(i(1774));i(4114),i(8111),i(8237);var o=i(5952),r=i(6067),n=i(5844),l=i(5720);e.A={name:"Header",data(){return{user:null,cart:[],cartServerCount:0,navigation:r.mainNavigation,userEmail:"",isLoggedIn:!1,isLoginStatusLoading:!0}},computed:{cartItemCount(){return Number.isFinite(this.cartServerCount)?this.cartServerCount:0},breadcrumbs(){return(0,r.getBreadcrumb)(this.$route.path)}},watch:{},async mounted(){await this.updateLoginStatus(),this.loadCart(),window.addEventListener("storage",this.handleStorageChange),this.loadServerCartCount(),window.addEventListener("cart-updated",this.handleCartUpdated),window.addEventListener("login-status-changed",this.handleLoginStatusChanged),this.loadUserEmail()},beforeDestroy(){window.removeEventListener("storage",this.handleStorageChange),window.removeEventListener("cart-updated",this.handleCartUpdated),window.removeEventListener("login-status-changed",this.handleLoginStatusChanged)},methods:{isNavActive(t){const e=this.$route&&this.$route.path||"";return("/account/security-settings"!==e||"/account"!==t)&&(e===t||"/"!==t&&e.startsWith(t+"/"))},loadCart(){this.cart=(0,o.readCart)()},async loadServerCartCount(){try{const t=await(0,n.getGoodsListV2)();let e=0;Array.isArray(t&&t.rows)?e=t.rows.reduce((t,e)=>{const i=Array.isArray(e&&e.cartMachineInfoDtoList)?e.cartMachineInfoDtoList:[];return t+i.length},0):Array.isArray(t&&t.data&&t.data.rows)&&(e=t.data.rows.reduce((t,e)=>{const i=Array.isArray(e&&e.cartMachineInfoDtoList)?e.cartMachineInfoDtoList:[];return t+i.length},0)),this.cartServerCount=Number.isFinite(e)?e:0}catch(t){console.error("加载购物车数量失败:",t)}},async handleStorageChange(t){"power_leasing_cart_v1"===t.key?(this.loadCart(),this.loadServerCartCount()):"leasToken"===t.key&&(await this.updateLoginStatus(),t.newValue?this.loadUserEmail():this.userEmail="")},async handleLoginStatusChanged(){this.isLoginStatusLoading=!1,await this.updateLoginStatus(),this.isLoggedIn?this.loadUserEmail():this.userEmail=""},async updateLoginStatus(){try{const t=await(0,l.getToken)(!0);this.isLoggedIn=!!t&&"null"!==t&&"undefined"!==t}catch(t){console.error("更新登录状态失败:",t),this.isLoggedIn=!1}finally{this.isLoginStatusLoading=!1}},handleCartUpdated(t){try{const e=t&&t.detail&&Number(t.detail.count);if(Number.isFinite(e))return void(this.cartServerCount=e)}catch(e){}this.loadServerCartCount()},goToLogin(){this.$router.push("/login")},goToRegister(){this.$router.push("/register")},loadUserEmail(){try{const t=localStorage.getItem("userInfo");if(t){const e=JSON.parse(t);this.userEmail=e.userName||e.email||e.username||"用户"}}catch(t){console.error("读取用户信息失败:",t),this.userEmail=""}},async handleLogout(){const{clearToken:t}=await Promise.resolve().then(()=>(0,s.default)(i(5720)));await t(),localStorage.removeItem("userInfo"),localStorage.removeItem("leasEmail"),localStorage.removeItem("userId"),localStorage.removeItem("username"),this.updateLoginStatus(),this.user=null,this.cart=[],this.userEmail="",window.dispatchEvent(new CustomEvent("login-status-changed")),this.$message.success("退出登录成功"),this.$router.push("/login")},getBreadcrumbPath(t){const e=["/productList","/cart","/checkout"];return 0===t?"/productList":t=o)&&Object.keys(i.O).every(function(t){return i.O[t](a[l])})?a.splice(l--,1):(n=!1,o0&&t[d-1][2]>o;d--)t[d]=t[d-1];t[d]=[a,s,o]}}(),function(){i.d=function(t,e){for(var a in e)i.o(e,a)&&!i.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})}}(),function(){i.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"===typeof window)return window}}()}(),function(){i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}}(),function(){i.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}}(),function(){i.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t}}(),function(){i.p="/"}(),function(){var t={524:0};i.O.j=function(e){return 0===t[e]};var e=function(e,a){var s,o,r=a[0],n=a[1],l=a[2],c=0;if(r.some(function(e){return 0!==t[e]})){for(s in n)i.o(n,s)&&(i.m[s]=n[s]);if(l)var d=l(i)}for(e&&e(a);c