Ver Fonte

机柜+用户+电池

xhj há 3 anos atrás
pai
commit
32975187d8

+ 39 - 28
machineAndCell/machineDetail/machineDetail.vue

@@ -4,47 +4,65 @@
 			<view class="item ddflex">
 				<view class="label">机柜名称</view>
 				<view class="item-input fflex ddflex">
-					<view>西正路100号门店12仓</view>
-					<view class="state">在线</view>
+					<view>{{cabInfo.devName}}</view>
+					<!-- <view class="state">在线</view> -->
 				</view>
 			</view>
 			<view class="item ddflex">
 				<view class="label">机柜编号</view>
 				<view class="item-input fflex">
-					CHZD04TTCC200329109
+					{{cabInfo.devId}}
 				</view>
 			</view>
 			<view class="item ddflex">
 				<view class="label">机柜温度</view>
 				<view class="item-input fflex">
-					29C
+					{{cabInfo.cabTemp}}C
 				</view>
 			</view>
 			<view class="item ddflex">
 				<view class="label">机柜电压</view>
 				<view class="item-input fflex">
-					229.20V
+					{{cabInfo.cabVol}}V
 				</view>
 			</view>
 			<view class="item ddflex">
 				<view class="label">当前电流</view>
 				<view class="item-input fflex">
-					14.2A
+					{{cabInfo.cabCur}}A
 				</view>
 			</view>
 			<view class="item ddflex">
 				<view class="label">信号强度</view>
 				<view class="item-input fflex">
-					28
+					{{cabInfo.dbm}}
 				</view>
 			</view>
 			<view class="item ddflex">
 				<view class="label">电表度数</view>
 				<view class="item-input fflex">
-					13461.11 KWH
+					{{cabInfo.emKwh}}KWH
 				</view>
 			</view>
 			<view class="item ddflex">
+				<view class="label">仓门数量</view>
+				<view class="item-input fflex">
+					{{cabInfo.doorCount}}
+				</view>
+			</view>
+			<view class="item ddflex">
+				<view class="label">空仓数量</view>
+				<view class="item-input fflex">
+					{{cabInfo.nullDoorCount}}
+				</view>
+			</view>
+			<view class="item ddflex">
+				<view class="label">可用电池数量</view>
+				<view class="item-input fflex">
+					{{cabInfo.useDoorCount}}
+				</view>
+			</view>
+			<!-- <view class="item ddflex">
 				<view class="label">iccid</view>
 				<view class="item-input fflex">
 					89860469092190149474
@@ -67,17 +85,17 @@
 				<view class="item-input fflex">
 					V1.2
 				</view>
-			</view>
+			</view> -->
 			
 		</view>
 		
 		<!-- 保存按钮 -->
-		<view class="savepadding" style="height: 150rpx;"></view>
+		<!-- <view class="savepadding" style="height: 150rpx;"></view>
 		<view class="savepadding submit-box">
 			<view class="submit-btn" @click="jumpUrl('/machineAndCell/machineDetailEdit/machineDetailEdit')">
 				更改机柜地址
 			</view>
-		</view>
+		</view> -->
 		
 	</view>
 </template>
@@ -91,12 +109,13 @@
 		props: {},
 		data() {
 			return {
-				systems: {},
-				isTop:0,
+				id:null,
+				cabInfo:{}
 			}
 		},
 		onLoad(options) {
-			
+			this.id = options.id
+			this.getDataInfo()
 		},
 		onShow() {
 			
@@ -109,24 +128,16 @@
 					})
 				}
 			},
+			getDataInfo(){
+				req.getRequest('/admin/v2/cab/info',{devId:this.id},res=>{
+					this.cabInfo = res
+				})
+			}
 		},
 		mounted() {
-			const systemInfo = uni.getSystemInfoSync();
-			// px转换到rpx的比例
-			let pxToRpxScale = 750 / systemInfo.windowWidth;
-			let systems = {
-				ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
-				navigationHeight: 44 * pxToRpxScale // 导航栏的高度
-			};
-			systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
-			this.systems = systems;
+			
 		},
 		onPageScroll: function(e) {
-			if (e.scrollTop > this.systems.barHeight) {
-				this.isTop = 1;
-			} else {
-				this.isTop = 0;
-			}
 		}
 	}
 </script>

+ 21 - 0
machineAndCell/machineInfo/machineInfo.css

@@ -1,11 +1,13 @@
 .cell-item{
 	width: calc((100% - 20rpx) / 2);
+	height: 340rpx;
 	margin:30rpx 20rpx 0rpx 0;
 	background: #FFFFFF;
 	box-shadow: 0rpx 8rpx 40rpx 1rpx rgba(51,51,51,0.06);
 	border-radius: 20rpx 20rpx 20rpx 20rpx;
 	padding: 26rpx 27rpx 30rpx 30rpx;
 	box-sizing: border-box;
+	position: relative;
 }
 .cell-item:nth-child(2n){
 	margin-right: 0;
@@ -40,6 +42,25 @@
 	font-weight: normal;
 	color: #EB5C20;
 	text-align: center;
+	position: absolute;
+	bottom: 30rpx;
+	left: 30rpx;
+	right: 30rpx;
+}
+.kongcang{
+	width: 112rpx;
+	height: 112rpx;
+	opacity: 1;
+	border: 1px solid #A8A5A5;
+	margin: auto;
+	border-radius: 100%;
+	text-align: center;
+	line-height: 112rpx;
+	color: #A8A5A5;
+}
+.error-sta{
+	text-align: center;
+	color: #A8A5A5;
 }
 
 /* 按钮 */

