lishanshan 5 ay önce
ebeveyn
işleme
628c8b19c3

+ 18 - 5
pages/finance/accountRecord.vue

@@ -45,9 +45,24 @@ export default {
   components: {
     AccountList,
   },
+  computed: {
+    navTitle() {
+      switch (this.type) {
+        case 'all':
+          return '账户明细';
+        case 'pending':
+          return '待结算明细';
+        case 'auditing':
+          return '提现审核中';
+        case 'completed':
+          return '已提现明细';
+        default:
+          return '账户明细';
+      }
+    },
+  },
   data() {
     return {
-      navTitle: '账户明细',
       settlementTabs: ['全部', '结算', '提现'],
       params: {},
       currentTab: 0,
@@ -64,7 +79,6 @@ export default {
         this.showTab = true;
         this.currentTab = this.type === 'all' ? 0 : 1;
       } else {
-        this.navTitle = this.accountMenus.find((menu) => menu.type === this.type).title;
         this.showTab = false;
       }
     }
@@ -110,7 +124,7 @@ export default {
               this.$refs.mescrollRef.upLoadType = 'NO_DATA';
             }
           } else {
-            this.accountData = [];;
+            this.accountData = [];
             this.mescroll.endErr();
           }
         })
@@ -179,7 +193,6 @@ export default {
     background: #ffffff;
     position: sticky;
     top: 0px;
-    border-bottom: 1px solid #eeeeee;
 
     /*#ifdef APP-PLUS*/
     .top {
@@ -222,7 +235,6 @@ export default {
     height: 80rpx;
     line-height: 80rpx;
     background: #fff;
-    border-radius: 0rpx 0rpx 13rpx 13rpx;
 
     .tab-item {
       flex: 1;
@@ -261,6 +273,7 @@ export default {
     color: #333;
     margin: 17rpx 31rpx;
     background: #fff;
+    border-radius: 10rpx;
   }
 }
 </style>

+ 3 - 3
pages/finance/components/account-list.vue

@@ -1,7 +1,7 @@
 <template>
   <view class="list">
     <view class="list_item" v-for="(item, index) in list" :key="index" @click="goDetails(item)">
-      <view class="left">
+      <view class="left" v-if="item.jumpType !== 'PENDING_SETTLE'">
         <image src="/static/finance/account/icon-list.png" mode="aspectFit"></image>
       </view>
       <view class="center">
@@ -10,7 +10,7 @@
       </view>
       <view class="right">
         <view class="money">{{ item.amountText }}</view>
-        <view class="value">余额{{ item.balanceAfter || 0 }}</view>
+        <view class="value" v-if="item.jumpType !== 'PENDING_SETTLE'">余额{{ item.balanceAfter || 0 }}</view>
       </view>
     </view>
   </view>
@@ -28,7 +28,7 @@ export default {
     goDetails(item) {
       let pathName = '';
       switch (item.jumpType) {
-        case 'SETTLE_NORMA':
+        case 'SETTLE_NORMAL':
           pathName = 'settlementDetails';
           break;
         case 'PENDING_SETTLE':

+ 1 - 1
pages/finance/components/group-meal-list.vue

@@ -11,7 +11,7 @@
           <text>x{{ item.quantity }}</text>
         </view>
       </uni-td>
-      <uni-td>¥{{ item.orderPrice.toFixed(2) }}</uni-td>
+      <uni-td v-if="item.orderPrice">¥{{ item.orderPrice.toFixed(2) }}</uni-td>
     </uni-tr>
   </uni-table>
 </template>

+ 35 - 0
pages/finance/dictionary.js

@@ -97,3 +97,38 @@ export const orderFields = [
     key: 'distributor',
   },
 ]
+
+export const groupMealFields = [
+  {
+    title: '订单编号',
+    valueField: 'statementNumber',
+    isShowTip: false,
+  },
+  {
+    title: '下单时间',
+    valueField: 'createTime',
+    isShowTip: false,
+  },
+  {
+    title: '成团时间',
+    valueField: 'groupMealTime',
+    isShowTip: false,
+  },
+  {
+    title: '成团价',
+    valueField: 'groupMealPrice',
+    isShowTip: false,
+  },
+  {
+    title: '应收金额',
+    valueField: 'amountPayable',
+    isShowTip: false,
+  },
+  {
+    title: '拉新分佣成本',
+    valueField: 'newUserCommission',
+    rateField: 'newUserCommissionRate',
+    isShowTip: true,
+    key: 'newUser',
+  }
+]

+ 148 - 82
pages/finance/groupMealDetails.vue

@@ -13,34 +13,21 @@
         <view class="amount">¥{{ settlementInfo.amountPayable }}</view>
       </view>
       <view class="settle-info">
-        <view class="info">
-          <view class="label">订单编号</view>
-          <view class="value">{{ settlementInfo.statementNumber }}</view>
-        </view>
-
-        <view class="info">
-          <view class="label">下单时间</view>
-          <view class="value">{{ settlementInfo.createTime }}</view>
-        </view>
-
-        <view class="info">
-          <view class="label">成团时间</view>
-          <view class="value">{{ settlementInfo.groupMealTime }}</view>
-        </view>
-
-        <view class="info">
-          <view class="label">成团价</view>
-          <view class="value">{{ settlementInfo.groupMealPrice }}</view>
-        </view>
-
-        <view class="info">
-          <view class="label">应收金额</view>
-          <view class="value">{{ settlementInfo.amountPayable }}</view>
-        </view>
-
-        <view class="info">
-          <view class="label">拉新分佣成本</view>
-          <view class="value">{{ settlementInfo.newUserCommission }}</view>
+        <view v-for="(item, index) in groupMealFields" :key="index" class="info">
+          <view class="label">
+            {{ item.title }}
+            <image
+              v-if="item.isShowTip"
+              src="/static/finance/status/icon-remind.png"
+              mode="aspectFit"
+              style="width: 33rpx; height: 33rpx; margin-left: 8rpx"
+              @click.stop="toggleTooltip(item.key)"
+            ></image>
+            <view class="tooltip" v-show="showTooltip === item.key">
+              商户占比{{ settlementInfo[item.rateField] }}%
+            </view>
+          </view>
+          <view class="value">{{ settlementInfo[item.valueField] }}</view>
         </view>
         <view class="remark"> 注:应收金额=成团价*商家分佣占比-拉新分佣成本</view>
       </view>
@@ -54,6 +41,7 @@
 
 <script>
 import api from '@/api/account';
+import { groupMealFields } from './dictionary';
 import GroupMealList from './components/group-meal-list.vue';
 
 export default {
@@ -63,19 +51,33 @@ export default {
   },
   data() {
     return {
-      bizId: '',
+      orderId: '',
       settlementInfo: {},
-      // 订单列表
       orderList: [],
+      groupMealFields,
+      showTooltip: null,
+      tooltipTimer: null,
     };
   },
+  mounted() {
+    // 点击其他区域隐藏提示
+    document.addEventListener('click', this.handleClickOutside);
+  },
+  beforeUnmount() {
+    // 移除事件监听
+    document.removeEventListener('click', this.handleClickOutside);
+    // 清除定时器
+    if (this.tooltipTimer) {
+      clearTimeout(this.tooltipTimer);
+    }
+  },
   onLoad(options) {
     if (options.id) {
-      this.bizId = options.id;
+      this.orderId = options.id;
     }
   },
   onShow() {
-    this.getDetails(this.bizId);
+    this.getDetails(this.orderId);
   },
   methods: {
     getDetails(id) {
@@ -83,9 +85,8 @@ export default {
         .settlementDetail(id)
         .then((res) => {
           if (res.data.code === 200) {
-            this.settlementInfo = res.data.result;
+            this.settlementInfo = res.data.result || {};
             this.orderList = res.data.result.orderList || [];
-
           } else {
             uni.showToast({
               title: res.data.msg || '获取结算详情失败',
@@ -100,6 +101,43 @@ export default {
           });
         });
     },
+    // 处理点击事件,显示提示并设置10秒自动隐藏
+    toggleTooltip(key) {
+      // 清除之前的定时器
+      if (this.tooltipTimer) {
+        clearTimeout(this.tooltipTimer);
+      }
+      // 显示当前提示,隐藏其他提示
+      this.showTooltip = this.showTooltip === key ? null : key;
+
+      // 如果是显示状态,设置10秒后自动隐藏
+      if (this.showTooltip) {
+        this.tooltipTimer = setTimeout(() => {
+          this.showTooltip = null;
+        }, 10000); // 10秒自动隐藏
+      }
+    },
+    // 点击其他区域隐藏提示
+    handleClickOutside(event) {
+      // 检查点击目标是否在提示或图片上
+      const tooltipElements = document.querySelectorAll('.tooltip, image[src*="icon-remind.png"]');
+      let isClickOnTooltip = false;
+
+      tooltipElements.forEach((element) => {
+        if (element.contains(event.target)) {
+          isClickOnTooltip = true;
+        }
+      });
+
+      // 如果点击的不是提示或图片,隐藏所有提示
+      if (!isClickOnTooltip) {
+        this.showTooltip = null;
+        // 清除定时器
+        if (this.tooltipTimer) {
+          clearTimeout(this.tooltipTimer);
+        }
+      }
+    },
     back() {
       uni.navigateBack({
         delta: 1,
@@ -115,6 +153,7 @@ export default {
   min-height: 100vh;
   font-family: Source Han Sans SC;
   padding-bottom: 100rpx;
+  font-weight: 500;
 
   .fix {
     position: sticky;
@@ -147,7 +186,6 @@ export default {
         position: absolute;
         left: 50%;
         transform: translateX(-50%);
-        font-weight: 500;
         font-size: 38rpx;
         color: #333333;
       }
@@ -156,59 +194,87 @@ export default {
 
   .settle-card {
     background-color: #fff;
-    padding: 30rpx 31rpx 10rpx;
-  }
-}
+    padding: 30rpx 31rpx 31rpx;
 
-.settle-header {
-  display: flex;
-  flex-direction: column;
-  justify-content: center;
-  align-items: center;
-  font-weight: 500;
+    .settle-header {
+      display: flex;
+      flex-direction: column;
+      justify-content: center;
+      align-items: center;
 
-  .amount {
-    font-weight: 500;
-    font-size: 63rpx;
-    color: #1f1f1f;
-    margin-bottom: 41rpx;
-  }
-}
-.settle-info {
-  background-color: #fff;
-  margin-bottom: 20rpx;
-}
+      .amount {
+        font-size: 63rpx;
+        color: #1f1f1f;
+        margin-bottom: 41rpx;
+      }
+    }
 
-.info {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  padding-bottom: 21rpx;
+    .settle-info {
+      background-color: #fff;
+      margin-bottom: 20rpx;
 
-  &:last-child {
-    border-bottom: none;
-  }
+      .info {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        padding-bottom: 21rpx;
 
-  .label {
-    font-weight: 400;
-    font-size: 31rpx;
-    color: #666666;
-  }
+        &:last-child {
+          border-bottom: none;
+        }
 
-  .value {
-    font-weight: 500;
-    font-size: 31rpx;
-    color: #333333;
-  }
-}
+        .label {
+          display: flex;
+          align-items: center;
+          font-weight: 400;
+          font-size: 31rpx;
+          color: #666666;
+          position: relative;
 
-.settle-list {
-  margin-top: 42rpx;
-}
-.remark {
-  font-weight: 400;
-  font-size: 25rpx;
-  color: #666666;
-  margin-top: 10rpx;
+          .tooltip {
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            width: 158rpx;
+            height: 42rpx;
+            background: rgba(0, 0, 0, 0.6);
+            border-radius: 4rpx 4rpx 4rpx 4rpx;
+            font-family: PingFang SC;
+            font-weight: 400;
+            font-size: 23rpx;
+            color: #ffffff;
+            margin-left: 10rpx;
+
+            &::after {
+              content: '';
+              position: absolute;
+              right: 158rpx;
+              bottom: 14rpx;
+              width: 0;
+              height: 0;
+              border-bottom: 10rpx solid transparent;
+              border-right: 10rpx solid rgba(0, 0, 0, 0.6);
+              border-top: 10rpx solid transparent;
+              border-left: 0;
+            }
+          }
+        }
+
+        .value {
+          font-size: 31rpx;
+          color: #333333;
+        }
+      }
+      .remark {
+        font-weight: 400;
+        font-size: 25rpx;
+        color: #666666;
+        margin-top: 10rpx;
+      }
+    }
+    .settle-list {
+      margin-top: 42rpx;
+    }
+  }
 }
 </style>

+ 1 - 0
pages/finance/orderDetails.vue

@@ -177,6 +177,7 @@ export default {
     padding: 42rpx 31rpx 85rpx;
     overflow: hidden;
     background: #ffffff;
+    height: 95vh;
   }
 }
 

+ 2 - 2
pages/finance/settlementDetails.vue

@@ -25,7 +25,7 @@
 
         <view class="info">
           <view class="label">结算金额</view>
-          <view class="value">{{ settlementInfo.amountPayable }}</view>
+          <view class="value">¥{{ settlementInfo.amountPayable }}</view>
         </view>
 
         <view class="info">
@@ -47,7 +47,7 @@
 
         <view class="info">
           <view class="label">结算单据</view>
-          <view class="value">{{ settlementInfo.settlementVoucher }}</view>
+          <view class="value">{{ settlementInfo.settlementDocument }}</view>
         </view>
       </view>
     </view>

+ 1 - 1
pages/finance/withdrawalDetails.vue

@@ -59,7 +59,7 @@ export default {
       bizId: '',
       cashInfo: {},
       showInvoicePopup: false,
-      reviewIcon: 'processing',
+      reviewIcon: '',
     };
   },
   onLoad(options) {