Bladeren bron

【feat】【v3】

1.增加积分结算记录页面
2.增加积分兑换记录页面
3.增加五片消费与中奖记录页面
ChenYL 9 maanden geleden
bovenliggende
commit
5ef7713d5a

+ 15 - 0
src/apis/rewardApi.js

@@ -61,4 +61,19 @@ export function exchangeReward(data) {
 	  loading: true,
 	  loadingText: "正在兑换奖励,请稍后..."
 	});
+}
+
+
+/**
+ * 查询兑换记录
+ * @param {Object} data
+ */
+export function queryRewardExchangeHistory(data) {
+	return request({
+	  url: "/reward/queryRewardExchangeHistory",
+	  method: "get",
+	  data,
+	  loading: true,
+	  loadingText: "正在查询兑换记录,请稍后..."
+	});
   }

+ 14 - 0
src/apis/settleApi.js

@@ -12,4 +12,18 @@ export function querySettle(data) {
 	loading: true,
 	loadingText: "查询中..."
   });
+}
+
+/**
+ * 查询结算积分记录
+ * @param {Object} data
+ */
+export function querySettlePointsHistory(data) {
+  return request({
+    url: "/settle/querySettlePointsHistory",
+    method: "get",
+    data,
+	  loading: true,
+	  loadingText: "查询中..."
+  });
 }

+ 17 - 2
src/common/router.js

@@ -59,9 +59,24 @@ const router = {
 	REWARD_EDIT_PAGE: '/pages/reward/rewardEdit',
 
 	/**
-	 * 转账记录
+	 * 转账记录
 	 */
-	ACCOUNT_TRANSFER_HISTORY_PAGE: '/pages/account/accountTransferHistory'
+	ACCOUNT_TRANSFER_HISTORY_PAGE: '/pages/account/accountTransferHistory',
+
+	/**
+	 * 积分结算记录页
+	 */
+	SETTLE_POINTS_PAGE: '/pages/userCenter/settlePointsHistory',
+
+	/**
+	 * 积分兑换记录页
+	 */
+	REWARD_EXCHANGE_HISTORY_PAGE: 'pages/userCenter/rewardExchangeHistory',
+
+	/**
+	 * 消费与中奖记录
+	 */
+	ITEM_CONSUME_WIN_HISTORY_PAGE: 'pages/userCenter/itemConsumeWinHistory'
 };
 
 export default router;

+ 21 - 0
src/pages.json

@@ -109,6 +109,27 @@
 				"navigationBarTitleText": "转账记录",
 				"enablePullDownRefresh": true
 			}
