Jelajahi Sumber

Merge branch 'v20' of http://192.168.31.240:3000/MTP2.0_New/MTP20_WEB_GLOBAL into v20

li.shaoyi 3 bulan lalu
induk
melakukan
2e45090eca

+ 58 - 0
public/config/columns.json

@@ -579,5 +579,63 @@
                 "label": "order.listingtrade.wrtradedetailid"
             }
         ]
+    },
+    {
+        "tableKey": "user-score",
+        "columns": [
+            {
+                "field": "scoretypename",
+                "label": "积分类型"
+            },
+            {
+                "field": "oriscore",
+                "label": "期初积分"
+            },
+            {
+                "field": "freezescore",
+                "label": "冻结积分"
+            },
+            {
+                "field": "todayincrease",
+                "label": "今日增加"
+            },
+            {
+                "field": "todaydecrease",
+                "label": "今日减少"
+            },
+            {
+                "field": "curscore",
+                "label": "期末积分"
+            }
+        ]
+    },
+    {
+        "tableKey": "user-score-detail",
+        "columns": [
+            {
+                "field": "scoretypename",
+                "label": "积分类型"
+            },
+            {
+                "field": "remainscore",
+                "label": "剩余积分"
+            },
+            {
+                "field": "validtype",
+                "label": "有效类型"
+            },
+            {
+                "field": "expiredate",
+                "label": "到期日期"
+            },
+            {
+                "field": "createdtime",
+                "label": "创建时间"
+            },
+            {
+                "field": "detailid",
+                "label": "明细单号"
+            }
+        ]
     }
 ]

+ 18 - 1
src/constants/market.ts

@@ -32,6 +32,23 @@ export function getRunStatusList() {
  * @returns 
  */
 export function getRunStatusName(value: number) {
-    const enums = getRunStatusList()
+    const enums = getValidTypeList
+    return getEnumTypeName(enums, value)
+}
+
+/**
+ * 获取有效期类型列表
+ * @returns 
+ */
+export function getValidTypeList() {
+    return getEnumTypeList('ValidType')
+}
+
+/**
+ * 获取有效期类型名称
+ * @returns 
+ */
+export function getValidTypeName(value: number) {
+    const enums = getValidTypeList()
     return getEnumTypeName(enums, value)
 }

+ 14 - 2
src/packages/pc/views/footer/points/account/index.vue

@@ -1,9 +1,21 @@
 <!-- 积分信息-我的积分 -->
 <template>
-    <app-table>
-    </app-table>
+    <app-table :data="dataList" v-model:columns="tableColumns" :loading="loading" />
 </template>
 
 <script lang="ts" setup>
+import { shallowRef } from 'vue'
+import { useRequest } from '@/hooks/request'
+import { queryUserScore } from '@/services/api/user'
+import { useTableColumnsStore } from '@/stores'
 import AppTable from '@pc/components/base/table/index.vue'
+
+const { getTableColumns } = useTableColumnsStore()
+const tableColumns = shallowRef<Model.TableColumn[]>([])
+
+const { loading, dataList } = useRequest(queryUserScore, {})
+
+getTableColumns('user-score').then((res) => {
+    tableColumns.value = res
+})
 </script>

+ 24 - 1
src/packages/pc/views/footer/points/details/index.vue

@@ -1,9 +1,32 @@
 <!-- 积分信息-积分明细 -->
 <template>
-    <app-table>
+    <app-table :data="dataList" v-model:columns="tableColumns" :loading="loading" >
+        <!-- 申请时间 -->
+        <template #createdtime="{ value }">
+            {{ formatDate(value) }}
+        </template>
+        <!-- 有效类型 -->
+        <template #validtype="{ value }">
+            {{ getValidTypeName(value) }}
+        </template>
     </app-table>
 </template>
 
 <script lang="ts" setup>
+import { shallowRef } from 'vue'
+import { useRequest } from '@/hooks/request'
+import { queryUserScoreDetail } from '@/services/api/user'
+import { useTableColumnsStore } from '@/stores'
 import AppTable from '@pc/components/base/table/index.vue'
+import { formatDate } from '@/filters'
+import { getValidTypeName } from '@/constants/market'
+
+const { getTableColumns } = useTableColumnsStore()
+const tableColumns = shallowRef<Model.TableColumn[]>([])
+
+const { loading, dataList } = useRequest(queryUserScoreDetail, {})
+
+getTableColumns('user-score-detail').then((res) => {
+    tableColumns.value = res
+})
 </script>

+ 26 - 0
src/services/api/user/index.ts

@@ -124,4 +124,30 @@ export function getUserInfo(config: RequestConfig<Model.UserInfoReq> = {}) {
         url: '/Zhongrong/GetUserInfo',
         params: config.data
     })
