初始化提交
This commit is contained in:
155
src/bundle/finance/detail.vue
Normal file
155
src/bundle/finance/detail.vue
Normal file
@ -0,0 +1,155 @@
|
||||
<route lang="jsonc" type="page">{
|
||||
"layout": "default",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarBackgroundColor": "#fff"
|
||||
}
|
||||
}</route>
|
||||
|
||||
<template>
|
||||
<view>
|
||||
<view>
|
||||
<navbar title="订单详情" custom-class="!bg-[transparent]"></navbar>
|
||||
</view>
|
||||
|
||||
<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" 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>¥{{ 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" 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 v-if="isDirectSale">
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view>预定门店</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>{{ bill?.order?.update_dtime }}</view>
|
||||
</view>
|
||||
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view>预约时长</view>
|
||||
<view>{{ bill?.order?.hours }}小时</view>
|
||||
</view>
|
||||
|
||||
<view class="mt-20rpx">
|
||||
<wd-gap height="2rpx" bg-color="#E5E5E5"></wd-gap>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 直营和团购都显示 -->
|
||||
<view>
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view>总收入</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>-¥{{ bill?.order?.coupon_price }}</view>
|
||||
</view>
|
||||
|
||||
<view class="mt-20rpx">
|
||||
<wd-gap height="2rpx" bg-color="#E5E5E5"></wd-gap>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view>订单编号</view>
|
||||
<view>
|
||||
<text>{{ bill?.order?.order_sn }}</text>
|
||||
<wd-divider vertical />
|
||||
<text class="text-[#4C9F44]" @click="copy(bill?.order?.order_sn)">复制</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 直营显示 -->
|
||||
<view v-if="isDirectSale" class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<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>{{ bill?.order?.dtime }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 团购显示 -->
|
||||
<view v-if="isGroupBuy">
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view>验券时间</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>{{ bill?.store?.name }}</view>
|
||||
</view>
|
||||
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view>券号</view>
|
||||
<view>{{ bill?.order?.group?.qr_sn }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 直营显示 -->
|
||||
<view v-if="isDirectSale" class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view>付款时间</view>
|
||||
<view>{{ bill?.order?.dtime }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { toTimes, copy } from '@/utils/tools'
|
||||
import { getUserTransactionDetailsInfo } from '@/api/user'
|
||||
|
||||
const OSS = inject('OSS')
|
||||
const bill = ref<any>({})
|
||||
|
||||
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">
|
||||
page {
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
185
src/bundle/finance/finance.vue
Normal file
185
src/bundle/finance/finance.vue
Normal file
@ -0,0 +1,185 @@
|
||||
<route lang="jsonc" type="page">{
|
||||
"layout": "default",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarBackgroundColor": "#F6F7F8"
|
||||
}
|
||||
}</route>
|
||||
|
||||
<template>
|
||||
<view class="home-bg pb-80rpx">
|
||||
<view class="home-bg w-[100%] fixed top-0 left-0 z-100">
|
||||
<wd-navbar left-arrow safeAreaInsetTop title="财务管理" :bordered="false" custom-style="background-color: transparent !important;" @click-left="router.navigateBack()"></wd-navbar>
|
||||
</view>
|
||||
|
||||
<view :style="{ paddingTop: navbarHeight + 'px' }">
|
||||
<view class="relative mx-30rpx mt-16rpx">
|
||||
<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">{{ 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">{{ 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">{{ userFinance.balance }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="mx-30rpx">
|
||||
<view class="flex items-center">
|
||||
<view class="font-bold text-[#303133] datetime-picker">
|
||||
<wd-datetime-picker v-model="value" :maxDate="Date.now()" type="year-month" @confirm="Finance.handleConfirmDate"></wd-datetime-picker>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="font-400 text-24rpx text-[#606266] leading-34rpx">
|
||||
收入¥{{ 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 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">【{{ item?.room?.title }}】{{ item?.group?.title || '' }}</view>
|
||||
<view class="flex items-center">
|
||||
<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" 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">
|
||||
核销时间:{{ item.update_time }}
|
||||
</view>
|
||||
</view>
|
||||
</mescroll-body>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { router } from '@/utils/tools'
|
||||
import { onPageScroll, onReachBottom } from '@dcloudio/uni-app'
|
||||
import useMescroll from "@/uni_modules/mescroll-uni/hooks/useMescroll.js"
|
||||
import { getStoreIncomeList, getStoreDetails } 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
|
||||
const downOption = {
|
||||
auto: true
|
||||
}
|
||||
const upOption = {
|
||||
auto: true,
|
||||
textNoMore: '~ 已经到底啦 ~', //无更多数据的提示
|
||||
}
|
||||
const list = ref<Array<any>>([]) // 茶艺师列表
|
||||
const userFinance = ref<any>({})
|
||||
const allPrice = ref<number>(0)
|
||||
|
||||
// 日期过滤
|
||||
const value = ref<number>(Date.now())
|
||||
|
||||
onLoad(async (args) => {
|
||||
await Finance.handleGetFinanceData()
|
||||
})
|
||||
|
||||
const Finance = {
|
||||
/**
|
||||
* 初始化财务数据
|
||||
*/
|
||||
handleGetFinanceData: async () => {
|
||||
try {
|
||||
const res = await getStoreDetails(useStore.defaultStore.id)
|
||||
userFinance.value = res.details
|
||||
console.log("🚀 ~ userFinance.value:", userFinance.value)
|
||||
} 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) => {
|
||||
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>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background-color: $cz-page-background;
|
||||
// background: linear-gradient( 176deg, #D2EDFF 0%, rgba(119,199,255,0) 100%);
|
||||
}
|
||||
|
||||
.home-bg {
|
||||
background: linear-gradient( 176deg, #D2EDFF 0%, rgba(119,199,255,0) 100%);
|
||||
// background-image: url(#{$OSS}images/store/finance/image1.png);
|
||||
background-size: 100% 588rpx;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.datetime-picker {
|
||||
:deep() {
|
||||
.wd-cell {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user