Commit 654c1b4c authored by 高铭波's avatar 高铭波

Merge branch 'dev' of https://git.banshouhui.com/lijundan/self-support into dev

parents 356ebf8d cf7ce8b4
<template> <template>
<view class="bottom-button"> <view class="bottom-button">
<view v-for="(item, index) in buttons" :class="['button-view', item.type]"> <view v-for="(item, index) in list" :class="['button-view', item.type]">
<u-button :class="['list-button', item.type]" @click="handleClick(index)" <u-button :class="['list-button', item.type, {'one': list.length == 1}]" @click="handleClick(item)"
:hover-class="item.type == 'image' ? 'none' : ''" :custom-style="buttonStyle[item.type]" type="primary" :hover-class="item.type == 'image' || item.disabled ? 'none' : ''"
shape="circle"> :custom-style="{...buttonStyle[item.disabled ? 'disabled' : item.type], ...item.customStyle}" type="primary" shape="circle">
<view class="image-view" v-if="item.type == 'image'"> <view class="image-view" v-if="item.type == 'image'">
<image :src="baseImageUrl + item.image" class="image-content"></image> <image :src="baseImageUrl + item.image" class="image-content"></image>
</view> </view>
<view :class="['text-content', item.type]">{{item.label}}</view> <view :class="['text-content', item.type]">{{item.label}}</view>
</u-button> </u-button>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
props: { props: {
// label: 按钮文字,
// type: 'text'普通按钮;'image'图文按钮
// image: type='image'的时候,按钮图片
// show: 是否显示,
// disabled: 是否禁用,true禁用;false 可以点击
// customStyle: 自定义button样式
buttons: { buttons: {
type: Array, type: Array,
default () { default () {
return [{ return [{
label: '过程反馈', label: '过程反馈',
type: 'image', type: 'image',
image: 'dianhua.png' image: 'guochengfankui.png',
show: true,
disabled: false,
}, },
{ {
label: '异常签到', label: '异常签到',
type: 'image', type: 'image',
image: 'daohang.png' image: 'yichangqiandao.png',
show: false,
disabled: false
},
{
label: '现场拍照',
type: 'image',
image: 'xiancahngpaizhao.png',
show: true,
disabled: false,
}, },
{ {
label: '接单', label: '接单',
type: 'text', type: 'text',
image: '' show: true,
disabled: true,
customStyle: {
'background-color': '#2272FF'
}
} }
] ]
} }
...@@ -42,6 +63,11 @@ ...@@ -42,6 +63,11 @@
baseImageUrl() { baseImageUrl() {
return process.uniEnv.qn_base_url return process.uniEnv.qn_base_url
}, },
list() {
return this.buttons.filter((item) => {
return item.show == true
})
},
buttonStyle() { buttonStyle() {
return { return {
'image': { 'image': {
...@@ -51,7 +77,6 @@ ...@@ -51,7 +77,6 @@
'flex-direction': 'column', 'flex-direction': 'column',
'height': '104rpx', 'height': '104rpx',
'width': '82rpx', 'width': '82rpx',
'margin-right': '40rpx'
}, },
'text': { 'text': {
...@@ -60,15 +85,26 @@ ...@@ -60,15 +85,26 @@
'display': 'flex', 'display': 'flex',
'flex-direction': 'column', 'flex-direction': 'column',
'height': '104rpx', 'height': '104rpx',
'width': '100%',
},
'disabled': {
'background-color': '#D1D4D4',
'border-color': 'transparent',
'display': 'flex',
'flex-direction': 'column',
'height': '104rpx',
'width': '100%' 'width': '100%'
}, },
} }
}, },
}, },
methods: { methods: {
handleClick(index) { // 0 主流程; 1 过程反馈;2 异常签到; 3 现场拍照
this.$emit('submit', index) handleClick(item) {
if (item.disabled) return
this.$emit('submit', item.id)
} }
} }
} }
...@@ -82,32 +118,45 @@ ...@@ -82,32 +118,45 @@
padding: 0 30rpx 44rpx 30rpx; padding: 0 30rpx 44rpx 30rpx;
.button-view { .button-view {
max-width: 600rpx;
display: flex;
&.image {} &.image {}
&.text { &.text {
width: 100%; width: 100%;
display: flex;
justify-content: flex-end;
} }
.list-button { .list-button {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
max-width: 600rpx; width: 100%;
&.image {
&.image {} margin-right: 40rpx;
}
&.text {} &.text {
.image-view { width: 400rpx;
flex-shrink: 0; margin-left: 40rpx;
background-color: #FFFFFF; &.one {
border-radius: 38rpx; width: 600rpx;
width: 76rpx; margin-left: 0rpx;
height: 76rpx;
.image-content {
width: 76rpx;
height: 76rpx;
} }
} }
.image-view {
flex-shrink: 0;
background-color: #FFFFFF;
border-radius: 38rpx;
width: 76rpx;
height: 76rpx;
.image-content {
width: 76rpx;
height: 76rpx;
}
}
.text-content { .text-content {
&.text { &.text {
color: #FFFFFF; color: #FFFFFF;
...@@ -125,7 +174,5 @@ ...@@ -125,7 +174,5 @@
} }
} }
} }
} }
</style> </style>
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
<view class="order-cell"> <view class="order-cell">
<text>合作厂商:</text> <text>合作厂商:</text>
<text>{{ order.partnerCompanyName }}</text> <text>{{ order.partnerCompanyName }}</text>
</view>
<view class="order-cell">
<text>厂商编号:</text>
<text>{{ order.partnerSerialNumber }}</text>
</view> </view>
<view class="order-cell between-cell"> <view class="order-cell between-cell">
<view class="left"> <view class="left">
...@@ -164,7 +168,7 @@ ...@@ -164,7 +168,7 @@
padding-bottom: 6rpx; padding-bottom: 6rpx;
background-color: #FFFFFF; background-color: #FFFFFF;
margin-bottom: 20rpx; margin-bottom: 20rpx;
padding: 30rpx 30rpx 0 30rpx; // padding: 30rpx 30rpx 0 30rpx;
border-radius: 6px; border-radius: 6px;
.top-item { .top-item {
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<view v-if="showCountTime" class="bottom-left-view"> <view v-if="showCountTime" class="bottom-left-view">
<view :class="['bottom-tag-view', {'timeout': timeout}]"><text>{{tagText}}</text></view> <view :class="['bottom-tag-view', {'timeout': timeout}]"><text>{{tagText}}</text></view>
<u-count-down :timestamp="timestamp" font-size="40" show-days separator="zh" <u-count-down :timestamp="timestamp" font-size="40" show-days separator="zh"
:color="timeout ? '#FA5A49' : '#FF930D'" @change="handleChange"separator-color="#666666" ref="order-count-down"></u-count-down> :color="timeout ? '#FA5A49' : '#FF930D'" @change="handleChange" separator-color="#666666" ref="order-count-down"></u-count-down>
</view> </view>
<view v-else-if="showTime"> <view v-else-if="showTime">
<text>{{timeTitle}}</text> <text>{{timeTitle}}</text>
...@@ -257,7 +257,7 @@ ...@@ -257,7 +257,7 @@
return 3 return 3
} else if (this.orderData.orderStatus == 85 || this.orderData.orderStatus == 87) { } else if (this.orderData.orderStatus == 85 || this.orderData.orderStatus == 87) {
return 4 return 4
} else if (this.orderData.orderStatus == 86 ||this.orderData.orderStatus == 88) { } else if (this.orderData.orderStatus == 86 || this.orderData.orderStatus == 88) {
return 5 return 5
} else if ([80, 81, 89, 110].indexOf(this.orderData.orderStatus) != -1) { } else if ([80, 81, 89, 110].indexOf(this.orderData.orderStatus) != -1) {
return 6 return 6
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
<text>履约记录</text> <text>履约记录</text>
</view> </view>
<view v-if="orderRecords.length == 0" class="no-record-view">当前暂无履约记录</view> <view v-if="orderRecords.length == 0" class="no-record-view">当前暂无履约记录</view>
<view v-else class="record-list-view"> <view v-else :class="['record-list-view', {'short': orderRecords.length <= showLenght}]">
<view class="record-right-view"> <view class="record-right-view">
<view class="dashed-line-view"></view> <view class="dashed-line-view"></view>
<view class="order-list"> <view class="order-list">
<view v-for="(record,index) in shwoOrderRecords" :key="record.operationContent" :class="['order-cell', {'first': index == 0}]"> <view v-for="(record,index) in showOrderRecords" :key="record.operationContent" :class="['order-cell', {'first': index == 0}]">
<view class="node-view"> <view class="node-view">
<view class="node-border-view"> <view class="node-border-view">
<view class="node-middle-view"></view> <view class="node-middle-view"></view>
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
} }
}, },
computed: { computed: {
shwoOrderRecords() { showOrderRecords() {
if (this.readMoreRecord && this.orderRecords && this.orderRecords.length > 0) { if (this.readMoreRecord && this.orderRecords && this.orderRecords.length > 0) {
return this.orderRecords.slice(0, this.showLenght) return this.orderRecords.slice(0, this.showLenght)
} else { } else {
...@@ -99,8 +99,10 @@ ...@@ -99,8 +99,10 @@
.record-list-view { .record-list-view {
position: relative; position: relative;
&.short {
padding-bottom: 30rpx;
}
.record-right-view { .record-right-view {
position: relative; position: relative;
display: flex; display: flex;
...@@ -189,7 +191,7 @@ ...@@ -189,7 +191,7 @@
text-align: center; text-align: center;
color: #2272FF; color: #2272FF;
font-size: 26rpx; font-size: 26rpx;
margin-top: 30rpx; padding-top: 30rpx;
padding-bottom: 30rpx; padding-bottom: 30rpx;
} }
......
...@@ -163,7 +163,7 @@ export default { ...@@ -163,7 +163,7 @@ export default {
login.signup(params).then(res => { login.signup(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res) { if (res) {
app.setUserData(res.data, that) login.setUserData(res.data, that)
app.track('signup_login', {mobile: res.data.mobile}); app.track('signup_login', {mobile: res.data.mobile});
app.profileSet(that) app.profileSet(that)
app.profileAppend(that) app.profileAppend(that)
...@@ -174,11 +174,11 @@ export default { ...@@ -174,11 +174,11 @@ export default {
title: '授权失败,请重新授权', title: '授权失败,请重新授权',
icon: 'none' icon: 'none'
}); });
this.setLoginStatus(false) that.setLoginStatus(false)
} }
}).catch(res => { }).catch(res => {
uni.hideLoading() uni.hideLoading()
this.setLoginStatus(false) that.setLoginStatus(false)
}) })
}, },
fail () { fail () {
...@@ -187,7 +187,7 @@ export default { ...@@ -187,7 +187,7 @@ export default {
} }
}) })
} else { } else {
this.toLogin(params) that.toLogin(params)
} }
} else { } else {
uni.showModal({ uni.showModal({
......
<template> <template>
<view class="order-wrap"> <view class="order-wrap">
<u-navbar :title="title" title-color="#FFFFFF" title-size="32" back-icon-color="#FFFFFF" :background="background" :border-bottom="false"></u-navbar> <u-navbar :title="title" title-color="#FFFFFF" title-size="32" back-icon-color="#FFFFFF" :background="background" :border-bottom="false"></u-navbar>
<view class="content"> <view class="header" v-if="order.currentOverTime && showTimeOut">
<view class="header" v-if="order.currentOverTime && showTimeOut"> <!-- 倒计时 -->
<view class="title"> <view class="title">
<view :class="['bottom-tag-view', {'timeout': timeout}]"><text>{{timeout ? '超' : '剩'}}</text></view> <view class="bottom-tag-view"><text>{{timeout ? '超时' : '剩余'}}</text></view>
<u-count-down :timestamp="timestampDiff(order.currentOverTime)" font-size="44" show-days separator="zh" separator-size="44" <u-count-down :timestamp="timestamp" font-size="28" show-days separator="zh" separator-size="32" height="40"
:color="tipColor" :separator-color="tipColor" @change="timeOutChange(order.currentOverTime)" ref="order-count-down"></u-count-down> color="#2272FF" separator-color="#FFFFFF" @change="timeOutChange" ref="order-count-down" bg-color="#FFFFFF"></u-count-down>
</view>
<u-button v-if="allowRejection || 1" :custom-style="customStyle" size="mini" @click="rejectOrder" shape="circle">拒单</u-button>
</view> </view>
<view class="header-content">
<!-- 抓紧时间提示 -->
<view class="tip-text">{{tipText}}</view>
<!-- 拒单 -->
<view v-show="allowRejection" class="reject-button" @click="$u.throttle(rejectOrder, 500)">拒单</view>
</view>
</view>
<view class="content">
<!-- 订单详情 -->
<view class="card base-item"> <view class="card base-item">
<Detail :order="order" :readMore.sync="readMore" :operate="isAllowDianhuaAndDaohang"></Detail> <Detail :order="order" :readMore.sync="readMore" :operate="isAllowDianhuaAndDaohang"></Detail>
</view> </view>
<!-- 从我的页面进来显示计算信息 --> <!-- 从我的页面进来显示结算信息 -->
<view v-if="isFromMine" class="settlement-view"> <view v-if="isFromMine" class="settlement-view">
<view class="settlement-title">结算信息</view> <view class="settlement-title">结算信息</view>
<view class="settlement-content"> <view class="settlement-content">
...@@ -30,11 +37,24 @@ ...@@ -30,11 +37,24 @@
<text>{{settlementInfo.amount}}元</text> <text>{{settlementInfo.amount}}元</text>
</view> </view>
</view> </view>
<!-- 其他页面进来 --> <!-- 不是从我的页面,而是其他页面进来 -->
<view v-else> <view v-else>
<!-- 业务文件 -->
<view class="order-file" v-if="showFile">
<view class="order-file-left">
<image :src="wenjianImage" class="file-image"></image>
<text>充电桩安装业务文件</text>
</view>
<view class="order-file-right" @click="$u.throttle(handleClickFile, 500)">
<text>点击查看</text>
<u-icon name="arrow-right"></u-icon>
</view>
</view>
<!-- 时间选择 -->
<view class="card appoint-item" v-show="showTimeSelect"> <view class="card appoint-item" v-show="showTimeSelect">
<appoint-time :dateList="dateList" :timeList="timeList" @dateChange="dateChange" @timeChange="timeChange" @weekChange="weekChange"></appoint-time> <appoint-time :dateList="dateList" :timeList="timeList" @dateChange="dateChange" @timeChange="timeChange" @weekChange="weekChange"></appoint-time>
</view> </view>
<!-- 履约记录 -->
<view class="card record-item"> <view class="card record-item">
<Record :orderRecords="orderRecords"></Record> <Record :orderRecords="orderRecords"></Record>
</view> </view>
...@@ -42,51 +62,7 @@ ...@@ -42,51 +62,7 @@
</view> </view>
<!-- 不是从我的页面进来才显示 --> <!-- 不是从我的页面进来才显示 -->
<template v-if="!isFromMine"> <template v-if="!isFromMine">
<BottomButtons :buttons="buttons" @submit="handleSubmit"></BottomButtons> <BottomButtons v-if="showBottomBtn" :buttons="buttons" @submit="handleSubmit"></BottomButtons>
<view v-if="showCenterBtn" class="toolbar">
<!-- 背景,内容,请求接口 根据状态不同改变 {{operationDoing[order.orderStatus].background}} -->
<!-- 过程反馈 -->
<view class="left">
<view v-if="allowFeedback" @click="clickFeedback" class="button">
<text>反馈</text>
</view>
</view>
<!--接单,抢单,已被抢, 预约 ,签到 ,去完工 timestampDiff(order.currentOverTime)>0 -->
<view class="center">
<view>
<u-toast ref="uToast" />
</view>
<view v-if="showCenterBtn" @click="$u.throttle(handleClickSure, 500)" class="button" :class="['center-button-view', btnClass]">
<text>{{ centerButtonText }}</text>
<view v-if="order.currentOverTime && showTimeOut" class="time-view">
<text style="padding-right: 8rpx;">{{timeOut?'剩':'超'}}</text>
<!-- <u-count-down
:timestamp="timestampDiff(order.currentOverTime)"
font-size="20"
color="#FFFFFF"
bg-color="transparent"
separator-color="#FFFFFF"
separator-size="20"
:ref="'uCountDown'"
show-days
height="20"
:show-days="threeDays()"
:show-minutes="!threeDays()"
:show-seconds="!threeDays()"
:separator="threeDays() ? 'zh' : 'colon'"
@change="timeOutChange(order.currentOverTime)" >
</u-count-down> -->
</view>
</view>
</view>
<!-- 异常预约 ,现场拍照 这里是调用拍照的两个组件-->
<view class="right">
<view v-if="errorSignIn || scenePhoto" @click="$u.throttle(handleClickRight, 500)" :class="['button', {'active': scenePhoto}]">
<text :style="errorSignIn ? 'font-size:24rpx' : ''">{{errorSignIn ? '异常\n签到' : '拍照'}}</text>
</view>
</view>
</view>
<take-photo type="test" v-if="takeStatus" @close="closeTake" :upload="false" :num="1"></take-photo> <take-photo type="test" v-if="takeStatus" @close="closeTake" :upload="false" :num="1"></take-photo>
<!-- <PopView title="查看交互规范" message="为完善交付质量,请查看对应的交付规范" :visible.sync="visible" @click="handleClick"/> --> <!-- <PopView title="查看交互规范" message="为完善交付质量,请查看对应的交付规范" :visible.sync="visible" @click="handleClick"/> -->
<u-popup border-radius="12" v-model="visible" safe-area-inset-bottom mode="center" width="690rpx" <u-popup border-radius="12" v-model="visible" safe-area-inset-bottom mode="center" width="690rpx"
...@@ -159,14 +135,13 @@ ...@@ -159,14 +135,13 @@
allowFeedback: false, // 允许过程反馈 allowFeedback: false, // 允许过程反馈
needPhotograph: true, // 需要现场拍摄 needPhotograph: true, // 需要现场拍摄
centerButton: '', // 是否显示按钮 centerButton: '', // 是否显示按钮
centerButtonText: '', bottomButtonText: '',
orderRecords: [], orderRecords: [],
method: null, method: null,
showCenterBtn: false, showBottomBtn: false,
showTimeSelect: false, showTimeSelect: false,
submitType: '', submitType: '',
nextUrl:'', nextUrl:'',
btnClass:'appoint-btn',
takeStatus:false, takeStatus:false,
errorSignIn:false, errorSignIn:false,
scenePhoto: false, scenePhoto: false,
...@@ -186,21 +161,9 @@ ...@@ -186,21 +161,9 @@
isFromMine: false, isFromMine: false,
settlementInfo: {formatTime: '-', list: [], amount: ''}, settlementInfo: {formatTime: '-', list: [], amount: ''},
unloaded: false, unloaded: false,
buttons: [{ timeout: false,
label: '过程反馈', timestamp: 0,
type: 'image', showFile: false, // 显示查看业务文件
image: 'dianhua.png'
},
{
label: '异常签到',
type: 'image',
image: 'daohang.png'
},
{
label: '接单',
type: 'text',
image: ''
}]
} }
}, },
onLoad(option) { onLoad(option) {
...@@ -235,23 +198,68 @@ ...@@ -235,23 +198,68 @@
this.closeLocationChange() this.closeLocationChange()
}, },
computed: { computed: {
centerButtonClass() {
let btnClass = "appoint-btn"
return btnClass
},
timeout() {
return this.order.currentOverTime < new Date().getTime()
},
tipColor() {
return this.timeout ? '#FA5A49' : '#FF930D'
},
customStyle() { customStyle() {
return { return {
'height': '48rpx', 'height': '48rpx',
'width': '100rpx', 'width': '100rpx',
'color': '#2272FF' 'color': '#FFFFFF',
'border-color': 'transparent',
'background-color': 'transparent'
} }
} },
tipText() {
switch (this.bottomButtonText) {
case '接单':
return this.timeout ? '您的订单已超时,请及时接单' : '请您注意剩余时间,及时接单'
case '预约':
return this.timeout ? '您的订单已超时,请及时预约' : '请您注意剩余时间,及时预约'
case '去完工':
return this.timeout ? '您的订单已超时,请及时完工' : '请您注意剩余时间,及时完工'
default:
return ''
}
},
buttons() {
//id: 0 主流程; 1 过程反馈;2 异常签到; 3 现场拍照
return [{
label: '过程反馈',
type: 'image',
image: 'guochengfankui.png',
show: this.allowFeedback,
disabled: false,
id: 1
},
{
label: '异常签到',
type: 'image',
image: 'yichangqiandao.png',
show: this.errorSignIn,
disabled: false,
id: 2
},
{
label: '现场拍照',
type: 'image',
image: 'xiancahngpaizhao.png',
show: this.scenePhoto,
disabled: false,
id: 3
},
{
label: this.bottomButtonText,
type: 'text',
image: '',
show: true,
disabled: this.centerBtnDisabled,
id: 0,
customStyle: {
'background-color': this.title == '待抢单' ? '#FF930D' : '#2272FF'
}
}]
},
wenjianImage() {
return process.uniEnv.qn_base_url + 'wenjian.png'
},
}, },
methods: { methods: {
updateLocation(){ updateLocation(){
...@@ -272,7 +280,6 @@ ...@@ -272,7 +280,6 @@
if(this.getDistance(res.latitude,res.longitude)>this.signDistance){ if(this.getDistance(res.latitude,res.longitude)>this.signDistance){
// 计算签到距离 // 计算签到距离
this.btnClass = "isGan-btn"
this.centerBtnDisabled = false this.centerBtnDisabled = false
}else{ }else{
this.centerBtnDisabled = true this.centerBtnDisabled = true
...@@ -325,13 +332,9 @@ ...@@ -325,13 +332,9 @@
if (res.code == 200) { if (res.code == 200) {
self.order = res.data self.order = res.data
this.getCurrentBtn() this.getCurrentBtn()
var nowTime = new Date(); var nowTime = new Date().getTime();
if(this.showTimeOut && this.order.currentOverTime && nowTime.getTime() > this.order.currentOverTime){ this.timeout = this.order.currentOverTime && nowTime> this.order.currentOverTime
this.btnClass='timeOut-btn' this.timestamp = Math.round(Math.abs(this.order.currentOverTime - nowTime) / 1000)
}
// if(self.order.isFirstOrder){
// this.visible = true
// }
// 格式化时间 // 格式化时间
this.settlementInfo.formatTime = this.order.settleCenterSyncDatetime ? this.$u.timeFormat(this.order.settleCenterSyncDatetime, 'yyyy.mm.dd hh:MM:ss') : '-' this.settlementInfo.formatTime = this.order.settleCenterSyncDatetime ? this.$u.timeFormat(this.order.settleCenterSyncDatetime, 'yyyy.mm.dd hh:MM:ss') : '-'
} else { } else {
...@@ -479,54 +482,76 @@ ...@@ -479,54 +482,76 @@
var orderBusinessType = this.order.orderBusinessTypeText var orderBusinessType = this.order.orderBusinessTypeText
if (orderStatus < 31 && orderBusinessType === '指派单') { if (orderStatus < 31 && orderBusinessType === '指派单') {
// 接单 // 接单
this.showCenterBtn = true this.showBottomBtn = true
this.centerButtonText = "接单" this.bottomButtonText = "接单"
// 已派单的时显示拒单按钮 // 已派单的时显示拒单按钮
this.allowRejection = true this.allowRejection = true
this.submitType = "orderAccept" this.submitType = "orderAccept"
this.readMore = false this.readMore = false
this.isAllowDianhuaAndDaohang = false this.isAllowDianhuaAndDaohang = false
this.title = '待接单',
this.showFile = false
} else if (orderStatus < 31 && orderBusinessType === '订单池') { } else if (orderStatus < 31 && orderBusinessType === '订单池') {
// 抢单 // 抢单
this.centerButton = "appoint1" this.centerButton = "appoint1"
this.centerButtonText = "抢单" this.bottomButtonText = "抢单"
this.showCenterBtn = true this.showBottomBtn = true
this.submitType = "orderGan" this.submitType = "orderGan"
this.showTimeOut=false this.showTimeOut=false
this.readMore = false this.readMore = false
this.isAllowDianhuaAndDaohang = false this.isAllowDianhuaAndDaohang = false
this.title = '待抢单',
this.showFile = false
} else if (orderStatus === 31 && !this.order.appointmentDatetime) { } else if (orderStatus === 31 && !this.order.appointmentDatetime) {
// 预约 // 预约
this.centerButton = "appoint2" this.centerButton = "appoint2"
this.centerButtonText = "预约" this.bottomButtonText = "预约"
this.allowFeedback = true this.allowFeedback = true
this.showCenterBtn = true this.showBottomBtn = true
this.showTimeSelect = true this.showTimeSelect = true
this.isAllowDianhuaAndDaohang = true this.isAllowDianhuaAndDaohang = true
this.readMore = true this.readMore = true
this.submitType = "workerAppointment" this.submitType = "workerAppointment"
this.title = '待预约',
this.showFile = true
this.loadCalendar() this.loadCalendar()
} else if (orderStatus === 31 && this.order.appointmentDatetime) { } else if (orderStatus === 31 && this.order.appointmentDatetime) {
// 签到 // 签到
this.centerButton = "appoint3" this.centerButton = "appoint3"
this.centerButtonText = "签到" this.bottomButtonText = "签到"
this.allowFeedback = true this.allowFeedback = true
this.showCenterBtn = true this.showBottomBtn = true
this.submitType = "maintainWorkerCheckin" this.submitType = "maintainWorkerCheckin"
this.isAllowDianhuaAndDaohang = true this.isAllowDianhuaAndDaohang = true
this.errorSignIn = true this.errorSignIn = true
this.title = '待签到',
this.showFile = true
// this.addressToCoordinate() // this.addressToCoordinate()
this.updateLocation() this.updateLocation()
} else if (orderStatus > 31 && orderStatus < 80) { } else if (orderStatus > 31 && orderStatus < 80) {
// 完工 // 完工
this.centerButton = "filish" this.centerButton = "filish"
this.centerButtonText = "去完工" this.bottomButtonText = "去完工"
this.submitType = "toFilish" this.submitType = "toFilish"
this.allowFeedback = true this.allowFeedback = true
this.showCenterBtn = true this.showBottomBtn = true
this.scenePhoto = true this.scenePhoto = true
this.readMore = true this.readMore = true
this.isAllowDianhuaAndDaohang = true this.isAllowDianhuaAndDaohang = true
this.title = '待完工',
this.showFile = true
}else if (orderStatus == 85 || orderStatus == 87) { // 审核中
this.isAllowDianhuaAndDaohang = true
this.title = '审核中',
this.showFile = true
} else if (orderStatus == 86 || orderStatus == 88) { // 异常单
this.isAllowDianhuaAndDaohang = true
this.title = '异常单',
this.showFile = true
} else if ([80, 81, 89, 110].indexOf(orderStatus) != -1) { // 已完工
this.isAllowDianhuaAndDaohang = true
this.title = '已完工',
this.showFile = true
} else { } else {
this.isAllowDianhuaAndDaohang = true this.isAllowDianhuaAndDaohang = true
} }
...@@ -546,8 +571,23 @@ ...@@ -546,8 +571,23 @@
this.handleBtn() this.handleBtn()
} }
}, },
handleSubmit(index) { handleSubmit(id) {
console.log(index) console.log(id)
// 0 主流程; 1 过程反馈;2 异常签到; 3 现场拍照
switch (id) {
case 0:
this.handleClickSure()
break
case 1:
this.clickFeedback()
break
case 2:
this.take()
break
case 3:
this.scenePhotoClick()
break
}
}, },
handleBtn() { handleBtn() {
console.log('click button') console.log('click button')
...@@ -614,7 +654,7 @@ ...@@ -614,7 +654,7 @@
|| (res.code!==undefined && res.code === 200) ) { || (res.code!==undefined && res.code === 200) ) {
this.trackOrder() this.trackOrder()
this.$refs.uToast.show({ this.$refs.uToast.show({
title: this.centerButtonText + '操作成功', title: this.bottomButtonText + '操作成功',
type: 'success', type: 'success',
duration: 1000, duration: 1000,
callback : function(){ callback : function(){
...@@ -639,6 +679,10 @@ ...@@ -639,6 +679,10 @@
}) })
} }
}) })
},
// 去业务材料页面
handleClickFile() {
}, },
trackOrder() { trackOrder() {
// 接单成功事件,签到成功事件 // 接单成功事件,签到成功事件
...@@ -658,14 +702,14 @@ ...@@ -658,14 +702,14 @@
}) })
}, },
isGan(){ isGan(){
this.centerButtonText = "已被抢" this.bottomButtonText = "已被抢"
this.submitType = "" this.submitType = ""
this.btnClass='isGan-btn' this.centerBtnDisabled = true
}, },
clickFeedback(){ clickFeedback(){
// 过程反馈 // 过程反馈
uni.navigateTo({ uni.navigateTo({
url: 'pages/order/feedback?orderId='+this.order.orderId+'&categoryId='+this.order.categoryId+'&showGY=' + (this.centerButtonText != '预约' ? '1' : '0') url: 'pages/order/feedback?orderId='+this.order.orderId+'&categoryId='+this.order.categoryId+'&showGY=' + (this.bottomButtonText != '预约' ? '1' : '0')
}) })
}, },
filish(){ filish(){
...@@ -745,23 +789,14 @@ ...@@ -745,23 +789,14 @@
Rad(d){ Rad(d){
return d * Math.PI / 180.0;//经纬度转换成三角函数中度分表形式。 return d * Math.PI / 180.0;//经纬度转换成三角函数中度分表形式。
}, },
timestampDiff(currentOverTime){ // 计算超时时间 timeOutChange(timestamp){
if(!currentOverTime){ if (this.timeout) this.$refs['order-count-down'].seconds += 2
return 0 if (timestamp == 0 && !this.timeout) { // 超时之后倒计时变为正计时
} setTimeout(()=> {
return Math.round(Math.abs(this.order.currentOverTime - new Date().getTime()) / 1000); this.timestamp = 1
}, this.timeout = true
timeOutChange(currentOverTime){ }, 1000)
let self = this }
var nowTime = new Date(); // 当前时间
if(currentOverTime && nowTime.getTime() > currentOverTime){
if(this.centerBtnDisabled === false && this.submitType === 'maintainWorkerCheckin'){
this.btnClass = "isGan-btn"
}else{
this.btnClass='timeOut-btn'
}
this.$refs['order-count-down'].seconds += 2
}
}, },
// handleClick(){ // handleClick(){
// this.visible = false // this.visible = false
...@@ -774,9 +809,6 @@ ...@@ -774,9 +809,6 @@
this.visible = false this.visible = false
// 添加客服 // 添加客服
}, },
threeDays() {
return this.timestampDiff(this.order.currentOverTime) > 3600 * 24 * 3
}
} }
}; };
</script> </script>
...@@ -794,55 +826,45 @@ ...@@ -794,55 +826,45 @@
flex-direction: column; flex-direction: column;
.header { .header {
padding: 24rpx 30rpx 24rpx 30rpx; padding: 4rpx 32rpx 14rpx 32rpx;
margin-bottom: 20rpx;
display: flex; .header-content {
justify-content: space-between; display: flex;
align-items: center; justify-content: space-between;
background-color: #FFFFFF; align-items: center;
border-radius: 12rpx; margin-top: 12rpx;
max-height: 100rpx; .tip-text {
font-size: 26rpx;
color: #EFEFEF;
}
.reject-button {
text-align: center;
width: 106rpx;
height: 52rpx;
border-radius: 40rpx;
font-size: 24rpx;
font-weight: 400;
line-height: 52rpx;
color: #DEDEDE;
text-align: right;
}
}
.title { .title {
display: flex; display: flex;
align-items: center; align-items: center;
.bottom-tag-view { .bottom-tag-view {
width: 52rpx;
height: 52rpx;
border-radius: 26rpx;
color: #FFFFFF; color: #FFFFFF;
font-size: 26rpx; font-size: 40rpx;
background-color: #FF930D; margin-right: 10rpx;
margin-right: 16rpx;
display: flex;
justify-content: center;
align-items: center;
&.timeout {
background-color: #FA5A49;
}
} }
} }
.button {
// text-align: center;
// width: 106rpx;
// height: 52rpx;
// border-radius: 40rpx;
// font-size: 24rpx;
// font-weight: 400;
// line-height: 52rpx;
// color: #DEDEDE;
}
} }
.content { .content {
height: 100%; height: 100%;
border-radius: 12rpx; border-radius: 12rpx;
overflow: auto; overflow: auto;
margin-right: 30rpx; margin: 6rpx 30rpx 30rpx 30rpx;
margin-left: 30rpx;
margin-bottom: 30rpx;
.card { .card {
background-color: #FFFFFF; background-color: #FFFFFF;
...@@ -972,4 +994,30 @@ ...@@ -972,4 +994,30 @@
} }
} }
} }
.order-file {
display: flex;
justify-content: space-between;
align-items: center;
margin: 20rpx 0;
border-radius: 12rpx;
background-color: #FFFFFF;
padding: 24rpx 30rpx;
.order-file-left {
color: #333333;
font-size: 26rpx;
display: flex;
align-items: center;
.file-image {
width: 52rpx;
height: 52rpx;
flex-shrink: 0;
margin-right: 16rpx;
}
}
.order-file-right {
color: #2272FF;
font-size: 26rpx;
}
}
</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