|
|
@@ -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>
|