2 lines
8.7 KiB
JavaScript
2 lines
8.7 KiB
JavaScript
|
|
import{c as s,s as e,g as t,$ as i,n as a,a as o,b as l,h as n,d as r,r as u,e as d,f as c,w as p,i as g,j as h,o as _,k as m,l as f,m as b,p as k,t as y,q as w,u as x,F as v}from"./index-BifMHC6c.js";import{_ as C,a as U}from"./uni-popup.D8sN-IRM.js";import{r as M}from"./uni-app.es.BM6_Rfsu.js";import{n as T}from"./nav.CvI0lGd-.js";import{l as $}from"./logo.DDDG-929.js";import{l as B}from"./logout.q3EjtEfG.js";import{_ as L}from"./_plugin-vue_export-helper.BCo6x5W8.js";const D=L({components:{navBar:T},data:()=>({noUnionImage:s.not_unionUrl,baseBgUrl:s.new_unionUrl,unionBgUrl:s.unicon_url,logo:$,logout:B,loading:!1,noMore:!1,isMerber:null,listData:[],UnionByUser:null,statusBarHeight:0,ThemeData:null,swiperList:[],isLeader:!1,isHasUnicon:!1,cardList:[{icon:s.coin_url,title:"本周金额",prop:"week_income"},{icon:s.hongbao_url,title:"厅主收益",prop:"room_author_ratio"},{icon:s.gift_url,title:"礼物分成",prop:"settlement_ratio"}],messageContent:"",popupStstus:0,messageText:"",msgType:"success",statusData:null,guild_id:""}),onLoad(s){const{id:o,h:l}=s;e("token",o||""),t("token")&&(this.getInfo(),this.getStatus()),this.statusBarHeight=l,e("BarHeight",l),t("Theme_Data")&&(this.ThemeData=JSON.parse(t("Theme_Data"))),i("refreshList",(s=>{this.refreshList()})),s.guild_id&&(this.guild_id=s.guild_id,a({url:"/pages/union/list?guild_id="+s.guild_id}))},onUnload(){o("refreshList")},methods:{back(){this.closeWeb()},search(){this.pageConfig.currentPage=1,this.listData=[],this.getList()},refreshList(){this.getInfo(),this.getStatus()},closeWeb(){const s=l().platform;"ios"===s?(console.log("调用iOS原生方法"),window.webkit.messageHandlers.nativeHandler.postMessage({action:"closeWeb"})):"android"===s&&(console.log("调用Android原生方法"),window.Android.closeWeb())},async getStatus(){n.get("/api/Guild/is_guild_member",{token:t("token")||""}).then((s=>{const{data:e,code:t,msg:i}=s;this.statusData={...e.guild,msg:i,code:t}})).catch((s=>{}))},async getInfo(){n.get("/api/Guild/my_guild",{token:t("token")||""}).then((s=>{const{data:e,code:t}=s;this.isLeader=!!t&&1==e.is_leader,this.isHasUnicon=!!t&&!!e.guild_id,this.isMerber=!!t&&e})).catch((s=>{this.isMerber=null,this.isHasUnicon=!1,this.isLeader=!1}))},exit(){r({itemList:["申请退出","付费退出"],success:s=>{0===s.tapIndex?this.applyToWithdraw():1===s.tapIndex&&this.paidWithdrawal()},fail:s=>{console.error("用户取消选择:",s)}})},applyToWithdraw(){this.popupStstus=0,this.messageContent="亲爱的会员,会长将在3天内审核,若超时未通过,您将自动退出并可加入其他公会;若通过,则30天内无法加入其他公会,是否还需要申请退出?",this.$refs.popup.open("center")},paidWithdrawal(){this.popupStstus=2,this.messageContent=`亲爱的会员,支付${this.isMerber.quit_guild_gold||0}金币,即可及时退出公会!是否需要付费退出?`,this.$refs.popup.open("center")},dissolveUnion(){this.popupStstus=4,this.messageContent="亲爱的会长,您当前操作将解散公会,是否解散?",this.$refs.popup.open("center")},closePopup(){this.$refs.popup.close()},confirmPopup(){null!==this.popupStstus&&(0===this.popupStstus?this.exitUnionize(1):2===this.popupStstus?this.exitUnionize(2):4===this.popupStstus&&this.isMerber.is_leader&&this.unionDissolve())},async exitUnionize(s){n.post("/api/Guild/quit_guild",{guild_id:this.isMerber.guild_id,type:s,token:t("token")||""}).then((e=>{const{data:t,code:i,msg:a}=e;1===i?(this.msgType="success",this.messageText=""+(1===s?"退出申请已提交,请等待审核":"付费退出成功"),this.$refs.message.open(),this.refreshList()):(this.messageText=a,this.msgType="error",this.$refs.message.open()),this.closePopup()}))},async unionDissolve(){n.post("/api/Guild/diss_guild",{guild_id:this.isMerber.guild_id,token:t("token")||""}).then((s=>{const{data:e,code:t,msg:i}=s;1===t?(this.msgType="success",this.messageText="操作成功",this.$refs.message.open(),this.refreshList()):(this.messageText=i,this.msgType="error",this.$refs.message.open()),this.closePopup()}))},applyUnion(){""==
|