You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

282 lines
6.4 KiB

4 years ago
<template>
<view>
<view class="infotop">
2 years ago
<u-tabs lineWidth="50" lineHeight="2" :scrollable="false" :list="list" lineColor="#cf995a"
4 years ago
:is-scroll="false" :current="current" @change="handleChange"></u-tabs>
</view>
4 years ago
<u-empty mode="list" :marginTop="100" v-if="isloading&&listOrder.length==0" />
<view class="orderBoxList" v-else>
4 years ago
<block v-for="(item,index) in listOrder" :key="index">
4 years ago
<view class="orderBox" :class="{'cancelBox':item.status==0}" @click="toinfo(item.id)">
4 years ago
<view class="orderBoxTitle flex-row">
2 years ago
<text class="orderBoxTitleTxt">{{item.type==1?"团队信息":"个人信息"}}</text>
3 years ago
<view :class="item.status!=1?'cancelStatus orderBoxStatus':'orderBoxStatus'">
{{item.status_name}}
4 years ago
</view>
4 years ago
</view>
<view class="orderBoxInfo flex-col">
4 years ago
<view class="orderBoxInfoRow flex-row">
3 years ago
<text class="iconfont icon-youkexuzhi"></text>
<text class="orderBoxInfoRowTxt">活动名称{{item.activity.name||"加载中..."}}</text>
</view>
<view class="orderBoxInfoRow flex-row" style="margin-top: 20rpx;">
4 years ago
<text class="iconfont icon-youkexuzhi"></text>
4 years ago
<text class="orderBoxInfoRowTxt">
4 years ago
3 years ago
订单信息{{timeFormat(item.start_time, 'MM月DD日')}}{{getHm(item.start_time)}}-{{getHm(item.end_time)}}{{item.total}}位观众
</text>
4 years ago
</view>
4 years ago
<view class="orderBoxInfoRow flex-row" v-if="item.type==1" style="margin-top: 20rpx;">
4 years ago
<text class="iconfont icon-iconfontgerenzhongxin"></text>
4 years ago
<text class="orderBoxInfoRowTxt">领队{{item.leader}} {{item.mobile}}</text>
4 years ago
</view>
4 years ago
<view class="orderBoxInfoRow flex-row" v-if="item.type==1" style="margin-top: 20rpx;">
4 years ago
<text class="iconfont icon-danwei"></text>
4 years ago
<text class="orderBoxInfoRowTxt">单位名称{{item.unit}}</text>
4 years ago
</view>
</view>
<view class="orderBoxTime">
4 years ago
<text>下单时间{{item.created_at}}</text>
4 years ago
</view>
<view class="orderBoxFooter flex-row flex_end">
4 years ago
<view class="fbtn cancel" v-if="item.status==1" style="margin-right: 23rpx;"
2 years ago
@click.stop="tocancel(item.id)">取消活动</view>
4 years ago
<view class="fbtn" :class="{'cancel':item.status!=1}" @click.stop="toinfo(item.id)">查看详情</view>
4 years ago
</view>
</view>
</block>
</view>
</view>
</template>
<script>
export default {
data() {
4 years ago
return {
activity_list: [],
4 years ago
itemStyle: {
height: '44px',
flex: 1
},
list: [{
4 years ago
name: '全部',
idx: ""
4 years ago
}, {
4 years ago
name: '已预约',
4 years ago
idx: "1"
4 years ago
}, {
4 years ago
name: '已核销',
4 years ago
idx: "2"
4 years ago
}, {
4 years ago
name: '已取消',
4 years ago
idx: "0"
3 years ago
}, {
name: '已过期',
idx: "3"
4 years ago
}],
current: 0,
4 years ago
isloading: true,
listOrder: []
4 years ago
}
},
4 years ago
onShow() {
this.loadOrder();
2 years ago
},
onShareAppMessage() {
return this.util.shareInfo
},
onShareTimeline(){
return this.util.shareInfo
4 years ago
},
4 years ago
methods: {
4 years ago
handleChange(e) {
this.current = e.index;
this.loadOrder();
},
toinfo(id) {
uni.navigateTo({
2 years ago
url: "/packages/order/activityorderinfo?id=" + id
4 years ago
})
},
tocancel(id) {
var that = this;
uni.showModal({
2 years ago
title: '确认要取消活动?',
4 years ago
success: function(res) {
if (res.confirm) {
that.util.request({
api: '/api/mobile/activity/cancel-order',
data: {
id: id
},
utilSuccess: function(res) {
that.loadOrder()
},
utilFail: function(res) {
uni.showToast({
icon: "none",
title: res
})
}
})
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
loadOrder() {
var that = this;
this.util.request({
api: '/api/mobile/user/my-activity-order',
data: {
status: this.list[this.current].idx
},
utilSuccess: function(res) {
3 years ago
that.listOrder = res;
for(var m of that.listOrder){
m.start_time=(m.number[0]!=null?m.number[0].start_time:'')
m.end_time=(m.number[0]!=null?m.number[0].end_time:'')
}
4 years ago
this.isloading = false;
},
utilFail: function(res) {
uni.showToast({
icon: "none",
title: res
})
}
})
4 years ago
},
getHm(val) {
if (val) {
3 years ago
return this.$moment(val).format("HH:mm")
4 years ago
} else return "";
},
3 years ago
timeFormat(val, format) {
console.log(val)
if (val) {
return this.$moment(val).format(format)
}else return "";
4 years ago
}
}
}
</script>
2 years ago
<style>
page{
background-color: #fbf3ea;
}
4 years ago
.orderBoxFooter {
padding: 20rpx 0 0 0;
}
.fbtn {
2 years ago
background: #cf995a;
4 years ago
border-radius: 8rpx;
font-size: 24rpx;
color: #FFFFFF;
padding: 7rpx 17rpx;
}
.cancel {
background: #F7F6F4;
color: #828282;
}
4 years ago
.cancelBox .iconfont {
color: #828282;
}
.cancelBox .fbtn {
background: #CFCFCF;
color: #828282;
}
4 years ago
.iconfont {
color: #6EAC97;
margin-right: 20rpx;
font-size: 24rpx;
}
.infotop {
background: #FFFFFF;
box-shadow: 2rpx 3rpx 10rpx 0px rgba(107, 94, 77, 0.3);
}
.orderBoxList {
padding: 26rpx;
box-sizing: border-box;
}
.orderBox {
2 years ago
/* min-height: 393rpx;
4 years ago
background: #FFFFFF;
border-radius: 16rpx;
box-sizing: border-box;
padding: 29rpx 18rpx;
position: relative;
2 years ago
margin-bottom: 17rpx; */
background: #FFFFFF;
border-radius: 16rpx;
box-sizing: border-box;
padding: 29rpx 18rpx;
position: relative;
margin-bottom: 30rpx;
4 years ago
}
.orderBoxTitle {
padding: 0rpx 0rpx 25rpx 0rpx;
border-bottom: 2rpx solid #F7F6F4;
}
.orderBoxInfoRow {
align-items: center;
}
.orderBoxTitleTxt {
font-size: 32rpx;
color: #351C1B;
}
4 years ago
.cancelStatus {
background: #CFCFCF !important;
}
4 years ago
.orderBoxStatus {
2 years ago
background: #cf995a;
4 years ago
border-top-right-radius: 16rpx;
border-bottom-left-radius: 16rpx;
font-size: 24rpx;
padding: 19rpx 23rpx 17rpx 23rpx;
color: #FFFFFF;
position: absolute;
right: 0;
top: 0;
}
.orderBoxInfo {
padding: 29rpx 0rpx;
border-bottom: 2rpx solid #F7F6F4;
}
.orderBoxInfoRowTxt {
font-size: 24rpx;
font-family: PingFang SC;
color: #828282;
}
.orderBoxTime {
color: #CFCFCF;
padding: 23rpx 0;
border-bottom: 2rpx solid #F7F6F4;
font-size: 24rpx;
}
</style>