ソースを参照

修改部分代码比较乱和包月切换车牌

CarlYang 3 年 前
コミット
34bcfb9a94

+ 246 - 219
pages/center/index.vue

@@ -1,249 +1,276 @@
 <template>
-	<view>
-		<u-navbar title-color="#fff" :custom-back="customBack" :border-bottom="false" back-icon-color="#CCE8FF" :background="{background: '#008CFF' }" title="我的"></u-navbar>
-		<view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-b-30 u-p-t-30">
-			<view class="u-m-r-24" @click="clickHead">
-				<u-avatar :src="userInfo.headImgUrl || userInfo.avatar||pic" size="140"></u-avatar>
-			</view>
-			<view class="u-flex-1" @click="login($store.state.vuex_hasLogin)">
-				<view class="u-font-18 u-p-b-20">{{ userInfo.nickname || userInfo.userName || '请登录' }}</view>
-				<view class="u-font-14">手机号:{{ userInfo.mobile || '暂无' }}</view>
-			</view>
-			<!-- <view class="u-m-l-10 u-p-10">
-				<u-icon name="arrow-right" color="#fff" size="28"></u-icon>
-			</view> -->
-		</view>
+  <view>
+		<!-- ===================================== tabbar ===================================== -->
+    <u-navbar
+      title-color="#fff"
+      :custom-back="customBack"
+      :border-bottom="false"
+      back-icon-color="#CCE8FF"
+      :background="{ background: '#008CFF' }"
+      title="我的"
+    ></u-navbar>
 		
-		<view class="u-m-t-20">
-			<u-cell-group>	
-			<!-- 	<u-cell-item title="贵州银行支付" @click="guizhouPay()">
-					<u-icon slot="icon" custom-prefix="custom-icon" size="35" name="wodecheliang"></u-icon>
-				</u-cell-item> -->
-				<u-cell-item title="我的车辆" @click="openPage('pages/myCars/myCars')">
+		<!-- ===================================== 头像 ===================================== -->
+    <view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-b-30 u-p-t-30">
+      <view class="u-m-r-24" @click="clickHead">
+        <u-avatar :src="pic" size="140"></u-avatar>
+        <!-- <u-avatar :src="userInfo.headImgUrl || userInfo.avatar || pic" size="140"></u-avatar> -->
+      </view>
+      <view class="u-flex-1" @click="login($store.state.vuex_hasLogin)">
+        <!-- <view class="u-font-18 u-p-b-20">{{ userInfo.nickname || userInfo.userName || '请登录' }}</view> -->
+        <view class="u-font-18 u-p-b-20">{{ userInfo.mobile || '请登录' }}</view>
+        <view class="u-font-14">手机号:{{ userInfo.mobile || '暂无' }}</view>
+      </view>
+    </view>
+
+    <view class="u-m-t-20">
+      <u-cell-group>
+        <!-- <u-cell-item title="贵州银行支付" @click="guizhouPay()">
 					<u-icon slot="icon" custom-prefix="custom-icon" size="35" name="wodecheliang"></u-icon>
-				</u-cell-item>
-				<u-cell-item title="停车记录" @click="openPage('pages/center/order/order')">
-					<u-icon slot="icon" custom-prefix="custom-icon" size="35" name="tingchejilu"></u-icon>
-				</u-cell-item>
-			</u-cell-group>
-		</view>
-		<view class="u-m-t-20">
-			<u-cell-group>
-				<!-- <u-cell-item title="充值" @click="openPage('pages/myCars/myCars')">
+        </u-cell-item>-->
+        <u-cell-item title="我的车辆" @click="openPage('pages/myCars/myCars', true)">
+          <u-icon slot="icon" custom-prefix="custom-icon" size="35" name="wodecheliang"></u-icon>
+        </u-cell-item>
+        <u-cell-item title="停车记录" @click="openPage('pages/center/order/order')">
+          <u-icon slot="icon" custom-prefix="custom-icon" size="35" name="tingchejilu"></u-icon>
+        </u-cell-item>
+      </u-cell-group>
+    </view>
+		
+    <view class="u-m-t-20">
+      <u-cell-group>
+        <!-- <u-cell-item title="充值" @click="openPage('pages/myCars/myCars')">
 					<u-icon slot="icon" custom-prefix="custom-icon" size="35" name="chongzhi"></u-icon>
-				</u-cell-item> -->
-				<u-cell-item title="包月" @click="openPage('pages/center/monthly/monthly')">
-					<u-icon slot="icon" custom-prefix="custom-icon" size="35" name="baoyue"></u-icon>
-				</u-cell-item>
-				<!-- <u-cell-item title="提现" @click="openPage('pages/center/order/order')">
+        </u-cell-item>-->
+        <u-cell-item title="包月" @click="openPage('pages/center/monthly/monthly')">
+          <u-icon slot="icon" custom-prefix="custom-icon" size="35" name="baoyue"></u-icon>
+        </u-cell-item>
+        <!-- <u-cell-item title="提现" @click="openPage('pages/center/order/order')">
 					<u-icon slot="icon" custom-prefix="custom-icon" size="35" name="tixian"></u-icon>
-				</u-cell-item> -->
-				<!-- <u-cell-item title="退款" @click="openPage('pages/center/order/order')">
+        </u-cell-item>-->
+        <!-- <u-cell-item title="退款" @click="openPage('pages/center/order/order')">
 					<u-icon slot="icon" custom-prefix="custom-icon" size="35" name="tuikuan"></u-icon>
-				</u-cell-item> -->
-				<!-- <u-cell-item title="账单记录" @click="openPage('pages/center/order/order')">
+        </u-cell-item>-->
+        <!-- <u-cell-item title="账单记录" @click="openPage('pages/center/order/order')">
 					<u-icon slot="icon" custom-prefix="custom-icon" size="35" name="zhangdanjilu"></u-icon>
-				</u-cell-item> -->
-			</u-cell-group>
-		</view>
-	<!-- 	<view class="u-m-t-20">
+        </u-cell-item>-->
+      </u-cell-group>
+    </view>
+		
+    <!-- <view class="u-m-t-20">
 			<u-cell-group>
 				<u-cell-item title="我的优惠" @click="openPage('pages/myCars/myCars')">
 					<u-icon slot="icon" custom-prefix="custom-icon" size="35" name="wodeyouhui"></u-icon>
 				</u-cell-item>
 			</u-cell-group>
-		</view> -->
-	<!-- 	<view class="u-m-t-20">
+    </view>-->
+    <!-- <view class="u-m-t-20">
 			<u-cell-group>
 				<u-cell-item title="发票管理" @click="openPage('pages/center/invoice/invoice')">
 					<u-icon slot="icon" custom-prefix="custom-icon" size="35" name="fapiaoguanli"></u-icon>
 				</u-cell-item>
 			</u-cell-group>
-		</view> -->
-		<view class="u-m-t-20">
-			<u-cell-group>
-				<u-cell-item title="消息中心" @click="openPage('pages/message/message', true)">
-					<u-icon slot="icon" custom-prefix="custom-icon" size="35" name="xiaoxi"></u-icon>
-					<u-badge type="success" :count="messageNum" :offset="[35, 60]"></u-badge>
-				</u-cell-item>
-			</u-cell-group>
-		</view>
-		<view class="u-m-t-20 u-m-b-40">
-			<u-cell-group>
-				<u-cell-item title="拨打客服电话" @click="phoneCall(phoneNo)">
-					<u-icon slot="icon" custom-prefix="custom-icon" size="35" name="dianhua"></u-icon>
-				</u-cell-item>
-			</u-cell-group>
-		</view>
+    </view>-->
 		
