feat: 【小程序】新增更新进度页面

This commit is contained in:
苟川东 2025-05-28 15:13:17 +08:00
parent a4d60955d8
commit e76819c020
5 changed files with 179 additions and 0 deletions

View File

@ -88,6 +88,13 @@
{
"navigationBarTitleText" : "隐私协议"
}
},
{
"path" : "pages/order/update-progress",
"style" :
{
"navigationBarTitleText" : "更新进度"
}
}
],
"globalStyle": {

View File

@ -182,6 +182,7 @@
<!-- 完成服务-->
<view class="bottom" v-if="data.status === enums.ORDER_DISPATCH_STATUS.STATUS_CLOCK">
<me-button @click="updateProgress()" active-color="var(--contentBgColor)" text="更新进度" width="686rpx" text-color="var(--titleColor)" custom-icon-color="var(--titleColor)"></me-button>
<me-button @click="completeService()" text="完成服务" width="686rpx" icon-type="icon-arrow-right-circle" margin-top="32rpx"></me-button>
</view>
</view>
@ -198,6 +199,10 @@ import {ref, computed} from 'vue'
import api from "../../api/api";
import enums from "../../utils/enums";
const updateProgress = () => {
helpers.jumpToPage('update-progress', 'id=' + id.value)
}
//
const canReportOrderException = computed(() => {
const excludedStatuses = [

View File

@ -0,0 +1,164 @@
<template>
<view class="ctr">
<view class="form-group">
<picker @change="bindPickerChange" :range="typeList">
<view class="item input flex-sb line-after">
<view class="title flex-l">进度</view>
<view class="select-ctr flex-r select">{{ submitData.is_finish_today == 1 ? '今日能完工' : '今日不能完工'}}</view>
</view>
</picker>
<view :class="[submitData.is_finish_today == 0 ? 'line-after' : '', 'item', 'time']">
<view class="item-row flex-sb">
<view class="title flex-l">完工时间</view>
<uni-datetime-picker v-model="submitData.finish_date" :start="Date.now()" type="datetime" :hide-second="true">
<view class="value flex-r value-empty" v-if="submitData.finish_date === null">点击选择完工时间</view>
<view class="value flex-r" v-else>{{ helpers.removeSeconds(submitData.finish_date) }}</view>
</uni-datetime-picker>
</view>
</view>
<view class="textarea" v-if="submitData.is_finish_today == 0">
<view class="title flex-l">当前施工进度</view>
<view class="value">
<textarea maxlength="200" :disable-default-padding="true" class="input-textarea" v-model="submitData.detail" placeholder-class="placeholder-class" placeholder="请简要描述当前的施工进度方便平台知晓服200字以内"/>
</view>
</view>
</view>
<me-empty-space height="376"></me-empty-space>
<view class="bottom">
<me-button @click="submit()" text="更 新" width="686rpx" icon-type="icon-arrow-up-line" margin-top="32rpx"></me-button>
</view>
</view>
</template>
<script setup>
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} from 'vue'
import {onLoad} from '@dcloudio/uni-app'
import api from "../../api/api";
import {throttle} from "../../utils/throttle";
const bindPickerChange = (e) => {
submitData.is_finish_today = e.detail.value
}
//
const submit = throttle(() => {
if (!validate()) {
return false
}
uni.showModal({
title: '提示信息',
confirmText: '确认',
content: '确认上报异常?',
success: function (res) {
if (res.confirm) {
uni.showLoading({
title: '提交中'
});
submitData.order_id = orderId.value
api.createOrderAbnormal(submitData).then(() => {
helpers.delayHideLoading()
uni.showModal({
title: '提示信息',
showCancel: false,
content: '异常已上报',
success: function (res) {
if (res.confirm) {
uni.navigateBack();
}
}
});
init()
}).catch(() => {})
}
}
});
})
const orderInfo = ref(null)
const init = () => {
// api.orderAbnormalInfo({order_id: orderId.value}).then(res => {
// if (res.id !== undefined) {
// orderInfo.value = res
// submitData.abnormal_id = orderInfo.value.abnormal_id
// submitData.detail = orderInfo.value.detail
// }
//
// helpers.delayHideLoading()
// }).catch(() => {})
}
const orderId = ref(null)
onLoad((params) => {
orderId.value = params.order_id
// uni.showLoading({
// title: ''
// })
init()
})
const typeList = ref([
"今日不能完工",
"今日能完工",
])
//
const submitData = reactive({
is_finish_today: 1,
finish_date: null,
detail: '',
})
//
const validate = () => {
if (submitData.abnormal_id === 0) {
helpers.showToast('请选择异常原因')
return false
}
if (submitData.detail === '') {
helpers.showToast('请输入异常详情')
return false
}
return true
}
</script>
<style lang="scss" scoped>
.ctr {
padding: 0 32rpx;
box-sizing: border-box;
height: 100vh;
.bottom {
width: 100%;
padding-top: 20rpx;
padding-bottom: 68rpx;
background: var(--pageBgColor);
box-sizing: border-box;
position: fixed;
bottom: 0;
}
}
</style>

View File

@ -39,6 +39,7 @@
}
}
.time {
position: relative;
.item-row {
width: 100%;
height: 100rpx;

View File

@ -33,6 +33,8 @@ class helpers {
'user-agreement': '/pages/user/user-agreement',
//隐私政策
'privacy-policy': '/pages/user/privacy-policy',
//更新进度
'update-progress': '/pages/order/update-progress',
}
url = paths[pathName]