Handy_Cao 3 tháng trước cách đây
mục cha
commit
397ff06b1a

+ 3 - 3
public/config/router.json

@@ -283,21 +283,21 @@
             {
                 "authType": 2,
                 "sort": 8,
-                "title": "积分信息",
+                "title": "pcroute.bottom.bottom_points",
                 "code": "bottom_points",
                 "component": "views/footer/index.vue",
                 "children": [
                     {
                         "authType": 2,
                         "sort": 1,
-                        "title": "我的积分",
+                        "title": "pcroute.bottom.bottom_minepoints",
                         "code": "bottom_points_account",
                         "component": "views/footer/points/account/index.vue"
                     },
                     {
                         "authType": 2,
                         "sort": 2,
-                        "title": "积分明细",
+                        "title": "pcroute.bottom.bottom_pointsdetail",
                         "code": "bottom_points_details",
                         "component": "views/footer/points/details/index.vue"
                     }

+ 4 - 1
public/locales/en-US.json

@@ -1686,7 +1686,10 @@
             "bottom_capital": "Fund information",
             "bottom_capital_summary": "Fund summary",
             "bottom_capital_statement": "Fund flow",
-            "bottom_capital_inoutapply": "Deposit and withdrawal details"
+            "bottom_capital_inoutapply": "Deposit and withdrawal details",
+            "bottom_points": "积分信息",
+            "bottom_minepoints": "我的积分",
+            "bottom_pointsdetail": "积分明细"
         },
         "market": {
             "title": "Market",

+ 4 - 1
public/locales/th-TH.json

@@ -1689,7 +1689,10 @@
             "bottom_capital": "ข้อมูลทางการเงิน",
             "bottom_capital_summary": "สรุปเงินทุน",
             "bottom_capital_statement": "กระแสเงินทุน",
-            "bottom_capital_inoutapply": "รายละเอียดการฝากและถอนเงิน"
+            "bottom_capital_inoutapply": "รายละเอียดการฝากและถอนเงิน",
+            "bottom_points": "积分信息",
+            "bottom_minepoints": "我的积分",
+            "bottom_pointsdetail": "积分明细"
         },
         "market": {
             "title": "ตลาดการค้า",

+ 4 - 1
public/locales/vi-VN.json

@@ -1686,7 +1686,10 @@
             "bottom_capital": "Thông tin ngân quỹ",
             "bottom_capital_summary": "Tổng hợp ngân quỹ",
             "bottom_capital_statement": "Dòng tiền",
-            "bottom_capital_inoutapply": "Chi tiết gửi/Rút tiền"
+            "bottom_capital_inoutapply": "Chi tiết gửi/Rút tiền",
+            "bottom_points": "积分信息",
+            "bottom_minepoints": "我的积分",
+            "bottom_pointsdetail": "积分明细"
         },
         "market": {
             "title": "Market",

+ 4 - 1
public/locales/zh-CN.json

@@ -1689,7 +1689,10 @@
             "bottom_capital": "资金信息",
             "bottom_capital_summary": "资金汇总",
             "bottom_capital_statement": "资金流水",
-            "bottom_capital_inoutapply": "出入金明细"
+            "bottom_capital_inoutapply": "出入金明细",
+            "bottom_points": "积分信息",
+            "bottom_minepoints": "我的积分",
+            "bottom_pointsdetail": "积分明细"
         },
         "market": {
             "title": "交易市场",

+ 4 - 1
public/locales/zh-TW.json

@@ -1689,7 +1689,10 @@
             "bottom_capital": "資金信息",
             "bottom_capital_summary": "資金彙總",
             "bottom_capital_statement": "資金流水",
-            "bottom_capital_inoutapply": "出入金明細"
+            "bottom_capital_inoutapply": "出入金明細",
+            "bottom_points": "积分信息",
+            "bottom_minepoints": "我的积分",
+            "bottom_pointsdetail": "积分明细"
         },
         "market": {
             "title": "交易市場",

+ 1 - 1
src/packages/mobile/router/index.ts

@@ -274,7 +274,7 @@ const routes: RouteRecordRaw[] = [
       {
         path: 'account',
         name: 'points-account',
-        component: () => import('../views/points/account/index.vue'),
+        component: () => import('../views/points/Index.vue'),
       }
     ]
   },

+ 39 - 0
src/packages/mobile/views/points/Index.vue

@@ -0,0 +1,39 @@
+<template>
+    <app-view>
+        <template #header>
+            <app-navbar title="积分信息" />
+        </template>
+        <Tabs class="van-tabs--list" v-model:active="active" :swipe-threshold="4">
+            <template v-for="(item, index) in components" :key="index">
+                <Tab :title="item.title" :name="index">
+                    <component :is="item.component" />
+                </Tab>
+            </template>
+        </Tabs>
+        <component ref="componentRef" :is="selectedComponent.history" @closed="closeComponent"
+            v-if="componentId && selectedComponent.history" />
+    </app-view>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, defineAsyncComponent } from 'vue'
+import { Tab, Tabs } from 'vant'
+import { i18n } from "@/stores"
+
+const { global: { t } } = i18n
+
+const components = [
+    {
+        name: 'score',
+        title: '我的积分',
+        component: defineAsyncComponent(() => import('./components/account/index.vue')),
+    },
+    {
+        name: 'scoredetail',
+        title: '积分明细',
+        component: defineAsyncComponent(() => import('./components/details/index.vue')),
+    },
+]
+
+const active = shallowRef(0)
+</script>

