Commit 512f40a2 by zhangzhen

1111

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