You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

203 lines
4.6 KiB

2 years ago
<template>
<view class='ordercontainer'>
2 years ago
<view class="tabsnav">
<u-tabs :list="list" :is-scroll="true" bg-color="#f0efed" bar-width="24" bar-height="24" gutter="53" font-size="24" inactive-color="#000" :active-item-style="{fontSize:'30rpx',color:'#ba8b45'}" :bar-style="{ right:'-36rpx',position:'relative',bottom:'32rpx',background:'#5b5b5a'}" :current="current" @change="change"></u-tabs>
2 years ago
</view>
<view class="orderlist">
<!-- 1条数据开始 -->
2 years ago
<view class="orderitem" v-for="(item,index) in orderList">
<view class="ordertop">
2 years ago
<text>运单号{{item.express_number?item.express_number:'-'}}</text>
<text>{{item.status==0?'待发货':'已发货'}}</text>
</view>
<view class="orderinfo">
2 years ago
<view class="orderbrief" @click="toDetail(item)">
<view class="orderimg">
<image src="../../static/orderimg1.jpg" mode="widthFix"></image>
</view>
<view class="orderright">
2 years ago
<view class="ordertitle">{{item.sku?item.sku.name:''}}</view>
<view class="ordersmalltext">{{item.sku?item.sku.specs:''}}</view>
</view>
</view>
2 years ago
<view class="ordertime" @click="toDetail(item)">
<text>预计送达时间</text>
2 years ago
<view>{{item.send_date?$moment(item.send_date).format("M月DD日"):''}}<text class="orderweek">{{item.week?'['+item.week+']':''}}</text>{{item.hh?item.hh:''}}</view>
</view>
<view class="ordertab">
2 years ago
<!-- <text class="deleteorder">删除订单</text> -->
<text class="orderinform">通知收件人</text>
</view>
2 years ago
</view>
</view>
<!-- 1条数据结束 -->
2 years ago
</view>
</view>
</template>
<script>
export default {
2 years ago
data() {
return {
list: [{
2 years ago
name: '全部',
status:'',
2 years ago
}, {
2 years ago
name: '待发货',
status:0
}, {
2 years ago
name: '已发货',
status:1
}],
status:'',
current: 0,
orderList:[]
2 years ago
}
},
onLoad() {
2 years ago
this.getOrderList()
2 years ago
},
methods: {
change(index) {
2 years ago
this.current = index;
this.status = this.list[index].status
this.getOrderList()
2 years ago
},
2 years ago
toDetail(item){
uni.setStorageSync('order_detail', item)
uni.navigateTo({
url:'/packages/myorder/infoconfirm'
})
2 years ago
},
async getOrderList(){
const res = await this.$u.api.getUserOrder({
status:this.status
})
this.orderList = res
// this.listArea = res.regions
},
2 years ago
}
}
</script>
<style lang="scss">
.ordercontainer{
background: #f0efed;
width: 100%;
height: 100vh;
overflow-y: scroll;
2 years ago
}
.tabsnav {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 80rpx;
2 years ago
z-index: 999;
overflow: hidden;
text-align: center;
// padding: 0 33rpx;
2 years ago
}
.tabsnav {
/deep/ .u-tab-item{
z-index: 2;
2 years ago
}
}
.orderlist {
padding: 82rpx 50rpx 56rpx;
}
.orderitem{
overflow: hidden;
margin-bottom: 25rpx;
background: url(../../static/libg.jpg) no-repeat center center;
background-size: cover;
border-radius: 10rpx;
box-shadow: 0 5px 15px rgba(0,0,0,.47);
padding: 12rpx;
}
.ordertop{
display: flex;
padding: 13rpx 20rpx 23rpx;
justify-content: space-between;
}
.ordertop text{
font-size: 24rpx;
color: #f2d6c1;
}
.orderinfo{
background: #fff;
padding: 24rpx;
border-radius: 10rpx;
}
.orderbrief{
display: flex;
padding-bottom: 24rpx;
}
.orderimg{
border: 1rpx solid rgba(186,139,69,.6);
border-radius: 10rpx;
overflow: hidden;
width: 150rpx;
height: 150rpx;
background: #fff;
text-align: center;
}
.orderimg image{
width: 100%;
height: auto;
vertical-align: middle;
}
.orderright{
padding-left: 32rpx;
width: 430rpx;
font-size: 24rpx;
color: #000;
padding-top: 20rpx;
}
.ordertitle{
height: 40rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
line-height: 40rpx;
}
.ordersmalltext{
text-align: justify;
}
.ordertime{
display: flex;
justify-content: space-between;
line-height: 36rpx;
font-size: 24rpx;
color: #000;
padding-bottom: 10rpx;
border-bottom: 1rpx solid #ececec;
margin-bottom: 26rpx;
}
.ordertime view text.orderweek{
color: #b62828;
margin: 0 10rpx;
}
.ordertab{
display: flex;
justify-content: flex-end;
}
.ordertab text{
display: inline-block;
width: 160rpx;
height: 50rpx;
margin: 0 22rpx;
border-radius: 50rpx;
text-align: center;
line-height: 50rpx;
border: 1rpx solid #cececd;
font-size: 24rpx;
color: #000;
}
.ordertab text.orderinform{
color: #ba8b45;
margin-right: 0;
}
2 years ago
</style>