Commit 400b7ae5 by zhangzhen

11

parent 0f670be8
...@@ -30,3 +30,9 @@ export const getStarOrder=()=>{ ...@@ -30,3 +30,9 @@ export const getStarOrder=()=>{
let url=`/cleanRecords/getByCleanerId` let url=`/cleanRecords/getByCleanerId`
return http.get(url) return http.get(url)
} }
// 保洁订单
export const cleanList=(data)=>{
let url=`/cleanRecords/myCleanList`
return http.get(url,data)
}
\ No newline at end of file
...@@ -127,6 +127,14 @@ ...@@ -127,6 +127,14 @@
"navigationBarTitleText" : "验券说明", "navigationBarTitleText" : "验券说明",
"enablePullDownRefresh" : false "enablePullDownRefresh" : false
} }
},
{
"path" : "pages/cleanRecord/index",
"style" :
{
"navigationBarTitleText" : "保洁记录",
"enablePullDownRefresh" : false
}
} }
], ],
......
...@@ -10,13 +10,13 @@ ...@@ -10,13 +10,13 @@
<view class="icon-box"> <view class="icon-box">
<image :src="assetsPath+'/clean_icon.png'" mode="widthFix"></image> <image :src="assetsPath+'/clean_icon.png'" mode="widthFix"></image>
</view> </view>
<text class="text-title text-bold text-lg">开始保洁</text> <text class="text-white text-bold text-lg">开始保洁</text>
</view> </view>
<view class="item"> <view class="item" @tap="onNavToList">
<view class="icon-box"> <view class="icon-box">
<image :src="assetsPath+'/order_icon.png'" mode="widthFix"></image> <image :src="assetsPath+'/order_icon.png'" mode="widthFix"></image>
</view> </view>
<text class="text-title text-bold text-lg">保洁记录</text> <text class="text-white text-bold text-lg">保洁记录</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -94,10 +94,18 @@ ...@@ -94,10 +94,18 @@
onNavToInfo(){ onNavToInfo(){
getStarOrder().then(res=>{ getStarOrder().then(res=>{
console.log(res,"查询保洁中的订单") console.log(res,"查询保洁中的订单")
if(res.data.code === 200){
uni.navigateTo({
url:"/pages/cleanOrderInfo/cleanOrderInfo?id="+res.data.data
}) })
// uni.navigateTo({ }else{
// url:"/pages/cleanOrderInfo/cleanOrderInfo" uni.showToast({
// }) icon:'none',
title:res.data.msg
})
}
})
}, },
onNavLocation(val){ onNavLocation(val){
uni.openLocation({ uni.openLocation({
...@@ -109,6 +117,11 @@ ...@@ -109,6 +117,11 @@
console.log(res) console.log(res)
} }
}) })
},
onNavToList(){
uni.navigateTo({
url:"/pages/cleanRecord/index"
})
} }
} }
} }
...@@ -144,7 +157,7 @@ ...@@ -144,7 +157,7 @@
align-items: center; align-items: center;
width: 23%; width: 23%;
margin: 10upx 1% 30upx 1%; margin: 10upx 1% 30upx 1%;
border: 1px solid rgba(255, 72, 255, 0.45); background:rgba(255, 72, 255, 0.45);
border-radius: 20upx; border-radius: 20upx;
padding: 20upx 0; padding: 20upx 0;
.icon-box{ .icon-box{
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
</template> </template>
<script> <script>
import {getInfoByRoomId,openDoorByCleaner} from "@/api/cleanRoom.js"; import {getInfoByRoomId,openDoorByCleaner,startClean,endClean} from "@/api/cleanRoom.js";
export default { export default {
data() { data() {
......
<template>
<view class="order-record">
<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>
<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>
</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>
</view>
</view>
<view v-if="item.couponId" class="flex-between part-1">
<text>优惠券抵扣</text>
<text>{{item.couponName}}</text>
</view>
<view class="flex-row part-1">
<text>订单编号:</text>
<text>{{item.orderNo}}</text>
</view>
<view class="flex-between part-1">
<text>使用时间:</text>
<text>{{item.preStartDate}} - {{item.preEndDate}}</text>
</view>
<view class="flex-between part-1">
<text>下单时间:</text>
<text>{{item.createTime}}</text>
</view>
</view>
</view>
</view>
<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" />
</view>
<NoLogin v-model="loginStatus" />
</view>
</template>
<script>
import {
cleanList
} from "@/api/cleanRoom.js"
import NoLogin from "@/components/noLogin/noLogin"
import {
getDictItem
} from "@/utils/tools.js"
export default {
components:{
NoLogin
},
data() {
return {
status: 'nomore ',
loadingText: '努力加载中',
loadmoreText: '上划加载',
nomoreText: '到底啦',
statusIndex: 0,
list: [],
statusList: [
{
label: "待保洁",
value: "",
},
{
label: "保洁中",
value: "1",
},
{
label: "已保洁",
value: "2",
}
],
queryParams: {
status: "",
pageNum: 1,
pageSize: 10
},
loginStatus:true,
orderStatusEnum:{}
};
},
onLoad() {
},
onReachBottom() {
if (this.status == 'loadmore') {
this.queryParams.pageNum += 1;
this.onLoading();
}
},
onShow() {
this.onGetDicts()
},
methods: {
onGetDicts() {
let dicts = []
if (uni.getStorageSync('dicts')) {
dicts = JSON.parse(uni.getStorageSync('dicts'))
this.orderStatusEnum = getDictItem(dicts, "store_order_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.onLoading()
})
}
},
onLoading() {
uni.showLoading({
title: '加载中'
})
this.status = 'loading'
this.queryParams.status = this.statusList[this.statusIndex].value;
cleanList(this.queryParams).then(res => {
console.log(res)
uni.hideLoading()
if (res.data.code == 200) {
if(this.queryParams.pageNum ==1){
this.list = res.data.rows
}else{
this.list = [...this.list,...res.data.rows]
}
if(this.list.length < res.data.total){
this.status = "loadmore"
}else{
this.status = 'nomore'
}
}else if(res.data.code == 401){
this.loginStatus = false
}
})
},
tabSelect(i) {
console.log(i, 99999)
this.statusIndex = i;
this.queryParams.pageNum = 1;
this.list = []
this.onLoading()
},
onNavToOrderInfo(val){
uni.navigateTo({
url:"/pages/orderResult/orderResult?orderNo="+val.orderNo
})
}
}
}
</script>
<style>
page{
background-color: #ffffff;
}
</style>
<style lang="scss" scoped>
.order-record {
display: flex;
flex-direction: column;
.content-box {
display: flex;
flex-direction: column;
.list-content{
display: flex;
flex-direction: column;
align-items: center;
.list-item{
width: 94%;
padding: 30upx 20upx;
border-radius: 20upx;
background-color: #ffffff;
margin-top: 30upx;
.part-1{
display: flex;
align-items: center;
padding: 10upx;
}
}
}
}
}
</style>
\ No newline at end of file
...@@ -25,9 +25,12 @@ ...@@ -25,9 +25,12 @@
<view class="flex-1 store-name"> <view class="flex-1 store-name">
<text>{{storeInfo.name}}</text> <text>{{storeInfo.name}}</text>
</view> </view>
<view class="flex-1 flex-row"> <view v-if="storeInfo && storeInfo.distance" class="flex-1 flex-row">
<text class="cuIcon-locationfill text-red"></text> <text class="cuIcon-locationfill text-red"></text>
<text>距您{{storeInfo &&storeInfo.distance? Number(storeInfo.distance).toFixed(2):999}}公里</text> <text>距您{{Number(storeInfo.distance).toFixed(2)}}公里</text>
</view>
<view v-else class="flex-1 flex-row">
</view> </view>
</view> </view>
<view class="flex-row part-right"> <view class="flex-row part-right">
...@@ -275,6 +278,7 @@ ...@@ -275,6 +278,7 @@
} else{ } else{
uni.hideLoading() uni.hideLoading()
this.$refs.popup.open() this.$refs.popup.open()
this.onGetListStore()
} }
} }
}) })
...@@ -282,8 +286,8 @@ ...@@ -282,8 +286,8 @@
onGetListStore() { onGetListStore() {
getListStore({ getListStore({
...this.queryParams, ...this.queryParams,
nowLatitude: this.latitude, nowLatitude: this.latitude||'',
nowLongitude: this.longitude nowLongitude: this.longitude||''
}).then(res => { }).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data.code == 200 && res.data.data.length) { if (res.data.code == 200 && res.data.data.length) {
......
...@@ -56,7 +56,6 @@ ...@@ -56,7 +56,6 @@
import { import {
orderList orderList
} from "@/api/order.js" } from "@/api/order.js"
import list from "../../uni_modules/uview-ui/libs/config/props/list";
import NoLogin from "@/components/noLogin/noLogin" import NoLogin from "@/components/noLogin/noLogin"
import { import {
getDictItem getDictItem
...@@ -80,19 +79,19 @@ import NoLogin from "@/components/noLogin/noLogin" ...@@ -80,19 +79,19 @@ import NoLogin from "@/components/noLogin/noLogin"
}, },
{ {
label: "已预约", label: "已预约",
value: "1", value: "0",
}, },
{ {
label: "使用中", label: "使用中",
value: "2", value: "1",
}, },
{ {
label: "已完成", label: "已完成",
value: "3", value: "2",
}, },
{ {
label: "退单", label: "退单",
value: "4", value: "3",
} }
], ],
queryParams: { queryParams: {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="share-box"> <view class="share-box">
<view class="content-box"> <view class="content-box">
<view class="tki-qrcode"> <view class="tki-qrcode">
<tki-qrcode ref="qrcode" :cid="cid" :val="text" :size="size" unit="upx" :icon="assetsPath+'/cart.png'" <tki-qrcode ref="qrcode" :cid="cid" :val="text" :size="size" unit="upx" :icon="iconUrl"
:iconSize="24" :onval="true" :loadMake="loadMake" :showLoading="false" @result="qrR" /> :iconSize="24" :onval="true" :loadMake="loadMake" :showLoading="false" @result="qrR" />
</view> </view>
<view class="info"> <view class="info">
...@@ -32,21 +32,20 @@ ...@@ -32,21 +32,20 @@
</template> </template>
<script> <script>
import config from "@/config/index.config"
import tkiQrcode from "@/components/tki-qrcode/tki-qrcode" import tkiQrcode from "@/components/tki-qrcode/tki-qrcode"
import { import {
getOrderInfoByNo getOrderInfoByNo
} from "@/api/order.js" } from "@/api/order.js"
import moment from "@/common/moment_zh_cn.js"; import moment from "@/common/moment_zh_cn.js";
import {openDoor} from "@/api/order.js" import {openDoor} from "@/api/order.js"
import iconUrl from "@/static/cart.png"
export default { export default {
components: { components: {
tkiQrcode tkiQrcode
}, },
data() { data() {
return { return {
assetsPath:config.assetsPath, iconUrl,
cid: "qrCode", cid: "qrCode",
qrPath: '', qrPath: '',
text: '生成中', text: '生成中',
......
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