Browse Source

bug 修复

lilei 4 years ago
parent
commit
7ba81968fb
2 changed files with 34 additions and 16 deletions
  1. 7 2
      pages/index/index.vue
  2. 27 14
      pages/userAuth/userAuth.vue

+ 7 - 2
pages/index/index.vue

@@ -183,7 +183,12 @@
 					  if(devices.length){
 						  _this.statusStr = '已发现设备'
 						  _this.deviceList = res.devices
-						  _this.loading = false
+						  if(res.devices.length == 1){
+							  _this.connectBlue(_this.deviceList[0])
+						  }else{
+							  _this.loading = false
+						  }
+						  
 					  }
 					})
 				  }
@@ -191,7 +196,7 @@
 			},
 			// 连接蓝牙设备
 			connectBlue(item){
-				if(this.loading){
+				if(this.connectStatus){
 					return
 				}
 				if(item){

+ 27 - 14
pages/userAuth/userAuth.vue

@@ -17,9 +17,14 @@
 			<view class="form-row">
 				<view><text class="red">*</text>投递类型</view>
 				<view class="form-grid">
-					<view :class="item==0?'active':''" v-for="item in 8" :key="item">
-						<view>废旧纸张</view>
-						<view class="texts">200g/1乐豆</view>
+					<view v-for="(item,index) in 8" :key="item" :class="index==0?'active':''">
+						<view class="imgs">
+							<u-image src="/static/RECYCLING.png" width="70rpx" height="70rpx"></u-image>
+						</view>
+						<view class="info">
+							<view>废旧纸张</view>
+							<view class="texts">200g/1乐豆</view>
+						</view>
 					</view>
 				</view>
 			</view>
@@ -61,7 +66,7 @@
 			<view>
 				<view>1.请等待电子秤数据稳定后,再点击提交按钮</view>
 				<view>2.提交数据时,请仔细检查投递重量是否正确</view>
-				<view>3.下次称重时,记得将上次称重的物品取下,避免重发提交数据</view>
+				<view>3.下次称重时,记得将上次称重的物品取下,避免重复称重</view>
 			</view>
 		</view>
 		<!-- 提交确认弹框 -->
@@ -204,10 +209,10 @@
 			submit(){
 				let that = this
 				console.log(this.washWeight,'this.washWeight')
-				if(this.washWeight==0){
+				if(this.washWeight<=0){
 					uni.showToast({
 						icon: 'none',
-						title: '投递重量不能是0,请投放称重'
+						title: '请投放物品!'
 					})
 					return
 				}
@@ -295,21 +300,29 @@
 		flex-wrap: wrap;
 		justify-content: space-around;
 		> view{
-			width: 30%;
+			width: 46%;
 			border: 1px solid #eee;
-			margin: 20rpx 0;
-			padding: 20rpx;
-			border-radius: 6rpx;
-			text-align: center;
+			margin: 10rpx 0;
+			padding: 10rpx 20rpx;
+			border-radius: 8rpx;
+			display: flex;
+			align-items: center;
+			background-color: #f8f8f8;
 			.texts{
 				font-size: 24rpx;
 				color: #999;
-				padding: 10rpx 0;
+				padding: 2rpx 0;
+			}
+			.imgs{
+				width: 90rpx;
+			}
+			.info{
+				flex-grow: 1;
 			}
 		}
 		.active{
-			border-color: #ffaa00;
-			background-color: #ffd36a;
+			border-color: #4792d8;
+			background-color: #55aaff;
 			color: #FFFFFF;
 			.texts{
 				color: #FFFFFF;