123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- <template>
- <div class="userCenterGrowthRecord">
- <div class="search">
- <span>{{ $i18n.locale === "zh" ? "成长值记录" : "Growth Record" }}</span>
- </div>
- <div class="list">
- <el-table
- :data="userTaskComplete"
- v-loading="loading"
- style="width: 100%"
- :header-cell-style="{ backgroundColor: '#f8f8f8' }"
- >
- <el-table-column
- align="center"
- :label="$i18n.locale === 'zh' ? '来源名称' : 'Source Title'"
- min-width="230"
- >
- <template slot-scope="scope">
- <span>{{ $i18n.locale == "zh" ? "获取" : "Gain" }}</span>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- :label="
- $i18n.locale === 'zh' ? '成长值(分)' : 'Growth Value (Points)'
- "
- width="200"
- >
- <template slot-scope="scope">
- <span style="color: #d61016">+</span>
- <span style="color: #d61016">{{ scope.row.growth }}</span>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- :label="$i18n.locale === 'zh' ? '日期' : 'Date'"
- min-width="130"
- >
- <template slot-scope="scope">
- <span>{{
- scope.row.createDate | time("YYYY-MM-DD ")
- }}</span>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- :label="$i18n.locale === 'zh' ? '时间' : 'Time'"
- min-width="130"
- >
- <template slot-scope="scope">
- <span>{{
- scope.row.createDate | time(" HH:mm:ss")
- }}</span>
- </template>
- </el-table-column>
- <el-table-column
- :prop="$i18n.locale==='zh'?'title':'titleEn'"
- align="center"
- :label="$i18n.locale === 'zh' ? '备注' : 'Remark'"
- min-width="230"
- >
- </el-table-column>
- </el-table>
- <el-pagination
- background
- @size-change="
- (val) => {
- page.pageSize = val;
- }
- "
- @current-change="
- (val) => {
- page.pageNo = val;
- }
- "
- layout="prev, pager, next, sizes, jumper"
- :total="page.total"
- :current-page="page.pageNo"
- :page-sizes="[10, 20, 50, 100]"
- :page-size="page.pageSize"
- style="text-align: center; margin-top: 20px"
- >
- </el-pagination>
- </div>
- </div>
- </template>
- <script>
- import moment from "moment";
- import { getUserGrowthDetails, getUserPointDetailsPage } from "@/api/user";
- export default {
- name: "userCenterGrowthRecord",
- data() {
- return {
- loading: false,
- params: {
- search1: "全部",
- },
- page: {
- pageNo: 1,
- pageSize: 10,
- total: 3,
- },
- userTaskComplete: [],
- };
- },
- filters: {
- time(date, type) {
- return moment(date).format(type);
- },
- },
- watch: {
- page: {
- handler: function () {
- this.loading = true;
- this.getUserGrowthDetailPage();
- },
- deep: true,
- },
- params: {
- handler: function () {
- this.loading = true;
- this.getUserGrowthDetailPage();
- },
- deep: true,
- },
- },
- mounted() {
- this.init();
- },
- methods: {
- init() {
- this.getUserGrowthDetailPage();
- },
- getUserGrowthDetailPage() {
- let param = {
- pageSize: this.page.pageSize,
- pageNo: this.page.pageNo,
- userId: JSON.parse(window.localStorage.getItem("user")).userId,
- };
- getUserGrowthDetails(param)
- .then((res) => {
- if (res) {
- this.userTaskComplete = res.data.umsUserGrowthDetailss;
- this.page.total = Number(res.data.page.totalCount);
- }
- })
- .then(() => {
- this.loading = false;
- })
- .catch(() => {
- this.loading = false;
- });
- },
- },
- };
- </script>
- <style scoped lang="less">
- .userCenterGrowthRecord {
- background-color: #fff;
- min-height: 700px;
- .search {
- font-size: 14px;
- font-weight: 600;
- height: 70px;
- line-height: 70px;
- span {
- cursor: pointer;
- margin: 0 30px;
- &.active {
- color: #60aae3;
- }
- }
- }
- .list {
- width: 100%;
- padding: 0 18px 18px 18px;
- box-sizing: border-box;
- }
- }
- </style>
|