2021-10-22 03:07:32 +00:00
|
|
|
|
<template>
|
|
|
|
|
<view>
|
|
|
|
|
<!-- 状态栏 -->
|
|
|
|
|
<status-nav :titleVal="'孔雀币管理'" :statusTitle="true"></status-nav>
|
2021-11-02 10:23:53 +00:00
|
|
|
|
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy30 fon28 col3 pad-x180">
|
2021-10-22 03:07:32 +00:00
|
|
|
|
<view class="mar-s20 bacf pad20 radius20">
|
|
|
|
|
<view class="mar-x30">当前孔雀币</view>
|
|
|
|
|
<view class="disjbac">
|
|
|
|
|
<view class="disjcac fc width33" style="align-items: flex-start;">
|
2021-11-02 10:23:53 +00:00
|
|
|
|
<view class="fon36 bold mar-z20">{{dangKQ}}</view>
|
|
|
|
|
<view class="mar-s36 coin-tx-btn" @tap="isTiX=true">提现</view>
|
2021-10-22 03:07:32 +00:00
|
|
|
|
</view>
|
|
|
|
|
<view class="disjcac fc width33">
|
2021-11-02 10:23:53 +00:00
|
|
|
|
<view class="fon36 bold">{{shenHZ}}<span class="coin-yuan">元</span></view>
|
|
|
|
|
<view class="mar-s36 fon26 col3 coin-miao">审核中</view>
|
2021-10-22 03:07:32 +00:00
|
|
|
|
</view>
|
|
|
|
|
<view class="disjcac fc width33">
|
2021-11-02 10:23:53 +00:00
|
|
|
|
<view class="fon36 bold">{{yiTKQ}}<span class="coin-yuan">元</span></view>
|
|
|
|
|
<view class="mar-s36 fon26 col3 coin-miao">已提现</view>
|
2021-10-22 03:07:32 +00:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 获取列表,提现列表 -->
|
|
|
|
|
<view class="mar-s20 bacf pad20 radius20">
|
|
|
|
|
<view class="mar-x50 fon28 disja">
|
|
|
|
|
<view @tap="switchState(true)" :class="activeJF?'col3 bold':'col9'">获取列表</view>
|
2021-11-02 10:23:53 +00:00
|
|
|
|
<view @tap="switchState(false)" :class="!activeJF?'col3 bold':'col9'">支出列表</view>
|
2021-10-22 03:07:32 +00:00
|
|
|
|
</view>
|
|
|
|
|
<view v-for="(item,index) in dataList" :key="index" class="disjbac bbot pad-sx10">
|
|
|
|
|
<view>
|
|
|
|
|
<view class="fon26 col3">{{item.title}}</view>
|
|
|
|
|
<view class="mar-s10 fon20 col9">{{item.time}}</view>
|
|
|
|
|
</view>
|
2021-11-02 10:23:53 +00:00
|
|
|
|
<view v-show="activeJF" class="fon36 bold pcol">+{{item.num}}</view>
|
|
|
|
|
<view v-show="!activeJF" class="fon36 bold">{{item.num}}</view>
|
2021-10-22 03:07:32 +00:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 分享按钮 -->
|
2021-11-02 10:23:53 +00:00
|
|
|
|
<view class="disjcac coin-share-box">
|
|
|
|
|
<image src="/static/public/bottom-shear.png" mode=""></image>
|
2021-10-22 03:07:32 +00:00
|
|
|
|
<view class="fon40 colf bold mar-z10">分享给好友</view>
|
2021-11-02 10:23:53 +00:00
|
|
|
|
<button class="posia-op" open-type="share"></button>
|
2021-10-22 03:07:32 +00:00
|
|
|
|
</view>
|
|
|
|
|
<!-- 提现弹框 -->
|
2021-11-02 10:23:53 +00:00
|
|
|
|
<view v-if="isTiX" @tap="isTiX=false" class="disjcac tc tx-tk-box">
|
|
|
|
|
<view class="bacf width100 radius20 pad30 mar-zy85" @tap.stop="isTiX=true">
|
|
|
|
|
<view class="fon28 bold col34">孔雀币提现</view>
|
|
|
|
|
<view class="fon28 mar-sx30 col34 font5">兑换比例{{kqbl}}孔雀币兑换{{whatPrice}}元人民币</view>
|
|
|
|
|
<input type="number" v-model="kNum" placeholder="请输入孔雀币" class="width100 radius10"/>
|
2021-10-22 03:07:32 +00:00
|
|
|
|
<view class="disjbac">
|
2021-11-02 10:23:53 +00:00
|
|
|
|
<view @tap.stop="confrimT" class="tk-btn pbackc">立即提现</view>
|
|
|
|
|
<view @tap.stop="isTiX=false" class="tk-btn">暂不提现</view>
|
2021-10-22 03:07:32 +00:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2021-12-02 09:31:26 +00:00
|
|
|
|
<!-- 弹框授权 -->
|
|
|
|
|
<empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower>
|
|
|
|
|
<!-- 弹框 -->
|
|
|
|
|
<auth-phone v-if="isShowP"></auth-phone>
|
2021-10-22 03:07:32 +00:00
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
statusHNH:uni.getStorageSync('statusHNH'),
|
|
|
|
|
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
|
|
|
|
activeJF:true,
|
2021-11-02 10:23:53 +00:00
|
|
|
|
kNum:'',//输入框孔雀币数量
|
2021-10-22 03:07:32 +00:00
|
|
|
|
dataList:[
|
2021-11-02 10:23:53 +00:00
|
|
|
|
// {title:'积分兑换',time:'2021.09.06 10:30:10',num:'1'},
|
|
|
|
|
// {title:'分享订单',time:'2021.09.06 10:30:10',num:'1'},
|
|
|
|
|
// {title:'订单分享',time:'2021.09.06 10:30:10',num:'1'},
|
|
|
|
|
// {title:'任务完成',time:'2021.09.06 10:30:10',num:'1'},
|
2021-10-22 03:07:32 +00:00
|
|
|
|
],
|
2021-11-02 10:23:53 +00:00
|
|
|
|
isTiX:false,
|
|
|
|
|
dangKQ:3000,//当前孔雀币
|
|
|
|
|
shenHZ:300 ,//审核中的孔雀币
|
|
|
|
|
yiTKQ:0 ,//已提孔雀币
|
|
|
|
|
kqbl:0,//兑换比例
|
|
|
|
|
whatPrice:0,//多少元
|
|
|
|
|
ntype:'in',//默认coin:孔雀币记录获取 withdrawal:提现记录获取
|
|
|
|
|
times:0,//次数
|
|
|
|
|
page:1,
|
|
|
|
|
size:10,
|
|
|
|
|
total:'',//总数
|
|
|
|
|
isZanw:true,
|
2021-12-20 08:02:27 +00:00
|
|
|
|
vision:false,
|
2021-12-02 09:31:26 +00:00
|
|
|
|
isShowP:false,
|
2021-11-02 10:23:53 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onReachBottom() {
|
|
|
|
|
if(this.total!=this.dataList.length){
|
|
|
|
|
this.page++
|
|
|
|
|
this.checkList(this.ntype)//调用自主预约列表事件
|
|
|
|
|
} else {
|
|
|
|
|
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多记录','none',1000)
|
|
|
|
|
this.isZanw = false
|
2021-10-22 03:07:32 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
2021-12-02 09:31:26 +00:00
|
|
|
|
onLoad(options) {
|
|
|
|
|
if(uni.getStorageSync('is_active')!=1){this.vision = true;}
|
|
|
|
|
if(options.invite_code!='' && options.invite_code!=undefined){
|
|
|
|
|
this.loginEv(options.invite_code);
|
|
|
|
|
} else if(options.source_code!='' && options.source_code!=undefined){
|
|
|
|
|
this.loginEv('',options.source_code,options.channel);
|
|
|
|
|
}
|
2021-11-02 10:23:53 +00:00
|
|
|
|
this.$toolAll.tools.isLogin();
|
|
|
|
|
this.checkInfo();
|
|
|
|
|
this.checkList(this.ntype);
|
2021-10-22 03:07:32 +00:00
|
|
|
|
},
|
|
|
|
|
methods: {
|
2021-12-02 09:31:26 +00:00
|
|
|
|
loginEv(invite_code='',source='',channel=''){
|
|
|
|
|
uni.login({
|
|
|
|
|
provider: 'weixin',
|
|
|
|
|
success: (res)=> {
|
|
|
|
|
if (res.code) {
|
|
|
|
|
var params = {
|
|
|
|
|
code:res.code,
|
|
|
|
|
invite_code:invite_code,//用户邀请码
|
|
|
|
|
source_code:source,
|
|
|
|
|
channel:channel
|
|
|
|
|
}
|
|
|
|
|
this.$requst.post('user/login',params).then(res => {
|
|
|
|
|
if(res.data.token!=''){
|
|
|
|
|
if(res.data.is_active==0) {
|
|
|
|
|
this.haveImg = false;
|
|
|
|
|
this.vision = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},error => {})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
buttonH(e){//授权成功
|
|
|
|
|
this.haveImg = e
|
|
|
|
|
if(e) {
|
|
|
|
|
this.vision = false
|
|
|
|
|
this.isShowP = true
|
|
|
|
|
}
|
|
|
|
|
},
|
2021-11-02 10:23:53 +00:00
|
|
|
|
confrimT(){//确定提现事件
|
|
|
|
|
if(this.kNum=='' || this.kNum<=0){
|
|
|
|
|
this.$toolAll.tools.showToast('请输入孔雀币数量');
|
|
|
|
|
} else if(this.kNum>this.dangKQ){
|
|
|
|
|
this.$toolAll.tools.showToast('请输入正确的孔雀币数量');
|
|
|
|
|
} else {
|
|
|
|
|
if(this.times==0){
|
|
|
|
|
this.times++;
|
|
|
|
|
this.$requst.post('user/withdrawal-coin',{coin:this.kNum}).then(res=>{
|
|
|
|
|
if(res.code==0){
|
|
|
|
|
this.isTiX = false;
|
|
|
|
|
this.$toolAll.tools.showToast('提现已提交审核');
|
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
this.dataList = [];
|
|
|
|
|
this.page =1;
|
|
|
|
|
this.isZanw = true;
|
|
|
|
|
this.ntype = 'out';
|
|
|
|
|
this.checkInfo();//查询账户信息
|
|
|
|
|
this.checkList(this.ntype);//查询已提现列表
|
|
|
|
|
this.activeJF = false;
|
|
|
|
|
this.times = 0;//可点
|
|
|
|
|
this.kNum = '';//清空输入框
|
|
|
|
|
},1500)
|
|
|
|
|
} else this.$toolAll.tools.showToast(res.msg);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
checkList(ntype){//查询数据列表
|
|
|
|
|
this.$requst.post('user/coin-log',{type:ntype,page:this.page,size:this.size}).then(res=>{
|
|
|
|
|
if(res.code==0){
|
|
|
|
|
if(this.page==1) this.dataList = [];
|
|
|
|
|
this.total = res.data.total;
|
|
|
|
|
if(res.data.list.length!=0){
|
|
|
|
|
res.data.list.forEach(item=>{
|
|
|
|
|
let obj = {
|
|
|
|
|
title:item.name,
|
|
|
|
|
time:item.created_at,
|
|
|
|
|
num:item.num
|
|
|
|
|
}
|
|
|
|
|
this.dataList.push(obj);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
checkInfo(){//查询账户详情
|
|
|
|
|
this.$requst.post('user/coin-load').then(res=>{
|
|
|
|
|
if(res.code==0){
|
|
|
|
|
this.dangKQ = res.data.coin;//当前孔雀币
|
|
|
|
|
this.shenHZ = res.data.withdrawal_ing;//审核中的孔雀币
|
|
|
|
|
this.yiTKQ = res.data.withdrawald;//已提孔雀币
|
|
|
|
|
this.kqbl = res.data.withdrawal_proportion.coin;//孔雀币比例
|
|
|
|
|
this.whatPrice = res.data.withdrawal_proportion.money;//兑换后的钱
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
switchState(flag){//切换事件
|
|
|
|
|
this.dataList = [];
|
2021-10-22 03:07:32 +00:00
|
|
|
|
this.activeJF = flag;
|
2021-11-02 10:23:53 +00:00
|
|
|
|
this.page =1;
|
|
|
|
|
this.isZanw = true;
|
2021-10-22 03:07:32 +00:00
|
|
|
|
if(flag) {
|
2021-11-02 10:23:53 +00:00
|
|
|
|
this.ntype ='in';
|
|
|
|
|
this.checkList(this.ntype);
|
2021-10-22 03:07:32 +00:00
|
|
|
|
} else {
|
2021-11-02 10:23:53 +00:00
|
|
|
|
this.ntype ='out';
|
|
|
|
|
this.checkList(this.ntype);
|
2021-10-22 03:07:32 +00:00
|
|
|
|
}
|
2021-11-02 10:23:53 +00:00
|
|
|
|
},
|
2021-10-22 03:07:32 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2021-11-02 10:23:53 +00:00
|
|
|
|
</script>
|