-		<!-- <view class="u-m-t-20">
+    <view class="u-m-t-20">
+      <u-cell-group>
+        <u-cell-item title="消息中心" @click="openPage('pages/message/message', true)">
+          <u-icon slot="icon" custom-prefix="custom-icon" size="35" name="xiaoxi"></u-icon>
+          <u-badge type="success" :count="messageNum" :offset="[38, 80]"></u-badge>
+        </u-cell-item>
+      </u-cell-group>
+    </view>
+    <view class="u-m-t-20 u-m-b-40">
+      <u-cell-group>
+        <u-cell-item title="拨打客服电话" @click="phoneCall(phoneNo)">
+          <u-icon slot="icon" custom-prefix="custom-icon" size="35" name="dianhua"></u-icon>
+        </u-cell-item>
+      </u-cell-group>
+    </view>
+
+    <!-- <view class="u-m-t-20">
 			<u-cell-group>
 				<u-cell-item icon="phone" title="手机号登录" @click="openPage('/pages/center/phoneLogin/phoneLogin')"></u-cell-item>
 			</u-cell-group>
-		</view> -->
-		<!-- 登出提示-->
-		<u-modal
-			v-model="logoutPop"
-			:title-style="{color: '#404040'}"
-			title="登出提示"
-			:show-confirm-button="true"
-			confirm-text="确认"
-			:confirm-style="{backgroundColor: '#3397FA', color: '#fff'}"
-			:show-cancel-button="true"
-			cancel-text="取消"
-			@cancel="logoutPop = false"
-			:cancel-style="{backgroundColor: '#EBF1FF', color: '#3397FA'}"
-			@confirm="loginOut">
-			<view class="slot-content">
-				<view class="pay-tips">你确认退出登录吗?</view>
-			</view>
-		</u-modal>
-		<u-toast ref="uToast" />
-	</view>
+    </view>-->
+		
+    <!-- ===================================== 登出提示 ===================================== -->
+    <u-modal
+      v-model="logoutPop"
+      :title-style="{ color: '#404040' }"
+      title="登出提示"
+      :show-confirm-button="true"
+      confirm-text="确认"
+      :confirm-style="{ backgroundColor: '#3397FA', color: '#fff' }"
+      :show-cancel-button="true"
+      cancel-text="取消"
+      @cancel="logoutPop = false"
+      :cancel-style="{ backgroundColor: '#EBF1FF', color: '#3397FA' }"
+      @confirm="loginOut"
+    >
+      <view class="slot-content">
+        <view class="pay-tips">你确认退出登录吗?</view>
+      </view>
+    </u-modal>
+    <u-toast ref="uToast" />
+  </view>
 </template>
 
 <script>
-	import getUrlParams from "../../utils/getUrlParams.js";
-	export default {
-		data() {
-			return {
-				// 默认头像
-				pic: '/static/img/default-avatar.png',
-				// 用户信息
-				userInfo: [],
-				code: null,
-				phoneNo: '16608538666',
-				logoutPop: false,
-				messageNum: 0
-			}
-		},
-		onLoad() {
-			this.getMsgNum()
-		},
-		onShow() {
-			if(this.$store.state.vuex_hasLogin){
-				this.userInfo = this.$store.state.vuex_user;
-				if(this.$store.state.vuex_wxinfo){
-					this.userInfo = Object.assign(this.userInfo,this.$store.state.vuex_wxinfo);
-				}
-			}else{
-				this.userInfo = [];
-			};
-			let locationLocaturl = window.location.search;
-			this.code = getUrlParams(locationLocaturl, "code");
-			if (this.code&&!this.$store.state.vuex_wxinfo.openId){
-				this.handleGetWXInfo(this.code)
-			};
-		},
-		methods: {
-			openPage(path, flag) {
-				this.$u.route({ 
-					url: path
-				})
-				if (flag) {
-					uni.setStorage({
-					    key: 'messageBack',
-					    data: 'pages/center/index'
-					})
-				}
-			},
-			// 获取消息未读条数
-			getMsgNum() {
-				this.$u.api.getIndexData()
-				.then(res=>{
-					if (res.code === 200) {
-						let num = 0
-						if (res.data.news) {
-							res.data.news.forEach(item => {
-								if (item.readFlag == 0) {
-									num += 1
-								}
-							})
-						}
-						this.messageNum = num
-					} else {
-						this.$refs.uToast.show({
-							title: res.msg,
-							type: 'error'
-						})
-					}
-				})
-				.catch(err => {
-					this.$refs.uToast.show({
-						title: '系统错误!',
-						type: 'error'
-					})
-				})
-			},
-			//登录判断
-			login(status){
-				console.log('this.$store.state.vuex_hasLogin',this.$store.state.vuex_hasLogin);
-				if(!status){
-					this.$u.route({
-						url: 'pages/center/phoneLogin/phoneLogin'
-					});
-				}
-			},
-			customBack(){
-				this.$u.route({
-					type:'switchTab',
-					url: 'pages/index/index'
-				});
-			},
-			phoneCall(phone){
-				uni.makePhoneCall({
-				    phoneNumber: phone
-				});
-			},
-			loginOut() {
-				// this.$store.state.vuex_hasLogin = false
-				// this.$store.state.vuex_wxinfo = null
-				// this.$store.state.vuex_token = ''
-				// this.$store.state.vuex_user = null
-				this.$u.vuex('vuex_hasLogin', false);
-				this.$u.vuex('vuex_wxinfo', null);
-				this.$u.vuex('vuex_token', '');
-				this.$u.vuex('vuex_user', null);
-				this.userInfo = []
-				this.code = ''
-				localStorage.clear()
-				setTimeout(() => {
-					this.logoutPop = false
-					uni.navigateTo({
-						url: '/pages/center/phoneLogin/phoneLogin'
-					})
-				}, 500)
-			},
-			clickHead() {
-				if (this.$store.state.vuex_hasLogin) {
-					this.logoutPop = true
-				}
-			}
-		}
-	}
+import getUrlParams from '../../utils/getUrlParams.js'
+export default {
+  data() {
+    return {
+      // 默认头像
+      pic: '/static/img/default-avatar.png',
+      // 用户信息
+      userInfo: [],
+      code: null,
+      phoneNo: '16608538666',
+      logoutPop: false,
+      messageNum: 0
+    }
+  },
+  onLoad() {},
+  onShow() {
+		this.getMsgNum()
+    if (this.$store.state.vuex_hasLogin) {
+      this.userInfo = this.$store.state.vuex_user;
+      if (this.$store.state.vuex_wxinfo) {
+        this.userInfo = Object.assign(this.userInfo, this.$store.state.vuex_wxinfo);
+      }
+    } else {
+      this.userInfo = [];
+    };
+    // let locationLocaturl = window.location.search;
+    // this.code = getUrlParams(locationLocaturl, "code");
+    // if (this.code && !this.$store.state.vuex_wxinfo.openId) {
+    //   this.handleGetWXInfo(this.code)
+    // };
+  },
+  methods: {
+		/**
+		 * 打开新页面
+		 * @param {String} path 跳转路径
+		 * @param {flag} flag 返回存储标识
+		 * */
+    openPage(path, flag) {
+      this.$u.route({
+        url: path
+      })
+      if (flag) {
+        uni.setStorage({
+          key: 'messageBack',
+          data: 'pages/center/index'
+        })
+      }
+    },
+    // 获取消息未读条数
+    getMsgNum() {
+      this.$u.api.getIndexData()
+        .then(res => {
+          if (res.code === 200) {
+            let num = 0
+            if (res.data.news) {
+              res.data.news.forEach(item => {
+                if (item.readFlag == 0) {
+                  num += 1
+                }
+              })
+            }
+            this.messageNum = num
+          } else {
+            this.$refs.uToast.show({
+              title: res.msg,
+              type: 'error'
+            })
+          }
+        })
+        .catch(err => {
+          this.$refs.uToast.show({
+            title: '系统错误!',
+            type: 'error'
+          })
+        })
+    },
+    //登录判断
+    login(status) {
+      console.log('this.$store.state.vuex_hasLogin', this.$store.state.vuex_hasLogin);
+      if (!status) {
+        this.$u.route({
+          url: 'pages/center/phoneLogin/phoneLogin'
+        });
+      }
+    },
+		// tabbar 返回
+    customBack() {
+      this.$u.route({
+        type: 'switchTab',
+        url: 'pages/index/index'
+      });
+    },
+		// 拨打电话
+    phoneCall(phone) {
+      uni.makePhoneCall({
+        phoneNumber: phone
+      });
+    },
+		// 登出
+    loginOut() {
+      this.$u.vuex('vuex_hasLogin', false);
+      this.$u.vuex('vuex_wxinfo', null);
+      this.$u.vuex('vuex_token', '');
+      this.$u.vuex('vuex_user', null);
+      this.userInfo = []
+      this.code = ''
+      localStorage.clear()
+      setTimeout(() => {
+        this.logoutPop = false
+        uni.navigateTo({
+          url: '/pages/center/phoneLogin/phoneLogin'
+        })
+      }, 500)
+    },
+		// 点击头像
+    clickHead() {
+      if (this.$store.state.vuex_hasLogin) {
+        this.logoutPop = true
+      }
+    }
+  }
+}
 </script>
 
 <style lang="scss" scoped>
