Commit b2ebc0be by zhangzhen

功能完善

parent b9225eee
...@@ -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.roomStatus===0?'bg-gray':val.roomStatus==1?'bg-yellow':val.roomStatus==2?'bg-yellow':val.roomStatus==3?'bg-pink':'bg-red'"> <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.roomStatus]}}</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 {
...@@ -75,45 +77,35 @@ ...@@ -75,45 +77,35 @@
0:'空闲中', 0:'空闲中',
1:'使用中', 1:'使用中',
2:'待保洁', 2:'待保洁',
3:'保洁中', 3:'保洁中'
4:'维护中' },
} 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)
if(res.data.code ===200){ if(res.data.code ===200){
if(res.data.data&&res.data.data.length){ this.list =res.data.data&&res.data.data.length? res.data.data:[]
this.list =res.data.data.map(item=>{
return {
...item,
roolList:item.roolList.map(val=>{
let roomStatus = 0;
if(val.recordsStatus != null && val.recordsStatus ===0){
roomStatus = 2
}else if(val.recordsStatus != null && val.recordsStatus ===1){
roomStatus = 3
}else if(val.status != null && val.status ===0){
roomStatus = 0
}else if(val.status != null && val.status ===1){
roomStatus = 1
}else if(val.status != null && val.status ===3){
roomStatus = 4
}
return {
...val,
roomStatus
}
})
}
})
}
} }
}) })
}, },
...@@ -122,7 +114,7 @@ ...@@ -122,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({
...@@ -148,6 +140,13 @@ ...@@ -148,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
})
}
} }
} }
} }
...@@ -226,7 +225,7 @@ ...@@ -226,7 +225,7 @@
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
width: 100%; width: 100%;
padding: 0 1% 20upx 1%; padding: 0 1%;
.room-item{ .room-item{
display: flex; display: flex;
flex-direction: column; flex-direction: column;
......
...@@ -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%;
......
...@@ -112,11 +112,11 @@ ...@@ -112,11 +112,11 @@
</view> </view>
<text>不可选时段</text> <text>不可选时段</text>
</view> </view>
<view class="flex-1 flex-row"> <!-- <view class="flex-1 flex-row">
<view class="round-box error"> <view class="round-box error">
</view> </view>
<text>重叠时段</text> <text>重叠时段</text>
</view> </view> -->
</view> </view>
<view class="date-point-box"> <view class="date-point-box">
<view v-for="(item,k) in intervalList" :key="k" class="date-point-item"> <view v-for="(item,k) in intervalList" :key="k" class="date-point-item">
...@@ -566,7 +566,7 @@ ...@@ -566,7 +566,7 @@
this.useDateStatus = false this.useDateStatus = false
this.intervalList[start] = { this.intervalList[start] = {
...this.dateIntervalList[start], ...this.dateIntervalList[start],
status: 3 status: 2
} }
} else { } else {
this.intervalList[start] = { this.intervalList[start] = {
......
...@@ -15,6 +15,32 @@ ...@@ -15,6 +15,32 @@
<text class="text-title text-bold text-xl">{{item.roomName||'房间名称'}}</text> <text class="text-title text-bold text-xl">{{item.roomName||'房间名称'}}</text>
<text class="text-pink">{{orderStatusEnum[item.status]}}</text> <text class="text-pink">{{orderStatusEnum[item.status]}}</text>
</view> </view>
<view class="flex-row timeline">
<view class="flex-col part-1">
<view class="part-circular">
</view>
<view class="part-line">
</view>
<view class="part-circular">
</view>
</view>
<view class="flex-col part-2">
<view class="flex-row">
<text class="text-title">预约开始时间</text>
<text class="text-title">{{item.preStartDate +':00'}}</text>
</view>
<view class="flex-row ">
<text class="text-title">预约结束时间</text>
<text class="text-title">{{item.preEndDate +':00'}}</text>
</view>
</view>
</view>
<view class="flex-between part-1"> <view class="flex-between part-1">
<view class=""> <view class="">
<text>{{item.payType==1?'微信支付':'余额支付'}}:</text> <text>{{item.payType==1?'微信支付':'余额支付'}}:</text>
...@@ -25,20 +51,28 @@ ...@@ -25,20 +51,28 @@
</view> </view>
</view> </view>
<view v-if="item.couponId" class="flex-between part-1"> <view v-if="item.couponId" class="flex-between part-1">
<text>优惠券抵扣</text> <text class="text-gray margin-right">优惠券抵扣</text>
<text>{{item.couponName}}</text> <text class="text-title">{{item.couponName}}</text>
</view> </view>
<view class="flex-row part-1"> <view class="flex-row part-1">
<text>订单编号:</text> <text class="text-gray margin-right">订单编号:</text>
<text>{{item.orderNo}}</text> <text class="text-title">{{item.orderNo}}</text>
</view> </view>
<view class="flex-between part-1"> <view class="flex-between part-1">
<text>使用时间:</text> <text class="text-gray">下单时间:</text>
<text>{{item.preStartDate}} - {{item.preEndDate}}</text> <text class="text-title">{{item.createTime}}</text>
</view>
<view v-if="item.startDate" class="flex-between part-1">
<text class="text-gray">开始时间:</text>
<text class="text-title">{{item.startDate}}</text>
</view>
<view v-if="item.endDate" class="flex-between part-1">
<text class="text-gray">结束时间:</text>
<text class="text-title">{{item.endDate}}</text>
</view> </view>
<view class="flex-between part-1"> <view class="flex-between part-1">
<text>下单时间:</text> <text class="text-gray">订单总计:</text>
<text>{{item.createTime}}</text> <text class="text-pink text-bold">{{item.totalPrice}}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -212,4 +246,45 @@ import NoLogin from "@/components/noLogin/noLogin" ...@@ -212,4 +246,45 @@ import NoLogin from "@/components/noLogin/noLogin"
} }
} }
} }
.timeline{
display: flex;
flex-direction: row;
.flex-col{
justify-content: center;
align-items: center;
.part-circular{
display: flex;
width: 8px;
height: 8px;
border-radius: 50%;
background-color: #e70486;
}
.part-line{
height: 50upx;
width: 2upx;
background-color: #999999;
margin-left: -1upx;
}
}
.part-1{
padding: 40upx 0;
margin-left: 20upx;
}
.part-2{
display: flex;
flex: 1;
flex-direction: column;
align-items: flex-start;
height: 120upx;
margin-left: 20upx;
.flex-row{
display: flex;
flex: 1;
width: 100%;
align-items: center;
justify-content: space-between;
}
}
}
</style> </style>
\ No newline at end of file
...@@ -41,10 +41,10 @@ ...@@ -41,10 +41,10 @@
<text class="text-black text-lg">下单时间:{{orderInfo.updateTime || orderInfo.createTime||'-'}}</text> <text class="text-black text-lg">下单时间:{{orderInfo.updateTime || orderInfo.createTime||'-'}}</text>
</view> </view>
<view class="info"> <view class="info">
<text class="text-black text-lg">开始时间:{{orderInfo.preStartDate}}</text> <text class="text-black text-lg">开始时间:{{orderInfo.preStartDate}}:00</text>
</view> </view>
<view class="info"> <view class="info">
<text class="text-black text-lg">结束时间:{{orderInfo.preEndDate}}</text> <text class="text-black text-lg">结束时间:{{orderInfo.preEndDate}}:00</text>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -37,10 +37,10 @@ ...@@ -37,10 +37,10 @@
</radio-group> </radio-group>
</view> </view>
<view class="cu-form-group"> <!-- <view class="cu-form-group">
<text class="text-black text-bold margin-right">手机号</text> <text class="text-black text-bold margin-right">手机号</text>
<input v-model="userInfo.phone" type="number" :maxlength="12" placeholder="请输入您的手机号" name="input"></input> <input v-model="userInfo.phone" type="number" :maxlength="12" placeholder="请输入您的手机号" name="input"></input>
</view> </view> -->
</form> </form>
<view class="confirm-btn-box"> <view class="confirm-btn-box">
<view class="confirm-btn"> <view class="confirm-btn">
......
static/tab-bar-img/home.png

