Files
dvcp_v2_wxcp_app/src/project/pidu/AppPointsChange/myOrder.vue

250 lines
6.4 KiB
Vue
Raw Normal View History

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>
<!-- -->
<div><span :style="{color: item.orderStatus==0? '#FF883C':item.orderStatus==1? '#42D784': '#999999'}">{{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>
<div class="btn" v-if="item.orderStatus==1 || item.orderStatus==2">
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-29 11:12:59 +08:00
this.getOrderList()
2022-11-22 19:24:52 +08:00
document.title = '我的订单'
},
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) {
this.$dialog.confirm({ content: '确定要关闭该订单吗?' }).then(() => {
2022-11-29 11:12:59 +08:00
this.$http.post('/appvillagerintegralshoporder/overOrderForWx',null,{
2022-11-23 09:57:26 +08:00
params: {
orderId: id
}
}).then(res=>{
if(res.code==0) {
this.$u.toast('关闭成功')
this.$store.commit('getUserInfo')
setTimeout(() => {
this.getOrderList()
},600)
}
})
})
},
},
filters: {
format(num) {
if(num == 0) {
return '预约中'
}else if(num == 1) {
return '已完成'
}else if(num == 2) {
return '已关闭'
}
},
},
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;
}
.list {
padding: 0 32px;
2022-11-24 09:41:26 +08:00
box-sizing: border-box;
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;
.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
// border: 1px solid #DDDDDD;
// border-radius: 52px;
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>