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.

877 lines
18 KiB

<template>
<view class="container">
<view>
3 years ago
<u-tabs-swiper ref="tabs" :list="list2" :is-scroll="false" :current="current" @change="change"
active-color="#FF4848" font-size="25" gutter="5px" duration="0"></u-tabs-swiper>
</view>
<view class="main">
<view class="card-box-order">
<view class="list-item" v-for="(item,index) in list" :key="item.id" @tap="goDetail(item.goodsId)">
<view class="info-cont">
<!-- <image class="infoImg" :src="item.titleImg"></image> -->
<view style="display: flex;">
<image src="/static/img/home/storeLogo.png" mode="" style="width: 56px;height: 56px;">
</image>
<view style="margin-left: 9px;">
<view class="">
五谷轻食牛肉盖浇饭
</view>
<view style="display: flex;">
<button class="order-btn" type="default">会员满20返18</button>
<button class="order-btn" type="default">非会员满20返18</button>
</view>
</view>
</view>
3 years ago
<view class="info-right">
<view>
<!-- <view class="logotitle" :class="item.status != 2 && item.status != 4 ? 'logotitle1' : 'logotitle'">
<view style="width: 10%;">
<image v-if="item.classify == 2" class="logos"
src="/static/img/home/storeLogo.png">
</image>
<image v-if="item.classify == 1" class="logos"
src="/static/img/my/eleicon.png">
</image>
</view>
<view class="nickName">{{item.goodsTitle}}</view>
3 years ago
</view> -->
<view class="status">
{{item.status == 1 ? '待提交' : item.status == 2 ? '提交待审核' : item.status == 3 ? '审核成功' : item.status == 4 ? '审核失败' : item.status == 5 ? '放弃任务':''}}
</view>
<view class="jujue" v-if="item.status == 4">拒绝原因{{item.auditContent}}</view>
<view class="countdown_time" v-if="item.status === 2">
<uni-countdown class="countdown_time" color="#999999" :day="item.endTime.day"
:hour="item.endTime.hour" :minute="item.endTime.minute"
:second="item.endTime.second">
</uni-countdown>
</view>
</view>
</view>
3 years ago
</view>
<view class="huixian" :class="item.status == 4 ? 'huixian' : 'huixian1'"
v-if="item.status === 1 || item.status === 4"></view>
<view class="info-wrap">
<view class="btn-wrap">
<view class="btn delete" v-if="item.status === 1 || item.status === 4"
@tap.stop="fangqi(item.orderId)">放弃任务</view>
<view class="btn demand" v-if="item.status === 1 || item.status === 4"
@tap.stop="shangchuan(item.orderId)">上传凭证</view>
</view>
</view>
</view>
</view>
</view>
3 years ago
<!-- 加载更多提示 -->
<view v-if="list.length > 0 ">
<load-more :loadingType="loadingType" :contentText="contentText"></load-more>
</view>
<!-- 暂无数据展示 -->
<empty v-if="list.length === 0" des="暂无订单数据" show="false"></empty>
</view>
</view>
</template>
<script>
import uniCountdown from '@/components/uni-countdown/uni-countdown.vue';
export default {
components: {
uniCountdown
},
data() {
return {
fromTabIndex: 0,
tabList: [{
name: "全部"
},
{
name: "待提交"
},
{
name: "提交待审核"
},
{
name: "审核成功"
},
{
3 years ago
name: "放弃任务"
},
{
3 years ago
name: "审核失败"
},
],
page: 1,
limit: 10,
3 years ago
// list: [],
list: [{
id: 1,
titleImg: "",
status: 1,
},
{
id: 2,
titleImg: "",
status: 3,
},
{
id: 3,
titleImg: "",
status: 4,
},
],
list2: [{
name: "全部"
},
{
name: "待提交"
},
{
name: "提交待审核"
},
{
name: "审核成功"
},
{
name: "放弃任务"
},
{
name: "审核失败"
}
],
current: 0,
loadingType: 0,
scrollTop: false,
contentText: {
contentdown: '上拉显示更多',
contentrefresh: '正在加载...',
contentnomore: '没有更多数据了'
},
isLogin: false
}
},
onShow() {
3 years ago
// let token = this.$queue.getData('token');
// if (token) {
// this.userId = this.$queue.getData('userId');
// this.page = 1;
// this.getList();
// } else {
// this.goLogin();
// }
},
methods: {
// 放弃任务
fangqi(id) {
uni.showModal({
3 years ago
// title: '温馨提示',
content: '确认要放弃吗?',
showCancel: true,
cancelText: '取消',
confirmText: '确认',
success: d => {
var that = this;
if (d.confirm) {
console.log('用户点击确定');
that.$queue.showLoading('提交中...');
that.$Request.postT('/wm/abandonOrders?orderId=' + id).then(res => {
if (res.code === 0) {
that.$queue.showToast('已放弃当前任务!');
that.page = 1;
that.getList();
uni.hideLoading();
} else {
that.$queue.showToast(res.msg);
uni.hideLoading();
}
})
}
}
});
},
3 years ago
change(index) {
this.current = index;
},
// 上传凭证
shangchuan(id) {
uni.navigateTo({
url: '/pages/order/release?orderId=' + id
});
},
timeFormat(param) {
return param < 10 ? '0' + param : param;
},
getList() {
this.loadingType = 1;
uni.showLoading({
title: '加载中...',
});
this.$Request.getT('/wm/selectOrdersListByUserId?page=' + this.page + '&limit=' + this.limit + '&userId=' +
this.userId + '&status=' + this.fromTabIndex).then(res => {
if (res.code === 0) {
if (this.page === 1) {
this.list = [];
}
res.data.list.forEach(d => {
let data = {}
data.day = 0;
data.hour = 0;
data.minute = 0;
data.second = 0;
var now = new Date().getTime();
var endDate = new Date(d.endTime).getTime();
let time = (endDate - now) / 1000;
data.day = this.timeFormat(parseInt(time / (60 * 60 * 24)));
data.hour = this.timeFormat(parseInt(time % (60 * 60 * 24) / 3600));
data.minute = this.timeFormat(parseInt(time % (60 * 60 * 24) % 3600 / 60));
data.second = this.timeFormat(parseInt(time % (60 * 60 * 24) % 3600 % 60));
d.endTime = data;
this.list.push(d);
});
if (res.data.list.length === this.limit) {
this.loadingType = 0;
} else {
this.loadingType = 3;
}
} else {
this.loadingType = 2;
}
uni.hideLoading();
});
},
fromTabSelect(index) {
this.fromTabIndex = index;
this.page = 1;
this.getList();
},
goLogin() {
uni.navigateTo({
url: '/pages/public/login'
});
},
goDetail(id) {
var latitude = this.$queue.getData('latitude')
var longitude = this.$queue.getData('longitude')
uni.navigateTo({
url: '/pages/index/taskDetail?goodsId=' + id + '&latitude=' + latitude + '&longitude=' +
longitude
})
},
endTask(item) {
let that = this;
uni.showModal({
3 years ago
// title: '温馨提示',
content: '取消订单将会扣除您的信誉分,确认取消订单吗?',
showCancel: true,
cancelText: '取消',
confirmText: '确认',
success: res => {
if (res.confirm) {
that.$queue.showLoading('取消中...');
that.$Request.postT('/help/endHelpTake?id=' + item.helpTakeId).then(res => {
if (res.code === 0) {
that.$queue.showToast('取消成功!');
uni.hideLoading();
} else {
that.$queue.showToast(res.msg);
}
})
}
}
});
},
topScrollTap: function() {
uni.pageScrollTo({
scrollTop: 0,
duration: 300
});
}
},
onPageScroll: function(e) {
this.scrollTop = e.scrollTop > 200;
},
onReachBottom: function() {
this.page = this.page + 1;
this.getList();
}
}
</script>
<style lang="scss">
page {
background: #f3f5f7;
}
.container {
width: 100%;
.header {
width: 100%;
height: 86upx;
background-color: #FFF;
position: fixed;
z-index: 99;
.menuTab {
width: 100%;
height: 78upx;
display: flex;
.menuTab-item {
width: 50%;
background-color: #FFF;
font-size: 32upx;
font-weight: bold;
color: #333333;
text-align: center;
line-height: 78upx;
}
.active {
background: #F7F6FD;
}
}
.navbar {
width: 100%;
height: 78upx;
background: #FFF;
padding-top: 10upx;
display: flex;
align-items: center;
justify-content: space-around;
.nav-item {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.txt {
font-size: 32upx;
font-weight: 500;
color: #666666;
}
.active_txt {
font-size: 32upx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
}
.line {
width: 60upx;
height: 8upx;
border-radius: 4upx;
margin-top: 10upx;
}
.active_line {
background: #FF3530;
}
}
}
}
.countdown_time {
display: flex;
font-size: 28rpx;
font-family: PingFang SC Medium, PingFang SC Medium-Medium;
font-weight: 500;
color: #999999;
}
.huixian {
height: 1rpx;
opacity: 1;
border: 1rpx solid #e6e6e6;
margin-top: 30rpx;
}
.huixian1 {
height: 1rpx;
opacity: 1;
border: 1rpx solid #e6e6e6;
margin-top: 60rpx;
}
.main {
3 years ago
padding: 16px 20upx 0;
.card-box-order {
.list-item {
background: #FFFFFF;
border-radius: 20upx;
3 years ago
padding: 15px 15px 20px;
margin-bottom: 20upx;
.title {
display: flex;
align-items: center;
width: 100%;
// justify-content: space-between;
padding-bottom: 20upx;
.logos {
width: 50upx;
height: 50upx;
border-radius: 100upx;
}
.nickName {
width: 90%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 28upx;
font-weight: 500;
color: #666666;
}
}
.info-cont {
3 years ago
display: flex;
justify-content: space-between;
// position: relative;
.infoImg {
3 years ago
width: 56px;
height: 56px;
// position: absolute;
}
.info-right {
3 years ago
// margin-left: 150upx;
// height: 100upx;
.logotitle {
width: 100%;
display: flex;
align-items: center;
}
3 years ago
.logotitle1 {
width: 100%;
display: flex;
align-items: center;
padding-top: 20rpx;
// margin-top: 20rpx;
}
.logos {
width: 34upx;
height: 34upx;
}
.nickName {
width: 90%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-left: 9rpx;
font-size: 32rpx;
font-family: PingFang SC Bold, PingFang SC Bold-Bold;
font-weight: 700;
color: #333333;
}
.express {
width: 90%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 32rpx;
font-family: PingFang SC Bold, PingFang SC Bold-Bold;
font-weight: 700;
color: #333333;
padding-top: 5rpx;
}
.status {
margin: 10rpx 0;
3 years ago
// width: 100px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
3 years ago
height: 16px;
font-size: 11px;
font-family: PingFang SC;
font-weight: 400;
3 years ago
line-height: 16px;
color: #878787;
}
.jujue {
font-size: 28rpx;
font-family: PingFang SC Medium, PingFang SC Medium-Medium;
font-weight: 500;
color: #999999;
}
}
}
.info-wrap {
.express {
padding-top: 30upx;
padding-bottom: 20upx;
font-size: 32upx;
line-height: 32upx;
font-weight: bold;
color: #333333;
}
.tag-box {
display: flex;
margin-bottom: 20upx;
.tag-item {
display: inline-block;
height: 38upx;
line-height: 38upx;
border-radius: 5upx;
padding: 0 13upx;
margin-right: 10upx;
}
.tag-item-blue {
background: #D9EDFF;
color: #66A6FF;
}
.tag-item-orange {
background: #FFE8D9;
color: #FF7D26;
}
.tag-item-pink {
background: #FFD9D9;
color: #FF6666;
}
.tag-item-green {
background: #D9FFFB;
color: #17D2BD;
}
}
.times {
font-size: 28upx;
font-weight: 500;
color: #666666;
margin-bottom: 20upx;
}
.code {
display: flex;
justify-content: space-between;
.ma {
font-size: 28upx;
font-weight: 500;
color: #666666;
}
.pay {
font-size: 24upx;
font-weight: 500;
color: #666666;
text {
color: #333333;
font-size: 32upx;
}
}
}
.btn-wrap {
display: flex;
justify-content: flex-end;
3 years ago
margin-top: 20px;
.btn {
3 years ago
width: 56px;
height: 16px;
line-height: 16px;
text-align: center;
margin-left: 20upx;
font-size: 24upx;
border-radius: 8upx;
}
.delete {
3 years ago
height: 16px;
font-size: 11px;
font-family: PingFang SC;
font-weight: 400;
line-height: 16px;
color: #878787;
border: 1px solid #878787;
border-radius: 8px;
}
.demand {
3 years ago
height: 16px;
font-size: 11px;
font-family: PingFang SC;
font-weight: 400;
line-height: 16px;
color: #FF4848;
border: 1px solid #FF4848;
border-radius: 8px;
}
}
}
}
.list-item:last-child {
margin-bottom: 0;
}
}
.card-box-run {
.list-item {
background: #FFFFFF;
border-radius: 20upx;
padding: 30upx;
margin-bottom: 20upx;
.title {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 20upx;
.date {
display: flex;
align-items: center;
image {
width: 30upx;
height: 32upx;
}
.txt {
font-size: 28upx;
font-weight: bold;
color: #FF3530;
margin-left: 10upx;
}
}
.status {
font-size: 32upx;
font-weight: 800;
color: #FF3530;
text {
font-size: 24upx;
}
}
}
.info-wrap {
.steps-box {
display: flex;
.left {
padding: 30upx 0;
display: flex;
flex-direction: column;
justify-content: space-between;
position: relative;
.round {
width: 20upx;
height: 20upx;
background: #CCCCCC;
border-radius: 50%;
z-index: 2;
}
.vertical-line {
width: 2upx;
height: 140upx;
background: #D9D9D9;
position: absolute;
left: 9upx;
top: 40upx;
z-index: 1;
}
}
.right {
margin-left: 10upx;
.text {
display: flex;
font-size: 32upx;
align-items: center;
height: 80upx;
}
.distance {
font-size: 28upx;
font-family: PingFang SC;
font-weight: 500;
color: #999999;
height: 58upx;
line-height: 58upx;
}
}
}
.contact-person {
display: flex;
align-items: center;
padding: 0 30upx;
margin: 20upx 0 10upx;
.nickName {
font-size: 28upx;
font-weight: 500;
color: #666666;
}
.moblie {
font-size: 28upx;
font-weight: 500;
color: #FF3530;
}
}
.btn-wrap {
display: flex;
justify-content: flex-end;
.btn {
width: 200upx;
height: 60upx;
background: #FF3530;
border-radius: 30upx;
font-size: 28upx;
font-weight: bold;
line-height: 60upx;
text-align: center;
color: #FFFFFF;
}
}
}
}
}
}
}
.tui-tabs {
flex: 1;
flex-direction: column;
overflow: hidden;
background-color: #fafafa;
/* #ifdef MP-ALIPAY || MP-BAIDU */
height: 100vh;
/* #endif */
}
.tui-scroll-h {
width: 750rpx;
height: 80rpx;
background-color: #ffffff;
flex-direction: row;
/* #ifndef APP-PLUS */
white-space: nowrap;
/* #endif */
/* #ifdef APP-PLUS */
position: fixed;
top: 0;
left: 0;
z-index: 999;
/* #endif */
/* #ifdef H5 */
position: fixed;
top: 44px;
left: 0;
z-index: 999;
/* #endif */
/* #ifdef MP-WEIXIN */
position: fixed;
top: 0;
left: 0;
z-index: 999;
/* #endif */
}
.tui-line-h {
/* #ifdef APP-PLUS */
height: 1rpx;
background-color: #cccccc;
/* #endif */
position: relative;
}
/* #ifndef APP-PLUS*/
.tui-line-h::after {
content: '';
position: absolute;
border-bottom: 1rpx solid #cccccc;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
bottom: 0;
right: 0;
left: 0;
}
/* #endif */
.tui-tab-item {
/* #ifndef APP-PLUS */
display: flex;
/* #endif */
}
.tui-tab-item-title {
3 years ago
color: #000000;
font-size: 11px;
font-family: PingFang SC;
font-weight: 500;
height: 80rpx;
line-height: 80rpx;
flex-wrap: nowrap;
white-space: nowrap;
}
.tui-tab-item-title-active {
3 years ago
border-bottom: 8rpx solid #FF4848;
border-radius: 4px;
text-align: left;
3 years ago
color: #000000;
font-size: 11px;
font-family: PingFang SC;
font-weight: 500;
border-bottom-width: 10upx;
text-align: center;
}
3 years ago
.order-btn {
width: 82px;
height: 18px;
background: #F8E3DF;
border: 1px solid #FF6A6A;
opacity: 1;
border-radius: 2px;
font-size: 10px;
font-family: PingFang SC;
font-weight: 500;
line-height: 18px;
color: #FF7171 !important;
margin-right: 6px;
margin-top: 12px;
}
</style>