+ 95 - 38
machineAndCell/machineInfo/machineInfo.vue

@@ -1,28 +1,52 @@
 <template>
 	<view>
 		<view style="padding:0 30rpx;" class="ddflex">
-			<view class="cell-item" v-for="item,index in 9">
-				<view class="cell-item-num">{{index}}</view>
-				<view class="ddflex">
-					<view style="margin-right: 13rpx;">
-						<cell :soc="index*10"></cell>
+			<view class="cell-item" v-for="item,index in groupList">
+				<view class="cell-item-num">{{item.doorId?item.doorId:0}}</view>
+				<block v-if="item.boxEnable==0">
+					<view class="error-sta" v-if="item.boxStatus==5">
+						异常
 					</view>
-					<view class="cell-item-info fflex">
-						<view class="cell-item-info-item ddflex">
-							<view>型号</view>
-							<view>60V 30Ah</view>
-						</view>
-						<view class="cell-item-info-item ddflex">
-							<view>电量</view>
-							<view>80%</view>
+					<view v-else-if="item.boxStatus==6">
+						电池通讯故障
+					</view>
+					<view class="error-sta">
+						禁用
+					</view>
+				</block>
+				<block v-else>
+					<view class="error-sta" v-if="item.boxStatus==5">
+						异常
+					</view>
+					<view class="error-sta" v-else-if="item.boxStatus==6">
+						电池通讯故障
+					</view>
+					<block v-else>
+						<view class="ddflex" v-if="item.boxStatus!=0&&item.batteryId">
+							<view style="margin-right: 13rpx;">
+								<cell :soc="item.soc"></cell>
+							</view>
+							<view class="cell-item-info fflex">
+								<view class="cell-item-info-item ddflex">
+									<view>型号</view>
+									<view>{{item.model}}</view>
+								</view>
+								<view class="cell-item-info-item ddflex">
+									<view>电量</view>
+									<view>{{item.soc}}%</view>
+								</view>
+								<view class="cell-item-info-item ddflex">
+									<view>电压</view>
+									<view>{{item.batVol}}V</view>
+								</view>
+							</view>
 						</view>
-						<view class="cell-item-info-item ddflex">
-							<view>电压</view>
-							<view>66.85V</view>
+						<view v-else class="kongcang">
+							空仓
 						</view>
-					</view>
-				</view>
-				<view class="cell-item-option" @click="jumpUrl('/machineAndCell/machineItemManage/machineItemManage')">仓位管理</view>
+					</block>
+				</block>
+				<view class="cell-item-option" @click="jumpUrl('/machineAndCell/machineItemManage/machineItemManage?id='+item.doorId+'&devId='+id)">仓位管理</view>
 			</view>
 		</view>
 		
@@ -30,8 +54,8 @@
 		<view class="bottom-btns savepadding">
 			<view class="ddflex" style="margin: 30rpx;justify-content: space-between;">
 				<view class="btn1" @click="jumpUrl('/warning/machineAlarm/machineAlarm')">故障告警</view>
-				<view class="btn1" @click="jumpUrl('/machineAndCell/machineDetail/machineDetail')">柜体信息</view>
-				<view class="btn2">刷新</view>
+				<view class="btn1" @click="jumpUrl('/machineAndCell/machineDetail/machineDetail?id='+id)">柜体信息</view>
+				<view class="btn2" @click="getDataList()">刷新</view>
 			</view>
 		</view>
 	</view>
@@ -49,16 +73,27 @@
 		props: {},
 		data() {
 			return {
-				systems: {},
-				isTop:0,
+				
+				id:null,
+				
+				groupList: [],
+				page: 1,
+				limit: 10,
+				searchValue:'',
+				isQuerying:false,//正在查询数据
+				
 			}
 		},
 		onLoad(options) {
-
+			this.id = options.id
+			this.getDataList()
 		},
 		onShow() {
 			
 		},
+		onReachBottom() {
+			this.getDataList(true)
+		},
 		methods: {
 			jumpUrl(url) {
 				if (req.isLogins(true)) {
@@ -67,24 +102,46 @@
 					})
 				}
 			},
+			getDataList(isPage) {
+				if(this.isQuerying) return
+				else this.isQuerying = true
+				if (!isPage) {
+					this.page = 1
+					uni.showLoading({
+						title:'加载中'
+					})
+				}
+				let queryParams = {
+					page: this.page,
+					limit: this.limit,
+				}
+				queryParams.devId = this.id
+				req.getRequest(
+					'/admin/v2/door/page',
+					queryParams,
+					data => {
+						if (data != null && data.list.length > 0) {
+							if (!isPage) {
+								this.groupList = data.list
+							} else {
+								this.groupList = this.groupList.concat(data.list)
+							}
+							this.page++
+						} else {
+							if (!isPage)
+								this.groupList = data.list
+							else {}
+						}
+						uni.hideLoading()
+						this.isQuerying = false
+					}
+				)
+			},
 		},
 		mounted() {
-			const systemInfo = uni.getSystemInfoSync();
-			// px转换到rpx的比例
-			let pxToRpxScale = 750 / systemInfo.windowWidth;
-			let systems = {
-				ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
-				navigationHeight: 44 * pxToRpxScale // 导航栏的高度
-			};
-			systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
-			this.systems = systems;
+			
 		},
 		onPageScroll: function(e) {
-			if (e.scrollTop > this.systems.barHeight) {
-				this.isTop = 1;
-			} else {
-				this.isTop = 0;
-			}
 		}
 	}
 </script>

+ 67 - 24
machineAndCell/machineItemManage/machineItemManage.vue

@@ -2,8 +2,8 @@
 	<view>
 		<view class="option-box">
 			<view class="option-time ddflex">
-				<view>更新时间: 2023-04-03 11:09:08</view>
-				<view class="refresh ddflex">
+				<view>更新时间: {{time}}</view>
+				<view class="refresh ddflex" @click="getState()">
 					<image src="../../static/pages/images/refresh.png"></image>
 					<text>刷新</text>
 				</view>
@@ -11,9 +11,9 @@
 			<view class="ddflex state">
 				<view class="ddflex">
 					<view>仓位状态:</view>
-					<view style="color: #A8A5A5;">启用</view>
+					<view style="color: #A8A5A5;">{{doorInfo.boxEnable==1?'启用':'禁用'}}</view>
 				</view>
-				<switch style="transform: scale(0.6);" color="#FF753A"></switch>
+				<switch style="transform: scale(0.6);" :checked="doorInfo.boxEnable" color="#FF753A" @change="boxEnableChange"></switch>
 			</view>
 		</view>
 		<view class="note">关闭后,仓门将禁用,用户无法打开</view>
@@ -21,7 +21,7 @@
 		
 		<view style="height: 165rpx;" class="savepadding"></view>
 		<view class="bottom-btns savepadding">
-			<view class="btn" @click="jumpUrl('/warning/machineAlarm/machineAlarm')">一键开门</view>
+			<view class="btn" @click="open">一键开门</view>
 		</view>
 	</view>
 </template>
@@ -29,42 +29,85 @@
 <script>
 	const app = getApp();
 	const req = require("../../utils/request.js");
+	const utils = require("../../utils/util");
 
 	export default {
 		components: {},
 		props: {},
 		data() {
 			return {
-				systems: {},
-				isTop:0,
+				id:null,//仓门id
+				devId:null,//机柜id
+				doorInfo:{},
+				time:''
 			}
 		},
-		onLoad(options) {
-
+		async onLoad(options) {
+			this.id = options.id
+			this.devId = options.devId
+			await this.getState()
 		},
 		onShow() {
 			
 		},
 		methods: {
-			
+			getState(){
+				return new Promise((r,j)=>{
+					uni.showLoading({
+						title:'加载中'
+					})
+					req.getRequest('/admin/v2/door/info',{devId:this.devId,doorId:this.id},res=>{
+						this.doorInfo = res
+						this.time = utils.formatTime(new Date()).t1
+						uni.hideLoading()
+					})
+				})
+			},
+			boxEnableChange(event){
+				this.doorInfo.boxEnable = event.detail.value
+				uni.showModal({
+					title:'提示',
+					content:event.detail.value?'确定启用该仓门?':'确定禁用该仓门?',
+					success: (r) => {
+						if(r.confirm){
+							uni.showLoading({
+								title:event.detail.value?'启用中':'禁用中',
+							})
+							req.postRequest('/admin/v2/cab/ableDoor',{devId:this.devId,doorId:this.id,cabEnable:event.detail.value?1:0},res=>{
+								uni.hideLoading()
+								if(res){
+									req.msg(event.detail.value?'启用成功':'禁用成功')
+								}else {
+									req.msg(event.detail.value?'启用失败':'禁用失败')
+									this.doorInfo.boxEnable = !this.doorInfo.boxEnable
+								}
+							})
+						}else{
+							this.doorInfo.boxEnable = !this.doorInfo.boxEnable
+						}
+						
+					}
+				})
+			},
+			open(){
+				uni.showLoading({
+					title:'开门中',
+				})
+				req.postRequest('/admin/v2/cab/openDoor',{devId:this.devId,doorId:this.id},res=>{
+					uni.hideLoading()
+					if(res){
+						req.msg('操作成功')
+					}else {
+						req.msg('操作失败')
+					}
+				})
+			}
 		},
 		mounted() {
-			const systemInfo = uni.getSystemInfoSync();
-			// px转换到rpx的比例
-			let pxToRpxScale = 750 / systemInfo.windowWidth;
-			let systems = {
-				ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
-				navigationHeight: 44 * pxToRpxScale // 导航栏的高度
-			};
-			systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
-			this.systems = systems;
+			
 		},
 		onPageScroll: function(e) {
-			if (e.scrollTop > this.systems.barHeight) {
-				this.isTop = 1;
-			} else {
-				this.isTop = 0;
-			}
+			
 		}
 	}
 </script>

+ 73 - 6
mine/myUser/myUser.vue

@@ -9,15 +9,17 @@
 		</view>
 		<view style="height: 135rpx;"></view>
 		<view>
-			<view class="user-item ddflex" v-for="item in 10">
+			<view class="user-item ddflex" v-for="item,index in groupList">
 				<view class="ddflex">
 					<image class="user-header" src="../../static/images/userimg.png"></image>
 					<view class="fflex">
-						<view class="user-nickName">灰灰莫</view>
-						<view class="user-phone">顾勇(13815141671)</view>
+						<view class="user-nickName">{{item.nickName}}</view>
+						<view class="user-phone">{{item.realName?item.realName:''}}<text v-if="item.mobile">({{item.mobile}})</text></view>
 					</view>
 				</view>
-				<view class="option-btn">禁用</view>
+				<view class="option-btn" v-if="item.status==1" @click="jinyong(2,item,index)">禁用</view>
+				<view class="option-btn" v-else-if="item.status==2" @click="jinyong(1,item,index)">已禁用</view>
+				<view class="option-btn" v-else-if="item.status==3">黑名单</view>
 			</view>
 		</view>
 
@@ -35,16 +37,81 @@
 			return {
 				systems: {},
 				isTop:0,
+				
+				groupList: [],
+				page: 1,
+				limit: 10,
+				searchValue:'',
+				isQuerying:false,//正在查询数据
 			}
 		},
 		onLoad(options) {
-
+			this.getDataList()
 		},
 		onShow() {
 			
 		},