+ 0 - 10
src/packages/mobile/views/points/account/index.vue

@@ -1,10 +0,0 @@
-<template>
-    <app-view>
-        <template #header>
-            <app-navbar title="积分信息" />
-        </template>
-    </app-view>
-</template>
-
-<script lang="ts" setup>
-</script>

+ 34 - 0
src/packages/mobile/views/points/components/account/index.less

@@ -0,0 +1,34 @@
+.bankstatement-list {
+    padding: 10px;
+    padding-bottom: 0;
+
+    dl {
+        line-height: 1.8;
+        color: #999;
+        background-color: #fff;
+        border-radius: 8px;
+        padding: 10px;
+
+        dt,
+        dd {
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+        }
+
+        dt {
+            color: #333;
+        }
+
+        dd {
+            font-size: 12px;
+
+            .van-button {
+                width: 80px;
+                border-width: 1px;
+                margin-top: 10px;
+                margin-left: auto;
+            }
+        }
+    }
+}

+ 68 - 0
src/packages/mobile/views/points/components/account/index.vue

@@ -0,0 +1,68 @@
+<!-- 积分信息- 我的积分 -->
+<template>
+    <app-pull-refresh ref="pullRefreshRef" v-model:loading="loading" v-model:error="error"
+        v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="onRefresh">
+        <div class="bankstatement-list" v-for="(item, index) in dataList" :key="index">
+            <dl>
+                <dd>
+                    <span>{{ $t('score.scoretypename') }}</span>
+                    <span>{{ handleNoneValue(item.scoretypename) }}</span>
+                </dd>
+                <dd>
+                    <span>{{ $t('score.oriscore') }}</span>
+                    <span>{{ handleNoneValue(item.oriscore) }}</span>
+                </dd>
+                <dd>
+                    <span>{{ $t('score.freezescore') }}</span>
+                    <span>{{ handleNoneValue(item.freezescore) }}</span>
+                </dd>
+                <dd>
+                    <span>{{ $t('score.todayincrease') }}</span>
+                    <span>{{ handleNoneValue(item.todayincrease) }}</span>
+                </dd>
+                 <dd>
+                    <span>{{ $t('score.todaydecrease') }}</span>
+                    <span>{{ handleNoneValue(item.todaydecrease) }}</span>
+                </dd>
+                <dd>
+                    <span>{{ $t('score.curscore') }}</span>
+                    <span>{{ handleNoneValue(item.curscore) }}</span>
+                </dd>
+            </dl>
+        </div>
+    </app-pull-refresh>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef } from 'vue'
+import { useRequest } from '@/hooks/request'
+import { queryUserScore } from '@/services/api/user'
+import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
+import { handleNoneValue } from '@/filters'
+
+const showModal = shallowRef(true)
+const error = shallowRef(false)
+const pullRefreshRef = shallowRef()
+const refresh = shallowRef(false) // 是否刷新父组件数据
+
+const { loading, pageIndex, pageCount, run, dataList } = useRequest(queryUserScore)
+
+const onRefresh = () => {
+    run()
+}
+
+// 关闭弹窗
+const closed = (isRefresh = false) => {
+    refresh.value = isRefresh
+    showModal.value = false
+}
+
+// 暴露组件属性给父组件调用
+defineExpose({
+    closed,
+})
+</script>
+
+<style lang="less">
+@import './index.less';
+</style>

