lishanshan 5 месяцев назад
Родитель
Сommit
71dde795e7

+ 7 - 0
common/router/modules/routes.js

@@ -743,6 +743,13 @@ const routes = [{
 			title: '结算详情',
 		},
 	},
+  {
+		path: '/pages/finance/groupMealDetails',
+		name: 'GroupMealDetails',
+		meta: {
+			title: '团餐结算详情',
+		},
+	},
   {
 		path: '/pages/finance/orderDetails',
 		name: 'OrderDetails',

+ 9 - 2
pages.json

@@ -116,6 +116,13 @@
 				"navigationStyle": "custom"
 			}
 		},
+    {
+			"path": "pages/finance/groupMealDetails",
+			"style": {
+				"navigationBarTitleText": "团餐结算详情",
+				"navigationStyle": "custom"
+			}
+		},
     {
 			"path": "pages/finance/orderDetails",
 			"style": {
@@ -564,8 +571,8 @@
       {
 				"text": "财务",
 				"pagePath": "pages/finance/index",
-				"iconPath": "static/tabbar/set_tab.png",
-				"selectedIconPath": "static/tabbar/set_select_tab.png"
+				"iconPath": "static/tabbar/finance_tab.png",
+				"selectedIconPath": "static/tabbar/finance_select_tab.png"
 			}
 			// { 
 			// 	"text": "消息",

+ 5 - 2
pages/finance/components/account-list.vue

@@ -27,8 +27,8 @@ export default {
   methods: {
     goDetails(item) {
       let pathName = '';
-      switch (item.mainType) {
-        case 'SETTLE':
+      switch (item.jumpType) {
+        case 'SETTLE_NORMA':
           pathName = 'settlementDetails';
           break;
         case 'PENDING_SETTLE':
@@ -37,6 +37,9 @@ export default {
         case 'WITHDRAW':
           pathName = 'withdrawalDetails';
           break;
+        case 'SETTLE_GROUP_MEAL':
+          pathName = 'groupMealDetails';
+          break;
       }
       uni.navigateTo({
         url: `/pages/finance/${pathName}?id=${item.bizId}`,

+ 72 - 0
pages/finance/components/group-meal-list.vue

@@ -0,0 +1,72 @@
+<template>
+  <uni-table class="table" border :empty-text="'暂无数据'">
+    <uni-tr>
+      <uni-th align="center">商品名称/数量</uni-th>
+      <uni-th align="center">商品总价</uni-th>
+    </uni-tr>
+    <uni-tr v-for="(item, index) in list" :key="index">
+      <uni-td>
+        <view class="info">
+          <text class="name">{{ item.productName }}</text>
+          <text>x{{ item.quantity }}</text>
+        </view>
+      </uni-td>
+      <uni-td>¥{{ item.orderPrice.toFixed(2) }}</uni-td>
+    </uni-tr>
+  </uni-table>
+</template>
+
+<script>
+export default {
+  props: {
+    list: {
+      type: Array,
+      default: () => [],
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.table {
+  border-radius: 8rpx;
+  overflow: hidden;
+  font-family: PingFang SC;
+  font-weight: 400;
+  border-color: #dbebff;
+
+  .info {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    font-size: 28rpx;
+
+    .name {
+      max-width: 367rpx;
+      margin-right: 10rpx;
+      white-space: nowrap;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      flex: 1;
+    }
+  }
+}
+
+::v-deep {
+  .uni-table-th {
+    height: 67rpx !important;
+    background: #f5faff;
+    font-size: 29rpx;
+    color: #333333;
+  }
+  .uni-table-td {
+    height: 54rpx !important;
+    text-align: center !important;
+    font-size: 27rpx !important;
+    color: #666666 !important;
+  }
+  .table--border {
+    border-color: #dbebff !important;
+  }
+}
+</style>

+ 1 - 1
pages/finance/components/order-list.vue

@@ -23,7 +23,7 @@ export default {
   methods: {
     goDetails(item) {
       uni.navigateTo({
-        url: `/pages/finance/orderDetails?orderId=${item.orderId}`,
+        url: `/pages/finance/orderDetails?id=${item.orderId}`,
       });
     },
   },

+ 214 - 0
pages/finance/groupMealDetails.vue

@@ -0,0 +1,214 @@
+<template>
+  <view class="settle">
+    <view class="fix">
+      <view class="top"></view>
+      <view class="head">
+        <span class="cuIcon-back" @click="back"></span>
+        <view class="case"> 结算详情-团餐 </view>
+      </view>
+    </view>
+
+    <view class="settle-card">
+      <view class="settle-header">
+        <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>
+        <view class="remark"> 注:应收金额=成团价*商家分佣占比-拉新分佣成本</view>
+      </view>
+      <!-- 订单列表 -->
+      <view class="settle-list">
+        <GroupMealList :list="orderList"></GroupMealList>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+import api from '@/api/account';
+import GroupMealList from './components/group-meal-list.vue';
+
+export default {
+  name: 'SettlementDetails',
+  components: {
+    GroupMealList,
+  },
+  data() {
+    return {
+      bizId: '',
+      settlementInfo: {},
+      // 订单列表
+      orderList: [],
+    };
+  },
+  onLoad(options) {
+    if (options.id) {
+      this.bizId = options.id;
+    }
+  },
+  onShow() {
+    this.getDetails(this.bizId);
+  },
+  methods: {
+    getDetails(id) {
+      api
+        .settlementDetail(id)
+        .then((res) => {
+          if (res.data.code === 200) {
+            this.settlementInfo = res.data.result;
+            this.orderList = res.data.result.orderList || [];
+
+          } else {
+            uni.showToast({
+              title: res.data.msg || '获取结算详情失败',
+              icon: 'none',
+            });
+          }
+        })
+        .catch(() => {
+          uni.showToast({
+            title: '获取结算详情失败',
+            icon: 'none',
+          });
+        });
+    },
+    back() {
+      uni.navigateBack({
+        delta: 1,
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.settle {
+  background: #f7f8fc;
+  min-height: 100vh;
+  font-family: Source Han Sans SC;
+  padding-bottom: 100rpx;
+
+  .fix {
+    position: sticky;
+    top: 0;
+    /*#ifdef APP-PLUS*/
+    .top {
+      width: 100%;
+      height: var(--status-bar-height);
+      background: #fff;
+    }
+
+    /*#endif*/
+
+    .head {
+      width: 100%;
+      height: 112rpx;
+      padding: 20rpx;
+      display: flex;
+      align-items: center;
+      background: #fff;
+      position: relative;
+      border-bottom: 1rpx solid #eeeeee;
+
+      .cuIcon-back {
+        font-size: 40rpx;
+        margin-right: 40rpx;
+      }
+
+      .case {
+        position: absolute;
+        left: 50%;
+        transform: translateX(-50%);
+        font-weight: 500;
+        font-size: 38rpx;
+        color: #333333;
+      }
+    }
+  }
+
+  .settle-card {
+    background-color: #fff;
+    padding: 30rpx 31rpx 10rpx;
+  }
+}
+
+.settle-header {
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+  font-weight: 500;
+
+  .amount {
+    font-weight: 500;
+    font-size: 63rpx;
+    color: #1f1f1f;
+    margin-bottom: 41rpx;
+  }
+}
+.settle-info {
+  background-color: #fff;
+  margin-bottom: 20rpx;
+}
+
+.info {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding-bottom: 21rpx;
+
+  &:last-child {
+    border-bottom: none;
+  }
+
+  .label {
+    font-weight: 400;
+    font-size: 31rpx;
+    color: #666666;
+  }
+
+  .value {
+    font-weight: 500;
+    font-size: 31rpx;
+    color: #333333;
+  }
+}
+
+.settle-list {
+  margin-top: 42rpx;
+}
+.remark {
+  font-weight: 400;
+  font-size: 25rpx;
+  color: #666666;
+  margin-top: 10rpx;
+}
+</style>

+ 2 - 2
pages/finance/orderDetails.vue

@@ -66,8 +66,8 @@ export default {
     }
   },
   onLoad(options) {
-    if (options.orderId) {
-      this.orderId = options.orderId;
+    if (options.id) {
+      this.orderId = options.id;
     }
   },
   onShow() {

+ 1 - 1
pages/finance/settlementDetails.vue

@@ -163,7 +163,7 @@ export default {
 
   .settle-card {
     background-color: #fff;
-    padding: 40rpx 31rpx 10rpx;
+    padding: 30rpx 31rpx 10rpx;
   }
 }