Commit 26629893 authored by Facius's avatar Facius

订单cell完成

parent f9620873
......@@ -12,25 +12,35 @@
</view>
<view class="content-view">
<view class="info-view" v-for="(item, key) in infoTexts" :key="key">
<text>{{item}}:</text>
<text>{{item + ':'}}</text>
<text>{{orderData[key]}}</text>
</view>
<view class="address-view">
<view class="address-left-view">
<image class="address-image" :src="dizhiImage" mode="widthFix"></image>
<text>{{orderData.contactAddress }}</text>
</view class="address-right-view">
<view>{{getDistance(orderData.contactAddressLatitud,orderData.contactAddressLongitud)}}km</view>
</view>
<view v-if="showDistance">
{{getDistance(orderData.contactAddressLatitud,orderData.contactAddressLongitud)}}km
</view>
</view>
</view>
<view class="line-view"></view>
<view class="reason-view" v-if="showReason"><text>未通过原因:</text>
<text class="reason-text">{{orderData.auditResults.remark}}</text>
</view>
<view class="bottom-view">
<view class="bottom-left-view">
<view :class="['bottom-tag-view', {'will': orderData.currentWillOverTime}]">{{tagText}}</view>
<u-count-down :timestamp="orderData.currentWillOverTime || orderData.currentOverTime" font-size="44"
color="#FF930D" @change="handleChange" ref="order-count-down"></u-count-down>
<view>
<view v-if="showCountTime" class="bottom-left-view">
<view :class="['bottom-tag-view', {'will': orderData.currentWillOverTime}]">{{tagText}}</view>
<u-count-down :timestamp="orderData.currentWillOverTime || orderData.currentOverTime"
font-size="44" color="#FF930D" @change="handleChange" ref="order-count-down"></u-count-down>
</view>
<view v-else-if="showTime">
<text>{{timeTitle}}</text>
<text>{{timeText}}</text>
</view>
</view>
<u-button class="right-btn" @click.stop="handleClick" :custom-style="buttonStyle" type="primary"
shape="circle">
......@@ -39,6 +49,7 @@
</view>
</view>
</view>
</view>
</template>
<script>
......@@ -61,6 +72,10 @@
appointmentDatetime: '', // 预约时间
currentWillOverTime: 10000, // 剩余时间
currentOverTime: 0, // 超过时间
auditDatetime: '2021.04.19 12:45:09', // 审核时间
submissionTime: '2021.04.19 16:24:48', // 提交时间
auditResults: {}, // 审核结果
orderBusinessType: 'R', // 业务类型 R 为抢单
}
}
},
......@@ -113,9 +128,9 @@
return this.typeTexts[this.orderType]
},
buttonStyle() { // 按钮样式
switch (this.orderData.orderStatus) {
switch (this.orderType) {
case 0:
if (this.orderData.currentWillOverTime) {
if (this.orderData.orderBusinessType != 'R') {
return this.buttonStyles[0]
} else {
return this.buttonStyles[1]
......@@ -130,6 +145,13 @@
return this.buttonStyles[2]
}
},
showCountTime() {
return [1, 2, 3].indexOf(this.orderType) != -1 || (this.orderType == 0 && this.orderData
.orderBusinessType != 'R')
},
showTime() {
return [4, 6].indexOf(this.orderType) != -1
},
infoTexts() {
return {
'orderNumber': '工单编号',
......@@ -141,21 +163,27 @@
return [this.type0Text, '去预约', '去签到', '去完工', '审核中', '去处理', '已完工']
},
type0Text() {
return this.orderData.currentWillOverTime ? '接单' : '抢单'
return this.orderData.orderBusinessType != 'R' ? '接单' : '抢单'
},
buttonStyles() {
return [{
'background-color': '#2272FF',
'color': '#FFFFFF',
'font-size': '32rpx'
'font-size': '32rpx',
'height': '80rpx',
'width': '200rpx'
}, {
'background-color': '#FF930D',
'color': '#FFFFFF',
'font-size': '32rpx'
'font-size': '32rpx',
'height': '80rpx',
'width': '200rpx'
}, {
'background-color': 'transparent',
'color': '#2272FF',
'font-size': '32rpx'
'font-size': '32rpx',
'height': '32rpx',
'width': '100rpx'
}]
},
buttonDisabled() {
......@@ -169,18 +197,30 @@
},
tagText() {
return this.orderData.currentWillOverTime ? '剩' : '超'
},
timeText() {
return this.orderType == 4 ? this.orderData.submissionTime : this.orderData.auditDatetime
},
timeTitle() {
return this.orderType == 4 ? '提交时间:' : '审核时间:'
},
showReason() {
return this.orderType == 5
},
showDistance() {
return this.orderType == 0
}
},
methods: {
handleClick() {
if (buttonDisabled) return
if (this.buttonDisabled) return
this.$emit('action')
},
actionClick() {
handleClickCell() {
this.$emit('click')
},
handleChange(timestamp) {
this.$refs['order-count-down'].seconds += 2
if (this.orderData.currentOverTime) this.$refs['order-count-down'].seconds += 2
},
getDistance(Latitud, Longitud) {
return this.distance(Latitud, Longitud, this.location[0], this.location[1])
......@@ -304,6 +344,17 @@
margin-top: 30rpx;
}
.reason-view {
text-align: left;
margin-top: 30rpx;
font-size: 26rpx;
color: #666666;
.reason-text {
color: #FA5A49;
}
}
.bottom-view {
display: flex;
align-items: center;
......@@ -330,11 +381,7 @@
}
}
.right-btn {
width: 200rpx;
height: 80rpx;
color: #FFFFFF;
}
.right-btn {}
}
}
}
......
......@@ -72,7 +72,7 @@
class="order-item-view"
>
<view v-for="(item, index) in orderList" :key="index">
<OrderCell :orderData="item"> </OrderCell>
<OrderCell :orderData="item" :orderType="0" :location="location" @click="handleClick" @action="handleAction"> </OrderCell>
</view>
<u-loadmore
:status="currentLoadStatus"
......@@ -106,7 +106,8 @@ export default {
data() {
return {
status: 0, // 入驻状态:0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',5=>'已签约',6=>'未支付保证金',7=>'已支付保证金',8=>'已通过考试',9=>'待提交'
triggered: false,
triggered: false,
location: [116.3896, 39.91917], // 经纬度
// list: [
// {
// image: "https://cdn.uviewui.com/uview/swiper/1.jpg",
......@@ -179,7 +180,14 @@ export default {
this.loadOrderList();
}
},
methods: {
methods: {
handleClick() { // 点击了cell
console.log('点击了cell')
},
handleAction() { // 点击了按钮
console.log('点击了按钮')
},
async initSettleInfo() {
let self = this;
if (self.status == 7) return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment