114 lines
2.5 KiB
Vue
114 lines
2.5 KiB
Vue
<template>
|
|
<view>
|
|
<u-sticky bgColor="#0122C7" style="width: 100vw">
|
|
<u-tabs
|
|
:list="tabLists"
|
|
@change="sectionChange"
|
|
lineColor="#fff"
|
|
:scrollable="false"
|
|
lineWidth="40"
|
|
inactiveStyle="color:#fff"
|
|
activeStyle="color:#fff"
|
|
></u-tabs>
|
|
</u-sticky>
|
|
<view class="content">
|
|
<u-search
|
|
placeholder="搜索你的订单"
|
|
@search="getOrderList"
|
|
:show-action="false"
|
|
bg-color="white"
|
|
v-model="keywords"
|
|
></u-search>
|
|
<view v-if="!orderlist.length">
|
|
<u-empty mode="data" icon="../../static/img/empty/data.png"> </u-empty>
|
|
</view>
|
|
<view v-else>
|
|
<logistiCard
|
|
ref="logistiCards"
|
|
v-for="(item, index) in orderlist"
|
|
@getlist="getOrderList"
|
|
@showTost="showToast"
|
|
@showToast2="showToast2"
|
|
:goodsInfo="item"
|
|
:key="index"
|
|
>
|
|
</logistiCard>
|
|
</view>
|
|
<!-- -->
|
|
<u-toast ref="uToast"></u-toast>
|
|
</view>
|
|
</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()
|
|
},
|
|
|
|
showToast () {
|
|
// 6
|
|
this.$refs.uToast.show({
|
|
type: 'success',
|
|
title: '成功主题(带图标)',
|
|
message: "操作成功",
|
|
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
|
|
})
|
|
},
|
|
showToast2 () {
|
|
// 6
|
|
|
|
this.$refs.uToast.show({
|
|
type: 'error',
|
|
message: "取件码不能为空",
|
|
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
|
|
},)
|
|
},
|
|
getOrderList () {
|
|
console.log("列表更新")
|
|
let id = JSON.parse(uni.getStorageSync('USER_INFO')).id
|
|
getList({
|
|
status: this.curNow,
|
|
courier_id: id,
|
|
keywords: this.keywords
|
|
}).then(res => {
|
|
this.orderlist = []
|
|
this.orderlist = res.data.data
|
|
})
|
|
}
|
|
|
|
},
|
|
onLoad () { },
|
|
onShow () {
|
|
this.getOrderList()
|
|
}
|
|
|
|
}
|
|
</script>
|
|
|
|
<style lang='scss'>
|
|
.content {
|
|
background-color: #f5f5f5;
|
|
padding: 1vh 2vw;
|
|
}
|
|
</style> |