|
@@ -3,7 +3,7 @@
|
|
|
<ul class="wallet-list flex-between">
|
|
<ul class="wallet-list flex-between">
|
|
|
<li class="gradient flex-center-between" v-for="(item, index) in 2" :key="index">
|
|
<li class="gradient flex-center-between" v-for="(item, index) in 2" :key="index">
|
|
|
<div class="wallet-list-li-left">
|
|
<div class="wallet-list-li-left">
|
|
|
- <div class="">{{ index == 0 ? $t('common.mibi') : $t('common.baomibi') }}{{ $t('personalCenter.yue') }}</div>
|
|
|
|
|
|
|
+ <div class="">{{ index == 0 ? $t('common.mibi') : $t('common.baomibi') }} {{ $t('personalCenter.yue') }}</div>
|
|
|
<div class="">{{ index == 0 ? userInfo.pointsBalance || 0 || 0 : userInfo.baoMiBalance || 0 }}</div>
|
|
<div class="">{{ index == 0 ? userInfo.pointsBalance || 0 || 0 : userInfo.baoMiBalance || 0 }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="wallet-list-li-right flex-align-center">
|
|
<div class="wallet-list-li-right flex-align-center">
|
|
@@ -19,19 +19,20 @@
|
|
|
</div>
|
|
</div>
|
|
|
</li>
|
|
</li>
|
|
|
</ul>
|
|
</ul>
|
|
|
- <el-tabs v-model="form.activeName" class="demo-tabs" @tab-click="handleClick">
|
|
|
|
|
|
|
+ <el-tabs v-model="form.changeType" class="demo-tabs" @tab-click="handleClick">
|
|
|
<el-tab-pane :label="$t(tab.label)" v-for="tab in tabs" :key="tab.name" :name="tab.name">
|
|
<el-tab-pane :label="$t(tab.label)" v-for="tab in tabs" :key="tab.name" :name="tab.name">
|
|
|
<div class="tabs flex-align-center">
|
|
<div class="tabs flex-align-center">
|
|
|
- <div :class="{ active: index == 0 }" class="tab" v-for="(item, index) in 2">{{ index == 0 ? '米币' : '暴米币' }}明细
|
|
|
|
|
|
|
+ <div @click="changeType(index)" :class="{ active: index + 1 == form.balanceType }" class="tab" v-for="(item, index) in 2">{{
|
|
|
|
|
+ index == 0 ? $t('common.mibi') : $t('common.baomibi') }}{{ $t('personalCenter.details') }}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<ul class="wallet-page-list">
|
|
<ul class="wallet-page-list">
|
|
|
<li v-for="(item, index) in list" :key="index">
|
|
<li v-for="(item, index) in list" :key="index">
|
|
|
<div class="title">
|
|
<div class="title">
|
|
|
- <div class="">订单米币</div>
|
|
|
|
|
- <div class="">2024-08-24 14:11:11</div>
|
|
|
|
|
|
|
+ <div class="">{{ item.bizTypeName }}</div>
|
|
|
|
|
+ <div class="">{{ item.createTime }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="price">+1000</div>
|
|
|
|
|
|
|
+ <div class="price">{{ form.changeType == 1 ? '+' : '' }}{{ item.balanceChange }}</div>
|
|
|
</li>
|
|
</li>
|
|
|
</ul>
|
|
</ul>
|
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
@@ -44,12 +45,12 @@
|
|
|
|
|
|
|
|
<el-dialog v-model="dialogVisible"
|
|
<el-dialog v-model="dialogVisible"
|
|
|
:title="`${transformationIndex == 0 ? $t('personalCenter.zhuanhuanbaomibi') : $t('personalCenter.zhuanghuanmibi')}`"
|
|
:title="`${transformationIndex == 0 ? $t('personalCenter.zhuanhuanbaomibi') : $t('personalCenter.zhuanghuanmibi')}`"
|
|
|
- width="523" :before-close="handleClose">
|
|
|
|
|
|
|
+ width="523">
|
|
|
<el-form :model="walletForm" label-width="auto" label-position="top">
|
|
<el-form :model="walletForm" label-width="auto" label-position="top">
|
|
|
<el-row :gutter="16" v-if="transformationIndex">
|
|
<el-row :gutter="16" v-if="transformationIndex">
|
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
|
<el-form-item :label="$t('common.baomibi')">
|
|
<el-form-item :label="$t('common.baomibi')">
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
<el-input-number v-model="walletForm.orderAmt" :min="1" controls-position="right" size="large"
|
|
<el-input-number v-model="walletForm.orderAmt" :min="1" controls-position="right" size="large"
|
|
|
@change="handleChange" style="width: 100%;" />
|
|
@change="handleChange" style="width: 100%;" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -68,8 +69,8 @@
|
|
|
<el-row :gutter="16" v-else>
|
|
<el-row :gutter="16" v-else>
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
<el-form-item :label="$t('common.mibi')">
|
|
<el-form-item :label="$t('common.mibi')">
|
|
|
- <el-input-number v-model="walletForm.orderAmt" :min="configTxt.configValue" :step="configTxt.configValue" controls-position="right" size="large"
|
|
|
|
|
- @change="handleChange" style="width: 100%;" />
|
|
|
|
|
|
|
+ <el-input-number v-model="walletForm.orderAmt" :min="configTxt.configValue" :step="configTxt.configValue"
|
|
|
|
|
+ controls-position="right" size="large" @change="handleChange" style="width: 100%;" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
@@ -96,32 +97,39 @@
|
|
|
import { ref, onMounted } from 'vue'
|
|
import { ref, onMounted } from 'vue'
|
|
|
|
|
|
|
|
import type { TabsPaneContext } from 'element-plus'
|
|
import type { TabsPaneContext } from 'element-plus'
|
|
|
|
|
+
|
|
|
import Pagination from '@/components/Pagination.vue'
|
|
import Pagination from '@/components/Pagination.vue'
|
|
|
|
|
+
|
|
|
import { getUserInfo } from '@/api/auth'
|
|
import { getUserInfo } from '@/api/auth'
|
|
|
|
|
|
|
|
import { payConfigDearch, calRate } from '@/api/order'
|
|
import { payConfigDearch, calRate } from '@/api/order'
|
|
|
|
|
+
|
|
|
|
|
+import { recordList } from '@/api/my'
|
|
|
|
|
+
|
|
|
import { createOrder } from '@/api/order.js'
|
|
import { createOrder } from '@/api/order.js'
|
|
|
|
|
|
|
|
import { useAppStore } from '@/pinia/appStore'
|
|
import { useAppStore } from '@/pinia/appStore'
|
|
|
|
|
|
|
|
import DGTMessage from '@/utils/message'
|
|
import DGTMessage from '@/utils/message'
|
|
|
|
|
|
|
|
-import { useI18n } from 'vue-i18n'
|
|
|
|
|
|
|
+import { useI18n } from 'vue-i18n'
|
|
|
|
|
|
|
|
-const { t } = useI18n()
|
|
|
|
|
|
|
+const { t } = useI18n()
|
|
|
|
|
|
|
|
const appStore = useAppStore();
|
|
const appStore = useAppStore();
|
|
|
|
|
|
|
|
const tabs = ref([
|
|
const tabs = ref([
|
|
|
- { label: 'personalCenter.incomeDetails', name: 0 },
|
|
|
|
|
- { label: 'personalCenter.usageRecord', name: 1 }
|
|
|
|
|
|
|
+ { label: 'personalCenter.incomeDetails', name: 1 },
|
|
|
|
|
+ { label: 'personalCenter.usageRecord', name: 2 }
|
|
|
])
|
|
])
|
|
|
const list = ref([])
|
|
const list = ref([])
|
|
|
|
|
+
|
|
|
const form = ref({
|
|
const form = ref({
|
|
|
- activeName: 0,
|
|
|
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
|
total: 0,
|
|
total: 0,
|
|
|
|
|
+ balanceType: 1,//1-米币 2-暴米币
|
|
|
|
|
+ changeType: 1,//1-增加 2-减少
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const walletForm = ref({
|
|
const walletForm = ref({
|
|
@@ -131,7 +139,7 @@ const walletForm = ref({
|
|
|
orderNum: null,
|
|
orderNum: null,
|
|
|
orderAmt: 1,
|
|
orderAmt: 1,
|
|
|
feeRate: 0,
|
|
feeRate: 0,
|
|
|
- targetAmount:0
|
|
|
|
|
|
|
+ targetAmount: 0
|
|
|
})
|
|
})
|
|
|
const configTxt = ref({})
|
|
const configTxt = ref({})
|
|
|
|
|
|
|
@@ -141,7 +149,7 @@ const dialogVisible = ref(false);
|
|
|
const transformationIndex = ref(0)
|
|
const transformationIndex = ref(0)
|
|
|
|
|
|
|
|
// 确认转换
|
|
// 确认转换
|
|
|
-const confirmTransformation = async () =>{
|
|
|
|
|
|
|
+const confirmTransformation = async () => {
|
|
|
let res = await createOrder({
|
|
let res = await createOrder({
|
|
|
payMethod: walletForm.value.payMethod,
|
|
payMethod: walletForm.value.payMethod,
|
|
|
orderType: walletForm.value.orderType,
|
|
orderType: walletForm.value.orderType,
|
|
@@ -154,46 +162,56 @@ const confirmTransformation = async () =>{
|
|
|
if (res.data.paySuccess) {
|
|
if (res.data.paySuccess) {
|
|
|
dialogVisible.value = false;
|
|
dialogVisible.value = false;
|
|
|
appStore.USERINFO();
|
|
appStore.USERINFO();
|
|
|
- DGTMessage.success(` ${ transformationIndex.value ? t('common.zhuanhuanbaomibi') : t('common.zhuanghuanmibi')}${t('common.success')}`)
|
|
|
|
|
|
|
+ DGTMessage.success(` ${transformationIndex.value ? t('common.zhuanhuanbaomibi') : t('common.zhuanghuanmibi')}${t('common.success')}`)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 米币暴米币转换
|
|
// 米币暴米币转换
|
|
|
-const changeTransformation = async (index:any) => {
|
|
|
|
|
|
|
+const changeTransformation = async (index: any) => {
|
|
|
transformationIndex.value = index;
|
|
transformationIndex.value = index;
|
|
|
walletForm.value.payMethod = index ? 'BMI' : 'MI';
|
|
walletForm.value.payMethod = index ? 'BMI' : 'MI';
|
|
|
walletForm.value.orderType = index ? 'exchange_mi' : 'exchange_bmi';
|
|
walletForm.value.orderType = index ? 'exchange_mi' : 'exchange_bmi';
|
|
|
let { data } = await payConfigDearch({ id: '03' });
|
|
let { data } = await payConfigDearch({ id: '03' });
|
|
|
|
|
|
|
|
- let result = data.filter((item:any) => item.configCode == 'bmb_to_mb_rate')
|
|
|
|
|
|
|
+ let result = data.filter((item: any) => item.configCode == 'bmb_to_mb_rate')
|
|
|
if (result.length) {
|
|
if (result.length) {
|
|
|
configTxt.value = result[0]
|
|
configTxt.value = result[0]
|
|
|
}
|
|
}
|
|
|
- walletForm.value.orderAmt = index == 0 ? configTxt.value.configValue : 1
|
|
|
|
|
|
|
+ walletForm.value.orderAmt = index == 0 ? configTxt.value.configValue : 1
|
|
|
handleChange()
|
|
handleChange()
|
|
|
dialogVisible.value = true;
|
|
dialogVisible.value = true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const handleChange = async () => {
|
|
const handleChange = async () => {
|
|
|
let res = await calRate({
|
|
let res = await calRate({
|
|
|
- orderType:walletForm.value.orderType,
|
|
|
|
|
- orderNum:walletForm.value.orderAmt
|
|
|
|
|
|
|
+ orderType: walletForm.value.orderType,
|
|
|
|
|
+ orderNum: walletForm.value.orderAmt
|
|
|
});
|
|
});
|
|
|
walletForm.value.feeRate = res.data.feeRate
|
|
walletForm.value.feeRate = res.data.feeRate
|
|
|
walletForm.value.targetAmount = res.data.targetAmount
|
|
walletForm.value.targetAmount = res.data.targetAmount
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
console.log(res);
|
|
console.log(res);
|
|
|
}
|
|
}
|
|
|
|
|
+// 米币暴米币切换
|
|
|
|
|
+const changeType = (index) => {
|
|
|
|
|
+ list.value = []
|
|
|
|
|
+ form.value.pageNum = 1;
|
|
|
|
|
+ form.value.balanceType = index + 1;
|
|
|
|
|
+ getList()
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
const handleClick = (tab: TabsPaneContext) => {
|
|
const handleClick = (tab: TabsPaneContext) => {
|
|
|
list.value = []
|
|
list.value = []
|
|
|
form.value.pageNum = 1;
|
|
form.value.pageNum = 1;
|
|
|
- form.value.activeName = tab.props.name;
|
|
|
|
|
|
|
+ form.value.changeType = tab.props.name;
|
|
|
getList()
|
|
getList()
|
|
|
}
|
|
}
|
|
|
const getList = async () => {
|
|
const getList = async () => {
|
|
|
-
|
|
|
|
|
|
|
+ let res = await await recordList(form.value);
|
|
|
|
|
+ console.log(res.rows)
|
|
|
|
|
+ list.value = res.rows;
|
|
|
|
|
+ form.value.total = res.total;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const handlePageChange = (newPage: number) => {
|
|
const handlePageChange = (newPage: number) => {
|