+		onReachBottom() {
+			this.getDataList(true)
+		},
 		methods: {
-			
+			getDataList(isPage) {
+				if(this.isQuerying) return
+				else this.isQuerying = true
+				if (!isPage) {
+					this.page = 1
+				}
+				let queryParams = {
+					page: this.page,
+					limit: this.limit,
+				}
+				if(this.searchValue){
+					queryParams.name=this.searchValue
+				}
+				req.getRequest(
+					'/admin/v2/user/page',
+					queryParams,
+					data => {
+						if (data != null && data.list.length > 0) {
+							if (!isPage) {
+								this.groupList = data.list
+							} else {
+								this.groupList = this.groupList.concat(data.list)
+							}
+							this.page++
+						} else {
+							if (!isPage)
+								this.groupList = data.list
+							else {}
+						}
+						uni.hideLoading()
+						this.isQuerying = false
+					}
+				)
+			},
+			jinyong(type,item,index){
+				uni.showModal({
+					title:'提示',
+					content:type==1?'确定解除该用户禁用?':'确定禁用该用户?',
+					success: (res) => {
+						if(res.confirm){
+							let dataP = {
+								id:item.id,
+								type:type
+							}
+							req.getRequest('/admin/v2/user/disable',dataP,res=>{
+								if(type==1){
+									this.groupList[index].status=1
+									req.msg('已解除禁用')
+								}else{
+									this.groupList[index].status=2
+									req.msg('已禁用')
+								}
+							})
+						}
+					}
+				})
+			}
 		},
 		mounted() {
 			

+ 2 - 1
pages.json

@@ -33,7 +33,8 @@
 		{
 			"path": "pages/order/order",
 			"style": {
-				"navigationBarTitleText": "订单"
+				"navigationBarTitleText": "订单",
+				"navigationStyle": "custom"
 			}
 		},
 		{

+ 42 - 0
pages/cell/cell.css

@@ -143,4 +143,46 @@
 	font-weight: 500;
 	color: #333333;
 	text-align: center;
+}
+
+/* 弹窗 */
+.pop-title{
+	line-height: 54rpx;
+	font-size: 36rpx;
+	font-family: Source Han Sans CN-Medium, Source Han Sans CN;
+	font-weight: 500;
+	color: #333333;
+	margin-left:30rpx ;
+}
+.change-ssicon{
+	width: 48rpx;
+	height: 48rpx;
+	margin-left: 10rpx;
+}
+.pop-content{
+	margin: 48rpx 30rpx 30rpx;
+	overflow: scroll;
+	width: calc(100% - 60rpx);
+}
+.pop-content::-webkit-scrollbar{
+	display: none;
+}
+.pop-content-item{
+	height: 108rpx;
+	line-height: 108rpx;
+	background: #F5F5F5;
+	border-radius: 10rpx 10rpx 10rpx 10rpx;
+	opacity: 1;
+	border: 2rpx solid #F5F5F5;
+	padding: 0 30rpx;
+	margin-bottom: 28rpx;
+}
+.pop-content-active{
+	background: #fff;
+	border: 2rpx solid #EB5C20;
+}
+.pop-content-icon{
+	width: 12rpx;
+	height: 19rpx;
+	margin-left: 10rpx;
 }

+ 140 - 5
pages/cell/cell.vue

@@ -2,8 +2,8 @@
 	<view>
 		<view class="top-box">
 			<view class="top-title">
-				<view class="ddflex" :style="'height: '+ systems.navigationHeight + 'rpx;padding-top:' + systems.ktxStatusHeight + 'rpx;'+'line-height: '+ systems.navigationHeight + 'rpx;'">
-					<view>白云科技门店</view>
+				<view v-if="!userInfo.storeId" @click="showPop=true" class="ddflex" :style="'height: '+ systems.navigationHeight + 'rpx;padding-top:' + systems.ktxStatusHeight + 'rpx;'+'line-height: '+ systems.navigationHeight + 'rpx;'">
+					<view>{{actMerchant.name}}</view>
 					<image class="dow-ssicon" src="../../static/pages/images/dow-ssicon.png"></image>
 				</view>
 			</view>
@@ -94,6 +94,21 @@
 			</view>
 		</view>
 
+		<left-pop v-if="showPop" :showPop="showPop" :btnColor="'#11BB8B'" :showBtn='false' title="解除提醒" width="460rpx"
+			@closePop="closePop()" @popSubmit="popSubmit()">
+			<view class="" style="height: 100%;flex-direction: column;display: flex;">
+				<view @click="closePop()" class="pop-title ddflex" :style="'height: '+ systems.navigationHeight + 'rpx;padding-top:' + systems.ktxStatusHeight + 'rpx;'+'line-height: '+ systems.navigationHeight + 'rpx;'">
+					<view>切换门店</view>
+					<image class="change-ssicon" src="../../static/pages/images/change.png"></image>
+				</view>
+				<scroll-view :scroll-y="true" @scrolltolower="loadLeftData" class="pop-content fflex">
+					<view :class="'pop-content-item '+(actMerchant.id==item.id?'pop-content-active':'')" v-for="(item,index) in merchantList" @click="changePop(item)">
+						<view class="pop-content-name">{{item.name}}</view>
+						<image class="pop-content-icon" src=""></image>
+					</view>
+				</scroll-view>
+			</view>
+		</left-pop>
 
 		<foot channel="cell" :isUpdate="isUpdate"></foot>
 	</view>
@@ -104,11 +119,13 @@
 	const req = require("../../utils/request.js");
 	import cell from "../../components/cell/index";
 	import foot from "../../components/nav-bar/index";
+	import leftPop from "../../components/left-pop/index";
 
 	export default {
 		components: {
 			cell,
-			foot
+			foot,
+			leftPop
 		},
 		props: {},
 		data() {
@@ -116,15 +133,44 @@
 				systems: {},
 				isTop:0,
 				
-				queryType:1
+				userInfo:{},
+				
+				showPop: false,
+				tempData: null,
+				
+				groupList: [],
+				page: 1,
+				limit: 10,
+				searchValue:'',
+				isQuerying:false,//正在查询数据
+				
+				queryType:1,
+				
+				merchantList: [],
+				merchantPage: 1,
+				merchantLimit: 10,
+				
+				actMerchant:null,//当前门店
 			}
 		},
 		onLoad(options) {
-
+			// 判断当前登录用户身份
+			if(req.isLogins(true)){
+				this.userInfo = req.getStorage('userInfo')
+				
+				if(!this.userInfo.storeId){
+					this.getMerchantList()
+				}
+			}else{
+				this.getMachineList()
+			}
 		},
 		onShow() {
 			
 		},
+		onReachBottom() {
+			this.getMachineList(true)
+		},
 		methods: {
 			jumpUrl(url){
 				if(req.isLogins(true)){
@@ -136,6 +182,95 @@
 			queryTypeChange(val) {
 				if (this.queryType == val) return false
 				this.queryType = val
+				this.getMachineList()
+			},
+			// 弹窗弹出
+			openPop(item) {
+				this.tempData = JSON.parse(JSON.stringify(item))
+				this.showPop = true
+			},
+			closePop(){
+				this.showPop = false
+			},
+			changePop(item){
+				this.actMerchant = item
+				this.closePop()
+				this.getMachineList()
+			},
+			// 获取电池列表
+			getMachineList(isPage){
+				if(this.isQuerying) return
+				else this.isQuerying = true
+				if (!isPage) {
+					this.page = 1
+				}
+				let queryParams = {
+					page: this.page,
+					limit: this.limit,
+				}
+				if(this.searchValue){
+					queryParams.devId=this.searchValue
+				}
+				queryParams.storeId = this.actMerchant.id
+				req.getRequest(
+					'/admin/v2/cab/page',
+					queryParams,
+					data => {
+						if (data != null && data.list.length > 0) {
+							if (!isPage) {
+								this.groupList = data.list
+							} else {
+								this.groupList = this.groupList.concat(data.list)
+							}
+							this.page++
+						} else {
+							if (!isPage)
+								this.groupList = data.list
+							else {}
+						}
+						uni.hideLoading()
+						this.isQuerying = false
+					}
+				)
+			},
+			loadLeftData(res){
+				this.getMerchantList(true)
+			},
+			getMerchantList(isPage){
+				if (!isPage) {
+					this.merchantPage = 1
+				}
+				let queryParams = {
+					page: this.merchantPage,
+					limit: this.merchantLimit,
+				}
+				queryParams.merchantId = req.getStorage('userInfo').merchantId?req.getStorage('userInfo').merchantId:null
+				req.getRequest(
+					'/admin/v2/store/page',
+					queryParams,
+					data => {
+						if (data != null && data.list.length > 0) {
+							if (!isPage) {
+								this.merchantList = data.list
+							} else {
+								this.merchantList = this.merchantList.concat(data.list)
+							}
+							this.merchantPage++
+						} else {
+							if (!isPage)
+								this.merchantList = data.list
+							else {}
+						}
+						if(!isPage){
+							if(this.actMerchant){
+								
+							}else{
+								this.actMerchant = this.merchantList[0]
+							}
+							this.getMachineList()
+						}
+					}
+				)
 			},
 		},
 		mounted() {

+ 28 - 12
pages/machine/machine.vue

@@ -20,7 +20,7 @@
 		<view :style="'height: '+ (systems.navigationHeight+systems.ktxStatusHeight+134) + 'rpx;'"></view>
 		
 		<!-- 机柜 -->
-		<view class="machine-item" v-for="item,index in groupList" @click="jumpUrl('/machineAndCell/machineInfo/machineInfo')">
+		<view class="machine-item" v-for="item,index in groupList" @click="jumpUrl('/machineAndCell/machineInfo/machineInfo?id='+item.devId)">
 			<view class="ddflex" style="justify-content: space-between;">
 				<view class="machine-title fflex tover">{{item.devName}}</view>
 				<view class="state">在线</view>
@@ -28,18 +28,18 @@
 			<view class="machine-number">机柜编号:{{item.devId}}</view>
 			<view class="machine-info ddflex">
 				<view class="ddflex">
-					<view class="margin-r40">温度:{{item.cabTemp}}℃</view>
-					<view class="margin-r40">仓门数:{{item.doorCount}}</view>
-					<view class="margin-r40">电池数:{{item.batNum}}</view>
+					<view class="margin-r40">温度:{{item.cabTemp?item.cabTemp:0}}℃</view>
+					<view class="margin-r40">仓门数:{{item.doorCount?item.doorCount:0}}</view>
+					<view class="margin-r40">电池数:{{item.batNum?item.batNum:0}}</view>
 				</view>
 				<view class="fflex tover" style="color: #2A82E4;text-align: right;">
-					{{item.storeName}}
+					{{item.storeName?item.storeName:''}}
 				</view>
 			</view>
 			<view class="address-box ddflex">
 				<image class="address-icon" src="../../static/pages/images/address-icon.png"></image>
 				<view class="fflex tover">{{item.address}}</view>
-				<image class="daohang" src="../../static/pages/images/daohang.png"></image>
+				<image @click.stop="toLocation(item)" class="daohang" src="../../static/pages/images/daohang.png"></image>
 			</view>
 		</view>
 		
@@ -82,7 +82,6 @@
 				isUpdate: false,
 				
 				userInfo:{},
-				userType:0,//0管理员 1商家 2门店
 				
 				showPop: false,
 				tempData: null,
@@ -97,7 +96,7 @@
 				merchantPage: 1,
 				merchantLimit: 10,
 				
-				actMerchant:{},//当前门店
+				actMerchant:null,//当前门店
 			}
 		},
 		onLoad(options) {
@@ -117,6 +116,9 @@
 				isUpdate: !this.isUpdate
 			}); 
 		},
