优化功能

This commit is contained in:
wangxiaowei
2026-01-14 18:13:43 +08:00
parent 59859a2363
commit 627280bb7e
6 changed files with 100 additions and 63 deletions

View File

@ -276,3 +276,17 @@ export function deleteRechargeActivity(id: number) {
export function toggleRechargeActivityStatus(data: {store_id: number, state: number}) {
return http.Post('/storeapi/Store/operateRecharge', data)
}
/**
* 获取门店充值明细列表
*/
export interface IGetStoreRechargeListParams {
page: number
size: number
store_id: number
month?: string
}
export function getStoreRechargeList(data: IGetStoreRechargeListParams) {
return http.Post<any>('/storeapi/user/storeRechargeLists', data)
}

View File

@ -22,7 +22,7 @@
</view>
<view class="mt-30rpx text-40rpx text-[#303133] leading-56rpx text-center">
<text class="font-bold" v-if="bill.change_type == 1 || bill.change_type == 2 || bill.change_type == 4">+</text>
<text class="font-bold" v-if="bill.change_type == 1 || bill.change_type == 2 || bill.change_type == 4 || bill.change_type == 9">+</text>
<text class="font-bold" v-if="bill.change_type == 3 || bill.change_type == 5">-</text>
{{ bill.amount }}
</view>

View File

@ -53,7 +53,7 @@
<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">
<text v-if="item.change_type == 1 || item.change_type == 2 || item.change_type == 4"> + </text>
<text v-if="item.change_type == 1 || item.change_type == 2 || item.change_type == 4 || item.change_type == 9"> + </text>
<text v-if="item.change_type == 3 || item.change_type == 5"> - </text>
{{ item.amount }}
</view>
@ -67,6 +67,7 @@
<text v-if="item.change_type == 1">预定</text>
<text v-if="item.change_type == 2">续单</text>
<text v-if="item.change_type == 4">核销</text>
<text v-if="item.change_type == 9">充值</text>
</view>
<view class="rounded-4rpx min-w-60rpx text-center text-[#FF5951] border-2rpx border-solid border-[#FF5951] text-22rpx pb-4rpx" v-if="item.change_type == 3 || item.change_type == 5">
<text v-if="item.change_type == 3">提现</text>
@ -82,6 +83,7 @@
<text v-if="item.change_type == 3">提现时间{{ item.create_time }}</text>
<text v-if="item.change_type == 4">核销时间{{ item.create_time }}</text>
<text v-if="item.change_type == 5">取消订单时间{{ item.create_time }}</text>
<text v-if="item.change_type == 9">充值时间{{ item.create_time }}</text>
</view>
</view>
</mescroll-body>

View File

@ -13,41 +13,41 @@
<view class="">
<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="RechargeList.handleConfirmDate"></wd-datetime-picker>
<wd-datetime-picker v-model="filterDate" :maxDate="Date.now()" type="year-month" @confirm="RechargeList.handleConfirmDate"></wd-datetime-picker>
</view>
</view>
<view class="flex items-center font-400 text-24rpx leading-34rpx text-[#606266] mx-30rpx">
<view class="mr-130rpx">充值¥2000.46</view>
<view class="">赠金¥500.00</view>
<view class="mr-130rpx">充值¥{{ totalRechargeMoney }}</view>
<view class="">赠金¥{{ totalGiftMoney }}</view>
</view>
<view class="mx-30rpx mt-20rpx">
<mescroll-body ref="mescrollItem0" @init="mescrollInit" @down="downCallback" @up="RechargeList.upCallback" :down="downOption" :up="upOption">
<view class="bg-white rounded-16rpx px-30rpx py-28rpx mb-20rpx" @click="router.navigateTo(`/bundle/user/recharge-detail?id=1`)">
<view class="bg-white rounded-16rpx px-30rpx py-28rpx mb-20rpx" v-for="item in list" :key="item.id">
<!-- <view class="bg-white rounded-16rpx px-30rpx py-28rpx mb-20rpx" @click="router.navigateTo(`/bundle/user/recharge-detail?id=${item.id}`)" v-for="item in list" :key="item.id"> -->
<view class="flex items-center justify-between">
<view class="font-bold text-30rpx text-[#303133] leading-42rpx">门店充值1000送500</view>
<view class="font-bold text-30rpx text-[#303133] leading-42rpx">门店充值{{ item.recharge_price }}{{ item.gift_price }}</view>
<view class="flex items-center">
<view class="text-[#FF5951] font-bold text-30rpx leading-42rpx">+1000.00</view>
<view class="">
<view class="text-[#FF5951] font-bold text-30rpx leading-42rpx">+{{ item.recharge_price }}</view>
<!-- <view class="">
<wd-icon name="arrow-right" size="32rpx" color="#666"></wd-icon>
</view>
</view> -->
</view>
</view>
<view class="mt-12rpx text-24rpx leading-34rpx text-[#606266] flex items-center">
<view class="w-300rpx mr-52rpx">客户昵称茶址客户昵称</view>
<view class="w-240rpx">手机13585423654</view>
<view class="w-300rpx mr-52rpx">客户昵称{{ item.nickname || '--' }}</view>
<view class="w-240rpx">手机{{ item.mobile }}</view>
</view>
<view class="mt-12rpx text-24rpx leading-34rpx text-[#F29747] flex items-center">
<view class="w-300rpx mr-52rpx">充值金额1000</view>
<view class="w-240rpx">赠金500</view>
<view class="w-300rpx mr-52rpx">充值金额{{ item.recharge_price }}</view>
<view class="w-240rpx">赠金{{ item.gift_price }}</view>
</view>
<view class="mt-12rpx text-24rpx leading-34rpx text-[#909399]">
充值时间2025-08-05 19:09:52
充值时间{{ item.pay_time }}
</view>
</view>
</mescroll-body>
@ -64,6 +64,7 @@
import { onPageScroll, onReachBottom } from '@dcloudio/uni-app'
import useMescroll from "@/uni_modules/mescroll-uni/hooks/useMescroll.js"
import { useStoreStore } from '@/store'
import { getStoreRechargeList } from '@/api/store'
const OSS = inject('OSS')
const useStore = useStoreStore()
@ -78,9 +79,11 @@
textNoMore: '~ 已经到底啦 ~', //无更多数据的提示
}
const list = ref<Array<any>>([]) // 茶室列表
const totalRechargeMoney = ref<number>(0) // 总充值金额
const totalGiftMoney = ref<number>(0) // 总赠金金额
// 日期过滤
const value = ref<number>(Date.now())
const filterDate = ref<number>(Date.now())
onLoad((args) => {
})
@ -91,21 +94,26 @@
* @param mescroll
*/
upCallback: (mescroll) => {
// 需要留一下数据为空的时候显示的空数据图标内容
// const filter = {
// page: mescroll.num,
// size: mescroll.size,
// store_id: useStore.defaultStore.id,
// }
// getStoreMemberList(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(() => {
// 需要留一下数据为空的时候显示的空数据图标内容
const filter = {
page: mescroll.num,
size: mescroll.size,
store_id: useStore.defaultStore.id,
month: RechargeList.handleFormatDate(filterDate.value)
}
getStoreRechargeList(filter).then((res) => {
totalRechargeMoney.value = res.total_recharge_price // 总充值金额
totalGiftMoney.value = res.total_gift_price // 总赠金金额
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() // 请求失败, 结束加载
// })
})
},
/**
@ -136,6 +144,17 @@
handleSearch: () => {
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>

View File

@ -29,11 +29,11 @@
</view>
<!-- TODO VIP显示这块内容 -->
<view class="relative mt-22rpx" v-if="user.member == 1">
<view class="relative mt-22rpx">
<wd-img width="650rpx" height='70rpx' :src="`${OSS}images/store/user/image1.png`"></wd-img>
<view class="absolute top-18rpx left-28rpx flex items-center">
<wd-img width="40rpx" height='40rpx' :src="`${OSS}icon/icon_vip.png`"></wd-img>
<view class="font-400 text-24rpx text-[#EECC99] leading-34rpx ml-18rpx">{{ user.expiration_time }}到期</view>
<view class="font-400 text-24rpx text-[#EECC99] leading-34rpx ml-18rpx">{{ user.expiration_time || '--' }}到期</view>
</view>
</view>

View File

@ -44,13 +44,13 @@
<view class="text-[#7B4FE1] flex items-center ml-78rpx mt-30rpx">
<view class="flex flex-col items-center justify-center mr-100rpx">
<view class="font-bold text-32rpx leading-44rpx">150,000.00</view>
<view class="font-bold text-32rpx leading-44rpx">{{ totalRechargeMoney || 0 }}</view>
<view class="mt-12rpx font-400 text-28rpx leading-40rpx">实际充值()</view>
</view>
<view class="flex flex-col items-center justify-center">
<view class="font-bold text-32rpx leading-44rpx">10,000.00</view>
<!-- <view class="flex flex-col items-center justify-center">
<view class="font-bold text-32rpx leading-44rpx">{{ totalGiftMoney || 0 }}</view>
<view class="mt-12rpx font-400 text-28rpx leading-40rpx">赠金()</view>
</view>
</view> -->
</view>
</view>
</view>
@ -80,32 +80,29 @@
</view>
</view>
<view>
<view class="mt-24rpx mx-30rpx">
<mescroll-body ref="mescrollItem0" @init="mescrollInit" @down="downCallback" @up="UserList.upCallback" :down="downOption" :up="upOption">
<view class="mb-22rpx" v-for="item in list" :key="item.id">
<view class="mx-64rpx flex justify-between items-center mb-10rpx">
<view class="flex items-center" @click="UserList.handleToDetail(item?.user?.id)">
<wd-img width="100rpx" height='100rpx' src="https://shchazhi.oss-cn-hangzhou.aliyuncs.com/fronted/icon/icon_avatar.png" :round="true"></wd-img>
<view class="mb-22rpx bg-white rounded-16rpx" v-for="item in list" :key="item.id">
<view class="px-34rpx py-14rpx flex justify-between items-center mb-10rpx">
<view class="flex items-center" @click="UserList.handleToDetail(item.user_id)">
<wd-img width="100rpx" height='100rpx' :src="item.avatar" :round="true"></wd-img>
<view class="ml-20rpx">
<view class="flex items-center">
<view class="font-bold text-28rpx text-[#303133] leading-40rpx mr-12rpx">{{ item?.user?.nickname }}</view>
<view class="font-bold text-28rpx text-[#303133] leading-40rpx mr-12rpx">{{ item.nickname }}</view>
<!-- TODO 如果是vip的话才显示这个皇冠 -->
<view v-if="item?.user?.member == 1">
<view v-if="item.member == 1">
<wd-img width="40rpx" height='40rpx' :src="`${OSS}icon/icon_crown.png`"></wd-img>
</view>
</view>
<view class="mt-14rpx font-400 text-26rpx text-[#303133] leading-36rpx">{{ item?.user?.mobile }}</view>
<view class="mt-10rpx text-24rpx text-[#F29747] leading-34rpx w-400rpx line-1">{{ item?.remark }}</view>
<view class="mt-14rpx font-400 text-26rpx text-[#303133] leading-36rpx">{{ item.mobile }}</view>
<view class="mt-14rpx font-400 text-26rpx text-[#303133] leading-36rpx">门店余额{{ item.store_money || '--' }}</view>
<view class="mt-10rpx text-24rpx text-[#F29747] leading-34rpx w-400rpx line-1">{{ item.remark }}</view>
</view>
</view>
<view @click="UserList.handleCall(item?.user?.mobile)" class="p-10rpx">
<view @click="UserList.handleCall(item.mobile)" class="p-10rpx">
<wd-img width="64rpx" height='64rpx' :src="`${OSS}icon/icon_phone3.png`"></wd-img>
</view>
</view>
<view class="mx-30rpx">
<wd-gap height="2rpx" bg-color="#E5E5E5"></wd-gap>
</view>
</view>
</mescroll-body>
</view>
@ -137,10 +134,12 @@
const keywords = ref<string>('') // 搜索关键词
const menuTab = ref([
{type: 'all', name: '全部'},
{type: 'recharge', name: '充值卡'},
{type: 'vip', name: '会员卡'},
// {type: 'recharge', name: '充值卡'},
// {type: 'vip', name: '会员卡'},
])
const currentTab = ref<string>('all')
const totalRechargeMoney = ref<number>(0) // 总充值金额
const totalGiftMoney = ref<number>(0) // 总赠送金额
onLoad((args) => {
})
@ -152,20 +151,23 @@
*/
upCallback: (mescroll) => {
// 需要留一下数据为空的时候显示的空数据图标内容
// const filter = {
// page: mescroll.num,
// size: mescroll.size,
// store_id: useStore.defaultStore.id,
// }
const filter = {
page: mescroll.num,
size: mescroll.size,
store_id: useStore.defaultStore.id,
search: keywords.value,
}
// getStoreMemberList(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(() => {
getStoreMemberList(filter).then((res) => {
totalRechargeMoney.value = res.totalMoney
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() // 请求失败, 结束加载
// })
})
},
/**