完善接口

This commit is contained in:
wangxiaowei
2025-12-19 21:30:26 +08:00
parent 09c86fa8ca
commit efc0d6fbd2
10 changed files with 351 additions and 139 deletions

View File

@ -14,23 +14,23 @@
<view>
<mescroll-body ref="mescrollItem0" @init="mescrollInit" @down="downCallback" @up="UserList.upCallback" :down="downOption" :up="upOption">
<view class="mb-22rpx">
<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="router.navigateTo('/bundle/user/user-detail')">
<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="ml-20rpx">
<view class="flex items-center">
<view class="font-bold text-28rpx text-[#303133] leading-40rpx mr-12rpx">用户昵称</view>
<view class="font-bold text-28rpx text-[#303133] leading-40rpx mr-12rpx">{{ item?.user?.nickname }}</view>
<!-- TODO 如果是vip的话才显示这个皇冠 -->
<view>
<view v-if="item?.user?.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">13525626532</view>
<view class="mt-10rpx text-24rpx text-[#F29747] leading-34rpx w-400rpx line-1">这里是备注信息备注信息这里是备注信息备注信息</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>
</view>
<view @click="UserList.handleCall">
<view @click="UserList.handleCall(item?.user?.mobile)" class="p-10rpx">
<wd-img width="64rpx" height='64rpx' :src="`${OSS}icon/icon_phone3.png`"></wd-img>
</view>
</view>
@ -48,8 +48,13 @@
<script lang="ts" setup>
import { router } from '@/utils/tools'
import { toTimes, copy } from '@/utils/tools'
import { getStoreMemberList } from '@/api/store'
import { onPageScroll, onReachBottom } from '@dcloudio/uni-app'
import useMescroll from "@/uni_modules/mescroll-uni/hooks/useMescroll.js"
import { useStoreStore } from '@/store'
const OSS = inject('OSS')
const useStore = useStoreStore()
// mescroll
const { mescrollInit, downCallback, getMescroll } = useMescroll(onPageScroll, onReachBottom) // 调用mescroll的hook
@ -62,7 +67,6 @@
}
const list = ref<Array<any>>([]) // 茶室列表
const OSS = inject('OSS')
onLoad((args) => {
})
@ -74,16 +78,36 @@
*/
upCallback: (mescroll) => {
// 需要留一下数据为空的时候显示的空数据图标内容
// getTeaRoomOrderList(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,
}
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(() => {
mescroll.endErr() // 请求失败, 结束加载
// })
})
},
/**
* 跳转用户详情
* @param id
*/
handleToDetail: (id) => {
uni.$on('refreshUserDetail', () => {
uni.$off('refreshUserDetail')
list.value = []
getMescroll().resetUpScroll()
})
router.navigateTo(`/bundle/user/user-detail?id=${id}`)
},
/**
* 电话
* @param phone