mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
1 line
660 B
JavaScript
1 line
660 B
JavaScript
(()=>{return(s,e)=>{const t=`https://api.live.bilibili.com/pay/v1/Exchange/silver2coin`;return{widget:{content:`\n <button\n class="gui-settings-flat-button"\n id="seeds-to-coins">\n <i class="mdi mdi-24px mdi-seed-outline"></i>\n <span>瓜子换硬币</span>\n </button>`,success:()=>{const s=async()=>{const s=await Ajax.getJsonWithCredentials(t);if(s.code!==0){Toast.info(s.message,"瓜子换硬币",3e3)}else{Toast.success(`${s.message}\n剩余银瓜子:${s.data.silver}`,"瓜子换硬币",3e3)}};const e=dq("#seeds-to-coins");e.addEventListener("click",async()=>{try{e.disabled=true;await s()}finally{e.disabled=false}})}}}}})(); |