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

248 lines
6.3 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-24 09:41:26 +08:00
<!-- v-if="orderList.length" -->
<div class="card-List">
<!-- v-for="(item,index) in orderList" :key="index" -->
<div class="item" >
<!-- @click="$linkTo(`./detail?id=${item.id}`)" -->
<div>
2022-11-23 09:57:26 +08:00
<div class="title">
2022-11-24 09:41:26 +08:00
<div>2020-12-11 10:10</div>
<!-- :style="{color: item.orderStatus==0? '#FF883C':item.orderStatus==1? '#42D784': '#999999'}" -->
<div>待收货</div>
2022-11-23 09:57:26 +08:00
</div>
2022-11-24 09:41:26 +08:00
<!-- v-for="(e,indexs) in item.merchandiseList" :key="indexs" -->
<div class="list">
2022-11-23 09:57:26 +08:00
<div class="list-item">
<div class="picture">
2022-11-24 09:41:26 +08:00
<img src="./components/imgs/check-icon.png" alt="">
2022-11-23 09:57:26 +08:00
</div>
<div class="info">
2022-11-24 09:41:26 +08:00
<div class="name">天薇抽纸天然无香纸巾天薇抽纸天然无香纸巾天薇抽纸可湿水面巾</div>
2022-11-23 09:57:26 +08:00
<div class="info-num">
2022-11-24 09:41:26 +08:00
<div class="num">数量2<span></span></div>
<div class="integral"><span>10</span>积分</div>
2022-11-23 09:57:26 +08:00
</div>
</div>
</div>
</div>
2022-11-24 09:41:26 +08:00
<div class="remark">
备注明天自己上门取货
</div>
<!-- v-if="item.orderStatus == 0" -->
<div class="btn">
<div class="cancel" @click="cancelBtn(item.id)">取消订单</div>
<div class="confirm">核销码<span>293049</span></div>
</div>
2022-11-23 09:57:26 +08:00
</div>
</div>
</div>
2022-11-24 09:41:26 +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() {
// 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
// this.getOrderList()
},
getOrderList() {
this.$instance.post('/appvillagerintegralshoporder/listForWx',null,{
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(() => {
this.$instance.post('/appvillagerintegralshoporder/overOrderForWx',null,{
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);
.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-24 09:41:26 +08:00
border: 1px solid #DDDDDD;
border-radius: 52px;
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>