-page{background-color: $my-page-bg-color;}
-.user-box{
-	position: relative;
-	background-color: $my-main-color;
-	color: #fff;
-	&:after{
-		position: absolute;
-		right: 0;
-		bottom: 0;
-		content: '';
-		background: url(../../static/img/center-top-bg.png) no-repeat;
-		background-position: -90rpx 0;
-		width: 305rpx;
-		height: 145rpx;
-		z-index: 999;
-	}
+page {
+  background-color: $my-page-bg-color;
+}
+.user-box {
+  position: relative;
+  background-color: $my-main-color;
+  color: #fff;
+  &:after {
+    position: absolute;
+    right: 0;
+    bottom: 0;
+    content: "";
+    background: url(../../static/img/center-top-bg.png) no-repeat;
+    background-position: -90rpx 0;
+    width: 305rpx;
+    height: 145rpx;
+    z-index: 999;
+  }
+}
+.u-avatar {
+  border: 10rpx solid #4caeff;
 }
-.u-avatar{border: 10rpx solid #4CAEFF;}
 .u-cell-box /deep/ .u-cell__left-icon-wrap,
-.u-cell-box /deep/ .custom-icon
-{color: $my-main-color;margin-right: 10rpx;}
-.pay-tips {text-align: center;margin: 30rpx 0;}
+.u-cell-box /deep/ .custom-icon {
+  color: $my-main-color;
+  margin-right: 10rpx;
+}
+.pay-tips {
+  text-align: center;
+  margin: 30rpx 0;
+}
 </style>

+ 16 - 5
pages/center/order/order.vue

@@ -65,15 +65,26 @@
                 <view class="order-center">
                   <view class="order-center-item">订单编号:{{ orderItem.orderId }}</view>
                   <view class="order-center-item">入场时间:{{ orderItem.inTime }}</view>
-                  <view
-                    class="order-center-item"
-                    v-if="orderItem.orderStatus !== 1"
-                  >出场时间:{{ orderItem.outTime }}</view>
+				  <view
+				    class="order-center-item"
+				    v-if="orderItem.orderStatus == 1 && orderItem.outTime"
+				  >预计出场时间:{{orderItem.outTime}}</view>
+				  <view
+				    class="order-center-item"
+				    v-if="orderItem.orderStatus !== 1"
+				  >出场时间:{{ orderItem.outTime }}</view>
                   <view
                     class="order-center-item"
                     v-if="orderItem.orderStatus !== 1"
                   >停留时间:{{ orderItem.duration }}</view>
-                  <view class="order-center-item">
+				  <view
+					class="order-center-item"
+					v-if="orderItem.orderStatus == 1"
+				  >
+				    预计金额:
+				    <span class="pay-amount">{{ orderItem.payAmount }}</span>
+				  </view>
+                  <view class="order-center-item" v-else>
                     应付金额:
                     <span class="pay-amount">{{ orderItem.payAmount }}</span>
                   </view>

+ 35 - 13
pages/center/order/orderDetails/orderDetails.vue

@@ -114,29 +114,46 @@ export default {
       // 订单列表,一般长度为1的数组
       orderList: [],
 	  // 重定向页面
-	  jumpUrl: location.href
+	  jumpUrl: location.href + '&type=open'
     }
   },
   onLoad (page) {
     const orderId = page?.orderId
-    uni.showLoading({
-      title: '加载中',
-      mask: true
-    })
-    setTimeout(() => {
-      if (orderId) {
-        this.orderId = orderId
-        this.handleGetOrderinfo(orderId)
-      }
-    }, 1000)
+	// 该标识判断是否是从支付完成页面回调回来
+	const openFlag = page?.type
+	if (orderId) {
+		this.orderId = orderId
+		// 如果标识存在,证明需要执行轮询判断支付状态,否则直接查询
+		if (openFlag && openFlag === 'open') {
+			this.handleGetOrderinfo(orderId, openFlag)
+			let time = 0
+			this.timer = setInterval(() => {
+				time ++
+				this.handleGetOrderinfo(orderId, openFlag)
+				// 超过60s直接清除轮询
+				if (time === 60) {
+					clearInterval(this.timer)
+				}
+			}, 1000)
+		} else {
+			this.handleGetOrderinfo(orderId)
+		}
+	}
   },
   methods: {
-    handleGetOrderinfo (orderId) {
+	/**
+	 * 通过订单id去获取订单信息
+	 * */
+    handleGetOrderinfo (orderId, openFlag) {
       this.$u.api.getOrderDetail({ id: orderId })
         .then(res => {
           if (res.code === 200) {
-            uni.hideLoading()
             this.orderInfo = res.data
+			if (openFlag === 'open') {
+				if (res.data.payStatus === 1 || res.data.payStatus === 3) {
+					clearInterval(this.timer)
+				}
+			}
           } else {
             this.$refs.uToast.show({
               title: res.msg,
@@ -189,6 +206,11 @@ export default {
         return ''
       }
     }
+  },
+  destroyed() {
+	  if (this.timer) {
+		  clearInterval(this.timer)
+	  }
   }
 }
 </script>

+ 14 - 9
pages/handleMonthly/handleMonthly.vue

@@ -7,7 +7,7 @@
 				<u-icon name="arrow-down" color="#7B7B7B" size="30"></u-icon>
 			</view>
 		</view>
-		<u-select v-model="isShowCarLicense" :list="carLicenseList" @confirm="carLicenseListConfirm"></u-select>
+		<u-select v-model="isShowCarLicense" :list="carLicenseList" :default-value="carLicenseDefaultValue" @confirm="carLicenseListConfirm"></u-select>
 		<view class="handle-monthly-item">
 			<view>车辆信息</view>
 			<view>{{form.carLicense.value | verifyStatusFilter}}</view>
@@ -102,17 +102,19 @@
 				label:"",
 				payWayPop: false,
 				jumpUrl: undefined,
-				monthlyContent: ''
+				monthlyContent: '',
+				carLicenseDefaultValue: [0]
 			}
 		},
 		onLoad (page) {
 			this.getSysterms(0)
-			if (page.roadNo) {
+			if (page.vehicleNo && page.vehicleNo) {
 				this.roadNo = page.roadNo;
-				this.getMonthInfo(this.roadNo);
-			}
-			if (page.vehicleNo) {
 				this.vehicleNo = page.vehicleNo
+				this.getMonthInfo(this.roadNo, this.vehicleNo);
+			} else if (page.roadNo) {
+				this.roadNo = page.roadNo;
+				this.getMonthInfo(this.roadNo);
 			}
 			const baseUrl = window.location.href.split('#')[0]
 			let jumpUrl = baseUrl + '#/pages/center/monthly/monthly'
@@ -189,16 +191,18 @@
 			},
 			carLicenseListConfirm (item) {
 				this.form.carLicense = item[0]
+				this.vehicleNo = item[0].label
+				this.getMonthInfo(this.roadNo, this.vehicleNo)
 			},
-			getMonthInfo(roadNo){
-				this.$u.api.monthInfo({roadNo: this.roadNo})
+			getMonthInfo(roadNo, vehicleNo){
+				this.$u.api.monthInfo({roadNo: roadNo, vehicleNo: vehicleNo})
 				.then(res => {
 					if (res.code === 200){
 						this.lastActiveDate = res.data.lastActiveDate;
 						this.form.monthAmount=res.data.monthAmount;
 						this.carLicenseList = [];
 						let vehicleNoItem = null
-						res.data.vehicleList.forEach(item => {
+						res.data.vehicleList.forEach((item, index) => {
 							const obj = {
 								value: item.energyType,
 								label: item.vehicleNo,
@@ -206,6 +210,7 @@
 							}
 							if (this.vehicleNo == item.vehicleNo) {
 								vehicleNoItem = obj
+								this.carLicenseDefaultValue = [index]
 							}
 							this.carLicenseList.push(obj)
 						});

+ 4 - 1
pages/index/index.scss

@@ -80,6 +80,9 @@ page{background-color: $my-page-bg-color;}
 			font-size: 22rpx;
 			font-weight: 500;
 			color: #787878;
+			display: inline-block;
+			width: 160rpx;
+			text-align: right;
 		}
 		.nosign{
 			width: 100%;
@@ -112,7 +115,7 @@ page{background-color: $my-page-bg-color;}
 	}
 	.pending-order-body-left{
 		.car-number{
-			margin-bottom: 11rpx;
+			margin-bottom: 20rpx;
 			font-size: 30rpx;
 			font-weight: 600;
 			color: #3A3A3A;

ファイルの差分が大きいため隠しています
+ 542 - 449
pages/index/index.vue


+ 4 - 4
pages/message/message.vue

@@ -56,10 +56,10 @@
 				uni.getStorage({
 				    key: 'messageBack',
 				    success: (res) => {
-						this.$u.route({
-							type: 'switchTab',
-							url: res.data
-						})
+							this.$u.route({
+								type: 'switchTab',
+								url: res.data
+							})
 				    }
 				})
 			},

+ 9 - 7
pages/myCars/myCars.vue

@@ -69,15 +69,17 @@
 		onLoad(){
 			this.handlegetMycars();
 		},
-		// onShow() {
-		// 	this.handlegetMycars();
-		// },
 		methods:{
 			customBack(){
-				this.$u.route({
-					type:'switchTab',
-					url: 'pages/index/index'
-				});
+				uni.getStorage({
+				    key: 'messageBack',
+				    success: (res) => {
+							this.$u.route({
+								type: 'switchTab',
+								url: res.data
+							})
+				    }
+				})
 			},
 			// 获取车辆列表
 			handlegetMycars(){

+ 403 - 404
pages/parkingLists/parkingLists.vue

@@ -1,15 +1,16 @@
 <template>
-	<view class="parking">
-		<view class="loading" v-show="loading">
-			<u-loadmore status="loading" icon-type="flower" :load-text="{loading: '正在定位中...',}" />
-		</view>
-		<view class="parking-header">
-			<u-search
+<view class="parking">
+  <view class="loading" v-show="loading">
+    <u-loadmore status="loading" icon-type="flower" :load-text="{loading: '正在定位中...',}" />
+  </view>
+  <view class="parking-header">
+    <u-search
 			placeholder="搜索停车场"
 			v-model="searchContent"
 			:show-action="false"
-			@change="searchInputChange"></u-search>
-			<u-icon
+			@change="searchInputChange"
+		></u-search>
+    <u-icon
 			v-if="!searchContent&&isShowSearchParking==false"
 			class="icon"
 			name="list"
@@ -17,8 +18,9 @@
 			color="#ffffff"
 			placeholder-color="#B5B5B5"
 			search-icon-color="#B3B3B3"
-			@click="listIconClick"></u-icon>
-			<u-icon
+			@click="listIconClick"
+		></u-icon>
+    <u-icon
 			v-if="searchContent||isShowSearchParking==true"
 			class="icon"
 			name="close"
@@ -26,412 +28,409 @@
 			color="#ffffff"
 			placeholder-color="#B5B5B5"
 			search-icon-color="#B3B3B3"
-			@click="clearSearchInput"></u-icon>
-		</view>
-		<view class="parking-map">
-			<map
-				id="pagemap" 
-				style="width: 100%; height: calc(100vh - 240rpx);" 
-				:show-location="true" 
-				:latitude="latitude" 
-				:longitude="longitude" 
-				@markertap="markertap"
-				:enable-traffic="true"
-				:enable-zoom="true"
-				:scale="scale"
-				:markers="covers"></map>
-		</view>
-		<view class="parking-current-address" v-if="nearParkingFlag">
-			<swiper class="swiper"
+			@click="clearSearchInput"
+		></u-icon>
+  </view>
+  <view class="parking-map">
+    <map
+      id="pagemap"
+      style="width: 100%; height: calc(100vh - 240rpx);"
+      :show-location="true"
+      :latitude="latitude"
+      :longitude="longitude"
+      @markertap="markertap"
+      :enable-traffic="true"
+      :enable-zoom="true"
+      :scale="scale"
+      :markers="covers"
+		></map>
+  </view>
+  <view class="parking-current-address" v-if="nearParkingFlag">
+    <swiper class="swiper"
 			:current="swiperCurrent"
 			:indicator-dots="false"
 			:autoplay="false"
 			previous-margin="30rpx"
 			next-margin="30rpx"
-			@change="swiperChange">
-				<swiper-item v-for="(item, index) in nearParkingList" :key="index + 'n'">
-					<view class="swiper-item">
-						<view @click="clickSearchParking(item)">{{item.roadName}}</view>
-						<view>{{item.areaName}}</view>
-						<view class="swiper-item-font">
-							<view>
-								<text>空闲车位</text>
-								<text class="yellow-font">{{item.spaceIdle}}</text>
-							</view>
-							<view v-if="item.monthAmount">
-								<text>包月费用</text>
-								<text class="yellow-font">{{item.monthAmount}}元</text>
-							</view>
-							<view>
-								<text>距离</text>
-								<text>{{item.distance|kmUnit}}</text>
-							</view>
-						</view>
-						<view class="swiper-item-button">
-							<button type="default" @click="navigation(item.latitude, item.longitude)">导航</button>
-							<button
-							type="default"
-							:disabled="!item.monthAmount"
-							:class="{'disabled': !item.monthAmount}"
-							@click="createMonth(item)">办理包月</button>
-						</view>
-						<view @click="lookParkingRule(item)">
-							<text>点击查看停车规则</text>
-							<u-icon name="arrow-right"></u-icon>
-						</view>
-					</view>
-				</swiper-item>
-			</swiper>
-		</view>
-		<view class="parking-address-list" v-if="isShowSearchParking">
-			<view
+			@change="swiperChange"
+		>
+      <swiper-item v-for="(item, index) in nearParkingList" :key="index + 'n'">
+        <view class="swiper-item">
+          <view @click="clickSearchParking(item)">{{item.roadName}}</view>
+          <view>{{item.areaName}}</view>
+          <view class="swiper-item-font">
+            <view>
+              <text>空闲车位</text>
+              <text class="yellow-font">{{item.spaceIdle}}</text>
+            </view>
+            <view v-if="item.monthAmount">
+              <text>包月费用</text>
+              <text class="yellow-font">{{item.monthAmount}}元</text>
+            </view>
+            <view>
+              <text>距离</text>
+              <text>{{item.distance|kmUnit}}</text>
+            </view>
+          </view>
+          <view class="swiper-item-button">
+            <button type="default" @click="navigation(item.latitude, item.longitude)">导航</button>
+            <button
+            type="default"
+            :disabled="!item.monthAmount"
+            :class="{'disabled': !item.monthAmount}"
+            @click="createMonth(item)">办理包月</button>
+          </view>
+          <view @click="lookParkingRule(item)">
+            <text>点击查看停车规则</text>
+            <u-icon name="arrow-right"></u-icon>
+          </view>
+        </view>
+      </swiper-item>
+    </swiper>
+  </view>
+  <view class="parking-address-list" v-if="isShowSearchParking">
+    <view
 			class="parking-address-list-item"
 			v-for="(item, index) in searchParkingList"
 			:key="index + 's'"
-			@click="clickSearchParking(item)">
-				<view class="pali-left">
-					<view>{{item.roadName}}</view>
-					<view>{{item.areaName}}</view>
-				</view>
-				<view class="pali-right">
-					<image
-					src="../../static/img/distance-icon.png"
-					mode="" 
-					@click.stop="navigation(item.latitude, item.longitude)"></image>
-					<view>路线</view>
-				</view>
-			</view>
-		</view>
-		<u-select v-model="mapSelect" :list="mapSelectList" @confirm="mapSelectConfirm"></u-select>
-		<map id="map" hidden="true"></map>
-		<u-toast ref="uToast" />
-	</view>
+			@click="clickSearchParking(item)"
+		>
+      <view class="pali-left">
+        <view>{{item.roadName}}</view>
+        <view>{{item.areaName}}</view>
+      </view>
+      <view class="pali-right">
+        <image
+        src="../../static/img/distance-icon.png"
+        mode=""
+        @click.stop="navigation(item.latitude, item.longitude)"></image>
+        <view>路线</view>
+      </view>
+    </view>
+  </view>
+  <u-select v-model="mapSelect" :list="mapSelectList" @confirm="mapSelectConfirm"></u-select>
+  <map id="map" hidden="true"></map>
+  <u-toast ref="uToast" />
+</view>
 </template>
 
 <script>
-	import Map from '@/js_sdk/ms-openMap/openMap.js';
-	import { qqMapTransBMap } from '../../utils/mapTrans.js';
-	export default{
-		data(){
-			return{
-				searchContent: '',
-				page_map:'',
-				loading: false,
-				latitude: 26.64969,
-				longitude: 106.636453,
-				scale: 16,
-				currentPosition: {
-					latitude: 26.64969,
-					longitude: 106.636453,
-				},
-				covers: [],
-				// 附近列表是否显示
-				nearParkingFlag: false,
-				// 轮播选中
-				swiperCurrent: 0,
-				// 附近停车列表
-				nearParkingList: [],
-				// 是否显示停车场列表
-				isShowSearchParking: false,
-				// 搜索停车场列表
-				searchParkingList: [],
-				// 显示单个停车场数据
-				isShowParkingDetail: false,
-				// 单个停车场数据
-				parkingDetailData: {},
-				mapSelect: false,
-				mapSelectList: [
-					{
-						value: '1',
-						label: '腾讯地图'
-					},
-					// {
-					// 	value: '2',
-					// 	label: '百度地图'
-					// },
-					{
-						value: '3',
-						label: '高德地图'
-					}
-				],
-				// 选中位置经纬度
-				currentPositionHover: {}
-			}
-		},
-		onLoad(page){
-			this.getLocation()
-			if (page.keyword) {
-				this.searchContent = page.keyword
-				this.searchInputChange(page.keyword)
-			}
-		},
-		methods:{
-			/* 
-			 * 查询输入框发生变化
-			 * 
-			 * */
-			searchInputChange (value) {
-				// 为空时关闭搜索列表
-				if (value === '') {
-					this.isShowSearchParking = false
-				}
-				this.isShowParkingDetail = false
-				this.getNearRoadsl()
-			},
-			getLocation(){
-				let that = this;
-				console.log("请求定位")
-				that.loading = true
-				
-				if(navigator.geolocation){
-				//判断是否有这个对象
-					navigator.geolocation.getCurrentPosition(function(pos){
-						console.log("经度:"+pos.coords.longitude+"纬度:"+pos.coords.latitude);
-						that.latitude = pos.coords.latitude;
-						that.longitude = pos.coords.longitude;
-						that.currentPosition.latitude = pos.coords.latitude
-						that.currentPosition.longitude = pos.coords.longitude
-						that.loading = false
-						that.getNearRoadsl()
-					})
-				}else{
-					this.$refs.uToast.show({
-						title: "当前系统不支持GPS API",
-						type: 'error',
-					})
-				};
-				
-				// uni.getLocation({
-				// 	type:"gcj02",
-				// 	success : function (res) {
-				// 		console.log("定位返回信息:", res);
-				// 		that.latitude = res.latitude;
-				// 		that.longitude = res.longitude;
-				// 		that.currentPosition.latitude = res.latitude
-				// 		that.currentPosition.longitude = res.longitude
-				// 		that.loading = false
-				// 		that.getNearRoadsl()
-				// 	},
-				// 	fail: function(res){
-				// 		this.$refs.uToast.show({
-				// 			title: res,
-				// 			type: 'error',
-				// 		})
-				// 	}
-				// })
-				
-			},
-			/**
-			  * 导航 
-			  * */
-			navigation (latitude, longitude) {
-				this.currentPositionHover = {
-					latitude: latitude,
-					longitude: longitude
-				}
-				this.mapSelect = true
-				// 腾讯地图用webview
-				// uni.navigateTo({
-				//   url: '/pages/parkingLists/map_web_view/map_web_view?url=https://3gimg.qq.com/lightmap/v1/marker/?marker=coord:'+latitude+','+longitude+'&referer=myApp&key=BOGBZ-2BZ33-O4L32-Y3QJR-PGN66-RFFEL'
-				// })
-				/* 组件多地图调用 */
-				// this.nearParkingFlag = false
-				// var options = {
-				//     destination:{  // 导航终点点坐标和名称
-				//         latitude: latitude,
-				//         longitude: longitude,
-				//         name: "终点"
-				//     },
-				//     mapId: "map" // map 组件的 id (微信小程序端必传)
-				// }
-				// Map.navigation(options)
-			},
-			// 多地图选择
-			mapSelectConfirm(item) {
-				const name = item[0].label
-				switch(name) {
-					case '腾讯地图':
-						uni.navigateTo({
-						  url: '/pages/parkingLists/map_web_view/map_web_view?url=https://3gimg.qq.com/lightmap/v1/marker/?marker=coord:'+this.currentPositionHover.latitude+','+this.currentPositionHover.longitude+'&referer=myApp&key=BOGBZ-2BZ33-O4L32-Y3QJR-PGN66-RFFEL'
-						})
-						// uni.navigateTo({
-						//   url: '/pages/parkingLists/map_web_view/map_web_view?url=https://3gimg.qq.com/lightmap/v1/marker/?marker=coord:'+this.currentPositionHover.latitude+','+this.currentPositionHover.longitude+'&referer=myApp&key=BOGBZ-2BZ33-O4L32-Y3QJR-PGN66-RFFEL'
-						// })
-						break;
-					case '百度地图':
-					let bdOriginPoint = qqMapTransBMap(this.currentPosition.longitude,this.currentPosition.latitude);//起点坐标
-					let bdCurrPoint = qqMapTransBMap(this.currentPositionHover.longitude,this.currentPositionHover.latitude);//终点坐标
-					let baiduMap = 'https://map.baidu.com/mobile/webapp/index/index/foo=bar/vt=map';
-					console.log('bdpoint',bdOriginPoint);
-					console.log('bdCurrPoint',bdCurrPoint);
-					let bdurl = `https://api.map.baidu.com/direction?origin=latlng:${bdOriginPoint.lat},${bdOriginPoint.lng}|name:起点&destination=latlng:${bdCurrPoint.lat},${bdCurrPoint.lng}|name:终点&mode=driving&output=html&src=webapp.baidu.openAPIdemo`;
-						console.log('百度地图theurl',bdurl);
-						window.location.href = baiduMap;
-						// uni.navigateTo({
-						//   url: `/pages/parkingLists/map_web_view/map_web_view?url=${encodeURIComponent(`http://api.map.baidu.com/direction?origin=latlng:${this.latitude},${this.longitude}|name:起点&destination=latlng:${this.currentPositionHover.latitude},${this.currentPositionHover.longitude}|name:终点&mode=driving&output=html&src=webapp.baidu.openAPIdemo`)}`
-						// })
-						break;
-					case '高德地图':
-					let gdurl = `https://uri.amap.com/navigation?from=${this.currentPosition.longitude},${this.currentPosition.latitude},起点&to=${this.currentPositionHover.longitude},${this.currentPositionHover.latitude},终点&mode=car&policy=1&src=mypage&coordinate=gaode&callnative=0`;
-					 console.log('高德地图theurl',gdurl);
-					 window.location.href = gdurl;
-					 // window.open(url, "_blank", "scrollbars=yes,resizable=1,modal=false,alwaysRaised=yes");
-						// uni.navigateTo({
-						//   url: `/pages/parkingLists/map_web_view/map_web_view?url=${encodeURIComponent(`//uri.amap.com/navigation?from=${this.currentPosition.longitude},${this.currentPosition.latitude},起点&to=${this.currentPositionHover.longitude},${this.currentPositionHover.latitude},终点&mode=car&policy=1&src=mypage&coordinate=gaode&callnative=0`)}`
-						// })
-						break;
-					
-				}
-			},
-			clearSearchInput () {
-				this.searchContent = '';
-				this.isShowSearchParking = false;
-				this.getNearRoadsl()
-			},
-			/**
-			 * lon,lat 为当前选中点的经纬度
-			 * 默认首个点放大 如果有传入经纬度则对应的点放大
-			 * */
-			getNearRoadsl(lon, lat){
-				// await this.getLocation();
-				this.$u.api.nearRoadsl({
-					latitude: this.currentPosition.latitude,
-					longitude:this.currentPosition.longitude,
-					roadName: this.searchContent
-				})
-				.then(res=>{
-					const nearParkingList = [] // 附近停车场列表
-					this.covers = []
-					res.data.forEach((item, index, arr)=>{
-						if(item.latitude && item.longitude){
-							nearParkingList.push(item)
-							let marker = {
-								latitude: item.latitude,
-								longitude: item.longitude,
-								id: String(index),
-								iconPath: require('./../../static/img/parking-icon.png'),
-								width: 20,
-								height: 25
-							}
-							// 选中经纬度图标变大
-							if (lon && lat) {
-								if (lon === item.longitude && lat === item.latitude) {
-									marker.width = 40
-									marker.height = 50
-								}
-							} else {
-								if (this.covers.length > 0) {
-									this.covers[0].width = 40
-									this.covers[0].height = 50
-								}
-							}
-							this.covers.push(marker)
-						}
-					})
-					this.nearParkingList = nearParkingList;
-					if (nearParkingList.length > 0) {
-						this.latitude = nearParkingList[0]?.latitude||this.currentPosition.latitude;
-						this.longitude = nearParkingList[0]?.longitude||this.currentPosition.longitude;
-					} else {
-						this.$refs.uToast.show({
-							title: '没有相关停车场信息',
-							type: 'warning'
-						})
-					}
-					this.nearParkingFlag = true
-					if (this.searchContent) {
-						this.searchParkingList = nearParkingList
-						this.isShowSearchParking = true 
-						this.nearParkingFlag = false
-					}
-				}).catch(err=>{
-					this.$refs.uToast.show({
-						title: err.msg,
-						type: 'error',
-					});
-				});
-			},
-			/**
-			 * 点击地图上的标记点触发
-			 * */
-			markertap(e){
-				let lon,lat
-				this.covers.forEach((item, index) => {
-					if (e.detail.markerId === item.id) {
-						lon = item.longitude
-						lat = item.latitude
-						this.swiperCurrent = index
-					}
-				})
-				this.getNearRoadsl(lon, lat)
-			},
-			/* 
-			 *地址发生变化
-			 * 
-			 * */
-			swiperChange (item) {
-				let map = uni.createMapContext('pagemap');
-				map.moveToLocation({
-					longitude: this.nearParkingList[item.detail.current].longitude,
-					latitude: this.nearParkingList[item.detail.current].latitude
-				})
-				this.getNearRoadsl(this.nearParkingList[item.detail.current].longitude, this.nearParkingList[item.detail.current].latitude)
-			},
-			/**
-			  * 点击单个停车场看详情
-			  * item 为选中项参数
-			  * */
-			clickSearchParking (item) {
-				console.log('clickSearchParking',item)
-				// this.parkingDetailData = item
-				// this.isShowParkingDetail = true
-				// this.latitude = item.latitude
-				// this.longitude = item.longitude
-				// this.getNearRoadsl(item.longitude, item.latitude)
-				// setTimeout(() => {
-				// 	this.isShowSearchParking = false
-				// }, 500)
-				// this.scale = 18
-				this.$u.route({
-					url: 'pages/parkingInformation/parkingInformation',
-					params:{
-						roadInfo:JSON.stringify(item) 
-					}
-				})
-			},
-			/**
-			 * 跳转停车标准页面
-			 * {roadNo} 路段编码
-			  * */
-			lookParkingRule (item) {
-				this.$u.route({
-					url: 'pages/chargeStandard/chargeStandard',
-					params: {
-						roadNo: item.roadNo
-					}
-				})
-			},
-			/*搜索右侧按钮点击
-			*/
-		   listIconClick(){
-			   this.isShowSearchParking = true;
-			   this.nearParkingFlag = false;
-			   this.searchParkingList = this.nearParkingList;
-			   // this.getNearRoadsl();
-		   },
-			createMonth(item){
-				this.$u.route({
-					url: 'pages/handleMonthly/handleMonthly',
-					params: {
-						roadNo:item.roadNo
-					}
-				});
-			}
-		}
-	}
+import Map from '@/js_sdk/ms-openMap/openMap.js'
+import { qqMapTransBMap } from '../../utils/mapTrans.js'
+export default {
+  data () {
+    return {
+      searchContent: '',
+      page_map: '',
+      loading: false,
+      latitude: 26.64969,
+      longitude: 106.636453,
+      scale: 16,
+      currentPosition: {
+        latitude: 26.64969,
+        longitude: 106.636453
+      },
+      covers: [],
+      // 附近列表是否显示
+      nearParkingFlag: false,
+      // 轮播选中
+      swiperCurrent: 0,
+      // 附近停车列表
+      nearParkingList: [],
+      // 是否显示停车场列表
+      isShowSearchParking: false,
+      // 搜索停车场列表
+      searchParkingList: [],
+      // 显示单个停车场数据
+      isShowParkingDetail: false,
+      // 单个停车场数据
+      parkingDetailData: {},
+      mapSelect: false,
+      mapSelectList: [
+        {
+          value: '1',
+          label: '腾讯地图'
+        },
+        // {
+        //  value: '2',
+        //  label: '百度地图'
+        // },
+        {
+          value: '3',
+          label: '高德地图'
+        }
+      ],
+      // 选中位置经纬度
+      currentPositionHover: {}
+    }
+  },
+  onLoad (page) {
+    this.getLocation()
+    if (page.keyword) {
+      this.searchContent = page.keyword
+      this.searchInputChange(page.keyword)
+    }
+  },
+  methods: {
+    /**
+     * 查询输入框发生变化
+     * @date 2021-08-10
+     * @param {String} value
+     */
+    searchInputChange (value) {
+      // 为空时关闭搜索列表
+      if (value === '') {
+        this.isShowSearchParking = false
+      }
+      this.isShowParkingDetail = false
+      this.getNearRoadsl()
+    },
+    /**
+     * 获取定位
+     * @date 2021-08-10
+     * @returns {any}
+     */
+    getLocation () {
+      const that = this
+      console.log('请求定位')
+      that.loading = true
+
+      if (navigator.geolocation) {
+        // 判断是否有这个对象
+        navigator.geolocation.getCurrentPosition(function (pos) {
+          console.log('经度:' + pos.coords.longitude + '纬度:' + pos.coords.latitude)
+          that.latitude = pos.coords.latitude
+          that.longitude = pos.coords.longitude
+          that.currentPosition.latitude = pos.coords.latitude
+          that.currentPosition.longitude = pos.coords.longitude
+          that.loading = false
+          that.getNearRoadsl()
+        })
+      } else {
+        this.$refs.uToast.show({
+          title: '当前系统不支持GPS API',
+          type: 'error'
+        })
+      };
+    },
+    /**
+     * 导航
+     * @date 2021-08-10
+     * @param {Number} latitude
+     * @param {Number} longitude
+     * @returns {any}
+     */
+    navigation (latitude, longitude) {
+      this.currentPositionHover = {
+        latitude: latitude,
+        longitude: longitude
+      }
+      this.mapSelect = true
+      // 腾讯地图用webview
+      // uni.navigateTo({
+      //   url: '/pages/parkingLists/map_web_view/map_web_view?url=https://3gimg.qq.com/lightmap/v1/marker/?marker=coord:'+latitude+','+longitude+'&referer=myApp&key=BOGBZ-2BZ33-O4L32-Y3QJR-PGN66-RFFEL'
+      // })
+      /* 组件多地图调用 */
+      // this.nearParkingFlag = false
+      // var options = {
+      //     destination:{  // 导航终点点坐标和名称
+      //         latitude: latitude,
+      //         longitude: longitude,
+      //         name: "终点"
+      //     },
+      //     mapId: "map" // map 组件的 id (微信小程序端必传)
+      // }
+      // Map.navigation(options)
+    },
+    // 多地图选择
+    mapSelectConfirm (item) {
+      const name = item[0].label
+      switch (name) {
+        case '腾讯地图':
+          uni.navigateTo({
+            url: '/pages/parkingLists/map_web_view/map_web_view?url=https://3gimg.qq.com/lightmap/v1/marker/?marker=coord:' + this.currentPositionHover.latitude + ',' + this.currentPositionHover.longitude + '&referer=myApp&key=BOGBZ-2BZ33-O4L32-Y3QJR-PGN66-RFFEL'
+          })
+          // uni.navigateTo({
+          //   url: '/pages/parkingLists/map_web_view/map_web_view?url=https://3gimg.qq.com/lightmap/v1/marker/?marker=coord:'+this.currentPositionHover.latitude+','+this.currentPositionHover.longitude+'&referer=myApp&key=BOGBZ-2BZ33-O4L32-Y3QJR-PGN66-RFFEL'
+          // })
+          break
+        case '百度地图':
+          const bdOriginPoint = qqMapTransBMap(this.currentPosition.longitude, this.currentPosition.latitude) // 起点坐标
+          const bdCurrPoint = qqMapTransBMap(this.currentPositionHover.longitude, this.currentPositionHover.latitude) // 终点坐标
+          const baiduMap = 'https://map.baidu.com/mobile/webapp/index/index/foo=bar/vt=map'
+          const bdurl = `https://api.map.baidu.com/direction?origin=latlng:${bdOriginPoint.lat},${bdOriginPoint.lng}|name:起点&destination=latlng:${bdCurrPoint.lat},${bdCurrPoint.lng}|name:终点&mode=driving&output=html&src=webapp.baidu.openAPIdemo`
+          console.log('百度地图theurl', bdurl)
+          window.location.href = baiduMap
+          break
+        case '高德地图':
+          const gdurl = `https://uri.amap.com/navigation?from=${this.currentPosition.longitude},${this.currentPosition.latitude},起点&to=${this.currentPositionHover.longitude},${this.currentPositionHover.latitude},终点&mode=car&policy=1&src=mypage&coordinate=gaode&callnative=0`
+          console.log('高德地图theurl', gdurl)
+          window.location.href = gdurl
+          // window.open(url, "_blank", "scrollbars=yes,resizable=1,modal=false,alwaysRaised=yes");
+          // uni.navigateTo({
+          //   url: `/pages/parkingLists/map_web_view/map_web_view?url=${encodeURIComponent(`//uri.amap.com/navigation?from=${this.currentPosition.longitude},${this.currentPosition.latitude},起点&to=${this.currentPositionHover.longitude},${this.currentPositionHover.latitude},终点&mode=car&policy=1&src=mypage&coordinate=gaode&callnative=0`)}`
+          // })
+          break
+      }
+    },
+    /**
+     * 清空搜索框内容
+     * @date 2021-08-10
+     * @returns {any}
+     */
+    clearSearchInput () {
+      this.searchContent = ''
+      this.isShowSearchParking = false
+      this.getNearRoadsl()
+    },
+    /**
+     * 默认首个点放大 如果有传入经纬度则对应的点放大
+     * @date 2021-08-10
+     * @param {Number} lon
+     * @param {Number} lat
+     * @returns {any}
+     */
+    getNearRoadsl (lon, lat) {
+      this.$u.api.nearRoadsl({
+        latitude: this.currentPosition.latitude,
+        longitude: this.currentPosition.longitude,
+        roadName: this.searchContent
+      })
+        .then(res => {
+          const nearParkingList = [] // 附近停车场列表
+          this.covers = []
+          res.data.forEach((item, index, arr) => {
+            if (item.latitude && item.longitude) {
+              nearParkingList.push(item)
+              const marker = {
+                latitude: item.latitude,
+                longitude: item.longitude,
+                id: String(index),
+                iconPath: require('./../../static/img/parking-icon.png'),
+                width: 20,
+                height: 25
+              }
+              // 选中经纬度图标变大
+              if (lon && lat) {
+                if (lon === item.longitude && lat === item.latitude) {
+                  marker.width = 40
+                  marker.height = 50
+                }
+              } else {
+                if (this.covers.length > 0) {
+                  this.covers[0].width = 40
+                  this.covers[0].height = 50
+                }
+              }
+              this.covers.push(marker)
+            }
+          })
+          this.nearParkingList = nearParkingList
+          if (nearParkingList.length > 0) {
+            this.latitude = nearParkingList[0]?.latitude || this.currentPosition.latitude
+            this.longitude = nearParkingList[0]?.longitude || this.currentPosition.longitude
+          } else {
+            this.$refs.uToast.show({
+              title: '没有相关停车场信息',
+              type: 'warning'
+            })
+          }
+          this.nearParkingFlag = true
+          if (this.searchContent) {
+            this.searchParkingList = nearParkingList
+            this.isShowSearchParking = true
+            this.nearParkingFlag = false
+          }
+        }).catch(err => {
+          this.$refs.uToast.show({
+            title: err.msg,
+            type: 'error'
+          })
+        })
+    },
+    /**
+      * 点击地图上的标记点触发
+      **/
+    markertap (e) {
+      let lon, lat
+      this.covers.forEach((item, index) => {
+        if (e.detail.markerId === item.id) {
+          lon = item.longitude
+          lat = item.latitude
+          this.swiperCurrent = index
+        }
+      })
+      this.getNearRoadsl(lon, lat)
+    },
+    /**
+     * 地址发生变化
+     * @date 2021-08-10
+     * @param {Object} item
+     * @returns {any}
+     */
+    swiperChange (item) {
+      const map = uni.createMapContext('pagemap')
+      map.moveToLocation({
+        longitude: this.nearParkingList[item.detail.current].longitude,
+        latitude: this.nearParkingList[item.detail.current].latitude
+      })
+      this.getNearRoadsl(this.nearParkingList[item.detail.current].longitude, this.nearParkingList[item.detail.current].latitude)
+    },
+    /**
+     * 点击单个停车场看详情
+     * @date 2021-08-10
+     * @param {Object} item 为选中项参数
+     * @returns {any}
+     */
+    clickSearchParking (item) {
+      this.$u.route({
+        url: 'pages/parkingInformation/parkingInformation',
+        params: {
+          roadInfo: JSON.stringify(item)
+        }
+      })
+    },
+    /**
+     * 跳转停车标准页面
+     * @date 2021-08-10
+     * @param {Object} item
+     * @returns {any}
+     */
+    lookParkingRule (item) {
+      this.$u.route({
+        url: 'pages/chargeStandard/chargeStandard',
+        params: {
+          roadNo: item.roadNo
+        }
+      })
+    },
+    /**
+     * 搜索右侧按钮点击
+     **/
+    listIconClick () {
+      this.isShowSearchParking = true
+      this.nearParkingFlag = false
+      this.searchParkingList = this.nearParkingList
+    },
+    /**
+     * 跳转包月
+     * @date 2021-08-10
+     * @param {Object} item
+     * @returns {any}
+     */
+    createMonth (item) {
+      this.$u.route({
+        url: 'pages/handleMonthly/handleMonthly',
+        params: {
+          roadNo: item.roadNo
+        }
+      })
+    }
+  }
+}
 </script>
 
 <style lang="scss" scoped>
-	.wrap{margin-top: 20vh;}
-	@import url("./parkingLists.scss");
+.wrap{margin-top: 20vh;}
+@import url("./parkingLists.scss");
 </style>

+ 11 - 10
pages/payLists/payLists.vue

@@ -33,16 +33,17 @@
 		</view>
 		<!-- 缴费提示-->
 		<u-modal
-		v-model="payTipsPop"
-		:title-style="{color: '#404040'}"
-		title="缴费提示"
-		:show-confirm-button="true"
-		confirm-text="立即缴费"
-		:confirm-style="{backgroundColor: '#3397FA', color: '#fff'}"
-		:show-cancel-button="true"
-		cancel-text="取消"
-		:cancel-style="{backgroundColor: '#EBF1FF', color: '#3397FA'}"
-		@confirm="payTipsPopConfirm">
+			v-model="payTipsPop"
+			:title-style="{color: '#404040'}"
+			title="缴费提示"
+			:show-confirm-button="true"
+			confirm-text="立即缴费"
+			:confirm-style="{backgroundColor: '#3397FA', color: '#fff'}"
+			:show-cancel-button="true"
+			cancel-text="取消"
+			:cancel-style="{backgroundColor: '#EBF1FF', color: '#3397FA'}"
+			@confirm="payTipsPopConfirm"
+		>
 			<view class="slot-content">
 				<view class="pay-tips">
 					<text>{{payTipsItem.num}}</text>场停车欠费,共

+ 8 - 0
pages/paymentMethod/paymentMethod.vue

@@ -73,6 +73,9 @@
 			 * @param {String} deviceNo 设备编号(只有车位锁部分有)
 			 * */
 			gyBankPay() {
+				uni.showLoading({
+				    title: '加载中'
+				});
 				const params = {
 					orderList: this.curOrderList,
 					deviceNo: this.deviceNo,
@@ -88,6 +91,7 @@
 							type: 'info',
 						});
 						setTimeout(() => {
+							uni.hideLoading();
 							location.reload()
 						}, 1000)
 					}
@@ -107,6 +111,9 @@
 			 * 最后再调起微信支付
 			 * */
 			wechatPay() {
+				uni.showLoading({
+				    title: '加载中'
+				});
 				// const openId = this.$store.state.vuex_wxinfo.openId
 				// if (openId) {
 				// 	this.getWXPay(this.curOrderList, this.deviceNo)
@@ -166,6 +173,7 @@
 						if (res.code === 200) {
 							location.href = res.data.qrCodeUrl
 						} else {
+							uni.hideLoading()
 							this.$refs.uToast.show({
 								title: res.msg,
 								type: 'error',