+		},
+		{
+			"path": "pages/userCenter/settlePointsHistory",
+			"style": {
+				"navigationBarTitleText": "积分结算记录",
+				"enablePullDownRefresh": true
+			}
+		},
+		{
+			"path": "pages/userCenter/rewardExchangeHistory",
+			"style": {
+				"navigationBarTitleText": "积分兑换记录",
+				"enablePullDownRefresh": true
+			}
+		},
+		{
+			"path": "pages/userCenter/itemConsumeWinHistory",
+			"style": {
+				"navigationBarTitleText": "消费与中奖记录",
+				"enablePullDownRefresh": true
+			}
 		}
 	],
 	"tabBar": {

+ 5 - 3
src/pages/userCenter.vue

@@ -62,13 +62,15 @@
     <view class="mt24" v-if="loginStatus">
       <uni-list :border="true">
         <uni-list-item title="积分结算记录" :showArrow="true" :showExtraIcon="true"
-          :extraIcon="{ color: '#000000', size: 22, type: 'info' }" link="navigateTo" :to="router.ABOUT_US_PAGE">
+          :extraIcon="{ color: '#000000', size: 22, type: 'info' }" link="navigateTo" :to="router.SETTLE_POINTS_PAGE">
         </uni-list-item>
         <uni-list-item title="积分兑换记录" :showArrow="true" :showExtraIcon="true" clickable
-          :extraIcon="{ color: '#000000', size: 22, type: 'minus' }" link="navigateTo" :to="router.DISCLAIMER_PAGE">
+          :extraIcon="{ color: '#000000', size: 22, type: 'minus' }" link="navigateTo"
+          :to="router.REWARD_EXCHANGE_HISTORY_PAGE">
         </uni-list-item>
         <uni-list-item title="彩票消费与中奖记录" :showArrow="true" :showExtraIcon="true"
-          :extraIcon="{ color: '#000000', size: 22, type: 'info' }" link="navigateTo" :to="router.ABOUT_US_PAGE">
+          :extraIcon="{ color: '#000000', size: 22, type: 'info' }" link="navigateTo"
+          :to="router.ITEM_CONSUME_WIN_HISTORY_PAGE">
         </uni-list-item>
         <uni-list-item title="账户转账记录" :showArrow="true" :showExtraIcon="true" clickable
           :extraIcon="{ color: '#000000', size: 22, type: 'minus' }" link="navigateTo"

+ 183 - 0
src/pages/userCenter/itemConsumeWinHistory.vue

@@ -0,0 +1,183 @@
+<template>
+  <!-- 月份选择器 -->
+  <view class="date-picker">
+    <view class="date-picker-item arrow left-arrow">
+      <uni-icons type="left" size="30" @click="plusMonth(-1)"></uni-icons>
+    </view>
+    <view class="date-picker-item">
+      <picker mode="date" fields="month" :value="currentMonth" @change="monthChange">
+        <view class="picker-view">{{ currentMonth }}</view>
+      </picker>
+    </view>
+    <view class="date-picker-item arrow right-arrow">
+      <uni-icons type="right" size="30" @click="plusMonth(1)"></uni-icons>
+    </view>
+  </view>
+
+  <!-- 数据列表 -->
+  <uni-list :border="true">
+    <uni-list-item v-for="item in listData" :key="item.id">
+      <template v-slot:body>
+        <view class="item-box">
+          <span class="item-label">转账类型</span>
+          <span class="item-label">{{ item.transferCategory == 'TRANSFER' ? '转账' : '结算' }}</span>
+        </view>
+        <view class="item-box" v-if="item.transferCategory == 'TRANSFER'">
+          <span class="item-label">转出账户</span>
+          <span class="item-label">{{ item.senderAccountName }}</span>
+        </view>
+        <view class="item-box" v-if="item.transferCategory == 'TRANSFER'">
+          <span class="item-label">转出账户转入前积分</span>
+          <span class="item-label">{{ item.saPointsBeforeTransfer }}</span>
+        </view>
+        <view class="item-box" v-if="item.transferCategory == 'TRANSFER'">
+          <span class="item-label">转出账户转入后积分</span>
+          <span class="item-label">{{ item.saPointsAfterTransfer }}</span>
+        </view>
+        <view class="item-box">
+          <span class="item-label">转出账户</span>
+          <span class="item-label">{{ item.recipientAccountName }}</span>
+        </view>
+        <view class="item-box">
+          <span class="item-label">转入账户转入前积分</span>
+          <span class="item-label">{{ item.raPointsBeforeTransfer }}</span>
+        </view>
+        <view class="item-box">
+          <span class="item-label">转入账户转入后积分</span>
+          <span class="item-label">{{ item.raPointsAfterTransfer }}</span>
+        </view>
+        <view class="item-box">
+          <span class="item-label">转账积分</span>
+          <span class="item-label">{{ item.transferPoints }}</span>
+        </view>
+        <view class="item-box">
+          <span class="item-label">转账时间</span>
+          <span class="item-value">{{ item.transferTime }}</span>
+        </view>
+      </template>
+    </uni-list-item>
+  </uni-list>
+  <uni-load-more status="no-more" v-if="!listData || listData.length == 0" />
+</template>
+
+<script setup>
+import { ref } from 'vue';
+import { accountApi } from '@/apis/apis';
+import { onLoad, onShow, onPullDownRefresh } from '@dcloudio/uni-app';
+
+// 属性
+/**
+ * 当前选中的月
+ */
+const currentMonth = ref('2025-04');
+
+/**
+ * 数据
+ */
+const listData = ref([]);
+
+// 方法
+/**
+ * 月份选择器
+ */
+const monthChange = (e) => {
+  currentMonth.value = e.detail.value
+}
+
+/**
+ * 月份加减
+ */
+const plusMonth = (num) => {
+  // 转换成date对象
+  let tempDate = new Date(currentMonth.value);
+  // 月份加减
+  tempDate.setMonth(tempDate.getMonth() + num);
+
+  // daet对象转换成字符串
+  let tempYear = tempDate.getFullYear();
+  let tempMonth = (tempDate.getMonth() + 1).toString().padStart(2, "0"); // 月份从0开始,+1后格式化为两位数
+  currentMonth.value = `${tempYear}-${tempMonth}`;
+
+  loadData();
+}
+
+/**
+ * 获取转账数据
+ */
+const loadData = async () => {
+  let res = await accountApi.queryTransferHistory({ 'transferMonth': currentMonth.value });
+  listData.value = res ? res : [];
+}
+
+// 生命周期
+onLoad(() => {
+  // daet对象转换成字符串
+  let tempDate = new Date();
+  let tempYear = tempDate.getFullYear();
+  let tempMonth = (tempDate.getMonth() + 1).toString().padStart(2, "0"); // 月份从0开始,+1后格式化为两位数
+  currentMonth.value = `${tempYear}-${tempMonth}`;
+});
+
+onShow(() => {
+  loadData();
+})
+
+onPullDownRefresh(() => {
+  loadData();
+});
+</script>
+
+<style lang="scss" scoped>
+.date-picker {
+  display: flex;
+
+  .date-picker-item {
+    flex: 1;
+
+    picker {
+      width: 100%;
+      height: 100%;
+      display: flex;
+
+      display: flex;
+      /* 水平居中 */
+      justify-content: center;
+      /* 垂直居中 */
+      align-items: center;
+    }
+  }
+
+  .arrow {
+    /* 启用 Flexbox 布局 */
+    display: flex;
+    /* 垂直居中 */
+    align-items: center;
+  }
+
+  .left-arrow {
+    /* 将子元素对齐到右侧 */
+    justify-content: flex-end;
+  }
+
+  .right-arrow {
+    /* 将子元素对齐到右侧 */
+    justify-content: flex-start;
+  }
+}
+
+::v-deep .uni-list-item__container .uni-list-item__header {
+  width: 0%;
+}
+
+::v-deep .uni-list-item__container>view {
+  width: 100%;
+}
+
+.item-box {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+
+  width: 100%;
+}
+</style>

+ 195 - 0
src/pages/userCenter/rewardExchangeHistory.vue

@@ -0,0 +1,195 @@
+<template>
+  <!-- 月份选择器 -->
+  <view class="date-picker">
+    <view class="date-picker-item arrow left-arrow">
+      <uni-icons type="left" size="30" @click="plusMonth(-1)"></uni-icons>
+    </view>
+    <view class="date-picker-item">
+      <picker mode="date" fields="month" :value="currentMonth" @change="monthChange">
+        <view class="picker-view">{{ currentMonth }}</view>
+      </picker>
+    </view>
+    <view class="date-picker-item arrow right-arrow">
+      <uni-icons type="right" size="30" @click="plusMonth(1)"></uni-icons>
+    </view>
+  </view>
+
+  <!-- 数据列表 -->
+  <uni-list :border="true">
+    <uni-list-item v-for="item in listData" :key="item.id">
+      <template v-slot:body>
+        <view class="item-box">
+          <span class="item-label">兑换的奖励</span>
+          <span class="item-label">{{ item.rewardName }}</span>
+        </view>
+        <view class="item-box">
+          <span class="item-label">兑换方式</span>
+          <span class="item-label">{{ item.exchangeMethod == 'MANUAL' ? '手动' : '自动' }}</span>
+        </view>
+        <view class="item-box">
+          <span class="item-label">兑换数量</span>
+          <span class="item-label">{{ item.exchangeCount }}</span>
+        </view>
+        <view class="item-box">
+          <span class="item-label">兑换所需总积分</span>
+          <span class="item-label">{{ item.exchangeTotalPoints }}</span>
+        </view>
+        <view class="item-box">
+          <span class="item-label">兑换使用的账户</span>
+          <span class="item-label">{{ item.accountName }}</span>
+        </view>
+        <view class="item-box">
+          <span class="item-label">兑换前账户中的积分</span>
+          <span class="item-label">{{ item.accountPointsBeforeExchange }}</span>
+        </view>
+        <view class="item-box">
+          <span class="item-label">兑换后账户中的积分</span>
+          <span class="item-label">{{ item.accountPointsAfterExchange }}</span>
+        </view>
+        <view class="item-box">
+          <span class="item-label">兑换前用户未使用的积分</span>
+          <span class="item-label">{{ item.unusedPointsBeforeExchange }}</span>
+        </view>
+        <view class="item-box">
+          <span class="item-label">兑换后用户未使用的积分</span>
+          <span class="item-label">{{ item.unusedPointsAfterExchange }}</span>
+        </view>
+        <view class="item-box">
+          <span class="item-label">兑换前用户已使用的积分</span>
+          <span class="item-label">{{ item.usedPointsBeforeExchange }}</span>
+        </view>
+        <view class="item-box">
+          <span class="item-label">兑换后用户已使用的积分</span>
+          <span class="item-label">{{ item.usedPointsAfterExchange }}</span>
+        </view>
+        <view class="item-box">
+          <span class="item-label">兑换时间</span>
+          <span class="item-label">{{ item.exchangeTime }}</span>
+        </view>
+      </template>
+    </uni-list-item>
+  </uni-list>
+  <uni-load-more status="no-more" v-if="!listData || listData.length == 0" />
+</template>
+
+<script setup>
+import { ref } from 'vue';
+import { rewardApi } from '@/apis/apis';
+import { onLoad, onShow, onPullDownRefresh } from '@dcloudio/uni-app';
+
+// 属性
+/**
+ * 当前选中的月
+ */
+const currentMonth = ref('2025-04');
+
+/**
+ * 数据
+ */
+const listData = ref([]);
+
+// 方法
+/**
+ * 月份选择器
+ */
+const monthChange = (e) => {
+  currentMonth.value = e.detail.value
+}
+
+/**
+ * 月份加减
+ */
+const plusMonth = (num) => {
+  // 转换成date对象
+  let tempDate = new Date(currentMonth.value);
+  // 月份加减
+  tempDate.setMonth(tempDate.getMonth() + num);
+
+  // daet对象转换成字符串
+  let tempYear = tempDate.getFullYear();
+  let tempMonth = (tempDate.getMonth() + 1).toString().padStart(2, "0"); // 月份从0开始,+1后格式化为两位数
+  currentMonth.value = `${tempYear}-${tempMonth}`;
+
+  loadData();
+}
+
+/**
+ * 获取转账数据
+ */
+const loadData = async () => {
+  let res = await rewardApi.queryRewardExchangeHistory({ 'exchangeMonth': currentMonth.value });
+  listData.value = res ? res : [];
+}
+
+// 生命周期
+onLoad(() => {
+  // daet对象转换成字符串
+  let tempDate = new Date();
+  let tempYear = tempDate.getFullYear();
+  let tempMonth = (tempDate.getMonth() + 1).toString().padStart(2, "0"); // 月份从0开始,+1后格式化为两位数
+  currentMonth.value = `${tempYear}-${tempMonth}`;
+});
+
+onShow(() => {
+  loadData();
+})
+
+onPullDownRefresh(() => {
+  loadData();
+});
+</script>
+
+<style lang="scss" scoped>
+.date-picker {
+  display: flex;
+
+  .date-picker-item {
+    flex: 1;
+
+    picker {
+      width: 100%;
+      height: 100%;
+      display: flex;
+
+      display: flex;
+      /* 水平居中 */
+      justify-content: center;
+      /* 垂直居中 */
+      align-items: center;
+    }
+  }
+
+  .arrow {
+    /* 启用 Flexbox 布局 */
+    display: flex;
+    /* 垂直居中 */
+    align-items: center;
+  }
+
+  .left-arrow {
+    /* 将子元素对齐到右侧 */
+    justify-content: flex-end;
+  }
+
+  .right-arrow {
+    /* 将子元素对齐到右侧 */
+    justify-content: flex-start;
+  }
+}
+
+::v-deep .uni-list-item__container .uni-list-item__header {
+  width: 0%;
+}
+
+::v-deep .uni-list-item__container>view {
+  width: 100%;
+}
+
+.item-box {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+
+  width: 100%;
+}
+</style>

+ 163 - 0
src/pages/userCenter/settlePointsHistory.vue

@@ -0,0 +1,163 @@
+<template>
+  <!-- 月份选择器 -->
+  <view class="date-picker">
+    <view class="date-picker-item arrow left-arrow">
+      <uni-icons type="left" size="30" @click="plusMonth(-1)"></uni-icons>
+    </view>
+    <view class="date-picker-item">
+      <picker mode="date" fields="month" :value="currentMonth" @change="monthChange">
+        <view class="picker-view">{{ currentMonth }}</view>
+      </picker>
+    </view>
+    <view class="date-picker-item arrow right-arrow">
+      <uni-icons type="right" size="30" @click="plusMonth(1)"></uni-icons>
+    </view>
+  </view>
+
+  <!-- 数据列表 -->
+  <uni-list :border="true">
+    <uni-list-item v-for="item in listData" :key="item.id">
+      <template v-slot:body>
+        <view class="item-box">
+          <span class="item-label">结算日期</span>
+          <span class="item-label">{{ item.settleDate }}</span>
+        </view>
+        <view class="item-box">
+          <span class="item-label">结算积分</span>
+          <span class="item-label">{{ item.settlePoints }}</span>
+        </view>
+        <view class="item-box">
+          <span class="item-label">结算前积分</span>
+          <span class="item-label">{{ item.beforeSettlePoints }}</span>
+        </view>
+        <view class="item-box">
+          <span class="item-label">结算后积分</span>
+          <span class="item-label">{{ item.afterSettlePoints }}</span>
+        </view>
+      </template>
+    </uni-list-item>
+  </uni-list>
+  <uni-load-more status="no-more" v-if="!listData || listData.length == 0" />
+</template>
+
+<script setup>
+import { ref } from 'vue';
+import { settleApi } from '@/apis/apis';
+import { onLoad, onShow, onPullDownRefresh } from '@dcloudio/uni-app';
+
+// 属性
+/**
+ * 当前选中的月
+ */
+const currentMonth = ref('2025-04');
+
+/**
+ * 数据
+ */
+const listData = ref([]);
+
+// 方法
+/**
+ * 月份选择器
+ */
+const monthChange = (e) => {
+  currentMonth.value = e.detail.value
+}
+
+/**
+ * 月份加减
+ */
+const plusMonth = (num) => {
+  // 转换成date对象
+  let tempDate = new Date(currentMonth.value);
+  // 月份加减
+  tempDate.setMonth(tempDate.getMonth() + num);
+
+  // daet对象转换成字符串
+  let tempYear = tempDate.getFullYear();
+  let tempMonth = (tempDate.getMonth() + 1).toString().padStart(2, "0"); // 月份从0开始,+1后格式化为两位数
+  currentMonth.value = `${tempYear}-${tempMonth}`;
+
+  loadData();
+}
+
+/**
+ * 获取转账数据
+ */
+const loadData = async () => {
+  let res = await settleApi.querySettlePointsHistory({ 'settleMonth': currentMonth.value });
+  listData.value = res ? res : [];
+}
+
+// 生命周期
+onLoad(() => {
+  // daet对象转换成字符串
+  let tempDate = new Date();
+  let tempYear = tempDate.getFullYear();
+  let tempMonth = (tempDate.getMonth() + 1).toString().padStart(2, "0"); // 月份从0开始,+1后格式化为两位数
+  currentMonth.value = `${tempYear}-${tempMonth}`;
+});
+
+onShow(() => {
+  loadData();
+})
+
+onPullDownRefresh(() => {
+  loadData();
+});
+</script>
+
+<style lang="scss" scoped>
+.date-picker {
+  display: flex;
+
+  .date-picker-item {
+    flex: 1;
+
+    picker {
+      width: 100%;
+      height: 100%;
+      display: flex;
+
+      display: flex;
+      /* 水平居中 */
+      justify-content: center;
+      /* 垂直居中 */
+      align-items: center;
+    }
+  }
+
+  .arrow {
+    /* 启用 Flexbox 布局 */
+    display: flex;
+    /* 垂直居中 */
+    align-items: center;
+  }
+
+  .left-arrow {
+    /* 将子元素对齐到右侧 */
+    justify-content: flex-end;
+  }
+
+  .right-arrow {
+    /* 将子元素对齐到右侧 */
+    justify-content: flex-start;
+  }
+}
+
+::v-deep .uni-list-item__container .uni-list-item__header {
+  width: 0%;
+}
+
+::v-deep .uni-list-item__container>view {
+  width: 100%;
+}
+
+.item-box {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+
+  width: 100%;
+}
+</style>