+ 34 - 0
src/packages/mobile/views/points/components/details/index.less

@@ -0,0 +1,34 @@
+.bankstatement-list {
+    padding: 10px;
+    padding-bottom: 0;
+
+    dl {
+        line-height: 1.8;
+        color: #999;
+        background-color: #fff;
+        border-radius: 8px;
+        padding: 10px;
+
+        dt,
+        dd {
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+        }
+
+        dt {
+            color: #333;
+        }
+
+        dd {
+            font-size: 12px;
+
+            .van-button {
+                width: 80px;
+                border-width: 1px;
+                margin-top: 10px;
+                margin-left: auto;
+            }
+        }
+    }
+}

+ 70 - 0
src/packages/mobile/views/points/components/details/index.vue

@@ -0,0 +1,70 @@
+<!-- 积分信息-积分明细 -->
+<template>
+    <app-pull-refresh ref="pullRefreshRef" v-model:loading="loading" v-model:error="error"
+        v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="onRefresh">
+        <div class="bankstatement-list" v-for="(item, index) in dataList" :key="index">
+            <dl>
+                <dt>
+                    <span>
+                        {{ $t('score.detailid') }}
+                        {{ handleNoneValue(item.detailid) }}
+                    </span>
+                    <span>
+                        <b>{{ getValidTypeName(item.validtype) }}</b>
+                    </span>
+                </dt>
+                <dd>
+                    <span>{{ $t('score.scoretypename') }}</span>
+                    <span>{{ handleNoneValue(item.scoretypename) }}</span>
+                </dd>
+                <dd>
+                    <span>{{ $t('score.remainscore') }}</span>
+                    <span>{{ formatDecimal(item.remainscore) }}</span>
+                </dd>
+                <dd>
+                    <span>{{ $t('score.expiredate') }}</span>
+                    <span>{{ handleNoneValue(item.expiredate) }}</span>
+                </dd>
+                 <dd>
+                    <span>{{ $t('score.createdtime') }}</span>
+                    <span>{{ formatDate(item.createdtime) }}</span>
+                </dd>                
+            </dl>
+        </div>
+    </app-pull-refresh>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef } from 'vue'
+import { useRequest } from '@/hooks/request'
+import { queryUserScoreDetail } from '@/services/api/user'
+import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
+import { formatDecimal, handleNoneValue, formatDate } from '@/filters'
+import { getValidTypeName } from '@/constants/market'
+
+const showModal = shallowRef(true)
+const error = shallowRef(false)
+const pullRefreshRef = shallowRef()
+const refresh = shallowRef(false) // 是否刷新父组件数据
+
+const { loading, pageIndex, pageCount, run, dataList } = useRequest(queryUserScoreDetail)
+
+const onRefresh = () => {
+    run()
+}
+
+// 关闭弹窗
+const closed = (isRefresh = false) => {
+    refresh.value = isRefresh
+    showModal.value = false
+}
+
+// 暴露组件属性给父组件调用
+defineExpose({
+    closed,
+})
+</script>
+
+<style lang="less">
+@import './index.less';
+</style>

+ 1 - 1
src/packages/snhl/router/index.ts

@@ -223,7 +223,7 @@ const routes: Array<RouteRecordRaw> = [
       {
         path: 'account',
         name: 'points-account',
-        component: () => import('@mobile/views/points/account/index.vue'),
+        component: () => import('@mobile/views/points/Index.vue'),
       }
     ]
   },