123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <template>
- <view class="financial">
- <view class="financial-box">
- <view class="drawable-price">
- <text>可提现余额(元)</text>
- <text>{{ financialData.withdrawableMoney || "0" }}</text>
- </view>
- <view class="detailed" @click="navigateTo(`/pages_module/withdrawal/index`)">查看明细</view>
- </view>
- <view class="financial-price">
- <view class="price-title">基本数据</view>
- <view class="price-list">
- <view
- class="price-item"
- v-for="(item, index) in detailedList"
- :key="index"
- >
- <text>{{ item.title }}</text>
- <text>{{ financialData[item.name] || "0" }}</text>
- </view>
- <!-- 占位盒子 -->
- <view class="price-item hide"></view>
- </view>
- </view>
- <view class="financial-price">
- <view class="price-title">消费金相关</view>
- <view class="price-list">
- <view
- class="price-item"
- v-for="(item, index) in voucherList"
- :key="index"
- >
- <text>{{ item.title }}</text>
- <text>{{ financialData[item.name] || "0" }}</text>
- </view>
- <!-- 占位盒子 -->
- <view class="price-item hide"></view>
- </view>
- </view>
- <view class="water">
- <view class="water-title">流水</view>
- <view class="water-box">
- <view class="water-header">
- <view
- class="header-item"
- :class="idx == 1 ? 'active' : ''"
- @click="changeIdx(1)"
- >日流水</view
- >
- <view
- class="header-item"
- :class="idx == 2 ? 'active' : ''"
- @click="changeIdx(2)"
- >月流水</view
- >
- </view>
- <WaterContainer :type="idx" :financialData="financialData"></WaterContainer>
- </view>
- </view>
- </view>
- </template>
- <script>
- import { getFinancial } from "@/config/index";
- import { detailedList, voucherList } from "./data";
- import WaterContainer from "../components/waterContainer/index"
- export default {
- onShow(){
- this.getFinancialData();
- },
- components:{
- WaterContainer
- },
- data() {
- return {
- // 静态数据
- detailedList: detailedList,
- voucherList: voucherList,
- // 动态数据
- // 切换日数据 以及 月数据
- idx: 1,
- financialData: {},
- queryData: {
- condition: "1",
- time: "",
- paymentMode:""
- },
- };
- },
- methods: {
- // 获取 总 数据
- async getFinancialData() {
- try {
- this.$loading.show("统计中...");
- const res = await getFinancial(this.queryData);
- this.financialData = res.data;
- // console.log(this.financialData);
- } finally {
- this.$loading.hide();
- }
- },
- // 控制激活态
- changeIdx(val) {
- this.idx = val;
- this.queryData.condition = val
- // 重新获取总数据
- this.getFinancialData()
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- @import "./index.scss";
- </style>
|