Commit 512f40a2 by zhangzhen

1111

parent 3ac6ccf4
......@@ -23,7 +23,7 @@ export const endClean=(data)=>{
export const openDoorByCleaner=(data)=>{
let url=`/room/open/door`
return http.post(url,data)
return http.get(url,data)
}
// 获取进行中的保洁订单
export const getStarOrder=()=>{
......
import http from "@/common/vmeitime-http/index.js"
import config from "@/config/index.config.js"
// 注册
export const register=(data)=>{
let url=`/wechat/register/binding/phone`
......@@ -41,3 +41,25 @@ export const dictList=()=>{
let url=`/dict/type/optionselect`
return http.get(url)
}
//上传文件
export const uploadFile=(data)=> {
console.log(data,"我要上传文件")
return new Promise((resolve, reject)=>{
let tokenHeaders = uni.getStorageSync("tokenHeaders");
uni.uploadFile({
url:`${config.baseUrl}/common/upload`,
filePath: data.url,
name: 'file',
header:{
[tokenHeaders]:uni.getStorageSync(tokenHeaders)
},
success: (res) => {
resolve(res)
},
fail: (err) => {
reject(err)
}
});
})
}
\ No newline at end of file
......@@ -3,16 +3,16 @@
<view class="card-box">
<form>
<view class="cu-form-group margin-top">
<view class="title">门店名称</view>
<text>{{orderInfo.storeName}}</text>
<view class="title">门店名称:</view>
<text class="text-bold">{{orderInfo.storeName}}</text>
</view>
<view class="cu-form-group">
<view class="title">门店地址</view>
<text>{{orderInfo.address}}</text>
<text>{{orderInfo.sStore.address}}</text>
</view>
<view class="cu-form-group">
<view class="title">房间名称</view>
<text>{{orderInfo.roomName}}</text>
<text class="text-bold">{{orderInfo.roomName}}</text>
</view>
<!-- <view class="cu-form-group">
......@@ -22,7 +22,7 @@
<view class="cu-form-group">
<view class="title">保洁状态</view>
<text>{{cleanStatusEnum[orderInfo.status]}}</text>
<text class="text-bold">{{cleanStatusEnum[orderInfo.status]}}</text>
</view>
<view class="cu-bar bg-white margin-top">
......@@ -72,6 +72,7 @@
<script>
import {getInfoById,openDoorByCleaner,startClean,endClean} from "@/api/cleanRoom.js";
import {getDictItem} from "@/utils/tools.js"
import {uploadFile} from "@/api/index.js"
export default {
data() {
......@@ -86,6 +87,9 @@
this.orderId = option.id;
this.onGetDicts()
},
onShow() {
this.imgList = []
},
methods:{
onGetDicts() {
let dicts = []
......@@ -98,6 +102,7 @@
dicts = res.data.data;
uni.setStorageSync('dicts', JSON.stringify(res.data.data))
this.cleanStatusEnum = getDictItem(dicts, "clean_records_status");
console.log(this.cleanStatusEnum,909090)
this.onLoading()
})
}
......@@ -116,11 +121,26 @@
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album'], //从相册选择
success: (res) => {
if (this.imgList.length != 0) {
this.imgList = this.imgList.concat(res.tempFilePaths)
} else {
this.imgList = res.tempFilePaths
console.log(res,"文件")
// if (this.imgList.length != 0) {
// this.imgList = this.imgList.concat(res.tempFilePaths)
// } else {
// this.imgList = res.tempFilePaths
// }
uni.showLoading({
title:'加载中...'
})
uploadFile({
url:res.tempFilePaths[0]
}).then(result=>{
uni.hideLoading()
if(result.data){
let data = JSON.parse(result.data);
this.imgList.push(data.url)
}
})
}
});
},
......@@ -132,10 +152,10 @@
},
DelImg(e) {
uni.showModal({
title: '召唤师',
content: '确定要删除这段回忆吗?',
cancelText: '再看看',
confirmText: '再见',
title: '提示',
content: '确定要删除吗?',
cancelText: '取消',
confirmText: '确定',
success: res => {
if (res.confirm) {
this.imgList.splice(e.currentTarget.dataset.index, 1)
......@@ -147,8 +167,16 @@
this.textareaBValue = e.detail.value
},
onOpenDoorByCleaner(){
openDoorByCleaner().then(res=>{
openDoorByCleaner({
roomId: this.orderInfo.roomId
}).then(res=>{
console.log()
if(res.data.code == 200){
uni.showToast({
icon:'success',
title:'开门成功'
})
}
})
}
}
......@@ -185,4 +213,7 @@
padding: 0 30upx 0 0;
}
}
.cu-form-group .title{
width: 240upx;
}
</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