2023-08-09 09:11:05 +08:00
|
|
|
<template>
|
|
|
|
<view class="content">
|
|
|
|
<u-search placeholder="搜索你的订单" @search="getOrderList" :show-action='false' bg-color='white'
|
|
|
|
v-model="keywords"></u-search>
|
|
|
|
<view style="margin: 10rpx 0 0 0;">
|
|
|
|
</view>
|
|
|
|
<u-sticky bgColor="#F5F5F5">
|
|
|
|
<u-subsection :list="list" :current="curNow" @change="sectionChange"></u-subsection>
|
|
|
|
</u-sticky>
|
|
|
|
<view v-if="!orderlist.length">
|
|
|
|
<u-empty mode="data" icon="../../static/img/empty/data.png">
|
|
|
|
</u-empty>
|
|
|
|
</view>
|
|
|
|
<view v-else>
|
2023-08-09 17:26:01 +08:00
|
|
|
<logistiCard :ref="'logistiCard'+index" v-for='(item,index) in orderlist' @getlist="getOrderList"
|
|
|
|
@showTost='showToast' :goodsInfo="item" :key="index">
|
2023-08-09 09:11:05 +08:00
|
|
|
</logistiCard>
|
|
|
|
</view>
|
2023-08-09 17:26:01 +08:00
|
|
|
<u-toast ref="uToast"></u-toast>
|
2023-08-09 09:11:05 +08:00
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import {
|
|
|
|
getList
|
|
|
|
} from "@/api/logistics.js"
|
|
|
|
import {
|
|
|
|
informationAdd
|
|
|
|
} from "@/api/logistics.js"
|
|
|
|
import logistiCard from "@/components/logistiComptent/logistiCard/logistiCard.vue"
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
logistiCard
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
keywords: "",
|
|
|
|
list: ['待取货', '已取货', '已送达'],
|
|
|
|
curNow: 0,
|
|
|
|
orderlist: []
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
sectionChange(index) {
|
|
|
|
this.curNow = index;
|
|
|
|
this.getOrderList()
|
|
|
|
},
|
2023-08-09 17:26:01 +08:00
|
|
|
showToast() {
|
|
|
|
this.$refs.uToast.show({
|
|
|
|
type: 'success',
|
|
|
|
title: '成功主题(带图标)',
|
|
|
|
message: "操作成功",
|
|
|
|
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
|
|
|
|
})
|
|
|
|
},
|
2023-08-09 09:11:05 +08:00
|
|
|
getOrderList() {
|
2023-08-09 17:26:01 +08:00
|
|
|
console.log("列表更新")
|
2023-08-09 09:11:05 +08:00
|
|
|
let id = JSON.parse(uni.getStorageSync('USER_INFO')).id
|
|
|
|
getList({
|
|
|
|
status: this.curNow,
|
2023-08-09 17:26:01 +08:00
|
|
|
// courier_id: 167,
|
2023-08-09 09:11:05 +08:00
|
|
|
courier_id: id,
|
|
|
|
keywords: this.keywords
|
|
|
|
}).then(res => {
|
2023-08-09 17:26:01 +08:00
|
|
|
this.orderlist = []
|
2023-08-09 09:11:05 +08:00
|
|
|
this.orderlist = res.data.data
|
2023-08-09 17:26:01 +08:00
|
|
|
for (let i = 0; i < this.orderlist.length; i++) {
|
|
|
|
// this.logistiCard
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-08-09 09:11:05 +08:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
onShow() {
|
|
|
|
this.getOrderList()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang='scss'>
|
|
|
|
.content {
|
|
|
|
background-color: #F5F5F5;
|
|
|
|
padding: 1vh 2vw;
|
|
|
|
}
|
|
|
|
</style>
|