|
@@ -1,38 +1,42 @@
|
|
|
<template>
|
|
<template>
|
|
|
<uv-navbar leftIcon="arrow-left" @leftClick="handleLeftClick" title="门店详情"></uv-navbar>
|
|
<uv-navbar leftIcon="arrow-left" @leftClick="handleLeftClick" title="门店详情"></uv-navbar>
|
|
|
<view class="page">
|
|
<view class="page">
|
|
|
- <image :src="state.station.pictures" mode="widthFix" class="station-bg" :style="state.imageStyle"></image>
|
|
|
|
|
|
|
+ <view class="station-container">
|
|
|
|
|
+ <swiper class="station-swiper" indicator-dots indicator-color="rgba(255,255,255,0.5)" indicator-active-color="#fff" autoplay circular>
|
|
|
|
|
+ <swiper-item v-for="(img, index) in (state.station.pictures || '').split('|')" :key="index">
|
|
|
|
|
+ <image :src="img" mode="aspectFit" class="station-bg"></image>
|
|
|
|
|
+ </swiper-item>
|
|
|
|
|
+ </swiper>
|
|
|
|
|
+ </view>
|
|
|
|
|
|
|
|
- <view class="station-box">
|
|
|
|
|
- <view class=" station_wrapper">
|
|
|
|
|
- <WashStation :item=" state.station" ref="station_ref"></WashStation>
|
|
|
|
|
|
|
+ <view class="station-info-wrapper">
|
|
|
|
|
+ <view class="station-box">
|
|
|
|
|
+ <view class="station_wrapper">
|
|
|
|
|
+ <WashStation :item="state.station" ref="station_ref"></WashStation>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="device-box">
|
|
<view class="device-box">
|
|
|
<view class="device-item" v-for="device in state.deviceList" :key="device.id" @click="handleClickDevice(device)">
|
|
<view class="device-item" v-for="device in state.deviceList" :key="device.id" @click="handleClickDevice(device)">
|
|
|
- <div class="device-item_header">
|
|
|
|
|
|
|
+ <view class="device-item_header">
|
|
|
<text class="device-item_header-seq">{{ device.seqName }}</text>
|
|
<text class="device-item_header-seq">{{ device.seqName }}</text>
|
|
|
- <text class="device-item_header-status" :class="device.state=='idle'?'success':''">{{ fmtDictName('WashDevice.state', device.state) }}</text>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="device-item_body">
|
|
|
|
|
|
|
+ <text class="device-item_header-status"
|
|
|
|
|
+ :class="getDeviceStatusClass(device.state)">
|
|
|
|
|
+ {{ fmtDictName('WashDevice.state', device.state) }}
|
|
|
|
|
+ </text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="device-item_body">
|
|
|
<view class="device-item_body_header">
|
|
<view class="device-item_body_header">
|
|
|
<text class="device-item_body_header-short">编号:{{ device.shortId }}</text>
|
|
<text class="device-item_body_header-short">编号:{{ device.shortId }}</text>
|
|
|
- <view></view>
|
|
|
|
|
- <text class="device-item_body_header-short">服务:{{ device.functionList.join("、") }}</text>
|
|
|
|
|
</view>
|
|
</view>
|
|
|
- <!-- <view class="device-item_body_func">
|
|
|
|
|
- <view class="device-item_body_func-tag">
|
|
|
|
|
- <uv-text text="服务:" size="mini" plain plainFill color="black" ></uv-text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="device-item_body_func-tag" v-for="f in device.functionList" :key="f">
|
|
|
|
|
- <uv-text :text="f" size="mini" plain plainFill color="black" ></uv-text>
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>-->
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
|
|
+ <view class="device-item_body_func">
|
|
|
|
|
+ <view class="device-item_body_func-tag" v-for="(f, index) in device.functionList" :key="index">
|
|
|
|
|
+ {{ f }}
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
-
|
|
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="station-bottom">
|
|
<view class="station-bottom">
|
|
@@ -63,11 +67,7 @@ const initState = () => ({
|
|
|
station: {
|
|
station: {
|
|
|
id: 0
|
|
id: 0
|
|
|
},
|
|
},
|
|
|
- currentUserId: 0,
|
|
|
|
|
- imageStyle: {
|
|
|
|
|
- height: '180px',
|
|
|
|
|
- width: '100%',
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ currentUserId: 0
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const state = reactive(initState())
|
|
const state = reactive(initState())
|
|
@@ -93,13 +93,6 @@ onLoad((options) => {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
onShow(() => {
|
|
onShow(() => {
|
|
|
- //设置图片的宽高
|
|
|
|
|
- let width = uni.getWindowInfo().windowWidth - rpxToPx(20)
|
|
|
|
|
- let height = uni.getWindowInfo().windowHeight * 3 / 4
|
|
|
|
|
- state.imageStyle = {
|
|
|
|
|
- width: `${width}px`,
|
|
|
|
|
- height: `${height}px`,
|
|
|
|
|
- }
|
|
|
|
|
// let station = getApp<any>().globalData.last.station;
|
|
// let station = getApp<any>().globalData.last.station;
|
|
|
// if (station) {
|
|
// if (station) {
|
|
|
// state.station = station;
|
|
// state.station = station;
|
|
@@ -148,138 +141,215 @@ const handleClickDevice = (device: any) => {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 获取设备状态对应的CSS类
|
|
|
|
|
+const getDeviceStatusClass = (state: string) => {
|
|
|
|
|
+ switch (state) {
|
|
|
|
|
+ case 'idle':
|
|
|
|
|
+ return 'success';
|
|
|
|
|
+ case 'working':
|
|
|
|
|
+ return 'warning';
|
|
|
|
|
+ case 'fault':
|
|
|
|
|
+ return 'error';
|
|
|
|
|
+ default:
|
|
|
|
|
+ return '';
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
|
|
+// 品牌主色调
|
|
|
|
|
+$brand-primary: #C6171E;
|
|
|
|
|
+$brand-primary-light: #F8E4E5;
|
|
|
|
|
+$brand-success: #07C160;
|
|
|
|
|
+$brand-warning: #FAAD14;
|
|
|
|
|
+$brand-error: #F56C6C;
|
|
|
|
|
+$text-primary: #333333;
|
|
|
|
|
+$text-secondary: #666666;
|
|
|
|
|
+$text-tertiary: #999999;
|
|
|
|
|
+$border-color: #E4E7ED;
|
|
|
|
|
+$background-light: #F5F7FA;
|
|
|
|
|
+
|
|
|
.page {
|
|
.page {
|
|
|
- margin-top: 104px;
|
|
|
|
|
- height: calc(100vh - 164px);
|
|
|
|
|
|
|
+ height: 100vh;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
- background-color: #eee;
|
|
|
|
|
|
|
+ background-color: $background-light;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
|
|
+ padding: 88rpx 0 120rpx;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+ overflow-x: hidden;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-.station-bg {
|
|
|
|
|
|
|
+.station-container {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ padding: 0 20rpx;
|
|
|
|
|
+ margin: 20rpx auto 0;
|
|
|
|
|
+ position: relative;
|
|
|
z-index: 1;
|
|
z-index: 1;
|
|
|
- border-radius: 10px;
|
|
|
|
|
- //width: calc(100vw - 20rpx);
|
|
|
|
|
- margin: 10px auto 0 auto;
|
|
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.station-swiper {
|
|
|
|
|
+ height: 400rpx;
|
|
|
|
|
+ border-radius: 20rpx;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.12);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-.block {
|
|
|
|
|
|
|
+.station-bg {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ display: block;
|
|
|
|
|
+ margin: auto;
|
|
|
border-radius: 20rpx;
|
|
border-radius: 20rpx;
|
|
|
- background: #fff;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-.content_station {
|
|
|
|
|
- height: calc(100vh - 480px);
|
|
|
|
|
|
|
+.station-info-wrapper {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ padding: 0 20rpx;
|
|
|
|
|
+ margin: 20rpx 0;
|
|
|
|
|
+ z-index: 10;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.station-box {
|
|
.station-box {
|
|
|
- width: calc(100vw - 80rpx);
|
|
|
|
|
- margin: -80rpx auto 0 auto;
|
|
|
|
|
- border-radius: 15rpx;
|
|
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ border-radius: 16rpx;
|
|
|
|
|
+ background-color: #fff;
|
|
|
|
|
+ box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.1);
|
|
|
|
|
+ padding: 24rpx;
|
|
|
|
|
+ position: relative;
|
|
|
z-index: 10;
|
|
z-index: 10;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.device-box {
|
|
.device-box {
|
|
|
- flex:1;
|
|
|
|
|
|
|
+ flex: 1;
|
|
|
overflow-y: scroll;
|
|
overflow-y: scroll;
|
|
|
- width: calc(100vw - 80rpx);
|
|
|
|
|
- margin: 30rpx auto 30rpx;
|
|
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ padding: 0 30rpx;
|
|
|
|
|
+ margin: 30rpx 0 0 0;
|
|
|
|
|
+ padding-bottom: 150rpx;
|
|
|
|
|
+ max-height: calc(100vh - 600rpx);
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.device-item {
|
|
.device-item {
|
|
|
background-color: #fff;
|
|
background-color: #fff;
|
|
|
- border-radius: 10rpx;
|
|
|
|
|
- //width: calc(100vw - 80rpx);
|
|
|
|
|
- margin: 20rpx auto;
|
|
|
|
|
- padding: 10rpx;
|
|
|
|
|
|
|
+ border-radius: 16rpx;
|
|
|
|
|
+ margin: 0 auto 24rpx;
|
|
|
|
|
+ padding: 20rpx 24rpx;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
|
|
+ box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
|
|
|
|
|
+ transition: all 0.2s ease;
|
|
|
|
|
+ border: 1rpx solid $border-color;
|
|
|
|
|
+
|
|
|
|
|
+ &:active {
|
|
|
|
|
+ transform: scale(0.99);
|
|
|
|
|
+ box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
&_header {
|
|
&_header {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
|
-
|
|
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ margin-bottom: 16rpx;
|
|
|
|
|
|
|
|
&-seq {
|
|
&-seq {
|
|
|
- font-size: 28rpx;
|
|
|
|
|
|
|
+ font-size: 30rpx;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ color: $text-primary;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
&-status {
|
|
&-status {
|
|
|
- font-size: 20rpx;
|
|
|
|
|
- background-color: $uni-color-primary;
|
|
|
|
|
|
|
+ font-size: 22rpx;
|
|
|
|
|
+ border-radius: 20rpx;
|
|
|
|
|
+ padding: 6rpx 20rpx;
|
|
|
|
|
+ font-weight: 500;
|
|
|
|
|
+ background-color: $brand-primary;
|
|
|
color: #fff;
|
|
color: #fff;
|
|
|
- border-radius: 6rpx;
|
|
|
|
|
- padding: 6rpx 10rpx;
|
|
|
|
|
- margin-left: 30rpx;
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
&_body {
|
|
&_body {
|
|
|
- margin-top: 8rpx;
|
|
|
|
|
- border-top: 1rpx solid #eee;
|
|
|
|
|
|
|
+ border-top: 1rpx solid $border-color;
|
|
|
|
|
+ padding-top: 16rpx;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
|
|
|
|
|
&_header {
|
|
&_header {
|
|
|
- font-size: 24rpx;
|
|
|
|
|
- padding: 10rpx 0;
|
|
|
|
|
|
|
+ margin-bottom: 12rpx;
|
|
|
|
|
|
|
|
&-short {
|
|
&-short {
|
|
|
- font-size: 24rpx;
|
|
|
|
|
|
|
+ font-size: 26rpx;
|
|
|
font-weight: 500;
|
|
font-weight: 500;
|
|
|
- transform: scale(0.8);
|
|
|
|
|
|
|
+ color: $text-secondary;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
&_func {
|
|
&_func {
|
|
|
- display: inline-flex;
|
|
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
|
+ margin-right: -8rpx;
|
|
|
|
|
+
|
|
|
|
|
+ &-tag {
|
|
|
|
|
+ font-size: 18rpx;
|
|
|
|
|
+ padding: 2rpx 14rpx;
|
|
|
|
|
+ margin-right: 8rpx;
|
|
|
|
|
+ margin-bottom: 8rpx;
|
|
|
|
|
+ background-color: $brand-primary-light;
|
|
|
|
|
+ color: $brand-primary;
|
|
|
|
|
+ border-radius: 16rpx;
|
|
|
|
|
+ font-weight: 500;
|
|
|
|
|
+ line-height: 1.4;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
- &-label {
|
|
|
|
|
- font-size: 24rpx;
|
|
|
|
|
- color: #aaa;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+.device-item_header-status.success {
|
|
|
|
|
+ background-color: $brand-success;
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
- &-tag {
|
|
|
|
|
- margin-right: 6px;
|
|
|
|
|
- transform: scale(0.8);
|
|
|
|
|
- padding: 10rpx 0;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+.device-item_header-status.warning {
|
|
|
|
|
+ background-color: $brand-warning;
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
+.device-item_header-status.error {
|
|
|
|
|
+ background-color: $brand-error;
|
|
|
|
|
+ color: #fff;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.station-bottom {
|
|
.station-bottom {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
-
|
|
|
|
|
position: fixed;
|
|
position: fixed;
|
|
|
- bottom: 20rpx;
|
|
|
|
|
- left: 20rpx;
|
|
|
|
|
|
|
+ bottom: 0;
|
|
|
|
|
+ left: 0;
|
|
|
|
|
+ background-color: #fff;
|
|
|
|
|
+ box-shadow: 0 -4rpx 16rpx rgba(0, 0, 0, 0.06);
|
|
|
|
|
+ padding: 20rpx;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+ z-index: 100;
|
|
|
|
|
|
|
|
&-box {
|
|
&-box {
|
|
|
- width: calc(100vw - 40rpx);
|
|
|
|
|
|
|
+ width: 100%;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
- justify-content: space-around;
|
|
|
|
|
|
|
+ justify-content: space-between;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.bottom-left {
|
|
.bottom-left {
|
|
|
- width: 200rpx;
|
|
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ margin-right: 20rpx;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.bottom-right {
|
|
.bottom-right {
|
|
|
- flex: 1
|
|
|
|
|
|
|
+ flex: 2;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-.success {
|
|
|
|
|
- background-color: $uni-color-success;
|
|
|
|
|
- color: #fff;
|
|
|
|
|
-}
|
|
|
|
|
</style>
|
|
</style>
|