2022-11-22 19:24:52 +08:00
|
|
|
|
<template>
|
2022-11-23 13:58:29 +08:00
|
|
|
|
<div class="myOrder">
|
2022-11-23 09:57:26 +08:00
|
|
|
|
|
|
|
|
|
|
<div class="tab-select">
|
|
|
|
|
|
<div class="item" :class="tabIndex == index? 'active': ''" v-for="(item,index) in tabList" :key="index" @click="toCheck(index)">{{ item }}<span></span></div>
|
|
|
|
|
|
</div>
|
2022-11-29 11:12:59 +08:00
|
|
|
|
<div class="card-List" v-if="orderList.length">
|
|
|
|
|
|
<div class="item" v-for="(item,index) in orderList" :key="index">
|
2022-11-24 09:41:26 +08:00
|
|
|
|
<!-- @click="$linkTo(`./detail?id=${item.id}`)" -->
|
|
|
|
|
|
<div>
|
2022-11-23 09:57:26 +08:00
|
|
|
|
<div class="title">
|
2022-11-29 11:12:59 +08:00
|
|
|
|
<div>{{ item.createTime }}</div>
|
2022-11-30 13:54:14 +08:00
|
|
|
|
<div><span class="status_all" :class="item.orderStatus==0?'status0':item.orderStatus==1?'status1':'status2'">{{ $dict.getLabel('merchandiseOrderStatus', item.orderStatus) }}</span></div>
|
2022-11-23 09:57:26 +08:00
|
|
|
|
</div>
|
2022-11-24 09:41:26 +08:00
|
|
|
|
<div class="list">
|
2022-11-23 09:57:26 +08:00
|
|
|
|
<div class="list-item">
|
|
|
|
|
|
<div class="picture">
|
2022-11-29 11:12:59 +08:00
|
|
|
|
<img :src="item.imageUrl" alt="">
|
2022-11-23 09:57:26 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="info">
|
2022-11-29 11:12:59 +08:00
|
|
|
|
<div class="name">{{ item.merchandiseName }}</div>
|
2022-11-23 09:57:26 +08:00
|
|
|
|
<div class="info-num">
|
2022-11-29 11:12:59 +08:00
|
|
|
|
<div class="num">数量:<span>{{ item.merchandiseNumber }}</span></div>
|
|
|
|
|
|
<div class="integral">共<span>{{ item.merchandiseNumber * item.merchandiseIntegral}}</span>积分</div>
|
2022-11-23 09:57:26 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2022-11-29 11:12:59 +08:00
|
|
|
|
<div class="remark" v-if="item.remark.length">备注:{{ item.remark }}</div>
|
2022-11-30 13:54:14 +08:00
|
|
|
|
<div class="btn" v-if="item.orderStatus==0">
|
2022-11-24 09:41:26 +08:00
|
|
|
|
<div class="cancel" @click="cancelBtn(item.id)">取消订单</div>
|
2022-11-29 11:12:59 +08:00
|
|
|
|
<div class="confirm">核销码:<span>{{ item.auditCode }}</span></div>
|
2022-11-24 09:41:26 +08:00
|
|
|
|
</div>
|
2022-11-23 09:57:26 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2022-11-29 11:12:59 +08:00
|
|
|
|
<AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty>
|
2022-11-23 09:57:26 +08:00
|
|
|
|
</div>
|
2022-11-22 19:24:52 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
export default {
|
2022-11-23 13:58:29 +08:00
|
|
|
|
name: "myOrder",
|
2022-11-22 19:24:52 +08:00
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
2022-11-23 09:57:26 +08:00
|
|
|
|
tabIndex: 0,
|
|
|
|
|
|
tabList: ['全部','待收货','已完成','已取消'],
|
|
|
|
|
|
orderList: [],
|
|
|
|
|
|
current: 1,
|
2022-11-22 19:24:52 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2022-11-23 09:57:26 +08:00
|
|
|
|
onLoad() {
|
2022-11-22 19:24:52 +08:00
|
|
|
|
document.title = '我的订单'
|
2022-11-30 13:54:14 +08:00
|
|
|
|
this.$dict.load('merchandiseOrderStatus').then(() => {
|
|
|
|
|
|
this.getOrderList()
|
|
|
|
|
|
})
|
|
|
|
|
|
|
2022-11-22 19:24:52 +08:00
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
2022-11-23 09:57:26 +08:00
|
|
|
|
toCheck(index) {
|
|
|
|
|
|
this.orderList = []
|
|
|
|
|
|
this.current = 1
|
|
|
|
|
|
this.tabIndex = index
|
2022-11-29 11:12:59 +08:00
|
|
|
|
this.getOrderList()
|
2022-11-23 09:57:26 +08:00
|
|
|
|
},
|
|
|
|
|
|
getOrderList() {
|
2022-11-29 11:12:59 +08:00
|
|
|
|
this.$http.post('/app/appintegralmerchandiseorder/listByGirdMember',null,{
|
2022-11-23 09:57:26 +08:00
|
|
|
|
params: {
|
|
|
|
|
|
current: this.current,
|
|
|
|
|
|
orderStatus: this.tabIndex == 0 ? '' : this.tabIndex == 1? 0 : this.tabIndex ==2? 1:2
|
|
|
|
|
|
}
|
|
|
|
|
|
}).then(res=>{
|
|
|
|
|
|
if(res?.data) {
|
|
|
|
|
|
this.orderList = this.current == 1? res.data.records : [...this.orderList,...res.data.records]
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
cancelBtn(id) {
|
2022-11-30 14:07:52 +08:00
|
|
|
|
this.$confirm('确定要取消该订单吗?\n 取消订单后,积分将退回至剩余积分').then(() => {
|
2022-11-30 13:54:14 +08:00
|
|
|
|
this.$http.post('/app/appintegralmerchandiseorder/cancelOrder',null,{
|
2022-11-23 09:57:26 +08:00
|
|
|
|
params: {
|
2022-11-30 13:54:14 +08:00
|
|
|
|
id: id
|
2022-11-23 09:57:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
}).then(res=>{
|
|
|
|
|
|
if(res.code==0) {
|
2022-11-30 13:54:14 +08:00
|
|
|
|
this.$u.toast('取消成功')
|
2022-11-23 09:57:26 +08:00
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
this.getOrderList()
|
2022-12-01 15:34:58 +08:00
|
|
|
|
},400)
|
2022-11-23 09:57:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
onReachBottom() {
|
|
|
|
|
|
this.current ++
|
|
|
|
|
|
this.getOrderList()
|
2022-11-22 19:24:52 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
2022-11-23 09:57:26 +08:00
|
|
|
|
<style scoped lang="scss">
|
2022-11-23 13:58:29 +08:00
|
|
|
|
.myOrder {
|
2022-11-23 09:57:26 +08:00
|
|
|
|
.tab-select {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 96px;
|
|
|
|
|
|
line-height: 96px;
|
|
|
|
|
|
position: fixed;
|
|
|
|
|
|
top: 0;
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
background: #3975C6;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
z-index: 999;
|
|
|
|
|
|
.item {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
font-size: 30px;
|
|
|
|
|
|
color: #FFFFFF;
|
|
|
|
|
|
}
|
|
|
|
|
|
.active {
|
|
|
|
|
|
font-size: 32px;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
span {
|
|
|
|
|
|
width: 50px;
|
|
|
|
|
|
height: 6px;
|
|
|
|
|
|
background: #FFFFFF;
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
left: 50%;
|
|
|
|
|
|
bottom: 14px;
|
|
|
|
|
|
margin-left: -24px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.card-List {
|
|
|
|
|
|
font-size: 28px;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
padding: 128px 32px 32px 32px;
|
2022-11-24 09:41:26 +08:00
|
|
|
|
box-sizing: border-box;
|
2022-11-23 09:57:26 +08:00
|
|
|
|
.item {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
background: #FFFFFF;
|
|
|
|
|
|
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.04);
|
|
|
|
|
|
border-radius: 16px;
|
|
|
|
|
|
margin-bottom: 16px;
|
|
|
|
|
|
.title {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
height: 104px;
|
|
|
|
|
|
line-height: 104px;
|
|
|
|
|
|
padding: 0 32px;
|
2022-11-24 09:41:26 +08:00
|
|
|
|
box-sizing: border-box;
|
2022-11-23 09:57:26 +08:00
|
|
|
|
border-bottom: 1px solid #EEEEEE;
|
2022-11-30 13:54:14 +08:00
|
|
|
|
|
|
|
|
|
|
.status_all {
|
|
|
|
|
|
padding: 3px 10px;
|
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.status0 {
|
|
|
|
|
|
background: #FFEDE2;
|
|
|
|
|
|
color: #FF883C;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.status1 {
|
|
|
|
|
|
background: #E2F6E1;
|
|
|
|
|
|
color: #42D784;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.status2 {
|
|
|
|
|
|
background: #EEEEEE;
|
|
|
|
|
|
color: #999999;
|
|
|
|
|
|
}
|
2022-11-23 09:57:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
.list {
|
|
|
|
|
|
padding: 0 32px;
|
2022-11-24 09:41:26 +08:00
|
|
|
|
box-sizing: border-box;
|
2022-11-30 13:54:14 +08:00
|
|
|
|
border-radius: 16px;
|
2022-11-24 09:41:26 +08:00
|
|
|
|
height: 100%;
|
2022-11-23 09:57:26 +08:00
|
|
|
|
.list-item {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
padding: 32px 0;
|
2022-11-24 09:41:26 +08:00
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
|
2022-11-23 09:57:26 +08:00
|
|
|
|
.picture {
|
|
|
|
|
|
width: 176px;
|
|
|
|
|
|
height: 176px;
|
|
|
|
|
|
margin-right: 16px;
|
|
|
|
|
|
img {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.info {
|
|
|
|
|
|
width: calc(100% - 192px);
|
2022-11-29 11:12:59 +08:00
|
|
|
|
.name {
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
display: -webkit-box;
|
|
|
|
|
|
-webkit-box-orient: vertical;
|
|
|
|
|
|
-webkit-line-clamp: 2;
|
|
|
|
|
|
}
|
2022-11-23 09:57:26 +08:00
|
|
|
|
.info-num {
|
|
|
|
|
|
margin-top: 24px;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
2022-11-30 16:41:18 +08:00
|
|
|
|
align-items: center;
|
2022-11-23 09:57:26 +08:00
|
|
|
|
.num {
|
|
|
|
|
|
color: #999999;
|
|
|
|
|
|
}
|
|
|
|
|
|
.integral {
|
|
|
|
|
|
color: #FF6900;
|
|
|
|
|
|
span {
|
|
|
|
|
|
font-size: 44px;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-11-24 09:41:26 +08:00
|
|
|
|
|
|
|
|
|
|
.remark {
|
|
|
|
|
|
padding: 16px 32px;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
border-top: 1px solid #EEEEEE;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2022-11-23 09:57:26 +08:00
|
|
|
|
.btn {
|
2022-11-24 09:41:26 +08:00
|
|
|
|
height: 100px;
|
2022-11-23 09:57:26 +08:00
|
|
|
|
display: flex;
|
2022-11-24 09:41:26 +08:00
|
|
|
|
justify-content: space-between;
|
2022-11-23 09:57:26 +08:00
|
|
|
|
padding: 0 20px;
|
2022-11-24 09:41:26 +08:00
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
border-top: 1px solid #EEEEEE;
|
2022-11-23 09:57:26 +08:00
|
|
|
|
div {
|
2022-11-24 09:41:26 +08:00
|
|
|
|
margin-top: 14px;
|
2022-11-23 09:57:26 +08:00
|
|
|
|
width: 176px;
|
|
|
|
|
|
height: 64px;
|
|
|
|
|
|
line-height: 64px;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
div:first-child {
|
|
|
|
|
|
margin-right: 32px;
|
2022-11-29 11:12:59 +08:00
|
|
|
|
color: #687DA6;
|
2022-11-23 09:57:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
div:last-child {
|
2022-11-24 09:41:26 +08:00
|
|
|
|
color: #999999;
|
|
|
|
|
|
width: calc(100% - 200px);
|
|
|
|
|
|
text-align: right;
|
2022-11-23 09:57:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-11-22 19:24:52 +08:00
|
|
|
|
|
2022-11-23 09:57:26 +08:00
|
|
|
|
::v-deep .emptyWrap .emptyImg {
|
|
|
|
|
|
margin-top: 100px;
|
|
|
|
|
|
}
|
2022-11-22 19:24:52 +08:00
|
|
|
|
}
|
|
|
|
|
|
</style>
|