+}
+
+/**
+ * 用户积分信息查询
+ */
+export function queryUserScore(config: RequestConfig<Model.UserScoreReq> = {}) {
+    return http.commonRequest<Model.UserScoreRsq>({
+        url: '/User/QueryUserScore',
+        params: {
+            userID: getUserId(),
+            ...config.data
+        },
+    })
+}
+
+/**
+ * 用户积分明细信息查询
+ */
+export function queryUserScoreDetail(config: RequestConfig<Model.UserScoreDetailReq> = {}) {
+    return http.commonRequest<Model.UserScoreDetailRsq>({
+        url: '/User/QueryUserScoreDetail',
+        params: {
+            userID: getUserId(),
+            ...config.data
+        },
+    })
 }

+ 1 - 1
src/stores/modules/enum.ts

@@ -14,7 +14,7 @@ export interface EnumType {
     bankmappedvalue?: string
 }
 
-const enumKeys = ['confirmStatus', 'countrycode', 'inoutapplystatus', 'inouttype', 'executetype', 'currency', 'deliveryOrderStatus', 'operatetypesearch', 'deliveryPayMode', 'applystatus', 'deliveryStatus', 'operateType', 'WRPresaleStatus', 'clientType', 'stepStatus', 'scoreConfigType', 'GZBSCPayStatus', 'gt_kksjdw', 'performanceStatus', 'handlestatus', 'performanceType', 'accountBusinessCode', 'certificatetype', 'signstatus', 'thjOrderStatus', 'THJDeliveryMode', 'goodsunit', 'WROutInApplyStatus2', 'THJTransferStatus', 'WRTradeOrderStatus', 'THJMarket', 'THJProfitRoleType', 'appointmentModelOut', 'orderstatus', 'Pricemode2', 'buildtype', 'listingselecttype', 'certypeperson', 'runstatus', 'traderstatus', 'transferapplystatus', 'ePayFlag', 'goodscurrency', 'paymodel'] as const
+const enumKeys = ['confirmStatus', 'countrycode', 'ValidType', 'inoutapplystatus', 'inouttype', 'executetype', 'currency', 'deliveryOrderStatus', 'operatetypesearch', 'deliveryPayMode', 'applystatus', 'deliveryStatus', 'operateType', 'WRPresaleStatus', 'clientType', 'stepStatus', 'scoreConfigType', 'GZBSCPayStatus', 'gt_kksjdw', 'performanceStatus', 'handlestatus', 'performanceType', 'accountBusinessCode', 'certificatetype', 'signstatus', 'thjOrderStatus', 'THJDeliveryMode', 'goodsunit', 'WROutInApplyStatus2', 'THJTransferStatus', 'WRTradeOrderStatus', 'THJMarket', 'THJProfitRoleType', 'appointmentModelOut', 'orderstatus', 'Pricemode2', 'buildtype', 'listingselecttype', 'certypeperson', 'runstatus', 'traderstatus', 'transferapplystatus', 'ePayFlag', 'goodscurrency', 'paymodel'] as const
 
 const enumMap = new Map<typeof enumKeys[number], ShallowRef<Model.EnumRsp[]>>()
 

+ 58 - 0
src/types/model/user.d.ts

@@ -493,4 +493,62 @@ declare namespace Model {
         // 合同签署链接
         signUrl: string
     }
+
+    /** 用户积分信息查询 请求 */
+    interface UserScoreReq {
+        // 用户ID
+        userID?: number
+    }
+
+    /** 用户积分信息查询 响应 */
+    interface UserScoreRsq {
+        // 期末积分
+        curscore: number
+        // 冻结积分
+        freezescore: number
+        // 期初积分
+        oriscore: number
+        // 积分类型ID
+        scoretypeid: number
+        // 积分类型名称
+        scoretypename: string
+        // 今日减少
+        todaydecrease: number
+        // 今日增加
+        todayincrease: number
+        // 用户ID
+        userid: number
+        // 代扣积分[积分服务商]
+        withholdsocre: number
+    }
+
+    /** 用户积分信息明细查询 请求 */
+    interface UserScoreDetailReq {
+        // 用户ID
+        userID?: number
+    }
+
+    /** 用户积分信息明细查询 响应 */
+    interface UserScoreDetailRsq {
+        // 创建时间
+        createdtime: string
+        // 明细单号
+        detailid: string
+        // 到期日期
+        expiredate: string
+        // 剩余积分
+        remainscore: number
+        // 积分
+        score: number
+        // 积分类型ID
+        scoretypeid: number
+        // 积分类型名称
+        scoretypename: string
+        // 交易日
+        tradedate: number
+       // 用户ID
+        userid: number
+        // 有效类型(枚举'ValidType')
+        validtype: number
+    }
 }