2 lines
312 KiB
JavaScript
2 lines
312 KiB
JavaScript
(function(){var t={346:function(t,e,a){"use strict";Object.defineProperty(e,"B",{value:!0}),e.A=void 0,a(4114);var s=a(9252),i=a(9662);e.A={name:"AccountProductNew",data(){const t=(t,e,a)=>{"string"!==typeof e||0!==e.trim().length?a():a(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)},a=(t,a,s)=>{"string"===typeof a&&e(a)?s(new Error("商品名称不能包含表情符号")):s()};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:a,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 s.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,i.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,a){"use strict";var s=a(3999)["default"];Object.defineProperty(e,"B",{value:!0}),e.A=void 0;var i=a(4180),o=s(a(8967));e.A={name:"AccountOrders",components:{OrderList:o.default},data(){return{active:"7",orders:{7:[],8:[],9:[]},loading:!1}},created(){const t=this.$route&&this.$route.query&&this.$route.query.status?String(this.$route.query.status):null,e=localStorage.getItem("orderListActiveTab"),a=t||e||"7";this.active=a,this.fetchOrders(a)},methods:{async fetchCancelOrder(t){const e=await(0,i.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(a){console.warn("保存标签页状态失败:",a)}this.fetchOrders(e)},async fetchOrders(t){const e=String(t);try{this.loading=!0;const a=await(0,i.getOrdersByStatus)({status:Number(t)}),s=null!=(a&&a.data)?a.data:a,o=Array.isArray(s)?s:Array.isArray(s&&s.rows)?s.rows:[];this.$set(this.orders,e,o)}catch(a){console.log(a,"获取订单失败")}finally{this.loading=!1}}}}},465:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.initNoEmojiGuard=void 0;const a=()=>{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(),a=["checkbox","radio","file","hidden","button","submit","reset","range","color","date","datetime-local","month","time","week"];return-1===a.indexOf(e)}return"TEXTAREA"===e},a=(t,e)=>{try{t.__noEmojiComposing=e}catch(a){}},s=t=>!(!t||!t.__noEmojiComposing);function i(e){const a=String(e.value??"");if(!a)return;if(!t.test(a))return;const s=e.selectionStart,i=e.selectionEnd,o=a.replace(t,"");if(o===a)return;e.value=o;try{if("number"===typeof s&&"number"===typeof i){const t=a.length-o.length,i=Math.max(0,s-t);e.setSelectionRange(i,i)}}catch(n){}const r=new Event("input",{bubbles:!0});e.dispatchEvent(r)}document.addEventListener("compositionstart",t=>{e(t.target)&&a(t.target,!0)},!0),document.addEventListener("compositionend",t=>{e(t.target)&&(a(t.target,!1),i(t.target))},!0),document.addEventListener("input",t=>{const a=t.target;e(a)&&(s(a)||i(a))},!0)};e.initNoEmojiGuard=a},589:function(t,e,a){"use strict";a.r(e),a.d(e,{__esModule:function(){return i.B},default:function(){return l}});var s=a(3663),i=a(7692),o=i.A,r=a(845),n=(0,r.A)(o,s.XX,s.Yp,!1,null,"3ba79d9c",null),l=n.exports},950:function(t,e){"use strict";e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{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.handleGuardExpand}},[e("el-table-column",{attrs:{type:"expand",width:"46",expandable:()=>!1},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-table",{ref:"innerTable-"+a.row.id,staticStyle:{width:"100%"},attrs:{data:a.row.productMachineDtoList||[],size:"small",border:"","row-key":"id","reserve-selection":"","header-cell-style":{textAlign:"left"},"cell-style":{textAlign:"left"}},on:{"selection-change":e=>t.handleShopInnerSelectionChange(a.row,e)}},[e("el-table-column",{attrs:{type:"selection",width:"46",selectable:e=>t.isRowSelectableByShop(a.row,e)}}),e("el-table-column",{attrs:{prop:"name",label:"商品名称"}}),e("el-table-column",{attrs:{prop:"miner",label:"机器编号"}}),e("el-table-column",{attrs:{prop:"algorithm",label:"算法"}}),e("el-table-column",{attrs:{prop:"powerDissipation",label:"功耗(kw/h)"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("span",{staticClass:"num-strong"},[t.formatNum6(a.row.powerDissipation).truncated?e("el-tooltip",{attrs:{content:t.formatNum6(a.row.powerDissipation).full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatNum6(a.row.powerDissipation).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatNum6(a.row.powerDissipation).text))])],1)]}}],null,!0)}),e("el-table-column",{attrs:{prop:"theoryPower",label:"理论算力"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("span",{staticClass:"num-strong"},[t.formatNum6(a.row.theoryPower).truncated?e("el-tooltip",{attrs:{content:t.formatNum6(a.row.theoryPower).full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatNum6(a.row.theoryPower).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatNum6(a.row.theoryPower).text))])],1),e("span",{directives:[{name:"show",rawName:"v-show",value:a.row.theoryPower,expression:"scope.row.theoryPower"}]},[t._v(" "+t._s(a.row.unit)+" ")])]}}],null,!0)}),e("el-table-column",{attrs:{prop:"computingPower",label:"实际算力"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("span",{staticClass:"num-strong"},[t.formatNum6(a.row.computingPower).truncated?e("el-tooltip",{attrs:{content:t.formatNum6(a.row.computingPower).full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatNum6(a.row.computingPower).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatNum6(a.row.computingPower).text))])],1),e("span",{directives:[{name:"show",rawName:"v-show",value:a.row.computingPower,expression:"scope.row.computingPower"}]},[t._v(" "+t._s(a.row.unit)+" ")])]}}],null,!0)}),e("el-table-column",{attrs:{prop:"theoryIncome",label:"单机理论收入(每日/币种)"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("span",{staticClass:"num-strong"},[t.formatNum6(a.row.theoryIncome).truncated?e("el-tooltip",{attrs:{content:t.formatNum6(a.row.theoryIncome).full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatNum6(a.row.theoryIncome).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatNum6(a.row.theoryIncome).text))])],1),e("span",{directives:[{name:"show",rawName:"v-show",value:a.row.coin,expression:"scope.row.coin"}]},[t._v(" "+t._s(t.toUpperText(a.row.coin))+" ")])]}}],null,!0)}),e("el-table-column",{attrs:{prop:"theoryUsdtIncome",label:"单机理论收入(每日/USDT)"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("span",{staticClass:"num-strong"},[t.formatNum6(a.row.theoryUsdtIncome).truncated?e("el-tooltip",{attrs:{content:t.formatNum6(a.row.theoryUsdtIncome).full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatNum6(a.row.theoryUsdtIncome).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatNum6(a.row.theoryUsdtIncome).text))])],1)]}}],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(a.row)||"USDT")+")")]},proxy:!0},{key:"default",fn:function(s){return[null!=t.getMachineUnitPriceBySelection(a.row,s.row)?[e("span",{staticClass:"price-strong"},[t.formatAmount(t.getMachineUnitPriceBySelection(a.row,s.row),t.getSelectedCoinSymbolForShop(a.row)).truncated?e("el-tooltip",{attrs:{content:t.formatAmount(t.getMachineUnitPriceBySelection(a.row,s.row),t.getSelectedCoinSymbolForShop(a.row)).full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(t.getMachineUnitPriceBySelection(a.row,s.row),t.getSelectedCoinSymbolForShop(a.row)).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(" "+t._s(t.formatAmount(t.getMachineUnitPriceBySelection(a.row,s.row),t.getSelectedCoinSymbolForShop(a.row)).text)+" ")])],1)]:[t._v("-")]]}}],null,!0)}),e("el-table-column",{attrs:{label:"租赁天数",width:"145"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-input-number",{attrs:{min:1,max:t.getRowMaxLeaseDaysLocal(a.row),precision:0,step:1,size:"mini","controls-position":"right"},on:{change:function(e){return t.handleLeaseTimeChange(a.row)},input:function(e){return t.handleLeaseTimeInput(a.row,e)}},model:{value:a.row.leaseTime,callback:function(e){t.$set(a.row,"leaseTime",e)},expression:"scope.row.leaseTime"}})]}}],null,!0)}),e("el-table-column",{attrs:{label:"最大可租(天)","min-width":"60"},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:"110"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-tag",{attrs:{type:1===Number(a.row.del)||1===Number(a.row.state)?"info":"success"}},[t._v(" "+t._s(1===Number(a.row.del)||1===Number(a.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(a.row)||"USDT")+")")]},proxy:!0},{key:"default",fn:function(s){return[null!=t.getMachineUnitPriceBySelection(a.row,s.row)?[e("span",{staticClass:"price-strong"},[t.formatAmount(t.getMachineUnitPriceBySelection(a.row,s.row)*Number(s.row.leaseTime||1),t.getSelectedCoinSymbolForShop(a.row)).truncated?e("el-tooltip",{attrs:{content:t.formatAmount(t.getMachineUnitPriceBySelection(a.row,s.row)*Number(s.row.leaseTime||1),t.getSelectedCoinSymbolForShop(a.row)).full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(t.getMachineUnitPriceBySelection(a.row,s.row)*Number(s.row.leaseTime||1),t.getSelectedCoinSymbolForShop(a.row)).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(" "+t._s(t.formatAmount(t.getMachineUnitPriceBySelection(a.row,s.row)*Number(s.row.leaseTime||1),t.getSelectedCoinSymbolForShop(a.row)).text)+" ")])],1)]:[t._v("-")]]}}],null,!0)})],1)]}}])}),e("el-table-column",{attrs:{prop:"name",label:"店铺名称"}}),e("el-table-column",{attrs:{prop:"totalMachine",label:"机器总数"}}),e("el-table-column",{attrs:{prop:"totalPrice"},scopedSlots:t._u([{key:"header",fn:function(){return[t._v(" 总价("+t._s(t.getSelectedCoinSymbolForShopHeader())+") ")]},proxy:!0},{key:"default",fn:function(a){return[e("span",{staticClass:"price-strong"},[t.formatAmount(t.displayShopTotalBySelection(a.row),t.getSelectedCoinSymbolForShop(a.row)).truncated?e("el-tooltip",{attrs:{content:t.formatAmount(t.displayShopTotalBySelection(a.row),t.getSelectedCoinSymbolForShop(a.row)).full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(t.displayShopTotalBySelection(a.row),t.getSelectedCoinSymbolForShop(a.row)).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(" "+t._s(t.formatAmount(t.displayShopTotalBySelection(a.row),t.getSelectedCoinSymbolForShop(a.row)).text)+" ")])],1)]}}])}),e("el-table-column",{attrs:{label:"支付方式"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-select",{staticStyle:{"min-width":"180px"},attrs:{placeholder:"请选择",size:"mini"},on:{change:e=>t.handleShopPayChange(a.row,e)},scopedSlots:t._u([{key:"prefix",fn:function(){return[t.getSelectedPayIcon(a.row)?e("img",{staticStyle:{width:"16px",height:"16px","margin-right":"6px","border-radius":"3px"},attrs:{src:t.getSelectedPayIcon(a.row),alt:t.getSelectedCoinSymbolForShop(a.row)}}):t._e()]},proxy:!0}],null,!0),model:{value:t.paySelectionMap[a.row.id],callback:function(e){t.$set(t.paySelectionMap,a.row.id,e)},expression:"paySelectionMap[scope.row.id]"}},t._l(t.getShopPayOptions(a.row),function(a,s){return e("el-option",{key:s,attrs:{value:a.value,label:a.label}},[e("div",{staticStyle:{display:"flex","align-items":"center",gap:"8px"}},[e("img",{staticStyle:{width:"18px",height:"18px","border-radius":"3px"},attrs:{src:a.icon,alt:a.label}}),e("span",[t._v(t._s(a.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("金额合计(USDT):")]),e("span",{staticClass:"price-strong"},[t.formatAmount(t.selectedTotal,"USDT").truncated?e("el-tooltip",{attrs:{content:t.formatAmount(t.selectedTotal,"USDT").full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(t.selectedTotal,"USDT").text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatAmount(t.selectedTotal,"USDT").text))])],1)]),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: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(a){return e("div",{key:a.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(a.shopName||a.shopId)+" "),e("span",{staticStyle:{"margin-left":"12px",color:"#666","font-weight":"400"}},[t._v("支付方式:"+t._s(a.payLabel))])]),e("div",[a.coinSymbol?[a.enough?e("span",{staticStyle:{color:"#16a34a","font-weight":"600"}},[t._v(" 已满足起付额 "+t._s(t.formatAmount(a.deductibleAmount||0,a.coinSymbol).text)+" ")]):e("span",{staticStyle:{color:"#ef4444","font-weight":"600"}},[t._v(" 金额不足最低起付额 "+t._s(t.formatAmount(a.deductibleAmount||0,a.coinSymbol).text)+" ,收取手续费 "+t._s(t.formatAmount(a.fee||0,a.coinSymbol).text)+" ")])]:t._e()],2)]),e("el-table",{attrs:{data:a.items,"max-height":"260",border:"",stripe:"","header-cell-style":{textAlign:"left"},"cell-style":{textAlign:"left"}}},[e("el-table-column",{attrs:{prop:"product",label:"商品","min-width":"160"}}),e("el-table-column",{attrs:{prop:"coin",label:"币种","min-width":"100"}}),e("el-table-column",{attrs:{prop:"user",label:"账户","min-width":"120"}}),e("el-table-column",{attrs:{prop:"miner",label:"机器编号","min-width":"160"}}),e("el-table-column",{attrs:{prop:"unitPrice","min-width":"140"},scopedSlots:t._u([{key:"header",fn:function(){return[t._v("单价("+t._s(a.coinSymbol||"USDT")+")")]},proxy:!0},{key:"default",fn:function(s){return[e("span",{staticClass:"price-strong"},[t.formatAmount(s.row.unitPrice,a.coinSymbol).truncated?e("el-tooltip",{attrs:{content:t.formatAmount(s.row.unitPrice,a.coinSymbol).full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(s.row.unitPrice,a.coinSymbol).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatAmount(s.row.unitPrice,a.coinSymbol).text))])],1)]}}],null,!0)}),e("el-table-column",{attrs:{prop:"leaseTime",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(a.coinSymbol||"USDT")+")")]},proxy:!0},{key:"default",fn:function(s){return[e("span",{staticClass:"price-strong"},[t.formatAmount(s.row.subtotal,a.coinSymbol).truncated?e("el-tooltip",{attrs:{content:t.formatAmount(s.row.subtotal,a.coinSymbol).full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(s.row.subtotal,a.coinSymbol).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatAmount(s.row.subtotal,a.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(a,s){return e("span",{key:s,staticStyle:{"margin-left":"12px"}},[t._v(" "+t._s(s)+": "),e("span",{staticClass:"price-strong"},[t.formatAmount(a,s).truncated?e("el-tooltip",{attrs:{content:t.formatAmount(a,s).full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(a,s).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatAmount(a,s).text))])],1)])}):[t._v("-")]],2)],2)]),e("el-dialog",{attrs:{visible:t.noticeDialog.visible,width:"680px",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.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.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=[]},1029:function(t,e,a){"use strict";Object.defineProperty(e,"B",{value:!0}),e.A=void 0,a(8111),a(7588),a(1701);var s=a(9662),i=a(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 a=Number(e._selectedPayIndex||0),s=Array.isArray(e.priceList)?e.priceList:[],i=s[a]||{};this.$set(this.machineList,t,{...e,_priceEditing:String(i.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,s.getMachineInfoById)(t),a=e?.data||{};this.product=a,this.ranges=Array.isArray(a.productMachineRangeList)?a.productMachineRangeList:[]}catch(e){console.error("获取商品详情失败",e),console.log("获取商品详情失败")}finally{this.loading=!1}},async fetchMachineList(t){const e=await(0,i.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:[],a=0,s=e[a]||{};return{...t,_selectedPayIndex:a,_priceEditing:String(s.price??"")}}),this.refreshStateSnapshot(),this.refreshFieldSnapshot()}},refreshStateSnapshot(){const t={},e=Array.isArray(this.machineList)?this.machineList:[];for(let a=0;a<e.length;a+=1){const s=e[a];s&&"undefined"!==typeof s.id&&(t[s.id]=s.state)}this.stateSnapshot=t},refreshFieldSnapshot(){const t={},e=Array.isArray(this.machineList)?this.machineList:[];for(let a=0;a<e.length;a+=1){const s=e[a];if(!s||"undefined"===typeof s.id)continue;const i={};Array.isArray(s.priceList)&&s.priceList.forEach(t=>{t&&(i[String(t.payTypeId??"")]=String(t.price??""))}),t[s.id]={theoryPower:String(s.theoryPower??""),powerDissipation:String(s.powerDissipation??""),type:String(s.type??""),priceMap:i,maxLeaseDays:String(s.maxLeaseDays??"")}}this.fieldSnapshot=t},isCellChanged(t,e){if(!t||"undefined"===typeof t.id)return!1;const a=this.fieldSnapshot[t.id]||{};if("price"===e){const e=Number(t._selectedPayIndex||0),s=Array.isArray(t.priceList)&&t.priceList[e]?t.priceList[e]:null,i=String(s&&s.payTypeId?s.payTypeId:e),o=String(s&&null!=s.price?s.price:""),r=String(a.priceMap&&a.priceMap[i]||"");return o!==r}const s=String(t[e]??""),i=String(a[e]??"");return s!==i},restoreStateSnapshot(){if(this.machineList&&this.machineList.length)for(let t=0;t<this.machineList.length;t+=1){const e=this.machineList[t];if(!e||"undefined"===typeof e.id)continue;const a=this.stateSnapshot[e.id];"undefined"!==typeof a&&this.$set(this.machineList[t],"state",a)}},async updateMachineList(t){this.updateLoading=!0;try{const e=await(0,i.updateMachine)(t);e&&200===e.code?(this.$message.success("更新成功"),this.fetchMachineList({id:this.productId})):this.restoreStateSnapshot()}catch(e){this.restoreStateSnapshot()}this.updateLoading=!1},async deleteMachine(t){const e=await(0,i.deleteMachine)(t);e&&200===e.code&&(this.$message.success("删除成功"),this.fetchMachineList({id:this.productId}))},handleTheoryPowerInput(t){const e=this.machineList&&this.machineList[t];if(!e||this.isRowDisabled(e))return;let a=String(this.machineList[t].theoryPower??"");a=a.replace(/[^0-9.]/g,"");const s=a.indexOf(".");-1!==s&&(a=a.slice(0,s+1)+a.slice(s+1).replace(/\./g,""));const i=a.endsWith("."),o=a.split(".");let r=o[0]||"",n=o[1]||"";r.length>6&&(r=r.slice(0,6)),n&&(n=n.slice(0,4)),a=n.length?`${r}.${n}`:i?`${r}.`:r,this.$set(this.machineList,t,{...this.machineList[t],theoryPower:a})},handleNumericCell(t,e){const a=this.machineList&&this.machineList[t];if(!a||this.isRowDisabled(a))return;let s=String("price"===e?this.machineList[t]._priceEditing??"":this.machineList[t][e]??"");s=s.replace(/[^0-9.]/g,"");const i=s.indexOf(".");if(-1!==i&&(s=s.slice(0,i+1)+s.slice(i+1).replace(/\./g,"")),"powerDissipation"===e){const t=s.endsWith("."),e=s.split(".");let a=e[0]||"",i=e[1]||"";a.length>6&&(a=a.slice(0,6)),i&&(i=i.slice(0,4)),s=i.length?`${a}.${i}`:t?`${a}.`:a}else if("price"===e){const e=s.endsWith("."),a=s.split(".");let i=a[0]||"",o=a[1]||"";i.length>12&&(i=i.slice(0,12)),o&&(o=o.slice(0,2)),s=o.length?`${i}.${o}`:e?`${i}.`:i,this.$set(this.machineList[t],"_priceEditing",s);const r=this.machineList[t],n=Number(r._selectedPayIndex||0);Array.isArray(r.priceList)&&r.priceList[n]&&this.$set(r.priceList[n],"price",s)}else if(-1!==i){const[t,e]=s.split(".");s=t+"."+(e?e.slice(0,6):"")}if("price"!==e){const a={...this.machineList[t],[e]:s};this.$set(this.machineList,t,a)}},handlePriceBlur(t){const e=String(this.machineList[t]._priceEditing??""),a=/^\d{1,12}(\.\d{1,2})?$/;if(!e||Number(e)<=0||!a.test(e)){this.$message.warning("单价必须大于0,整数最多12位,小数最多2位"),this.$set(this.machineList[t],"_priceEditing","");const e=this.machineList[t],a=Number(e._selectedPayIndex||0);Array.isArray(e.priceList)&&e.priceList[a]&&this.$set(e.priceList[a],"price","")}},handleMaxLeaseDaysInput(t){const e=this.machineList&&this.machineList[t];if(!e||this.isRowDisabled(e))return;let a=String(this.machineList[t].maxLeaseDays??"");a=a.replace(/\D/g,""),a.length>3&&(a=a.slice(0,3));const s={...this.machineList[t],maxLeaseDays:a};this.$set(this.machineList,t,s)},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 a=Number(e);if(!Number.isInteger(a)||a<1||a>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??""),a=/^\d{1,6}(\.\d{1,4})?$/;if(!e||Number(e)<=0||!a.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??""),a=/^\d{1,6}(\.\d{1,4})?$/;if(!e||Number(e)<=0||!a.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 a={...this.machineList[t],type:this.machineList[t].type};this.$set(this.machineList,t,a)},handleStateChange(t){const e=this.machineList&&this.machineList[t];if(!e||this.isRowDisabled(e))return;const a={...this.machineList[t],state:this.machineList[t].state};this.$set(this.machineList,t,a)},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,i.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})?$/,a=t=>"string"===typeof t&&0===t.trim().length&&t.length>0;for(let i=0;i<this.machineList.length;i+=1){const s=this.machineList[i],o=s&&(s.miner||s.id||i+1),r=String(s.theoryPower??""),n=String(s._priceEditing??""),l=String(s.type??""),c=String(s.powerDissipation??""),d=String(s.maxLeaseDays??"");if(!r||Number(r)<=0||!t.test(r))return void this.$message.warning(`第${i+1}行(机器:${o}) 理论算力必须大于0,整数最多6位,小数最多4位`);if(!c||Number(c)<=0||!t.test(c))return void this.$message.warning(`第${i+1}行(机器:${o}) 功耗必须大于0,整数最多6位,小数最多4位`);if(!n||Number(n)<=0||!e.test(n))return void this.$message.warning(`第${i+1}行(机器:${o}) 单价必须大于0,整数最多12位,小数最多2位`);if(!/^\d{1,3}$/.test(d)||!Number.isInteger(Number(d))||Number(d)<1||Number(d)>365)return void this.$message.warning(`第${i+1}行(机器:${o}) 最大租赁天数需为 1-365 的整数`);if(l&&a(l))return void this.$message.warning(`第${i+1}行(机器:${o}) 型号不能全是空格`)}const s=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(s,"payload"),await this.updateMachineList(s)}catch(t){}else this.$message.warning("没有可提交的数据")},handleBack(){this.$router.back()}}}},1043:function(t,e,a){"use strict";a.r(e),a.d(e,{__esModule:function(){return i.B},default:function(){return l}});var s=a(2224),i=a(1507),o=i.A,r=a(845),n=(0,r.A)(o,s.XX,s.Yp,!1,null,"7050467e",null),l=n.exports},1074:function(t,e){"use strict";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:"输入币种或算法关键字后回车/搜索",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)]),e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:t.tableData,border:"",stripe:""}},[e("el-table-column",{attrs:{prop:"name",label:"名称"}}),e("el-table-column",{attrs:{prop:"coin",label:"币种"}}),e("el-table-column",{attrs:{label:"支持结算方式"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("div",{staticClass:"paytypes"},t._l(a.row.payTypes||[],function(a,s){return e("el-tooltip",{key:s,attrs:{content:t.formatPayType(a),placement:"top","open-delay":80}},[e("img",{staticClass:"paytype-icon",attrs:{src:a.image,alt:t.formatPayType(a)}})])}),1)]}}])}),e("el-table-column",{attrs:{prop:"algorithm",label:"算法"}}),e("el-table-column",{attrs:{prop:"type",label:"商品类型"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-tag",{attrs:{type:1===a.row.type?"success":"warning"}},[t._v(" "+t._s(1===a.row.type?"算力套餐":"挖矿机器")+" ")])]}}])}),e("el-table-column",{attrs:{prop:"saleNumber",label:"已售数量"}}),e("el-table-column",{attrs:{prop:"totalMachineNumber",label:"该商品总机器数量"}}),e("el-table-column",{attrs:{prop:"state",label:"状态"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-tag",{attrs:{type:1===a.row.state?"info":"success"}},[t._v(" "+t._s(1===a.row.state?"下架":"上架")+" ")])]}}])}),e("el-table-column",{attrs:{label:"操作",fixed:"right",width:"220"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-button",{attrs:{type:"text",size:"small"},on:{click:function(e){return t.handleView(a.row)}}},[t._v("详情")]),e("el-button",{attrs:{type:"text",size:"small"},on:{click:function(e){return t.handleEdit(a.row)}}},[t._v("修改")]),e("el-button",{staticStyle:{color:"#f56c6c"},attrs:{type:"text",size:"small"},on:{click:function(e){return t.handleDelete(a.row)}}},[t._v("删除")]),e("el-button",{attrs:{type:"text",size:"small"},on:{click:function(e){return t.handleAddMachine(a.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),e("el-dialog",{attrs:{visible:t.editDialog.visible,"close-on-click-modal":!1,width:"620px",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":"100px"}},[e("el-form-item",{attrs:{label:"名称"}},[e("el-input",{attrs:{maxlength:"30","show-word-limit":""},model:{value:t.editDialog.form.name,callback:function(e){t.$set(t.editDialog.form,"name",e)},expression:"editDialog.form.name"}})],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:"描述"}},[e("el-input",{attrs:{type:"textarea",rows:4,maxlength:"100","show-word-limit":""},model:{value:t.editDialog.form.description,callback:function(e){t.$set(t.editDialog.form,"description",e)},expression:"editDialog.form.description"}})],1)],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("商品列表")])])}]},1182:function(t,e,a){"use strict";a.r(e),a.d(e,{__esModule:function(){return i.B},default:function(){return l}});var s=a(2038),i=a(7570),o=i.A,r=a(845),n=(0,r.A)(o,s.XX,s.Yp,!1,null,null,null),l=n.exports},1193:function(t,e,a){"use strict";var s=a(3999)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e.addSingleOrBatchMachine=o,e.deleteMachine=r,e.getMachineListForUpdate=d,e.getUserMachineList=n,e.getUserMinersList=l,e.updateMachine=c;var i=s(a(5720));function o(t){return(0,i.default)({url:"/lease/product/machine/addSingleOrBatchMachine",method:"post",data:t})}function r(t){return(0,i.default)({url:"/lease/product/machine/delete",method:"post",data:t})}function n(t){return(0,i.default)({url:"/lease/product/machine/getUserMachineList",method:"post",data:t})}function l(t){return(0,i.default)({url:"/lease/product/machine/getUserMinersList",method:"post",data:t})}function c(t){return(0,i.default)({url:"/lease/product/machine/updateMachine",method:"post",data:t})}function d(t){return(0,i.default)({url:"/lease/product/machine/getMachineListForUpdate",method:"post",data:t})}},1220:function(t,e,a){"use strict";a.r(e),a.d(e,{__esModule:function(){return i.B},default:function(){return l}});var s=a(5508),i=a(1872),o=i.A,r=a(845),n=(0,r.A)(o,s.XX,s.Yp,!1,null,"9935370e",null),l=n.exports},1259:function(t,e,a){"use strict";Object.defineProperty(e,"B",{value:!0}),e.A=void 0,a(4114),a(8111),a(3579);e.A={name:"AccountPage",data(){return{activeIndex:"1",userEmail:"",activeRole:"seller",buyerLinks:[{label:"我的钱包",to:"/account/wallet"},{label:"已购商品",to:"/account/purchased"},{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/receipt-record"}]}},computed:{userInitial(){const t=(this.userEmail||"").trim();return t?t[0].toUpperCase():"?"},displayedLinks(){return"buyer"===this.activeRole?this.buyerLinks:this.sellerLinks}},mounted(){const t=t=>{const e=localStorage.getItem(t);if(null==e)return null;try{return JSON.parse(e)}catch(a){return e}},e=t("leasEmail")||"";this.userEmail="string"===typeof e?e:String(e);const a=t("accountActiveRole");"buyer"!==a&&"seller"!==a||(this.activeRole=a),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 a="buyer"===e?"buyer":"seller"===e?"seller":this.activeRole;if(this.activeRole!==a){this.activeRole=a;try{localStorage.setItem("accountActiveRole",JSON.stringify(a))}catch(r){}}return}const e=["/account/wallet","/account/purchased","/account/purchased-detail","/account/orders","/account/funds-flow"],a=["/account/shops","/account/shop-new","/account/product-new","/account/products","/account/product-detail","/account/product-machine-add","/account/seller-orders","/account/receipt-record","/account/shop-config"],s=e.some(e=>0===t.indexOf(e)),i=a.some(e=>0===t.indexOf(e)),o=s?"buyer":i?"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 a=e;if(!a)try{a=sessionStorage.getItem("orderDetailFrom")||""}catch(i){a=""}return"buyer"===a&&"/account/orders"===t||"seller"===a&&"/account/seller-orders"===t}const a={"/account/seller-orders":["/account/seller-orders"],"/account/products":["/account/products","/account/product-detail"],"/account/purchased":["/account/purchased","/account/purchased-detail"]},s=a[t];return Array.isArray(s)?s.some(t=>0===e.indexOf(t)):0===e.indexOf(t)}},watch:{"$route.path":{immediate:!0,handler(){this.setActiveRoleByRoute()}}}}},1394:function(t,e,a){"use strict";a.r(e),a.d(e,{__esModule:function(){return i.B},default:function(){return l}});var s=a(8475),i=a(8284),o=i.A,r=a(845),n=(0,r.A)(o,s.XX,s.Yp,!1,null,"37492658",null),l=n.exports},1406:function(t,e,a){"use strict";var s=a(3999)["default"],i=s(a(5471)),o=s(a(9197)),r=s(a(9325)),n=s(a(5129)),l=s(a(1052));a(1475),a(6804);var c=a(465);i.default.config.productionTip=!1,i.default.use(l.default),(0,c.initNoEmojiGuard)(),new i.default({router:r.default,store:n.default,render:t=>t(o.default)}).$mount("#app")},1507:function(t,e,a){"use strict";var s=a(3999)["default"];Object.defineProperty(e,"B",{value:!0}),e.A=void 0;a(7723);var i=a(5952),o=s(a(9146));e.A={mixins:[o.default],name:"ProductList",mounted(){},methods:{formatPayType(t){try{const e=(t&&t.chain?String(t.chain):"").toUpperCase(),a=(t&&t.coin?String(t.coin):"").toUpperCase();return e&&a?`${e}-${a}`:e||a||""}catch(e){return""}},handleAddToCart(t){try{(0,i.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,a){"use strict";Object.defineProperty(e,"B",{value:!0}),e.A=void 0,a(4114);var s=a(5705);e.A={data(){return{form:{name:"",description:"",image:""}}},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)},async fetchAddShop(){const t=await(0,s.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))if(this.hasEmoji(this.form.name))this.$message({message:"店铺名称不能包含表情符号",type:"warning",showClose:!0});else if(this.form.name&&this.form.name.length>30)this.$message({message:"店铺名称不能超过30个字符",type:"warning",showClose:!0});else if(t(this.form.description))this.$message({message:"店铺描述不能全是空格",type:"warning",showClose:!0});else{if(!(this.form.description&&this.form.description.length>300))return this.$route.query&&"1"===this.$route.query.hasShop?(this.$message({message:"每个用户仅允许一个店铺,无法新建",type:"warning",showClose:!0}),void this.$router.replace("/account/shops")):void(this.form.name?this.fetchAddShop(this.form):this.$message.error("店铺名称不能为空"));this.$message({message:"店铺描述不能超过300个字符",type:"warning",showClose:!0})}else this.$message({message:"店铺名称不能为空或全是空格",type:"warning",showClose:!0})}}}},1749:function(t,e,a){"use strict";a.r(e),a.d(e,{__esModule:function(){return i.B},default:function(){return l}});var s=a(5059),i=a(1561),o=i.A,r=a(845),n=(0,r.A)(o,s.XX,s.Yp,!1,null,"7f00bb86",null),l=n.exports},1867:function(t,e,a){"use strict";Object.defineProperty(e,"B",{value:!0}),e.A=void 0;var s=a(9662);e.A={name:"PurchasedDetail",data(){return{loading:!1,detail:{}}},created(){this.load()},methods:{async load(){const t=this.$route.params.id;if(t)try{this.loading=!0;const e=await(0,s.getOwnedById)({id:t});!e||0!==e.code&&200!==e.code||(this.detail=e.data)}catch(e){console.error("获取已购商品详情失败",e)}finally{this.loading=!1}else this.$message({message:"订单项ID缺失,请重新进入",type:"error",showClose:!0})},formatDateTime(t){if(!t)return"—";try{const e=String(t);return e.includes("T")?e.replace("T"," "):e}catch(e){return String(t)}}}}},1872:function(t,e){"use strict";Object.defineProperty(e,"B",{value:!0}),e.A=void 0;e.A={name:"Content"}},1910:function(t,e){"use strict";e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"account-page"},[e("div",{staticClass:"account-layout"},[e("aside",{staticClass:"sidebar"},[e("nav",{staticClass:"side-nav"},[e("div",{directives:[{name:"show",rawName:"v-show",value:t.userEmail,expression:"userEmail"}],staticClass:"user-info-card",attrs:{role:"region","aria-label":"用户信息",tabindex:"0"}},[e("div",{staticClass:"user-meta"},[e("div",{staticClass:"user-email",attrs:{title:t.userEmail||"未登录"}},[t._v(t._s(t.userEmail||"未登录"))])])]),e("div",{staticClass:"user-role",attrs:{role:"group","aria-label":"导航分组切换"}},[e("button",{staticClass:"role-button",class:{active:"buyer"===t.activeRole},attrs:{"aria-pressed":"buyer"===t.activeRole,tabindex:"0"},on:{click:function(e){return t.handleClickRole("buyer")},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.handleClickRole("buyer"))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"space",32,e.key,[" ","Spacebar"])?null:(e.preventDefault(),t.handleClickRole("buyer"))}]}},[t._v("买家相关")]),e("button",{staticClass:"role-button",class:{active:"seller"===t.activeRole},attrs:{"aria-pressed":"seller"===t.activeRole,tabindex:"0"},on:{click:function(e){return t.handleClickRole("seller")},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.handleClickRole("seller"))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"space",32,e.key,[" ","Spacebar"])?null:(e.preventDefault(),t.handleClickRole("seller"))}]}},[t._v("卖家相关")])]),t._l(t.displayedLinks,function(a){return e("router-link",{key:a.to,class:["side-link",t.isActiveLink(a.to)?"active":""],attrs:{to:a.to}},[t._v(t._s(a.label))])})],2)]),e("section",{staticClass:"content"},[e("router-view")],1)])])},e.Yp=[]},1968:function(t,e){"use strict";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,a){"use strict";var s=a(3999)["default"];Object.defineProperty(e,"B",{value:!0}),e.A=void 0;var i=a(4180),o=s(a(8967));e.A={name:"AccountSellerOrders",components:{OrderList:o.default},data(){return{active:"7",orders:{7:[],8:[]},loading:!1}},created(){const t=this.$route&&this.$route.query&&this.$route.query.status?String(this.$route.query.status):null,e=localStorage.getItem("sellerOrderListActiveTab"),a=t||e||"7";this.active=a,this.fetchOrders(a)},methods:{handleTabClick(t){const e=t&&t.name?String(t.name):this.active;try{localStorage.setItem("sellerOrderListActiveTab",e)}catch(a){}this.fetchOrders(e)},async fetchOrders(t){const e=String(t);try{this.loading=!0;const a=await(0,i.getOrdersByStatusForSeller)({status:Number(t)}),s=null!=(a&&a.data)?a.data:a,o=Array.isArray(s)?s:Array.isArray(s&&s.rows)?s.rows:[];this.$set(this.orders,e,o)}catch(a){console.error("获取卖家订单失败",a)}finally{this.loading=!1}}}}},2038:function(t,e){"use strict";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=[]},2125:function(t,e){"use strict";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(a,s){return e("div",{key:t.getRowKey(a,s),staticClass:"record-item",class:t.statusClass(a.status),on:{click:function(e){return t.toggleExpand("recharge",a,s)}}},[e("div",{staticClass:"item-main"},[e("div",{staticClass:"item-left"},[e("div",{staticClass:"amount"},[t.formatAmount(a.amount,a.fromSymbol).truncated?e("el-tooltip",{attrs:{content:`${t.formatAmount(a.amount,a.fromSymbol).full} ${(a.fromSymbol||"USDT").toUpperCase()}`,placement:"top"}},[e("span",[t._v(" + "+t._s(t.formatAmount(a.amount,a.fromSymbol).text)+" "+t._s((a.fromSymbol||"USDT").toUpperCase())+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(" + "+t._s(t.formatAmount(a.amount,a.fromSymbol).text)+" "+t._s((a.fromSymbol||"USDT").toUpperCase())+" ")])],1),e("div",{staticClass:"chain"},[t._v(t._s(t.formatChain(a.fromChain)))])]),e("div",{staticClass:"item-right"},[e("div",{staticClass:"status"},[e("el-tag",{attrs:{type:t.getRechargeStatusType(a.status),size:"small"}},[t._v(t._s(t.getRechargeStatusText(a.status)))])],1),e("div",{staticClass:"time"},[t._v(t._s(t.formatFullTime(a.createTime)))])])]),e("div",{directives:[{name:"show",rawName:"v-show",value:t.isExpanded("recharge",a,s),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:a.fromAddress}},[t._v(t._s(a.fromAddress))]),e("el-button",{attrs:{type:"text",size:"mini",icon:"el-icon-document-copy"},on:{click:function(e){return e.stopPropagation(),t.handleCopy(a.fromAddress,"充值地址")}}},[t._v("复制")])],1)]),a.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:a.txHash}},[t._v(t._s(a.txHash))]),e("el-button",{attrs:{type:"text",size:"mini",icon:"el-icon-document-copy"},on:{click:function(e){return e.stopPropagation(),t.handleCopy(a.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(a,s){return e("div",{key:t.getRowKey(a,s),staticClass:"record-item",class:t.statusClass(a.status),on:{click:function(e){return t.toggleExpand("withdraw",a,s)}}},[e("div",{staticClass:"item-main"},[e("div",{staticClass:"item-left"},[e("div",{staticClass:"amount"},[t.formatAmount(a.amount,a.toSymbol).truncated?e("el-tooltip",{attrs:{content:`${t.formatAmount(a.amount,a.toSymbol).full} ${(a.toSymbol||"USDT").toUpperCase()}`,placement:"top"}},[e("span",[t._v(" - "+t._s(t.formatAmount(a.amount,a.toSymbol).text)+" "+t._s((a.toSymbol||"USDT").toUpperCase())+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(" - "+t._s(t.formatAmount(a.amount,a.toSymbol).text)+" "+t._s((a.toSymbol||"USDT").toUpperCase())+" ")])],1),e("div",{staticClass:"chain"},[t._v(t._s(t.formatChain(a.toChain)))])]),e("div",{staticClass:"item-right"},[e("div",{staticClass:"status"},[e("el-tag",{attrs:{type:t.getWithdrawStatusType(a.status),size:"small"}},[t._v(t._s(t.getWithdrawStatusText(a.status)))])],1),e("div",{staticClass:"time"},[t._v(t._s(t.formatFullTime(a.createTime)))])])]),e("div",{directives:[{name:"show",rawName:"v-show",value:t.isExpanded("withdraw",a,s),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:a.toAddress}},[t._v(t._s(a.toAddress))]),e("el-button",{attrs:{type:"text",size:"mini",icon:"el-icon-document-copy"},on:{click:function(e){return e.stopPropagation(),t.handleCopy(a.toAddress,"收款地址")}}},[t._v("复制")])],1)]),a.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:a.txHash}},[t._v(t._s(a.txHash))]),e("el-button",{attrs:{type:"text",size:"mini",icon:"el-icon-document-copy"},on:{click:function(e){return e.stopPropagation(),t.handleCopy(a.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(a,s){return e("div",{key:t.getRowKey(a,s),staticClass:"record-item",class:t.statusClass(a.status),on:{click:function(e){return t.toggleExpand("consume",a,s)}}},[e("div",{staticClass:"item-main"},[e("div",{staticClass:"item-left"},[e("div",{staticClass:"amount"},[t.formatAmount(a.realAmount,a.fromSymbol).truncated?e("el-tooltip",{attrs:{content:`${t.formatAmount(a.realAmount,a.fromSymbol).full} ${(a.fromSymbol||"USDT").toUpperCase()}`,placement:"top"}},[e("span",[t._v(" - "+t._s(t.formatAmount(a.realAmount,a.fromSymbol).text)+" "+t._s((a.fromSymbol||"USDT").toUpperCase())+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(" - "+t._s(t.formatAmount(a.realAmount,a.fromSymbol).text)+" "+t._s((a.fromSymbol||"USDT").toUpperCase())+" ")])],1),e("div",{staticClass:"chain"},[t._v(t._s(t.formatChain(a.fromChain)))])]),e("div",{staticClass:"item-right"},[e("div",{staticClass:"status"},[e("el-tag",{attrs:{type:t.getPayStatusType(a.status),size:"small"}},[t._v(t._s(t.getPayStatusText(a.status)))])],1),e("div",{staticClass:"time"},[t._v(t._s(t.formatFullTime(a.createTime||a.time)))])])]),e("div",{directives:[{name:"show",rawName:"v-show",value:t.isExpanded("consume",a,s),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("span",{staticClass:"value mono"},[t._v(t._s(a.orderId||""))])]),e("div",{staticClass:"expand-item"},[e("span",{staticClass:"label"},[t._v("支付地址")]),e("span",{staticClass:"value mono-ellipsis",attrs:{title:a.fromAddress}},[t._v(t._s(a.fromAddress||""))])]),e("div",{staticClass:"expand-item"},[e("span",{staticClass:"label"},[t._v("收款地址")]),e("span",{staticClass:"value mono-ellipsis",attrs:{title:a.toAddress}},[t._v(t._s(a.toAddress||""))])]),a.txHash?e("div",{staticClass:"expand-item"},[e("span",{staticClass:"label"},[t._v("交易哈希")]),e("span",{staticClass:"value mono-ellipsis",attrs:{title:a.txHash}},[t._v(t._s(a.txHash))])]):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=[]},2172:function(t,e){"use strict";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(a){return e("div",{key:a.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((a.fromChain||a.chain||"").toUpperCase())+" "+t._s((a.fromSymbol||a.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(a.walletBalance||a.balance||0)+" "+t._s(t.displaySymbol(a)))])]),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(a.blockedBalance||0)+" "+t._s(t.displaySymbol(a)))])],1),e("el-button",{staticClass:"withdraw-inline-btn",attrs:{type:"success",size:"mini"},on:{click:function(e){return t.handleWithdraw(a)}}},[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(a){return e("div",{key:a.id,staticClass:"transaction-item"},[e("div",{staticClass:"transaction-info"},[e("span",{staticClass:"transaction-type"},[t._v(t._s(a.type))]),e("span",{staticClass:"transaction-time"},[t._v(t._s(a.time))]),e("el-tag",{staticClass:"transaction-status",attrs:{size:"mini",type:a.statusTagType||"info"}},[t._v(" "+t._s(a.statusText||"-")+" ")])],1),e("div",{staticClass:"transaction-amount",class:a.amount>0?"positive":"negative"},[t._v(" "+t._s(a.amount>0?"+":"")+t._s(a.amountText)+" USDT ")])])}),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:"USDT提现",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=[]},2224:function(t,e,a){"use strict";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("label",{staticClass:"required",staticStyle:{"margin-bottom":"10px"}},[t._v("币种选择:")]),e("div",{staticClass:"filter-row"},[e("el-select",{ref:"screen",staticClass:"input",attrs:{size:"middle",placeholder:"请选择",clearable:""},on:{change:t.handleCurrencyChange,clear:t.handleCurrencyClear},model:{value:t.screenCurrency,callback:function(e){t.screenCurrency=e},expression:"screenCurrency"}},t._l(t.currencyList,function(a){return e("el-option",{key:a.value,attrs:{label:a.label,value:a.value}},[e("div",{staticStyle:{display:"flex","align-items":"center"}},[e("img",{staticStyle:{float:"left",width:"20px"},attrs:{src:a.imgUrl}}),e("span",{staticStyle:{float:"left","margin-left":"5px"}},[t._v(t._s(a.label))])])])}),1),e("el-input",{staticStyle:{width:"240px"},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(s){return e("div",{key:s.id,staticClass:"product-item",attrs:{tabindex:"0","aria-label":"查看详情"},on:{click:function(e){return t.handleProductClick(s)}}},[e("img",{staticClass:"product-image",attrs:{src:a(6278),alt:s.name}}),e("div",{staticClass:"product-info"},[e("h4",[t._v("商品: "+t._s(s.name))]),e("p",{staticStyle:{"font-size":"16px","margin-top":"10px","font-weight":"bold"}},[t._v("算法: "+t._s(s.algorithm))]),e("div",{staticClass:"product-footer"},[e("div",{staticClass:"paytypes"},[e("span",{staticClass:"paytypes-label"},[t._v("支付方式:")]),t._l(s.payTypes||[],function(a,s){return e("el-tooltip",{key:s,attrs:{content:t.formatPayType(a),placement:"top","open-delay":80}},[e("img",{staticClass:"paytype-icon",attrs:{src:a.image,alt:t.formatPayType(a)}})])})],2),e("div",{staticClass:"right-meta"},[e("span",{staticClass:"product-sold",attrs:{"aria-label":"已售数量"}},[t._v("已售:"+t._s(s&&null!=s.saleNumber?s.saleNumber:0))]),e("span",{staticClass:"shop-name"},[t._v("店铺:"+t._s(s&&(s.shopName||s.name)))])])])])])}),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=[]},2389:function(t,e){"use strict";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("金额(USDT):")]),e("span",{staticClass:"value strong"},[t._v(t._s(t.order.totalPrice))])]),e("div",{staticClass:"row"},[e("span",{staticClass:"label"},[t._v("创建时间:")]),e("span",{staticClass:"value"},[t._v(t._s(t.formatDateTime(t.order.createTime)))])])]),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:{prop:"name",label:"名称","min-width":"160"}}),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:{prop:"price",label:"单价(USDT)","min-width":"120"}}),e("el-table-column",{attrs:{prop:"address",label:"收款地址","min-width":"240"}})],1)],1),e("div",{staticClass:"actions"},[e("el-button",{on:{click:function(e){return t.$router.back()}}},[t._v("返回")])],1)],1)])},e.Yp=[]},2515:function(t,e,a){"use strict";Object.defineProperty(e,"B",{value:!0}),e.A=void 0,a(8111),a(1701),a(7642),a(8004),a(3853),a(5876),a(2475),a(5024),a(1698);var s=a(6299),i=a(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,i.truncateAmountByCoin)(t,e)},handleTab(t,e){this.expandedKeys.clear(),this.expandedKeys=new Set(this.expandedKeys);const a=t&&t.name||this.active;this.pagination.status=this.getStatusByTab(a),this.pagination.pageNum=1,this.currentPage=1,this.loadList()},getRowKey(t,e){const a=null!=e?`#${e}`:"";if(!t)return String(null!=e?e:"");const s=t.__key||t.id||t.txHash||t.orderId||`${t.createTime||""}-${t.updateTime||""}`;return null==s||""===s?String(null!=e?e:""):`${String(s)}${a}`},isExpanded(t,e,a){const s=`${t}-${this.getRowKey(e,a)}`;return this.expandedKeys.has(s)},toggleExpand(t,e,a){const s=`${t}-${this.getRowKey(e,a)}`;this.expandedKeys.has(s)?this.expandedKeys.clear():(this.expandedKeys.clear(),this.expandedKeys.add(s)),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,s.transactionRecord)({pageNum:this.pagination.pageNum,pageSize:this.pagination.pageSize,status:t}),a=e?.rows||e?.data?.rows||[];this.total=e?.total||e?.data?.total||(Array.isArray(a)?a.length:0);const i=(Array.isArray(a)?a:[]).map((t,e)=>({...t,__key:t.id||t.txHash||t.orderId||`${e}`}));2===t?this.rechargeRows=i:1===t?this.withdrawRows=i:this.consumeRows=i,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(),a={tron:"TRON",trx:"TRON",eth:"ETH",ethereum:"ETH",bsc:"BSC",polygon:"POLYGON",matic:"POLYGON"};return(a[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 a=Number(t);if(!Number.isFinite(a))return"0";const s=Math.max(0,Number(e)||0),i=Math.pow(10,s),o=Math.trunc(a*i)/i,r=String(o);if(0===s)return r;const[n,l=""]=r.split("."),c=l.padEnd(s,"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 a=String(t||"");if(navigator&&navigator.clipboard&&navigator.clipboard.writeText)await navigator.clipboard.writeText(a);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(),document.execCommand("copy"),document.body.removeChild(t)}this.$message.success(`${e}已复制`)}catch(a){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":""}}}},2553:function(t,e){"use strict";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(a){return e("div",{key:a.id,staticClass:"recharge-item pending",on:{click:function(e){return t.showDetail(a)}}},[e("div",{staticClass:"item-main"},[e("div",{staticClass:"item-left"},[e("div",{staticClass:"amount"},[t._v(" "+t._s(a.amount)+" "+t._s(a.fromSymbol||"USDT")+" ")]),e("div",{staticClass:"chain"},[t._v(t._s(t.getChainName(a.fromChain)))])]),e("div",{staticClass:"item-right"},[e("div",{staticClass:"status pending-status"},[e("i",{staticClass:"el-icon-loading"}),t._v(" "+t._s(t.getStatusText(a.status))+" ")]),e("div",{staticClass:"time"},[t._v(t._s(t.formatTime(a.createTime)))])])]),e("div",{staticClass:"item-footer"},[e("div",{staticClass:"footer-left"},[e("span",{staticClass:"address"},[t._v(t._s(t.formatAddress(a.address)))]),a.txHash?e("span",{staticClass:"tx-hash"},[e("i",{staticClass:"el-icon-link"}),t._v(" "+t._s(t.formatAddress(a.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(a){return e("div",{key:a.id,staticClass:"recharge-item success",on:{click:function(e){return t.showDetail(a)}}},[e("div",{staticClass:"item-main"},[e("div",{staticClass:"item-left"},[e("div",{staticClass:"amount"},[t._v(" "+t._s(a.amount)+" "+t._s(a.fromSymbol||"USDT")+" ")]),e("div",{staticClass:"chain"},[t._v(t._s(t.getChainName(a.fromChain)))])]),e("div",{staticClass:"item-right"},[e("div",{staticClass:"status success-status"},[e("i",{staticClass:"el-icon-check"}),t._v(" "+t._s(t.getStatusText(a.status))+" ")]),e("div",{staticClass:"time"},[t._v(t._s(t.formatTime(a.createTime)))])])]),e("div",{staticClass:"item-footer"},[e("div",{staticClass:"footer-left"},[e("span",{staticClass:"address"},[t._v(t._s(t.formatAddress(a.address)))]),a.txHash?e("span",{staticClass:"tx-hash"},[e("i",{staticClass:"el-icon-link"}),t._v(" "+t._s(t.formatAddress(a.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(a){return e("div",{key:a.id,staticClass:"recharge-item failed",on:{click:function(e){return t.showDetail(a)}}},[e("div",{staticClass:"item-main"},[e("div",{staticClass:"item-left"},[e("div",{staticClass:"amount"},[t._v(" "+t._s(a.amount)+" "+t._s(a.fromSymbol||"USDT")+" ")]),e("div",{staticClass:"chain"},[t._v(t._s(t.getChainName(a.fromChain)))])]),e("div",{staticClass:"item-right"},[e("div",{staticClass:"status failed-status"},[e("i",{staticClass:"el-icon-close"}),t._v(" "+t._s(t.getStatusText(a.status))+" ")]),e("div",{staticClass:"time"},[t._v(t._s(t.formatTime(a.createTime)))])])]),e("div",{staticClass:"item-footer"},[e("div",{staticClass:"footer-left"},[e("span",{staticClass:"address"},[t._v(t._s(t.formatAddress(a.address)))]),a.txHash?e("span",{staticClass:"tx-hash"},[e("i",{staticClass:"el-icon-link"}),t._v(" "+t._s(t.formatAddress(a.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||"USDT"))])]),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("查看您的充值申请和到账状态")])])}]},2570:function(t,e,a){"use strict";Object.defineProperty(e,"B",{value:!0}),e.A=void 0,a(4114),a(8111),a(2489),a(1701);var s=a(5705),i=a(9252),o=a(6299);e.A={name:"AccountMyShops",data(){return{loaded:!1,defaultCover:"https://dummyimage.com/120x120/eee/999.png&text=Shop",shop:{id:0,name:"",image:"",description:"",del:!0,state:0},visibleEdit:!1,editForm:{id:"",name:"",image:"",description:""},shopConfigs:[],visibleConfigEdit:!1,configForm:{id:"",chainLabel:"",chainValue:"",payAddress:"",payCoins:[],payCoin:""},productOptions:[],coinOptions:i.coinList||[],editCoinOptionsApi:[],chainOptions:[{label:"Tron (TRC20)",value:"tron"},{label:"Ethereum (ERC20)",value:"ethereum"},{label:"BSC (BEP20)",value:"bsc"},{label:"Nexa",value:"nexa"}],shopLoading:!1}},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")},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())}},created(){this.fetchMyShop()},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)},resetShopState(){this.shop={id:0,name:"",image:"",description:"",del:!0,state:0},this.shopConfigs=[]},async fetchMyShop(){try{const t=await(0,s.getMyShop)();t&&(0===t.code||200===t.code)&&t.data?(this.shop={id:t.data.id,name:t.data.name,image:t.data.image,description:t.data.description,del:!!t.data.del,state:Number(t.data.state||0)},this.fetchShopConfigs(t.data.id)):(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.getShopConfig)({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,s.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,s.deleteShopConfig)(t);!e||0!==e.code&&200!==e.code||(this.$message.success("删除成功"),this.fetchShopConfigs(this.shop.id))},async handleEditConfig(t){try{const e=await(0,s.getChainAndCoin)({id:t.id});if(e&&(0===e.code||200===e.code)&&e.data){const a=e.data||{},s=Array.isArray(a.children)?a.children:[];this.editCoinOptionsApi=s.map(t=>({label:t.label,value:t.value}));const i=s.filter(t=>1===Number(t.hasBind)).map(t=>t.value);this.configForm={id:t.id,chainLabel:a.label||"",chainValue:a.value||"",payAddress:a.address||"",payCoins:i,payCoin:i.join(",")}}else{this.editCoinOptionsApi=[];const e=t.chain||"",a=String(t.payCoin||""),s=a?a.split(","):[];this.configForm={id:t.id,chainLabel:e,chainValue:t.chain||"",payAddress:t.payAddress||"",payCoins:s,payCoin:s.join(",")}}this.visibleConfigEdit=!0}catch(e){this.visibleConfigEdit=!0}},async handleDeleteConfig(t){this.deleteShopConfig({id:t.id})},submitConfigEdit(){if(!this.configForm.chainLabel&&!this.configForm.chainValue)return void this.$message.warning("请选择支付链");if(!this.configForm.payCoins||0===this.configForm.payCoins.length)return void this.$message.warning("请选择支付币种");const t=(this.configForm.payAddress||"").trim();if(!t)return void this.$message.warning("请输入钱包地址");const e={id:this.configForm.id,chain:this.configForm.chainValue||this.configForm.chainLabel,payCoin:(this.configForm.payCoins||[]).join(","),payAddress:this.configForm.payAddress};this.updateShopConfig(e)},removeSelectedCoin(t){const e=String(t||"").toLowerCase(),a=new Map((this.editCoinOptions||[]).map(t=>[String(t.label).toLowerCase(),String(t.value)])),s=a.get(e);s&&(this.configForm.payCoins=(this.configForm.payCoins||[]).filter(t=>String(t)!==String(s)))},async handleOpenEdit(){try{this.visibleEdit=!0;const t=await(0,s.queryShop)({id:this.shop.id});t&&(0===t.code||200===t.code)&&t.data?this.editForm={id:t.data.id,name:t.data.name,image:t.data.image,description:t.data.description}:(this.editForm={id:this.shop.id,name:this.shop.name,image:this.shop.image,description:this.shop.description},this.$message.warning(t&&t.msg?t.msg:"未获取到店铺详情"))}catch(t){this.editForm={id:this.shop.id,name:this.shop.name,image:this.shop.image,description:this.shop.description},console.error("查询店铺详情失败:",t)}},async submitEdit(){try{const{name:t,image:e,description:a}=this.editForm,i=t=>"string"===typeof t&&t.length>0&&0===t.trim().length;if(i(t))return void this.$message.error("店铺名称不能全是空格");if(!t)return void this.$message.error("店铺名称不能为空");if(this.hasEmoji(t))return void this.$message.warning("店铺名称不能包含表情符号");if(i(e))return void this.$message.error("店铺封面不能全是空格");if(i(a))return void this.$message.error("店铺描述不能全是空格");if(t&&t.length>30)return void this.$message.warning("店铺名称不能超过30个字符");if(a&&a.length>300)return void this.$message.warning("店铺描述不能超过300个字符");const o={...this.editForm},r=await(0,s.updateShop)(o);!r||0!==r.code&&200!==r.code?this.$message({message:r.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(){try{await this.$confirm("确定删除该店铺吗?此操作不可恢复","提示",{type:"warning"});const t=await(0,s.deleteShop)(this.shop.id);!t||0!==t.code&&200!==t.code||(this.$message({message:"删除成功",type:"success",showClose:!0}),this.resetShopState(),this.loaded=!1,setTimeout(()=>{this.fetchMyShop()},500))}catch(t){}},async handleToggleShop(){try{const t=2===this.shop.state,e=t?"确定开启店铺吗?":"确定关闭该店铺吗?关闭后用户将无法访问";await this.$confirm(e,"提示",{type:"warning"});const a=await(0,s.closeShop)(this.shop.id);!a||0!==a.code&&200!==a.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-new",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})}}}},2605:function(t,e,a){"use strict";a.r(e),a.d(e,{__esModule:function(){return i.B},default:function(){return l}});var s=a(6356),i=a(3466),o=i.A,r=a(845),n=(0,r.A)(o,s.XX,s.Yp,!1,null,"4f1442d6",null),l=n.exports},2935:function(t,e,a){"use strict";Object.defineProperty(e,"B",{value:!0}),e.A=void 0,a(4114);a(4180);var s=a(4981);e.A={name:"OrderList",props:{items:{type:Array,default:()=>[]},emptyText:{type:String,default:"暂无数据"},showCheckout:{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:""}}},computed:{safeItems(){return Array.isArray(this.items)?this.items:[]}},methods:{formatAmount(t,e){return(0,s.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)}},async handleCheckout(t){if(t)try{this.payLoading=!0,this.paymentDialog={totalPrice:t.totalPrice,payAmount:t.payAmount,noPayAmount:t.noPayAmount,img:t.img},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)try{this.$router.push(`/account/order-detail/${e}`)}catch(a){this.$message({message:"无法跳转到详情页",type:"error",showClose:!0})}else this.$message({message:"订单ID缺失",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}}}},3375:function(t,e){"use strict";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(a){return[e("el-table",{attrs:{data:a.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:{prop:"name",label:"名称","min-width":"160"}}),e("el-table-column",{attrs:{prop:"payCoin",label:"币种","min-width":"100"}}),e("el-table-column",{attrs:{prop:"address",label:"收款地址","min-width":"240"}}),e("el-table-column",{attrs:{prop:"leaseTime",label:"租赁天数","min-width":"100"}}),e("el-table-column",{attrs:{prop:"price",label:"售价(USDT)","min-width":"240"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("span",{staticClass:"value strong"},[t.formatAmount(a.row.price,a.row.payCoin||"USDT").truncated?e("el-tooltip",{attrs:{content:t.formatAmount(a.row.price,a.row.payCoin||"USDT").full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(a.row.price,a.row.payCoin||"USDT").text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatAmount(a.row.price,a.row.payCoin||"USDT").text))])],1)]}}],null,!0)})],1)]}}])}),e("el-table-column",{attrs:{label:"订单号","min-width":"220"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("span",{staticClass:"value mono"},[t._v(t._s(a.row&&a.row.orderNumber||"—"))])]}}])}),e("el-table-column",{attrs:{label:"创建时间","min-width":"180"},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":"100"},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:"总金额(USDT)","min-width":"140"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("span",{staticClass:"value strong"},[t.formatAmount(a.row&&a.row.totalPrice,"USDT").truncated?e("el-tooltip",{attrs:{content:t.formatAmount(a.row&&a.row.totalPrice,"USDT").full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(a.row&&a.row.totalPrice,"USDT").text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatAmount(a.row&&a.row.totalPrice,"USDT").text))])],1)]}}])}),e("el-table-column",{attrs:{"min-width":"180"},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(" 已支付金额(USDT) ")])])]},proxy:!0},{key:"default",fn:function(a){return[e("span",{staticClass:"value strong"},[t.formatAmount(a.row&&a.row.payAmount,"USDT").truncated?e("el-tooltip",{attrs:{content:t.formatAmount(a.row&&a.row.payAmount,"USDT").full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(a.row&&a.row.payAmount,"USDT").text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatAmount(a.row&&a.row.payAmount,"USDT").text))])],1)]}}])}),e("el-table-column",{attrs:{label:"待支付金额(USDT)","min-width":"140"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("span",{staticClass:"value strong"},[t.formatAmount(a.row&&a.row.noPayAmount,"USDT").truncated?e("el-tooltip",{attrs:{content:t.formatAmount(a.row&&a.row.noPayAmount,"USDT").full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(a.row&&a.row.noPayAmount,"USDT").text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatAmount(a.row&&a.row.noPayAmount,"USDT").text))])],1)]}}])}),e("el-table-column",{attrs:{label:"操作","min-width":"280",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-button",{staticStyle:{"margin-right":"8px"},attrs:{size:"mini"},on:{click:function(e){return t.handleGoDetail(a.row)}}},[t._v("详情")]),t.shouldShowActions(a.row)?[e("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(e){return t.handleCheckout(a.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("总金额(USDT): "),e("b",[t.formatAmount(t.paymentDialog.totalPrice,"USDT").truncated?e("el-tooltip",{attrs:{content:t.formatAmount(t.paymentDialog.totalPrice,"USDT").full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(t.paymentDialog.totalPrice,"USDT").text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatAmount(t.paymentDialog.totalPrice,"USDT").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("已支付金额(USDT):")]),e("b",{staticClass:"value strong"},[t.formatAmount(t.paymentDialog.payAmount,"USDT").truncated?e("el-tooltip",{attrs:{content:t.formatAmount(t.paymentDialog.payAmount,"USDT").full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(t.paymentDialog.payAmount,"USDT").text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatAmount(t.paymentDialog.payAmount,"USDT").text))])],1)],1),e("div",{staticStyle:{"margin-bottom":"6px"}},[t._v("待支付金额(USDT): "),e("b",{staticClass:"value strong"},[t.formatAmount(t.paymentDialog.noPayAmount,"USDT").truncated?e("el-tooltip",{attrs:{content:t.formatAmount(t.paymentDialog.noPayAmount,"USDT").full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(t.paymentDialog.noPayAmount,"USDT").text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatAmount(t.paymentDialog.noPayAmount,"USDT").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=[]},3466:function(t,e,a){"use strict";Object.defineProperty(e,"B",{value:!0}),e.A=void 0,a(4114),a(8111),a(2489),a(116),a(7588),a(1701);var s=a(1193);e.A={name:"AccountProductMachineAdd",data(){return{form:{productId:Number(this.$route.query.productId)||null,coin:this.$route.query.coin||"",productName:this.$route.query.name||"",powerDissipation:null,theoryPower:null,type:"",unit:"TH/S",cost:"",costMap:{},maxLeaseDays:""},confirmVisible:!1,rules:{productName:[{required:!0,message:"商品名称不能为空",trigger:"change"}],coin:[{required:!0,message:"币种不能为空",trigger:"change"}],powerDissipation:[{required:!0,message:"功耗不能为空",trigger:"blur"},{validator:(t,e,a)=>{const s=String(e||"");if(!s)return void a(new Error("功耗不能为空"));const i=/^\d{1,6}(\.\d{1,4})?$/;i.test(s)?Number(s)<=0?a(new Error("功耗必须大于0")):a():a(new Error("功耗整数最多6位,小数最多4位"))},trigger:"blur"}],theoryPower:[{required:!0,message:"理论算力不能为空",trigger:"blur"},{validator:(t,e,a)=>{const s=String(e||"");if(!s)return void a(new Error("理论算力不能为空"));const i=/^\d{1,6}(\.\d{1,4})?$/;i.test(s)?Number(s)<=0?a(new Error("理论算力必须大于0")):a():a(new Error("理论算力整数最多6位,小数最多4位"))},trigger:"blur"}],unit:[{required:!0,message:"请选择算力单位",trigger:"change"}],cost:[{validator(t,e,a){if(Array.isArray(this.payTypeDefs)&&this.payTypeDefs.length>0)return void a();const s=String(e||"");if(!s)return void a(new Error("请填写机器成本(USDT)"));const i=/^\d{1,12}(\.\d{1,2})?$/;i.test(s)?Number(s)<=0?a(new Error("成本必须大于 0")):a():a(new Error("成本整数最多12位,小数最多2位"))},trigger:"blur"}],maxLeaseDays:[{required:!0,message:"请填写最大租赁天数",trigger:"blur"},{validator:(t,e,a)=>{const s=String(e??"");if(!s)return void a(new Error("请填写最大租赁天数"));if(!/^\d{1,3}$/.test(s))return void a(new Error("仅允许整数,范围 1-365"));const i=Number(s);!Number.isInteger(i)||i<1||i>365?a(new Error("范围需在 1-365 天")):a()},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",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}]}}},created(){this.initPayTypesFromRoute(),this.fetchMiners(),this.lastTypeBaseline=this.form.type,this.rules&&this.rules.cost&&this.$set(this.rules,"cost",[{validator:this.validateCost,trigger:"blur"}])},methods:{validateCost(t,e,a){if(Array.isArray(this.payTypeDefs)&&this.payTypeDefs.length>0)return void a();const s=String(e||"");if(!s)return void a(new Error("请填写机器成本(USDT)"));const i=/^\d{1,12}(\.\d{1,2})?$/;i.test(s)?Number(s)<=0?a(new Error("成本必须大于 0")):a():a(new Error("成本整数最多12位,小数最多2位"))},initPayTypesFromRoute(){this.payTypeDefs=[];try{const t=this.$route.query.payTypes;if(!t)return;const e=JSON.parse(decodeURIComponent(t));if(!Array.isArray(e))return;const a=[];e.forEach(t=>{const e=String(t&&t.chain?t.chain:"").toUpperCase(),s=String(t&&t.coin?t.coin:"").toUpperCase();if(!e&&!s)return;const i=[e,s].filter(Boolean).join("-"),o=i;a.push({chain:e,coin:s,key:i,label:o})});const s=new Map;a.forEach(t=>{s.has(t.key)||s.set(t.key,t)}),this.payTypeDefs=Array.from(s.values());const i={};this.payTypeDefs.forEach(t=>{i[t.key]=""}),this.form.costMap=i,this.lastCostMapBaseline={...i}}catch(t){this.payTypeDefs=[]}},handleBack(){this.$router.back()},handleNumeric(t){let e=String(this.form[t]??"");e=e.replace(/[^0-9.]/g,"");const a=e.indexOf(".");-1!==a&&(e=e.slice(0,a+1)+e.slice(a+1).replace(/\./g,""));const s=e.endsWith(".");if("cost"===t){const t=e.split(".");let a=t[0]||"",i=t[1]||"";a.length>12&&(a=a.slice(0,12)),i&&(i=i.slice(0,2)),e=i.length?`${a}.${i}`:s?`${a}.`:a}else if("powerDissipation"===t||"theoryPower"===t){const t=e.split(".");let a=t[0]||"",i=t[1]||"";a.length>6&&(a=a.slice(0,6)),i&&(i=i.slice(0,4)),e=i.length?`${a}.${i}`:s?`${a}.`:a}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!==a){const[t,a]=e.split(".");e=t+"."+(a?a.slice(0,6):"")}}this.form[t]=e,"cost"===t&&this.syncCostToRows()},handleCostMapInput(t,e){let a=String(e??this.form.costMap[t]??"");a=a.replace(/[^0-9.]/g,"");const s=a.indexOf(".");-1!==s&&(a=a.slice(0,s+1)+a.slice(s+1).replace(/\./g,""));const i=a.endsWith("."),o=a.split(".");let r=o[0]||"",n=o[1]||"";r.length>12&&(r=r.slice(0,12)),n&&(n=n.slice(0,2)),a=n.length?`${r}.${n}`:i?`${r}.`:r,this.$set(this.form.costMap,t,a);const l=Number(this.lastCostMapBaseline[t]??NaN);this.selectedMachineRows=this.selectedMachineRows.map(e=>{const s=Number((e.priceMap&&e.priceMap[t])??NaN),i=!Number.isFinite(s)||s===l,o={...e.priceMap||{}};return i&&(o[t]=a),{...e,priceMap:o}});const c=Number(a);Number.isFinite(c)&&this.$set(this.lastCostMapBaseline,t,c)},handleTypeInput(){"string"===typeof this.form.type&&this.form.type.length>20&&(this.form.type=this.form.type.slice(0,20))},syncCostToRows(){const t=Number(this.form.cost);if(!Number.isFinite(t))return;const e=this.lastCostBaseline;this.selectedMachineRows=this.selectedMachineRows.map(a=>{const s=Number(a.price);return Number.isFinite(s)&&s!==e?a:{...a,price:t}}),this.lastCostBaseline=t},updateMachineType(){this.selectedMachineRows=this.selectedMachineRows.map(t=>t.type&&t.type!==this.lastTypeBaseline?t:{...t,type:this.form.type}),this.lastTypeBaseline=this.form.type},updateSelectedMachineRows(){const t=new Map;this.machineOptions.forEach(e=>{t.set(e.miner,e)});const e=[];this.selectedMachines.forEach(a=>{const s=t.get(a);if(s){const t=this.selectedMachineRows.find(t=>t.miner===a),i=t&&t.priceMap?t.priceMap:null,o={};this.payTypeDefs&&this.payTypeDefs.length&&this.payTypeDefs.forEach(t=>{o[t.key]=this.form.costMap[t.key]}),e.push({user:s.user,coin:s.coin,miner:s.miner,realPower:s.realPower,price:t?t.price:this.form.cost,powerDissipation:t&&void 0!==t.powerDissipation?t.powerDissipation:this.form.powerDissipation,theoryPower:t&&void 0!==t.theoryPower?t.theoryPower:this.form.theoryPower,unit:t&&t.unit?t.unit:this.form.unit,type:t?t.type:this.form.type,state:t?t.state:0,maxLeaseDays:t&&void 0!==t.maxLeaseDays?t.maxLeaseDays:this.form.maxLeaseDays,priceMap:i||o})}}),this.selectedMachineRows=e},syncPowerDissipationToRows(){const t=Number(this.form.powerDissipation);if(!Number.isFinite(t))return;const e=this.lastPowerDissipationBaseline;this.selectedMachineRows=this.selectedMachineRows.map(a=>{const s=Number(a.powerDissipation);return Number.isFinite(s)&&s!==e?a:{...a,powerDissipation:t}}),this.lastPowerDissipationBaseline=t},syncTheoryPowerToRows(){const t=Number(this.form.theoryPower);if(!Number.isFinite(t))return;const e=this.lastTheoryPowerBaseline;this.selectedMachineRows=this.selectedMachineRows.map(a=>{const s=Number(a.theoryPower);return Number.isFinite(s)&&s!==e?a:{...a,theoryPower:t}}),this.lastTheoryPowerBaseline=t},syncUnitToRows(){const t=this.form.unit;if(!t)return;const e=this.lastUnitBaseline;this.selectedMachineRows=this.selectedMachineRows.map(a=>{const s=a.unit;return s&&s!==e?a:{...a,unit:t}}),this.lastUnitBaseline=t},handleRowPowerDissipationInput(t){let e=String(this.selectedMachineRows[t].powerDissipation??"");e=e.replace(/[^0-9.]/g,"");const a=e.indexOf(".");-1!==a&&(e=e.slice(0,a+1)+e.slice(a+1).replace(/\./g,""));const s=e.endsWith("."),i=e.split(".");let o=i[0]||"",r=i[1]||"";o.length>6&&(o=o.slice(0,6)),r&&(r=r.slice(0,4)),e=r.length?`${o}.${r}`:s?`${o}.`:o,this.$set(this.selectedMachineRows[t],"powerDissipation",e)},handleRowPowerDissipationBlur(t){const e=String(this.selectedMachineRows[t].powerDissipation??""),a=/^\d{1,6}(\.\d{1,4})?$/;(!e||Number(e)<=0||!a.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 a=e.indexOf(".");-1!==a&&(e=e.slice(0,a+1)+e.slice(a+1).replace(/\./g,""));const s=e.endsWith("."),i=e.split(".");let o=i[0]||"",r=i[1]||"";o.length>6&&(o=o.slice(0,6)),r&&(r=r.slice(0,4)),e=r.length?`${o}.${r}`:s?`${o}.`:o,this.$set(this.selectedMachineRows[t],"theoryPower",e)},handleRowTheoryPowerBlur(t){const e=String(this.selectedMachineRows[t].theoryPower??""),a=/^\d{1,6}(\.\d{1,4})?$/;(!e||Number(e)<=0||!a.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 a=this.lastMaxLeaseDaysBaseline;this.selectedMachineRows=this.selectedMachineRows.map(t=>{const s=Number(t.maxLeaseDays);return Number.isInteger(s)&&s!==a?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 a=Number(e);(!Number.isInteger(a)||a<1||a>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 a=e.indexOf(".");-1!==a&&(e=e.slice(0,a+1)+e.slice(a+1).replace(/\./g,""));const s=e.endsWith("."),i=e.split(".");let o=i[0]||"",r=i[1]||"";o.length>12&&(o=o.slice(0,12)),r&&(r=r.slice(0,2)),e=r.length?`${o}.${r}`:s?`${o}.`:o,this.$set(this.selectedMachineRows[t],"price",e)},handleRowPriceMapInput(t,e){const a=this.selectedMachineRows[t],s={...a.priceMap||{}};let i=String(s[e]??"");i=i.replace(/[^0-9.]/g,"");const o=i.indexOf(".");-1!==o&&(i=i.slice(0,o+1)+i.slice(o+1).replace(/\./g,""));const r=i.endsWith("."),n=i.split(".");let l=n[0]||"",c=n[1]||"";l.length>12&&(l=l.slice(0,12)),c&&(c=c.slice(0,2)),i=c.length?`${l}.${c}`:r?`${l}.`:l,s[e]=i,this.$set(this.selectedMachineRows[t],"priceMap",s)},handleRowPriceMapBlur(t,e){const a=this.selectedMachineRows[t],s=String((a.priceMap&&a.priceMap[e])??""),i=/^\d{1,12}(\.\d{1,2})?$/;if(!s||Number(s)<=0||!i.test(s)){this.$message.warning("价格必须大于0,整数最多12位,小数最多2位");const s={...a.priceMap||{}};s[e]="",this.$set(this.selectedMachineRows[t],"priceMap",s)}},handleRowPriceBlur(t){const e=String(this.selectedMachineRows[t].price??""),a=/^\d{1,12}(\.\d{1,2})?$/;(!e||Number(e)<=0||!a.test(e))&&(this.$message.warning("价格必须大于0,整数最多12位,小数最多2位"),this.$set(this.selectedMachineRows[t],"price",""))},handleRowTypeInput(t){const e=String(this.selectedMachineRows[t].type||""),a=e.length>20?e.slice(0,20):e;this.$set(this.selectedMachineRows[t],"type",a)},handleRowTypeBlur(t){const e=this.selectedMachineRows[t].type,a=t=>"string"===typeof t&&t.length>0&&0===t.trim().length;a(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(0,s.getUserMinersList)({coin:this.form.coin||""}),e=t?.data;let a=[];Array.isArray(e)?a=e:e&&"object"===typeof e?Object.keys(e).forEach(t=>{const s=Array.isArray(e[t])?e[t]:[];s.forEach(t=>{t&&t.user&&t.coin&&a.push({user:t.user,coin:t.coin,miner:t.miner||null})})}):e&&e.additionalProperties1&&(a=[e.additionalProperties1]),this.form.coin&&(a=a.filter(t=>t.coin===this.form.coin)),this.miners=a}catch(t){console.error("获取挖矿账户失败",t)}finally{this.minersLoading=!1}},async handleMinerChange(t){if(this.selectedMachines=[],!t)return void(this.machineOptions=[]);const[e,a]=t.split("|");this.machinesLoading=!0;try{const t={coin:a,user:e},i=await(0,s.getUserMachineList)(t),o=i?.data||[];this.machineOptions=Array.isArray(o)?o:[],console.log("选择挖矿账户:",{user:e,coin:a}),console.log("获取机器列表响应:",i),console.log("机器列表数据:",this.machineOptions)}catch(i){console.error("获取机器列表失败",i)}finally{this.machinesLoading=!1}},async handleSave(){try{const t=await this.$refs.machineForm.validate();if(!t)return}catch(a){return}if(!this.form.productId)return void this.$message.warning("缺少商品ID");if(!this.selectedMiner)return void this.$message.warning("请先选择挖矿账户");if(!this.selectedMachines.length)return void this.$message.warning("请至少选择一台机器");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){for(let t=0;t<this.selectedMachineRows.length;t+=1){const e=this.selectedMachineRows[t];if(this.payTypeDefs&&this.payTypeDefs.length)for(let i=0;i<this.payTypeDefs.length;i+=1){const a=this.payTypeDefs[i],s=String(e&&e.priceMap?e.priceMap[a.key]:""),o=Number(s);if(!/^\d{1,12}(\.\d{1,2})?$/.test(s)||!Number.isFinite(o)||o<=0){const s=e&&(e.miner||e.user)||t+1;return void this.$message.warning(`第${t+1}行(机器:${s}) 价格(${a.label})必须大于0,整数最多12位,小数最多2位`)}}else{const a=Number(e&&e.price);if(!Number.isFinite(a)||a<=0){const a=e&&(e.miner||e.user)||t+1;return void this.$message.warning(`第${t+1}行(机器:${a}) 价格必须大于0`)}}const a=String((e&&e.maxLeaseDays)??""),s=Number(a);if(!/^\d{1,3}$/.test(a)||!Number.isInteger(s)||s<1||s>365){const a=e&&(e.miner||e.user)||t+1;return void this.$message.warning(`第${t+1}行(机器:${a}) 最大租赁天数需为 1-365 的整数`)}}this.confirmVisible=!0}else this.$message.warning("存在行的矿机型号全是空格,请修正后再试")},async doSubmit(){const[t,e]=this.selectedMiner.split("|");this.saving=!0;try{const t={productId:this.form.productId,powerDissipation:this.form.powerDissipation,theoryPower:this.form.theoryPower,type:this.form.type,unit:this.form.unit,cost:this.payTypeDefs&&this.payTypeDefs.length?Number(this.form.costMap&&this.form.costMap[this.payTypeDefs[0].key])||0:this.form.cost,maxLeaseDays:this.form.maxLeaseDays,productMachineURDVos:this.selectedMachineRows.map(t=>({miner:t.miner,price:this.payTypeDefs&&this.payTypeDefs.length?void 0:Number(t.price)||0,priceList:this.payTypeDefs&&this.payTypeDefs.length?this.payTypeDefs.map(e=>({chain:e.chain,coin:e.coin,price:Number(t.priceMap&&t.priceMap[e.key])||0})):void 0,state:t.state||0,type:t.type||this.form.type,user:t.user,maxLeaseDays:Number(t.maxLeaseDays)||Number(this.form.maxLeaseDays)||0,powerDissipation:Number(t.powerDissipation)||Number(this.form.powerDissipation)||0,theoryPower:Number(t.theoryPower)||Number(this.form.theoryPower)||0,unit:t.unit||this.form.unit}))};console.log(t,"请求参数");const e=await(0,s.addSingleOrBatchMachine)(t);!e||0!==e.code&&200!==e.code||(this.$message({message:"添加成功",duration:3e3,showClose:!0,type:"success"}),this.confirmVisible=!1,this.$router.back())}catch(a){console.error("添加出售机器失败",a),console.log("添加失败")}finally{this.saving=!1}}},watch:{"form.cost":function(){this.syncCostToRows()},form:{deep:!0,handler(t,e){this.payTypeDefs&&this.payTypeDefs.length&&t&&t.costMap&&Object.keys(t.costMap).forEach(a=>{e&&e.costMap&&t.costMap[a]!==e.costMap[a]&&this.handleCostMapInput(a,t.costMap[a])})}},"form.type":function(){this.updateMachineType()},"form.maxLeaseDays":function(){this.syncMaxLeaseDaysToRows()},"form.powerDissipation":function(){this.syncPowerDissipationToRows()},"form.theoryPower":function(){this.syncTheoryPowerToRows()},"form.unit":function(){this.syncUnitToRows()},selectedMachines(){this.updateSelectedMachineRows()}}}},3574:function(t,e){"use strict";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=[]},3663:function(t,e){"use strict";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.productDetailLoading,expression:"productDetailLoading"}],staticClass:"product-detail"},[t.loading?e("div",{staticClass:"loading"},[e("i",{staticClass:"el-icon-loading",attrs:{"aria-label":"加载中",role:"img"}}),t._v(" 加载中... ")]):t.product?e("div",{staticClass:"detail-container"},[e("h2",{staticStyle:{margin:"10px","text-align":"left","margin-top":"28px"}},[t._v("商品详情-选择矿机")]),e("section",{staticClass:"pay-methods",attrs:{"aria-label":"支付方式"}},[e("div",{staticClass:"pay-label",attrs:{tabindex:"0","aria-label":"支付方式标签"}},[t._v("支付方式:")]),e("ul",{staticClass:"pay-list",attrs:{role:"list","aria-label":"支付方式列表"}},t._l(t.paymentMethodList,function(a,s){return e("li",{key:s,staticClass:"pay-item",attrs:{"aria-label":`支付方式: ${a.payChain}`}},[e("el-tooltip",{attrs:{content:t.formatPayTooltip(a),placement:"top","open-delay":80}},[e("img",{staticClass:"pay-icon",attrs:{src:t.getPayImageUrl(a),alt:`${(a.payChain||"").toUpperCase()} ${(a.payCoin||"").toUpperCase()}`.trim(),title:t.formatPayTooltip(a),tabindex:"0",role:"img"},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.handlePayIconKeyDown(a))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"space",32,e.key,[" ","Spacebar"])?null:(e.preventDefault(),t.handlePayIconKeyDown(a))}]}})])],1)}),0)]),e("section",{staticClass:"filter-bar",attrs:{"aria-label":"筛选条件"}},[e("div",{staticClass:"filter-grid"},[e("div",{staticClass:"filter-cell"},[e("label",{staticClass:"filter-title",attrs:{for:"payFilter"}},[t._v("支付方式筛选")]),e("el-select",{staticClass:"filter-control",attrs:{id:"payFilter",placeholder:"全部",clearable:"",filterable:"",size:"small"},on:{change:t.handlePayFilterChange},scopedSlots:t._u([{key:"prefix",fn:function(){return[t.getSelectedPayIcon()?e("img",{staticStyle:{width:"16px",height:"16px","border-radius":"3px","margin-right":"6px"},attrs:{src:t.getSelectedPayIcon(),alt:""}}):t._e()]},proxy:!0}]),model:{value:t.selectedPayKey,callback:function(e){t.selectedPayKey=e},expression:"selectedPayKey"}},t._l(t.paymentMethodList,function(a,s){return e("el-option",{key:s,attrs:{label:t.formatPayTooltip(a),value:`${a.payChain||""}|${a.payCoin||""}`}},[e("div",{staticClass:"pay-opt"},[e("img",{staticClass:"pay-icon",attrs:{src:t.getPayImageUrl(a),alt:""}}),e("span",[t._v(t._s((a.payChain||"").toUpperCase())+" - "+t._s((a.payCoin||"").toUpperCase()))])])])}),1)],1),e("div",{staticClass:"filter-cell center-title"},[e("label",{staticClass:"filter-title"},[t._v("单价区间"),t.getPriceCoinSymbol()?e("span",[t._v("("+t._s(t.getPriceCoinSymbol())+")")]):t._e()]),e("div",{staticClass:"range-controls"},[e("el-input-number",{staticClass:"filter-control",attrs:{min:0,step:1,precision:0,controls:!1,size:"small"},model:{value:t.filters.minPrice,callback:function(e){t.$set(t.filters,"minPrice",e)},expression:"filters.minPrice"}}),e("span",{staticClass:"filter-sep"},[t._v("-")]),e("el-input-number",{staticClass:"filter-control",attrs:{min:0,step:1,precision:0,controls:!1,size:"small"},model:{value:t.filters.maxPrice,callback:function(e){t.$set(t.filters,"maxPrice",e)},expression:"filters.maxPrice"}})],1)]),e("div",{staticClass:"filter-cell center-title"},[e("label",{staticClass:"filter-title"},[t._v("实际算力")]),e("div",{staticClass:"range-controls"},[e("el-input-number",{staticClass:"filter-control",attrs:{min:0,step:.1,precision:2,controls:!1,size:"small"},model:{value:t.filters.minPower,callback:function(e){t.$set(t.filters,"minPower",e)},expression:"filters.minPower"}}),e("span",{staticClass:"filter-sep"},[t._v("-")]),e("el-input-number",{staticClass:"filter-control",attrs:{min:0,step:.1,precision:2,controls:!1,size:"small"},model:{value:t.filters.maxPower,callback:function(e){t.$set(t.filters,"maxPower",e)},expression:"filters.maxPower"}}),e("el-select",{staticClass:"filter-control",staticStyle:{"max-width":"140px"},attrs:{placeholder:"单位",size:"small"},model:{value:t.filters.unit,callback:function(e){t.$set(t.filters,"unit",e)},expression:"filters.unit"}},t._l(t.powerUnitOptions,function(t){return e("el-option",{key:t,attrs:{label:t,value:t}})}),1)],1)]),e("div",{staticClass:"filter-cell filter-cell--span-2 center-title"},[e("label",{staticClass:"filter-title"},[t._v("功耗(kw/h)")]),e("div",{staticClass:"range-controls"},[e("el-input-number",{staticClass:"filter-control",attrs:{min:0,step:.1,precision:2,controls:!1,size:"small"},model:{value:t.filters.minPowerDissipation,callback:function(e){t.$set(t.filters,"minPowerDissipation",e)},expression:"filters.minPowerDissipation"}}),e("span",{staticClass:"filter-sep"},[t._v("-")]),e("el-input-number",{staticClass:"filter-control",attrs:{min:0,step:.1,precision:2,controls:!1,size:"small"},model:{value:t.filters.maxPowerDissipation,callback:function(e){t.$set(t.filters,"maxPowerDissipation",e)},expression:"filters.maxPowerDissipation"}}),e("div",{staticClass:"filter-actions-inline"},[e("el-button",{attrs:{type:"primary",size:"small","aria-label":"执行筛选"},on:{click:t.handleSearchFilters}},[t._v("筛选查询")]),e("el-button",{attrs:{size:"small","aria-label":"重置筛选"},on:{click:t.handleResetFilters}},[t._v("重置")])],1)],1)])])]),e("section",{staticClass:"productList"},[e("el-table",{ref:"machineTable",staticClass:"series-table",staticStyle:{width:"100%"},attrs:{data:t.machineList,"row-key":"id","row-class-name":t.handleGetRowClass,"header-cell-style":{textAlign:"left"},"cell-style":{textAlign:"left"}}},[e("el-table-column",{attrs:{width:"46"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-checkbox",{attrs:{disabled:1===a.row.saleState||2===a.row.saleState,title:1===a.row.saleState||2===a.row.saleState?"该机器已售出或售出中,无法选择":""},on:{change:e=>t.handleManualSelectFlat(a.row,e)},model:{value:a.row._selected,callback:function(e){t.$set(a.row,"_selected",e)},expression:"scope.row._selected"}})]}}])}),e("el-table-column",{attrs:{prop:"theoryPower",label:"理论算力","header-align":"left",align:"left","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(a){return[e("span",{staticClass:"num-strong"},[t.formatNum6(a.row.theoryPower).truncated?e("el-tooltip",{attrs:{content:t.formatNum6(a.row.theoryPower).full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatNum6(a.row.theoryPower).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatNum6(a.row.theoryPower).text))])],1),t._v(" "+t._s(a.row.unit)+" ")]}}])}),e("el-table-column",{attrs:{"header-align":"left",align:"left","show-overflow-tooltip":""},scopedSlots:t._u([{key:"header",fn:function(){return[e("span",{staticClass:"sortable",class:{active:"powerSort"===t.activeSortField},on:{click:function(e){return t.handleToggleSort("powerSort")}}},[t._v(" 实际算力 "),e("i",{staticClass:"sort-arrow",class:[t.sortStates&&t.sortStates.powerSort?"asc":"desc","powerSort"===t.activeSortField?"active":""]})])]},proxy:!0},{key:"default",fn:function(a){return[e("span",{staticClass:"num-strong"},[t.formatNum6(a.row.computingPower).truncated?e("el-tooltip",{attrs:{content:t.formatNum6(a.row.computingPower).full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatNum6(a.row.computingPower).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatNum6(a.row.computingPower).text))])],1),t._v(" "+t._s(a.row.unit)+" ")]}}])}),e("el-table-column",{attrs:{prop:"powerDissipation","header-align":"left",align:"left"},scopedSlots:t._u([{key:"header",fn:function(){return[e("span",{staticClass:"sortable",class:{active:"powerDissipationSort"===t.activeSortField},on:{click:function(e){return t.handleToggleSort("powerDissipationSort")}}},[t._v(" 功耗(kw/h) "),e("i",{staticClass:"sort-arrow",class:[t.sortStates&&t.sortStates.powerDissipationSort?"asc":"desc","powerDissipationSort"===t.activeSortField?"active":""]})])]},proxy:!0}])}),e("el-table-column",{attrs:{prop:"algorithm",label:"算法","header-align":"left",align:"left"}}),e("el-table-column",{attrs:{prop:"theoryIncome","header-align":"left",align:"left","show-overflow-tooltip":""},scopedSlots:t._u([{key:"header",fn:function(){return[t._v(" 单机理论收入(每日) "),t.getFirstCoinSymbol()?e("span",[t._v("("+t._s(t.getFirstCoinSymbol())+")")]):t._e()]},proxy:!0},{key:"default",fn:function(a){return[e("span",{staticClass:"num-strong"},[t.formatNum6(a.row.theoryIncome).truncated?e("el-tooltip",{attrs:{content:t.formatNum6(a.row.theoryIncome).full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatNum6(a.row.theoryIncome).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatNum6(a.row.theoryIncome).text))])],1)]}}])}),e("el-table-column",{attrs:{prop:"theoryUsdtIncome",label:"单机理论收入(每日/USDT)","header-align":"left",align:"left"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("span",{staticClass:"num-strong"},[t.formatNum6(a.row.theoryUsdtIncome).truncated?e("el-tooltip",{attrs:{content:t.formatNum6(a.row.theoryUsdtIncome).full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatNum6(a.row.theoryUsdtIncome).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatNum6(a.row.theoryUsdtIncome).text))])],1)]}}])}),e("el-table-column",{attrs:{prop:"type",label:"矿机型号","header-align":"left",align:"left"}}),e("el-table-column",{attrs:{label:"最大可租赁(天)","header-align":"left",align:"left"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.getRowMaxLeaseDays(e.row)))]}}])}),e("el-table-column",{attrs:{label:"租赁天数(天)","header-align":"left",align:"left"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-input-number",{attrs:{min:1,max:t.getRowMaxLeaseDays(a.row),step:1,precision:0,size:"mini",disabled:1===a.row.saleState||2===a.row.saleState,"controls-position":"right"},on:{change:e=>t.handleLeaseDaysChange(a.row,e)},model:{value:a.row.leaseTime,callback:function(e){t.$set(a.row,"leaseTime",e)},expression:"scope.row.leaseTime"}})]}}])}),e("el-table-column",{attrs:{prop:"price","header-align":"left",align:"center"},scopedSlots:t._u([{key:"header",fn:function(){return[e("span",{staticClass:"sortable",class:{active:"priceSort"===t.activeSortField},on:{click:function(e){return t.handleToggleSort("priceSort")}}},[t._v(" 单价 "),t.getPriceCoinSymbol()?e("span",[t._v("("+t._s(t.getPriceCoinSymbol())+")")]):t._e(),e("i",{staticClass:"sort-arrow",class:[t.sortStates&&t.sortStates.priceSort?"asc":"desc","priceSort"===t.activeSortField?"active":""]})])]},proxy:!0},{key:"default",fn:function(a){return[e("span",{staticClass:"price-strong"},[t.formatAmount(a.row.price,t.getRowCoin(a.row)).truncated?e("el-tooltip",{attrs:{content:t.formatAmount(a.row.price,t.getRowCoin(a.row)).full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(a.row.price,t.getRowCoin(a.row)).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatAmount(a.row.price,t.getRowCoin(a.row)).text))])],1)]}}])}),e("el-table-column",{attrs:{prop:"saleState",label:"售出状态",width:"110","header-align":"left",align:"left"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-tag",{attrs:{type:0===a.row.saleState?"info":1===a.row.saleState?"danger":"warning"}},[t._v(" "+t._s(0===a.row.saleState?"未售出":1===a.row.saleState?"已售出":"售出中")+" ")])]}}])})],1)],1),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:"80vw",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:"theoryPower",label:"理论算力","header-align":"left",align:"left"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("span",{staticClass:"num-strong"},[t.formatNum6(a.row.theoryPower).truncated?e("el-tooltip",{attrs:{content:t.formatNum6(a.row.theoryPower).full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatNum6(a.row.theoryPower).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatNum6(a.row.theoryPower).text))])],1),t._v(" "+t._s(a.row.unit)+" ")]}}])}),e("el-table-column",{attrs:{label:"实际算力","header-align":"left",align:"left"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("span",{staticClass:"num-strong"},[t.formatNum6(a.row.computingPower).truncated?e("el-tooltip",{attrs:{content:t.formatNum6(a.row.computingPower).full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatNum6(a.row.computingPower).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatNum6(a.row.computingPower).text))])],1),t._v(" "+t._s(a.row.unit)+" ")]}}])}),e("el-table-column",{attrs:{prop:"algorithm",label:"算法",width:"120","header-align":"left",align:"left"}}),e("el-table-column",{attrs:{prop:"powerDissipation",label:"功耗(kw/h)","header-align":"left",align:"left"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("span",{staticClass:"num-strong"},[t.formatNum6(a.row.powerDissipation).truncated?e("el-tooltip",{attrs:{content:t.formatNum6(a.row.powerDissipation).full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatNum6(a.row.powerDissipation).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatNum6(a.row.powerDissipation).text))])],1)]}}])}),e("el-table-column",{attrs:{label:"租赁天数(天)","header-align":"left",align:"left"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(Number(e.row.leaseTime||1)))]}}])}),e("el-table-column",{attrs:{prop:"price","header-align":"left",align:"left"},scopedSlots:t._u([{key:"header",fn:function(){return[t._v(" 单价 "),t.getPriceCoinSymbol()?e("span",[t._v("("+t._s(t.getPriceCoinSymbol())+")")]):t._e()]},proxy:!0},{key:"default",fn:function(a){return[e("span",{staticClass:"price-strong"},[t.formatAmount(a.row.price,t.getRowCoin(a.row)).truncated?e("el-tooltip",{attrs:{content:t.formatAmount(a.row.price,t.getRowCoin(a.row)).full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(a.row.price,t.getRowCoin(a.row)).text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatAmount(a.row.price,t.getRowCoin(a.row)).text))])],1)]}}])})],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=[]},3723:function(t,e,a){"use strict";var s=a(3999)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e.productRoutes=e.mainRoutes=e["default"]=e.childrenRoutes=e.checkoutRoutes=e.cartRoutes=e.accountRoutes=void 0;var i=s(a(1774));const o=e.productRoutes=[{path:"/productList",name:"productList",component:()=>Promise.resolve().then(()=>(0,i.default)(a(1043))),meta:{title:"商品列表",description:"浏览所有可用商品",allAuthority:["all"]}},{path:"/product/:id",name:"productDetail",component:()=>Promise.resolve().then(()=>(0,i.default)(a(589))),meta:{title:"商品详情",description:"查看商品详细信息",allAuthority:["all"]}}],r=e.cartRoutes=[{path:"/cart",name:"cart",component:()=>Promise.resolve().then(()=>(0,i.default)(a(4125))),meta:{title:"购物车",description:"管理购物车商品",allAuthority:["all"]}}],n=e.checkoutRoutes=[{path:"/checkout",name:"checkout",component:()=>Promise.resolve().then(()=>(0,i.default)(a(5638))),meta:{title:"订单结算",description:"完成订单结算",allAuthority:["all"]}}],l=e.accountRoutes=[{path:"/account",name:"account",component:()=>Promise.resolve().then(()=>(0,i.default)(a(3834))),redirect:"/account/shops",meta:{title:"个人中心",description:"管理个人资料和店铺",allAuthority:["all"]},children:[{path:"wallet",name:"Wallet",component:()=>Promise.resolve().then(()=>(0,i.default)(a(9072))),meta:{title:"我的钱包",description:"查看钱包余额、充值和提现",allAuthority:["all"]}},{path:"rechargeRecord",name:"RechargeRecord",component:()=>Promise.resolve().then(()=>(0,i.default)(a(6851))),meta:{title:"充值记录",description:"查看充值记录",allAuthority:["all"]}},{path:"withdrawalHistory",name:"WithdrawalHistory",component:()=>Promise.resolve().then(()=>(0,i.default)(a(1394))),meta:{title:"提现记录",description:"查看提现记录",allAuthority:["all"]}},{path:"receipt-record",name:"accountReceiptRecord",component:()=>Promise.resolve().then(()=>(0,i.default)(a(8441))),meta:{title:"收款记录",description:"卖家收款流水记录",allAuthority:["all"]}},{path:"shop-new",name:"accountShopNew",component:()=>Promise.resolve().then(()=>(0,i.default)(a(1749))),meta:{title:"新增店铺",description:"创建新的店铺",allAuthority:["all"]}},{path:"shop-config",name:"accountShopConfig",component:()=>Promise.resolve().then(()=>(0,i.default)(a(4859))),meta:{title:"钱包绑定",description:"绑定店铺收款钱包",allAuthority:["all"]}},{path:"shops",name:"accountMyShops",component:()=>Promise.resolve().then(()=>(0,i.default)(a(7802))),meta:{title:"我的店铺",description:"查看我的店铺信息",allAuthority:["all"]}},{path:"product-new",name:"accountProductNew",component:()=>Promise.resolve().then(()=>(0,i.default)(a(9266))),meta:{title:"新增商品",description:"创建新的商品",allAuthority:["all"]}},{path:"products",name:"accountProducts",component:()=>Promise.resolve().then(()=>(0,i.default)(a(7915))),meta:{title:"商品列表",description:"管理店铺下的商品列表",allAuthority:["all"]}},{path:"purchased",name:"accountPurchased",component:()=>Promise.resolve().then(()=>(0,i.default)(a(5815))),meta:{title:"已购商品",description:"查看已购买的商品列表",allAuthority:["all"]}},{path:"funds-flow",name:"accountFundsFlow",component:()=>Promise.resolve().then(()=>(0,i.default)(a(6952))),meta:{title:"资金流水",description:"充值/提现/消费记录切换查看",allAuthority:["all"]}},{path:"purchased-detail/:id",name:"PurchasedDetail",component:()=>Promise.resolve().then(()=>(0,i.default)(a(8874))),meta:{title:"已购商品详情",description:"查看已购商品详细信息",allAuthority:["all"]}},{path:"orders",name:"accountOrders",component:()=>Promise.resolve().then(()=>(0,i.default)(a(8401))),meta:{title:"订单列表",description:"查看与管理订单(按状态筛选)",allAuthority:["all"]}},{path:"seller-orders",name:"accountSellerOrders",component:()=>Promise.resolve().then(()=>(0,i.default)(a(4051))),meta:{title:"已售出订单",description:"卖家侧订单列表",allAuthority:["all"]}},{path:"order-detail/:id",name:"accountOrderDetail",component:()=>Promise.resolve().then(()=>(0,i.default)(a(4458))),meta:{title:"订单详情",description:"查看订单详细信息",allAuthority:["all"]}},{path:"product-detail/:id",name:"accountProductDetail",component:()=>Promise.resolve().then(()=>(0,i.default)(a(5355))),meta:{title:"商品详情",description:"个人中心 - 商品详情",allAuthority:["all"]}},{path:"product-machine-add",name:"accountProductMachineAdd",component:()=>Promise.resolve().then(()=>(0,i.default)(a(2605))),meta:{title:"添加出售机器",description:"为商品添加出售机器",allAuthority:["all"]}}]}],c=e.childrenRoutes=[...o,...r,...n,...l],d=e.mainRoutes=[{path:"/",name:"Home",component:()=>Promise.resolve().then(()=>(0,i.default)(a(1182))),redirect:"/productList",children:c},{path:"*",redirect:"/productList"}];e["default"]=d},3834:function(t,e,a){"use strict";a.r(e),a.d(e,{__esModule:function(){return i.B},default:function(){return l}});var s=a(1910),i=a(1259),o=i.A,r=a(845),n=(0,r.A)(o,s.XX,s.Yp,!1,null,"59d86c16",null),l=n.exports},4051:function(t,e,a){"use strict";a.r(e),a.d(e,{__esModule:function(){return i.B},default:function(){return l}});var s=a(9690),i=a(1977),o=i.A,r=a(845),n=(0,r.A)(o,s.XX,s.Yp,!1,null,"c4d1af58",null),l=n.exports},4125:function(t,e,a){"use strict";a.r(e),a.d(e,{__esModule:function(){return i.B},default:function(){return l}});var s=a(950),i=a(8732),o=i.A,r=a(845),n=(0,r.A)(o,s.XX,s.Yp,!1,null,"639b0fc8",null),l=n.exports},4180:function(t,e,a){"use strict";var s=a(3999)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e.addOrders=o,e.cancelOrder=r,e.getChainAndListForSeller=d,e.getCoinPrice=u,e.getOrdersByIds=n,e.getOrdersByStatus=l,e.getOrdersByStatusForSeller=c;var i=s(a(5720));function o(t){return(0,i.default)({url:"/lease/order/info/addOrders",method:"post",data:t})}function r(t){return(0,i.default)({url:"/lease/order/info/cancelOrder",method:"post",data:t})}function n(t){return(0,i.default)({url:"/lease/order/info/getOrdersByIds",method:"post",data:t})}function l(t){return(0,i.default)({url:"/lease/order/info/getOrdersByStatus",method:"post",data:t})}function c(t){return(0,i.default)({url:"/lease/order/info/getOrdersByStatusForSeller",method:"post",data:t})}function d(t){return(0,i.default)({url:"/lease/shop/getChainAndListForSeller",method:"post",data:t})}function u(t){return(0,i.default)({url:"/lease/order/info/getCoinPrice",method:"post",data:t})}},4300:function(t,e,a){"use strict";Object.defineProperty(e,"B",{value:!0}),e.A=void 0,a(8111),a(1701);var s=a(6299),i=a(4981);e.A={name:"AccountReceiptRecord",data(){return{loading:!1,rows:[{orderId:"1234567890",fromChain:"tron",fromSymbol:"USDT",fromAddress:"TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",toChain:"tron",coin:"USDT",toAddress:"TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",txHash:"TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",status:2,updateTime:"2024-01-15 14:30:25",realAmount:100},{orderId:"1234567890",fromChain:"tron",fromSymbol:"USDT",fromAddress:"TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",toChain:"tron",coin:"USDT",toAddress:"TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",txHash:"TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",status:1,updateTime:"2024-01-15 14:30:25",realAmount:106}],page:1,pageSize:10,total:0,range:[],keyword:"",expandedRowKeys:[]}},mounted(){this.fetchList(),this.rows=this.withKeys(this.rows)},methods:{formatAmount(t,e){return(0,i.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),a=this.expandedRowKeys.includes(e);this.expandedRowKeys=a?[]:[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 a=Number(t);if(!Number.isFinite(a))return"0";const s=Math.max(0,Number(e)||0),i=Math.pow(10,s),o=Math.trunc(a*i)/i,r=String(o);if(0===s)return r;const[n,l=""]=r.split("."),c=l.padEnd(s,"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||"-"},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(a){}const e=document.createElement("textarea");e.value=t,document.body.appendChild(e),e.select();try{document.execCommand("copy"),this.$message.success("已复制")}catch(a){}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,s.sellerReceiptList)(t),a=e&&(e.data||e),i=Array.isArray(a&&a.rows)?a.rows:Array.isArray(a)?a:[];this.rows=this.withKeys(i),this.total=e.total}catch(t){this.rows=[],this.total=0}finally{this.loading=!1}}}}},4458:function(t,e,a){"use strict";a.r(e),a.d(e,{__esModule:function(){return i.B},default:function(){return l}});var s=a(2389),i=a(9660),o=i.A,r=a(845),n=(0,r.A)(o,s.XX,s.Yp,!1,null,"613e4d6c",null),l=n.exports},4487:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=void 0,a(4114),a(8111),a(2489),a(116),a(2912),a(7588),a(1701),a(8237),a(7642),a(8004),a(3853),a(5876),a(2475),a(5024),a(1698);var s=a(7723),i=a(5952),o=a(9662),r=a(5844),n=a(4981);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"},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}},mounted(){this.$route.params.id?(this.params.id=this.$route.params.id,this.product=!0,this.productListData&&this.productListData.length&&(this.expandedRowKeys=[this.productListData[0].id]),this.fetchGetMachineInfo(this.params),this.fetchPayTypes()):(this.$message.error("商品不存在"),this.product=!1),this.fetchGetGoodsList()},methods:{getRowCoin(t){try{const e=t&&(t.payCoin||t.coin)||this.getPriceCoinSymbol()||"";return String(e).toUpperCase()}catch(e){return""}},formatAmount(t,e){return(0,n.truncateAmountByCoin)(t,e)},formatNum6(t){return(0,n.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 a=t.find(t=>String(t&&t.payCoin).toUpperCase()===String(e).toUpperCase());if(!a)return;const s=`${a.payChain||""}|${a.payCoin||""}`;this.selectedPayKey=s,this.filters.chain=String(a.payChain||"").trim(),this.filters.coin=String(a.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={id:this.params.id};try{this.params&&null!=this.params.pageNum&&(t.pageNum=this.params.pageNum),this.params&&null!=this.params.pageSize&&(t.pageSize=this.params.pageSize)}catch(a){}const e=(e,a,s)=>{const i=e[a];if(null===i||void 0===i||""===i)return;const o=Number(i);Number.isFinite(o)&&o>0&&(t[s]=o)};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");try{if(this.activeSortField){const e=this.sortStates||{};t[this.activeSortField]=!!e[this.activeSortField]}}catch(a){}return t},async fetchPayTypes(){try{const t=await(0,o.getPayTypes)({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,o.getMachineInfo)(t);if(console.log(e),e&&200===e.code){console.log(e.data,"res.rows"),this.total=e.total||0;try{const t=e&&e.data&&e.data.payConfigList;Array.isArray(t)&&t.length&&(this.paymentMethodList=t)}catch(a){}const t=e&&e.data&&(e.data.rows||e.data.list)||e&&e.rows||[],s=(Array.isArray(t)?t:[]).map((t,e)=>({...t,id:t&&void 0!==t.id&&null!==t.id?t.id:`m-${e}`,leaseTime:t&&t.leaseTime&&Number(t.leaseTime)>0?Number(t.leaseTime):1,_selected:!1}));this.machineList=s,this.productListData=[],this.expandedRowKeys=[],this.ensureDefaultPayFilterSelection(),this.$nextTick(()=>{this.machinesLoaded=!0})}this.productDetailLoading=!1},async loadProduct(){try{this.loading=!0;const t=this.$route.params.id;this.product=await(0,s.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(0,r.addCart)(t);return e},async fetchGetGoodsList(t){const e=await(0,r.getGoodsList)(t);try{const t=this.params&&this.params.id?Number(this.params.id):Number(this.$route.params.id),s=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:[],i=s.length&&s[0]&&Array.isArray(s[0].shoppingCartInfoDtoList)?s.flatMap(t=>Array.isArray(t.shoppingCartInfoDtoList)?t.shoppingCartInfoDtoList:[]):s,o=i.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=i.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(a){}this.$nextTick(()=>{this.cartLoaded=!0,this.autoSelectAndDisable()})}catch(a){console.warn("解析购物车数据失败",a)}},handleBack(){this.$router.push("/productList")},handleSeriesRowClick(t){const e=t.id,a=Object.keys(this.selectedMap).filter(t=>(this.selectedMap[t]||[]).length>0),s=this.expandedRowKeys.includes(e);this.expandedRowKeys=s?a:Array.from(new Set([e,...a]))},handleGetSeriesRowClassName(){return"series-clickable-row"},handleInnerSelectionChange(t,e){const a=t.id;this.$set(this.selectedMap,a,e);const s=Object.keys(this.selectedMap).filter(t=>(this.selectedMap[t]||[]).length>0),i=new Set(this.expandedRowKeys);s.forEach(t=>i.add(t)),this.expandedRowKeys=Array.from(i).filter(t=>s.includes(t)||t===a||this.expandedRowKeys.includes(t))},handleExpandChange(t,e){},autoSelectAndDisable(){},isSelectable(t,e){return!0},isSelectedByParent(t,e){const a=t&&t.id,s=a&&this.selectedMap[a]||[];return!!s.find(t=>t&&t.id===e.id)},handleManualSelect(t,e,a){if(e&&(1===e.saleState||2===e.saleState))return this.$message.warning("该机器已售出或售出中,无法选择"),void this.$set(e,"_selected",!1);const s=t.id,i=this.selectedMap[s]&&[...this.selectedMap[s]]||[],o=i.findIndex(t=>t&&t.id===e.id);a&&-1===o&&i.push(e),!a&&o>-1&&i.splice(o,1),this.$set(this.selectedMap,s,i),this.$set(e,"_selected",!!a)},handleGetInnerRowClass({row:t}){return t&&(1===t.saleState||2===t.saleState)?"sold-row":""},handleDecreaseVariantQuantity(t,e){const a=this.productListData[t].variants[e];a.quantity>1&&a.quantity--},handleIncreaseVariantQuantity(t,e){const a=this.productListData[t].variants[e];a.quantity<99&&a.quantity++},handleVariantQuantityInput(t,e){const a=this.productListData[t].variants[e],s=Number(a.quantity);(!s||s<1)&&(a.quantity=1),s>99&&(a.quantity=99)},handleAddVariantToCart(t){if(t&&t.onlyKey)try{(0,i.addToCart)({id:t.onlyKey,title:t.model,price:t.price,quantity:t.quantity}),this.$message.success(`已添加 ${t.quantity} 件 ${t.model} 到购物车`),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=>{(0,i.addToCart)({id:t.onlyKey||t.id,title:t.type||t.model||"矿机",price:t.price,quantity:1,leaseTime:Number(t.leaseTime||1)})}),this.$message.success(`已加入 ${t.length} 台矿机到购物车`),this.selectedMap={}}catch(e){console.error("统一加入购物车失败",e)}else this.$message.warning("请先勾选至少一台矿机")},handleOpenAddToCartDialog(){const t=Array.isArray(this.productListData)?this.productListData:[],e=t.flatMap(t=>Array.isArray(t.productMachines)?t.productMachines.filter(t=>!!t&&!!t._selected):[]),a=e.filter(t=>t&&(0===t.saleState||void 0===t.saleState||null===t.saleState));a.length?(a.length<e.length&&this.$message.warning("部分机器已售出或售出中,已自动为您排除"),this.confirmAddDialog.items=a.slice(),this.confirmAddDialog.visible=!0,this.$nextTick(()=>{try{this.clearAllSelections()}catch(t){}})):this.$message.warning("请先勾选至少一台矿机")},async handleConfirmAddSelectedToCart(){const t=Array.isArray(this.confirmAddDialog.items)?this.confirmAddDialog.items.filter(Boolean):[];if(!t.length)return void this.$message.warning("请先勾选至少一台矿机");const e=this.params&&this.params.id?this.params.id:this.$route&&this.$route.params&&this.$route.params.id;if(!e)return void this.$message.error("商品ID缺失,无法加入购物车");const a=t.map(t=>({productId:e,productMachineId:t.id,leaseTime:Number(t.leaseTime||1)}));try{const e=await this.fetchAddCart(a);if(!e||e.code&&200!==Number(e.code))return void this.$message.error(e&&e.msg?e.msg:"加入购物车失败,请稍后重试");try{t.forEach(t=>{t&&t.id&&this.cartMachineIdSet.add(t.id),this.$set(t,"_selected",!1),this.$set(t,"_inCart",!0),(!t.leaseTime||Number(t.leaseTime)<=0)&&this.$set(t,"leaseTime",1)}),this.$nextTick(()=>this.autoSelectAndDisable())}catch(s){}this.$message({message:`已加入 ${t.length} 台矿机到购物车`,type:"success",duration:3e3,showClose:!0}),this.confirmAddDialog.visible=!1,this.selectedMap={},this.fetchGetMachineInfo(this.params),this.fetchGetGoodsList();try{window.dispatchEvent(new CustomEvent("cart-updated"))}catch(s){}}catch(s){console.error("加入购物车失败: ",s),this.$message.error("加入购物车失败,请稍后重试")}},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{(0,i.addToCart)({id:t.date,title:t.date,price:t.price,quantity:t.quantity,leaseTime:Number(t.leaseTime||1)}),this.$message.success(`已添加 ${t.quantity} 件 ${t.date} 到购物车`),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())}}}},4571:function(t,e){"use strict";e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"purchased-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:"sub-title"},[t._v("基本信息")]),e("div",{staticClass:"row"},[e("span",{staticClass:"label"},[t._v("用户:")]),e("span",{staticClass:"value mono"},[t._v(t._s(t.detail.userId||"—"))])]),e("div",{staticClass:"row"},[e("span",{staticClass:"label"},[t._v("订单项ID:")]),e("span",{staticClass:"value mono"},[t._v(t._s(t.detail.orderItemId||"—"))])]),e("div",{staticClass:"row"},[e("span",{staticClass:"label"},[t._v("机器ID:")]),e("span",{staticClass:"value mono"},[t._v(t._s(t.detail.productMachineId||"—"))])]),e("div",{staticClass:"row"},[e("span",{staticClass:"label"},[t._v("商品类型:")]),e("span",{staticClass:"value"},[e("el-tag",{attrs:{type:1===t.detail.type?"success":"info"}},[t._v(" "+t._s(1===t.detail.type?"算力套餐":"挖矿机器")+" ")])],1)]),e("div",{staticClass:"row"},[e("span",{staticClass:"label"},[t._v("状态:")]),e("span",{staticClass:"value"},[e("el-tag",{attrs:{type:0===t.detail.status?"success":"info"}},[t._v(" "+t._s(0===t.detail.status?"运行中":"已过期")+" ")])],1)]),e("div",{directives:[{name:"show",rawName:"v-show",value:1===t.detail.type,expression:"detail.type === 1"}],staticClass:"row"},[e("span",{staticClass:"label"},[t._v("购买算力:")]),e("span",{staticClass:"value strong"},[t._v(t._s(t.detail.purchasedComputingPower))])]),e("div",{staticClass:"row"},[e("span",{staticClass:"label"},[t._v("购买时间:")]),e("span",{staticClass:"value"},[t._v(t._s(t.formatDateTime(t.detail.createTime)))])]),e("div",{staticClass:"row"},[e("span",{staticClass:"label"},[t._v("开始时间:")]),e("span",{staticClass:"value"},[t._v(t._s(t.formatDateTime(t.detail.startTime)))])]),e("div",{staticClass:"row"},[e("span",{staticClass:"label"},[t._v("结束时间:")]),e("span",{staticClass:"value"},[t._v(t._s(t.formatDateTime(t.detail.endTime)))])])]),e("el-card",{staticClass:"section",staticStyle:{"margin-top":"12px"}},[e("div",{staticClass:"sub-title"},[t._v("收益信息")]),e("div",{staticClass:"row"},[e("span",{staticClass:"label"},[t._v("当前实际算力:")]),e("span",{staticClass:"value strong"},[t._v(t._s(t.detail.currentComputingPower||"0"))])]),e("div",{staticClass:"row"},[e("span",{staticClass:"label"},[t._v("币种收益:")]),e("span",{staticClass:"value strong"},[t._v(t._s(t.detail.currentIncome||"0"))])]),e("div",{staticClass:"row"},[e("span",{staticClass:"label"},[t._v("当前USDT收益:")]),e("span",{staticClass:"value strong"},[t._v(t._s(t.detail.currentUsdtIncome||"0")+" USDT")])]),e("div",{staticClass:"row"},[e("span",{staticClass:"label"},[t._v("预估结束总收益:")]),e("span",{staticClass:"value strong"},[t._v(t._s(t.detail.estimatedEndIncome||"0"))])]),e("div",{staticClass:"row"},[e("span",{staticClass:"label"},[t._v("预估结束USDT总收益:")]),e("span",{staticClass:"value strong"},[t._v(t._s(t.detail.estimatedEndUsdtIncome||"0")+" USDT")])])]),e("div",{staticClass:"actions"},[e("el-button",{on:{click:function(e){return t.$router.back()}}},[t._v("返回")])],1)],1)])},e.Yp=[]},4601:function(t,e,a){"use strict";Object.defineProperty(e,"B",{value:!0}),e.A=void 0,a(4114),a(8111),a(2489),a(7588),a(1701);a(5705);var s=a(6299);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(),a=(this.value||[]).filter(t=>Array.isArray(t)&&String(t[1]).toLowerCase()!==e);this.handleChange(a)},handleItemClick(t,e){if(t)if(t.isLeaf){const e=t.path.map(t=>t.value),a=e[0],s=e[1];this.currentChain=String(a||"");let i=Array.isArray(this.value)?this.value.slice():[];const o=i.length?i[i.length-1]:null,r=Array.isArray(o)?o[0]:null;r&&r!==a&&(i=[]);const n=i.findIndex(t=>Array.isArray(t)&&t[0]===a&&t[1]===s);n>=0?i.splice(n,1):i.push([a,s]),this.handleChange(i)}else{const a=e&&e.value;t.expanded||t.expand(),a&&(this.currentChain=String(a),this.value=[],this.form.chain=String(a),this.form.payCoin="")}},handleExpandChange(t){const e=Array.isArray(t)&&t[0]||"";e&&(this.currentChain=String(e))},validateAddressByChain(t,e){const a=String(t||"").toLowerCase(),s=String(e||"").trim();if(!s)return{ok:!1,message:"请输入收款地址"};if(a.includes("tron")||"tron"===a){const t=/^T[A-Za-z1-9]{33}$/.test(s);return t?{ok:!0}:{ok:!1,message:"请输入正确的 TRON 地址:以 T 开头的 34 位字符"}}if(a.includes("ethereum")||"ethereum"===a||a.includes("eth")||a.includes("bsc")||"bsc"===a||a.includes("polygon")||"polygon"===a||a.includes("erc")||a.includes("bep")){const t=/^0x[a-fA-F0-9]{40}$/.test(s);return t?{ok:!0}:{ok:!1,message:"请输入正确的以太坊/EVM 兼容链地址:以 0x 开头 + 40 位十六进制"}}return s.length<=10?{ok:!1,message:"请输入正确的收款地址格式"}:{ok:!0}},async getChainAndList(){this.loading=!0;const t=await(0,s.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},a=t&&(null!=t.label?t.label:t.value)||"";return e.label=String(a).toUpperCase(),Array.isArray(t&&t.children)&&(e.children=this.toUpperOptions(t.children)),e})},async FetchAddWalletShopConfig(t){this.loading=!0;const e=await(0,s.addWalletShopConfig)(t);!e||0!==e.code&&200!==e.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 a=e[e.length-1],s=Array.isArray(a)?a[0]:"",i=this.currentChain||s,o=e.filter(t=>Array.isArray(t)&&t[0]===i);this.value=o,this.form.chain=i||"",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:a}=this.validateAddressByChain(this.form.chain,this.form.payAddress);e?this.preCheckBeforeBind():this.$message.warning(a||"钱包地址格式不正确")},async preCheckBeforeBind(){try{this.loading=!0;const t={chain:this.form.chain,payCoin:this.form.payCoin},e=await(0,s.getProductListForShopWalletConfig)(t),a=Array.isArray(e&&e.data)?e.data:Array.isArray(e&&e.rows)?e.rows:[];if(a&&a.length){this.preCheck.rows=a;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,a)=>{const s=this.getRowKey(e,a);this.preCheck.rowPrices[s]||this.$set(this.preCheck.rowPrices,s,{}),t.forEach(t=>{t in this.preCheck.rowPrices[s]||this.$set(this.preCheck.rowPrices[s],t,"")})}),this.preCheck.visible=!0}else await this.submitBindWithPrice([])}catch(t){await this.submitBindWithPrice([])}finally{this.loading=!1}},handleConfirmBindAfterPreview(){const t=(this.form.payCoin||"").split(",").map(t=>t.trim().toUpperCase()).filter(Boolean);for(let a=0;a<this.preCheck.rows.length;a++){const e=this.preCheck.rows[a],s=this.getRowKey(e,a),i=this.preCheck.rowPrices&&this.preCheck.rowPrices[s]||{};for(const o of t){const t=i[o];if(!t||Number(t)<=0)return void this.$message.warning(`请填写第 ${a+1} 行 ${o} 的价格`)}}const e=this.collectMachineGroups(this.preCheck.rows);this.preCheck.visible=!1,this.submitBindWithPrice(e)},collectMachineGroups(t){const e=[],a=(t,e)=>{null!=e&&""!==e&&t.push(e)};return(t||[]).forEach((t,s)=>{const i=[];Array.isArray(t&&t.machineList)&&t.machineList.forEach(t=>a(i,t&&(null!=t.productMachineId?t.productMachineId:t.id))),Array.isArray(t&&t.productMachineIdList)&&t.productMachineIdList.forEach(t=>a(i,t)),t&&null!=t.productMachineId&&a(i,t.productMachineId),Array.isArray(t&&t.productMachineDtoList)&&t.productMachineDtoList.forEach(t=>a(i,t&&(null!=t.productMachineId?t.productMachineId:t.id))),Array.isArray(t&&t.machines)&&t.machines.forEach(t=>a(i,t&&(null!=t.productMachineId?t.productMachineId:t.id))),Array.isArray(t&&t.items)&&t.items.forEach(t=>a(i,t&&(null!=t.productMachineId?t.productMachineId:t.id)));const o=this.getRowKey(t,s);e.push({key:o,machineIds:i})}),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),a=[];Array.isArray(t)&&t.length&&t.forEach(t=>{const s=this.preCheck.rowPrices&&this.preCheck.rowPrices[t.key]||{},i=e.map(t=>s[t]||"").join(",");(t.machineIds||[]).forEach(t=>{a.push({productMachineId:t,price:i})})});const i={chain:this.form.chain,symbol:this.form.payCoin,payAddress:this.form.payAddress,productMachineForWalletConfigVoList:a},o=await(0,s.updateProductListForShopWalletConfig)(i);!o||0!==o.code&&200!==o.code?this.preCheck.visible=!0:(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 a=this.preCheck.rows[e],s=this.getRowKey(a,e),i=this.preCheck.rowPrices&&this.preCheck.rowPrices[s]||{};for(const e of t){const t=i[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())}}}},4859:function(t,e,a){"use strict";a.r(e),a.d(e,{__esModule:function(){return i.B},default:function(){return l}});var s=a(8603),i=a(4601),o=i.A,r=a(845),n=(0,r.A)(o,s.XX,s.Yp,!1,null,"42f7ea7c",null),l=n.exports},4981:function(t,e){"use strict";function a(){return 6}function s(t,e){if(null===t||void 0===t)return{text:"0",truncated:!1,full:"0"};const a=String(t);if(!a)return{text:"0",truncated:!1,full:"0"};if(!/^-?\d+(\.\d+)?$/.test(a))return{text:a,truncated:!1,full:a};const s=a.startsWith("-"),i=s?a.slice(1):a,[o,r=""]=i.split("."),n=r.slice(0,Math.max(0,e)),l=r.length>e,c=(s?"-":"")+(n?`${o}.${n}`:o);return{text:c,truncated:l,full:a}}function i(t,e){const i=a(e);return s(t,i)}function o(t){return s(t,6)}Object.defineProperty(e,"__esModule",{value:!0}),e.getMaxDecimalsByCoin=a,e.truncateAmountByCoin=i,e.truncateAmountRaw=s,e.truncateTo6=o},4994:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=void 0,a(4114),a(8111),a(7588);class s{constructor(){this.loadingStates=new Map,this.setupListeners()}setupListeners(){window.addEventListener("network-retry-complete",()=>{this.resetAllLoadingStates()})}setLoading(t,e,a){const s=`${t}:${e}`;this.loadingStates.set(s,{value:a,timestamp:Date.now()})}getLoading(t,e){const a=`${t}:${e}`,s=this.loadingStates.get(a);return!!s&&s.value}resetAllLoadingStates(){const t=[];this.loadingStates.forEach((e,a)=>{if(!0===e.value){const[e,s]=a.split(":");t.push({componentId:e,stateKey:s}),this.loadingStates.set(a,{value:!1,timestamp:Date.now()})}}),window.dispatchEvent(new CustomEvent("reset-loading-states",{detail:{componentsToUpdate:t}}))}resetComponentLoadingStates(t){const e=[];return this.loadingStates.forEach((a,s)=>{if(s.startsWith(`${t}:`)&&!0===a.value){const a=s.split(":")[1];e.push({componentId:t,stateKey:a}),this.loadingStates.set(s,{value:!1,timestamp:Date.now()})}}),e}}const i=new s;e["default"]=i},5059:function(t,e){"use strict";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"},[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("el-button",{attrs:{type:"primary"},on:{click:t.handleCreate}},[t._v("创建店铺")])],1)])])},e.Yp=[]},5129:function(t,e,a){"use strict";var s=a(3999)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=void 0;var i=s(a(5471)),o=s(a(5353));i.default.use(o.default);e["default"]=new o.default.Store({state:{},getters:{},mutations:{},actions:{},modules:{}})},5355:function(t,e,a){"use strict";a.r(e),a.d(e,{__esModule:function(){return i.B},default:function(){return l}});var s=a(8466),i=a(1029),o=i.A,r=a(845),n=(0,r.A)(o,s.XX,s.Yp,!1,null,"69d09b20",null),l=n.exports},5508:function(t,e){"use strict";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,a){"use strict";a.r(e),a.d(e,{__esModule:function(){return i.B},default:function(){return l}});var s=a(9628),i=a(7370),o=i.A,r=a(845),n=(0,r.A)(o,s.XX,s.Yp,!1,null,"c3bf12ce",null),l=n.exports},5656:function(t,e){"use strict";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,"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,"empty-text":"暂无已完成的订单"}})],1)],1)],1)},e.Yp=[]},5705:function(t,e,a){"use strict";var s=a(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 i=s(a(5720));function o(t){return(0,i.default)({url:"/lease/shop/addShop",method:"post",data:t})}function r(t){return(0,i.default)({url:"/lease/shop/getShopByUserEmail",method:"get",params:t})}function n(t){return(0,i.default)({url:"/lease/shop/updateShop",method:"post",data:t})}function l(t){return(0,i.default)({url:"/lease/shop/deleteShop",method:"post",data:{id:t}})}function c(t){return(0,i.default)({url:"/lease/shop/getShopById",method:"post",data:t})}function d(t){return(0,i.default)({url:"/lease/shop/closeShop",method:"post",data:{id:t}})}function u(t){return(0,i.default)({url:"/lease/shop/getShopConfig",method:"post",data:{id:t}})}function h(t){return(0,i.default)({url:"/lease/shop/addShopConfig",method:"post",data:t})}function p(t){return(0,i.default)({url:"/lease/shop/updateShopConfig",method:"post",data:t})}function m(t){return(0,i.default)({url:"/lease/shop/deleteShopConfig",method:"post",data:t})}function g(t){return(0,i.default)({url:"/lease/shop/getChainAndCoin",method:"post",data:t})}},5720:function(t,e,a){"use strict";var s=a(3999)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=void 0,a(4114),a(8111),a(7588);var i=s(a(6425)),o=s(a(9526)),r=a(1052),n=s(a(4994)),l=s(a(7465));const c=new Map;function d(t){const{url:e,method:a,params:s,data:i}=t;return[e,a,JSON.stringify(s),JSON.stringify(i)].join("&")}const u=i.default.create({baseURL:"http://10.168.2.220:8888",timeout:1e4}),h=6e4;let p=new Map,m={online:0,offline:0},g=!1;window.addEventListener("online",()=>{const t=Date.now();if(g)return void console.log("[网络] 网络恢复处理已在进行中,忽略重复事件");if(g=!0,t-m.online>3e4){m.online=t;try{window.vm&&window.vm.$message&&(window.vm.$message({message:window.vm.$i18n.t("home.networkReconnected")||"网络已重新连接,正在恢复数据...",type:"success",duration:5e3,showClose:!0}),console.log("[网络] 显示网络恢复提示, 时间:",(new Date).toLocaleTimeString()))}catch(a){console.error("[网络] 显示网络恢复提示失败:",a)}}else console.log("[网络] 抑制重复的网络恢复提示, 间隔过短:",t-m.online+"ms");const e=[];p.forEach(async(a,s)=>{if(t-a.timestamp<=h)try{const t=await u(a.config);e.push(t),a.callback&&"function"===typeof a.callback&&a.callback(t),window.vm&&(a.config.url.includes("getPoolPower")&&t&&t.data?window.dispatchEvent(new CustomEvent("chart-data-updated",{detail:{type:"poolPower",data:t.data}})):a.config.url.includes("getNetPower")&&t&&t.data?window.dispatchEvent(new CustomEvent("chart-data-updated",{detail:{type:"netPower",data:t.data}})):a.config.url.includes("getBlockInfo")&&t&&t.rows&&window.dispatchEvent(new CustomEvent("chart-data-updated",{detail:{type:"blockInfo",data:t.rows}}))),p.delete(s)}catch(i){console.error("重试请求失败:",i),p.delete(s)}else p.delete(s)}),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(()=>{g=!1},5e3)})}),window.addEventListener("offline",()=>{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})}),u.defaults.retry=2,u.defaults.retryDelay=2e3,u.defaults.shouldRetry=t=>"Network Error"===t.message||t.message.includes("timeout"),localStorage.setItem("superReportError","");let f=localStorage.getItem("superReportError");window.addEventListener("setItem",()=>{f=localStorage.getItem("superReportError")}),u.interceptors.request.use(t=>{let e;f="",localStorage.setItem("superReportError","");try{e=JSON.parse(localStorage.getItem("token"))}catch(o){console.log(o)}if(e&&(t.headers["Authorization"]=e),console.log(e,"if就覅飞机飞机"),"get"==t.method&&t.data&&(t.params=t.data),"get"===t.method&&t.params){let e=t.url+"?";for(const s of Object.keys(t.params)){const i=t.params[s];var a=encodeURIComponent(s)+"=";if(null!==i&&"undefined"!==typeof i)if("object"===typeof i){for(const t of Object.keys(i))if(null!==i[t]&&"undefined"!==typeof i[t]){let a=s+"["+t+"]",o=encodeURIComponent(a)+"=";e+=o+encodeURIComponent(i[t])+"&"}}else e+=a+encodeURIComponent(i)+"&"}e=e.slice(0,-1),t.params={},t.url=e}const s=d(t);if(c.has(s)){const t=c.get(s);t(),c.delete(s)}return t.cancelToken=new i.default.CancelToken(t=>{c.set(s,t)}),t},t=>{Promise.reject(t)}),u.interceptors.response.use(t=>{const e=d(t.config);c.delete(e);const a=t.data.code||200,s=o.default[a]||t.data.msg||o.default["default"];return 421===a?(localStorage.setItem("cs_disconnect_all",Date.now().toString()),localStorage.removeItem("token"),f=localStorage.getItem("superReportError"),f||(f=421,localStorage.setItem("superReportError",f),r.MessageBox.confirm(window.vm.$i18n.t("user.loginExpired"),window.vm.$i18n.t("user.overduePrompt"),{distinguishCancelAndClose:!0,confirmButtonText:window.vm.$i18n.t("user.login"),cancelButtonText:window.vm.$i18n.t("user.Home"),closeOnClickModal:!1,showClose:!1,type:"warning"}).then(()=>{window.vm.$router.push(`/${window.vm.$i18n.locale}/login`),localStorage.removeItem("token")}).catch(()=>{window.vm.$router.push(`/${window.vm.$i18n.locale}/`),localStorage.removeItem("token")})),Promise.reject("登录状态已过期")):a>=500&&!f?(f=500,localStorage.setItem("superReportError",f),void(0,r.Message)({dangerouslyUseHTMLString:!0,message:s,type:"error",showClose:!0})):200!==a?(r.Notification.error({title:s}),Promise.reject("error")):t.data},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=d(t.config);c.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<u.defaults.retry&&u.defaults.shouldRetry(t))return t.config.__retryCount+=1,console.log(`[请求重试] ${t.config.url} - 第 ${t.config.__retryCount} 次重试`),new Promise(e=>{setTimeout(()=>{e(u(t.config))},u.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 a=null;t.config.url.includes("getPoolPower")?a=t=>{window.vm&&(window.vm.minerChartLoading=!1)}:t.config.url.includes("getBlockInfo")&&(a=t=>{window.vm&&(window.vm.reportBlockLoading=!1)}),p.has(e)||(p.set(e,{config:t.config,timestamp:Date.now(),retryCount:0,callback:a}),console.log("请求已加入断网重连队列:",t.config.url))}return f||(f="error",localStorage.setItem("superReportError",f),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"]=u},5787:function(t,e,a){"use strict";Object.defineProperty(e,"B",{value:!0}),e.A=void 0,a(8111),a(2489);var s=a(6299);e.A={name:"RechargeRecord",data(){return{activeTab:"pending",detailDialogVisible:!1,selectedItem:null,rechargeRecords:[{address:"TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",amount:100,fromSymbol:"USDT",fromChain:"tron",status:2,createTime:"2024-01-15 14:30:25",id:1,txHash:"TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE"},{address:"TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",amount:100,fromSymbol:"USDT",fromChain:"tron",status:2,createTime:"2024-01-15 14:30:25",id:2,txHash:"TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE"},{address:"TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",amount:100,fromSymbol:"USDT",fromChain:"tron",status:2,createTime:"2024-01-15 14:30:25",id:3,txHash:"TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE"}],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,s.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),a=new Date,s=a-e;return s<6e4?"刚刚":s<36e5?`${Math.floor(s/6e4)}分钟前`:s<864e5?`${Math.floor(s/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(a){console.log("复制失败,请手动复制")}document.body.removeChild(e)},refreshData(){this.loadRechargeRecords()},viewOnExplorer(t,e){const a={tron:`https://tronscan.org/#/transaction/${t}`,ethereum:`https://etherscan.io/tx/${t}`,bsc:`https://bscscan.com/tx/${t}`,polygon:`https://polygonscan.com/tx/${t}`},s=a[e];s?window.open(s,"_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()}}}},5815:function(t,e,a){"use strict";a.r(e),a.d(e,{__esModule:function(){return i.B},default:function(){return l}});var s=a(6975),i=a(7896),o=i.A,r=a(845),n=(0,r.A)(o,s.XX,s.Yp,!1,null,"5597a452",null),l=n.exports},5844:function(t,e,a){"use strict";var s=a(3999)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e.addCart=o,e.deleteBatchGoods=n,e.deleteBatchGoodsForIsDelete=l,e.getGoodsList=r;var i=s(a(5720));function o(t){return(0,i.default)({url:"/lease/shopping/cart/addGoods",method:"post",data:t})}function r(t){return(0,i.default)({url:"/lease/shopping/cart/getGoodsList",method:"post",data:t})}function n(t){return(0,i.default)({url:"/lease/shopping/cart/deleteBatchGoods",method:"post",data:t})}function l(t){return(0,i.default)({url:"/lease/shopping/cart/deleteBatchGoodsForIsDelete",method:"post",data:t})}},5912:function(t,e){"use strict";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("b",[t._v("币种")]),t._v(" 进行分类管理,创建的商品会在商城对买家展示。 商品可理解为“不同算法、币种的机器集合分类”。 ")]),e("li",[e("b",[t._v("出售机器")]),t._v(":创建商品后,请进入 "),e("b",[t._v("商品列表")]),t._v(" 为该商品 "),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:"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:"140"}}),e("el-table-column",{attrs:{label:"支付币种"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("div",{staticClass:"coin-list"},[Array.isArray(a.row.children)&&a.row.children.length?t._l(a.row.children,function(a,s){return e("el-tooltip",{key:s,attrs:{content:String(a&&a.payCoin?a.payCoin:"").toUpperCase(),placement:"top"}},[a&&a.image?e("img",{staticClass:"coin-img",attrs:{src:a.image,alt:(a.payCoin||"").toUpperCase()}}):t._e()])}):[t._v(" "+t._s(String(a.row.payCoin||"").toUpperCase())+" ")]],2)]}}],null,!1,569036476)}),e("el-table-column",{attrs:{prop:"payAddress",label:"收款钱包地址","show-overflow-tooltip":""}}),e("el-table-column",{attrs:{label:"操作",width:"180",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-button",{attrs:{type:"text"},on:{click:function(e){return t.handleEditConfig(a.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(a.row)}}},[t._v("删除")])]}}],null,!1,2146652355)})],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:"修改店铺",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("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}}},[e("div",{staticClass:"row"},[e("label",{staticClass:"label"},[t._v("支付链")]),e("el-input",{attrs:{placeholder:"-",disabled:""},model:{value:t.configForm.chainLabel,callback:function(e){t.$set(t.configForm,"chainLabel",e)},expression:"configForm.chainLabel"}})],1),e("div",{staticClass:"row"},[e("label",{staticClass:"label"},[t._v("支付币种")]),e("el-select",{staticClass:"input",attrs:{size:"middle",multiple:"","collapse-tags":"",filterable:"",placeholder:"请选择币种"},model:{value:t.configForm.payCoins,callback:function(e){t.$set(t.configForm,"payCoins",e)},expression:"configForm.payCoins"}},t._l(t.editCoinOptions,function(t){return e("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})}),1)],1),e("div",{staticClass:"row"},[e("label",{staticClass:"label"},[t._v("已选择币种")]),e("div",{staticClass:"selected-coin-list"},[t._l(t.selectedCoinLabels,function(a){return e("el-tag",{key:a,attrs:{type:"warning",effect:"light",closable:""},on:{close:function(e){return t.removeSelectedCoin(a)}}},[t._v(t._s(a))])}),t.selectedCoinLabels.length?t._e():e("span",{staticStyle:{color:"#c0c4cc"}},[t._v("未选择")])],2)]),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("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,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.updateQuantity=e.removeFromCart=e.readCart=e["default"]=e.computeSummary=e.clearCart=e.addToCart=void 0,a(8111),a(2489),a(1701),a(8237);const s="power_leasing_cart_v1",i=()=>{try{const t=window.localStorage.getItem(s);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=i;const o=t=>{try{window.localStorage.setItem(s,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(a){console.error("[cartManager] writeCart error:",a)}},r=t=>{if(!t||!t.id)return i();const e=i(),a=e.findIndex(e=>e.id===t.id);if(a>=0){const s=[...e];return s[a]={...s[a],quantity:Math.max(1,Number(s[a].quantity||0)+Number(t.quantity||1))},o(s),s}const s=[...e,{...t,quantity:Math.max(1,Number(t.quantity||1))}];return o(s),s};e.addToCart=r;const n=(t,e)=>{const a=i(),s=a.map(a=>a.id===t?{...a,quantity:Math.max(1,Number(e)||1)}:a);return o(s),s};e.updateQuantity=n;const l=t=>{const e=i(),a=e.filter(e=>e.id!==t);return o(a),a};e.removeFromCart=l;const c=()=>(o([]),[]);e.clearCart=c;const d=()=>{const t=i(),e=t.reduce((t,e)=>t+Number(e.quantity||0),0),a=t.reduce((t,e)=>t+Number(e.quantity||0)*Number(e.price||0),0);return{totalQuantity:e,totalPrice:a}};e.computeSummary=d;e["default"]={readCart:i,addToCart:r,updateQuantity:n,removeFromCart:l,clearCart:c,computeSummary:d}},6037:function(t,e){"use strict";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%"},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}},[e("el-table-column",{attrs:{type:"expand",width:"46"},scopedSlots:t._u([{key:"default",fn:function(a){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 mono"},[t._v(t._s(a.row.orderId||"-"))])]),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(a.row.fromChain)||"-"))])])]),e("div",{staticClass:"detail-item"},[e("span",{staticClass:"detail-label"},[t._v("付款币种")]),e("span",{staticClass:"detail-value"},[e("span",{staticClass:"badge badge-blue"},[t._v(t._s(String(a.row.fromSymbol||a.row.coin||"").toUpperCase()))])])]),e("div",{staticClass:"detail-item detail-item-full"},[e("span",{staticClass:"detail-label"},[t._v("付款地址")]),e("span",{staticClass:"detail-value address"},[e("span",{staticClass:"mono-ellipsis",attrs:{title:a.row.fromAddress}},[t._v(t._s(a.row.fromAddress||"-"))]),a.row.fromAddress?e("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(e){return e.stopPropagation(),t.copy(a.row.fromAddress)}}},[t._v("复制")]):t._e()],1)])])])]}}])}),e("el-table-column",{attrs:{label:"支付时间","min-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:"收款金额(USDT)","min-width":"160",align:"right"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("span",{staticClass:"amount-green"},[t.formatAmount(a.row.realAmount,a.row.coin||a.row.toSymbol||"USDT").truncated?e("el-tooltip",{attrs:{content:`+${t.formatAmount(a.row.realAmount,a.row.coin||a.row.toSymbol||"USDT").full}`,placement:"top"}},[e("span",[t._v(" +"+t._s(t.formatAmount(a.row.realAmount,a.row.coin||a.row.toSymbol||"USDT").text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(" +"+t._s(t.formatAmount(a.row.realAmount,a.row.coin||a.row.toSymbol||"USDT").text)+" ")])],1)]}}])}),e("el-table-column",{attrs:{label:"收款链","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatChain(e.row.toChain)))]}}])}),e("el-table-column",{attrs:{label:"收款币种","min-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:"收款地址","min-width":"260"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("span",{staticClass:"mono-ellipsis",attrs:{title:a.row.toAddress}},[t._v(t._s(a.row.toAddress))]),e("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(e){return e.stopPropagation(),t.copy(a.row.toAddress)}}},[t._v("复制")])]}}])}),e("el-table-column",{attrs:{label:"交易HASH","min-width":"260"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("span",{staticClass:"mono-ellipsis",attrs:{title:a.row.txHash}},[t._v(t._s(a.row.txHash))]),a.row.txHash?e("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(e){return e.stopPropagation(),t.copy(a.row.txHash)}}},[t._v("复制")]):t._e()]}}])}),e("el-table-column",{attrs:{label:"支付状态","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-tag",{attrs:{type:t.getStatusType(a.row.status),size:"small"}},[t._v(t._s(t.getStatusText(a.row.status)))])]}}])}),e("el-table-column",{attrs:{label:"状态更新时间","min-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("收款记录")])])}]},6067:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mainNavigation=e.getPageTitle=e.getPageDescription=e.getBreadcrumb=e["default"]=e.checkRoutePermission=e.breadcrumbConfig=void 0,a(8111),a(3579);const s=e.mainNavigation=[{path:"/productList",name:"商城",icon:"🛍️",description:"浏览所有商品"},{path:"/cart",name:"购物车",icon:"🛒",description:"管理购物车商品"},{path:"/account",name:"个人中心",icon:"👤",description:"管理个人资料和店铺"}],i=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/")?i["/product"]:i[t]||["首页"];e.getBreadcrumb=o;const r=(t,e=[])=>{if(!t.meta||!t.meta.allAuthority)return!0;const a=t.meta.allAuthority;return!!a.includes("all")||a.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:s,breadcrumbConfig:i,getBreadcrumb:o,checkRoutePermission:r,getPageTitle:n,getPageDescription:l}},6163:function(t,e,a){"use strict";Object.defineProperty(e,"B",{value:!0}),e.A=void 0,a(4114),a(8111),a(3579);var s=a(9662);e.A={name:"AccountProducts",data(){return{loading:!1,searchKeyword:"",tableData:[],pagination:{pageNum:1,pageSize:10,total:0},coinOptions:[],editDialog:{visible:!1,saving:!1,form:null},total:0,userEmail:""}},created(){this.initOptions(),this.fetchTableData()},methods:{formatPayType(t){try{const e=(t&&t.chain?String(t.chain):"").toUpperCase(),a=(t&&t.coin?String(t.coin):"").toUpperCase();return e&&a?`${e}-${a}`:e||a||""}catch(e){return""}},initOptions(){try{const{coinList:t}=a(9252);this.coinOptions=Array.isArray(t)?t:[]}catch(t){this.coinOptions=[]}},async fetchMachineInfo(t){const e=await(0,s.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{const e=(this.searchKeyword||"").trim();let a,i;if(e){const t=e.toLowerCase(),s=(this.coinOptions||[]).some(e=>e.value&&String(e.value).toLowerCase()===t||e.label&&String(e.label).toLowerCase()===t);s?a=e:i=e}try{this.userEmail=JSON.parse(localStorage.getItem("leasEmail"))}catch(t){console.log(t)}if(!this.userEmail)return void this.$alert("登录信息异常,请重新返回 m2poll 矿池进入该系统","提示",{confirmButtonText:"确认",center:!0,closeOnClickModal:!1,closeOnPressEscape:!1,showClose:!1,callback:()=>{window.location.href="https://m2pool.com"}});const o={pageNum:this.pagination.pageNum,pageSize:this.pagination.pageSize,coin:a||void 0,algorithm:i||void 0,userEmail:this.userEmail},r=await(0,s.getProductList)(o),n=r?.data?.records||r?.data?.list||r?.rows||r?.list||r?.data||[];this.tableData=Array.isArray(n)?n:[],this.total=r.total,console.log(this.tableData)}catch(t){console.error("获取商品列表失败",t),console.log("获取商品列表失败")}finally{this.loading=!1}},handleSearch(){this.pagination.pageNum=1,this.fetchTableData()},handleReset(){this.searchKeyword="",this.pagination.pageNum=1,this.pagination.pageSize=10,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){this.editDialog.form={...t},this.editDialog.visible=!0},async handleSaveEdit(){if(this.editDialog.form){this.editDialog.saving=!0;try{const t=t=>"string"===typeof t&&t.trim().length>0,e=String(this.editDialog.form.name||""),a=String(this.editDialog.form.description||"");if(!t(e))return this.$message.warning("名称不能为空或全是空格"),void(this.editDialog.saving=!1);if(!t(a))return this.$message.warning("描述不能为空或全是空格"),void(this.editDialog.saving=!1);this.editDialog.form.name=e.trim(),this.editDialog.form.description=a.trim();const i={id:this.editDialog.form.id,shopId:this.editDialog.form.shopId,name:this.editDialog.form.name,image:this.editDialog.form.image,coin:this.editDialog.form.coin,description:this.editDialog.form.description,state:this.editDialog.form.state},o=await(0,s.updateProduct)(i);!o||0!==o.code&&200!==o.code?this.$message({message:o?.msg||"保存失败",type:"error",showClose:!0}):(this.$message({message:"保存成功",type:"success",showClose:!0}),this.editDialog.visible=!1,this.fetchTableData())}catch(t){console.error("保存商品失败",t),console.log("保存失败")}finally{this.editDialog.saving=!1}}},handleDelete(t){t&&t.id&&this.$confirm("确认删除该商品吗?删除后不可恢复","提示",{confirmButtonText:"删除",cancelButtonText:"取消",type:"warning"}).then(async()=>{try{const e=await(0,s.deleteProduct)(t.id);!e||0!==e.code&&200!==e.code||(this.$message.success("删除成功"),1===this.tableData.length&&this.pagination.pageNum>1&&(this.pagination.pageNum-=1),this.fetchTableData())}catch(e){console.error("删除商品失败",e),console.log("删除失败")}}).catch(()=>{})},handleSizeChange(t){this.pagination.pageSize=t,this.pagination.pageNum=1,this.fetchTableData()},handleCurrentChange(t){this.pagination.pageNum=t,this.fetchTableData()},handleClear(){this.searchKeyword="",this.pagination.pageNum=1,this.fetchTableData()},handleAddMachine(t){if(!t||!t.id)return void this.$message.warning("缺少商品ID");let e="";try{const a=Array.isArray(t.payTypes)?t.payTypes:[];e=encodeURIComponent(JSON.stringify(a))}catch(a){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,a){"use strict";t.exports=a.p+"img/commodity.0dddb787.png"},6299:function(t,e,a){"use strict";var s=a(3999)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e.addWalletShopConfig=d,e.balanceRechargeList=n,e.balanceWithdrawList=l,e.bindWallet=p,e.getChainAndList=u,e.getProductListForShopWalletConfig=f,e.getRecentlyTransaction=g,e.getShopConfig=h,e.getWalletInfo=o,e.sellerReceiptList=c,e.transactionRecord=m,e.updateProductListForShopWalletConfig=y,e.withdrawBalance=r;var i=s(a(5720));function o(t){return(0,i.default)({url:"/lease/user/getWalletInfo",method:"post",data:t})}function r(t){return(0,i.default)({url:"/lease/user/withdrawBalance",method:"post",data:t})}function n(t){return(0,i.default)({url:"/lease/user/balanceRechargeList",method:"post",data:t})}function l(t){return(0,i.default)({url:"/lease/user/balanceWithdrawList",method:"post",data:t})}function c(t){return(0,i.default)({url:"/lease/user/balancePayList",method:"post",data:t})}function d(t){return(0,i.default)({url:"/lease/shop/addShopConfig",method:"post",data:t})}function u(t){return(0,i.default)({url:"/lease/shop/getChainAndList",method:"post",data:t})}function h(t){return(0,i.default)({url:"/lease/shop/getShopConfig",method:"post",data:t})}function p(t){return(0,i.default)({url:"/lease/user/bindWallet",method:"post",data:t})}function m(t){return(0,i.default)({url:"/lease/user/transactionRecord",method:"post",data:t})}function g(t){return(0,i.default)({url:"/lease/user/getRecentlyTransaction",method:"post",data:t})}function f(t){return(0,i.default)({url:"/lease/product/getProductListForShopWalletConfig",method:"post",data:t})}function y(t){return(0,i.default)({url:"/lease/product/updateProductListForShopWalletConfig",method:"post",data:t})}},6356:function(t,e){"use strict";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-alert",{staticClass:"notice-alert",attrs:{type:"warning","show-icon":"",closable:!1,title:"新增出售机器必须在 M2pool 有挖矿算力记录才能添加出租",description:"建议稳定在 M2pool 矿池挖矿 24 小时之后,再添加出售该机器"}}),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-input",{staticStyle:{width:"50%"},attrs:{disabled:""},model:{value:t.form.productName,callback:function(e){t.$set(t.form,"productName",e)},expression:"form.productName"}})],1),e("el-form-item",{attrs:{label:"矿机型号"}},[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),e("el-form-item",{attrs:{label:"理论算力",prop:"theoryPower"}},[e("el-input",{staticStyle:{width:"50%"},attrs:{placeholder:"请输入单机理论算力",inputmode:"decimal"},on:{input:function(e){return t.handleNumeric("theoryPower")}},model:{value:t.form.theoryPower,callback:function(e){t.$set(t.form,"theoryPower",e)},expression:"form.theoryPower"}})],1),e("el-form-item",{attrs:{label:"算力单位",prop:"unit"}},[e("el-select",{attrs:{placeholder:"请选择算力单位"},model:{value:t.form.unit,callback:function(e){t.$set(t.form,"unit",e)},expression:"form.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)],1),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),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),e("el-form-item",{attrs:{label:"统一售价",prop:"cost"}},[e("span",{attrs:{slot:"label"},slot:"label"},[t._v(" 统一售价 "),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"}})])],1),t.payTypeDefs&&t.payTypeDefs.length?e("div",{staticClass:"cost-multi"},t._l(t.payTypeDefs,function(a){return e("div",{key:a.key,staticClass:"cost-item"},[e("el-input",{staticStyle:{width:"50%"},attrs:{placeholder:"请输入价格",inputmode:"decimal"},on:{input:e=>t.handleCostMapInput(a.key,e)},model:{value:t.form.costMap[a.key],callback:function(e){t.$set(t.form.costMap,a.key,e)},expression:"form.costMap[pt.key]"}},[e("template",{slot:"append"},[t._v(t._s(a.label))])],2)],1)}),0):e("el-input",{staticStyle:{width:"50%"},attrs:{placeholder:"请输入成本(USDT)",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),e("el-form-item",{attrs:{label:"选择挖矿账户"}},[e("el-select",{attrs:{filterable:"",clearable:"",placeholder:"请选择挖矿账户",loading:t.minersLoading},on:{change:t.handleMinerChange},model:{value:t.selectedMiner,callback:function(e){t.selectedMiner=e},expression:"selectedMiner"}},t._l(t.miners,function(t){return e("el-option",{key:t.user+"_"+t.coin,attrs:{label:t.user+"("+t.coin+")",value:t.user+"|"+t.coin}})}),1)],1),e("el-form-item",{attrs:{label:"选择机器(可多选)"}},[e("el-select",{attrs:{multiple:"",filterable:"","collapse-tags":"",placeholder:"请选择机器",loading:t.machinesLoading,disabled:!t.selectedMiner},model:{value:t.selectedMachines,callback:function(e){t.selectedMachines=e},expression:"selectedMachines"}},t._l(t.machineOptions,function(t){return e("el-option",{key:t.user+"_"+t.miner,attrs:{label:t.miner+"("+t.user+")",value:t.miner}})}),1)],1)],1)],1),t.selectedMachineRows.length?e("el-card",{staticClass:"form-card",attrs:{shadow:"never"}},[e("div",{staticClass:"section-title",attrs:{slot:"header"},slot:"header"},[t._v("已选择机器")]),e("el-table",{staticStyle:{width:"100%"},attrs:{data:t.selectedMachineRows,border:"",stripe:""}},[e("el-table-column",{attrs:{prop:"user",label:"挖矿账户"}}),e("el-table-column",{attrs:{prop:"miner",label:"机器编号"}}),e("el-table-column",{attrs:{prop:"realPower",label:"实际算力(MH/S)"}},[e("template",{slot:"header"},[e("el-tooltip",{attrs:{content:"实际算力为该机器在本矿池过去24H的平均算力",effect:"dark",placement:"top"}},[e("i",{staticClass:"el-icon-question",staticStyle:{"margin-right":"4px",color:"#909399"},attrs:{"aria-label":"帮助",tabindex:"0"}})]),e("span",[t._v("实际算力(MH/S)")])],1)],2),e("el-table-column",{attrs:{label:"功耗(kw/h)","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-input",{staticStyle:{width:"100%"},attrs:{placeholder:"示例:0.01",inputmode:"decimal"},on:{input:function(e){return t.handleRowPowerDissipationInput(a.$index)},blur:function(e){return t.handleRowPowerDissipationBlur(a.$index)}},model:{value:a.row.powerDissipation,callback:function(e){t.$set(a.row,"powerDissipation",e)},expression:"scope.row.powerDissipation"}},[e("template",{slot:"append"},[t._v("kw/h")])],2)]}}],null,!1,2461731706)}),e("el-table-column",{attrs:{label:"理论算力","min-width":"160"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("div",{staticStyle:{display:"flex","align-items":"center",gap:"8px"}},[e("el-input",{staticStyle:{width:"100%"},attrs:{placeholder:"理论算力",inputmode:"decimal"},on:{input:function(e){return t.handleRowTheoryPowerInput(a.$index)},blur:function(e){return t.handleRowTheoryPowerBlur(a.$index)}},model:{value:a.row.theoryPower,callback:function(e){t.$set(a.row,"theoryPower",e)},expression:"scope.row.theoryPower"}}),e("el-select",{staticStyle:{width:"150px"},attrs:{placeholder:"单位"},on:{change:e=>t.handleRowUnitChange(a.$index,e)},model:{value:a.row.unit,callback:function(e){t.$set(a.row,"unit",e)},expression:"scope.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)],1)]}}],null,!1,2316701192)}),e("el-table-column",{attrs:{label:"售价(按结算币种)","min-width":"220"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("div",{staticClass:"price-multi"},[t.payTypeDefs&&t.payTypeDefs.length?e("div",{staticClass:"price-items"},t._l(t.payTypeDefs,function(s){return e("div",{key:s.key,staticClass:"price-item"},[e("el-input",{attrs:{placeholder:"价格",inputmode:"decimal"},on:{input:()=>t.handleRowPriceMapInput(a.$index,s.key),blur:()=>t.handleRowPriceMapBlur(a.$index,s.key)},model:{value:a.row.priceMap[s.key],callback:function(e){t.$set(a.row.priceMap,s.key,e)},expression:"scope.row.priceMap[pt.key]"}},[e("template",{slot:"append"},[t._v(t._s(s.label))])],2)],1)}),0):e("el-input",{staticStyle:{width:"100%"},attrs:{placeholder:"价格",inputmode:"decimal"},on:{input:function(e){return t.handleRowPriceInput(a.$index)},blur:function(e){return t.handleRowPriceBlur(a.$index)}},model:{value:a.row.price,callback:function(e){t.$set(a.row,"price",e)},expression:"scope.row.price"}},[e("template",{slot:"append"},[t._v("USDT")])],2)],1)]}}],null,!1,3822584807)},[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:"最大租赁天数(天)","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-input",{staticStyle:{width:"100%"},attrs:{placeholder:"1-365",inputmode:"numeric"},on:{input:function(e){return t.handleRowMaxLeaseDaysInput(a.$index)},blur:function(e){return t.handleRowMaxLeaseDaysBlur(a.$index)}},model:{value:a.row.maxLeaseDays,callback:function(e){t.$set(a.row,"maxLeaseDays",e)},expression:"scope.row.maxLeaseDays"}},[e("template",{slot:"append"},[t._v("天")])],2)]}}],null,!1,309661603)}),e("el-table-column",{attrs:{label:"矿机型号"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-input",{staticStyle:{width:"100%"},attrs:{placeholder:"矿机型号",maxlength:20},on:{input:function(e){return t.handleRowTypeInput(a.$index)},blur:function(e){return t.handleRowTypeBlur(a.$index)}},model:{value:a.row.type,callback:function(e){t.$set(a.row,"type",e)},expression:"scope.row.type"}})]}}],null,!1,1752667191)}),e("el-table-column",{attrs:{label:"上下架状态",width:"100"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-button",{attrs:{type:0===a.row.state?"success":"info",size:"mini"},on:{click:function(e){return t.handleToggleState(a.$index)}}},[t._v(" "+t._s(0===a.row.state?"上架":"下架")+" ")])]}}],null,!1,875649026)})],1)],1):t._e(),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),e("el-dialog",{attrs:{title:"请确认上架信息",visible:t.confirmVisible,width:"400px"},on:{"update:visible":function(e){t.confirmVisible=e}}},[e("div",[e("p",[t._v("请仔细确认已选择机器列表、价格及相关参数定义。")]),e("p",{staticStyle:{"text-align":"left"}},[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",loading:t.saving},on:{click:t.doSubmit}},[t._v("确认上架已选择机器")])],1)])],1)},e.Yp=[]},6616:function(t,e,a){"use strict";Object.defineProperty(e,"B",{value:!0}),e.A=void 0,a(8111),a(1701),a(3579);var s=a(6299),i=a(6299);e.A={name:"WalletPage",data(){return{walletBalance:0,blockedBalance:0,walletList:[],WalletData:{},rechargeDialogVisible:!1,qrCodeGenerated:!1,withdrawDialogVisible:!1,withdrawLoading:!1,withdrawForm:{toChain:"tron",toSymbol:"USDT",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:[{label:"USDT (TRC20)",value:"USDT"}]},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 a=t-e;return a<=0?"0":this.formatDec6FromInt(a)},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:{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,a]=t;if(e&&a)try{this.createLoading=!0;const t=await(0,i.bindWallet)({chain:e,coin:a});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(s){console.error("获取充值信息失败",s)}finally{this.createLoading=!1}else this.$message.warning("请选择完整的链与币种")},async getChainAndList(){this.loading=!0;const t=await(0,i.getChainAndList)();t&&(0===t.code||200===t.code)&&t.data&&(this.options=t.data),this.loading=!1},async fetchRecentlyTransaction(){try{const t=await(0,s.getRecentlyTransaction)();if(t&&(0===t.code||200===t.code)){const e=Array.isArray(t.data)?t.data:[],a=e.map((t,e)=>{const a=Number(t&&t.amount),s=Number.isFinite(a)?a:0,i=Number(t&&t.type),o=1===i?Math.abs(s):-Math.abs(s),r=1===i?"充值":2===i?"提现":"支付",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"}});this.recentTransactions=a}}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 a=Number(t);if(!Number.isFinite(a))return"0";e=a.toFixed(20).replace(/\.0+$/,"").replace(/(\.\d*?)0+$/,"$1")}const a=e.match(/^(-?)(\d+)(?:\.(\d+))?$/);if(!a)return e;let s=a[2],i=a[3]||"";return i.length>6&&(i=i.slice(0,6)),i?`${s}.${i}`:s},toScaledInt(t,e=6){if(null===t||void 0===t)return 0;const a=String(t).trim();if(""===a)return 0;const s=new RegExp(`^\\d+(?:\\.(\\d{0,${e}}))?$`),i=a.match(s);if(!i){const t=Number(a);if(!Number.isFinite(t))return 0;const s=Math.pow(10,e);return Math.round(t*s)}const[o,r]=a.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 a=t<0?"-":"",s=Math.abs(t),i=Math.pow(10,e),o=Math.floor(s/i),r=String(s%i).padStart(e,"0");return`${a}${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,s.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 a=await(0,s.balanceRechargeList)(e);if(!a||0!==a.code&&200!==a.code)return this.$message({message:a?.msg||"获取充值记录失败",type:"error",showClose:!0}),null;{const t={list:a.data.rows||[],total:a.data.total||0,totalPage:a.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,s.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()})},handleWithdraw(t){if(t){this.WalletData=t;const e=t.fromChain||t.chain||this.withdrawForm.toChain,a=t.fromSymbol||t.coin||this.withdrawForm.toSymbol;this.withdrawForm.toChain=e,this.withdrawForm.toSymbol=a,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(a){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="USDT充值二维码",e.style.width="160px",e.style.height="160px",e.style.borderRadius="4px",e.onerror=()=>{t.innerHTML='<div style="width: 200px; height: 200px; display: flex; align-items: center; justify-content: center; background: #f5f5f5; border-radius: 4px; color: #f56c6c;">二维码加载失败</div>'},t.appendChild(e),this.qrCodeGenerated=!0}}else{const t=this.$refs.qrCodeRef;t&&(t.innerHTML='<div style="width: 200px; height: 200px; display: flex; align-items: center; justify-content: center; background: #f5f5f5; border-radius: 4px; color: #999;">暂无二维码数据</div>')}},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=await(0,s.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:this.withdrawForm.toAddress,fromAddress:this.WalletData&&this.WalletData.fromAddress||"",code:this.withdrawForm.googleCode});!t||0!==t.code&&200!==t.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:"USDT",amount:"",toAddress:"",fee:"1.00",googleCode:""},this.withdrawLoading=!1,this.$nextTick(()=>{this.$refs.withdrawForm&&this.$refs.withdrawForm.clearValidate()})},validateWithdrawAmount(t,e,a){if(!e)return void a(new Error("请输入提现金额"));const s=this.toScaledInt(e);if(!Number.isFinite(s)||s<=0)return void a(new Error("请输入有效的金额"));const i=this.toScaledInt(this.withdrawForm.fee),o=s+i,r=this.WalletData&&(this.WalletData.walletBalance||this.WalletData.balance)||0,n=this.toScaledInt(r);if(o>n){const t=this.formatDec6FromInt(o);return void a(new Error(`提现金额加上手续费(${t} USDT)不能超过钱包余额`))}s<1e6?a(new Error("最小提现金额为1 USDT")):s<=i?a(new Error("提现金额必须大于手续费")):a()},handleGoogleCodeInput(t){this.withdrawForm.googleCode=t.replace(/\D/g,"")},handleAmountInput(t){let e=String(t||"");e=e.replace(/[^0-9.]/g,"");const a=e.indexOf(".");if(-1!==a&&(e=e.slice(0,a+1)+e.slice(a+1).replace(/\./g,"")),-1!==a){const[t,a]=e.split(".");e=t+"."+(a?a.slice(0,6):"")}const s=e.split(".");s[0]&&s[0].length>12&&(s[0]=s[0].slice(0,12)),e=s.join("."),this.withdrawForm.amount=e},validateGoogleCode(t,e,a){e?/^\d{6}$/.test(e)?a():a(new Error("谷歌验证码必须是6位数字")):a(new Error("请输入谷歌验证码"))},validateAddress(t,e,a){const s="string"===typeof e?e.trim():"";if(!s)return void a(new Error("请输入收款地址"));const i=this.withdrawForm.toChain;let o=!1;switch(i){case"tron":o=/^T[A-Za-z1-9]{33}$/.test(s);break;case"ethereum":o=/^0x[a-fA-F0-9]{40}$/.test(s);break;case"bsc":o=/^0x[a-fA-F0-9]{40}$/.test(s);break;case"polygon":o=/^0x[a-fA-F0-9]{40}$/.test(s);break;default:o=s.length>10}o?a():a(new Error("请输入正确的收款地址格式"))},addTransactionRecord(t,e){const a=new Date,s=`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}-${String(a.getDate()).padStart(2,"0")} ${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}`;this.recentTransactions.unshift({id:Date.now(),type:t,amount:e,time:s}),this.recentTransactions.length>10&&(this.recentTransactions=this.recentTransactions.slice(0,10))}}}},6652:function(t,e){"use strict";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"},t._l(t.navigation,function(a){return e("router-link",{key:a.path,staticClass:"nav-btn",attrs:{to:a.path,"active-class":"active",title:a.description}},[e("span",{staticClass:"nav-icon"},[t._v(t._s(a.icon))]),e("span",{staticClass:"nav-text"},[t._v(t._s(a.name))]),"/cart"===a.path?e("span",{staticClass:"cart-count"},[t._v("("+t._s(t.cartItemCount)+")")]):t._e()])}),1)])},e.Yp=[]},6804:function(t,e,a){function s(t,e){try{const a=atob(t);let s="";for(let t=0;t<a.length;t++)s+=String.fromCharCode(a.charCodeAt(t)^e.charCodeAt(t%e.length));return s}catch(a){return console.error("解密失败:",a),null}}function i(){const t=new URLSearchParams(window.location.search),e=t.get("data"),a=t.get("language"),i=t.get("username"),o=t.get("source"),r=t.get("version"),n="mining-pool-secret-key-2024";let l=null;if(e)try{const t=s(e,n);l=JSON.parse(t)}catch(c){console.error("解密或解析数据失败:",c)}return{token:l?.token||"",leasEmail:l?.leasEmail||"",userId:l?.userId||"",timestamp:l?.timestamp||null,language:a||"zh",username:i||"",source:o||"",version:r||"1.0"}}function o(t,e,a){console.log("执行自动登录:",{userId:e,leasEmail:a?"***":""})}function r(t){console.log("设置语言:",t)}a(4979),a(4603),a(7566),a(8721),document.addEventListener("DOMContentLoaded",function(){const t=i();t.token&&(console.log(t.token,"params.token 存入"),localStorage.setItem("token",t.token),localStorage.setItem("leasEmail",t.leasEmail),localStorage.setItem("userId",t.userId),localStorage.setItem("language",t.language),localStorage.setItem("username",t.username),localStorage.setItem("source",t.source),localStorage.setItem("version",t.version)),console.log("接收到的参数:",{userId:t.userId?"***":"",leasEmail:t.leasEmail?"***":"",token:t.token?"***":"",language:t.language,username:t.username,source:t.source}),t.token&&t.userId&&o(t.token,t.userId,t.leasEmail),t.language&&r(t.language)})},6851:function(t,e,a){"use strict";a.r(e),a.d(e,{__esModule:function(){return i.B},default:function(){return l}});var s=a(2553),i=a(5787),o=i.A,r=a(845),n=(0,r.A)(o,s.XX,s.Yp,!1,null,"5cf693fa",null),l=n.exports},6952:function(t,e,a){"use strict";a.r(e),a.d(e,{__esModule:function(){return i.B},default:function(){return l}});var s=a(2125),i=a(2515),o=i.A,r=a(845),n=(0,r.A)(o,s.XX,s.Yp,!1,null,"32104fd7",null),l=n.exports},6975:function(t,e){"use strict";e.Yp=e.XX=void 0;e.XX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"account-purchased"},[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:""}},[e("el-table-column",{attrs:{prop:"userId",label:"用户",width:"180"}}),e("el-table-column",{attrs:{prop:"productMachineId",label:"机器ID",width:"80"}}),e("el-table-column",{attrs:{prop:"type",label:"类型",width:"100"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-tag",{attrs:{type:1===a.row.type?"success":"info"}},[t._v(" "+t._s(1===a.row.type?"算力套餐":"挖矿机器")+" ")])]}}])}),e("el-table-column",{attrs:{prop:"estimatedEndIncome",label:"预计总收益","min-width":"140"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("span",{staticClass:"value strong"},[t.formatAmount(a.row.estimatedEndIncome,a.row.coin||"USDT").truncated?e("el-tooltip",{attrs:{content:t.formatAmount(a.row.estimatedEndIncome,a.row.coin||"USDT").full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(a.row.estimatedEndIncome,a.row.coin||"USDT").text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatAmount(a.row.estimatedEndIncome,a.row.coin||"USDT").text))])],1)]}}])}),e("el-table-column",{attrs:{prop:"estimatedEndUsdtIncome",label:"预计USDT总收益","min-width":"160"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("span",{staticClass:"value strong"},[t.formatAmount(a.row.estimatedEndUsdtIncome,"USDT").truncated?e("el-tooltip",{attrs:{content:t.formatAmount(a.row.estimatedEndUsdtIncome,"USDT").full,placement:"top"}},[e("span",[t._v(" "+t._s(t.formatAmount(a.row.estimatedEndUsdtIncome,"USDT").text)+" "),e("i",{staticClass:"el-icon-more amount-more"})])]):e("span",[t._v(t._s(t.formatAmount(a.row.estimatedEndUsdtIncome,"USDT").text))])],1)]}}])}),e("el-table-column",{attrs:{prop:"startTime",label:"开始时间","min-width":"160"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("span",[t._v(t._s(t.formatDateTime(a.row.startTime)))])]}}])}),e("el-table-column",{attrs:{prop:"endTime",label:"结束时间","min-width":"160"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("span",[t._v(t._s(t.formatDateTime(a.row.endTime)))])]}}])}),e("el-table-column",{attrs:{prop:"status",label:"状态",width:"100"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-tag",{attrs:{type:0===a.row.status?"success":"info"}},[t._v(" "+t._s(0===a.row.status?"运行中":"已过期")+" ")])]}}])}),e("el-table-column",{attrs:{label:"操作",fixed:"right",width:"120"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-button",{attrs:{type:"text",size:"small"},on:{click:function(e){return t.handleView(a.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("已购商品")])])])}]},7370:function(t,e,a){"use strict";Object.defineProperty(e,"B",{value:!0}),e.A=void 0,a(4114);var s=a(5952);e.A={name:"Checkout",data(){return{cartItems:[],loading:!1,submitting:!1,form:{name:"",phone:"",address:"",note:""},errors:{}}},computed:{summary(){return(0,s.computeSummary)()}},mounted(){this.loadCart()},methods:{loadCart(){try{this.loading=!0,this.cartItems=(0,s.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,s.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,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=void 0,a(8111),a(7588);class s{constructor(){this.recentErrors=new Map,this.throttleTime=3e3,this.errorTypes={"Network Error":"network",timeout:"timeout","Request failed with status code":"statusCode",networkReconnected:"networkStatus",NetworkError:"network"}}getErrorType(t){for(const[e,a]of Object.entries(this.errorTypes))if(t.includes(e))return a;return"unknown"}canShowError(t){const e=this.getErrorType(t),a=Date.now();if(this.recentErrors.has(e)){const t=this.recentErrors.get(e);if(a-t<this.throttleTime)return console.log(`[错误提示] 已抑制重复错误: ${e}`),!1}return this.recentErrors.set(e,a),!0}cleanup(){const t=Date.now();this.recentErrors.forEach((e,a)=>{t-e>this.throttleTime&&this.recentErrors.delete(a)})}}const i=new s;e["default"]=i},7570:function(t,e,a){"use strict";var s=a(3999)["default"];Object.defineProperty(e,"B",{value:!0}),e.A=void 0;var i=s(a(1774));e.A={components:{comHeard:()=>Promise.resolve().then(()=>(0,i.default)(a(9872))),appMain:()=>Promise.resolve().then(()=>(0,i.default)(a(1220)))}}},7692:function(t,e,a){"use strict";var s=a(3999)["default"];Object.defineProperty(e,"B",{value:!0}),e.A=void 0,a(8111),a(2489),a(116),a(7588);var i=s(a(4487));e.A={name:"ProductDetail",mixins:[i.default],methods:{getRowMaxLeaseDays(t){const e=t&&(t.maxLeaseDays||t.maxLeaseDay||t.max_lease_days)||365,a=Number(e);return Number.isFinite(a)?a<1?1:a>365?365:Math.floor(a):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,a]=String(t).split("|"),s=Array.isArray(this.paymentMethodList)?this.paymentMethodList:[],i=s.find(t=>String(t&&t.payChain).toUpperCase()===String(e).toUpperCase()&&String(t&&t.payCoin).toUpperCase()===String(a).toUpperCase());return this.getPayImageUrl(i)}catch(t){return""}},handlePayFilterChange(t){try{const e="string"===typeof t?t:"";if(e){const[t,a]=e.split("|");this.filters.chain=(t||"").trim(),this.filters.coin=(a||"").trim()}else this.filters.chain="",this.filters.coin="";this.handleSearchFilters()}catch(e){}},handleSearchFilters(){const t=this.buildQueryParams();this.fetchGetMachineInfo(t)},handleResetFilters(){this.selectedPayKey=null,this.filters={chain:"",coin:"",minPrice:null,maxPrice:null,minPower:null,maxPower:null,minPowerDissipation:null,maxPowerDissipation:null,unit:"GH/S"},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),a=e&&e.payCoin?String(e.payCoin):"";return a?a.toUpperCase():""}catch(t){return""}},handleLeaseDaysChange(t,e){const a=this.getRowMaxLeaseDays(t);let s=Number(e);Number.isFinite(s)||(s=1),s<1&&(s=1),s>a&&(s=a),s=Math.floor(s),this.$set(t,"leaseTime",s)},formatPayTooltip(t){try{if(!t)return"";const e=(t.payChain||"").toString().trim(),a=(t.payCoin||"").toString().trim();return e&&a?`${e} - ${a}`:e||a||""}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(a){console.error("handleManualSelectFlat error:",a)}},handleGetRowClass({row:t}){return t&&(1===t.saleState||2===t.saleState)?"sold-row":""},handleOpenAddToCartDialog(){const t=Array.isArray(this.machineList)?this.machineList:[],e=t.filter(t=>!!t&&!!t._selected),a=e.filter(t=>t&&(0===t.saleState||void 0===t.saleState||null===t.saleState));a.length?(a.length<e.length&&this.$message.warning("部分机器已售出或售出中,已自动为您排除"),this.confirmAddDialog.items=a.slice(),this.confirmAddDialog.visible=!0,this.$nextTick(()=>{try{(this.machineList||[]).forEach(t=>this.$set(t,"_selected",!1))}catch(t){}})):this.$message.warning("请先勾选至少一台矿机")}}}},7723:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.listProducts=e.getProductById=e["default"]=void 0;const a=[{id:"p1001",title:"新能源充电桩(家用)",description:"7kW 单相,智能预约,支持远程监控。",price:1299,image:"https://via.placeholder.com/300x200?text=%E5%85%85%E7%94%B5%E6%A1%A9"},{id:"p1002",title:"工业电能表",description:"三相四线,远程抄表,Modbus 通信。",price:899,image:"https://via.placeholder.com/300x200?text=%E7%94%B5%E8%83%BD%E8%A1%A8"},{id:"p1003",title:"配电柜(入门版)",description:"IP54 防护,内置断路器与防雷模块。",price:5599,image:"https://via.placeholder.com/300x200?text=%E9%85%8D%E7%94%B5%E6%9F%9C"},{id:"p1004",title:"工矿照明灯",description:"120W 高亮,耐腐蚀,适配多场景。",price:329,image:"https://via.placeholder.com/300x200?text=%E7%85%A7%E6%98%8E%E7%81%AF"}],s=async()=>Promise.resolve(a);e.listProducts=s;const i=async t=>{const e=a.find(e=>e.id===t);return Promise.resolve(e)};e.getProductById=i;e["default"]={listProducts:s,getProductById:i}},7802:function(t,e,a){"use strict";a.r(e),a.d(e,{__esModule:function(){return i.B},default:function(){return l}});var s=a(5912),i=a(2570),o=i.A,r=a(845),n=(0,r.A)(o,s.XX,s.Yp,!1,null,"031e6e83",null),l=n.exports},7896:function(t,e,a){"use strict";Object.defineProperty(e,"B",{value:!0}),e.A=void 0,a(4114);var s=a(9662),i=a(9252),o=a(4981);e.A={name:"AccountPurchased",data(){return{loading:!1,searchKeyword:"",tableData:[],pagination:{pageNum:1,pageSize:10},coins:i.coinList||[],total:0,currentPage:1}},created(){this.fetchTableData(this.pagination)},methods:{formatAmount(t,e){return(0,o.truncateAmountByCoin)(t,e)},async fetchTableData(t){this.loading=!0;try{const e=await(0,s.getOwnedList)(t);!e||0!==e.code&&200!==e.code||(this.tableData=e.rows,this.total=e.total)}catch(e){console.error("获取已购商品失败",e)}finally{this.loading=!1}},handleSearch(){this.pagination.pageNum=1,this.fetchTableData()},handleReset(){this.searchKeyword="",this.pagination.pageNum=1,this.pagination.pageSize=10,this.fetchTableData(this.pagination)},handleClear(){this.searchKeyword="",this.pagination.pageNum=1,this.fetchTableData(this.pagination)},handleSizeChange(t){this.pagination.pageSize=t,this.pagination.pageNum=1,this.fetchTableData(this.pagination)},handleCurrentChange(t){this.pagination.pageNum=t,this.fetchTableData(this.pagination)},handleView(t){this.$router.push({name:"PurchasedDetail",params:{id:t.id}})},formatDateTime(t){if(!t)return"—";try{const e=String(t);return e.includes("T")?e.replace("T"," "):e}catch(e){return String(t)}}}}},7915:function(t,e,a){"use strict";a.r(e),a.d(e,{__esModule:function(){return i.B},default:function(){return l}});var s=a(1074),i=a(6163),o=i.A,r=a(845),n=(0,r.A)(o,s.XX,s.Yp,!1,null,"d6c9b7e4",null),l=n.exports},8284:function(t,e,a){"use strict";Object.defineProperty(e,"B",{value:!0}),e.A=void 0,a(8111),a(2489);var s=a(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 a=await(0,s.balanceWithdrawList)(e);!a||0!==a.code&&200!==a.code?this.$message({message:a?.msg||"获取提现记录失败",type:"error",showClose:!0}):(this.withdrawalRecords=a.rows||[],this.pagination.totalPage=a.totalPage||0,this.total=a.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),a=new Date,s=a-e;return s<6e4?"刚刚":s<36e5?`${Math.floor(s/6e4)}分钟前`:s<864e5?`${Math.floor(s/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(a){this.$message.error("复制失败,请手动复制")}document.body.removeChild(e)},viewOnExplorer(t,e){const a={tron:`https://tronscan.org/#/transaction/${t}`,ethereum:`https://etherscan.io/tx/${t}`,bsc:`https://bscscan.com/tx/${t}`,polygon:`https://polygonscan.com/tx/${t}`},s=a[e];s?window.open(s,"_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()}}}},8401:function(t,e,a){"use strict";a.r(e),a.d(e,{__esModule:function(){return i.B},default:function(){return l}});var s=a(5656),i=a(460),o=i.A,r=a(845),n=(0,r.A)(o,s.XX,s.Yp,!1,null,"2ad2c7c3",null),l=n.exports},8441:function(t,e,a){"use strict";a.r(e),a.d(e,{__esModule:function(){return i.B},default:function(){return l}});var s=a(6037),i=a(4300),o=i.A,r=a(845),n=(0,r.A)(o,s.XX,s.Yp,!1,null,"bd46f398",null),l=n.exports},8466:function(t,e){"use strict";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(a){return[e("el-input",{class:{"changed-input":t.isCellChanged(a.row,"theoryPower")},staticStyle:{"max-width":"260px"},attrs:{size:"small",inputmode:"decimal",disabled:t.isRowDisabled(a.row)},on:{input:function(e){return t.handleTheoryPowerInput(a.$index)},blur:function(e){return t.handleTheoryPowerBlur(a.$index)}},model:{value:a.row.theoryPower,callback:function(e){t.$set(a.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(a.row)},model:{value:a.row.unit,callback:function(e){t.$set(a.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(a){return[e("el-input",{class:{"changed-input":t.isCellChanged(a.row,"powerDissipation")},staticStyle:{"max-width":"260px"},attrs:{size:"small",inputmode:"decimal",disabled:t.isRowDisabled(a.row)},on:{input:function(e){return t.handleNumericCell(a.$index,"powerDissipation")},blur:function(e){return t.handlePowerDissipationBlur(a.$index)}},model:{value:a.row.powerDissipation,callback:function(e){t.$set(a.row,"powerDissipation",e)},expression:"scope.row.powerDissipation"}})]}}],null,!1,2013801812)}),e("el-table-column",{attrs:{label:"型号"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-input",{class:{"changed-input":t.isCellChanged(a.row,"type")},staticStyle:{"max-width":"180px"},attrs:{size:"small",maxlength:20,disabled:t.isRowDisabled(a.row)},on:{input:function(e){return t.handleTypeCell(a.$index)}},model:{value:a.row.type,callback:function(e){t.$set(a.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(a){return[e("el-input",{class:{"changed-input":t.isCellChanged(a.row,"price")},staticStyle:{"max-width":"260px"},attrs:{size:"small",inputmode:"decimal",disabled:t.isRowDisabled(a.row)},on:{input:function(e){return t.handleNumericCell(a.$index,"price")},blur:function(e){return t.handlePriceBlur(a.$index)}},model:{value:a.row._priceEditing,callback:function(e){t.$set(a.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(a.$index)}},model:{value:a.row._selectedPayIndex,callback:function(e){t.$set(a.row,"_selectedPayIndex",e)},expression:"scope.row._selectedPayIndex"}},t._l(a.row.priceList||[],function(t,a){return e("el-option",{key:t.payTypeId||a,attrs:{label:[String(t.chain||"").toUpperCase(),String(t.coin||"").toUpperCase()].filter(Boolean).join("-"),value:a}})}),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(a){return[e("el-input",{class:{"changed-input":t.isCellChanged(a.row,"maxLeaseDays")},staticStyle:{"max-width":"260px"},attrs:{size:"small",inputmode:"numeric",disabled:t.isRowDisabled(a.row)},on:{input:function(e){return t.handleMaxLeaseDaysInput(a.$index)},blur:function(e){return t.handleMaxLeaseDaysBlur(a.$index)}},model:{value:a.row.maxLeaseDays,callback:function(e){t.$set(a.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(a){return[e("el-switch",{attrs:{"active-value":0,"inactive-value":1,"active-text":"上架","inactive-text":"下架",disabled:t.isRowDisabled(a.row)},on:{change:function(e){return t.handleStateChange(a.$index)}},model:{value:a.row.state,callback:function(e){t.$set(a.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(a){return[e("el-tag",{attrs:{type:0===a.row.saleState?"info":1===a.row.saleState?"danger":"warning"}},[t._v(" "+t._s(0===a.row.saleState?"未售出":1===a.row.saleState?"已售出":"售出中")+" ")])]}}],null,!1,1904393654)}),e("el-table-column",{attrs:{label:"操作",fixed:"right","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-button",{staticStyle:{color:"#f56c6c"},attrs:{type:"text",size:"small",disabled:t.isRowDisabled(a.row)},on:{click:function(e){return t.handleDeleteMachine(a.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=[]},8475:function(t,e){"use strict";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(a){return e("div",{key:a.id,staticClass:"withdrawal-item pending",on:{click:function(e){return t.showDetail(a)}}},[e("div",{staticClass:"item-main"},[e("div",{staticClass:"item-left"},[e("div",{staticClass:"amount"},[t._v(t._s(a.amount)+" "+t._s(a.toSymbol||"USDT"))]),e("div",{staticClass:"chain"},[t._v(t._s(t.getChainName(a.toChain)))])]),e("div",{staticClass:"item-right"},[e("div",{staticClass:"status pending-status"},[e("i",{staticClass:"el-icon-loading"}),t._v(" "+t._s(t.getStatusText(a.status))+" ")]),e("div",{staticClass:"time"},[t._v(t._s(t.formatTime(a.createTime)))])])]),e("div",{staticClass:"item-footer"},[e("div",{staticClass:"footer-left"},[e("span",{staticClass:"address"},[t._v(t._s(t.formatAddress(a.toAddress)))]),a.txHash?e("span",{staticClass:"tx-hash"},[e("i",{staticClass:"el-icon-link"}),t._v(" "+t._s(t.formatAddress(a.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(a){return e("div",{key:a.id,staticClass:"withdrawal-item success",on:{click:function(e){return t.showDetail(a)}}},[e("div",{staticClass:"item-main"},[e("div",{staticClass:"item-left"},[e("div",{staticClass:"amount"},[t._v(t._s(a.amount)+" "+t._s(a.toSymbol||"USDT"))]),e("div",{staticClass:"chain"},[t._v(t._s(t.getChainName(a.toChain)))])]),e("div",{staticClass:"item-right"},[e("div",{staticClass:"status success-status"},[e("i",{staticClass:"el-icon-check"}),t._v(" "+t._s(t.getStatusText(a.status))+" ")]),e("div",{staticClass:"time"},[t._v(t._s(t.formatTime(a.createTime)))])])]),e("div",{staticClass:"item-footer"},[e("div",{staticClass:"footer-left"},[e("span",{staticClass:"address"},[t._v(t._s(t.formatAddress(a.toAddress)))]),a.txHash?e("span",{staticClass:"tx-hash"},[e("i",{staticClass:"el-icon-link"}),t._v(" "+t._s(t.formatAddress(a.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(a){return e("div",{key:a.id,staticClass:"withdrawal-item failed",on:{click:function(e){return t.showDetail(a)}}},[e("div",{staticClass:"item-main"},[e("div",{staticClass:"item-left"},[e("div",{staticClass:"amount"},[t._v(t._s(a.amount)+" "+t._s(a.toSymbol||"USDT"))]),e("div",{staticClass:"chain"},[t._v(t._s(t.getChainName(a.toChain)))])]),e("div",{staticClass:"item-right"},[e("div",{staticClass:"status failed-status"},[e("i",{staticClass:"el-icon-close"}),t._v(" "+t._s(t.getStatusText(a.status))+" ")]),e("div",{staticClass:"time"},[t._v(t._s(t.formatTime(a.createTime)))])])]),e("div",{staticClass:"item-footer"},[e("div",{staticClass:"footer-left"},[e("span",{staticClass:"address"},[t._v(t._s(t.formatAddress(a.toAddress)))]),a.txHash?e("span",{staticClass:"tx-hash"},[e("i",{staticClass:"el-icon-link"}),t._v(" "+t._s(t.formatAddress(a.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||"USDT"))])]),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("查看您的提现申请和交易状态")])])}]},8603:function(t,e,a){"use strict";e.Yp=e.XX=void 0,a(8111),a(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:a,data:s}){return[e("span",{staticClass:"custom-node",attrs:{"aria-label":"cascader-item",tabindex:"0"},on:{click:function(e){return e.stopPropagation(),t.handleItemClick(a,s)}}},[e("span",{staticClass:"node-label"},[t._v(t._s(s.label))]),a.isLeaf&&a.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(a){return e("el-tag",{key:a,attrs:{type:"warning",effect:"light",closable:"","disable-transitions":""},on:{close:function(e){return t.handleRemoveSelectedCoin(a)}}},[t._v(" "+t._s(a)+" ")])}),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":"160"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.name||e.row.productName||e.row.title||e.row.product||"-"))]}}])}),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(null!=e.row.totalMachineNumber?e.row.totalMachineNumber:e.row.total||e.row.totalMachines||"-"))]}}])}),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(a){return e("el-table-column",{key:"price-"+a,attrs:{label:a+" 价格","min-width":"160"},scopedSlots:t._u([{key:"default",fn:function(s){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(a))]},proxy:!0}],null,!0),model:{value:t.preCheck.rowPrices[t.getRowKey(s.row,s.$index)][a],callback:function(e){t.$set(t.preCheck.rowPrices[t.getRowKey(s.row,s.$index)],a,e)},expression:"preCheck.rowPrices[getRowKey(scope.row, scope.$index)][sym]"}})]}}],null,!0)})})],2)],1)],1)])},e.Yp=[]},8732:function(t,e,a){"use strict";Object.defineProperty(e,"B",{value:!0}),e.A=void 0,a(4114),a(8111),a(2489),a(116),a(7588),a(1701),a(8237),a(3579),a(7642),a(8004),a(3853),a(5876),a(2475),a(5024),a(1698);var s=a(5844),i=a(4180),o=a(4981);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},options:[],payDialog:{visible:!1,value:[],loading:!1},selectedChain:"",selectedCoin:"",selectedPrice:0,paySelectionMap:{},clearOffLoading:!1,settlementSuccessfulVisible:!1}},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(){let t=0;const e=e=>{const a=this.selectedMachinesMap[e.id],s=Array.isArray(e.productMachineDtoList)?e.productMachineDtoList:[];s.forEach(e=>{a&&a.has(e.id)&&(t+=Number(e.price||0)*Number(e.leaseTime||1))})};return Array.isArray(this.groups)&&this.groups.length?this.groups.forEach(e):Array.isArray(this.shops)&&this.shops.length&&this.shops.forEach(t=>(t.shoppingCartInfoDtoList||[]).forEach(e)),t},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()}},mounted(){this.fetchGetGoodsList()},watch:{"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())}},beforeDestroy(){try{this.noticeTimer&&clearInterval(this.noticeTimer)}catch(t){}this.noticeTimer=null},methods:{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 a=1;"-"===e[0]&&(a=-1,e=e.slice(1));const s=e.split("."),i=parseInt(s[0]||"0",10)||0,o=(s[1]||"").replace(/[^0-9]/g,""),r=o.length>=2?o.slice(0,2):o.padEnd(2,"0"),n=100*i+(parseInt(r||"0",10)||0);return a*n},centsToText(t){const e=t<0?"-":"",a=Math.abs(Number(t)||0),s=Math.floor(a/100),i=String(a%100).padStart(2,"0");return`${e}${s}.${i}`},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))},getRowMaxLeaseDaysLocal(t){const e=t&&t.maxLeaseDays,a=Number(e);return Number.isFinite(a)?a<1?1:a>365?365:Math.floor(a):365},formatTrunc(t,e=2){const a=Number(t);if(!Number.isFinite(a))return"0";const s=Math.max(0,Number(e)||0),i=Math.pow(10,s),o=Math.trunc(a*i)/i,r=String(o);if(0===s)return r;const[n,l=""]=r.split("."),c=l.padEnd(s,"0");return`${n}.${c}`},async fetchChainAndListForSeller(t){if(!t)return this.options=[],void(this.loading=!1);this.loading=!0;const e=await(0,i.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},a=t&&(null!=t.label?t.label:t.value)||"";return e.label=String(a).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):"",a=t&&t.payCoin?String(t.payCoin):"",s=`${e}|${a}`;return{label:`${e} - ${this.toUpperText(a)}`,value:s,icon:t&&t.payCoinImage?t.payCoinImage:""}})},hasMachinePriceForSelection(t,e){if(!t||!e)return!1;const a=this.paySelectionMap[t.id]||"",[s,i]=String(a).split("|"),o=Array.isArray(e.priceList)?e.priceList:[];return o.some(t=>String(t.chain)===s&&String(t.coin)===i)},getSelectedCoinSymbolForShop(t){const e=this.paySelectionMap[t?t.id:void 0];if(!e)return"";const a=String(e).split("|");return this.toUpperText(a[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]||"",[a,s]=String(e).split("|"),i=Array.isArray(t&&t.payConfigList)?t.payConfigList:[],o=i.find(t=>String(t.payChain)===a&&String(t.payCoin)===s);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 a=this.selectedMachinesMap[t.id];if(a&&a.size){const e=Array.isArray(t.productMachineDtoList)?t.productMachineDtoList:[];e.forEach(e=>{a.has(e.id)&&!this.hasMachinePriceForSelection(t,e)&&a.delete(e.id)}),this.$nextTick(()=>this.applyInnerSelectionFromSet(t))}},displayShopTotalBySelection(t){if(!t)return 0;if(this.ensureDefaultPaySelection(t),this.isShopLeaseChanged(t))try{const e=Array.isArray(t.productMachineDtoList)?t.productMachineDtoList:[];let a=0;return e.forEach(e=>{const s=this.getMachineUnitPriceBySelection(t,e);if(null!=s){const t=Math.max(1,Math.floor(Number(e.leaseTime||1)));a+=this.toCents(s)*t}}),a/100}catch(r){}const e=this.paySelectionMap[t.id]||"",[a,s]=e.split("|"),i=Array.isArray(t.totalPriceList)?t.totalPriceList:[],o=i.find(t=>String(t.chain)===a&&String(t.coin)===s);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),a=Math.max(1,Math.floor(Number(t&&t.leaseTime)||1));return e!==a})}catch(e){return!1}},getMachineUnitPriceBySelection(t,e){if(!t||!e)return Number(e.price||0);this.ensureDefaultPaySelection(t);const a=this.paySelectionMap[t.id]||"",[s,i]=a.split("|"),o=Array.isArray(e.priceList)?e.priceList:[],r=o.find(t=>String(t.chain)===s&&String(t.coin)===i);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 a=0;for(const s of e){const t=this.toCents(s&&s.price),e=Math.max(1,Math.floor(Number(s&&s.leaseTime)||1));a+=t*e}return a/100},computeShopTotalDisplay(t){const e=Array.isArray(t&&t.productMachineDtoList)?t.productMachineDtoList:[],a=Number(t&&t.totalPrice),s=Number.isFinite(a);let i=!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){i=!0;break}}if(s&&!i||!e.length&&s)return this.formatTrunc(a,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 a=this.selectedMachinesMap[e.id];if(!a||0===a.size)return;const s=Array.isArray(e.productMachineDtoList)?e.productMachineDtoList:[];s.forEach(e=>{a.has(e.id)&&t.push({machineId:e.id,productId:e.productId})})}),t.filter(t=>t&&null!=t.machineId)},async fetchAddOrders(t,e){try{const a={code:e,orderInfoVoList:t},s=await(0,i.addOrders)(a);return s}catch(a){return{code:-1,msg:"网络异常",data:null}}},async fetchDeleteBatchGoods(t){try{const e=await(0,s.deleteBatchGoods)(t);return e}catch(e){return{code:-1,msg:"网络异常"}}},async handleClearOffShelf(){if(!this.clearOffLoading){this.clearOffLoading=!0;try{const t=await(0,s.deleteBatchGoodsForIsDelete)();t&&200===Number(t.code)?(this.$message({message:"已清除下架商品",type:"success",showClose:!0}),await this.fetchGetGoodsList()):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(a){this.expandedGroupKeys=[]}},handleShopExpandChange(t,e){try{const a=Array.isArray(e)?e.map(t=>t&&(null!=t.id?String(t.id):void 0)).filter(Boolean):[];this.expandedShopKeys=a;const s=a.includes(String(t.id));s&&this.$nextTick(()=>this.applyInnerSelectionFromSet(t))}catch(a){this.expandedShopKeys=[]}},async fetchGetGoodsList(t){try{this.loading=!0;const a=await(0,s.getGoodsList)(t),i=Array.isArray(a&&a.rows)?a.rows:Array.isArray(a&&a.data&&a.data.rows)?a.data.rows:Array.isArray(a&&a.data)?a.data:[];if(!i||0===i.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(i.length&&i[0].productMachineDtoList){const t=i.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))})})}catch(e){}this.shops=t,this.groups=[],this.expandedGroupKeys=[];try{this.expandedShopKeys=t.map(t=>String(t.id))}catch(e){this.expandedShopKeys=[]}const a=t.reduce((t,e)=>t+(Array.isArray(e.productMachineDtoList)?e.productMachineDtoList.length:0),0);return void window.dispatchEvent(new CustomEvent("cart-updated",{detail:{count:a}}))}const o=i.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,a=0){const s=this.$refs["innerTable-"+t.id],i=Array.isArray(t.productMachineDtoList)?t.productMachineDtoList:[];if(s&&"function"===typeof s.clearSelection){try{s.clearSelection()}catch(o){}e&&i.forEach(t=>{try{s.toggleRowSelection(t,!0)}catch(o){}})}else a>=5||this.$nextTick(()=>this.applyInnerSelection(t,e,a+1))},applyInnerSelectionFromSet(t,e=0){if(!t)return;const a=this.$refs["innerTable-"+t.id],s=Array.isArray(t.productMachineDtoList)?t.productMachineDtoList:[],i=this.selectedMachinesMap[t.id];if(a&&"function"===typeof a.clearSelection){try{a.clearSelection()}catch(o){}i&&i.size&&s.forEach(t=>{if(i.has(t.id))try{a.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 a=new Set((e||[]).map(t=>t.id));this.$set(this.selectedMachinesMap,t.id,a)},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 a=Number(e.price||0),s=Number(e.leaseTime||1);return t+a*s},0)},countMachines(t){const e=Array.isArray(t&&t.shoppingCartInfoDtoList)?t.shoppingCartInfoDtoList:[];return e.reduce((t,e)=>t+(Array.isArray(e.productMachineDtoList)?e.productMachineDtoList.length:0),0)},async handleCheckoutShop(t){if(!t)return;const e=t.id,a=Array.isArray(t.productMachineDtoList)?t.productMachineDtoList:[];if(0===a.length)return void this.$message({message:"该店铺暂无可结算的机器",type:"warning",showClose:!0});const s=Array.isArray(this.expandedShopKeys)&&this.expandedShopKeys.includes(String(e)),i=[];if(s){const t=this.selectedMachinesMap[e];if(!t||0===t.size)return void this.$message({message:"请先在该店铺下勾选要结算的机器",type:"warning",showClose:!0});if(a.forEach(a=>{t.has(a.id)&&this.isOnShelf(a)&&i.push({leaseTime:Number(a.leaseTime||1),machineId:a.id,productId:a.productId,shopId:e})}),!i.length)return void this.$message({message:"所选机器均已下架,无法结算",type:"warning",showClose:!0})}else{const t=a.filter(t=>this.isOnShelf(t));if(!t.length)return void this.$message({message:"该店铺暂无上架机器可结算",type:"warning",showClose:!0});t.forEach(t=>{i.push({leaseTime:Number(t.leaseTime||1),machineId:t.id,productId:t.productId,shopId:e})})}await this.fetchChainAndListForSeller(e),this.pendingCheckoutShop={shop:t,payload:i},this.noticeDialog.visible=!0,this.noticeDialog.checked=!1,this.startNoticeCountdown()},async executeCheckout(t){if(!this.pendingCheckoutShop&&!this.pendingCheckoutAll)return;let e=[];if(this.pendingCheckoutAll&&this.pendingCheckoutAll.length)this.pendingCheckoutAll.forEach(({shop:t,items:a})=>{(a||[]).forEach(a=>{const s=this.paySelectionMap[t.id]||"",[i,o]=String(s).split("|");e.push({leaseTime:Number(a.leaseTime||1),machineId:a.id,productId:a.productId,shopId:t.id,chain:i,coin:o})})});else if(this.pendingCheckoutShop){const{payload:t}=this.pendingCheckoutShop;e=(Array.isArray(t)?t:[]).map(t=>{const e=this.paySelectionMap[t.shopId]||this.paySelectionMap[this.pendingCheckoutShop.shop.id]||"",[a,s]=String(e).split("|");return{...t,chain:a,coin:s}})}this.creatingOrder=!0;try{const a=await this.fetchAddOrders(e,t);let s=!1;if(a&&200===Number(a.code)){const t=String(a.data||"");s=t.includes("成功"),this.$message({message:"结算成功,订单状态请在订单列表中查看",type:"success",duration:3e3,showClose:!0}),this.settlementSuccessfulVisible=!0}s?await this.fetchGetGoodsList():this.reapplySelectionsForPendingShop()}catch(a){console.log("网络错误,请重试"),this.reapplySelectionsForPendingShop()}finally{this.creatingOrder=!1,this.pendingCheckoutShop=null,this.pendingCheckoutAll=null}},handleCheckoutSelected(){if(!this.selectedMachineCount)return void this.$message({message:"请先勾选要结算的机器",type:"warning",showClose:!0});const t=Array.isArray(this.shops)?this.shops:[],e=[];t.forEach(t=>{const a=this.selectedMachinesMap[t.id];if(!a||!a.size)return;const s=Array.isArray(t.productMachineDtoList)?t.productMachineDtoList:[],i=s.filter(t=>a.has(t.id)&&this.isOnShelf(t));i.length&&e.push({shop:t,items:i})}),e.length?(this.pendingCheckoutAll=e,this.noticeDialog.visible=!0,this.noticeDialog.checked=!1,this.startNoticeCountdown()):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.fetchGetGoodsList(),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(a){}})}catch(a){}}}).catch(()=>null):this.$message({message:"请先勾选需要删除的机器或商品",type:"warning",showClose:!0})},confirmPay(){this.confirmDialog.visible=!1,this.showGoogleCodeDialog()},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)},handleNoticeAcknowledge(){if(!(this.noticeDialog.countdown>0))if(this.noticeDialog.checked)if(this.noticeDialog.visible=!1,this.$nextTick(()=>this.reapplySelectionsForPendingShop()),this.pendingCheckoutAll&&this.pendingCheckoutAll.length)this.showConfirmDialogAll();else{try{const t=this.pendingCheckoutShop&&this.pendingCheckoutShop.shop;if(t){const e=this.paySelectionMap[t.id]||"",[a,s]=String(e).split("|");this.selectedChain=a||"",this.selectedCoin=s||""}else this.selectedChain="",this.selectedCoin=""}catch(t){this.selectedChain="",this.selectedCoin=""}this.showConfirmDialog()}else this.$message({message:'请先勾选"我已阅读并同意上述注意事项"',type:"warning",showClose:!0})},openPaySelectDialog(){},showConfirmDialog(){if(!this.pendingCheckoutShop)return;const{shop:t,payload:e}=this.pendingCheckoutShop;this.$nextTick(()=>this.reapplySelectionsForPendingShop());const a=Array.isArray(t.productMachineDtoList)?t.productMachineDtoList:[],s=(new Map,new Set(e.map(t=>t.machineId))),i=[];a.forEach(e=>{if(s.has(e.id)&&this.isOnShelf(e)){const a=this.getMachineUnitPriceBySelection(t,e);if(null==a)return;const s=Math.max(1,Math.floor(Number(e.leaseTime||1))),o=Number(a||0),r=Number(o)*s;i.push({product:t.name||"",coin:this.toUpperText(this.selectedCoin||""),user:e.user,miner:e.miner,unitPrice:Number(o||0),leaseTime:s,subtotal:Number(r||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=i.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:i,deductibleAmount:h,fee:p,enough:g,groupSubtotal:m};this.confirmDialog.shops=[f],this.confirmDialog.count=i.length;const y={},v=(t,e)=>t+this.toCents(e);if(l){let t=i.reduce((t,e)=>v(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 a=0;const s=Array.isArray(this.shops)?this.shops:[];s.forEach(s=>{const i=this.selectedMachinesMap[s.id];if(!i||!i.size)return;const o=this.paySelectionMap[s.id]||"",[r,n]=String(o).split("|"),l=this.toUpperText(n||""),c=`${r} - ${l}`,d=Array.isArray(s&&s.payConfigList)?s.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(s.productMachineDtoList)?s.productMachineDtoList:[];let f=0;if(g.forEach(t=>{if(!i.has(t.id)||!this.isOnShelf(t))return;const o=this.getMachineUnitPriceBySelection(s,t);if(null==o)return;const r=Math.max(1,Math.floor(Number(t.leaseTime||1))),n=Number(o||0),c=Number(n)*r;m.push({product:s.name||"",coin:l,user:t.user,miner:t.miner,unitPrice:n,leaseTime:r,subtotal:c}),f+=c;const d=e.get(l)||0;e.set(l,d+this.toCents(c)),a+=1}),m.length){const a=f>=h||h<=0;if(!a&&p>0){const t=e.get(l)||0;e.set(l,t+this.toCents(p))}t.push({shopId:s.id,shopName:s.name||"",coinSymbol:l,payLabel:c,items:m,deductibleAmount:h,fee:p,enough:a,groupSubtotal:f})}});const i={};e.forEach((t,e)=>{i[e]=Number(this.centsToText(t))}),this.confirmDialog.shops=t,this.confirmDialog.count=a,this.confirmDialog.totalsByCoin=i,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{await this.executeCheckout(this.googleCodeDialog.code),this.googleCodeDialog.visible=!1}catch(t){this.googleCodeDialog.error="验证码错误,请重新输入"}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},handleLeaseTimeChange(t){t.leaseTime<1?t.leaseTime=1:t.leaseTime>365?t.leaseTime=365:t.leaseTime=Math.floor(t.leaseTime)},handleLeaseTimeInput(t,e){if(""===e||null===e||void 0===e)return void(t.leaseTime=1);const a=Number(e);isNaN(a)?t.leaseTime=1:t.leaseTime=a%1===0?a<1?1:a>365?365:a:Math.floor(a)},handleProductExpandChange(t,e,a){const s=this.$refs["productTable-"+(t&&t.id)];if(!s||!e)return;const i=s.selection||[],o=Array.isArray(i)&&i.some(t=>t&&t.id===e.id);o&&this.$nextTick(()=>{this.applyInnerSelection(e,!0)})},isProductSelected(t,e){const a=this.$refs["productTable-"+(t&&t.id)];if(!a||!e)return!1;const s=a.selection||[];return Array.isArray(s)&&s.some(t=>t&&t.id===e.id)},formatPayTooltip(t){return`${t.payChain} - ${this.toUpperText(t.payCoin)}`}}}},8874:function(t,e,a){"use strict";a.r(e),a.d(e,{__esModule:function(){return i.B},default:function(){return l}});var s=a(4571),i=a(1867),o=i.A,r=a(845),n=(0,r.A)(o,s.XX,s.Yp,!1,null,"592f2fb3",null),l=n.exports},8967:function(t,e,a){"use strict";a.r(e),a.d(e,{__esModule:function(){return i.B},default:function(){return l}});var s=a(3375),i=a(2935),o=i.A,r=a(845),n=(0,r.A)(o,s.XX,s.Yp,!1,null,"5400b150",null),l=n.exports},9072:function(t,e,a){"use strict";a.r(e),a.d(e,{__esModule:function(){return i.B},default:function(){return l}});var s=a(2172),i=a(6616),o=i.A,r=a(845),n=(0,r.A)(o,s.XX,s.Yp,!1,null,"75ddb61b",null),l=n.exports},9146:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=void 0,a(4114);var s=a(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:{coin:"",algorithm:""},productListLoading:!1}},mounted(){this.fetchGetList()},methods:{formatPriceRange(t){try{if(null===t||void 0===t)return"0.00";const e=String(t);if(e.includes("-")){const[t,a]=e.split("-");return`${this._truncate2(t)}-${this._truncate2(a)}`}return this._truncate2(e)}catch(e){return"0.00"}},_truncate2(t){if(null===t||void 0===t)return"0.00";const e=String(t).trim();if(!e)return"0.00";const[a,s=""]=e.split("."),i=s.slice(0,2);return`${a}.${i.padEnd(2,"0")}`},handleCurrencyChange(t){try{if(void 0===t||null===t||""===t)return;this.params.coin=t;const e=(this.searchAlgorithm||"").trim(),a=e?{coin:t,algorithm:e}:{coin:t};this.fetchGetList(a)}catch(e){console.error("处理币种变更失败",e)}},async fetchGetList(t){this.productListLoading=!0;try{const e=await(0,s.getProductList)(t);console.log("API响应:",e),e&&200===e.code?(this.products=e.rows||[],console.log("商品数据:",this.products)):(console.error("API返回错误:",e),this.products=[])}catch(e){console.error("获取商品列表失败:",e),this.products=[],this.products=[]}this.productListLoading=!1},handleAlgorithmSearch(){const t=(this.searchAlgorithm||"").trim(),e={...this.params};t?(e.algorithm=t,this.params.algorithm=t):(delete e.algorithm,this.params.algorithm=""),e.algorithm?this.fetchGetList({...e,coin:this.screenCurrency||void 0}):this.fetchGetList(this.screenCurrency?{coin:this.screenCurrency}:void 0)},handleCurrencyClear(){this.screenCurrency="",this.params.coin="";const t=(this.searchAlgorithm||"").trim();t?this.fetchGetList({algorithm:t}):this.fetchGetList()},handleAlgorithmClear(){this.searchAlgorithm="",this.params.algorithm="";const t=this.screenCurrency;t?this.fetchGetList({coin:t}):this.fetchGetList()},handleProductClick(t){(t.id||0==t.id)&&this.$router.push(`/product/${t.id}`)}}}},9197:function(t,e,a){"use strict";a.r(e),a.d(e,{default:function(){return n}});var s=a(1968),i=a(845),o={},r=(0,i.A)(o,s.XX,s.Yp,!1,null,null,null),n=r.exports},9252:function(t,e){"use strict";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,a){"use strict";a.r(e),a.d(e,{__esModule:function(){return i.B},default:function(){return l}});var s=a(3574),i=a(346),o=i.A,r=a(845),n=(0,r.A)(o,s.XX,s.Yp,!1,null,"538996de",null),l=n.exports},9325:function(t,e,a){"use strict";var s=a(3999)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=void 0;var i=s(a(5471)),o=s(a(1973)),r=a(3723);i.default.use(o.default);const n=new o.default({mode:"history",base:"/",routes:r.mainRoutes});n.beforeEach((t,e,a)=>{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(", ")}`),a()}),n.onError(t=>{console.error("路由错误:",t)});e["default"]=n},9526:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=void 0;e["default"]={401:"认证失败,无法访问系统资源,请重新登录",403:"当前操作没有权限",404:"访问资源不存在",default:"系统未知错误,请反馈给管理员"}},9628:function(t,e){"use strict";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(a){return e("div",{key:a.id,staticClass:"order-item"},[e("div",{staticClass:"item-image"},[e("img",{attrs:{src:a.image,alt:a.title}})]),e("div",{staticClass:"item-info"},[e("h3",{staticClass:"item-title"},[t._v(t._s(a.title))]),e("div",{staticClass:"item-price"},[t._v("¥"+t._s(a.price))])]),e("div",{staticClass:"item-quantity"},[e("span",{staticClass:"quantity-label"},[t._v("数量:")]),e("span",{staticClass:"quantity-value"},[t._v(t._s(a.quantity))])]),e("div",{staticClass:"item-total"},[e("span",{staticClass:"total-label"},[t._v("小计:")]),e("span",{staticClass:"total-price"},[t._v("¥"+t._s((a.price*a.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,a){"use strict";Object.defineProperty(e,"B",{value:!0}),e.A=void 0;var s=a(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,s.getOrdersByIds)({orderId:t}),a=null!=(e&&e.data)?e.data:e;let i={};Array.isArray(a)&&a.length?i=a[0]:a&&"object"===typeof a?i=a:Array.isArray(e&&e.rows)&&e.rows.length&&(i=e.rows[0]),this.order=i||{},this.items=Array.isArray(i&&i.orderItemDtoList)?i.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)}}}}},9662:function(t,e,a){"use strict";var s=a(3999)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e.createProduct=r,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.updateProduct=l;var i=s(a(5720));function o(t){return(0,i.default)({url:"/lease/product/getList",method:"get",data:t})}function r(t){return(0,i.default)({url:"/lease/product/add",method:"post",data:t})}function n(t){return(0,i.default)({url:"/lease/product/getList",method:"post",data:t})}function l(t){return(0,i.default)({url:"/lease/product/update",method:"post",data:t})}function c(t){return(0,i.default)({url:"/lease/product/delete",method:"post",data:{id:t}})}function d(t){return(0,i.default)({url:"/lease/product/getMachineInfo",method:"post",data:t})}function u(t){return(0,i.default)({url:"/lease/product/getOwnedList",method:"post",data:t})}function h(t){return(0,i.default)({url:"/lease/product/getOwnedById",method:"post",data:t})}function p(t){return(0,i.default)({url:"/lease/product/getMachineInfoById",method:"post",data:t})}function m(t){return(0,i.default)({url:"/lease/product/getPayTypes",method:"post",data:t})}},9690:function(t,e){"use strict";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,"empty-text":"暂无进行中的订单"}})],1),e("el-tab-pane",{attrs:{label:"订单已完成",name:"8"}},[e("order-list",{attrs:{items:t.orders[8],"show-checkout":!1,"empty-text":"暂无已完成的订单"}})],1)],1)],1)},e.Yp=[]},9814:function(t,e,a){"use strict";Object.defineProperty(e,"B",{value:!0}),e.A=void 0,a(4114),a(8111),a(7588),a(8237);var s=a(5952),i=a(6067),o=a(5844);e.A={name:"Header",data(){return{user:null,cart:[],cartServerCount:0,navigation:i.mainNavigation}},computed:{cartItemCount(){return Number.isFinite(this.cartServerCount)?this.cartServerCount:0},breadcrumbs(){return(0,i.getBreadcrumb)(this.$route.path)}},watch:{},mounted(){this.loadCart(),window.addEventListener("storage",this.handleStorageChange),this.loadServerCartCount(),window.addEventListener("cart-updated",this.handleCartUpdated)},beforeDestroy(){window.removeEventListener("storage",this.handleStorageChange),window.removeEventListener("cart-updated",this.handleCartUpdated)},methods:{loadCart(){this.cart=(0,s.readCart)()},async loadServerCartCount(){try{const t=await(0,o.getGoodsList)(),e=Array.isArray(t&&t.rows)?t.rows:Array.isArray(t&&t.data&&t.data.rows)?t.data.rows:Array.isArray(t&&t.data)?t.data:Array.isArray(t)?t:[];let a=[];Array.isArray(e)&&e.length?Array.isArray(e[0]&&e[0].shoppingCartInfoDtoList)?e.forEach(t=>{Array.isArray(t&&t.shoppingCartInfoDtoList)&&a.push(...t.shoppingCartInfoDtoList)}):a=e:Array.isArray(t&&t.shoppingCartInfoDtoList)&&(a=t.shoppingCartInfoDtoList);let s=0;a.length?s=a.reduce((t,e)=>t+(Array.isArray(e&&e.productMachineDtoList)?e.productMachineDtoList.length:0),0):Array.isArray(t&&t.productMachineDtoList)&&(s=t.productMachineDtoList.length),this.cartServerCount=Number.isFinite(s)?s:0}catch(t){}},handleStorageChange(t){"power_leasing_cart_v1"===t.key&&(this.loadCart(),this.loadServerCartCount())},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()},handleLogout(){this.user=null,this.cart=[]},getBreadcrumbPath(t){const e=["/productList","/cart","/checkout"];return 0===t?"/productList":t<e.length?e[t-1]:"/productList"}}}},9872:function(t,e,a){"use strict";a.r(e),a.d(e,{__esModule:function(){return i.B},default:function(){return l}});var s=a(6652),i=a(9814),o=i.A,r=a(845),n=(0,r.A)(o,s.XX,s.Yp,!1,null,"20c969ee",null),l=n.exports}},e={};function a(s){var i=e[s];if(void 0!==i)return i.exports;var o=e[s]={id:s,loaded:!1,exports:{}};return t[s].call(o.exports,o,o.exports,a),o.loaded=!0,o.exports}a.m=t,function(){a.amdO={}}(),function(){var t=[];a.O=function(e,s,i,o){if(!s){var r=1/0;for(d=0;d<t.length;d++){s=t[d][0],i=t[d][1],o=t[d][2];for(var n=!0,l=0;l<s.length;l++)(!1&o||r>=o)&&Object.keys(a.O).every(function(t){return a.O[t](s[l])})?s.splice(l--,1):(n=!1,o<r&&(r=o));if(n){t.splice(d--,1);var c=i();void 0!==c&&(e=c)}}return e}o=o||0;for(var d=t.length;d>0&&t[d-1][2]>o;d--)t[d]=t[d-1];t[d]=[s,i,o]}}(),function(){a.d=function(t,e){for(var s in e)a.o(e,s)&&!a.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})}}(),function(){a.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"===typeof window)return window}}()}(),function(){a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}}(),function(){a.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}}(),function(){a.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t}}(),function(){a.p="/"}(),function(){var t={524:0};a.O.j=function(e){return 0===t[e]};var e=function(e,s){var i,o,r=s[0],n=s[1],l=s[2],c=0;if(r.some(function(e){return 0!==t[e]})){for(i in n)a.o(n,i)&&(a.m[i]=n[i]);if(l)var d=l(a)}for(e&&e(s);c<r.length;c++)o=r[c],a.o(t,o)&&t[o]&&t[o][0](),t[o]=0;return a.O(d)},s=self["webpackChunkpower_leasing"]=self["webpackChunkpower_leasing"]||[];s.forEach(e.bind(null,0)),s.push=e.bind(null,s.push.bind(s))}();var s=a.O(void 0,[504],function(){return a(1406)});s=a.O(s)})();
|
||
//# sourceMappingURL=app.d49ccc2c.js.map
|