订阅者

This commit is contained in:
asd 2020-10-16 14:31:39 +08:00
parent 9a6eeff200
commit 3f1085f664
5 changed files with 147 additions and 268 deletions

View File

@ -98,9 +98,10 @@ interface Teacherliked {
interest: string;
}
export async function getteacherliked(){
const res = await get<Array<Teacherliked>>('teacherliked');
console.log(res)
export async function getteacherliked(data?:any){
const res = await get<Array<Teacherliked>>('teacherliked',data);
// console.log(res)
return res.data
}
@ -294,10 +295,27 @@ export async function saleinfo(data?:any){
/**
*
*/
export async function cashout(data?:any){
export async function cashout(data?:any,accountinfo?:any){
// data.type=data.typeid?data.typeid:0
// if(data.type!=0){
// delete data.typeid
// }
data.type=accountinfo.type
console.log(data,'tixian')
console.log(accountinfo)
data.account=accountinfo.account
data.bankcode=accountinfo.bankcode
data.bankname=accountinfo.bankname
data.mname=accountinfo.mname
console.log(data)
const res = await post<Liveaddrule>('withdrawal',data);
if(res.code==0){
message.success("新增成功")
}else{
message.error(res.msg)
}
}
/**
@ -346,6 +364,30 @@ export async function deleteaccount(data:any) {
console.log(res)
}
/**
*
*
*/
interface TransactionInfo{
accountid:number,
memberid:number,
sn:string,
type:number,
typename:string,
money:number,
source:number,
remark:string,
deleted_at:any,
created_at:string,
updated_at:string
}
export async function transactioninfo(data?: any){
const res = await get<TransactionInfo>('account/'+data)
// console.log(res)
return res.data
}
/**
*
* @param phone

View File

@ -9,7 +9,7 @@
<div class="mingxilist">
<div class="tabs">
<div class="beforetab">提现到指定账户</div>
<span class="residue">余额50</span>
<span class="residue">余额{{yue}}</span>
<div class="topbtn topbtn2">提现到指定账户</div>
<div class="topbtn topbtn1">提现记录</div>
</div>
@ -97,7 +97,7 @@
<div class="desc">每笔提现收取0.1%服务费最低0.1</div>
</div>
</div>
<div class="ale">*您的余额只有{{yue}}最低提现金额100</div>
<div class="ale" v-if="payinfo.money<100 || payinfo.money>parseFloat(yue)">*您的余额只有{{parseFloat(yue)}}最低提现金额100</div>
</div>
<div class="cashoutall submit" @click="sub">立即提现</div>
<NavBottom class="navbottom"></NavBottom>
@ -109,6 +109,7 @@
import { defineComponent, onMounted, ref, toRaw } from "vue";
import NavBottom from "@/components/NavBottom.vue";
import { cashout, getwallect } from '@/api';
import store from '@/store';
export default defineComponent({
name: "Cashout",
components: {
@ -124,13 +125,14 @@ export default defineComponent({
bankcode:"",
bankname:"",
international:0,
typeid:0
})
const moneychange: (e: number) => void = (e: number) => {
console.log(e);
};
const yue=ref<number>(105)
// const yue=ref<string>(store.state.userinfo.money)
const yue=ref<number>(10000)
// yue.value=store.state.userinfo.money
const accountlist =ref<Array<any>>([])
onMounted(async () => {
@ -139,7 +141,7 @@ export default defineComponent({
function onChange(e: any) {
console.log(e.target.value);
payinfo.value.type=e.target.value
payinfo.value.typeid=toRaw(accountlist.value)[e.target.value].wallectid
// payinfo.value.typeid=toRaw(accountlist.value)[e.target.value].wallectid
// payinfo.value.type=toRaw(accountlist.value)[e.target.value].wallectid
}
function all(){
@ -147,7 +149,9 @@ export default defineComponent({
}
function sub(){
console.log(toRaw(payinfo.value))
// cashout(toRaw(payinfo.value))
console.log(toRaw(payinfo.value))
payinfo.value.money=Number(payinfo.value.money)
cashout(toRaw(payinfo.value),toRaw(accountlist.value)[payinfo.value.type])
}
return {
@ -158,7 +162,8 @@ export default defineComponent({
all,
yue,
sub,
accountlist
accountlist,
store
};
},
});

View File

@ -13,22 +13,25 @@
<div class="detail">
<div class="infoitem">
<div class="left">金额</div>
<div class="right">30.00</div>
<div class="right">{{accountinfo.money}}</div>
</div>
<div class="infoitem">
<div class="left">类型</div>
<div class="right">收入</div>
<div class="right" v-if="accountinfo.type==1">直播收入</div>
<div class="right" v-if="accountinfo.type==2">提现</div>
<div class="right" v-if="accountinfo.type==3">后台充值</div>
</div>
<div class="infoitem">
<div class="left">流水号</div>
<div class="right">126545654561656515616256565646556</div>
<div class="right">{{accountinfo.sn}}</div>
</div>
<div class="infoitem">
<div class="left">日期</div>
<div class="right">2020-08-17 14:23:20</div>
<div class="right">{{accountinfo.created_at}}</div>
</div>
<div class="infoitem">
@ -45,17 +48,22 @@
</template>
<script lang="ts">
import { defineComponent } from "vue";
import { defineComponent, onMounted, ref } from "vue";
import NavBottom from "@/components/NavBottom.vue";
import { transactioninfo } from '@/api';
import { useRoute } from 'vue-router';
export default defineComponent({
name: "Transactiondetail",
components: {
NavBottom
},
setup() {
const accountinfo=ref<any>({})
onMounted(async () => {
accountinfo.value=await transactioninfo(useRoute().query.id)
})
return {
accountinfo
};
},
});

View File

@ -20,7 +20,7 @@
<img src="@/static/images/account.png" alt="" class="pic" />
<div class="texts">
<div>绑定用户</div>
<div class="num">3</div>
<div class="num">{{accountlist.length}}</div>
</div>
</div>
<div class="linecolumn"></div>
@ -31,8 +31,12 @@
<div class="num">
<span class="moneyicon" v-if="ifchina"></span>
<span class="moneyicon" v-else> $ </span>
880
<span class="float">.00</span>
<!-- {{store.state.userinfo.moneyValue}} -->
<!-- {{store.state.userinfo.money.split('.')[0]}}
<span class="float">{{store.state.userinfo.money.split('.')[1]?'.'+store.state.userinfo.money.split('.')[1]:''}}</span> -->
<!-- <span class="float">{{'$0'.split('.')}}</span> -->
</div>
</div>
</div>
@ -185,7 +189,7 @@
<td>{{i.typename}}</td>
<td class="moneyadd moneyreverse" v-if="i.type==2">-{{i.money}}</td>
<td class="moneyadd " v-else>+{{i.money}}</td>
<td>查看详情</td>
<td @click="navto(3,i.accountid)">查看详情{{i.accountid}}</td>
</tr>
</tbody>
@ -200,6 +204,7 @@
import { defineComponent, onMounted, ref, toRaw } from "vue";
import NavBottom from "@/components/NavBottom.vue";
import router from "@/router";
import store from '@/store';
import { deleteaccount, getwallect, saleinfo } from "@/api";
export default defineComponent({
name: "Wallet",
@ -218,6 +223,7 @@ export default defineComponent({
salelist.value = await saleinfo();
accountlist.value=await getwallect();
console.log(store.state.userinfo)
});
const tabindex = ref(0);
async function tabchange(e: number): Promise<void> {
@ -249,6 +255,8 @@ export default defineComponent({
case 2:
url = "/mine/cashout";
break;
case 3:
url = "/mine/transactionxq"
}
if(id){
router.push({
@ -274,7 +282,8 @@ export default defineComponent({
listindex,
onChange,
dates,
del
del,
store
};
},
});

View File

@ -4,255 +4,53 @@
<div class="title">我的订阅者56</div>
<div class="sel">
<img src="@/static/images/sousuo.png" alt="" class="icon" />
<input type="text" placeholder="请输入想要搜索的学生姓名" />
<input type="text" placeholder="请输入想要搜索的学生姓名" v-model="condition.title" @keyup.enter="search(condition)"/>
</div>
</div>
<div class="mid">
<!-- {{teacherlikedlist}} -->
<div class="studentlist">
<div class="stuitem">
<img src="" alt="" class="photo" />
<div class="stuitem" v-for="(i,j) in teacherlikedlist" :key="j">
<img :src="i.img" alt="" class="photo" />
<div>
<div class="info">
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
<span>{{i.name}}</span>
</div>
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
<span class="label">所在国家:</span>
<span>{{i.live}}</span>
</div>
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
<span class="label">年龄:</span>
<span>{{i.age}}</span>
</div>
</div>
<div class="info">
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
<span class="label">学生母语:</span>
<span>{{i.mtongue }}</span>
</div>
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
<span class="label">兴趣点:</span>
<span>{{interest}}</span>
</div>
<div class="infoitem">
<span class="label">姓名:</span>
<span class="label">语言等级:</span>
<span>asd</span>
</div>
<div>参加平台直播课程总时长<span class="time">350min</span></div>
</div>
</div>
</div>
<div class="stuitem">
<img src="" alt="" class="photo" />
<div>
<div class="info">
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
</div>
<div class="info">
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
<div>参加平台直播课程总时长<span class="time">350min</span></div>
<div>参加平台直播课程总时长<span class="time">{{i.longtime}}min</span></div>
</div>
</div>
</div>
<div class="stuitem">
<img src="" alt="" class="photo" />
<div>
<div class="info">
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
</div>
<div class="info">
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
<div>参加平台直播课程总时长<span class="time">350min</span></div>
</div>
</div>
</div>
<div class="stuitem">
<img src="" alt="" class="photo" />
<div>
<div class="info">
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
</div>
<div class="info">
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
<div>参加平台直播课程总时长<span class="time">350min</span></div>
</div>
</div>
</div>
<div class="stuitem">
<img src="" alt="" class="photo" />
<div>
<div class="info">
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
</div>
<div class="info">
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
<div>参加平台直播课程总时长<span class="time">350min</span></div>
</div>
</div>
</div>
<div class="stuitem">
<img src="" alt="" class="photo" />
<div>
<div class="info">
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
</div>
<div class="info">
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
<div class="infoitem">
<span class="label">姓名:</span>
<span>asd</span>
</div>
<div>参加平台直播课程总时长<span class="time">350min</span></div>
</div>
</div>
</div>
</div>
</div>
<div class="pages">
@ -286,19 +84,21 @@
font-weight: bold;
}
.sel {
width: 171px;
// width: 171px;
height: 26px;
border: 1px solid #999;
display: flex;
align-items: center;
// padding: 8px;
border-radius: 4px;
padding-right:30px;
> img {
width: 11px;
height: 11px;
margin-left:5px
}
> input {
width: 119px;
width: 170px;
font-size: 9px;
line-height: 1;
margin-left: 6px;
@ -362,15 +162,30 @@
</style>
<script lang="ts">
import { getteacherliked } from '@/api';
import { defineComponent, ref } from "vue";
import { defineComponent, onMounted, ref } from "vue";
export default defineComponent({
name: "Subscriber",
components: {},
setup() {
const page = ref(6);
getteacherliked()
const page = ref(1);
const teacherlikedlist =ref<Array<any>>([]);
const title=ref('')
const condition = ref<any>({
title:""
})
onMounted(async () => {
teacherlikedlist.value=await getteacherliked()
});
async function search(e:any){
teacherlikedlist.value=await getteacherliked(e)
}
return {
page,
teacherlikedlist,
condition,
title,
search
};
},
});