chenrui 4 jaren geleden
bovenliggende
commit
96cab6f1ce
3 gewijzigde bestanden met toevoegingen van 53 en 51 verwijderingen
  1. 1 0
      pages/index/index.vue
  2. 52 51
      pages/store/store.vue
  3. BIN
      static/md-big-pic.png

+ 1 - 0
pages/index/index.vue

@@ -258,6 +258,7 @@
 		.storeList {
 			padding: 25upx 20upx 20upx;
 			.store-section {
+				display: block;
 				margin-bottom: 20rpx;
 			}
 			.stores-box {

+ 52 - 51
pages/store/store.vue

@@ -13,13 +13,16 @@
 		<!-- 网点信息及设备 -->
 		<view class="details" v-if="stationData">
 			<view class="details-address">
-				<view>{{ stationData.name }}</view>
-				<view>{{ stationData.provinceName }}{{ stationData.cityName }}{{ stationData.districtName }}{{ stationData.address }}</view>
-				<view>
-					营业时间:
-					<text v-for="(tItem, tInd) in stationData.deliveryTimeRuleItemList" :key="tInd">
-						{{ tItem.openTime }} - {{ tItem.closeTime }}{{ tInd == stationData.deliveryTimeRuleItemList.length - 1 ? '' : ',' }}
-					</text>
+				<image src="/static/md-big-pic.png" class="store-pic"></image>
+				<view class="store-info">
+					<view>{{ stationData.name }}</view>
+					<view>{{ stationData.provinceName }}{{ stationData.cityName }}{{ stationData.districtName }}{{ stationData.address }}</view>
+					<view>
+						营业时间:
+						<text v-for="(tItem, tInd) in stationData.deliveryTimeRuleItemList" :key="tInd">
+							{{ tItem.openTime }} - {{ tItem.closeTime }}{{ tInd == stationData.deliveryTimeRuleItemList.length - 1 ? '' : ',' }}
+						</text>
+					</view>
 				</view>
 			</view>
 			<!-- 设备列表 -->
@@ -29,16 +32,12 @@
 					<view class="details-dev-cons">
 						<view class="dev-item" v-for="boxItem in item.deviceTypeBoxList">
 							<view class="item-pic-con">
-								<!-- <image class="full-" src="/static/full-bg.png"></image> -->
-								<text class="full-sign">
-									已满
-								</text>
-								<u-image height="80" width="80" :src="`/static/${boxItem.rubbishType}.png`"></u-image>
+								<text v-if="boxItem.flag==1" class="full-sign">已满</text>
+								<u-image height="80" width="80" :src="`/static/${boxItem.rubbishType}.png`" class="type-sign"></u-image>
 							</view>
 							<view class="dev-main">
 								<view>
 									{{ boxItem.rubbishTypeDictValue }}
-									<u-tag v-if="boxItem.flag==1" text="已满" size="mini" mode="dark" type="info" />
 								</view>
 								<view class="rule-con">
 									{{ getRule(boxItem.rubbishType).rubbishWeight }}g/
@@ -73,34 +72,30 @@
 		onLoad(options) {
 			this.stationId = options.id
 			this.stationNo = options.stationNo
-			//  获取经纬度
-			this.getLocation()
 			this.getStation()  //  网点信息
 			this.getDevice()  //  设备信息
 		},
 		methods: {
-			//  获取经纬度
-			getLocation() {
-				const _this = this;
-				uni.getLocation({
-					type: 'wgs84',
-					success: function(res) {
-						_this.lng = res.longitude
-						_this.lat = res.latitude
-					},
-					fail: function(error) {
-						console.log(error)
-						uni.showToast({ icon: 'none', title: '定位失败' })
-					}
-				})
-			},
 			//  网点信息
 			getStation(){
 				stationDetail({ id: this.stationId }).then(res => {
 					if(res.status == 200){
 						this.stationData = res.data
+						this.markers = []
+						this.markers.push({
+							latitude: res.data.lat,
+							longitude: res.data.lng,
+							width: 30,
+							height: 30,
+							iconPath: "/static/store.png"
+						})
+						this.lng = res.data.lng
+						this.lat = res.data.lat
 					}else{
 						this.stationData = null
+						this.markers = []
+						this.lng = ''
+						this.lat = ''
 					}
 				})
 			},
@@ -109,16 +104,6 @@
 				stationDevice({ stationNo: this.stationNo }).then(res => {
 					if(res.status == 200){
 						this.deviceData = res.data
-						this.markers = []
-						for(let i=0; i<res.data.length; i++){
-							this.markers.push({
-								latitude: res.data[i].lat,
-								longitude: res.data[i].lng,
-								width: 30,
-								height: 30,
-								iconPath: "/static/store.png"
-							})
-						}
 					}else{
 						this.deviceData = []
 					}
@@ -143,19 +128,27 @@
 	.details{
 		margin: 20upx;
 		.details-address{
+			display: flex;
 			padding: 20upx;
 			background: #FFFFFF;
 			border-radius: 15upx;
 			box-shadow: 0upx 3upx 6upx #eee;
 			margin-bottom: 20upx;
-			>view{
-				font-size: 24upx;
-				padding: 5upx 0;
-				color: #666;
-				&:first-child{
-					font-weight: bold;
-					font-size: 30upx;
-					color: #333;
+			.store-pic{
+				width: 130rpx;
+				height:130rpx;
+				margin-right: 20rpx;
+			}
+			.store-info{
+				>view{
+					font-size: 24upx;
+					padding: 5upx 0;
+					color: #666;
+					&:first-child{
+						font-weight: bold;
+						font-size: 30upx;
+						color: #333;
+					}
 				}
 			}
 		}
@@ -174,7 +167,7 @@
 					}
 				}
 				.details-dev-cons{
-					padding: 10upx;
+					padding: 10upx 0;
 					display: flex;
 					flex-wrap: wrap;
 					.dev-item{
@@ -182,7 +175,7 @@
 						display: flex;
 						align-items: center;
 						> view{
-							padding: 15upx 10upx;
+							padding: 25upx 10upx 15upx 0;
 							&:last-child{
 								view{
 									display: flex;
@@ -194,13 +187,21 @@
 							}
 						}
 						.item-pic-con{
+							position: relative;
+							padding-left: 30rpx;
 							.full-sign{
 								font-size: 24rpx;
 								padding: 4rpx 10rpx 14rpx;
 								color: #fff;
 								background: url('/static/full-bg.png') no-repeat;
 								background-size: 100% 100%;
-								transform: scale(1.5);
+								transform: scale(0.8);
+								position: absolute;
+								left: 0;
+								top: 0;
+								width: 68rpx;
+								height: 55rpx;
+								z-index: 9;
 							}
 						}
 						.dev-main{

BIN
static/md-big-pic.png