+		onReachBottom() {
+			this.getMachineList(true)
+		},
 		methods: {
 			jumpUrl(url){
 				if(req.isLogins(true)){
@@ -135,7 +137,6 @@
 			},
 			changePop(item){
 				this.actMerchant = item
-				req.setStorage('default_merchant',item)
 				this.closePop()
 				this.getMachineList()
 			},
@@ -204,8 +205,8 @@
 							else {}
 						}
 						if(!isPage){
-							if(req.getStorage('default_merchant')){
-								this.actMerchant = req.getStorage('default_merchant')
+							if(this.actMerchant){
+								
 							}else{
 								this.actMerchant = this.merchantList[0]
 							}
@@ -213,7 +214,22 @@
 						}
 					}
 				)
-			}
+			},
+			toLocation(item) {
+				let plugin = requirePlugin('routePlan');
+				let key = req.public.mapLBSKEY; //使用在腾讯位置服务申请的key
+				let referer = '皮小店商家端'; //调用插件的app的名称
+				// console.log("名称====" + referer);
+				let endPoint = JSON.stringify({
+					//终点
+					'name': item.devName,
+					'latitude': item.latitude,
+					'longitude':item.longitude
+				});
+				uni.navigateTo({
+					url: 'plugin://routePlan/index?key=' + key + '&referer=' + referer + '&endPoint=' + endPoint
+				});
+			},
 		},
 		mounted() {
 			const systemInfo = uni.getSystemInfoSync();

+ 64 - 3
pages/order/order.css

@@ -1,10 +1,29 @@
-.tab-box{
+.top-box{
 	background-color: #fff;
-	padding: 30rpx;
 	position: fixed;
+	top: 0;
 	left: 0;
 	right: 0;
-	top: 0;
+	z-index: 100;
+}
+.top-box{
+	background-color: #fff;
+}
+.top-title{
+	font-size: 36rpx;
+	font-family: Source Han Sans CN-Medium, Source Han Sans CN;
+	font-weight: 500;
+	color: #333333;
+	padding: 0 30rpx;
+}
+.dow-ssicon{
+	width: 36rpx;
+	height: 36rpx;
+	margin-left: 15rpx;
+}
+.tab-box{
+	background-color: #fff;
+	padding: 30rpx;
 	z-index: 100;
 }
 .tab-item{
@@ -107,4 +126,46 @@
 	font-size: 28rpx;
 	font-weight: normal;
 	color: #FFFFFF;
+}
+
+/* 弹窗 */
+.pop-title{
+	line-height: 54rpx;
+	font-size: 36rpx;
+	font-family: Source Han Sans CN-Medium, Source Han Sans CN;
+	font-weight: 500;
+	color: #333333;
+	margin-left:30rpx ;
+}
+.change-ssicon{
+	width: 48rpx;
+	height: 48rpx;
+	margin-left: 10rpx;
+}
+.pop-content{
+	margin: 48rpx 30rpx 30rpx;
+	overflow: scroll;
+	width: calc(100% - 60rpx);
+}
+.pop-content::-webkit-scrollbar{
+	display: none;
+}
+.pop-content-item{
+	height: 108rpx;
+	line-height: 108rpx;
+	background: #F5F5F5;
+	border-radius: 10rpx 10rpx 10rpx 10rpx;
+	opacity: 1;
+	border: 2rpx solid #F5F5F5;
+	padding: 0 30rpx;
+	margin-bottom: 28rpx;
+}
+.pop-content-active{
+	background: #fff;
+	border: 2rpx solid #EB5C20;
+}
+.pop-content-icon{
+	width: 12rpx;
+	height: 19rpx;
+	margin-left: 10rpx;
 }

+ 178 - 35
pages/order/order.vue

@@ -1,54 +1,62 @@
 <template>
 	<view>
-		<!-- tab -->
-		<view class="tab-box ddflex">
-			<view class="fflex ddflex">
-				<view :class="'tab-item fflex '+(queryType==1?'tab-item-active':'')" @click="queryTypeChange(1)">
-					<view>待确认</view>
-					<image class="tab-active-icon" src="../../static/images/tab_cur.png"></image>
+		<view class="top-box">
+			<view class="top-title">
+				<view v-if="!userInfo.storeId" @click="showPop=true" class="ddflex" :style="'height: '+ systems.navigationHeight + 'rpx;padding-top:' + systems.ktxStatusHeight + 'rpx;'+'line-height: '+ systems.navigationHeight + 'rpx;'">
+					<view>{{actMerchant.name}}</view>
+					<image class="dow-ssicon" src="../../static/pages/images/dow-ssicon.png"></image>
 				</view>
-				<view :class="'tab-item fflex '+(queryType==2?'tab-item-active':'')" @click="queryTypeChange(2)">
-					<view>已完成</view>
-					<image class="tab-active-icon" src="../../static/images/tab_cur.png"></image>
+			</view>
+			<view class="tab-box ddflex">
+				<view class="fflex ddflex">
+					<view :class="'tab-item fflex '+(queryType==1?'tab-item-active':'')" @click="queryTypeChange(1)">
+						<view>未完成</view>
+						<image class="tab-active-icon" src="../../static/images/tab_cur.png"></image>
+					</view>
+					<view :class="'tab-item fflex '+(queryType==2?'tab-item-active':'')" @click="queryTypeChange(2)">
+						<view>已完成</view>
+						<image class="tab-active-icon" src="../../static/images/tab_cur.png"></image>
+					</view>
+					<view :class="'tab-item fflex '+(!queryType?'tab-item-active':'')" @click="queryTypeChange(-1)">
+						<view>全部</view>
+						<image class="tab-active-icon" src="../../static/images/tab_cur.png"></image>
+					</view>
 				</view>
-				<view :class="'tab-item fflex '+(queryType==3?'tab-item-active':'')" @click="queryTypeChange(3)">
-					<view>全部</view>
-					<image class="tab-active-icon" src="../../static/images/tab_cur.png"></image>
+				<view class="ddflex">
+					<image class="saoma" src="../../static/pages/images/saoma.png"></image>
+					<image class="sousuo" src="../../static/pages/images/search.png"></image>
 				</view>
 			</view>
-			<view class="ddflex">
-				<image class="saoma" src="../../static/pages/images/saoma.png"></image>
-				<image class="sousuo" src="../../static/pages/images/search.png"></image>
-			</view>
 		</view>
-		<view style="height: 110rpx;"></view>
+		
+		<view :style="'height: '+ (systems.navigationHeight+systems.ktxStatusHeight+106) + 'rpx;'"></view>
 		
 		<!-- 订单 -->
 		<view>
-			<view class="order-item" v-for="item,index in 10" @click="jumpUrl('/pages/orderDetail/orderDetail?id='+item)">
+			<view class="order-item" v-for="item,index in groupList" @click="jumpUrl('/pages/orderDetail/orderDetail?id='+item)">
 				<view class="ddflex order-item-header">
-					<view class="order-time">2023-03-29 12:05:58</view>
-					<block>
+					<view class="order-time">{{item.createDate}}</view>
+					<!-- <block>
 						<view v-if="index!=1" class="order-state">线下-待确认</view>
 						<view v-else class="order-state" style="color: #0FCB27;">微信-支付成功</view>
-					</block>
+					</block> -->
 				</view>
 				<view class="order-item-body">
 					<view class="order-item-content ddflex">
 						<view class="order-item-content-label">订单编号</view>
-						<view class="order-item-content-data fflex tover">159582346324325171424</view>
+						<view class="order-item-content-data fflex tover">{{item.orderNo}}</view>
 					</view>
 					<view class="order-item-content ddflex">
 						<view class="order-item-content-label">门店名称</view>
-						<view class="order-item-content-data fflex tover">白云科技</view>
+						<view class="order-item-content-data fflex tover">{{item.storeName}}</view>
 					</view>
 					<view class="order-item-content ddflex">
 						<view class="order-item-content-label">租借机柜</view>
-						<view class="order-item-content-data fflex tover">CHZD04TTCC200329109</view>
+						<view class="order-item-content-data fflex tover">{{item.leaseDevId}}</view>
 					</view>
 					<view class="order-item-content ddflex">
 						<view class="order-item-content-label">电池ID</view>
-						<view class="order-item-content-data fflex tover">613880983244</view>
+						<view class="order-item-content-data fflex tover">{{item.batteryId}}</view>
 					</view>
 					<view class="order-item-content ddflex">
 						<view class="order-item-content-label">电池型号</view>
@@ -56,23 +64,38 @@
 					</view>	
 					<view class="order-item-content ddflex">
 						<view class="order-item-content-label">租赁用户</view>
-						<view class="order-item-content-data fflex tover">文涛 15200809658</view>
+						<view class="order-item-content-data fflex tover">{{item.realName}} {{item.phone}}</view>
 					</view>
 					<view class="order-item-content ddflex">
 						<view class="order-item-content-label">租借时长</view>
-						<view class="order-item-content-data fflex tover">8小时</view>
+						<view class="order-item-content-data fflex tover">{{item.time}}小时</view>
 					</view>
 					<view class="order-item-content ddflex">
 						<view class="order-item-content-label">应付金额</view>
-						<view class="order-item-content-data fflex tover" style="color: #EB5C20;">3元</view>
+						<view class="order-item-content-data fflex tover" style="color: #EB5C20;">{{item.payMoney}}元</view>
 					</view>
 				</view>
-				<view v-if="index!=1" class="order-btns ddflex">
+				<!-- <view v-if="index!=1" class="order-btns ddflex">
 					<view class="order-btn" @click.stop="">确认支付</view>
-				</view>
+				</view> -->
 			</view>
 		</view>
 		
+		<left-pop v-if="showPop" :showPop="showPop" :btnColor="'#11BB8B'" :showBtn='false' title="解除提醒" width="460rpx"
+			@closePop="closePop()" @popSubmit="popSubmit()">
+			<view class="" style="height: 100%;flex-direction: column;display: flex;">
+				<view @click="closePop()" class="pop-title ddflex" :style="'height: '+ systems.navigationHeight + 'rpx;padding-top:' + systems.ktxStatusHeight + 'rpx;'+'line-height: '+ systems.navigationHeight + 'rpx;'">
+					<view>切换门店</view>
+					<image class="change-ssicon" src="../../static/pages/images/change.png"></image>
+				</view>
+				<scroll-view :scroll-y="true" @scrolltolower="loadLeftData" class="pop-content fflex">
+					<view :class="'pop-content-item '+(actMerchant.id==item.id?'pop-content-active':'')" v-for="(item,index) in merchantList" @click="changePop(item)">
+						<view class="pop-content-name">{{item.name}}</view>
+						<image class="pop-content-icon" src=""></image>
+					</view>
+				</scroll-view>
+			</view>
+		</left-pop>
 		
 		<foot channel="order" :isUpdate="isUpdate"></foot>
 	</view>
@@ -82,26 +105,54 @@
 	const app = getApp();
 	const req = require("../../utils/request.js");
 	import foot from "../../components/nav-bar/index";
+	import leftPop from "../../components/left-pop/index";
 
 	export default {
 		components: {
-			foot
+			foot,
+			leftPop
 		},
 		props: {},
 		data() {
 			return {
 				systems: {},
-				isTop: 0,
-
+				isTop:0,
+				
+				showPop: false,
+				tempData: null,
+				
 				queryType: 1,
+				
+				groupList: [],
+				page: 1,
+				limit: 10,
+				searchValue:'',
+				isQuerying:false,//正在查询数据
+				
+				merchantList: [],
+				merchantPage: 1,
+				merchantLimit: 10,
+				
+				actMerchant:null,//当前门店
 			}
 		},
 		onLoad(options) {
-
+			if(req.isLogins(true)){
+				this.userInfo = req.getStorage('userInfo')
+				
+				if(!this.userInfo.storeId){
+					this.getMerchantList()
+				}
+			}else{
+				this.getDataList()
+			}
 		},
 		onShow() {
 
 		},
+		onReachBottom() {
+			this.getDataList(true)
+		},
 		methods: {
 			jumpUrl(url) {
 				if (req.isLogins(true)) {
@@ -112,7 +163,99 @@
 			},
 			queryTypeChange(val) {
 				if (this.queryType == val) return false
-				this.queryType = val
+				this.queryType = val==-1?'':val
+				this.getDataList()
+			},
+			// 弹窗弹出
+			openPop(item) {
+				this.tempData = JSON.parse(JSON.stringify(item))
+				this.showPop = true
+			},
+			closePop(){
+				this.showPop = false
+			},
+			changePop(item){
+				this.actMerchant = item
+				this.closePop()
+				this.getDataList()
+			},
+			getDataList(isPage) {
+				if(this.isQuerying) return
+				else this.isQuerying = true
+				if (!isPage) {
+					this.page = 1
+				}
+				let queryParams = {
+					page: this.page,
+					limit: this.limit,
+				}
+				if(this.searchValue){
+					queryParams.name=this.searchValue
+				}
+				queryParams.type = this.queryType
+				queryParams.storeId = this.actMerchant.id
+				req.getRequest(
+					'/admin/v2/order/page',
+					queryParams,
+					data => {
+						if (data != null && data.list.length > 0) {
+							if (!isPage) {
+								this.groupList = data.list
+							} else {
+								this.groupList = this.groupList.concat(data.list)
+							}
+							this.page++
+						} else {
+							if (!isPage)
+								this.groupList = data.list
+							else {}
+						}
+						uni.hideLoading()
+						this.isQuerying = false
+					}
+				)
+			},
+			loadLeftData(res){
+				this.getMerchantList(true)
+			},
+			getMerchantList(isPage){
+				if (!isPage) {
+					this.merchantPage = 1
+				}
+				let queryParams = {
+					page: this.merchantPage,
+					limit: this.merchantLimit,
+				}
+				queryParams.merchantId = req.getStorage('userInfo').merchantId?req.getStorage('userInfo').merchantId:null
+				req.getRequest(
+					'/admin/v2/store/page',
+					queryParams,
+					data => {
+						if (data != null && data.list.length > 0) {
+							if (!isPage) {
+								this.merchantList = data.list
+							} else {
+								this.merchantList = this.merchantList.concat(data.list)
+							}
+							this.merchantPage++
+						} else {
+							if (!isPage)
+								this.merchantList = data.list
+							else {}
+						}
+						if(!isPage){
+							if(this.actMerchant){
+								
+							}else{
+								this.actMerchant = this.merchantList[0]
+							}
+							this.getDataList()
+						}
+					}
+				)
+			},
+			searchFn(){
+				this.getDataList()
 			},
 		},
 		mounted() {

+ 1 - 1
utils/request.js

@@ -28,7 +28,7 @@ const publics = {
 	'storemanagers': 'https://websmall.zhiqiyun.com?appId=', //saas门店管理地址(智企云所有)
 	'channel': '', //处方中间渠道号  SAAS系统为空
 	'is_customer_pick_up': false,
-	'mapLBSKEY': 'YQZBZ-6LMC4-IGQUO-XE64O-4UJL6-YNB77',
+	'mapLBSKEY': 'I52BZ-OXYKJ-PWMFN-XWADQ-WR775-XTBQE',
 	'iconSrc': 'red/',
 	'titleTopBgColor': '#EB692F',
 }