|
@@ -0,0 +1,169 @@
|
|
|
|
+<template>
|
|
|
|
+ <div id="card-1">
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="24" class="main">
|
|
|
|
+ <el-col :span="24" style="margin: 0 0 10px 0">
|
|
|
|
+ <el-col :span="2"><el-button type="primary" size="mini" @click="toBack()">返回</el-button></el-col>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24" class="one">
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ <p>
|
|
|
|
+ 账户余额:<span>{{ info.total }}</span
|
|
|
|
+ >元
|
|
|
|
+ </p>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ 可提现金额:<span style="color: red">{{ info.canGet }}</span
|
|
|
|
+ >元
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24" class="two">
|
|
|
|
+ <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @view="toView">
|
|
|
|
+ <template #money="{ row }">
|
|
|
|
+ <span v-if="row.status == '-1'" style="color: red; cursor: pointer"> -{{ row.money }} </span>
|
|
|
|
+ <span v-else-if="row.status == '0'" style="color: green"> +{{ row.money }} </span>
|
|
|
|
+ </template>
|
|
|
|
+ </data-table>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+<script>
|
|
|
|
+const _ = require('lodash');
|
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
|
+const { mapActions } = createNamespacedHelpers('cashBack');
|
|
|
|
+const { mapActions: dictData } = createNamespacedHelpers('dictData');
|
|
|
|
+export default {
|
|
|
|
+ name: 'card-1',
|
|
|
|
+ props: {},
|
|
|
|
+ components: {},
|
|
|
|
+ data: function () {
|
|
|
|
+ return {
|
|
|
|
+ // 账户余额
|
|
|
|
+ info: {},
|
|
|
|
+ // 账户流水
|
|
|
|
+ list: [],
|
|
|
|
+ // 来源列表
|
|
|
|
+ sourceList: [],
|
|
|
|
+ // 状态列表
|
|
|
|
+ statusList: [],
|
|
|
|
+ // 列表
|
|
|
|
+ opera: [{ label: '查看', method: 'view' }],
|
|
|
|
+ fields: [
|
|
|
|
+ {
|
|
|
|
+ label: '来源',
|
|
|
|
+ model: 'source',
|
|
|
|
+ format: (i) => {
|
|
|
|
+ let data = this.sourceList.find((f) => f.value == i);
|
|
|
|
+ if (data) return data.label;
|
|
|
|
+ else return '暂无';
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ { label: '来源id', model: 'source_id' },
|
|
|
|
+ { label: '返现金额', model: 'money', custom: true },
|
|
|
|
+ {
|
|
|
|
+ label: '状态',
|
|
|
|
+ model: 'status',
|
|
|
|
+ format: (i) => {
|
|
|
|
+ let data = this.statusList.find((f) => f.value == i);
|
|
|
|
+ if (data) return data.label;
|
|
|
|
+ else return '暂无';
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ { label: '返现时间', model: 'time' },
|
|
|
|
+ ],
|
|
|
|
+ canGet: 0,
|
|
|
|
+ total: 0,
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ async created() {
|
|
|
|
+ await this.searchOther();
|
|
|
|
+ await this.search();
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ ...mapActions(['query', 'fetch', 'create', 'update', 'delete', 'computedTotal']),
|
|
|
|
+ ...dictData({ dictQuery: 'query' }),
|
|
|
|
+ // 查询
|
|
|
|
+ async search({ skip = 0, limit = this.$limit, ...info } = {}) {
|
|
|
|
+ info.inviter = this.id;
|
|
|
|
+ let arr = await this.computedTotal({ customer: this.id });
|
|
|
|
+ if (this.$checkRes(arr)) {
|
|
|
|
+ this.$set(this, `info`, arr.data);
|
|
|
|
+ }
|
|
|
|
+ let res = await this.query({ skip, limit, ...info });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
|
+ this.$set(this, `total`, res.total);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 查看来源
|
|
|
|
+ toView({ data }) {
|
|
|
|
+ if (data.source == '2') {
|
|
|
|
+ this.$router.push({ path: `/platGroup/order`, query: { source_id: data.source_id } });
|
|
|
|
+ } else if (data.source == '0' || data.source == '3') {
|
|
|
|
+ this.$router.push({ path: `/platmanag/order`, query: { source_id: data.source_id } });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 查询其他信息
|
|
|
|
+ async searchOther() {
|
|
|
|
+ let res;
|
|
|
|
+ res = await this.dictQuery({ code: 'cashBack_source' });
|
|
|
|
+ if (this.$checkRes(res)) this.$set(this, `sourceList`, res.data);
|
|
|
|
+ res = await this.dictQuery({ code: 'cashBack_status' });
|
|
|
|
+ if (this.$checkRes(res)) this.$set(this, `statusList`, res.data);
|
|
|
|
+ },
|
|
|
|
+ // 返回
|
|
|
|
+ toBack() {
|
|
|
|
+ window.history.go('-1');
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ ...mapState(['user']),
|
|
|
|
+ id() {
|
|
|
|
+ return this.$route.query.id;
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ metaInfo() {
|
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
|
+ },
|
|
|
|
+ watch: {
|
|
|
|
+ test: {
|
|
|
|
+ deep: true,
|
|
|
|
+ immediate: true,
|
|
|
|
+ handler(val) {},
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="less" scoped>
|
|
|
|
+.main {
|
|
|
|
+ text-align: center;
|
|
|
|
+}
|
|
|
|
+.one {
|
|
|
|
+ margin: 0 0 10px 0;
|
|
|
|
+ p {
|
|
|
|
+ font-size: 24px;
|
|
|
|
+ font-weight: 700;
|
|
|
|
+ span {
|
|
|
|
+ color: red;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+.two {
|
|
|
|
+ span {
|
|
|
|
+ color: red;
|
|
|
|
+ }
|
|
|
|
+ .sp1 {
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ font-weight: 500;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+.title {
|
|
|
|
+ text-align: center;
|
|
|
|
+}
|
|
|
|
+.el-col {
|
|
|
|
+ margin: 10px 0;
|
|
|
|
+}
|
|
|
|
+</style>
|