Commit e8dea083 authored by Morson's avatar Morson

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

# Conflicts:
#	src/common/api/order.js
parents 56ae2fac c425d896
...@@ -80,6 +80,11 @@ let orderApiFun = function(vm){ ...@@ -80,6 +80,11 @@ let orderApiFun = function(vm){
*/ */
let openTimerange = async (params = {}) => await vm.$u.get(prefix + vm.vuex_token + '/wokerOrder/appointment/timerange', params); let openTimerange = async (params = {}) => await vm.$u.get(prefix + vm.vuex_token + '/wokerOrder/appointment/timerange', params);
/**
* 联系时间接口
*/
let contactTime = async (params = {},orderId) => await vm.$u.get('/wxh-worker-rest/rest/order/record/'+ vm.vuex_token+'/contact/'+orderId, params);
const orderApi = { const orderApi = {
listByRecommendOrder, listByRecommendOrder,
listOrderCount, listOrderCount,
...@@ -99,6 +104,7 @@ let orderApiFun = function(vm){ ...@@ -99,6 +104,7 @@ let orderApiFun = function(vm){
saveImage, saveImage,
getWatermark, getWatermark,
openTimerange, openTimerange,
contactTime,
} }
return orderApi return orderApi
} }
......
...@@ -7,9 +7,11 @@ ...@@ -7,9 +7,11 @@
<text>{{title}}</text> <text>{{title}}</text>
</view> </view>
<view class="line-view" /> <view class="line-view" />
<view v-if="count" class="order-content"> <view class="order-content">
<view v-if="count">
你本月还有<text class="order-content-count">{{count}}</text>次拒单机会 你本月还有<text class="order-content-count">{{count}}</text>次拒单机会
</view> </view>
</view>
<view class="order-pop-text"> <view class="order-pop-text">
<text>{{message}}</text> <text>{{message}}</text>
</view> </view>
...@@ -94,6 +96,7 @@ ...@@ -94,6 +96,7 @@
} }
.order-content { .order-content {
min-height: 14rpx;
text-align: center; text-align: center;
color: #333333; color: #333333;
font-size: 32rpx; font-size: 32rpx;
......
...@@ -369,6 +369,11 @@ ...@@ -369,6 +369,11 @@
"name": "订单 - 拒单", //模式名称 "name": "订单 - 拒单", //模式名称
"path": "pages/order/refuse", //启动页面,必选 "path": "pages/order/refuse", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到 "query": "" //启动参数,在页面的onLoad函数里面得到
},
{
"name": "订单 - 过程反馈", //模式名称
"path": "pages/order/feedback", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
} }
] ]
} }
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<text>客户信息:</text> <text>客户信息:</text>
<text>{{ order.contactName }}</text> <text>{{ order.contactName }}</text>
</view> </view>
<u-image width="60rpx" height="60rpx" :src="phoneIcon"></u-image> <u-image width="60rpx" height="60rpx" :src="phoneIcon" @click="phoneToCustomer(order.contactPhone)" ></u-image>
</view> </view>
<view class="order-cell"> <view class="order-cell">
<text>联系方式:</text> <text>联系方式:</text>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<u-icon name="map" size="28"></u-icon> <u-icon name="map" size="28"></u-icon>
<text class="address-txt">{{ order.contactAddress }}</text> <text class="address-txt">{{ order.contactAddress }}</text>
</view> </view>
<u-image width="60rpx" height="60rpx" :src="navigationIcon"></u-image> <u-image width="60rpx" height="60rpx" :src="navigationIcon" @click="openLocation"></u-image>
</view> </view>
</view> </view>
<view class="card order-item"> <view class="card order-item">
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
<!-- 过程反馈 --> <!-- 过程反馈 -->
<view class="left"> <view class="left">
<view v-show="allowFeedback" @click="clickFeedback" class="button"> <view v-show="allowFeedback" @click="clickFeedback" class="button">
过程反馈 <text>过程反馈</text>
</view> </view>
</view> </view>
<!--接单,抢单,已被抢, 预约 ,签到 ,去完工 timestampDiff(order.currentOverTime)>0 --> <!--接单,抢单,已被抢, 预约 ,签到 ,去完工 timestampDiff(order.currentOverTime)>0 -->
...@@ -153,7 +153,10 @@ ...@@ -153,7 +153,10 @@
btnClass:'appoint-btn', btnClass:'appoint-btn',
takeStatus:false, takeStatus:false,
errorSignIn:false, errorSignIn:false,
scenePhoto: true scenePhoto: true,
isErrorSign:false,
errorSignUrl:'',
isAllowDianhuaAndDaohang : false
} }
}, },
onLoad(option) { onLoad(option) {
...@@ -170,10 +173,22 @@ ...@@ -170,10 +173,22 @@
}, },
computed: { computed: {
phoneIcon() { phoneIcon() {
return process.uniEnv.qn_base_url + 'icon/dianhua-1@2x.png' //self-support/icon/dianhua-0@2x.png
if(this.isAllowDianhuaAndDaohang){
return process.uniEnv.qn_base_url + 'icon/dianhua-1@2x.png'
}else{
return process.uniEnv.qn_base_url + 'icon/dianhua-0@2x.png'
}
}, },
navigationIcon() { navigationIcon() {
return process.uniEnv.qn_base_url + 'icon/daohang-1@2x.png' //self-support/icon/daohang-0@2x.png
if(this.isAllowDianhuaAndDaohang){
return process.uniEnv.qn_base_url + 'icon/daohang-1@2x.png'
}else{
return process.uniEnv.qn_base_url + 'icon/daohang-0@2x.png'
}
}, },
centerButtonClass() { centerButtonClass() {
let btnClass = "appoint-btn" let btnClass = "appoint-btn"
...@@ -181,6 +196,45 @@ ...@@ -181,6 +196,45 @@
} }
}, },
methods: { methods: {
openLocation(){
if(this.isAllowDianhuaAndDaohang){
uni.getLocation({
type: 'gcj02', //返回可以用于uni.openLocation的经纬度
success: function (res) {
const latitude = res.latitude;
const longitude = res.longitude;
uni.openLocation({
latitude: latitude,
longitude: longitude,
success: function () {
console.log('success');
}
});
}
});
}
},
phoneToCustomer(phone){ // 联系客户
if(this.isAllowDianhuaAndDaohang){
uni.makePhoneCall({
phoneNumber: phone ,//仅为示例
complete() {
}
});
this.contactTime()
}
},
contactTime() {
let self = this
var data={}
self.$u.api.contactTime(data,this.order.orderId).then((res)=>{
if (res.code == 200) {
console.log("===", res.data)
} else {
console.log(res.message);
}
})
},
scenePhotoClick() { // 跳转拍照小程序 scenePhotoClick() { // 跳转拍照小程序
uni.navigateTo({ uni.navigateTo({
url: 'pages/photo/list?orderId='+this.order.orderId+'&brandId='+this.order.lianbaoBrandId+'&brand='+this.order.brandName url: 'pages/photo/list?orderId='+this.order.orderId+'&brandId='+this.order.lianbaoBrandId+'&brand='+this.order.brandName
...@@ -196,18 +250,13 @@ ...@@ -196,18 +250,13 @@
this.takeStatus = false this.takeStatus = false
// 获取返回的图片 ,如果返回的图片存在则直接异常签约,成功后跳转到去完工页面, // 获取返回的图片 ,如果返回的图片存在则直接异常签约,成功后跳转到去完工页面,
if(img){ // 拍照完成 if(img){ // 拍照完成
this.$refs.uToast.show({ this.isErrorSign = true
title: '签到成功', this.errorSignUrl = img
type: 'success', this.handleBtn()
url: 'pages/order/detail',
params: {
id: 1
}
})
}else{ }else{
this.$refs.uToast.show({ this.$refs.uToast.show({
title: '异常签到失败,请先按要求拍照', title: '异常签到失败,请先按要求拍照',
type: 'waning' type: 'warning'
}) })
} }
}, },
...@@ -222,14 +271,8 @@ ...@@ -222,14 +271,8 @@
console.log("===", res.data) console.log("===", res.data)
self.order = res.data self.order = res.data
this.getCurrentBtn() this.getCurrentBtn()
this.visibale = true if(self.order.isFirstOrder){
// self.order.operationType = "accept" }
// }else{
// self.order.operationType = "appointment"
// }
// self.method =self.operationDoing[self.order.operationType].action;
// // 根据工单的状态确定是否需要过程反馈
// self.allowFeedback = self.allowFeedbackStatus.indexOf(self.order.orderStatus)>0
} else { } else {
console.log(res.message, "获取订单详情失败!"); console.log(res.message, "获取订单详情失败!");
} }
...@@ -238,7 +281,7 @@ ...@@ -238,7 +281,7 @@
loadOrderRecord() { loadOrderRecord() {
let self = this let self = this
var param = { var param = {
'orderId': self.orderId orderId: self.orderId
}; };
self.$u.api.listOrderRecord(param).then((res) => { self.$u.api.listOrderRecord(param).then((res) => {
if (res.code == 200) { if (res.code == 200) {
...@@ -248,9 +291,6 @@ ...@@ -248,9 +291,6 @@
} }
}) })
}, },
rejectOrder() { // 拒单
console.log("点击拒单")
},
/** /**
* 点击下一周 * 点击下一周
* @param {Object} data * @param {Object} data
...@@ -297,6 +337,7 @@ ...@@ -297,6 +337,7 @@
this.allowFeedback = true this.allowFeedback = true
this.showCenterBtn = true this.showCenterBtn = true
this.showTimeSelect = true this.showTimeSelect = true
this.isAllowDianhuaAndDaohang = true
this.submitType = "workerAppointment" this.submitType = "workerAppointment"
} else if (orderStatus === 31 && this.order.appointmentDatetime) { } else if (orderStatus === 31 && this.order.appointmentDatetime) {
// 签到 // 签到
...@@ -310,36 +351,44 @@ ...@@ -310,36 +351,44 @@
// 完工 // 完工
this.centerButton = "filish" this.centerButton = "filish"
this.centerButtonText = "去完工" this.centerButtonText = "去完工"
this.submitType = "toFilish"
this.allowFeedback = true this.allowFeedback = true
this.showCenterBtn = true this.showCenterBtn = true
this.scenePhoto = true this.scenePhoto = true
} else {} } else {}
}, },
handleBtn() { handleBtn() {
if(this.centerButton === "filish"){
this.filish()
return
}
if(!this.submitType){ if(!this.submitType){
return; return;
} }
const data = {} const data = {}
// 不同请求类型传递不同数据 // 不同请求类型传递不同数据
if (this.submitType === 'maintainWorkerCheckin') { // 签到 if(this.submitType === 'orderAccept'){ // 接单
// 检查见到距离是否符合
if(this.getDistance(this.order.contactAddressLatitud,this.order.contactAddressLongitud)>3){
this.$refs.uToast.show({
title: '签到失败,请点击异常签到处理或联系客服',
type: 'error'
})
return
}
data.remark = "123"
data.revert = true
}else if(this.submitType === 'orderAccept'){ // 接单
data.orderId = this.order.orderId data.orderId = this.order.orderId
}else if(this.submitType === 'orderGan'){ // 抢单 }else if(this.submitType === 'orderGan'){ // 抢单
data.orderId = this.order.orderId data.orderId = this.order.orderId
}else if(this.submitType === 'workerAppointment'){ // 预约
data.appointmentDatetime = ''
data.appointmentDatetimeRange = ''
if(!data.appointmentDatetime || !data.appointmentDatetimeRange ){
this.commonToast('请选择预约时间和时间段','waring')
return
}
}else if (this.submitType === 'maintainWorkerCheckin') { // 签到
// 检查见到距离是否符合
if(!this.isErrorSign){
if(this.getDistance(this.order.contactAddressLatitud,this.order.contactAddressLongitud)>3){
this.commonToast('签到失败,请点击异常签到处理或联系客服','error')
return
}
}
data.exception = this.isErrorSign
data.coordinate = this.dataValue ? this.dataValue[0]+','+this.dataValue[1]:''
data.url = this.errorSignUrl?this.errorSignUrl:''
}else if(this.submitType === 'toFilish'){ // 去完工
this.filish()
return
} }
this.$u.api[this.submitType](data, this.order.orderId).then(res => { this.$u.api[this.submitType](data, this.order.orderId).then(res => {
if ((res.data.code!==undefined && res.data.code === 200) if ((res.data.code!==undefined && res.data.code === 200)
...@@ -349,8 +398,7 @@ ...@@ -349,8 +398,7 @@
type: 'success', type: 'success',
url: 'pages/order/detail', url: 'pages/order/detail',
params: { params: {
id: 1, id: this.order.orderId
menu: 2
} }
}) })
} else { } else {
...@@ -363,6 +411,14 @@ ...@@ -363,6 +411,14 @@
} }
}) })
}, },
commonToast(message,type,url,params){ // 统一得toast
this.$refs.uToast.show({
title: message,
type: type,
url: url,
params:params
})
},
isGan(){ isGan(){
this.centerButtonText = "已被抢" this.centerButtonText = "已被抢"
this.submitType = "" this.submitType = ""
...@@ -380,6 +436,11 @@ ...@@ -380,6 +436,11 @@
url: 'pages/order/complete?orderId='+this.order.orderId url: 'pages/order/complete?orderId='+this.order.orderId
}) })
}, },
rejectOrder() { // 拒单
uni.navigateTo({
url: 'pages/order/refuse?orderId='+this.order.orderId
})
},
/** /**
* 获取当前位置的经纬度 * 获取当前位置的经纬度
*/ */
...@@ -441,13 +502,14 @@ ...@@ -441,13 +502,14 @@
this.btnClass='timeOut-btn' this.btnClass='timeOut-btn'
self.$refs['uCountDown'].seconds += 2 self.$refs['uCountDown'].seconds += 2
} }
},handleClick(){ },
handleClick(){
this.visibale = false this.visibale = false
// 去完工 // 去完工
uni.navigateTo({ uni.navigateTo({
url: 'pages/photo/list' url: 'pages/photo/list'
}) })
} }
} }
}; };
</script> </script>
......
...@@ -257,7 +257,7 @@ ...@@ -257,7 +257,7 @@
height: 100vh; height: 100vh;
overflow: auto; overflow: auto;
background-color: #F4F5F7; background-color: #F4F5F7;
background-image: linear-gradient(to top, #F4F5F7 0%, #2272FF 100%); background-image: linear-gradient(to top, #F4F5F7 0%, #2272FF 50%);
background-size: 750rpx 600rpx; background-size: 750rpx 600rpx;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
......
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
</view> </view>
</view> </view>
<view class="bottm-btn-view"> <view class="bottom-btn-view">
<button :loading="submiting" :disabled="disabledSubmit" class="btn" @click="handleClickSubmit">确定</button> <button :loading="submiting" :disabled="disabledSubmit" class="btn bottom-btn" @click="handleClickSubmit"><text class="button-text">提交</text></button>
</view> </view>
<PopView title="拒单提示" message="确定“拒单”操作,将影响对您的派单频率,\n甚至进入黑名单,请谨慎操作" <PopView title="拒单提示" message="确定“拒单”操作,将影响对您的派单频率,\n甚至进入黑名单,请谨慎操作"
:visible.sync="visibale" :count="count" @click="handleClick" buttonText="确定"/> :visible.sync="visibale" :count="count" @click="handleClick" buttonText="确定"/>
...@@ -76,10 +76,9 @@ ...@@ -76,10 +76,9 @@
if (this.count > 0) { if (this.count > 0) {
this.visibale = true this.visibale = true
} else { } else {
let message = '本月无拒单机会,请联系客服'
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: message, title: '本月无拒单机会,请联系客服',
}) })
} }
}, },
...@@ -218,10 +217,21 @@ ...@@ -218,10 +217,21 @@
margin-right: 10rpx; margin-right: 10rpx;
color:#FA5A49 color:#FA5A49
} }
.bottm-btn-view { .bottom-btn-view {
width: 100%; width: 100%;
padding: 0 80rpx; padding: 0 80rpx;
position: absolute; position: absolute;
bottom: 40rpx; bottom: 40rpx;
.bottom-btn {
height: 104rpx;
display: flex;
align-items: center;
justify-content: center;
.button-text {
font-size: 32rpx;
font-weight: bold;
}
}
} }
</style> </style>
...@@ -470,7 +470,7 @@ ...@@ -470,7 +470,7 @@
} }
.item { .item {
display: flex; display: flex;
padding: 28rpx 30rpx; padding: 28rpx 0rpx;
width: 100%; width: 100%;
font-size: 32rpx; font-size: 32rpx;
color: #333; color: #333;
......
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