合并部分页面
This commit is contained in:
141
pages/store/deliver.vue
Normal file
141
pages/store/deliver.vue
Normal file
@@ -0,0 +1,141 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 订单分类 -->
|
||||
<scroll-view class="nav" scroll-x="true" scroll-with-animation="true">
|
||||
<view :class="['nav-item', selectNavId === item.state ? 'nav-item-selected':'']" v-for="(item,index) in navList" :key="index" @click="selectNav(item.state)">
|
||||
{{item.name}}
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 订单列表 -->
|
||||
<store-order v-if="returnInfo.length > 0" :list="returnInfo" listType="deliver" />
|
||||
|
||||
<view v-else class="pack-center">
|
||||
<image src="../../static/icons/order-null.png"></image>
|
||||
<view>您还没有相关订单</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { storeDeliver } from '@/apis/interfaces/store'
|
||||
import storeOrder from '@/components/store-order/store-order'
|
||||
export default {
|
||||
comments:{
|
||||
storeOrder
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
returnInfo : '' ,// 列表
|
||||
navList : [{
|
||||
name : '待发货',
|
||||
state : '1'
|
||||
},{
|
||||
name : '已发货',
|
||||
state : '2'
|
||||
},{
|
||||
name : '待提货',
|
||||
state : '3'
|
||||
},{
|
||||
name : '已提货',
|
||||
state : '4'
|
||||
}
|
||||
],
|
||||
selectNavId : '1'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
onShow() {
|
||||
// 获取退货单列表
|
||||
this.returnData();
|
||||
},
|
||||
methods: {
|
||||
// 退货单列表
|
||||
returnData(){
|
||||
storeDeliver(this.selectNavId).then(res=>{
|
||||
console.log(res)
|
||||
this.returnInfo = res.data
|
||||
})
|
||||
},
|
||||
|
||||
// 选择订单
|
||||
selectNav(id) {
|
||||
if (this.selectNavId !== id) {
|
||||
this.selectNavId = id
|
||||
this.returnData()
|
||||
}
|
||||
},
|
||||
|
||||
// 我要发货
|
||||
goSend(orderNo) {
|
||||
console.log(orderNo)
|
||||
return
|
||||
uni.showModal({
|
||||
title: '是否签收此订单?',
|
||||
success: res => {
|
||||
if(res.confirm) {
|
||||
storeSign(orderNo).then(() => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '签收成功'
|
||||
})
|
||||
setTimeout(()=>{
|
||||
this.returnData()
|
||||
},3000)
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: err.message
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// 订单nav
|
||||
.nav {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
box-sizing: border-box;
|
||||
white-space: nowrap;
|
||||
font-size: $title-size*0.95;
|
||||
padding: 0 30rpx;
|
||||
background-color: #fff;
|
||||
color: #666;
|
||||
position: sticky;
|
||||
top: 0rpx;
|
||||
z-index: 1;
|
||||
.nav-item {
|
||||
width: 25%;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
border-bottom: solid 4rpx #fff;
|
||||
padding: 30rpx 0;
|
||||
}
|
||||
.nav-item-selected {
|
||||
color: $main-color;
|
||||
}
|
||||
}
|
||||
|
||||
// 暂无订单
|
||||
.pack-center {
|
||||
text-align: center;
|
||||
font-size: $title-size-sm;
|
||||
color: $text-gray;
|
||||
padding-top: 50%;
|
||||
image {
|
||||
width: $uni-img-size-lg * 2;
|
||||
height:$uni-img-size-lg * 2;
|
||||
border-radius: $uni-border-radius-circle;
|
||||
margin-bottom: $margin;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user