feat: 预约上门时间
This commit is contained in:
parent
cdd2f1211f
commit
f1320b0221
|
|
@ -61,6 +61,12 @@ class Api {
|
|||
let url = `${config.host}/worker/order_dispatch/info`;
|
||||
return fetch.request('GET', url, data, true)
|
||||
}
|
||||
|
||||
// 预约上门时间
|
||||
static appointmentTime(data) {
|
||||
let url = `${config.host}/worker/order_dispatch/appointmentTime`;
|
||||
return fetch.request('postFrom', url, data, true)
|
||||
}
|
||||
}
|
||||
|
||||
export default Api
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
<view class="item-row flex-sb line-after">
|
||||
<view class="title flex-l">预约上门时间</view>
|
||||
<view class="value flex-r">
|
||||
<text>{{data.order_info.plan_time}}</text>
|
||||
<text>{{data.plan_time}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-multi-line line-after">
|
||||
|
|
|
|||
|
|
@ -29,15 +29,36 @@ import MeIcon from "../../components/me-icon/me-icon.vue";
|
|||
import MeEmptySpace from "../../components/me-empty-space/me-empty-space.vue";
|
||||
import MeButton from "../../components/me-button/me-button.vue";
|
||||
import helpers from "../../utils/helpers";
|
||||
import {ref, reactive, computed, watch, inject} from 'vue'
|
||||
import {onLoad, onShow} from '@dcloudio/uni-app'
|
||||
import {ref} from 'vue'
|
||||
import {onLoad} from '@dcloudio/uni-app'
|
||||
import api from "../../api/api";
|
||||
import {throttle} from "../../utils/throttle";
|
||||
|
||||
const planTime = ref('')
|
||||
|
||||
const submit = () => {
|
||||
console.log(data.value)
|
||||
//预约上门时间
|
||||
const submit = throttle(() => {
|
||||
uni.showModal({
|
||||
title: '提示信息',
|
||||
confirmText: '确认',
|
||||
content: '确认已和客户约定上门时间?',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
uni.showLoading({
|
||||
title: '提交中'
|
||||
});
|
||||
api.appointmentTime({order_dispatch_id: id.value, plan_time: data.value.plan_time}).then(res => {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '预约成功',
|
||||
icon: "success"
|
||||
})
|
||||
setTimeout(() => {
|
||||
helpers.jumpToPage('order-info', `id=${id.value}`, 'redirectTo')
|
||||
}, 1000)
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
const id = ref(null)
|
||||
onLoad((params) => {
|
||||
|
|
@ -48,6 +69,10 @@ onLoad((params) => {
|
|||
const data = ref(null)
|
||||
const init = () => {
|
||||
api.orderInfo({order_dispatch_id: id.value}).then(res => {
|
||||
if (res.status !== 10) {
|
||||
return helpers.showToast('该订单已预约')
|
||||
}
|
||||
|
||||
data.value = res
|
||||
}).catch(() => {})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user