Commit 3ac6ccf4 by zhangzhen

123213

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