Commit 044767d9 by zhangzhen

细节完善

parent 512f40a2
const CONFIG = { const CONFIG = {
// 开发环境配置 // 开发环境配置
development: { development: {
assetsPath: 'https://coujiao.pseer.com/wechat_static', // 静态资源路径 assetsPath: 'https://www.coujio.com/wechat_static', // 静态资源路径
baseUrl: 'https://coujiao.pseer.com/front-api', // 后台接口请求地址 baseUrl: 'https://www.coujio.com/front-api', // 后台接口请求地址
hostUrl: 'https://coujiao.pseer.com/prod-api', // H5地址(前端运行地址) hostUrl: 'https://www.coujio.com/prod-api', // H5地址(前端运行地址)
// baseUrl: 'http://192.168.1.189:8883/front', // 后台接口请求地址 // baseUrl: 'http://192.168.1.189:8883/front', // 后台接口请求地址
// hostUrl: 'http://192.168.1.189:8882', // H5地址(前端运行地址) // hostUrl: 'http://192.168.1.189:8882', // H5地址(前端运行地址)
websocketUrl: '', // websocket服务端地址 websocketUrl: '', // websocket服务端地址
...@@ -13,9 +13,9 @@ const CONFIG = { ...@@ -13,9 +13,9 @@ const CONFIG = {
}, },
// 生产环境配置 // 生产环境配置
production: { production: {
assetsPath: 'https://coujiao.pseer.com/wechat_static', // 静态资源路径 assetsPath: 'https://www.coujio.com/wechat_static', // 静态资源路径
baseUrl: 'https://coujiao.pseer.com/front-api', // 后台接口请求地址 baseUrl: 'https://www.coujio.com/front-api', // 后台接口请求地址
hostUrl: 'https://coujiao.pseer.com/prod-api', // H5地址(前端运行地址) hostUrl: 'https://www.coujio.com/prod-api', // H5地址(前端运行地址)
websocketUrl: '', // websocket服务端地址 websocketUrl: '', // websocket服务端地址
weixinAppId: '', // 微信公众号appid weixinAppId: '', // 微信公众号appid
codeHeadUrl:"", codeHeadUrl:"",
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
</view> </view>
<view class="room-box"> <view class="room-box">
<view v-for="(val,k) in item.roolList" class="room-item" :class="val.status==3?'bg-blue':val.status==2?'bg-red':'bg-gray'"> <view v-for="(val,k) in item.roolList" :key='k' class="room-item" :class="val.status==3?'bg-blue':val.status==2?'bg-red':'bg-gray'" @tap='onNavSearch(val)'>
<view class="room-name"> <view class="room-name">
<text>{{val.name}}</text> <text>{{val.name}}</text>
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<text>{{val.roomName}}</text> <text>{{val.roomName}}</text>
</view> --> </view> -->
<view class="room-stauts margin-top"> <view class="room-stauts margin-top">
<text>{{statusEnum[val.status]}}</text> <text>{{ [0,1].includes(val.recordsStatus)?cleanStatusEnum[val.recordsStatus]: statusEnum[val.status]}}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -65,7 +65,9 @@ ...@@ -65,7 +65,9 @@
<script> <script>
import {getListStore,getStarOrder} from "@/api/cleanRoom.js"; import {getListStore,getStarOrder} from "@/api/cleanRoom.js";
import config from "@/config/index.config" import config from "@/config/index.config"
import {
getDictItem
} from "@/utils/tools.js"
export default { export default {
data() { data() {
return { return {
...@@ -76,13 +78,29 @@ ...@@ -76,13 +78,29 @@
1:'使用中', 1:'使用中',
2:'待保洁', 2:'待保洁',
3:'保洁中' 3:'保洁中'
} },
cleanStatusEnum:{}
}; };
}, },
onLoad() { onShow() {
this.onLoading() this.onGetDicts()
}, },
methods:{ methods:{
onGetDicts() {
let dicts = []
if (uni.getStorageSync('dicts')) {
dicts = JSON.parse(uni.getStorageSync('dicts'))
this.cleanStatusEnum = getDictItem(dicts, "clean_records_status");
this.onLoading()
} else {
dictList().then(res => {
dicts = res.data.data;
uni.setStorageSync('dicts', JSON.stringify(res.data.data))
this.cleanStatusEnum = getDictItem(dicts, "clean_records_status");
this.onLoading()
})
}
},
onLoading(){ onLoading(){
getListStore().then(res=>{ getListStore().then(res=>{
console.log(res) console.log(res)
...@@ -96,7 +114,7 @@ ...@@ -96,7 +114,7 @@
console.log(res,"查询保洁中的订单") console.log(res,"查询保洁中的订单")
if(res.data.code === 200){ if(res.data.code === 200){
uni.navigateTo({ uni.navigateTo({
url:"/pages/cleanOrderInfo/cleanOrderInfo?id="+res.data.data url:"/pages/cleanOrderInfo/cleanOrderInfo?id="+res.data.data.id
}) })
}else{ }else{
uni.showToast({ uni.showToast({
...@@ -122,6 +140,13 @@ ...@@ -122,6 +140,13 @@
uni.navigateTo({ uni.navigateTo({
url:"/pages/cleanRecord/index" url:"/pages/cleanRecord/index"
}) })
},
onNavSearch(val){
if(val.recordsStatus == 0){
uni.navigateTo({
url:"/pages/cleanOrderInfo/cleanOrderInfo?id="+val.recordsId
})
}
} }
} }
} }
......
...@@ -27,21 +27,44 @@ ...@@ -27,21 +27,44 @@
<view class="cu-bar bg-white margin-top"> <view class="cu-bar bg-white margin-top">
<view class="action"> <view class="action">
拍照上传 开始拍照上传
</view> </view>
<view class="action"> <view class="action">
{{imgList.length}}/4 {{orderInfo.startImage? orderInfo.startImage.length:'0'}}/4
</view> </view>
</view> </view>
<view class="cu-form-group"> <view v-if="orderInfo.startImage" class="cu-form-group">
<view class="grid col-4 grid-square flex-sub">
<view class="bg-img" v-for="(item,index) in orderInfo.startImage" :key="index" @tap="ViewImage('start',item)">
<image :src="item" mode="aspectFill"></image>
<view v-if="orderInfo.status === 0 " class="cu-tag bg-red" @tap.stop="DelImg('start',index)" :data-index="index">
<text class='cuIcon-close'></text>
</view>
</view>
<view v-if="orderInfo.status === 0 && imgList.length<4" class="solids" @tap="onChooseImage">
<text class='cuIcon-cameraadd'></text>
</view>
</view>
</view>
<view v-if="orderInfo.status>=1" class="cu-bar bg-white margin-top">
<view class="action">
结束拍照上传
</view>
<view class="action">
{{orderInfo.endImage?orderInfo.endImage.length:'0'}}/4
</view>
</view>
<view v-if="orderInfo.status>=1" class="cu-form-group">
<view class="grid col-4 grid-square flex-sub"> <view class="grid col-4 grid-square flex-sub">
<view class="bg-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" :data-url="imgList[index]"> <view class="bg-img" v-for="(item,index) in orderInfo.endImage" :key="index" @tap="ViewImage('end',item)" >
<image :src="imgList[index]" mode="aspectFill"></image> <image :src="item" mode="aspectFill"></image>
<view class="cu-tag bg-red" @tap.stop="DelImg" :data-index="index"> <view v-if="orderInfo.status == 1" class="cu-tag bg-red" @tap.stop="DelImg('end',index)" :data-index="index">
<text class='cuIcon-close'></text> <text class='cuIcon-close'></text>
</view> </view>
</view> </view>
<view class="solids" @tap="onChooseImage" v-if="imgList.length<4"> <view v-if="orderInfo.status == 1 && imgList.length<4 " class="solids" @tap="onChooseImage">
<text class='cuIcon-cameraadd'></text> <text class='cuIcon-cameraadd'></text>
</view> </view>
</view> </view>
...@@ -49,7 +72,7 @@ ...@@ -49,7 +72,7 @@
<view class="cu-form-group align-start"> <view class="cu-form-group align-start">
<view class="title">备注描述</view> <view class="title">备注描述</view>
<textarea maxlength="-1" :disabled="modalName!=null" @input="textareaBInput" placeholder="请输入描述"></textarea> <textarea maxlength="-1" :disabled="modalName!=null" @input="textareaBInput" v-model="remark" placeholder="请输入描述"></textarea>
</view> </view>
</form> </form>
...@@ -57,7 +80,7 @@ ...@@ -57,7 +80,7 @@
<view v-if="orderInfo.status !='2' " class="confirm-box"> <view v-if="orderInfo.status !='2' " class="confirm-box">
<view class="confirm-btn"> <view class="confirm-btn">
<button class="cu-btn block bg-blue margin-tb-sm lg" type="">提交并开始保洁</button> <button class="cu-btn block bg-blue margin-tb-sm lg" type="" @tap="onOrderConfirm">提交并{{orderInfo.status==1?'完成':'开始'}}保洁</button>
</view> </view>
<view class="open-door-btn"> <view class="open-door-btn">
...@@ -80,16 +103,14 @@ ...@@ -80,16 +103,14 @@
imgList:[], imgList:[],
orderInfo:{}, orderInfo:{},
cleanStatusEnum:{}, cleanStatusEnum:{},
orderId:'' orderId:'',
openDoor:false
}; };
}, },
onLoad(option) { onLoad(option) {
this.orderId = option.id; this.orderId = option.id;
this.onGetDicts() this.onGetDicts()
}, },
onShow() {
this.imgList = []
},
methods:{ methods:{
onGetDicts() { onGetDicts() {
let dicts = [] let dicts = []
...@@ -108,10 +129,16 @@ ...@@ -108,10 +129,16 @@
} }
}, },
onLoading(){ onLoading(){
this.imgList = []
getInfoById(this.orderId).then(res=>{ getInfoById(this.orderId).then(res=>{
console.log(res,90909090) console.log(res,90909090)
if(res.data.code === 200){ if(res.data.code === 200){
this.orderInfo = res.data.data; this.orderInfo = {
...res.data.data,
startImage:res.data.data.startImage? res.data.data.startImage.split(','):[],
endImage: res.data.data.endImage? res.data.data.endImage.split(','):[],
}
} }
}) })
}, },
...@@ -136,21 +163,23 @@ ...@@ -136,21 +163,23 @@
uni.hideLoading() uni.hideLoading()
if(result.data){ if(result.data){
let data = JSON.parse(result.data); let data = JSON.parse(result.data);
if(this.orderInfo.status>=1){
this.imgList.push(data.url) this.orderInfo.endImage.push(data.url)
}else{
this.orderInfo.startImage.push(data.url)
}
} }
}) })
} }
}); });
}, },
ViewImage(e) { ViewImage(val,url) {
uni.previewImage({ uni.previewImage({
urls: this.imgList, urls: val=='start'? this.orderInfo.startImage: this.orderInfo.endImage,
current: e.currentTarget.dataset.url current: url
}); });
}, },
DelImg(e) { DelImg(val,i) {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '确定要删除吗?', content: '确定要删除吗?',
...@@ -158,7 +187,12 @@ ...@@ -158,7 +187,12 @@
confirmText: '确定', confirmText: '确定',
success: res => { success: res => {
if (res.confirm) { if (res.confirm) {
this.imgList.splice(e.currentTarget.dataset.index, 1) if(val == 'start'){
this.orderInfo.startImage.splice(i, 1)
}else{
this.orderInfo.endImage.splice(i, 1)
}
} }
} }
}) })
...@@ -172,12 +206,77 @@ ...@@ -172,12 +206,77 @@
}).then(res=>{ }).then(res=>{
console.log() console.log()
if(res.data.code == 200){ if(res.data.code == 200){
this.openDoor = true;
uni.showToast({ uni.showToast({
icon:'success', icon:'success',
title:'开门成功' title:'开门成功'
}) })
} }
}) })
},
onOrderConfirm(){
// if(this.orderInfo.status === 0 && !this.openDoor){
// uni.showToast({
// icon:'none',
// title:'提交前请先开门'
// })
// }
if(this.orderInfo.status ==1){
if(!this.orderInfo.endImage.length){
uni.showToast({
icon:'none',
title:'请上传至少一张图片'
})
return
}
}else{
if(!this.orderInfo.startImage.length){
uni.showToast({
icon:'none',
title:'请上传至少一张图片'
})
return
}
}
if(this.orderInfo.status == '1'){
endClean({
id:this.orderInfo.id,
endImage: this.orderInfo.endImage.join(),
remark: this.remark
}).then(res=>{
if(res.data.code == 200){
uni.showToast({
icon:'success',
title:'提交成功'
})
this.onLoading()
}else{
uni.showToast({
icon:'none',
title:res.data.msg
})
}
})
}else{
startClean({
id:this.orderInfo.id,
startImage: this.orderInfo.startImage.join(),
remark: this.remark
}).then(res=>{
if(res.data.code == 200){
uni.showToast({
icon:'success',
title:'提交成功'
})
uni.navigateBack()
}else{
uni.showToast({
icon:'none',
title:res.data.msg
})
}
})
}
} }
} }
} }
...@@ -193,6 +292,7 @@ ...@@ -193,6 +292,7 @@
width: 94%; width: 94%;
border-radius: 24upx; border-radius: 24upx;
overflow: hidden; overflow: hidden;
padding-bottom: 120upx;
} }
} }
.confirm-box{ .confirm-box{
...@@ -203,6 +303,7 @@ ...@@ -203,6 +303,7 @@
padding: 24upx 0; padding: 24upx 0;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
background-color: #ffffff;
z-index: 999; z-index: 999;
.confirm-btn{ .confirm-btn{
width: 76%; width: 76%;
......
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