Commit 3ac6ccf4 by zhangzhen

123213

parent 400b7ae5
......@@ -6,8 +6,8 @@ export const getListStore=()=>{
return http.get(url)
}
export const getInfoByRoomId=(roomId)=>{
let url=`/cleanRecords/getByRoomId/${roomId}`
export const getInfoById=(id)=>{
let url=`/cleanRecords/${id}`
return http.get(url)
}
......
......@@ -208,7 +208,7 @@
align-items: center;
width: 30%;
margin: 12upx 1.6%;
padding: 20upx 0;
padding: 30upx 0;
border-radius: 20upx;
}
}
......
......@@ -4,25 +4,25 @@
<form>
<view class="cu-form-group margin-top">
<view class="title">门店名称</view>
<text>测试一号店</text>
<text>{{orderInfo.storeName}}</text>
</view>
<view class="cu-form-group">
<view class="title">门店地址</view>
<text>武汉市印象国际8楼802</text>
<text>{{orderInfo.address}}</text>
</view>
<view class="cu-form-group">
<view class="title">房间名称</view>
<text>一帆风顺</text>
<text>{{orderInfo.roomName}}</text>
</view>
<view class="cu-form-group">
<!-- <view class="cu-form-group">
<view class="title">房间号</view>
<text>111</text>
</view>
</view> -->
<view class="cu-form-group">
<view class="title">保洁状态</view>
<text>待保洁</text>
<text>{{cleanStatusEnum[orderInfo.status]}}</text>
</view>
<view class="cu-bar bg-white margin-top">
......@@ -55,7 +55,7 @@
</form>
</view>
<view class="confirm-box">
<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>
</view>
......@@ -70,21 +70,40 @@
</template>
<script>
import {getInfoByRoomId,openDoorByCleaner,startClean,endClean} from "@/api/cleanRoom.js";
import {getInfoById,openDoorByCleaner,startClean,endClean} from "@/api/cleanRoom.js";
import {getDictItem} from "@/utils/tools.js"
export default {
data() {
return {
imgList:[],
orderInfo:{},
cleanStatusEnum:{},
orderId:''
};
},
onLoad() {
this.onLoading();
onLoad(option) {
this.orderId = option.id;
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(){
getInfoByRoomId(this.roomId).then(res=>{
getInfoById(this.orderId).then(res=>{
console.log(res,90909090)
if(res.data.code === 200){
this.orderInfo = res.data.data;
......
<template>
<view class="order-record">
<scroll-view v-if="loginStatus" scroll-x class="bg-white nav">
<!-- <scroll-view v-if="loginStatus" scroll-x class="bg-white nav">
<view class="flex text-center">
<view class="cu-item flex-sub" :class="index==statusIndex?'text-orange cur':''"
v-for="(item,index) in statusList" :key="index" @tap="tabSelect(index)">
<text>{{item.label}}</text>
</view>
</view>
</scroll-view>
</scroll-view> -->
<view v-if="loginStatus" class="content-box">
<view class="list-content">
<view v-for="(item,index) in list" :key="index" class="list-item" @tap="onNavToOrderInfo(item)">
<view class="flex-between part-1">
<text class="text-title text-bold text-xl">{{item.roomName||'房间名称'}}</text>
<text class="text-pink">{{orderStatusEnum[item.status]}}</text>
<text class="text-pink">{{cleanStatusEnum[item.status]}}</text>
</view>
<view class="flex-between part-1">
<view class="">
<text>{{item.payType==1?'微信支付':'余额支付'}}:</text>
<text class="text-black text-bold text-lg">{{item.payPrice}}</text>
</view>
<view class="flex-row">
<text>{{item.orderType==1?'房间预定':'房间续订'}}</text>
<text>所属门店:</text>
<text class="text-black text-bold text-lg">{{item.storeName}}</text>
</view>
</view>
<view v-if="item.couponId" class="flex-between part-1">
<text>优惠券抵扣</text>
<text>{{item.couponName}}</text>
<view class="flex-row part-1">
<text>创建时间</text>
<text>{{item.createTime||'-'}}</text>
</view>
<view class="flex-row part-1">
<text>订单编号:</text>
<text>{{item.orderNo}}</text>
<text>开始时间:</text>
<text>{{item.startDate||'-'}}</text>
</view>
<view class="flex-between part-1">
<text>使用时间:</text>
<text>{{item.preStartDate}} - {{item.preEndDate}}</text>
<view class="flex-row part-1">
<text>完成时间:</text>
<text>{{item.endDate||'-'}}</text>
</view>
<view class="flex-between part-1">
<text>下单时间:</text>
<text>{{item.createTime}}</text>
<view class="flex-row part-1">
<text>备注:</text>
<text>{{item.remark}}</text>
</view>
</view>
</view>
</view>
<u-empty v-if="loginStatus && list.length == 0" text="未查询到相关订单" textColor='#C1C1C1'></u-empty>
<u-empty v-if="loginStatus && list.length == 0" text="未查询到相关记录" textColor='#C1C1C1'></u-empty>
<view v-if="loginStatus && list.length" style="padding: 12px 6% 0;">
<u-loadmore :status="status" :icon="true" :line='true' :loading-text="loadingText"
:loadmore-text="loadmoreText" :nomore-text="nomoreText" />
......@@ -73,27 +70,27 @@ import NoLogin from "@/components/noLogin/noLogin"
nomoreText: '到底啦',
statusIndex: 0,
list: [],
statusList: [
{
label: "待保洁",
value: "",
},
{
label: "保洁中",
value: "1",
},
{
label: "已保洁",
value: "2",
}
],
// statusList: [
// {
// label: "待保洁",
// value: "",
// },
// {
// label: "保洁中",
// value: "1",
// },
// {
// label: "已保洁",
// value: "2",
// }
// ],
queryParams: {
status: "",
pageNum: 1,
pageSize: 10
},
loginStatus:true,
orderStatusEnum:{}
cleanStatusEnum:{}
};
},
onLoad() {
......@@ -113,13 +110,13 @@ import NoLogin from "@/components/noLogin/noLogin"
let dicts = []
if (uni.getStorageSync('dicts')) {
dicts = JSON.parse(uni.getStorageSync('dicts'))
this.orderStatusEnum = getDictItem(dicts, "store_order_status");
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.orderStatusEnum = getDictItem(dicts, "store_order_status");
this.cleanStatusEnum = getDictItem(dicts, "clean_records_status");
this.onLoading()
})
}
......@@ -129,7 +126,6 @@ import NoLogin from "@/components/noLogin/noLogin"
title: '加载中'
})
this.status = 'loading'
this.queryParams.status = this.statusList[this.statusIndex].value;
cleanList(this.queryParams).then(res => {
console.log(res)
uni.hideLoading()
......@@ -158,7 +154,7 @@ import NoLogin from "@/components/noLogin/noLogin"
},
onNavToOrderInfo(val){
uni.navigateTo({
url:"/pages/orderResult/orderResult?orderNo="+val.orderNo
url:"/pages/cleanOrderInfo/cleanOrderInfo?id="+val.id
})
}
}
......
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