Commit 3512b2fd authored by Facius's avatar Facius

工单cell样式

parent 403838d9
<template> <template>
<view class="order-cell">
<view class="order-view" @click="handleClickCell"> <view class="order-view" @click="handleClickCell">
<view class="order-top-view"> <view class="order-top-view">
<view class="left-view"> <view class="left-view">
<view :class="['tag-view', {'active': orderData.orderServiceType == '安装'}]"> <view :class="['tag-view', {'active': active}]">
{{ orderData.orderServiceType }}</view> {{ orderData.orderServiceType }}
</view>
<view class="store-view">{{ orderData.categoryName }}</view> <view class="store-view">{{ orderData.categoryName }}</view>
</view> </view>
<view class="right-view">{{ orderData.orderBusinessTypeText }}</view> <view class="right-view">{{ orderData.orderBusinessTypeText }}</view>
...@@ -15,26 +17,27 @@ ...@@ -15,26 +17,27 @@
</view> </view>
<view class="address-view"> <view class="address-view">
<view class="address-left-view"> <view class="address-left-view">
<image class="address-image" :src="dizhiImage"></image> <image class="address-image" :src="dizhiImage" mode="widthFix"></image>
<text>{{orderData.contactAddress }}</text> <text>{{orderData.contactAddress }}</text>
</view class="address-right-view"> </view class="address-right-view">
<view>{{getDistance(orderData.contactAddressLatitud,orderData.contactAddressLongitud)}}km</view> <view>{{getDistance(orderData.contactAddressLatitud,orderData.contactAddressLongitud)}}km</view>
</view> </view>
</view> </view>
<u-divider margin-top="16" half-width="630" border-color="#F4F5F7" :use-slot="false"> <view class="line-view"></view>
</u-divider>
<view class="bottom"> <view class="bottom-view">
<view class="left"> <view class="bottom-left-view">
<view class="tag">剩</view> <view :class="['bottom-tag-view', {'will': orderData.currentWillOverTime}]">{{tagText}}</view>
<u-count-down :timestamp="timestamp" font-size="44" color="#FF930D"></u-count-down> <u-count-down :timestamp="orderData.currentWillOverTime || orderData.currentOverTime" font-size="44"
color="#FF930D" @change="handleChange" ref="order-count-down"></u-count-down>
</view> </view>
<u-button class="right-btn" @click.stop="handleClick" :custom-style="buttonStyle"> <u-button class="right-btn" @click.stop="handleClick" :custom-style="buttonStyle" type="primary" shape="circle">
{{orderText}} {{orderText}}
</u-button> </u-button>
</view> </view>
</view> </view>
</view>
</template> </template>
<script> <script>
...@@ -42,7 +45,8 @@ ...@@ -42,7 +45,8 @@
props: { props: {
orderData: { orderData: {
type: Object, type: Object,
default: { default () {
return {
orderServiceType: '安装', // 服务类型:安装、维修 orderServiceType: '安装', // 服务类型:安装、维修
categoryName: '充电桩', // 品类:充电桩 categoryName: '充电桩', // 品类:充电桩
orderBusinessTypeText: '分配单', // 业务类型:分配单、订单池 orderBusinessTypeText: '分配单', // 业务类型:分配单、订单池
...@@ -52,11 +56,20 @@ ...@@ -52,11 +56,20 @@
contactAddress: '湾街道荔枝花园D座125号', // 详细地址 contactAddress: '湾街道荔枝花园D座125号', // 详细地址
contactAddressLatitud: '116.3896', // 联系人地址经度 contactAddressLatitud: '116.3896', // 联系人地址经度
contactAddressLongitud: '39.91917', // 联系人地址纬度 contactAddressLongitud: '39.91917', // 联系人地址纬度
orderStatus: '0', // 工单状态 orderStatus: 0, // 工单状态
appointmentDatetime: '' // 预约时间 appointmentDatetime: '', // 预约时间
currentWillOverTime: 10000, // 剩余时间
currentOverTime: 0, // 超过时间
}
} }
}, },
orderType: Number // 0:待接单 1:'去预约', 2:'去签到', 3:'去完工', 4:'审核中', 5:'去处理', 6'已完工' orderType: Number, // 0:待接单 1:'去预约', 2:'去签到', 3:'去完工', 4:'审核中', 5:'去处理', 6'已完工'
location: {
type: Array,
default () {
return [116.3896, 39.91917]
}
}
}, },
data() { data() {
return { return {
...@@ -99,21 +112,21 @@ ...@@ -99,21 +112,21 @@
return this.typeTexts[this.orderType] return this.typeTexts[this.orderType]
}, },
buttonStyle() { // 按钮样式 buttonStyle() { // 按钮样式
switch (this.status) { switch (this.orderData.orderStatus) {
case 0: case 0:
if (this.orderData.currentWillOverTime) { if (this.orderData.currentWillOverTime) {
return this.buttonStyle[0] return this.buttonStyles[0]
} else { } else {
return this.buttonStyle[1] return this.buttonStyles[1]
} }
case 1: case 1:
case 2: case 2:
case 3: case 3:
case 5: case 5:
return this.buttonStyle[0] return this.buttonStyles[0]
case 4: case 4:
case 6: case 6:
return this.buttonStyle[2] return this.buttonStyles[2]
} }
}, },
infoTexts() { infoTexts() {
...@@ -132,21 +145,30 @@ ...@@ -132,21 +145,30 @@
buttonStyles() { buttonStyles() {
return [{ return [{
'background-color': '#2272FF', 'background-color': '#2272FF',
'color': '#FFFFFF' 'color': '#FFFFFF',
'font-size': '32rpx'
}, { }, {
'background-color': '#FF930D', 'background-color': '#FF930D',
'color': '#FFFFFF' 'color': '#FFFFFF',
'font-size': '32rpx'
}, { }, {
'background-color': 'transparent', 'background-color': 'transparent',
'color': '#2272FF' 'color': '#2272FF',
'font-size': '32rpx'
}] }]
}, },
buttonDisabled() { buttonDisabled() {
return this.orderData.orderStatus == 4 || this.orderData.orderStatus == 6 return this.orderData.orderStatus == 4 || this.orderData.orderStatus == 6
}, },
dizhiImage() { dizhiImage() {
return process.uniEnv.qn_base_url + 'dizhi.png' return process.uniEnv.qn_base_url + 'shouye-dizhi.png'
},
active() {
return this.orderData.orderServiceType == '安装'
}, },
tagText() {
return this.orderData.currentWillOverTime ? '剩' : '超'
}
}, },
methods: { methods: {
handleClick() { handleClick() {
...@@ -156,8 +178,11 @@ ...@@ -156,8 +178,11 @@
actionClick() { actionClick() {
this.$emit('click') this.$emit('click')
}, },
handleChange(timestamp) {
this.$refs['order-count-down'].seconds += 2
},
getDistance(Latitud, Longitud) { getDistance(Latitud, Longitud) {
return this.distance(Latitud, Longitud, this.dataValue[0], this.dataValue[1]) return this.distance(Latitud, Longitud, this.location[0], this.location[1])
}, },
/** /**
* echo distance(116.3896,39.91917,116.3940,39.91726); * echo distance(116.3896,39.91917,116.3940,39.91726);
...@@ -185,16 +210,21 @@ ...@@ -185,16 +210,21 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.order-cell {
padding-bottom: 20rpx;
.order-view { .order-view {
width: 100%; width: 100%;
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 12rpx; border-radius: 12rpx;
padding: 30rpx; padding: 30rpx;
margin-bottom: 20rpx;
.order-top-view { .order-top-view {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
margin-bottom: 20rpx;
.left-view { .left-view {
display: flex; display: flex;
...@@ -234,31 +264,77 @@ ...@@ -234,31 +264,77 @@
.content-view { .content-view {
.info-view { .info-view {
text-align: left; text-align: left;
margin-top: 20rpx;
color: #333333; color: #333333;
font-size: 26rpx; font-size: 26rpx;
margin-top: 12rpx;
margin-bottom: 12rpx;
} }
.address-view { .address-view {
display: flex; display: flex;
align-items: center; align-items: flex-start;
justify-content: space-between; justify-content: space-between;
color: #333333; color: #333333;
font-size: 24rpx; font-size: 24rpx;
margin-top: 12rpx;
.address-left-view { .address-left-view {
display: flex; display: flex;
align-items: center; align-items: center;
align-items: flex-start;
.address-image { .address-image {
width: 24rpx; width: 26rpx;
height: 24rpx; height: 28rpx;
margin-right: 8rpx; margin-right: 8rpx;
flex-shrink: 0;
margin-top: 4rpx;
} }
} }
.address-right-view {} .address-right-view {}
} }
}
.line-view {
background-color: #F4F5F7;
height: 2rpx;
width: 100%;
margin-top: 30rpx;
}
.bottom-view {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 30rpx;
.bottom-left-view {
display: flex;
align-items: center;
.bottom-tag-view {
width: 52rpx;
height: 52rpx;
border-radius: 26rpx;
line-height: 56rpx;
color: #FFFFFF;
font-size: 26rpx;
background-color: #FA5A49;
margin-right: 20rpx;
&.will {
background-color: #FF930D;
}
}
}
.right-btn {
width: 200rpx;
height: 80rpx;
color: #FFFFFF;
}
}
} }
} }
</style> </style>
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