diff --git a/api/order.js b/api/order.js index 70ec1f4..d3c01f7 100644 --- a/api/order.js +++ b/api/order.js @@ -107,6 +107,20 @@ export function orderDone(id,images){ } }) } +/** + * 订单服务详情 + * @param id + * @returns {Promise} + */ +export function orderServiceInfo(id){ + return request({ + url:"order/getServiceDate", + method: 'get', + data:{ + order_service_id:id, + } + }) +} /** * 开始服务 */ @@ -116,4 +130,14 @@ export function orderStart(data){ method: 'post', data:data }) +} +/** + * 开始服务 + */ +export function orderEnd(data){ + return request({ + url:"order/end-service", + method: 'post', + data:data + }) } \ No newline at end of file diff --git a/pages/OrderConfirm/end.vue b/pages/OrderConfirm/end.vue index 20c51f9..5ccace1 100644 --- a/pages/OrderConfirm/end.vue +++ b/pages/OrderConfirm/end.vue @@ -19,39 +19,36 @@ :rules="rules" ref="feedForm" > - - - + + - - - - - - - - + + + + + @delete="(res) => {uploadDel(res,'appliance')}" + @afterRead="(res) => {uploadPut(res,'appliance')}" + > - - - - - + + + + + @delete="(res) => {uploadDel(res,'before_status')}" + @afterRead="(res) => {uploadPut(res,'before_status')}" + > - + @delete="(res) => {uploadDel(res,'pet_status')}" + @afterRead="(res) => {uploadPut(res,'pet_status')}" + > - - - - - + + + + + - - - - - - + + + + + + @delete="(res) => {uploadDel(res,'food_status')}" + @afterRead="(res) => {uploadPut(res,'food_status')}" + > - - + - - - - - + @delete="(res) => {uploadDel(res,'sick')}" + @afterRead="(res) => {uploadPut(res,'sick')}" + > - - + - - - - - - + @delete="(res) => {uploadDel(res,'excrement')}" + @afterRead="(res) => {uploadPut(res,'excrement')}" + > - + @delete="(res) => {uploadDel(res,'other')}" + @afterRead="(res) => {uploadPut(res,'other')}" + > - + - + - + @delete="(res) => {uploadDel(res,'food_bowl')}" + @afterRead="(res) => {uploadPut(res,'food_bowl')}" + > - + - + @delete="(res) => {uploadDel(res,'basin')}" + @afterRead="(res) => {uploadPut(res,'basin')}" + > - - + - - - + @delete="(res) => {uploadDel(res,'staple_food')}" + @afterRead="(res) => {uploadPut(res,'staple_food')}" + > - - + - - - + - - - - + @delete="(res) => {uploadDel(res,'water')}" + @afterRead="(res) => {uploadPut(res,'water')}" + > - - + - - - - - - - - - + @delete="(res) => {uploadDel(res,'snacks')}" + @afterRead="(res) => {uploadPut(res,'snacks')}" + > - - + - - - + @delete="(res) => {uploadDel(res,'wowo')}" + @afterRead="(res) => {uploadPut(res,'wowo')}" + > - - + - - - + @delete="(res) => {uploadDel(res,'cage')}" + @afterRead="(res) => {uploadPut(res,'cage')}" + > - - + - - - + @delete="(res) => {uploadDel(res,'hair')}" + @afterRead="(res) => {uploadPut(res,'hair')}" + > - - + - - - + @delete="(res) => {uploadDel(res,'pet_sick')}" + @afterRead="(res) => {uploadPut(res,'pet_sick')}" + > - - + - - - + @delete="(res) => {uploadDel(res,'pet_excrement')}" + @afterRead="(res) => {uploadPut(res,'pet_excrement')}" + > - - + - - - - - - + @delete="(res) => {uploadDel(res,'cat_litter')}" + @afterRead="(res) => {uploadPut(res,'cat_litter')}" + > - + @delete="(res) => {uploadDel(res,'other_info')}" + @afterRead="(res) => {uploadPut(res,'other_info')}" + > - + - - + - - - - - - - - - - + @delete="(res) => {uploadDel(res,'foundation')}" + @afterRead="(res) => {uploadPut(res,'foundation')}" + > - - - - + + + + - + @delete="(res) => {uploadDel(res,'health_other')}" + @afterRead="(res) => {uploadPut(res,'health_other')}" + > - + - - + - - - - - + @delete="(res) => {uploadDel(res,'pet_clean')}" + @afterRead="(res) => {uploadPut(res,'pet_clean')}" + > - - + - - - - - - - + @delete="(res) => {uploadDel(res,'before_facial')}" + @afterRead="(res) => {uploadPut(res,'before_facial')}" + > - - + - - - - + @delete="(res) => {uploadDel(res,'pet_facial')}" + @afterRead="(res) => {uploadPut(res,'pet_facial')}" + > - - + - - - - - + @delete="(res) => {uploadDel(res,'end_facial')}" + @afterRead="(res) => {uploadPut(res,'end_facial')}" + > - + - - - - + + + + + + + + - - + - - - - - + - - - - - - - + - - + @delete="(res) => {uploadDel(res,'out_play')}" + @afterRead="(res) => {uploadPut(res,'out_play')}" + > - + - + @delete="(res) => {uploadDel(res,'trash')}" + @afterRead="(res) => {uploadPut(res,'trash')}" + > - - - - - + + + + + @delete="(res) => {uploadDel(res,'appliance_info')}" + @afterRead="(res) => {uploadPut(res,'appliance_info')}" + > - + @delete="(res) => {uploadDel(res,'pet_secure')}" + @afterRead="(res) => {uploadPut(res,'pet_secure')}" + > - - - - - + + + + + + + + + + + + + + + + + @delete="(res) => {uploadDel(res,'close')}" + @afterRead="(res) => {uploadPut(res,'close')}" + > - - - - - + + + + + @delete="(res) => {uploadDel(res,'key')}" + @afterRead="(res) => {uploadPut(res,'key')}" + > - + @@ -1304,7 +1387,7 @@ import { import api from '@/utils/functions.js'; import HeaderNav from "@/components/HeaderNav/Index.vue"; import MzButton from "@/components/MzButton/Index.vue"; -import {orderDone} from "@/api/order"; +import {orderDone, orderEnd} from "@/api/order"; export default { components: { @@ -1323,11 +1406,80 @@ export default { isTop: false, fileList: [], model: { - connect: '', - remark: '', - file: [], + order_service_id:'', + appliance:{option:'',remark:'',upload:[]}, + before_status:{option:'',remark:'',upload:[]}, + pet_status:{option:'',remark:'',upload:[]}, + food_status:{food_option:'',water_option:'',remark:'',upload:[]}, + sick:{option:'',remark:'',upload:[]}, + excrement:{option:'',remark:'',upload:[]}, + other :{option:'',remark:'',upload:[]}, + food_bowl :{option:'',remark:'',upload:[]}, + basin :{option:'',remark:'',upload:[]}, + staple_food :{option:'',type_option:'',remark:'',upload:[]}, + water :{option:'',remark:'',upload:[]}, + snacks :{option:'',remark:'',upload:[]}, + wowo :{option:'',remark:'',upload:[]}, + cage :{option:'',remark:'',upload:[]}, + hair :{option:'',remark:'',upload:[]}, + pet_sick :{option:'',remark:'',upload:[]}, + pet_excrement :{option:'',remark:'',upload:[]}, + cat_litter :{option:'',remark:'',upload:[]}, + other_info :{option:'',remark:'',upload:[]}, + foundation :{option:'',remark:'',upload:[]}, + health :{option:'',remark:'',upload:[]}, + health_other :{option:'',remark:'',upload:[]}, + pet_clean :{option:'',remark:'',upload:[]}, + before_facial :{option:'',remark:'',upload:[]}, + pet_facial :{option:'',remark:'',upload:[]}, + end_facial :{option:'',remark:'',upload:[]}, + home_play :{option:'',remark:'',upload:[]}, + out_play :{option:'',number_option:'',feces_option:'',in_home_option:'',remark:'',upload:[]}, + trash :{option:'',remark:'',upload:[]}, + appliance_info :{option:'',remark:'',upload:[]}, + pet_secure :{option:'',remark:'',upload:[]}, + close :{option:'',remark:'',upload:[]}, + close_mima :{option:'',remark:'',upload:[]}, + key :{option:'',remark:'',upload:[]}, + leave :'', goOutTime: '' }, + images: { + appliance: [], + before_status: [], + pet_status: [], + food_status: [], + sick: [], + excrement: [], + other: [], + food_bowl: [], + basin: [], + staple_food: [], + water: [], + snacks: [], + wowo: [], + cage: [], + hair: [], + pet_sick: [], + pet_excrement: [], + cat_litter: [], + other_info: [], + foundation: [], + health: [], + health_other: [], + pet_clean: [], + before_facial: [], + pet_facial: [], + end_facial: [], + home_play: [], + out_play: [], + trash: [], + appliance_info: [], + pet_secure: [], + close: [], + close_mima: [], + key: [], + }, rules: { 'connect': { type: 'string', @@ -1345,7 +1497,7 @@ export default { } }, onLoad(option) { - this.id = option.id; + this.model.order_service_id = option.id; // this.model.goOutTime = uni.$u.timeFormat(null,'yyyy年mm月dd日 hh时MM分'); }, computed: { @@ -1354,30 +1506,111 @@ export default { }, }, methods: { - submit() { - let file = []; - this.fileList.forEach(item => { - file.push(item.url) + timeConfirm(e){ + this.model.leave = uni.$u.timeFormat(e.value,'yyyy-mm-dd hh:MM'); + }, + uploadSubmit(data,fileName = ''){ + this.model[fileName].upload = data.map(item => { + return {url:item.url,type:item.type}; + }) + }, + uploadShow(data,fileName = ''){ + let result = []; + try{ + data.forEach(item => { + result.push({url:item.url}) + }) + }catch (e){ + this.images[fileName] = []; + } + this.images[fileName] = result; + }, + uploadPut(event,fileName = ''){ + let lists = [].concat(event.file); + let fileListLen = this.images[fileName].length; + lists.map((item) => { + this.images[fileName].push({ + ...item, + status: 'uploading', + message: '上传中', + }); }); - this.model.file = file; - // this.$refs.feedForm.validate().then(res => { - orderDone(this.id, this.model.file).then((res) => { - if (res.code === 200) { - - - this.model = { - connect: '', - remark: '', - file: [] + for (let i = 0; i < lists.length; i++) { + const fileType = api.getFileType(lists[i].url); + console.log(fileType) + api.uploadOssFile(lists[i].url).then(res => { + let item = this.images[fileName][fileListLen]; + this.images[fileName].splice(fileListLen, 1, { + ...item, + status: 'success', + message: '', + url: res.show_path, + thumb: res.show_path, + type:fileType + }); + fileListLen++; + }) + } + }, + uploadDel(fileIndex,fileName = ''){ + this.images[fileName].splice(fileIndex.index,1); + }, + submit() { + let that = this; + let data = [ + 'appliance', + 'before_status', + 'pet_status', + 'food_status', + 'sick', + 'excrement', + 'other', + 'food_bowl', + 'basin', + 'staple_food', + 'water', + 'snacks', + 'wowo', + 'cage', + 'hair', + 'pet_sick', + 'pet_excrement', + 'cat_litter', + 'other_info', + 'foundation', + 'health', + 'health_other', + 'pet_clean', + 'before_facial', + 'pet_facial', + 'end_facial', + 'home_play', + 'out_play', + 'trash', + 'appliance_info', + 'pet_secure', + 'close', + 'close_mima', + 'key', + ]; + new Promise((resolve,reject)=>{ + data.forEach((item,index) => { + that.uploadSubmit(this.images[item],item); + if(index === data.length-1){ + resolve() } - this.fileList = []; - api.success('保存成功').then(() => { - uni.navigateBack(); - }) - } else { - uni.$u.toast(res.msg) - } - }) + }); + }).then(() => { + orderEnd(this.model).then((res) => { + if (res.code === 200) { + api.success('保存成功').then(() => { + // uni.navigateBack(); + }) + } else { + uni.$u.toast(res.msg) + } + }) + }); // }).catch(errors => { // uni.$u.toast(errors[0].message) // }) diff --git a/pages/OrderDetail/index.vue b/pages/OrderDetail/index.vue index 6b389ed..eb9c8d6 100644 --- a/pages/OrderDetail/index.vue +++ b/pages/OrderDetail/index.vue @@ -184,6 +184,935 @@ + + + + + + + + + + + + + 门窗、灯、空调、水电等情况: + + + + {{getString(service.end.appliance.option)}} + + + {{service.end.appliance.remark}} + + + + + + + + + + + + + + + + + + + 入户前萌宠家居情况: + + + {{service.end.before_status}} + + {{getString(service.end.before_status.option)}} + + + {{service.end.before_status.remark}} + + + + + + + + + + + + + + + + + + + 萌宠生活区情况: + + + {{service.end.pet_status}} + + {{getString(service.end.pet_status.option)}} + + + {{service.end.pet_status.remark}} + + + + + + + + + + + + + + + + + + + 萌宠粮剩余情况: + + + {{service.end.food_status}} + + {{getString(service.end.food_status.option)}} + + + {{service.end.food_status.remark}} + + + + + + + + + + + + + + + + + + + 是否有萌宠呕吐物: + + + {{service.end.sick}} + + {{getString(service.end.sick.option)}} + + + {{service.end.sick.remark}} + + + + + + + + + + + + + + + + + + + 萌宠排泄物情况: + + + {{service.end.excrement}} + + {{getString(service.end.excrement.option)}} + + + {{service.end.excrement.remark}} + + + + + + + + + + + + + + + + + + + 其他情况反馈: + + + {{service.end.other}} + + {{getString(service.end.other.option)}} + + + {{service.end.other.remark}} + + + + + + + + + + + + + + + + + + + 食盆清洗并擦干水渍: + + + {{service.end.food_bowl}} + + {{getString(service.end.food_bowl.option)}} + + + {{service.end.food_bowl.remark}} + + + + + + + + + + + + + + + + + + + 水盆清理: + + + {{service.end.basin}} + + {{getString(service.end.basin.option)}} + + + {{service.end.basin.remark}} + + + + + + + + + + + + + + + + + + + 萌宠主食: + + + {{service.end.staple_food}} + + {{getString(service.end.staple_food.option)}} + + + {{service.end.staple_food.remark}} + + + + + + + + + + + + + + + + + + + 萌宠饮用水: + + + {{service.end.water}} + + {{getString(service.end.water.option)}} + + + {{service.end.water.remark}} + + + + + + + + + + + + + + + + + + + 零食、药品及其他: + + + {{service.end.snacks}} + + {{getString(service.end.snacks.option)}} + + + {{service.end.snacks.remark}} + + + + + + + + + + + + + + + + + + + 窝窝整理: + + + {{service.end.wowo}} + + {{getString(service.end.wowo.option)}} + + + {{service.end.wowo.remark}} + + + + + + + + + + + + + + + + + + + 笼笼清理: + + + {{service.end.cage}} + + {{getString(service.end.cage.option)}} + + + {{service.end.cage.remark}} + + + + + + + + + + + + + + + + + + + 周边毛发: + + + {{service.end.hair}} + + {{getString(service.end.hair.option)}} + + + {{service.end.hair.remark}} + + + + + + + + + + + + + + + + + + + 屋内排泄物清理: + + + {{service.end.pet_sick}} + + {{getString(service.end.pet_sick.option)}} + + + {{service.end.pet_sick.remark}} + + + + + + + + + + + + + + + + + + + 屋内呕吐物清理: + + + {{service.end.pet_excrement}} + + {{getString(service.end.pet_excrement.option)}} + + + {{service.end.pet_excrement.remark}} + + + + + + + + + + + + + + + + + + + 猫砂盆整理及猫砂更换: + + + {{service.end.cat_litter}} + + {{getString(service.end.cat_litter.option)}} + + + {{service.end.cat_litter.remark}} + + + + + + + + + + + + + + + + + + + 其他需求反馈: + + + {{service.end.other_info}} + + {{getString(service.end.other_info.option)}} + + + {{service.end.other_info.remark}} + + + + + + + + + + + + + + + + + + + 基础检查: + + + {{service.end.foundation}} + + {{getString(service.end.foundation.option)}} + + + {{service.end.foundation.remark}} + + + + + + + + + + + + + + + + + + + 健康情况: + + + {{service.end.health}} + + {{getString(service.end.health.option)}} + + + {{service.end.health.remark}} + + + + + + + + + + + + + + + + + + + 其他: + + + {{service.end.health_other}} + + {{getString(service.end.health_other.option)}} + + + {{service.end.health_other.remark}} + + + + + + + + + + + + + + + + + + + 萌宠清洁: + + + {{service.end.pet_clean}} + + {{getString(service.end.pet_clean.option)}} + + + {{service.end.pet_clean.remark}} + + + + + + + + + + + + + + + + + + + 洗护前原始状态: + + + {{service.end.before_facial}} + + {{getString(service.end.before_facial.option)}} + + + {{service.end.before_facial.remark}} + + + + + + + + + + + + + + + + + + + 使用产品: + + + {{service.end.pet_facial}} + + {{getString(service.end.pet_facial.option)}} + + + {{service.end.pet_facial.remark}} + + + + + + + + + + + + + + + + + + + 洗护后状态: + + + {{service.end.end_facial}} + + {{getString(service.end.end_facial.option)}} + + + {{service.end.end_facial.remark}} + + + + + + + + + + + + + + + + + + + 在家互动: + + + {{service.end.home_play}} + + {{getString(service.end.home_play.option)}} + + + {{service.end.home_play.remark}} + + + + + + + + + + + + + + + + + + + 外出遛弯: + + + {{service.end.out_play}} + + {{getString(service.end.out_play.option)}} + + + {{service.end.out_play.remark}} + + + + + + + + + + + + + + + + + + + 垃圾携带: + + + {{service.end.trash}} + + {{getString(service.end.trash.option)}} + + + {{service.end.trash.remark}} + + + + + + + + + + + + + + + + + + + 门窗、灯、空调、水电等状态: + + + {{service.end.appliance_info}} + + {{getString(service.end.appliance_info.option)}} + + + {{service.end.appliance_info.remark}} + + + + + + + + + + + + + + + + + + + 离开时萌宠安全确认: + + + {{service.end.pet_secure}} + + {{getString(service.end.pet_secure.option)}} + + + {{service.end.pet_secure.remark}} + + + + + + + + + + + + + + + + + + + 普通锁: + + + {{service.end.close}} + + {{getString(service.end.close.option)}} + + + {{service.end.close.remark}} + + + + + + + + + + + + + + + + + + + 密码锁: + + + {{service.end.close_mima}} + + {{getString(service.end.close_mima.option)}} + + + {{service.end.close_mima.remark}} + + + + + + + + + + + + + + + + + + + 房门钥匙: + + + {{service.end.key}} + + {{getString(service.end.key.option)}} + + + {{service.end.key.remark}} + + + + + + + + + + + + + + + + + + @@ -199,7 +1128,7 @@ import {delPet, getDetail} from "@/api/pet"; import log from "@/utils/log"; import functions from "@/utils/functions.js"; - import {orderDetail} from "@/api/order"; + import {orderDetail, orderServiceInfo} from "@/api/order"; export default { components: { HeaderNav, @@ -256,6 +1185,10 @@ }, ], detail:{}, + service:{ + start:{}, + end:{}, + }, id:0, } }, @@ -263,6 +1196,7 @@ log(option); this.id = option.id; this.getDetail(option.id); + this.getOrderServiceInfo(option.id); }, onShareAppMessage() { return { @@ -271,6 +1205,19 @@ } }, methods: { + getString(value){ + let typeStr = typeof value; + if(typeStr === 'string'){ + return value; + }else{ + console.log(typeStr) + // if(value.length > 0){ + // return value.join(','); + // }else{ + // return ''; + // } + } + }, delPet(){ functions.confirm("确认删除该宠物吗?").then(() => { delPet(this.id).then((res) => { @@ -288,6 +1235,12 @@ this.detail = data.data; log(data); }) + }, + getOrderServiceInfo(id){ + orderServiceInfo(id).then(data => { + this.service.start = data.data.startservice; + this.service.end = data.data.endservice; + }) } }, onPageScroll(res) {