|
|
<template>
|
|
|
<view class="content">
|
|
|
<view class="end-title" style="display:none;">
|
|
|
<view v-for="(item,index) in items" :key="index" :class="{btna:count == index}" @tap="change(index)">
|
|
|
{{item}}<view class="line"></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="end-cont" :class="{dis:btnnum == 0}">
|
|
|
<view class="statusBox">
|
|
|
<text v-for="(item,index) in statusLabels" :key="index" @click="changeStatus(index)" :class="{cur: index == status}">{{item}}</text>
|
|
|
</view>
|
|
|
<view class="orderCol" v-for="(item, index) in list" :key="item.id" @click="goDetail(item.id)">
|
|
|
<view class="title">
|
|
|
<view>{{item.order_name || '暂无'}}<!-- <text class="free">免费</text> --></view>
|
|
|
<!-- <view class="status">待参加</view> -->
|
|
|
</view>
|
|
|
<view class="infoList">
|
|
|
<view class="infoCol"><view class="date"><image mode="heightFix" src="../../static/icon_shijian@2x.png"></image>{{item.created_at}}</view><view class="price"><text>¥</text>{{item.total}}</view></view>
|
|
|
<!--<view class="infoCol"><view class="address"><image mode="heightFix" src="../../static/icon_dizhi.png"></image>苏州·园区星海街188号苏州万怡大酒店南栋大酒店南栋</view></view>-->
|
|
|
</view>
|
|
|
<view class="btn"><!--<text> 预约服务 </text>--></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="end-cont" :class="{dis:btnnum == 1}" >
|
|
|
<view class="statusBox">
|
|
|
<text>待付款</text>
|
|
|
<text class="cur">待服务</text>
|
|
|
<text>已服务</text>
|
|
|
<text>待评价</text>
|
|
|
</view>
|
|
|
<view class="orderCol">
|
|
|
<view class="title">
|
|
|
<view>33孕期保健Q&A<text class="free">免费</text></view>
|
|
|
<view class="status">待参加</view>
|
|
|
</view>
|
|
|
<view class="infoList">
|
|
|
<view class="infoCol"><view class="date"><image mode="heightFix" src="../../static/icon_shijian@2x.png"></image>2021-02-10 14:00</view><view class="price"><text>¥</text>100</view></view>
|
|
|
<view class="infoCol"><view class="address"><image mode="heightFix" src="../../static/icon_dianpu@2x.png"></image>苏州·园区星海街188号苏州万怡大酒店</view></view>
|
|
|
</view>
|
|
|
<view class="btn"><text>投诉</text></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
//{"0":"待确认","10":"待支付","20":"进行中","100":"已完成"}
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
info: {
|
|
|
token: ''
|
|
|
},
|
|
|
btnnum: 0,
|
|
|
items:["活动订单","商品订单"],
|
|
|
count:"",
|
|
|
token: '',
|
|
|
page: 1,
|
|
|
list: [],
|
|
|
status: 0,
|
|
|
statusLabels: {0: "待确认", 10:"待支付", 20:"进行中", 100:"已完成"},
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
const phone_token = uni.getStorageSync('phone_token')
|
|
|
this.info.phone = phone_token.phone
|
|
|
this.token = phone_token.token
|
|
|
this.status = options.status || 0
|
|
|
this.getOrderList()
|
|
|
},
|
|
|
onShow() {
|
|
|
},
|
|
|
onReachBottom() {
|
|
|
this.getOrderList()
|
|
|
},
|
|
|
methods: {
|
|
|
changeStatus(i) {
|
|
|
this.status = i
|
|
|
this.page = 1
|
|
|
this.list = []
|
|
|
this.getOrderList()
|
|
|
},
|
|
|
change(e) {
|
|
|
this.count = e
|
|
|
this.btnnum = e
|
|
|
console.log(this.count)
|
|
|
},
|
|
|
getOrderList() {
|
|
|
const phone_token = uni.getStorageSync('phone_token')
|
|
|
uni.request({
|
|
|
url: this.baseUrl + '/api/member/get-orders',
|
|
|
method: 'GET',
|
|
|
data: {
|
|
|
state: this.status,
|
|
|
page: this.page,
|
|
|
token: phone_token.token
|
|
|
},
|
|
|
success: r => {
|
|
|
this.list = this.list.concat(r.data.data)
|
|
|
this.page++
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.content {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
}
|
|
|
.end-title{
|
|
|
display: flex;
|
|
|
width:100%;
|
|
|
height: 88rpx;
|
|
|
background: #FFFFFF;
|
|
|
box-shadow: 0px 2px 12px 0px #DEE4E7;
|
|
|
line-height: 88rpx;
|
|
|
font-size: 32rpx;
|
|
|
font-weight: 400;
|
|
|
color:#333;
|
|
|
position: fixed;
|
|
|
top:0;
|
|
|
left:0;
|
|
|
z-index: 999;
|
|
|
}
|
|
|
.end-title view{
|
|
|
flex-grow: 1;
|
|
|
text-align: center;
|
|
|
position: relative;
|
|
|
.line{position: absolute;width: 128rpx;height: 8rpx;background: #FF578A;border-radius: 4rpx;bottom:0;left:50%;margin-left:-64rpx;display: none;}
|
|
|
}
|
|
|
.end-cont{
|
|
|
display: none;
|
|
|
// padding-top:88rpx;
|
|
|
}
|
|
|
.btna{
|
|
|
color: #FF578A;
|
|
|
}
|
|
|
.btna .line{display:block!important;}
|
|
|
.dis{
|
|
|
display: block;
|
|
|
}
|
|
|
.orderCol{
|
|
|
background: #fff;
|
|
|
border-radius: 16rpx;
|
|
|
width:710rpx;
|
|
|
margin:20rpx auto 0 auto;
|
|
|
padding: 0 30rpx;
|
|
|
box-sizing: border-box;
|
|
|
.title{
|
|
|
padding:30rpx 0;
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
align-content: center;
|
|
|
align-items: center;
|
|
|
font-size:32rpx;
|
|
|
font-weight: 500;
|
|
|
color:#333;
|
|
|
.free{display:inline-block;width: 58rpx;height: 32rpx;background: #FF753E;border-radius: 6rpx;font-size: 20rpx;font-weight: 400;color: #FFFFFF;text-align: center;line-height:32rpx;margin-left:10rpx;}
|
|
|
.status{font-size: 28rpx;font-weight: 400;color: #666666;}
|
|
|
}
|
|
|
.btn{
|
|
|
display: flex;
|
|
|
justify-content: flex-end;
|
|
|
padding:30rpx 0;
|
|
|
text{
|
|
|
display: block;
|
|
|
width: 160rpx;
|
|
|
height: 64rpx;
|
|
|
border-radius: 8rpx;
|
|
|
border: 2rpx solid #DEDEDE;
|
|
|
font-size: 28rpx;
|
|
|
font-weight: 400;
|
|
|
color: #333333;
|
|
|
text-align:center;
|
|
|
line-height:64rpx;
|
|
|
}
|
|
|
}
|
|
|
.infoList{
|
|
|
.infoCol{
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
color:#666;
|
|
|
font-size: 28rpx;
|
|
|
line-height:1.8;
|
|
|
align-items: center;
|
|
|
align-content: center;
|
|
|
.date image{width:26rpx;height:26rpx;display: inline-block;margin-right:12rpx;}
|
|
|
.bulid{overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}
|
|
|
.bulid image{width:25rpx;height:26rpx;display: inline-block;margin-right:12rpx;}
|
|
|
.address{overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}
|
|
|
.address image{width:24rpx;height:26rpx;display: inline-block;margin-right:12rpx;}
|
|
|
.price{
|
|
|
font-size: 36rpx;
|
|
|
font-weight: 500;
|
|
|
color: #FF578A;
|
|
|
text{font-size: 28rpx;margin-right:5rpx;}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
.statusBox{
|
|
|
width:750rpx;
|
|
|
margin:2rpx auto;
|
|
|
box-sizing: border-box;
|
|
|
height:120rpx;
|
|
|
background: #fff;
|
|
|
display: flex;
|
|
|
paddind:0 30rpx;
|
|
|
justify-content: space-around;
|
|
|
align-items: center;
|
|
|
align-content: center;
|
|
|
color:#666;
|
|
|
font-size:28rpx;
|
|
|
text{display:block;width: 156rpx;height: 64rpx;background: #F0F0F0;border-radius: 32rpx;text-align: center;line-height:64rpx;}
|
|
|
.cur{background: #FF578A;color:#fff;}
|
|
|
}
|
|
|
</style>
|