对接订单相关接口

This commit is contained in:
wangxiaowei
2025-12-19 01:39:09 +08:00
parent 10aae8ea46
commit eee48dd9aa
13 changed files with 379 additions and 810 deletions

View File

@ -17,7 +17,7 @@
<wd-search v-model="keywords" hide-cancel placeholder-left light placeholder="搜索订单信息"></wd-search>
</view> -->
<view class="search-box flex items-center ml-26rpx" @click="Order.handleToSearch">
<wd-search placeholder="搜索茶址名称" hide-cancel disabled :placeholder-left="true"
<wd-search placeholder="搜索订单信息" hide-cancel disabled :placeholder-left="true"
placeholderStyle="text-align:left;padding-left: 24rpx;line-heigt: 44rpx;color: #C9C9C9; font-size: 32rpx;font-weight: normal;">
</wd-search>
</view>
@ -36,10 +36,13 @@
<view class="tabs mt-18rpx mx-30rpx">
<mescroll-body ref="mescrollItem0" @init="mescrollInit" @down="downCallback" @up="Order.upCallback" :down="downOption" :up="upOption">
<view class="mb-20rpx" v-for="(item, index) in list" :key="index">
<combo-card :type="OrderSource.Admin" :order="item"></combo-card>
<combo-card :type="OrderSource.Admin" :order="item" @refresh="Order.handleResetSearch"></combo-card>
</view>
</mescroll-body>
</view>
<!-- 弹出框 -->
<wd-message-box></wd-message-box>
</view>
</template>
@ -50,6 +53,10 @@
import useMescroll from "@/uni_modules/mescroll-uni/hooks/useMescroll.js"
import { OrderSource, AdminOrderStatusText, TeaSpecialistOrderStatusText, TeaSpecialistOrderStatusValue } from '@/utils/order'
import { router } from '@/utils/tools'
import { getStoreOrderList} from '@/api/order'
import { useStoreStore } from '@/store'
const useStore = useStoreStore()
/* mescroll */
const { mescrollInit, downCallback, getMescroll } = useMescroll(onPageScroll, onReachBottom) // 调用mescroll的hook
@ -87,21 +94,22 @@
const Order = {
// 上拉加载的回调: 其中num:当前页 从1开始, size:每页数据条数,默认10
upCallback: (mescroll) => {
// const filter = {
// page: mescroll.num,
// size: mescroll.size,
// order_status: orderStatus.value,
// search: keywords.value
// }
const filter = {
page: mescroll.num,
size: mescroll.size,
store_id: useStore.defaultStore.id,
order_status: '',
search: keywords.value,
}
// 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(() => {
getStoreOrderList(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() // 请求失败, 结束加载
// })
})
},
/**
@ -122,8 +130,6 @@
* 重置搜索
*/
handleResetSearch: () => {
console.log("🚀 ~ location:", 456)
list.value = []
getMescroll().resetUpScroll()
},