소스 검색

Merge branch 'deploy' of http://git.chelingzhu.com/chelingzhu-web/qhsxKx-mini-html into deploy

lilei 4 년 전
부모
커밋
38e777a120
2개의 변경된 파일46개의 추가작업 그리고 19개의 파일을 삭제
  1. 18 3
      pages/order/orderDetail.vue
  2. 28 16
      pages/store/storeDetail.vue

+ 18 - 3
pages/order/orderDetail.vue

@@ -38,11 +38,11 @@
 			<view class="order-photo">
 				<view v-if="orderInfo.beginImage">
 					<view>洗车前</view>
-					<u-image width="100%" height="400rpx" :src="orderInfo.beginImage"></u-image>
+					<u-image @click="showImage(orderInfo.beginImage)" width="100%" height="400rpx" mode="aspectFit" :src="orderInfo.beginImage"></u-image>
 				</view>
 				<view v-if="orderInfo.endImage">
 					<view>洗车后</view>
-					<u-image width="100%" height="400rpx" :src="orderInfo.endImage"></u-image>
+					<u-image @click="showImage(orderInfo.endImage)" width="100%" height="400rpx" mode="aspectFit" :src="orderInfo.endImage"></u-image>
 				</view>
 			</view>
 		</view>
@@ -101,7 +101,22 @@
 						},500)
 					}
 				})
-			} 
+			},
+			// 图片预览
+			showImage (url) {
+				uni.previewImage({
+					urls: [url],
+					longPressActions: {
+						itemList: ['发送给朋友', '保存图片', '收藏'],
+						success: function(data) {
+							console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
+						},
+						fail: function(err) {
+							console.log(err.errMsg);
+						}
+					}
+				});
+			}
 		},
 	}
 </script>

+ 28 - 16
pages/store/storeDetail.vue

@@ -52,12 +52,9 @@
 			</view>
 		</view>
 		<view class="footer">
-			<button type="warn" plain @click="getWaitPhoto">排队情况</button>
+			<button type="warn" :loading="loading" plain @click="getWaitPhoto">排队情况</button>
 			<button type="warn" @click="openLocation">立刻导航</button>
 		</view>
-		<u-popup v-model="showPop" mode="center" width="90%" height="60%" closeable>
-			<image class="pop-img" :src="waitPhoto"></image>
-		</u-popup>
 	</view>
 </template>
 
@@ -73,15 +70,15 @@
 					lat: '36.636193',
 					lng: '101.760521'
 				},
-				showPop: false, // 是否显示排队弹窗
 				storeInfo: null, // 网点详细信息
 				labelList: [], // 网点标签
-				waitPhoto: ''  // 排队照片
+				loading: false  // 是否显示排队按钮loading
 			}
 		},
 		onLoad(option) {
 			// 获取当前经纬度
 			let _this = this
+			this.pageInit()
 			uni.getLocation({
 				type: 'wgs84', // 默认wgs84
 				success: function(res) {
@@ -103,6 +100,11 @@
 			
 		},
 		methods: {
+			pageInit () {
+				this.storeInfo = null
+				this.labelList = []
+				this.loading = false
+			},
 			// 获取网点详情信息
 			getStoreDetail (id) {
 				uni.showLoading({
@@ -152,19 +154,29 @@
 			},
 			// 获取排队情况
 			getWaitPhoto () {
-				uni.showLoading({
-					title: '加载中...',
-					mask: true
-				})
+				this.loading = true
 				let deviceNo = this.storeInfo.deviceVOList && this.storeInfo.deviceVOList.length? this.storeInfo.deviceVOList[0].deviceNo :''
 				getWaitPhoto({deviceNo:deviceNo}).then(res=>{
-					uni.hideLoading()
+					this.loading = false
 					if(res.status==200) {
-						this.waitPhoto = res.data
-						this.showPop=true
-					} else {
-						this.toashMsg(res.message)
-					}
+						if (res.data) {
+							// 预览图片
+							uni.previewImage({
+								urls: [res.data],
+								longPressActions: {
+									itemList: ['发送给朋友', '保存图片', '收藏'],
+									success: function(data) {
+										console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
+									},
+									fail: function(err) {
+										console.log(err.errMsg);
+									}
+								}
+							});
+						} else {
+							this.toashMsg('暂无数据')
+						}
+					} 
 				})
 			},
 			// 打开导航位置信息界面