完善接口
This commit is contained in:
@ -15,54 +15,55 @@
|
||||
<view class="mt-38rpx">
|
||||
<view class="">
|
||||
<view class="mx-48rpx flex items-center">
|
||||
<view class="rounded-4rpx w-60rpx text-center text-[#40AE36] border-2rpx border-solid border-[#40AE36] text-22rpx pb-4rpx">团购</view>
|
||||
<!-- <view class="rounded-4rpx w-60rpx text-center text-[#FF5951] border-2rpx border-solid border-[#FF5951] text-22rpx pb-4rpx">直营</view> -->
|
||||
<view class="w-600rpx line-2 ml-20rpx font-bold text-30rpx text-[#303133] leading-42rpx text-left">【榻榻米双人包间】惬意茶室商务洽谈会议室这是里团购名称</view>
|
||||
<view class="rounded-4rpx w-60rpx text-center text-[#40AE36] border-2rpx border-solid border-[#40AE36] text-22rpx pb-4rpx" v-if="isGroupBuy">团购</view>
|
||||
<view class="rounded-4rpx w-60rpx text-center text-[#FF5951] border-2rpx border-solid border-[#FF5951] text-22rpx pb-4rpx" v-if="isDirectSale">直营</view>
|
||||
<view class="w-600rpx line-2 ml-20rpx font-bold text-30rpx text-[#303133] leading-42rpx text-left">【{{ bill?.room?.title }}】{{ bill?.order?.group?.title || '' }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="mt-30rpx text-40rpx text-[#303133] leading-56rpx text-center">
|
||||
<text class="font-bold">+</text>¥128.00
|
||||
<text class="font-bold">+</text>¥{{ bill.amount }}
|
||||
</view>
|
||||
|
||||
<view class="flex items-center flex items-center justify-center mt-16rpx">
|
||||
<wd-img width="28rpx" height="28rpx" :src="`${OSS}images/store/finance/image2.png`" mode="aspectFit" />
|
||||
<view class="text-26rpx text-[#606266] leading-36rpx ml-12rpx">核销成功</view>
|
||||
<view class="text-26rpx text-[#606266] leading-36rpx ml-12rpx" v-if="isGroupBuy">核销成功</view>
|
||||
<view class="text-26rpx text-[#606266] leading-36rpx ml-12rpx" v-if="isDirectSale">结算成功</view>
|
||||
</view>
|
||||
|
||||
<view class="mx-28rpx mt-72rpx">
|
||||
<!-- 这一块内容是在直营店才显示 -->
|
||||
<!-- <view>
|
||||
<view v-if="isDirectSale">
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view>预定门店</view>
|
||||
<view>茶址.24小时智能茶室(中新店)</view>
|
||||
<view>{{ bill?.store?.name }}</view>
|
||||
</view>
|
||||
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view>预约时间</view>
|
||||
<view>2025-03-18 09:00-12:00</view>
|
||||
<view>{{ bill?.order?.update_dtime }}</view>
|
||||
</view>
|
||||
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view>预约时长</view>
|
||||
<view>3小时</view>
|
||||
<view>{{ bill?.order?.hours }}小时</view>
|
||||
</view>
|
||||
|
||||
<view class="mt-20rpx">
|
||||
<wd-gap height="2rpx" bg-color="#E5E5E5"></wd-gap>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<!-- 直营和团购都显示 -->
|
||||
<view>
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view>总收入</view>
|
||||
<view>¥148.00</view>
|
||||
<view>¥{{ bill?.order?.order_amount }}</view>
|
||||
</view>
|
||||
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view>优惠券</view>
|
||||
<view>-¥20</view>
|
||||
<view>-¥{{ bill?.order?.coupon_price }}</view>
|
||||
</view>
|
||||
|
||||
<view class="mt-20rpx">
|
||||
@ -74,46 +75,46 @@
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view>订单编号</view>
|
||||
<view>
|
||||
<text>7327328627526903</text>
|
||||
<text>{{ bill?.order?.order_sn }}</text>
|
||||
<wd-divider vertical />
|
||||
<text class="text-[#4C9F44]" @click="copy('7327328627526903')">复制</text>
|
||||
<text class="text-[#4C9F44]" @click="copy(bill?.order?.order_sn)">复制</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 直营显示 -->
|
||||
<!-- <view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view v-if="isDirectSale" class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view>交易方式</view>
|
||||
<view>微信支付</view>
|
||||
</view> -->
|
||||
<view>{{ bill?.order?.pay_way_title }}</view>
|
||||
</view>
|
||||
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view>创建时间</view>
|
||||
<view>2025-05-16 12:20:26</view>
|
||||
<view>{{ bill?.order?.dtime }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 团购显示 -->
|
||||
<view>
|
||||
<view v-if="isGroupBuy">
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view>验券时间</view>
|
||||
<view>2025-05-16 12:20:26</view>
|
||||
<view>{{ bill?.order?.group?.yanquan_dtime }}</view>
|
||||
</view>
|
||||
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view>验券门店</view>
|
||||
<view>茶址.24小时智能茶室(中新店)</view>
|
||||
<view>{{ bill?.store?.name }}</view>
|
||||
</view>
|
||||
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view>券号</view>
|
||||
<view>8408669398</view>
|
||||
<view>{{ bill?.order?.group?.qr_sn }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 直营显示 -->
|
||||
<!-- <view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view v-if="isDirectSale" class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view>付款时间</view>
|
||||
<view>2025-08-16 12:20:26</view>
|
||||
</view> -->
|
||||
<view>{{ bill?.order?.dtime }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -123,11 +124,28 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { toTimes, copy } from '@/utils/tools'
|
||||
import { getUserTransactionDetailsInfo } from '@/api/user'
|
||||
|
||||
const OSS = inject('OSS')
|
||||
const bill = ref<any>({})
|
||||
|
||||
onLoad((args) => {
|
||||
onLoad(async (args) => {
|
||||
const id = Number(args.id) || 0
|
||||
if (id) {
|
||||
const res = await getUserTransactionDetailsInfo(id)
|
||||
bill.value = res.details
|
||||
}
|
||||
})
|
||||
|
||||
// 团购
|
||||
const isGroupBuy = computed(() => {
|
||||
return bill.value.change_type === 4
|
||||
})
|
||||
|
||||
// 直营
|
||||
const isDirectSale = computed(() => {
|
||||
return bill.value.change_type === 1 || bill.value.change_type === 2
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
@ -17,20 +17,20 @@
|
||||
<wd-img width="692rpx" height="334rpx" :src="`${OSS}images/store/finance/image1.png`" mode="aspectFit" />
|
||||
<view class="absolute top-50rpx left-40rpx">
|
||||
<view class="font-400 text-26rpx text-[#B4CEFF] leading-36rpx">经营资产</view>
|
||||
<view class="mt-20rpx font-bold text-36rpx text-[#fff] leading-34rpx">5,662.46</view>
|
||||
<view class="mt-20rpx font-bold text-36rpx text-[#fff] leading-34rpx">{{ userFinance.total_amount }}</view>
|
||||
</view>
|
||||
|
||||
<view class="flex items-center justify-around w-100% absolute bottom-40rpx left-0 px-40rpx">
|
||||
<view class="flex flex-col items-center justify-start">
|
||||
<view class="font-400 text-24rpx text-[#606266] text-34rpx">已提现</view>
|
||||
<view class="font-bold text-32rpx text-[#303133] leading-34rpx mt-14rpx">3,662.46</view>
|
||||
<view class="font-bold text-32rpx text-[#303133] leading-34rpx mt-14rpx">{{ userFinance.total_reflect_amount }}</view>
|
||||
</view>
|
||||
<view class="h-98rpx">
|
||||
<wd-divider vertical color="#EAEEF2" custom-class="!h-98rpx"></wd-divider>
|
||||
</view>
|
||||
<view class="flex flex-col items-center justify-start">
|
||||
<view class="font-400 text-24rpx text-[#606266] text-34rpx">待提现</view>
|
||||
<view class="font-bold text-32rpx text-[#303133] leading-34rpx mt-14rpx">3,662.46</view>
|
||||
<view class="font-bold text-32rpx text-[#303133] leading-34rpx mt-14rpx">{{ userFinance.user_money }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -38,41 +38,35 @@
|
||||
<view class="mx-30rpx">
|
||||
<view class="flex items-center">
|
||||
<view class="font-bold text-[#303133] datetime-picker">
|
||||
<!-- <text class="text-44rpx">8</text>
|
||||
<text class="text-32rpx">月</text> -->
|
||||
<wd-datetime-picker v-model="value" :maxDate="Date.now()" type="year-month" @confirm="Finance.handleConfirmDate"></wd-datetime-picker>
|
||||
|
||||
</view>
|
||||
<!-- <view class="mt-16rpx">
|
||||
<wd-icon name="fill-arrow-down" size="40rpx" color="#BFC2CC"></wd-icon>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<view class="font-400 text-24rpx text-[#606266] leading-34rpx">
|
||||
收入¥5,562.46
|
||||
收入¥{{ allPrice }}
|
||||
</view>
|
||||
|
||||
<view class="mt-20rpx">
|
||||
<mescroll-body ref="mescrollItem0" @init="mescrollInit" @down="downCallback" @up="Finance.upCallback" :down="downOption" :up="upOption">
|
||||
<view class="bg-white rounded-16rpx px-16rpx py-28rpx" @click="router.navigateTo(`/bundle/finance/detail`)">
|
||||
<view class="bg-white rounded-16rpx px-16rpx py-28rpx mb-20rpx" v-for="item in list" :key="item.id" @click="router.navigateTo(`/bundle/finance/detail?id=${item.id}`)">
|
||||
<view class="flex items-center justify-between">
|
||||
<view class="line-1 w-480rpx font-bold text-30rpx text-[#303133] leading-42rpx">【榻榻米双人包间】惬意茶室商务...</view>
|
||||
<view class="line-1 w-480rpx font-bold text-30rpx text-[#303133] leading-42rpx">【{{ item?.room?.title }}】{{ item?.group?.title || '' }}</view>
|
||||
<view class="flex items-center">
|
||||
<view class="text-[#FF5951] font-bold text-30rpx leading-42rpx">+ 181.35</view>
|
||||
<view class="text-[#FF5951] font-bold text-30rpx leading-42rpx">+ {{ item.amount }}</view>
|
||||
<wd-icon name="arrow-right" size="26rpx" color="#666"></wd-icon>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="mt-12rpx">
|
||||
<view class="flex items-center">
|
||||
<view class="rounded-4rpx w-60rpx text-center text-[#40AE36] border-2rpx border-solid border-[#40AE36] text-22rpx pb-4rpx">团购</view>
|
||||
<!-- <view class="rounded-4rpx w-60rpx text-center text-[#FF5951] border-2rpx border-solid border-[#FF5951] text-22rpx pb-4rpx">直营</view> -->
|
||||
<view class="text-24rpx text-[#606266] leading-34rpx ml-10rpx">上海.茶址24小时智能茶室(中新店)</view>
|
||||
<view class="rounded-4rpx w-60rpx text-center text-[#40AE36] border-2rpx border-solid border-[#40AE36] text-22rpx pb-4rpx" v-if="item.change_type == 4">团购</view>
|
||||
<view class="rounded-4rpx w-60rpx text-center text-[#FF5951] border-2rpx border-solid border-[#FF5951] text-22rpx pb-4rpx" v-if="item.change_type == 1 || item.change_type == 2">直营</view>
|
||||
<view class="text-24rpx text-[#606266] leading-34rpx ml-10rpx">{{ item?.store?.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="mt-14rpx text-24rpx text-[#909399] leading-34rpx">
|
||||
核销时间:2025-08-05 19:09:52
|
||||
核销时间:{{ item.update_time }}
|
||||
</view>
|
||||
</view>
|
||||
</mescroll-body>
|
||||
@ -87,9 +81,13 @@
|
||||
import { router } from '@/utils/tools'
|
||||
import { onPageScroll, onReachBottom } from '@dcloudio/uni-app'
|
||||
import useMescroll from "@/uni_modules/mescroll-uni/hooks/useMescroll.js"
|
||||
import { getStoreIncomeList } from '@/api/store'
|
||||
import { useStoreStore } from '@/store'
|
||||
import { getUserInfo } from '@/api/user'
|
||||
|
||||
const OSS = inject('OSS')
|
||||
const navbarHeight = inject('navbarHeight')
|
||||
const useStore = useStoreStore()
|
||||
|
||||
// mescroll相关
|
||||
const { mescrollInit, downCallback, getMescroll } = useMescroll(onPageScroll, onReachBottom) // 调用mescroll的hook
|
||||
@ -101,37 +99,67 @@
|
||||
textNoMore: '~ 已经到底啦 ~', //无更多数据的提示
|
||||
}
|
||||
const list = ref<Array<any>>([]) // 茶艺师列表
|
||||
|
||||
const userFinance = ref<any>({})
|
||||
const allPrice = ref<number>(0)
|
||||
|
||||
// 日期过滤
|
||||
const value = ref<number>(Date.now())
|
||||
|
||||
onLoad((args) => {
|
||||
onLoad(async (args) => {
|
||||
await Finance.handleGetFinanceData()
|
||||
})
|
||||
|
||||
const Finance = {
|
||||
// 上拉加载的回调: 其中num:当前页 从1开始, size:每页数据条数,默认10
|
||||
upCallback: (mescroll) => {
|
||||
|
||||
// getTeaSpecialistOrderList(filter).then((res) => {
|
||||
// const curPageData = res.list || [] // 当前页数据
|
||||
// if(mescroll.num == 1) list.value = [] // 第一页需手动制空列表
|
||||
// list.value = list.value.concat(curPageData) //追加新数据
|
||||
// mescroll.endSuccess(curPageData.length, Boolean(res.more))
|
||||
// }).catch(() => {
|
||||
mescroll.endErr() // 请求失败, 结束加载
|
||||
// })
|
||||
},
|
||||
|
||||
// 确认日期-
|
||||
handleConfirmDate: (date: {value: number}) => {
|
||||
const d = new Date(date.value)
|
||||
console.log("🚀 ~ d:", d)
|
||||
const year = d.getFullYear()
|
||||
const month = d.getMonth() + 1
|
||||
console.log(`${year}年${month}月`);
|
||||
/**
|
||||
* 初始化财务数据
|
||||
*/
|
||||
handleGetFinanceData: async () => {
|
||||
try {
|
||||
const res = await getUserInfo()
|
||||
userFinance.value = res
|
||||
} catch(e) {
|
||||
}
|
||||
},
|
||||
|
||||
upCallback: (mescroll) => {
|
||||
const filter = {
|
||||
page: mescroll.num,
|
||||
size: mescroll.size,
|
||||
store_id: useStore.defaultStore.id,
|
||||
times: Finance.handleFormatDate(value.value)
|
||||
}
|
||||
|
||||
getStoreIncomeList(filter).then((res) => {
|
||||
console.log("🚀 ~ res:", res)
|
||||
const curPageData = res.list || [] // 当前页数据
|
||||
if(mescroll.num == 1) list.value = [] // 第一页需手动制空列表
|
||||
list.value = list.value.concat(curPageData) //追加新数据
|
||||
allPrice.value = res.all_price || 0
|
||||
mescroll.endSuccess(curPageData.length, Boolean(res.more))
|
||||
}).catch(() => {
|
||||
mescroll.endErr() // 请求失败, 结束加载
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 确认日期
|
||||
* @param date
|
||||
*/
|
||||
handleConfirmDate: (date: {value: number}) => {
|
||||
list.value = []
|
||||
getMescroll().resetUpScroll();
|
||||
},
|
||||
|
||||
/**
|
||||
* 格式化时间
|
||||
*/
|
||||
handleFormatDate: (timestamp: number) => {
|
||||
const d = new Date(timestamp)
|
||||
const year = d.getFullYear()
|
||||
const month = d.getMonth() + 1
|
||||
const monthStr = month < 10 ? `0${month}` : `${month}`
|
||||
return `${year}-${monthStr}`
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user