288 lines
8.5 KiB
Vue
288 lines
8.5 KiB
Vue
<template>
|
||
<tpx-layout>
|
||
<template v-slot:header>
|
||
|
||
<view class="pt-30">
|
||
<view class="com-jianju" style="padding: 30rpx;background-color:#B12D29;border-radius: 30rpx;">
|
||
<u-row justify="between">
|
||
<view class="clr-wht font-32 font-weight">订单概况</view>
|
||
|
||
<tpx-select mode="drop" v-model:value="searchParam.keyword" :list="dateRangeList" customInput="true">
|
||
<view style="width: 200rpx;;">
|
||
<u-button @click="handleSearchMoreBtn()" :hairline="false" shape="circle" size="mini" custom-style="border-radius: 23rpx;font-size: 26rpx;height: 50rpx;width: 130rpx;">
|
||
<u-row justify="between" custom-style="width: 100%;">
|
||
<view :style="'padding-right: 4rpx;white-space: nowrap;' + (hasExtSchParam?'color: #B12D29;':'color: #666;')">
|
||
统计
|
||
</view>
|
||
<u-icon :name="showSearchMore?'arrow-up-fill':'arrow-down-fill'"
|
||
color="#666" size="18" custom-style="margin-top: 2rpx;"
|
||
></u-icon>
|
||
</u-row>
|
||
</u-button>
|
||
</view>
|
||
</tpx-select>
|
||
</u-row>
|
||
|
||
<u-row justify="between" custom-style="margin-top:30rpx;">
|
||
<view style="flex: 1;text-align: center;">
|
||
<u-text :text="5" color="#fff" bold="true" size="40" align="center"></u-text>
|
||
<view class="pt-20 clr-wht font-26" style="opacity: 0.8;">
|
||
<u-row justify="center">
|
||
<u-icon name="order" color="#fff" custom-style="opacity: 0.8;" size="30"></u-icon>
|
||
<text class="pl-10">待处理订单</text>
|
||
</u-row>
|
||
</view>
|
||
</view>
|
||
<view>
|
||
<u-line direction="col" color="#fff" length="80"></u-line>
|
||
</view>
|
||
<view style="flex: 1;text-align: center;">
|
||
<u-text :text="118" color="#fff" bold="true" size="40" align="center"></u-text>
|
||
<view class="pt-20 clr-wht font-26" style="opacity: 0.8;">
|
||
<u-row justify="center">
|
||
<u-icon name="order" color="#fff" custom-style="opacity: 0.8;" size="30"></u-icon>
|
||
<text class="pl-10">累计处理订单</text>
|
||
</u-row>
|
||
</view>
|
||
</view>
|
||
</u-row>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="com-jianju" style="padding-top: 30rpx;">
|
||
<u-row justify="between" align="top">
|
||
<u-col span="12">
|
||
<!-- 订单状态 -->
|
||
<tpx-tabs :list="ordStatusList" v-model:value="searchParam.ordStatus"
|
||
@tabchange="(val)=> { handleSearchParamChange() }" v-slot="curOrdTab"
|
||
>
|
||
<text slot>
|
||
(<text>{{curOrdTab.item.val}}</text>)
|
||
</text>
|
||
</tpx-tabs>
|
||
</u-col>
|
||
</u-row>
|
||
</view>
|
||
</template>
|
||
<template v-slot:body>
|
||
<scroll-view :scroll-y="true" @scrolltolower="onScrollBottom()" class="pos-abt-all"
|
||
>
|
||
<view class="pgb-cont">
|
||
<!-- 列表数据 -->
|
||
<view v-for="(orItem) in ordList" class="ord-list-item">
|
||
<u-row justify="between">
|
||
<u-col span="11">
|
||
<u-row @click="handleDealItem(orItem, { type: 2 })">
|
||
<view>
|
||
<u-text :text="'运单号:'+ 'T7080304038'" size="26"></u-text>
|
||
</view>
|
||
<view class="pl-10">
|
||
<u-icon name="file-text" size="32" custom-style=""></u-icon>
|
||
</view>
|
||
</u-row>
|
||
</u-col>
|
||
</u-row>
|
||
|
||
<u-row @click="handleDealItem(orItem, { type: 1 })" custom-style="margin-top: 30rpx;" justify="center">
|
||
<u-col span="4">
|
||
<u-text :text="'中国上海'" size="30" :bold="true" align="center"></u-text>
|
||
<u-text :text="'张三'" size="26" color="#999" margin="20rpx 0 0 0"
|
||
align="center"></u-text>
|
||
</u-col>
|
||
<u-col span="4" justify="center" align="center" custom-style="text-align: center;">
|
||
<image style="width: 70rpx;height: 14rpx;" :src="getCdnUrl('search/toline.png')">
|
||
</image>
|
||
<!-- getCdnUrl('search/toline-grey.png') -->
|
||
<u-text :text="'待付款'" align="center" size="22" margin="10rpx 0 0 0"></u-text>
|
||
</u-col>
|
||
<u-col span="4">
|
||
<u-text :text="'越南'" size="30" :bold="true" align="center"></u-text>
|
||
<u-text :text="'李四'" size="26" color="#999" margin="20rpx 0 0 0"
|
||
align="center"></u-text>
|
||
</u-col>
|
||
</u-row>
|
||
|
||
<u-text :text="'签收时间:' + '2022-04-30 15:25'" color="#999" size="24"
|
||
margin="30rpx 0 0 0"></u-text>
|
||
|
||
<u-line color="#DEDEDE" margin="30rpx 0 0 0"></u-line>
|
||
|
||
<u-row justify="end" custom-style="margin-top:20rpx;">
|
||
<view style="display: inline-block;white-space: nowrap;">
|
||
<u-row>
|
||
<u-button @click="handleDealItem(orItem, { type: 4 })" shape="circle" type="primary"
|
||
:plain="true" custom-style="height: 54rpx;margin-left: 12rpx;">取消</u-button>
|
||
<u-button shape="circle" type="primary" :plain="true"
|
||
custom-style="height: 54rpx;margin-left: 12rpx;">立即开单</u-button>
|
||
</u-row>
|
||
</view>
|
||
|
||
</u-row>
|
||
|
||
</view>
|
||
|
||
<!-- 加载更多 -->
|
||
<u-loadmore icon-size="28" font-size="28" margin-top="30" v-if="showLoadMore || loadedAll"
|
||
:status="loadedAll ? 'nomore' : 'loading'" />
|
||
|
||
<!-- 空数据页 -->
|
||
<view v-if="ordList.length == 0" style="padding-top: 100rpx;">
|
||
<u-empty text="无数据" :icon="getCdnUrl('kong.png')" textSize="28" width="86" height="97">
|
||
</u-empty>
|
||
</view>
|
||
</view>
|
||
</scroll-view>
|
||
</template>
|
||
</tpx-layout>
|
||
|
||
</template>
|
||
<script>
|
||
import { ordStaEnum, dateRangeList, ordStatusList, payTypeEnum, payTypeList, dlvTypeEnum, dlvTypeList, dateTypeEnum, dateTypeList } from "@/common/enum"
|
||
|
||
export default {
|
||
props: {
|
||
// hasLeftWin: {
|
||
// type: Boolean
|
||
// }
|
||
},
|
||
computed: {
|
||
hasExtSchParam() {
|
||
let hasExt = false
|
||
const searchParam = this.searchParam
|
||
if(
|
||
(searchParam.postStatus && searchParam.postStatus.length > 0)
|
||
|| (searchParam.payType && searchParam.payType.length > 0)
|
||
|| (searchParam.date || (searchParam.dateType && searchParam.dateType != dateTypeEnum.custom) )
|
||
) {
|
||
hasExt = true
|
||
}
|
||
return hasExt
|
||
},
|
||
},
|
||
data() {
|
||
return {
|
||
...JSON.parse(JSON.stringify({ ordStaEnum, dateRangeList, ordStatusList, payTypeEnum, payTypeList, dlvTypeEnum, dlvTypeList, dateTypeEnum, dateTypeList })),
|
||
searchParam: {
|
||
keyword: '',
|
||
ordStatus: ordStatusList[0].val // 订单状态, 1:寄件; 2:收件; 3:待付款;
|
||
},
|
||
ordList: [
|
||
{}
|
||
// ,{},{},{},{},{},{},{}
|
||
],
|
||
showLoadMore: false,
|
||
loadedAll: false
|
||
}
|
||
},
|
||
onShareAppMessage() {
|
||
return {
|
||
// title: '',
|
||
// path: 'TODO'
|
||
}
|
||
},
|
||
onLoad() {
|
||
this.initData();
|
||
},
|
||
onUnload() {
|
||
},
|
||
methods: {
|
||
initData(){
|
||
// this.showLoading()
|
||
setTimeout(() => {
|
||
uni.stopPullDownRefresh();
|
||
}, 300);
|
||
},
|
||
loadListData() {
|
||
// 请求列表数据 TODO
|
||
console.log('====this.searchParam===', this.searchParam)
|
||
},
|
||
|
||
onScrollBottom() {
|
||
console.log("onScrollBottom");
|
||
if (this.loadedAll) {
|
||
return;
|
||
}
|
||
this.showLoadMore = true;
|
||
this.handleSearchParamChange();
|
||
},
|
||
handleSearchMoreBtn(){
|
||
if(!this.showLoadMore) {
|
||
// 回显更多条件
|
||
Object.keys(this.tmpSearchParam).map(t=> {
|
||
const val = this.searchParam[t]
|
||
typeof val != 'undefined' && (this.tmpSearchParam[t] = val)
|
||
})
|
||
}
|
||
this.showSearchMore = !this.showSearchMore
|
||
},
|
||
handleSearchParamChange(key, val) {
|
||
if(key) {
|
||
this.searchParam[key] = val
|
||
}
|
||
this.loadListData()
|
||
},
|
||
async handleDealItem(item, deal = { type: '1' }) {
|
||
switch (deal.type){
|
||
case 1: // 跳转
|
||
this.goto(`post/detail?id=${item.id}`)
|
||
break;
|
||
case 2: // 复制订单号
|
||
this.setClipboardData('xxxxxxx')
|
||
break;
|
||
case 3: // 删除
|
||
await this.confirmModal('确认要删除吗?')
|
||
break;
|
||
case 4: // 取消
|
||
await this.confirmModal('确认要取消吗?')
|
||
break;
|
||
default:
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style lang="scss">
|
||
@import '@/common/uni-nvue.scss';
|
||
page {
|
||
background-color: #fff !important;
|
||
height: 100% !important;
|
||
}
|
||
</style>
|
||
<style scoped lang="scss">
|
||
.pgb-cont{
|
||
padding: 30rpx;
|
||
}
|
||
|
||
.ord-list-item{
|
||
|
||
border: 2px solid #F6F6F6;
|
||
box-shadow: 0rpx 3rpx 12rpx 0rpx rgba(139,139,139,0.06);
|
||
border-radius: 20rpx;
|
||
padding: 22rpx 30rpx;
|
||
background-color: #fff;
|
||
margin-bottom: 30rpx;
|
||
}
|
||
.search-more-panel{
|
||
overflow: hidden;
|
||
position: absolute;
|
||
left: 0;
|
||
right: 0;
|
||
height: calc(70vh);
|
||
z-index: 200;
|
||
}
|
||
.smp-body{
|
||
padding: 30rpx;
|
||
display: flex;
|
||
flex-direction: column;
|
||
height: 100%;
|
||
background-color: #FFF;
|
||
border-radius: 0 0 30rpx 30rpx;
|
||
box-sizing: border-box;
|
||
}
|
||
.smp-content{
|
||
flex: 1;
|
||
position: relative;
|
||
}
|
||
</style> |