Commit 044767d9 by zhangzhen

细节完善

parent 512f40a2
const CONFIG = {
// 开发环境配置
development: {
assetsPath: 'https://coujiao.pseer.com/wechat_static', // 静态资源路径
baseUrl: 'https://coujiao.pseer.com/front-api', // 后台接口请求地址
hostUrl: 'https://coujiao.pseer.com/prod-api', // H5地址(前端运行地址)
assetsPath: 'https://www.coujio.com/wechat_static', // 静态资源路径
baseUrl: 'https://www.coujio.com/front-api', // 后台接口请求地址
hostUrl: 'https://www.coujio.com/prod-api', // H5地址(前端运行地址)
// baseUrl: 'http://192.168.1.189:8883/front', // 后台接口请求地址
// hostUrl: 'http://192.168.1.189:8882', // H5地址(前端运行地址)
websocketUrl: '', // websocket服务端地址
......@@ -13,9 +13,9 @@ const CONFIG = {
},
// 生产环境配置
production: {
assetsPath: 'https://coujiao.pseer.com/wechat_static', // 静态资源路径
baseUrl: 'https://coujiao.pseer.com/front-api', // 后台接口请求地址
hostUrl: 'https://coujiao.pseer.com/prod-api', // H5地址(前端运行地址)
assetsPath: 'https://www.coujio.com/wechat_static', // 静态资源路径
baseUrl: 'https://www.coujio.com/front-api', // 后台接口请求地址
hostUrl: 'https://www.coujio.com/prod-api', // H5地址(前端运行地址)
websocketUrl: '', // websocket服务端地址
weixinAppId: '', // 微信公众号appid
codeHeadUrl:"",
......
......@@ -41,7 +41,7 @@
</view>
<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">
<text>{{val.name}}</text>
......@@ -50,7 +50,7 @@
<text>{{val.roomName}}</text>
</view> -->
<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>
......@@ -65,7 +65,9 @@
<script>
import {getListStore,getStarOrder} from "@/api/cleanRoom.js";
import config from "@/config/index.config"
import {
getDictItem
} from "@/utils/tools.js"
export default {
data() {
return {
......@@ -76,13 +78,29 @@
1:'使用中',
2:'待保洁',
3:'保洁中'
}
},
cleanStatusEnum:{}
};
},
onLoad() {
this.onLoading()
onShow() {
this.onGetDicts()
},
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(){
getListStore().then(res=>{
console.log(res)
......@@ -96,7 +114,7 @@
console.log(res,"查询保洁中的订单")
if(res.data.code === 200){
uni.navigateTo({
url:"/pages/cleanOrderInfo/cleanOrderInfo?id="+res.data.data
url:"/pages/cleanOrderInfo/cleanOrderInfo?id="+res.data.data.id
})
}else{
uni.showToast({
......@@ -122,6 +140,13 @@
uni.navigateTo({
url:"/pages/cleanRecord/index"
})
},
onNavSearch(val){
if(val.recordsStatus == 0){
uni.navigateTo({
url:"/pages/cleanOrderInfo/cleanOrderInfo?id="+val.recordsId
})
}
}
}
}
......
......@@ -27,21 +27,44 @@
<view class="cu-bar bg-white margin-top">
<view class="action">
拍照上传
开始拍照上传
</view>
<view class="action">
{{imgList.length}}/4
{{orderInfo.startImage? orderInfo.startImage.length:'0'}}/4
</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="bg-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" :data-url="imgList[index]">
<image :src="imgList[index]" mode="aspectFill"></image>
<view class="cu-tag bg-red" @tap.stop="DelImg" :data-index="index">
<view class="bg-img" v-for="(item,index) in orderInfo.endImage" :key="index" @tap="ViewImage('end',item)" >
<image :src="item" mode="aspectFill"></image>
<view v-if="orderInfo.status == 1" class="cu-tag bg-red" @tap.stop="DelImg('end',index)" :data-index="index">
<text class='cuIcon-close'></text>
</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>
</view>
</view>
......@@ -49,7 +72,7 @@
<view class="cu-form-group align-start">
<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>
</form>
......@@ -57,7 +80,7 @@
<view v-if="orderInfo.status !='2' " class="confirm-box">
<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 class="open-door-btn">
......@@ -80,16 +103,14 @@
imgList:[],
orderInfo:{},
cleanStatusEnum:{},
orderId:''
orderId:'',
openDoor:false
};
},
onLoad(option) {
this.orderId = option.id;
this.onGetDicts()
},
onShow() {
this.imgList = []
},
methods:{
onGetDicts() {
let dicts = []
......@@ -108,10 +129,16 @@
}
},
onLoading(){
this.imgList = []
getInfoById(this.orderId).then(res=>{
console.log(res,90909090)
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 @@
uni.hideLoading()
if(result.data){
let data = JSON.parse(result.data);
this.imgList.push(data.url)
if(this.orderInfo.status>=1){
this.orderInfo.endImage.push(data.url)
}else{
this.orderInfo.startImage.push(data.url)
}
}
})
}
});
},
ViewImage(e) {
ViewImage(val,url) {
uni.previewImage({
urls: this.imgList,
current: e.currentTarget.dataset.url
urls: val=='start'? this.orderInfo.startImage: this.orderInfo.endImage,
current: url
});
},
DelImg(e) {
DelImg(val,i) {
uni.showModal({
title: '提示',
content: '确定要删除吗?',
......@@ -158,7 +187,12 @@
confirmText: '确定',
success: res => {
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 @@
}).then(res=>{
console.log()
if(res.data.code == 200){
this.openDoor = true;
uni.showToast({
icon:'success',
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 @@
width: 94%;
border-radius: 24upx;
overflow: hidden;
padding-bottom: 120upx;
}
}
.confirm-box{
......@@ -203,6 +303,7 @@
padding: 24upx 0;
display: flex;
flex-direction: row;
background-color: #ffffff;
z-index: 999;
.confirm-btn{
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