diff --git a/src/api/index.ts b/src/api/index.ts index 72d5d0c..cdfd7b6 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -98,9 +98,10 @@ interface Teacherliked { interest: string; } -export async function getteacherliked(){ - const res = await get>('teacherliked'); - console.log(res) +export async function getteacherliked(data?:any){ + const res = await get>('teacherliked',data); + // console.log(res) + return res.data } @@ -303,10 +304,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('withdrawal',data); if(res.code==0){ message.success("新增成功") + }else{ + message.error(res.msg) } } /** @@ -355,6 +373,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('account/'+data) + // console.log(res) + return res.data +} + /** * 发送验证码 * @param phone 手机号 diff --git a/src/views/mine/Cashout.vue b/src/views/mine/Cashout.vue index 05e92c6..2f9a6bd 100644 --- a/src/views/mine/Cashout.vue +++ b/src/views/mine/Cashout.vue @@ -9,7 +9,7 @@
提现到指定账户
- 余额:¥50 + 余额:{{yue}}
提现到指定账户
提现记录
@@ -97,7 +97,7 @@
注:每笔提现收取0.1%服务费,最低¥0.1
-
*您的余额只有¥{{yue}},最低提现金额¥100
+
*您的余额只有{{parseFloat(yue)}},最低提现金额¥100
立即提现
@@ -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(105) + // const yue=ref(store.state.userinfo.money) + const yue=ref(10000) + // yue.value=store.state.userinfo.money const accountlist =ref>([]) 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 }; }, }); diff --git a/src/views/mine/Transactiondetail.vue b/src/views/mine/Transactiondetail.vue index e7ee32b..9c5544b 100644 --- a/src/views/mine/Transactiondetail.vue +++ b/src/views/mine/Transactiondetail.vue @@ -6,38 +6,41 @@ Application List An Application -
-
-
交易明细详情
-
-
-
-
金额
-
¥30.00
+
+
+
交易明细详情
+
+
+
金额
+
{{accountinfo.money}}
+
-
-
类型
-
收入
-
+
+
类型
+
直播收入
+
提现
+
后台充值
-
-
流水号
-
126545654561656515616256565646556
-
+
-
-
日期
-
2020-08-17 14:23:20
-
+
+
流水号
+
{{accountinfo.sn}}
+
-
-
来源
-
直播收益—英语三级A1教学
+
+
日期
+
{{accountinfo.created_at}}
+
+ +
+
来源
+
直播收益—英语三级A1教学
+
+ +
返回
- -
返回
-
@@ -45,17 +48,22 @@