团购列表
This commit is contained in:
parent
e11d6ffd76
commit
a647b6123e
|
|
@ -32,9 +32,16 @@ export default {
|
|||
orderorderList(data) { //订单列表
|
||||
return uni.api.get("/order/orderList", data);
|
||||
},
|
||||
// 团购订单列表
|
||||
groupOrderInfo(data) { //订单列表
|
||||
return uni.api.get("/groupOrderInfo/list", data);
|
||||
},
|
||||
orderorderInfo(data) { //订单回显
|
||||
return uni.api.get("/order/orderInfo", data);
|
||||
},
|
||||
groupOrderInfoDetail(data) { //订单回显
|
||||
return uni.api.get("/groupOrderInfo/get", data);
|
||||
},
|
||||
loginwxuserInfo(data) { //用户详情
|
||||
return uni.api.get("/login/userInfo", data);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -200,6 +200,12 @@
|
|||
"navigationBarTitleText": "确认订单",
|
||||
"navigationBarTextStyle": "black"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/order/order_groupdetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单详情"
|
||||
}
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
|
|
|
|||
|
|
@ -88,8 +88,25 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- 新订单 -->
|
||||
<view class="" v-if="navtabindex == 0">
|
||||
|
||||
<view class="orderList" v-if="navtabindex == 0">
|
||||
<view class="listBox" v-for="(item,i) in groupList" :key="i" @click="orderinfoTo(item)" >
|
||||
<view class="df">
|
||||
<view style="display: flex;">
|
||||
<text >{{item.proName.length>10?item.proName.substring(0,10)+'...':item.proName}}</text><u-icon name="arrow-right" color="#000" size="28"></u-icon>
|
||||
</view>
|
||||
<text :class="[item.status=='unpaid'||item.status=='unused'?'state':'state2']">{{item.status|statusFirter}}</text>
|
||||
</view>
|
||||
<view class="df" style="justify-content: flex-start;margin-top: 32rpx;">
|
||||
<image style="width:120rpx; height: 120rpx;border-radius: 12rpx 12rpx 12rpx 12rpx;"
|
||||
:src="item.proImg" mode="aspectFill">
|
||||
</image>
|
||||
<view class="ml-20 fontStyle">
|
||||
<view>数量:{{item.number}}份</view>
|
||||
<view>实付:<text style="color: #FF4C11;">¥{{item.payAmount}}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
<u-button v-if="item.status=='unused'" type="primary" shape="circle" class="buttonStyle" text="查看券码"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
<image style="margin:32rpx auto;" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png"
|
||||
v-if="is_end" mode="aspectFill"></image>
|
||||
|
|
@ -131,6 +148,7 @@
|
|||
}
|
||||
],
|
||||
list: [],
|
||||
groupList:[ ],
|
||||
is_end: false,
|
||||
swiperCurrent: '',
|
||||
form: {
|
||||
|
|
@ -153,6 +171,20 @@
|
|||
},
|
||||
onReachBottom() {
|
||||
this.orderorderList()
|
||||
// 获取团购订单
|
||||
this.getorderList()
|
||||
},
|
||||
filters:{
|
||||
statusFirter(e){
|
||||
// 状态: unpaid-待付款;unused-待使用;closed-已完成;refunding-退款中;refund-已退款;cancelled-已取消;
|
||||
if(e=='closed') return'已完成'
|
||||
else if(e=='unpaid') return'待付款'
|
||||
else if(e=='unused') return'待使用'
|
||||
else if(e=='refunding') return'退款中'
|
||||
else if(e=='refund') return'已退款'
|
||||
else if(e=='cancelled') return'已取消'
|
||||
else return "1"
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 切换导航栏
|
||||
|
|
@ -173,12 +205,20 @@
|
|||
orderId: e.id
|
||||
})
|
||||
},
|
||||
orderinfoTo(e){
|
||||
uni.pro.navigateTo('order/order_groupdetail', {
|
||||
orderId: e.id
|
||||
})
|
||||
},
|
||||
init_fn() {
|
||||
this.list = []
|
||||
this.groupList = []
|
||||
this.is_end = false
|
||||
this.form.page = 1
|
||||
this.form.status = 'loadmore'
|
||||
this.orderorderList()
|
||||
// 获取团购订单
|
||||
this.getorderList()
|
||||
},
|
||||
orderswitch(e, a) {
|
||||
this.active = a
|
||||
|
|
@ -214,6 +254,32 @@
|
|||
}, 500)
|
||||
}
|
||||
},
|
||||
async getorderList(){
|
||||
let res = await this.api.groupOrderInfo({
|
||||
page: this.form.page,
|
||||
size: this.form.size,
|
||||
userId: uni.cache.get('userInfo').id, //userId
|
||||
status: this.swiperCurrent
|
||||
})
|
||||
if(res.data.list.length ==0){
|
||||
this.is_end = true
|
||||
this.form.status = 'nomore'
|
||||
return false;
|
||||
}else{
|
||||
this.form.status = 'loading';
|
||||
this.form.page = ++this.form.page;
|
||||
setTimeout(() => {
|
||||
this.groupList = [...this.groupList, ...res.data.list];
|
||||
if (res.data.list.length == 10) {
|
||||
this.form.status = 'loading';
|
||||
} else {
|
||||
this.is_end = true;
|
||||
this.form.status = 'nomore';
|
||||
}
|
||||
}, 500)
|
||||
// console.log(res,'返回的数据')
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -410,4 +476,44 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
.orderList{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
.listBox{
|
||||
padding: 16rpx 18rpx;
|
||||
margin-top: 48rpx;font-size: 32rpx;
|
||||
width: 694rpx;
|
||||
height: 248rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
position: relative;
|
||||
.buttonStyle{
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
bottom: 50rpx;
|
||||
width: 170rpx;
|
||||
height: 64rpx;
|
||||
background: #FFD100;
|
||||
border-radius: 32rpx 32rpx 32rpx 32rpx;
|
||||
border: none;
|
||||
}
|
||||
.state{
|
||||
color: #FF4C11;
|
||||
}
|
||||
.state2{
|
||||
color: #999;
|
||||
}
|
||||
.fontStyle{
|
||||
font-size: 28rpx;font-weight: 400;color: #666666;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.df{ display: flex; align-items: center; justify-content: space-between; }
|
||||
|
||||
.ml-20{
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<template>
|
||||
<view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
onLoad(e) {
|
||||
this.orderId = e.orderId
|
||||
this.orderorderInfo()
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
orderId:"",
|
||||
listinfo:null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async orderorderInfo() {
|
||||
let res = await this.api.groupOrderInfoDetail({
|
||||
orderId: this.orderId
|
||||
})
|
||||
if (res.code == 0) {
|
||||
this.listinfo = res.data
|
||||
// this.mountedcreateSelectorQuery()
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
Loading…
Reference in New Issue