1.05 KB | W: | H:

static/tab-bar-img/home.png

4.63 KB | W: | H:

static/tab-bar-img/home.png
static/tab-bar-img/home.png
static/tab-bar-img/home.png
static/tab-bar-img/home.png
  • 2-up
  • Swipe
  • Onion skin
static/tab-bar-img/order.png

988 Bytes | W: | H:

static/tab-bar-img/order.png

4.26 KB | W: | H:

static/tab-bar-img/order.png
static/tab-bar-img/order.png
static/tab-bar-img/order.png
static/tab-bar-img/order.png
  • 2-up
  • Swipe
  • Onion skin
static/tab-bar-img/order_selected.png

1.21 KB | W: | H:

static/tab-bar-img/order_selected.png

5.58 KB | W: | H:

static/tab-bar-img/order_selected.png
static/tab-bar-img/order_selected.png
static/tab-bar-img/order_selected.png
static/tab-bar-img/order_selected.png
  • 2-up
  • Swipe
  • Onion skin
static/tab-bar-img/user.png

1.22 KB | W: | H:

static/tab-bar-img/user.png

5.55 KB | W: | H:

static/tab-bar-img/user.png
static/tab-bar-img/user.png
static/tab-bar-img/user.png
static/tab-bar-img/user.png
  • 2-up
  • Swipe
  • Onion skin
static/tab-bar-img/user_selected.png

1.41 KB | W: | H:

static/tab-bar-img/user_selected.png

7.28 KB | W: | H:

static/tab-bar-img/user_selected.png
static/tab-bar-img/user_selected.png
static/tab-bar-img/user_selected.png
static/tab-bar-img/user_selected.png
  • 2-up
  • Swipe
  • Onion skin
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