完善账单详情

This commit is contained in:
wangxiaowei
2025-12-20 23:34:11 +08:00
parent a2f1023de8
commit bbaba61b51
5 changed files with 129 additions and 19 deletions

View File

@ -163,4 +163,11 @@ export function checkDouyinCoupon(data: ICheckDouyinCouponParams) {
*/
export function getUserMember() {
return http.Post<any>('/api/user/UserMember')
}
}
/**
* 流水账单详情
*/
export function getUserBillDetails(id: number) {
return http.Post<any>('/api/user/accountDetails', {id})
}

View File

@ -16,7 +16,7 @@
<view class="mt-28rpx mx-32rpx bg-white rounded-16rpx py-30rpx">
<view class="flex items-center">
<view class="w-8rpx h-32rpx bg-[#4C9F44] mr-22rpx"></view>
<view class="font-bold text-28rpx leading-40rpx text-[#303133]">订单号1744601722882174</view>
<view class="font-bold text-28rpx leading-40rpx text-[#303133]">订单号{{ bill.source_sn }}</view>
</view>
<view class="mt-16rpx mb-20rpx border-b-2rpx border-b-solid border-[#E5E5E5] mx-18rpx"></view>
@ -24,11 +24,11 @@
<view class="text-28rpx leading-40rpx text-[#606266] mx-28rpx">
<view class="flex justify-between items-center mb-16rpx">
<view>消费类型</view>
<view>茶艺师预定</view>
<view>{{ billType }}</view>
</view>
<view class="flex justify-between items-center mb-16rpx">
<view>交易方式</view>
<view>微信支付</view>
<view>{{ bill.change_object == 1 ? '余额支付' : '微信支付' }}</view>
</view>
<view class="flex justify-between items-center mb-16rpx">
<view>消费金额</view>
@ -39,22 +39,22 @@
<view class="mt-26rpx mb-20rpx border-b-2rpx border-b-dashed border-[#E5E5E5] mx-18rpx"></view>
<view class="text-28rpx leading-40rpx text-[#606266] mx-28rpx">
<view class="flex justify-between items-center mb-16rpx">
<!-- <view class="flex justify-between items-center mb-16rpx">
<view>茶艺师</view>
<view>茶艺师的昵称</view>
</view>
</view> -->
<!-- 如果是茶室预定类型则显示消费门店 -->
<view class="flex justify-between items-center mb-16rpx">
<view class="flex justify-between items-center mb-16rpx" v-if="bill.change_type == 1 || bill.change_type == 2 || bill.change_type == 3">
<view>消费门店</view>
<view>茶艺师的昵称</view>
</view>
<view>{{ bill.store.name }}</view>
</view>
<view class="flex justify-between items-center mb-16rpx">
<view>下单时间</view>
<view>2025-04-25 04:43</view>
<view>{{ bill.create_time }}</view>
</view>
<view class="flex justify-between items-center mb-16rpx">
<view>支付时间</view>
<view>2025-04-25 04:43</view>
<view>{{ bill.create_time }}</view>
</view>
</view>
</view>
@ -63,8 +63,39 @@
<script lang="ts" setup>
const OSS = inject('OSS')
import { getUserBillDetails } from '@/api/user'
const id = ref<number>(0)
const bill = ref({
id: 0,
change_type: 0,
create_time: '',
source_sn: '',
change_object: '',
store: {
name: ''
}
})
const type = ref<string>('')
onLoad(async (args) => {
id.value = Number(args.id) || 0
const res = await getUserBillDetails(id.value)
bill.value = res.data
})
const billType = computed(() => {
switch (bill.value.change_type) {
case 1:
return '包间预定'
case 2:
return '包间续订'
case 3:
return '购买套餐'
case 4:
return '开通会员'
}
})
</script>
<style lang="scss">

View File

@ -0,0 +1,56 @@
<route lang="jsonc" type="page">{
// "needLogin": true,
"layout": "default",
"style": {
"navigationStyle": "custom"
}
}</route>
<template>
<view class="mt-26rpx mx-30rpx">
<bill-notice :type="type" :money="10.00" :time="bill.create_time" :order="bill.source_sn"></bill-notice>
</view>
</template>
<script lang="ts" setup>
import { getUserBillDetails } from '@/api/user'
import BillNotice from '@/components/notice/Bill.vue'
const OSS = inject('OSS')
const id = ref<number>(0)
const bill = ref({
id: 0,
change_type: 0,
create_time: '',
source_sn: ''
})
const type = ref<string>('')
onLoad(async (args) => {
id.value = Number(args.id) || 0
const res = await getUserBillDetails(id.value)
bill.value = res.data
switch (bill.value.change_type) {
case 5:
type.value = 'refund'
break
case 6:
type.value = 'recharge'
break
default:
type.value = ''
break
}
console.log("🚀 ~ bill.value:", type.value)
})
</script>
<style lang="scss">
page {
background-color: $cz-page-background;
}
</style>

View File

@ -89,6 +89,7 @@
import useMescroll from "@/uni_modules/mescroll-uni/hooks/useMescroll.js"
import { useUserStore } from '@/store'
import { getUserInfo, getUserMoneyLog } from '@/api/user'
import { router } from '@/utils/tools'
const OSS = inject('OSS')
const userStore = useUserStore()
@ -156,18 +157,25 @@
* 去充值
*/
handleToRecharge: () => {
uni.navigateTo({
url: '/bundle/wallet/recharge'
})
router.navigateTo('/bundle/wallet/recharge')
},
/**
* 跳转对应账单详情
*/
handleToBillDetail: (id: number) => {
uni.navigateTo({
url: `/bundle/wallet/bill?id=${id}`
})
handleToBillDetail: (item: any) => {
switch (item.change_type) {
case 1: // 包间预定
case 2: // 包间续订
case 3: // 套餐购买
case 4: // 开通会员
router.navigateTo(`/bundle/wallet/bill?id=${item.id}`)
break
case 5: // 退款
case 6: // 充值
router.navigateTo(`/bundle/wallet/pay-bill?id=${item.id}`)
break
}
}
}
</script>

View File

@ -316,6 +316,14 @@
"navigationStyle": "custom"
}
},
{
"path": "wallet/pay-bill",
"type": "page",
"layout": "default",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "wallet/recharge",
"type": "page",