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.
wuliu/pages/index/index.vue

339 lines
7.1 KiB

8 months ago
<template>
<view class="container">
8 months ago
<view class="box" v-for="(item,index) in list" :key="index">
8 months ago
<view class="texts">
8 months ago
<text class="text">发货地</text><text class="text1">{{item.deliver_address}}</text>
8 months ago
</view>
<view class="texts">
8 months ago
<text class="text">收货地</text><text class="text1">{{item.receiving_address}}</text>
8 months ago
</view>
8 months ago
<view class="biaoqian">
<view class="biaoqian1">
车型{{item.car_type}}
</view>
<view class="biaoqian2">
装载量{{item.loading_capacity}}
</view>
<view class="biaoqian3">
运费价格{{item.freight}}
</view>
<view class="biaoqian4">
{{item.transport_time}}
</view>
8 months ago
</view>
<view class="xinxis">
<view class="">
8 months ago
<text class="xinxis1">发布时间</text><text class="text1">{{item.release_time}}</text>
8 months ago
</view>
<view class="">
8 months ago
<text class="xinxis1">下架时间</text><text class="text1">{{item.delisting_time}}</text>
8 months ago
</view>
<view class="">
7 months ago
<text class="xinxis1">装货时间</text><text
class="text1">{{item.loading_start_time}}{{item.loading_end_time}} </text>
8 months ago
</view>
<view class="">
8 months ago
<text class="xinxis1">发货电话</text><text class="text1">{{item.mobile}}</text>
8 months ago
</view>
</view>
8 months ago
<button :class="item.status=='2'?'btn':'btndis'" @click="qiangdan(item)">抢单</button>
8 months ago
</view>
<uni-popup ref="popup" background-color="#fff" :mask-click='false'>
8 months ago
<view class="popbox" v-if="status">
8 months ago
<view class="close">
<image src="@/static/close-l.png" mode="" style="width: 44rpx;height: 44rpx;" @click="close">
</image>
</view>
<view class="cg">
<image src="@/static/成功.png" mode="" style="width: 130rpx;height: 130rpx;"></image>
</view>
<view class="wenzi">
抢单成功
</view>
<view class="cgwenzi">
您好您已抢单成功请尽快前往发货地装货
</view>
</view>
8 months ago
<view class="popbox" v-else>
<view class="close">
<image src="@/static/close-l.png" mode="" style="width: 44rpx;height: 44rpx;" @click="close">
</image>
</view>
<view class="cg">
<image src="@/static/失败.png" mode="" style="width: 130rpx;height: 130rpx;"></image>
</view>
<view class="wenzi">
抢单失败
</view>
<view class="cgwenzi">
7 months ago
{{msg}}
8 months ago
</view>
</view>
8 months ago
</uni-popup>
8 months ago
</view>
</template>
<script>
export default {
data() {
return {
7 months ago
listwdl: [{
car_type: "9.6米",
delisting_time: "2024-07-30 00:00",
deliver_address: "江苏省徐州市鼓楼区新航",
freight: "800.00",
id: 11,
is_accep: 0,
loading_capacity: "60",
loading_end_time: "2024-07-30 00:00",
loading_start_time: "2024-07-30 00:00",
mobile: "13280243699",
order_time: "2024-07-29 19:02",
receiving_address: "安徽省宿州市萧县新淮",
release_time: "2024-07-29 19:01",
status: 2,
status_text: "抢单中",
transport_time: "今日"
}
],
content: '',
msg: "",
8 months ago
status: true,
list: [],
8 months ago
item: 3,
href: 'https://uniapp.dcloud.io/component/README?id=uniui',
biaqqian: [{
text: '车型:13.6',
background: '#E2ECFA',
color: '#0D5DC9'
},
{
text: '装载量:20m³',
background: '#E7F4F9',
color: '#14B2EC'
},
{
text: '运费价格:¥500',
background: '#F9EEEE',
color: '#E45050'
},
{
text: '今日达',
background: '#F9F3EB',
color: '#FA9512'
},
]
8 months ago
}
},
8 months ago
onShow() {
7 months ago
this.memberAgreement()
// this.taskList(1)
8 months ago
},
7 months ago
onReachBottom() {
8 months ago
console.log(11122);
},
8 months ago
methods: {
7 months ago
memberAgreement() {
this.$api.memberAgreement().then(res => {
console.log(7, res);
this.content = res.data.content
if (this.content != '<p><br></p>') {
7 months ago
this.taskList(1)
7 months ago
}else{}
this.list=this.listwdl
7 months ago
})
},
7 months ago
memberInfo() {
this.$api.memberInfo().then(res => {
if (res.data.auth_status != 2) {
7 months ago
uni.showModal({
title: "温馨提示",
content: "司机未认证成功,请先认证",
confirmColor: "#05754D",
7 months ago
showCancel: false,
7 months ago
success(res) {
uni.switchTab({
url: "/pages/user/index"
})
}
})
}
})
},
8 months ago
taskList(page) {
this.$api.taskList({
page
}).then(res => {
7 months ago
this.memberInfo()
8 months ago
this.list = res.data.list
})
},
qiangdan(e) {
if (e.status == 2) {
this.$refs.popup.open('center')
this.$api.orderGrabbing({
task_id: e.id
}).then(res => {
if (res.code == 200) {
this.status = true
this.$refs.popup.open('center')
this.taskList(1)
}
}).catch(res => {
7 months ago
console.log(444, res);
8 months ago
uni.hideToast();
this.status = false
this.$refs.popup.open('center')
this.taskList(1)
7 months ago
this.msg = res.msg ? res.msg : '您好,您来晚了一步,订单已被其他司机抢走 了,请选择其他订单'
8 months ago
})
} else {
}
8 months ago
},
close() {
this.$refs.popup.close('center')
},
8 months ago
}
}
</script>
8 months ago
<style scoped>
.cg {
text-align: center;
}
.cgwenzi {
margin-top: 30rpx;
text-align: center;
font-family: Alibaba PuHuiTi;
font-weight: 400;
font-size: 26rpx;
color: #222222;
}
.wenzi {
margin-top: 20rpx;
text-align: center;
font-family: Alibaba PuHuiTi;
font-weight: 400;
font-size: 36rpx;
color: #222222;
}
.popbox {
width: 660rpx;
height: 450rpx;
background: #FFFFFF;
border-radius: 20rpx;
}
.close {
text-align: right;
margin: 22rpx;
}
.btn {
margin-top: 29rpx;
width: 602rpx;
height: 90rpx;
background: #0D5DC9;
box-shadow: 0rpx 4rpx 13rpx 0rpx rgba(39, 58, 132, 0.28);
border-radius: 45rpx;
font-family: Alibaba PuHuiTi;
font-weight: 400;
font-size: 30rpx;
color: #FFFFFF;
line-height: 36rpx;
text-align: center;
line-height: 90rpx;
}
.btndis {
margin-top: 29rpx;
width: 602rpx;
height: 90rpx;
background: #999C9F;
box-shadow: 0rpx 4rpx 13rpx 0rpx rgba(39, 58, 132, 0.28);
border-radius: 45rpx;
font-family: Alibaba PuHuiTi;
font-weight: 400;
font-size: 30rpx;
color: #FFFFFF;
line-height: 36rpx;
text-align: center;
line-height: 90rpx;
}
.xinxis {
margin-top: 30rpx;
font-size: 26rpx;
}
.xinxis1 {
color: #999999;
}
.biaoqian {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
8 months ago
font-size: 24rpx;
8 months ago
}
.biaoqian1 {
padding: 19rpx;
border-radius: 10rpx;
margin-top: 20rpx;
8 months ago
background: #E2ECFA;
color: #0D5DC9
}
.biaoqian2 {
padding: 19rpx;
border-radius: 10rpx;
margin-top: 20rpx;
background: #E7F4F9;
color: #14B2EC
}
.biaoqian3 {
padding: 19rpx;
border-radius: 10rpx;
margin-top: 20rpx;
background: #F9EEEE;
color: #E45050
}
.biaoqian4 {
padding: 19rpx;
border-radius: 10rpx;
margin-top: 20rpx;
background: #F9F3EB;
color: #FA9512
8 months ago
}
8 months ago
.container {
8 months ago
padding: 24rpx;
8 months ago
font-size: 14px;
line-height: 24px;
8 months ago
padding-top: 0;
8 months ago
}
8 months ago
.box {
padding: 30rpx;
background: #fff;
margin-top: 20rpx;
}
.texts {
font-size: 30rpx;
margin-bottom: 29rpx;
}
.text {
color: #999999;
}
</style>