瀏覽代碼

订单+运营数据+关于+反馈

xhj 3 年之前
父節點
當前提交
5871c367c5

+ 2 - 2
components/left-pop/index.css

@@ -7,7 +7,7 @@
 .ddinfo .li input{flex: 1;-webkit-flex: 1;font-size: 28rpx;color: #333;text-align: right;}
 .textarea{background: #f5f5f5;border-radius: 10rpx;margin-top: 20rpx;width: 100%;padding: 15rpx;box-sizing: border-box;height: 120rpx;font-size: 28rpx;color: #333;}
 .placeholder{color: #ccc;}
-.confirmation-bar{position: fixed;z-index: 100;left: 0;top: 0;bottom: 0;background: #fff;border-radius: 0rpx 0rpx 0 0;padding: 0rpx 0rpx 0rpx;width: 60%;height: 100%;}
+.confirmation-bar{position: fixed;z-index: 1000;left: 0;top: 0;bottom: 0;background: #fff;border-radius: 0rpx 0rpx 0 0;padding: 0rpx 0rpx 0rpx;width: 60%;height: 100%;}
 .pop-title{font-size:30rpx;padding:10rpx 50rpx 20rpx 50rpx;color:#263343;border-bottom:1rpx solid #eeeeee;}
 .pop-close{position: absolute;right: 40rpx;top: 25rpx;font-size: 40rpx;}
 .pop-content{}
@@ -15,4 +15,4 @@
 .pop-btn-cancal{flex:0 0 40%;border-radius: 40rpx;background-color: #fff;height: 80rpx;line-height: 80rpx;color: #666;text-align: center;border:1rpx solid #666;}
 .pop-btn-submit{flex:0 0 40%;border-radius: 40rpx;background-color: #009AFF;height: 80rpx;line-height: 80rpx;color: #fff;text-align: center;border:1rpx solid #009AFF;}
 
-.mask{background-color:#000;opacity: 0.68;width: 100vw;height: 100vh;z-index: 99;}
+.mask{background-color:#000;opacity: 0.68;width: 100vw;height: 100vh;z-index: 999;}

+ 2 - 2
mine/feedback/feedback.vue

@@ -33,7 +33,7 @@ export default {
   components: {},
   props: {},
   onLoad: function (options) {
-    this.getData();
+    // this.getData();
   },
   methods: {
     intText(e) {
@@ -80,7 +80,7 @@ export default {
         return false;
       }
 
-      req.postRequest('/api/feedback', {
+      req.postRequest('/admin/v2/user/feedback', {
         name: that.name,
         mobile: that.mobile,
         text: that.text

+ 6 - 3
mine/myUser/myUser.vue

@@ -3,8 +3,8 @@
 		<view class="search-box ddflex">
 			<view class="search-input ddflex fflex">
 				<image class="search-input-icon" src="../../static/pages/images/search.png"></image>
-				<input class="fflex"  placeholder="请输入用户昵称或电话"/>
-				<view class="search-btn">搜索</view>
+				<input class="fflex" v-model="searchValue" confirm-type="search" @confirm="searchFn"  placeholder="请输入用户昵称或电话"/>
+				<view class="search-btn" @click="searchFn">搜索</view>
 			</view>
 		</view>
 		<view style="height: 135rpx;"></view>
@@ -111,7 +111,10 @@
 						}
 					}
 				})
-			}
+			},
+			searchFn(){
+				this.getDataList()
+			},
 		},
 		mounted() {
 			

+ 95 - 76
mine/page/page.vue

@@ -1,91 +1,110 @@
 <template>
 	<view>
 		<!--mine/page/page.wxml-->
-		<view class="title" v-if="title">{{ title }}</view>
-		<view class="content"><rich-text :nodes="params"></rich-text></view>
+		<view class="title" v-if="title&&!isHetong">{{ title }}</view>
+		<view class="" style="padding: 30rpx 30rpx 50rpx;" v-if="isHetong">
+			<rich-text :nodes="params"></rich-text>
+		</view>
+		<view class="content" v-else>
+			<rich-text :nodes="params"></rich-text>
+		</view>
 	</view>
 </template>
 
 <script>
-// mine/page/page.js
-const app = getApp();
-const req = require('../../utils/request.js');
+	// mine/page/page.js
+	const app = getApp();
+	const req = require('../../utils/request.js');
+	const util = require('../../utils/util')
 
-export default {
-	data() {
-		return {
-			title: '',
-			isXieyi: false, //用户协议
-			isYinsi: false, //隐私政策
-			isOpen: false,
-			isGroup: false,
-			params: ''
-		};
-	},
+	export default {
+		data() {
+			return {
+				title: '',
+				isXieyi: false, //用户协议
+				isYinsi: false, //隐私政策
+				isHetong: false, //合同
+				params: '',
+				hetongId: null
+			};
+		},
 
-	components: {},
-	props: {},
-	onLoad: function(options) {
-		this.id = options.id;
-		if (options.isXieyi) {
-			this.isXieyi = true;
-		}
-		if (options.isYinsi) {
-			this.isYinsi = true;
-		}
-		if (options.isOpen) {
-			this.isOpen = true;
-		}
-		if (options.isGroup) {
-			this.isGroup = true;
-		}
-
-		this.title = options.title;
-		// if (this.title) {
-		// 	uni.setNavigationBarTitle({
-		// 		title: this.title
-		// 	});
-		// }
-		this.getData();
-	},
-	methods: {
-		getData() {
-			var that = this;
-			let url = false;
-			let form = {};
-
-			if (that.isXieyi) {
-				url = '/api/protocol';
-			} else if (that.isYinsi) {
-				url = '/api/params/value';
-				form.type = 'PRIVACY_AGREEMENT';
-			} else {
-				url = '/api/content/detail';
-				form.id = that.id;
+		components: {},
+		props: {},
+		onLoad: function(options) {
+			this.id = options.id;
+			if (options.isXieyi) {
+				this.isXieyi = true;
 			}
-			if (that.isOpen) {
-				req.getRequest('/api/config', {}, function(res) {
-					that.params = res.OPEN_GROUP;
-				});
-			} else if (that.isGroup) {
-				req.getRequest('/api/config', {}, function(res) {
-					that.params = res.Head_Agreement;
-				});
-			} else if(that.isXieyi || that.isYinsi) {
-				req.getRequest(url, form, data => {
-					that.setData({
-						params: data
-					});
-				});
-			}else{
-				req.getRequest(url, form, data => {
-					that.params = data.text
-				});
+			if (options.isYinsi) {
+				this.isYinsi = true;
+			}
+			if (options.isHetong) {
+				this.isHetong = true;
 			}
+
+			this.title = options.title;
+			if (options.hetongId) this.hetongId = options.hetongId
+			// if (this.title) {
+			// 	uni.setNavigationBarTitle({
+			// 		title: this.title
+			// 	});
+			// }
+			this.getData();
+		},
+		methods: {
+			getData() {
+				var that = this;
+				let url = false;
+				let form = {};
+				if (that.isXieyi) {
+					req.getRequest('/api/other/config', {}, function(res) {
+						that.params = res.SERVICE_AGREEMENT;
+					});
+				} else if (that.isYinsi) {
+					req.getRequest('/api/other/config', {}, function(res) {
+						that.params = res.PRIVACY_AGREEMENT;
+					});
+				} else if (that.isHetong) {
+					req.getRequest('/admin/v2/contract/' + this.hetongId, {}, (data)=> {
+						data.content = data.content.replace(/{partyb}/, data.partyb);
+						data.content = data.content.replace(/{card_no}/, data.partybCardNo);
+						data.content = data.content.replace(/{partyb_mobile}/, data.partybPhone);
+						data.leaseStart = data.leaseStart.split('-');
+						data.content = data.content.replace(/{hire_begin}/, data.leaseStart[0] + '年' + data
+							.leaseStart[1] + '月' + data.leaseStart[2]);
+						if (data.leaseEnd) {
+							data.leaseEnd = data.leaseEnd.split('-');
+						}
+						data.content = data.content.replace(/{hire_end}/, data.leaseEnd ? data.leaseEnd[0] + '年' +
+							data.leaseEnd[1] + '月' + data.leaseEnd[2] : '____');
+						if (data.leaseTime) {
+							data.leaseTime = this.getTime(data.leaseTime);
+						}
+						let time = '';
+						if (data.leaseTime[0] == 0 && data.leaseTime[1] == 0) time = '01分钟';
+						if (data.leaseTime[0] > 0) {
+							time += data.leaseTime[0] + '小时';
+						}
+						if (data.leaseTime[1] >= 0) {
+							time += data.leaseTime[1] + '分钟';
+						}
+						data.content = data.content.replace(/{hire_duration}/, time ? time : '____');
+						data.content = data.content.replace(/{battery_model}/, data.batteryModel);
+						data.content = data.content.replace(/{battery_num}/, data.batteryNum);
+						data.content = data.content.replace(/{deposit}/, data.deposit);
+						data.content = data.content.replace(/{hire_price}/, data.leaseMoney);
+						data.content = data.content.replace(/{order_sign}/, '');
+						that.params = data.content;
+					});
+				}
+			},
+			getTime(time) {
+				return util.countDown(time);
+			},
 		}
-	}
-};
+	};
 </script>
 <style>
-@import './page.css';
+	@import './page.css';
 </style>

+ 11 - 0
pages.json

@@ -55,6 +55,17 @@
 				"navigationStyle": "custom"
 			}
 		},
+		{
+			"path": "pages/machineLook/machineLook",
+			"style": {
+				"navigationStyle": "custom"
+			}
+		},{
+			"path": "pages/orderLook/orderLook",
+			"style": {
+				"navigationStyle": "custom"
+			}
+		},
 		// {
 		// 	"path": "pages/main/main",
 		// 	"style": {

+ 5 - 6
pages/about/about.vue

@@ -22,7 +22,7 @@ const req = require("../../utils/request.js");
 export default {
   data() {
     return {
-      about: {}
+      about: {aboutAs:''}
     };
   },
 
@@ -40,11 +40,10 @@ export default {
 
     getAbout() {
       var _this = this;
-
-      req.getRequest('/api/aboutAs', {}, function (res) {
-        _this.setData({
-          about: res
-        });
+      req.getRequest('/api/other/config', {}, (res)=> {
+        _this.about.aboutAs = res.ABOUT_US
+		_this.about.hotLine = res.CONFIG_SERVICE_HOT_MOBILE
+		_this.about.logo = res.CONFIG_PROJECT_LOGO
       }, true);
     }
 

+ 1 - 0
pages/authorize/authorize.vue

@@ -82,6 +82,7 @@ export default {
 				req.setStorage('AUTH_TOKEN', params.token);
 				console.log(params.token)
 				req.msg('登陆成功')
+				uni.$emit('reSetLogin',true)
 				setTimeout(()=>{
 					uni.navigateBack()
 				},500)

+ 33 - 4
pages/cell/cell.vue

@@ -1,8 +1,8 @@
 <template>
 	<view>
 		<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 class="top-title" :style="'height: '+ systems.navigationHeight + 'rpx;padding-top:' + systems.ktxStatusHeight + 'rpx;'+'line-height: '+ systems.navigationHeight + 'rpx;'">
+				<view v-if="!userInfo.storeId&&actMerchant" @click="showPop=true" class="ddflex" >
 					<view>{{actMerchant.name}}</view>
 					<image class="dow-ssicon" src="../../static/pages/images/dow-ssicon.png"></image>
 				</view>
@@ -38,7 +38,7 @@
 					<view class="state-label">租赁中</view>
 				</view>
 				<view class="ddflex state-data">
-					<view>{{count.leaseCount}}</view>
+					<view>{{count.leaseCount?count.leaseCount:0}}</view>
 					<view>{{getP(1)}}%</view>
 				</view>
 			</view>
@@ -48,7 +48,7 @@
 					<view class="state-label">空闲</view>
 				</view>
 				<view class="ddflex fflex state-data">
-					<view>{{count.noLeaseCount}}</view>
+					<view>{{count.noLeaseCount?count.noLeaseCount:0}}</view>
 					<view>{{getP(2)}}%</view>
 				</view>
 			</view>
@@ -91,6 +91,13 @@
 				</view>
 			</view>
 		</view>
+		
+		<view v-if="groupList.length==0">
+			<view class="nodata">
+				<image :src="picUrlss+'empty.png'"></image>
+				<text>暂无电池~</text>
+			</view>
+		</view>
 
 		<left-pop v-if="showPop" :showPop="showPop" :btnColor="'#11BB8B'" :showBtn='false' title="解除提醒" width="460rpx"
 			@closePop="closePop()" @popSubmit="popSubmit()">
@@ -128,6 +135,7 @@
 		props: {},
 		data() {
 			return {
+				picUrlss: req.public.picUrls,
 				systems: {},
 				isTop:0,
 				
@@ -165,10 +173,30 @@
 						id:this.userInfo.storeId
 					}
 					this.getMachineList()
+					this.getTopNum()
 				}
 			}else{
 				this.getMachineList()
 			}
+			uni.$on('reSetLogin',(data)=>{
+				console.log('reSetLogin')
+				this.actMerchant = null
+				// 判断当前登录用户身份
+				if(req.isLogins(true)){
+					this.userInfo = req.getStorage('userInfo')
+					
+					if(!this.userInfo.storeId){
+						this.getMerchantList()
+					}else{
+						this.actMerchant={
+							id:this.userInfo.storeId
+						}
+						this.getMachineList()
+					}
+				}else{
+					this.getMachineList()
+				}
+			})
 		},
 		onShow() {
 		},
@@ -232,6 +260,7 @@
 			},
 			// 获取电池列表
 			getMachineList(isPage){
+				if(!this.actMerchant||!this.actMerchant.id) return
 				if(this.isQuerying) return
 				else this.isQuerying = true
 				if (!isPage) {

+ 35 - 2
pages/machine/machine.vue

@@ -1,8 +1,8 @@
 <template>
 	<view>
 		<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 class="top-title" :style="'height: '+ systems.navigationHeight + 'rpx;padding-top:' + systems.ktxStatusHeight + 'rpx;'+'line-height: '+ systems.navigationHeight + 'rpx;'">
+				<view v-if="!userInfo.storeId&&actMerchant" @click="showPop=true" class="ddflex">
 					<view>{{actMerchant.name}}</view>
 					<image class="dow-ssicon" src="../../static/pages/images/dow-ssicon.png"></image>
 				</view>
@@ -43,6 +43,13 @@
 			</view>
 		</view>
 		
+		<view v-if="groupList.length==0">
+			<view class="nodata">
+				<image :src="picUrlss+'empty.png'"></image>
+				<text>暂无设备~</text>
+			</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;">
@@ -77,6 +84,7 @@
 		props: {},
 		data() {
 			return {
+				picUrlss: req.public.picUrls,
 				systems: {},
 				isTop:0,
 				isUpdate: false,
@@ -106,10 +114,34 @@
 				
 				if(!this.userInfo.storeId){
 					this.getMerchantList()
+				}else{
+					this.actMerchant={
+						id:this.userInfo.storeId
+					}
+					this.getMachineList()
 				}
 			}else{
 				this.getMachineList()
 			}
+			uni.$on('reSetLogin',(data)=>{
+				console.log('reSetLogin')
+				this.actMerchant = null
+				// 判断当前登录用户身份
+				if(req.isLogins(true)){
+					this.userInfo = req.getStorage('userInfo')
+					
+					if(!this.userInfo.storeId){
+						this.getMerchantList()
+					}else{
+						this.actMerchant={
+							id:this.userInfo.storeId
+						}
+						this.getMachineList()
+					}
+				}else{
+					this.getMachineList()
+				}
+			})
 		},
 		onShow() {
 			this.setData({
@@ -142,6 +174,7 @@
 			},
 			// 获取机柜列表
 			getMachineList(isPage){
+				if(!this.actMerchant||!this.actMerchant.id) return
 				if(this.isQuerying) return
 				else this.isQuerying = true
 				if (!isPage) {

+ 160 - 0
pages/machineLook/machineLook.css

@@ -0,0 +1,160 @@
+.top-box{
+	background-color: #fff;
+	position: fixed;
+	top: 0;
+	left: 0;
+	right: 0;
+}
+.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;
+}
+/* 搜索 */
+.search-box{
+	padding: 30rpx;
+}
+.search-saoma{
+	width: 40rpx;
+	height: 40rpx;
+	margin-right: 45rpx;
+}
+.search-input{
+	height: 76rpx;
+	line-height: 76rpx;
+	background: #F8F8F8;
+	border-radius: 20rpx 20rpx 20rpx 20rpx;
+	opacity: 1;
+	padding: 0 16rpx 0 30rpx;
+}
+.search-input-icon{
+	width: 26rpx;
+	height: 26rpx;
+	margin-right: 10rpx;
+}
+.search-btn{
+	width: 96rpx;
+	height: 47rpx;
+	line-height: 47rpx;
+	background: #EB5C20;
+	border-radius: 24rpx 24rpx 24rpx 24rpx;
+	opacity: 1;
+	font-size: 22rpx;
+	font-family: SourceHanSansCN-Regular-, SourceHanSansCN-Regular;
+	font-weight: normal;
+	color: #FFFFFF;
+	text-align: center;
+	margin-left: 10rpx;
+}
+
+/* 机柜 */
+.machine-item{
+	margin: 30rpx;
+	padding:23rpx 30rpx 38rpx;
+	background: #FFFFFF;
+	border-radius: 20rpx 20rpx 20rpx 20rpx;
+	opacity: 1;
+}
+.machine-title{
+	line-height: 47rpx;
+	font-size: 32rpx;
+	font-family: Source Han Sans CN-Bold, Source Han Sans CN;
+	font-weight: bold;
+	color: #333333;
+}
+.state{
+	line-height: 36rpx;
+	border-radius: 5rpx 5rpx 5rpx 5rpx;
+	opacity: 1;
+	border: 2rpx solid #0FCB27;
+	color: #0FCB27;
+	text-align: center;
+	margin-left: 20rpx;
+	padding: 0 15rpx;
+}
+.machine-number{
+	line-height: 41rpx;
+	font-size: 28rpx;
+	font-family: Source Han Sans CN-Medium, Source Han Sans CN;
+	font-weight: 500;
+	color: #666464;
+	margin-top: 7rpx;
+}
+.machine-info{
+	line-height: 36rpx;
+	background: #f8f8f8;
+	border-radius: 8rpx 8rpx 8rpx 8rpx;
+	padding: 20rpx;
+	font-size: 24rpx;
+	color: #666464;
+	font-weight: 500;
+	margin-top: 11rpx;
+}
+.margin-r40{
+	margin-right: 40rpx;
+}
+.address-box{
+	margin: 32rpx 0rpx 0;
+}
+.address-icon{
+	width: 26rpx;
+	height: 26rpx;
+	margin-right: 10rpx;
+}
+.daohang{
+	width: 50rpx;
+	height: 50rpx;
+	margin-left: 10rpx;
+}
+
+/* 弹窗 */
+.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;
+}

+ 303 - 0
pages/machineLook/machineLook.vue

@@ -0,0 +1,303 @@
+<template>
+	<view>
+		<view class="top-box">
+			<view class="top-title ddflex">
+				<view :style="'height: '+ systems.navigationHeight+'rpx;padding-top:' + systems.ktxStatusHeight + 'rpx;'" class="ddflex" @click="goback">
+					<image style="width: 48rpx;height: 48rpx;margin: auto;margin-right: 20rpx;" src="../../static/pages/images/back.png"></image>
+				</view>
+				<view v-if="!storeId&&actMerchant" @click="showPop=true" class="ddflex fflex" :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>
+			<view class="search-box ddflex">
+				<image class="search-saoma" src="../../static/pages/images/saoma.png" @click="saomaFn()"></image>
+				<view class="search-input ddflex fflex">
+					<image class="search-input-icon" src="../../static/pages/images/search.png"></image>
+					<input class="fflex" v-model="searchValue" confirm-type="search" @confirm="searchFn"  placeholder="请输入编号查询"/>
+					<view class="search-btn" @click="searchFn">搜索</view>
+				</view>
+			</view>
+		</view>
+		
+		<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?id='+item.devId)">
+			<view class="ddflex" style="justify-content: space-between;">
+				<view class="machine-title fflex tover">{{item.devName}}</view>
+				<!-- <view class="state">在线</view> -->
+			</view>
+			<view class="machine-number">机柜编号:{{item.devId}}</view>
+			<view class="machine-info ddflex">
+				<view class="ddflex">
+					<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:''}}
+				</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 @click.stop="toLocation(item)" class="daohang" src="../../static/pages/images/daohang.png"></image>
+			</view>
+		</view>
+		
+		<view v-if="groupList.length==0">
+			<view class="nodata">
+				<image :src="picUrlss+'empty.png'"></image>
+				<text>暂无设备~</text>
+			</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>
+
+	</view>
+</template>
+
+<script>
+	const app = getApp();
+	const req = require("../../utils/request.js");
+	import leftPop from "../../components/left-pop/index";
+
+	export default {
+		components: {
+			leftPop
+		},
+		props: {},
+		data() {
+			return {
+				picUrlss: req.public.picUrls,
+				systems: {},
+				isTop:0,
+				isUpdate: false,
+				
+				userInfo:{},
+				
+				showPop: false,
+				tempData: null,
+				
+				groupList: [],
+				page: 1,
+				limit: 10,
+				searchValue:'',
+				isQuerying:false,//正在查询数据
+				
+				merchantList: [],
+				merchantPage: 1,
+				merchantLimit: 10,
+				
+				actMerchant:null,//当前门店
+				
+				merchantId:null,
+				storeId:null
+			}
+		},
+		onLoad(options) {
+			this.merchantId = options.merchantId
+			this.storeId = options.storeId
+			// 判断当前登录用户身份
+			if(req.isLogins(true)){
+				
+				if(!this.storeId){
+					this.getMerchantList()
+				}else{
+					this.actMerchant={
+						id:this.storeId
+					}
+					this.getMachineList()
+				}
+			}else{
+				this.getMachineList()
+			}
+		},
+		onShow() {
+			this.setData({
+				isUpdate: !this.isUpdate
+			}); 
+		},
+		onReachBottom() {
+			this.getMachineList(true)
+		},
+		methods: {
+			goback: function() {
+				var pages = getCurrentPages();
+				if(pages.length==1){
+					uni.switchTab({
+						url:'/pages/index/index'
+					})
+				}else{
+					wx.navigateBack({
+						delta: pages.length - 2
+					})
+				}
+			},
+			jumpUrl(url){
+				if(req.isLogins(true)){
+					uni.navigateTo({
+						url:url
+					})
+				}
+			},
+			// 弹窗弹出
+			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.actMerchant||!this.actMerchant.id) return
+				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 = this.merchantId?this.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()
+						}
+					}
+				)
+			},
+			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
+				});
+			},
+			searchFn(){
+				this.getMachineList()
+			},
+			saomaFn(){
+				// 只允许通过相机扫码
+				uni.scanCode({
+					onlyFromCamera: false,
+					success: (res) =>{
+						console.log('条码类型:' + res.scanType);
+						console.log('条码内容:' + res.result);
+						// did设备id
+						this.searchValue = res.result
+						this.searchFn()
+					}
+				});
+			}
+		},
+		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>
+
+<style>
+	@import "./machineLook.css";
+</style>

+ 3 - 3
pages/myMerchant/myMerchant.vue

@@ -4,7 +4,7 @@
 		<view>
 			<view class="search-box ddflex">
 				<image class="search-icon" src="../../static/images/ssico.png"></image>
-				<input class="fflex" v-model="searchValue" confirm-type="search" @confirm="searchFn" placeholder="请输入门店名称或电话"/>
+				<input class="fflex" v-model="searchValue" confirm-type="search" @confirm="searchFn" placeholder="请输入门店名称"/>
 				<view class="search-btn" @click="searchFn">搜索</view>
 			</view>
 		</view>
@@ -59,8 +59,8 @@
 					</view> -->
 				</view>
 				<view class="ddflex" style="justify-content: space-between;margin-top: 30rpx;">
-					<view class="sjyy-btn" style="border: 2rpx solid #EB5C20;color: #EB5C20;" @click.stop="jumpUrl()">查看订单</view>
-					<view class="sjyy-btn" @click.stop="jumpUrl()">查看设备</view>
+					<view class="sjyy-btn" style="border: 2rpx solid #EB5C20;color: #EB5C20;" @click.stop="jumpUrl('/pages/orderLook/orderLook?storeId='+item.id)">查看订单</view>
+					<view class="sjyy-btn" @click.stop="jumpUrl('/pages/machineLook/machineLook?storeId='+item.id)">查看设备</view>
 					<view class="sjyy-btn" @click.stop="jumpUrl('/pages/operationDataPersonal/operationDataPersonal?storeId='+item.id)">运营情况</view>
 				</view>
 			</view>

+ 3 - 3
pages/myStore/myStore.vue

@@ -4,7 +4,7 @@
 		<view>
 			<view class="search-box ddflex">
 				<image class="search-icon" src="../../static/images/ssico.png"></image>
-				<input v-model="searchValue" confirm-type="search" @confirm="searchFn" class="fflex" placeholder="请输入商家名称或电话"/>
+				<input v-model="searchValue" confirm-type="search" @confirm="searchFn" class="fflex" placeholder="请输入商家名称"/>
 				<view class="search-btn" @click="searchFn">搜索</view>
 			</view>
 		</view>
@@ -74,8 +74,8 @@
 					</view>
 				</view>
 				<view class="ddflex" style="justify-content: space-between;margin-top: 30rpx;">
-					<view class="sjyy-btn" style="border: 2rpx solid #EB5C20;color: #EB5C20;" @click.stop="jumpUrl()">查看订单</view>
-					<view class="sjyy-btn" @click.stop="jumpUrl()">查看设备</view>
+					<view class="sjyy-btn" style="border: 2rpx solid #EB5C20;color: #EB5C20;" @click.stop="jumpUrl('/pages/orderLook/orderLook?merchantId='+item.id)">查看订单</view>
+					<view class="sjyy-btn" @click.stop="jumpUrl('/pages/machineLook/machineLook?merchantId='+item.id)">查看设备</view>
 					<view class="sjyy-btn" @click.stop="jumpUrl('/pages/operationDataPersonal/operationDataPersonal?merchantId='+item.id)">运营情况</view>
 				</view>
 			</view>

+ 7 - 4
pages/operationData/operationData.vue

@@ -1,7 +1,7 @@
 <template>
 	<view style="padding-bottom: 30rpx;">
 		<!-- tab -->
-		<view class="tab-box ddflex">
+		<view class="tab-box ddflex" v-if="!userInfo.storeId">
 			<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>
@@ -15,7 +15,7 @@
 				<image class="tab-active-icon" src="../../static/images/tab_cur.png"></image>
 			</view>
 		</view>
-		<view style="height: 110rpx;"></view>
+		<view style="height: 110rpx;" v-if="!userInfo.storeId"></view>
 
 		<!-- 我的收益 -->
 		<block v-if="queryType==1">
@@ -228,6 +228,8 @@
 				isTop: 0,
 				pxToRpxScale: 0,
 				rpxTopxScale: 0,
+				
+				userInfo:{},
 
 				merchantId:null,
 				storeId:null,
@@ -480,6 +482,7 @@
 			}
 		},
 		onLoad(options) {
+			this.userInfo = req.getStorage('userInfo')
 			this.getStatisticData()
 		},
 		onShow() {
@@ -623,8 +626,8 @@
 					let merchantId = this.merchantId?this.merchantId:req.getStorage('userInfo').merchantId?req.getStorage('userInfo').merchantId:''
 					let storeId = this.storeId?this.storeId:req.getStorage('userInfo').storeId?req.getStorage('userInfo').storeId:''
 					let pData = {
-						merchantId:merchantId,
-						storeId:storeId
+						merchantId:merchantId?merchantId:null,
+						storeId:storeId?storeId:null
 					}
 					req.getRequest('/admin/v2/statistic/histogram', pData, res => {
 						this.barEchartData = res

+ 10 - 8
pages/operationDataPersonal/operationDataPersonal.vue

@@ -64,6 +64,8 @@
 				totalRefund :0,
 				totalProfit:0,
 				useProfit :0,
+				
+				echartData:{},
 
 
 				// 近一周营业额度(元)图表数据
@@ -209,10 +211,10 @@
 			if(options.storeId){
 				this.storeId = options.storeId
 			}
-			this.totalTurnover = options.totalTurnover?options.totalTurnover:0
-			this.totalRefund = options.totalRefund?options.totalRefund:0
-			this.totalProfit = options.totalProfit?options.totalProfit:0
-			this.useProfit = options.useProfit?options.useProfit:0
+			this.totalTurnover = options.totalTurnover&&options.totalTurnover!='null'?options.totalTurnover:0
+			this.totalRefund = options.totalRefund&&options.totalRefund!='null'?options.totalRefund:0
+			this.totalProfit = options.totalProfit&&options.totalProfit!='null'?options.totalProfit:0
+			this.useProfit = options.useProfit&&options.useProfit!='null'?options.useProfit:0
 			this.getStatisticData()
 		},
 		onShow() {
@@ -245,7 +247,7 @@
 						this.option3.xAxis[0].data = this.echartData.profitList.map(item=>{return item.showTime})
 						this.option3.yAxis[0].axisLabel.fontSize = 13 * this.rpxTopxScale
 						this.option3.xAxis[0].axisLabel.fontSize = 13 * this.rpxTopxScale
-						his.option3.series[0].data = this.echartData.profitList.map(item=>{return item.profit})
+						this.option3.series[0].data = this.echartData.profitList.map(item=>{return item.profit})
 						this.option3.series[0].label.normal.fontSize = 13 * this.rpxTopxScale
 						chart.setOption(this.option3);
 					});
@@ -260,11 +262,11 @@
 					let merchantId = this.merchantId?this.merchantId:''
 					let storeId = this.storeId?this.storeId:''
 					let pData = {
-						merchantId:merchantId,
-						storeId:storeId
+						merchantId:merchantId?merchantId:null,
+						storeId:storeId?storeId:null
 					}
 					req.getRequest('/admin/v2/statistic/histogram', pData, res => {
-						this.barEchartData = res
+						this.echartData = res
 						console.log('statistic chart', res)
 						r(res)
 					})

+ 37 - 0
pages/order/order.css

@@ -59,6 +59,43 @@
 	margin-bottom: 10rpx;
 }
 
+/* 搜索 */
+.search-box{
+	padding: 30rpx 30rpx 0;
+}
+.search-saoma{
+	width: 40rpx;
+	height: 40rpx;
+	margin-right: 45rpx;
+}
+.search-input{
+	height: 76rpx;
+	line-height: 76rpx;
+	background: #F8F8F8;
+	border-radius: 20rpx 20rpx 20rpx 20rpx;
+	opacity: 1;
+	padding: 0 16rpx 0 30rpx;
+}
+.search-input-icon{
+	width: 26rpx;
+	height: 26rpx;
+	margin-right: 10rpx;
+}
+.search-btn{
+	width: 96rpx;
+	height: 47rpx;
+	line-height: 47rpx;
+	background: #EB5C20;
+	border-radius: 24rpx 24rpx 24rpx 24rpx;
+	opacity: 1;
+	font-size: 22rpx;
+	font-family: SourceHanSansCN-Regular-, SourceHanSansCN-Regular;
+	font-weight: normal;
+	color: #FFFFFF;
+	text-align: center;
+	margin-left: 10rpx;
+}
+
 /* 订单 */
 .order-item{
 	background: #FFFFFF;

+ 33 - 8
pages/order/order.vue

@@ -1,13 +1,13 @@
 <template>
 	<view>
 		<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 class="top-title" :style="'height: '+ systems.navigationHeight + 'rpx;padding-top:' + systems.ktxStatusHeight + 'rpx;'+'line-height: '+ systems.navigationHeight + 'rpx;'">
+				<view v-if="!userInfo.storeId&&actMerchant" @click="showPop=true" class="ddflex">
 					<view>{{actMerchant.name}}</view>
 					<image class="dow-ssicon" src="../../static/pages/images/dow-ssicon.png"></image>
 				</view>
 			</view>
-			<view class="tab-box ddflex">
+			<view class="tab-box">
 				<view class="fflex ddflex">
 					<view :class="'tab-item fflex '+(!queryType?'tab-item-active':'')" @click="queryTypeChange(-1)">
 						<view>全部</view>
@@ -22,14 +22,17 @@
 						<image class="tab-active-icon" src="../../static/images/tab_cur.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 class="search-box ddflex">
+					<view class="search-input ddflex fflex">
+						<image class="search-input-icon" src="../../static/pages/images/search.png"></image>
+						<input class="fflex" v-model="searchValue" confirm-type="search" @confirm="searchFn"  placeholder="请输入编号查询"/>
+						<view class="search-btn" @click="searchFn">搜索</view>
+					</view>
 				</view>
 			</view>
 		</view>
 		
-		<view :style="'height: '+ (systems.navigationHeight+systems.ktxStatusHeight+106) + 'rpx;'"></view>
+		<view :style="'height: '+ (systems.navigationHeight+systems.ktxStatusHeight+106+105) + 'rpx;'"></view>
 		
 		<!-- 订单 -->
 		<view>
@@ -81,6 +84,13 @@
 			</view>
 		</view>
 		
+		<view v-if="groupList.length==0">
+			<view class="nodata">
+				<image :src="picUrlss+'empty.png'"></image>
+				<text>暂无订单~</text>
+			</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;">
@@ -115,6 +125,7 @@
 		props: {},
 		data() {
 			return {
+				picUrlss: req.public.picUrls,
 				systems: {},
 				isTop:0,
 				
@@ -146,6 +157,19 @@
 			}else{
 				this.getDataList()
 			}
+			uni.$on('reSetLogin',(data)=>{
+				console.log('reSetLogin')
+				this.actMerchant = null
+				if(req.isLogins(true)){
+					this.userInfo = req.getStorage('userInfo')
+					
+					if(!this.userInfo.storeId){
+						this.getMerchantList()
+					}
+				}else{
+					this.getDataList()
+				}
+			})
 		},
 		onShow() {
 
@@ -180,6 +204,7 @@
 				this.getDataList()
 			},
 			getDataList(isPage) {
+				if(!this.actMerchant||!this.actMerchant.id) return
 				if(this.isQuerying) return
 				else this.isQuerying = true
 				if (!isPage) {
@@ -190,7 +215,7 @@
 					limit: this.limit,
 				}
 				if(this.searchValue){
-					queryParams.name=this.searchValue
+					queryParams.orderNo=this.searchValue
 				}
 				queryParams.type = this.queryType
 				queryParams.storeId = this.actMerchant.id

+ 6 - 1
pages/orderDetail/orderDetail.vue

@@ -59,7 +59,7 @@
 				<view class="info-item-label">租赁合同</view>
 				<view class="ddflex">
 					<view class="info-item-data fflex tover">{{info.contractId}}</view>
-					<view style="color: #2A82E4;margin-left: 10rpx;text-decoration: underline;">查看</view>
+					<view style="color: #2A82E4;margin-left: 10rpx;text-decoration: underline;" @click="jump('/mine/page/page?title=租赁合同&isHetong=true&hetongId='+info.contractId)">查看</view>
 				</view>
 			</view>
 			<!-- <view class="info-item ddflex">
@@ -139,6 +139,11 @@
 		onShow() {
 		},
 		methods: {
+			jump(url) {
+				uni.navigateTo({
+					url: url
+				});
+			},
 			getData(){
 				req.getRequest('/admin/v2/order/'+this.id,{},res=>{
 					this.info = res

+ 208 - 0
pages/orderLook/orderLook.css

@@ -0,0 +1,208 @@
+.top-box{
+	background-color: #fff;
+	position: fixed;
+	top: 0;
+	left: 0;
+	right: 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{
+	text-align: center;
+	font-size: 28rpx;
+	line-height: 41rpx;
+}
+.tab-item image{
+	visibility: hidden;
+}
+.tab-item-active{
+	color: #EB5C20;
+}
+.tab-item-active image{
+	visibility: visible;
+}
+.tab-active-icon{
+	width: 32rpx;
+	height: 10rpx;
+	margin-top: 10rpx;
+	margin: auto;
+}
+.saoma{
+	width: 39rpx;
+	height: 36rpx;
+	margin-left: 60rpx;
+	margin-bottom: 10rpx;
+}
+.sousuo{
+	width: 36rpx;
+	height: 36rpx;
+	margin-left: 50rpx;
+	margin-bottom: 10rpx;
+}
+
+/* 搜索 */
+.search-box{
+	padding: 30rpx 30rpx 0;
+}
+.search-saoma{
+	width: 40rpx;
+	height: 40rpx;
+	margin-right: 45rpx;
+}
+.search-input{
+	height: 76rpx;
+	line-height: 76rpx;
+	background: #F8F8F8;
+	border-radius: 20rpx 20rpx 20rpx 20rpx;
+	opacity: 1;
+	padding: 0 16rpx 0 30rpx;
+}
+.search-input-icon{
+	width: 26rpx;
+	height: 26rpx;
+	margin-right: 10rpx;
+}
+.search-btn{
+	width: 96rpx;
+	height: 47rpx;
+	line-height: 47rpx;
+	background: #EB5C20;
+	border-radius: 24rpx 24rpx 24rpx 24rpx;
+	opacity: 1;
+	font-size: 22rpx;
+	font-family: SourceHanSansCN-Regular-, SourceHanSansCN-Regular;
+	font-weight: normal;
+	color: #FFFFFF;
+	text-align: center;
+	margin-left: 10rpx;
+}
+
+/* 订单 */
+.order-item{
+	background: #FFFFFF;
+	border-radius: 10rpx 10rpx 10rpx 10rpx;
+	opacity: 1;
+	padding: 25rpx 31rpx;
+	margin: 30rpx;
+}
+.order-item-header{
+	justify-content: space-between;
+	padding-bottom: 26rpx;
+	border-bottom: 1rpx solid #E6E6E6;
+}
+.order-time{
+	line-height: 41rpx;
+	font-size: 28rpx;
+	font-family: Source Han Sans CN-Medium, Source Han Sans CN;
+	font-weight: 500;
+	color: #A8A5A5;
+}
+.order-state{
+	line-height: 41rpx;
+	font-size: 28rpx;
+	font-family: Source Han Sans CN-Medium, Source Han Sans CN;
+	font-weight: 500;
+	color: #EB5C20;
+}
+.order-item-body{
+	padding: 10rpx 0 0;
+	
+}
+.order-item-content{
+	margin: 20rpx 0;
+	justify-content: space-between;
+}
+.order-item-content-label{
+	line-height: 41rpx;
+	font-size: 28rpx;
+	font-family: Source Han Sans CN-Medium, Source Han Sans CN;
+	font-weight: 500;
+	color: #A8A5A5;
+	margin-right: 20rpx;
+}
+.order-item-content-data{
+	line-height: 41rpx;
+	font-size: 28rpx;
+	font-family: Source Han Sans CN-Medium, Source Han Sans CN;
+	font-weight: 500;
+	color: #666464;
+	text-align: right;
+}
+.order-btns{
+	justify-content: flex-end;
+	margin-top: 20rpx;
+	padding-top: 20rpx;
+	border-top: 1rpx solid #E6E6E6;
+}
+.order-btn{
+	line-height: 56rpx;
+	background: #EB5C20;
+	border-radius: 73rpx 73rpx 73rpx 73rpx;
+	opacity: 1;
+	padding: 0 23rpx;
+	margin-left: 20rpx;
+	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;
+}

+ 315 - 0
pages/orderLook/orderLook.vue

@@ -0,0 +1,315 @@
+<template>
+	<view style="overflow: hidden;">
+		<view class="top-box">
+			<view class="top-title ddflex">
+				<view :style="'height: '+ systems.navigationHeight+'rpx;padding-top:' + systems.ktxStatusHeight + 'rpx;'" class="ddflex" @click="goback">
+					<image style="width: 48rpx;height: 48rpx;margin: auto;margin-right: 20rpx;" src="../../static/pages/images/back.png"></image>
+				</view>
+				<view v-if="!storeId&&actMerchant" @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>
+			<view class="tab-box">
+				<view class="fflex ddflex">
+					<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 :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>
+				<view class="search-box ddflex">
+					<view class="search-input ddflex fflex">
+						<image class="search-input-icon" src="../../static/pages/images/search.png"></image>
+						<input class="fflex" v-model="searchValue" confirm-type="search" @confirm="searchFn"  placeholder="请输入编号查询"/>
+						<view class="search-btn" @click="searchFn">搜索</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		
+		<view :style="'height: '+ (systems.navigationHeight+systems.ktxStatusHeight+106+105) + 'rpx;'"></view>
+		
+		<!-- 订单 -->
+		<view>
+			<view class="order-item" v-for="item,index in groupList" @click="jumpUrl('/pages/orderDetail/orderDetail?id='+item.id)">
+				<view class="ddflex order-item-header">
+					<view class="order-time">{{item.leaseTime}}</view>
+					<!-- <block>
+						<view v-if="index!=1" class="order-state">线下-待确认</view>
+						<view v-else class="order-state" style="color: #0FCB27;">微信-支付成功</view>
+					</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">{{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">{{item.leaseStoreName}}</view>
+					</view>
+					<view class="order-item-content ddflex">
+						<view class="order-item-content-label">租借机柜</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">{{item.batteryId}}</view>
+					</view>
+					<view class="order-item-content ddflex">
+						<view class="order-item-content-label">电池型号</view>
+						<view class="order-item-content-data fflex tover">60V 30Ah</view>
+					</view>	
+					<view class="order-item-content ddflex">
+						<view class="order-item-content-label">租赁用户</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">{{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;">{{item.payMoney}}元</view>
+					</view>
+				</view>
+				<!-- <view v-if="index!=1" class="order-btns ddflex">
+					<view class="order-btn" @click.stop="">确认支付</view>
+				</view> -->
+			</view>
+		</view>
+		
+		<view v-if="groupList.length==0">
+			<view class="nodata">
+				<image :src="picUrlss+'empty.png'"></image>
+				<text>暂无订单~</text>
+			</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>
+	</view>
+</template>
+
+<script>
+	const app = getApp();
+	const req = require("../../utils/request.js");
+	import leftPop from "../../components/left-pop/index";
+
+	export default {
+		components: {
+			leftPop
+		},
+		props: {},
+		data() {
+			return {
+				picUrlss: req.public.picUrls,
+				systems: {},
+				isTop:0,
+				
+				showPop: false,
+				tempData: null,
+				
+				queryType: '',
+				
+				groupList: [],
+				page: 1,
+				limit: 10,
+				searchValue:'',
+				isQuerying:false,//正在查询数据
+				
+				merchantList: [],
+				merchantPage: 1,
+				merchantLimit: 10,
+				
+				actMerchant:null,//当前门店
+				
+				merchantId:null,
+				storeId:null
+			}
+		},
+		onLoad(options) {
+			this.merchantId = options.merchantId
+			this.storeId = options.storeId
+			if(req.isLogins(true)){
+				if(!this.storeId){
+					this.getMerchantList()
+				}else{
+					this.actMerchant={
+						id:this.storeId
+					}
+					this.getDataList()
+				}
+			}else{
+				this.getDataList()
+			}
+		},
+		onShow() {
+
+		},
+		onReachBottom() {
+			this.getDataList(true)
+		},
+		methods: {
+			goback: function() {
+				var pages = getCurrentPages();
+				if(pages.length==1){
+					uni.switchTab({
+						url:'/pages/index/index'
+					})
+				}else{
+					wx.navigateBack({
+						delta: pages.length - 2
+					})
+				}
+			},
+			jumpUrl(url) {
+				if (req.isLogins(true)) {
+					uni.navigateTo({
+						url: url
+					})
+				}
+			},
+			queryTypeChange(val) {
+				if (this.queryType == val) return false
+				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.actMerchant||!this.actMerchant.id) return
+				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.orderNo=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 = this.merchantId?this.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() {
+			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>
+
+<style>
+	@import "./orderLook.css";
+</style>

+ 22 - 7
pages/user/user.vue

@@ -2,11 +2,11 @@
 	<view>
 		<view :class="'mine' + (skinNotColor ? ' not-color' : '')">
 			<image src="/static/images/wdbg.png" class="wdbg"
-				@click="jumpUrl('mine/userinfo/userinfo')"></image>
+				></image>
 			<view class="minec">
 				<image :src="userInfos.avatar ? userInfos.avatar : '/static/images/userimg.png'" mode="aspectFit"
-					class="user" @click="jumpUrl('mine/userinfo/userinfo')"></image>
-				<view class="mines" @click="jumpUrl('mine/userinfo/userinfo')" v-if="isLogin">
+					class="user" ></image>
+				<view class="mines"  v-if="isLogin">
 					<view class="ddflex">{{userInfos.nickName}}
 					</view>
 					<text class="edu" v-if="userInfos.mobile">{{userInfos.mobile}}</text>
@@ -38,15 +38,15 @@
 				<view class="flex">我的服务</view>
 			</view>
 			<view class="list2 dflex">
-				<navigator url="" hover-class="none" class="li" @click="jumpUrl('mine/order/order')">
+				<navigator url="/pages/order/order" hover-class="none" class="li" open-type="switchTab">
 					<image src="../../static/pages/images/user_service1.png"></image>
 					<text>我的订单</text>
 				</navigator>
-				<navigator url="" hover-class="none" class="li" @click="jumpUrl('pages/myStore/myStore')">
+				<navigator v-if="!userInfos.storeId" url="" hover-class="none" class="li" @click="jumpUrl('pages/myStore/myStore')">
 					<image src="../../static/pages/images/user_service2.png"></image>
 					<text>我的商家</text>
 				</navigator>
-				<navigator url="" hover-class="none" class="li" @click="jumpUrl('pages/myMerchant/myMerchant')">
+				<navigator v-if="!userInfos.storeId" url="" hover-class="none" class="li" @click="jumpUrl('pages/myMerchant/myMerchant')">
 					<image src="../../static/pages/images/user_service3.png"></image>
 					<text>我的门店</text>
 				</navigator>
@@ -66,7 +66,7 @@
 					<image src="../../static/pages/images/user_service7.png"></image>
 					<text>建议反馈</text>
 				</navigator>
-				<navigator url="/mine/feedback/feedback" hover-class="none" class="li">
+				<navigator url="" hover-class="none" class="li" @click="logout">
 					<image src="../../static/pages/images/user_service8.png"></image>
 					<text>退出登录</text>
 				</navigator>
@@ -150,6 +150,21 @@
 					this.alarmCount = res.alarmCount?res.alarmCount:0
 					this.exceptionOrderCount = res.exceptionOrderCount?res.exceptionOrderCount:0
 				})
+			},
+			logout(){
+				uni.showModal({
+					title:'提示',
+					content:'确定退出登陆?',
+					success: (res) => {
+						if(res.confirm){
+							req.removeStorage('userInfo')
+							req.removeStorage('AUTH_TOKEN')
+							this.userInfos =  null
+							this.isLogin = false
+							req.isLogins(true)
+						}
+					}
+				})
 			}
 		}
 	};

二進制
static/pages/images/back.png


+ 1 - 1
utils/request.js

@@ -185,7 +185,7 @@ const clearValueEmpty = (data) => {
  * @param {*} isLoad 是否显示加载提示
  */
 const baseRequest = (url, data, method, success, isLoad) => {
-	if(url=='/admin/v2/login'){
+	if(url=='/admin/v2/login'||url=='/api/protocol'||url=='/api/params/value'||url=='/api/other/config'){
 		if (!isLoad) uni.showNavigationBarLoading();
 		header['content-type'] = 'application/json;charset=UTF-8'
 		uni.request({

+ 18 - 1
utils/util.js

@@ -289,6 +289,22 @@ function captureTime(time,isTime){
 		return date
 	}
 }
+function countDown(times){
+    //计算小时数 转化为整数
+    var h = parseInt(times / 60);
+    //如果小时数小于 10,要变成 0 + 数字的形式
+    h = h < 10 ? "0" + h : h;
+    //计算分钟数 转化为整数
+    var m = parseInt(times % 60);
+    //如果分钟数小于 10,要变成 0 + 数字的形式
+    m = m < 10 ? "0" + m : m;
+    //计算描述 转化为整数
+    // var s = parseInt(times % 60);
+    //如果秒钟数小于 10,要变成 0 + 数字的形式
+    // s = s < 10 ? "0" + s : s;
+    // return h + ':' + m + ':' + s
+        return [h,m];
+}
 
 module.exports = {
 	formatTime: formatTime,
@@ -306,5 +322,6 @@ module.exports = {
 	styleHintText:styleHintText,
 	formatNumbers: formatNumbers,
 	toDecimal: toDecimal,
-	captureTime: captureTime
+	captureTime: captureTime,
+	countDown:countDown
 };

+ 19 - 0
warning/orderAlarm/orderAlarm.css

@@ -117,4 +117,23 @@
 	font-family: Source Han Sans CN-Medium, Source Han Sans CN;
 	font-weight: 500;
 	color: #A8A5A5;
+}
+
+.apply-info-box{
+	margin: 30rpx 0;
+}
+.reason-input{
+	padding: 30rpx;
+	margin: 30rpx 0;
+	border-radius: 4rpx;
+	border: 1px solid #eeeeee;
+}
+.reason-input textarea{
+	height: 150rpx;
+}
+.applyBtn1{
+	flex:0 0 45%;border-radius: 40rpx;background-color: #fff;height: 80rpx;line-height: 80rpx;color: #666;text-align: center;border:1rpx solid #666;
+}
+.applyBtn2{
+	flex:0 0 45%;border-radius: 40rpx;background-color: var(--main);height: 80rpx;line-height: 80rpx;color: #fff;text-align: center;border:1rpx solid var(--main);
 }

+ 84 - 17
warning/orderAlarm/orderAlarm.vue

@@ -14,10 +14,11 @@
 			</view>
 		</view>
 		<view style="height: 110rpx;"></view>
-		
+
 		<!-- 订单 -->
 		<view>
-			<view class="order-item" v-for="item,index in groupList" @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">类型:{{item.exceptionCause}}</view>
 					<block>
@@ -32,7 +33,8 @@
 					</view>
 					<view class="order-item-content ddflex">
 						<view class="order-item-content-label">订单状态:</view>
-						<view class="order-item-content-data fflex tover">{{item.finishStatus==0?'未结束':item.finishStatus==1?'自动结束':'人工结束'}}</view>
+						<view class="order-item-content-data fflex tover">
+							{{item.finishStatus==0?'未结束':item.finishStatus==1?'自动结束':'人工结束'}}</view>
 					</view>
 					<view class="order-item-content ddflex">
 						<view class="order-item-content-label">机柜编号:</view>
@@ -50,33 +52,50 @@
 				<view v-if="item.isException!==0" class="order-btns ddflex">
 					<view class="order-btn-time">2022-12-31 17:16:37</view>
 					<view style="justify-content: flex-end;" class="ddflex">
-						<view class="order-btn" v-if="item.status>1" @click.stop="">退款</view>
-						<view class="order-btn" v-else @click.stop="">结束订单</view>
+						<view class="order-btn" v-if="item.status>1&&item.refundStatus==0" @click.stop="openPop(item)">退款</view>
+						<view class="order-btn" v-else @click.stop="finishOrder">结束订单</view>
 					</view>
 				</view>
 			</view>
 		</view>
-		
+
+		<bottom-pop v-if="showPop" :showPop='showPop' :btnColor="'#11BB8B'" :showBtn='true' title="退款"
+			@closePop="closePop()" @popSubmit="popSubmit()">
+			<view class="apply-info-box">
+				<view class="reason-input">
+					<input v-model="tempData.rmoney" placeholder="请填写退款金额"></input>
+				</view>
+				<view>请填写退款金额,最多可退¥{{tempData.payMoney}}</view>
+			</view>
+		</bottom-pop>
+
 	</view>
 </template>
 
 <script>
 	const app = getApp();
 	const req = require("../../utils/request.js");
+	import bottomPop from "../../components/bottom-pop/index";
 
 	export default {
-		components: {},
+		components: {
+			bottomPop
+		},
 		props: {},
 		data() {
 			return {
 
 				queryType: 0,
-				
+
 				groupList: [],
 				page: 1,
 				limit: 10,
-				searchValue:'',
-				isQuerying:false,//正在查询数据
+				searchValue: '',
+				isQuerying: false, //正在查询数据
+				
+				// 筛选弹窗
+				showPop: false,
+				tempData: null,
 			}
 		},
 		onLoad(options) {
@@ -101,10 +120,10 @@
 				this.queryType = val
 				this.getMachineList()
 			},
-			
+
 			// 获取机柜列表
-			getMachineList(isPage){
-				if(this.isQuerying) return
+			getMachineList(isPage) {
+				if (this.isQuerying) return
 				else this.isQuerying = true
 				if (!isPage) {
 					this.page = 1
@@ -135,11 +154,59 @@
 					}
 				)
 			},
+			
+			// 弹窗打开
+			openPop(item,index) {
+				this.tempData = item;
+				this.tempData.rmoney = item.payMoney
+				this.showPop = true
+			},
+			// 弹窗关闭
+			closePop() {
+				this.showPop = false
+				this.tempData = null
+			},
+			// 弹窗确认
+			popSubmit() {
+				if(Number(this.tempData.rmoney)>Number(this.tempData.payMoney)) return req.msg('退款金额超出支付金额')
+				uni.showModal({
+					title: '提示',
+					content: "确定退款?",
+					success: (res) => {
+						if (res.confirm) {
+							req.getRequest('/admin/v2/order/refund', {
+								id: this.tempData.id,
+								refundMoney:this.tempData.rmoney
+							}, data => {
+								this.tempData = null
+								this.showPop = false
+								res.msg('订单已退款')
+								this.getMachineList()
+							})
+						}
+					}
+				})
+			},
+			// 结束订单
+			finishOrder(item) {
+				uni.showModal({
+					title: '提示',
+					content: "确定结束该订单?",
+					success: (res) => {
+						if (res.confirm) {
+							req.getRequest('/admin/v2/order/settle', {
+								id: item.id
+							}, data => {
+								res.msg('订单已结束')
+								this.getMachineList()
+							})
+						}
+					}
+				})
+			}
 		},
-		mounted() {
-		},
-		onPageScroll: function(e) {
-		}
+		mounted() {},
+		onPageScroll: function(e) {}
 	}
 </script>