空白格 2 yıl önce
ebeveyn
işleme
736d486fc1

+ 1 - 1
pages/center/order/orderDetails/orderDetails.vue

@@ -46,7 +46,7 @@
 					<u-cell-item title="免费时长 " :arrow="false" :border-bottom="false" :border-top="false"
 						:value="orderInfo.freeDuration"></u-cell-item>
 				</template>
-				<<!-- template v-else>
+				<!-- <template v-else>
 					<u-cell-item title="免费时长 " :arrow="false" :border-bottom="false" :border-top="false" :value="new Date(orderInfo.createTime).valueOf() < new Date('2022-06-20 00:00:00').valueOf() ? '0天0时15分0秒' : '0天0时30分0秒'"></u-cell-item>
 				</template> -->
 				<u-cell-item title=" 计费时长 " :arrow=" false" :border-bottom="false" :border-top="false"

+ 38 - 38
pages/parkingLists/parkingLists.scss

@@ -1,5 +1,5 @@
 .parking {
-	background-color: #008CFF;
+	background-color: #008cff;
 	position: relative;
 }
 .parking-header {
@@ -19,7 +19,7 @@
 	left: 30rpx;
 	background-color: #fff;
 	border-radius: 26.5rpx;
-	box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1)
+	box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
 }
 .parking-details-header {
 	display: flex;
@@ -43,7 +43,7 @@
 	color: rgba(0, 140, 255, 1);
 }
 .parking-details-button {
-	background-color: #008CFF;
+	background-color: #008cff;
 	height: 103rpx;
 	line-height: 103rpx;
 	border-bottom-left-radius: 26.5rpx;
@@ -57,7 +57,7 @@
 .parking-details-right-distance {
 	height: 44rpx;
 	line-height: 44rpx;
-	color: #008CFF;
+	color: #008cff;
 	display: flex;
 	flex-direction: row;
 	margin-bottom: 20rpx;
@@ -76,13 +76,13 @@
 }
 .parking-current-address {
 	position: absolute;
-	bottom: 84rpx;
+	bottom: 80rpx;
 	z-index: 1000;
 	width: 100%;
 	height: 345rpx;
 }
 .parking-current-address .swiper {
-	height: 400rpx;
+	height: 430rpx;
 }
 .parking-current-address .swiper-item {
 	background-color: #fff;
@@ -91,21 +91,21 @@
 	border-radius: 25rpx;
 	padding: 30rpx;
 }
-.parking-current-address .swiper-item>view:first-child {
+.parking-current-address .swiper-item > view:first-child {
 	font-size: 32rpx;
 	color: #484848;
 	line-height: 50rpx;
 }
-.parking-current-address .swiper-item>view:nth-child(2) {
+.parking-current-address .swiper-item > view:nth-child(2) {
 	font-size: 24rpx;
 	color: #969696;
 	line-height: 50rpx;
 }
-.parking-current-address .swiper-item>view:nth-child(3) {
+.parking-current-address .swiper-item > view:nth-child(3) {
 	display: flex;
 	flex-direction: row;
-	background: -webkit-gradient(linear, 0% 0%, 0% 100%,from(#fff), to(#F4F7FF));/*谷歌*/
-	background: linear-gradient(to right, #fff 0%, #F4F7FF 50%, #fff 100%);
+	background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#f4f7ff)); /*谷歌*/
+	background: linear-gradient(to right, #fff 0%, #f4f7ff 50%, #fff 100%);
 	justify-content: space-around;
 	height: 71rpx;
 	line-height: 71rpx;
@@ -113,15 +113,15 @@
 	margin-top: 20rpx;
 	margin-bottom: 20rpx;
 }
-.parking-current-address .swiper-item>view:nth-child(4) {
+.parking-current-address .swiper-item > view:nth-child(4) {
 	display: flex;
 	flex-direction: row;
 	justify-content: space-around;
 }
-.parking-current-address .swiper-item>view:nth-child(5) {
+.parking-current-address .swiper-item > view:nth-child(5) {
 	text-align: center;
 	margin-top: 30rpx;
-	color: #A4A4A4;
+	color: #a4a4a4;
 	font-size: 24rpx;
 }
 .parking-address-list {
@@ -159,7 +159,7 @@
 	color: #969696;
 	margin-top: 10rpx;
 	overflow: hidden;
-	text-overflow:ellipsis;
+	text-overflow: ellipsis;
 	white-space: nowrap;
 }
 .pali-right image {
@@ -171,11 +171,11 @@
 	font-size: 20rpx;
 }
 .yellow-font {
-	color: #FA6400;
+	color: #fa6400;
 	margin-left: 10rpx;
 }
 .swiper-item-font {
-	color: #6D6D6D;
+	color: #6d6d6d;
 	font-size: 28rpx;
 }
 .swiper-item-button button {
@@ -185,16 +185,16 @@
 	font-size: 30rpx;
 }
 .swiper-item-button button:first-child {
-	border: solid 1px #008CFF;
-	color: #008CFF;
+	border: solid 1px #008cff;
+	color: #008cff;
 	margin-right: 4%;
 }
 .swiper-item-button button:last-child {
-	background-color: #008CFF;
+	background-color: #008cff;
 	color: #fff;
 }
 .swiper-item-button .disabled {
-	background-color: #d2d2d2!important;
+	background-color: #d2d2d2 !important;
 }
 .loading {
 	width: 100%;
@@ -224,11 +224,11 @@
 	justify-content: space-between;
 	padding: 25rpx;
 }
-.padt-header>view>view:nth-child(1) {
+.padt-header > view > view:nth-child(1) {
 	color: #484848;
 	font-size: 32rpx;
 }
-.padt-header>view.padt-header-title>view:nth-child(2) {
+.padt-header > view.padt-header-title > view:nth-child(2) {
 	color: #969696;
 	font-size: 24rpx;
 	margin-top: 16rpx;
@@ -238,7 +238,7 @@
 }
 .padt-header-icon view {
 	font-size: 18rpx;
-	color: #3A3A3A;
+	color: #3a3a3a;
 }
 .padt-header image {
 	width: 45rpx;
@@ -251,7 +251,7 @@
 	color: #727275;
 }
 .padt-timeline text {
-	color: #FA6B0B;
+	color: #fa6b0b;
 	margin-left: 5rpx;
 	font-size: 29rpx;
 }
@@ -264,25 +264,25 @@
 	display: flex;
 	flex-direction: row;
 }
-.parking-address-details-numer>view {
+.parking-address-details-numer > view {
 	width: 48%;
 	height: 110rpx;
 	padding: 15rpx;
 	text-align: center;
-	background: linear-gradient(359deg, #FFFFFF 0%, #F6F6FF 100%);
+	background: linear-gradient(359deg, #ffffff 0%, #f6f6ff 100%);
 	border-radius: 15px;
 }
-.parking-address-details-numer>view>view:first-child {
-	color: #008CFF;
+.parking-address-details-numer > view > view:first-child {
+	color: #008cff;
 	font-size: 56rpx;
 	font-weight: 400;
 }
-.parking-address-details-numer>view>view:last-child {
+.parking-address-details-numer > view > view:last-child {
 	color: #838383;
 	font-size: 24rpx;
 	font-weight: 400;
 }
-.parking-address-details-numer>view:last-child {
+.parking-address-details-numer > view:last-child {
 	margin-left: 4%;
 }
 .parking-address-details-price {
@@ -291,22 +291,22 @@
 	width: calc(100% - 30rpx);
 	margin: 10rpx auto 0;
 }
-.parking-address-details-price>view:first-child {
+.parking-address-details-price > view:first-child {
 	font-size: 24rpx;
 	color: #787878;
 	font-weight: 400;
 	text-align: center;
 	padding-top: 24rpx;
 }
-.parking-address-details-price>view>text:first-child {
+.parking-address-details-price > view > text:first-child {
 	font-size: 66rpx;
-	color: #008CFF;
+	color: #008cff;
 }
-.parking-address-details-price>view:last-child {
+.parking-address-details-price > view:last-child {
 	width: 100%;
 	height: 81rpx;
 	line-height: 81rpx;
-	background: linear-gradient(180deg, #EFEFFF 0%, #FFFFFF 100%);
+	background: linear-gradient(180deg, #efefff 0%, #ffffff 100%);
 	border-bottom-left-radius: 25rpx;
 	border-bottom-right-radius: 25rpx;
 	text-align: center;
@@ -317,9 +317,9 @@
 	height: 96rpx;
 	line-height: 96rpx;
 	margin: 103rpx auto 57rpx;
-	background-color: #008CFF;
+	background-color: #008cff;
 	border-radius: 10rpx;
 	text-align: center;
 	font-size: 28rpx;
 	color: #fff;
-}
+}

+ 413 - 426
pages/parkingLists/parkingLists.vue

@@ -1,436 +1,423 @@
 <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
-			placeholder="搜索停车场"
-			v-model="searchContent"
-			:show-action="false"
-			@change="searchInputChange"
-		></u-search>
-    <u-icon
-			v-if="!searchContent&&isShowSearchParking==false"
-			class="icon"
-			name="list"
-			size="44"
-			color="#ffffff"
-			placeholder-color="#B5B5B5"
-			search-icon-color="#B3B3B3"
-			@click="listIconClick"
-		></u-icon>
-    <u-icon
-			v-if="searchContent||isShowSearchParking==true"
-			class="icon"
-			name="close"
-			size="36"
-			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"
-			: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
-			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>
+	<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
+				v-if="!searchContent && isShowSearchParking == false"
+				class="icon"
+				name="list"
+				size="44"
+				color="#ffffff"
+				placeholder-color="#B5B5B5"
+				search-icon-color="#B3B3B3"
+				@click="listIconClick"
+			></u-icon>
+			<u-icon
+				v-if="searchContent || isShowSearchParking == true"
+				class="icon"
+				name="close"
+				size="36"
+				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" :current="swiperCurrent" :indicator-dots="false" :vertical="true" :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 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>
 </template>
 
 <script>
-import Map from '@/js_sdk/ms-openMap/openMap.js'
-import { qqMapTransBMap } from '../../utils/mapTrans.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
+	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();
+		// this.getNearRoadsl()
+		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
-        }
-      })
-    }
-  }
-}
+			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'
+					});
+					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) {
+			if (item.monthAmount) {
+				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>

+ 28 - 10
pages/paymentMethod/paymentMethod.scss

@@ -17,26 +17,26 @@
 }
 .pay-way-new {
 	display: flex;
-	justify-content: space-between;
-	width: calc(100% - 80rpx);
+	justify-content: space-around;
+	width: calc(100% - 60rpx);
 	border-top: solid 1px #979797;
-	margin: 23rpx auto;
-	padding: 36rpx 0;
+	margin: 23rpx auto 0;
+	padding: 36rpx 0 10rpx;
 	.pay-way-item {
-		width: calc(50% - 9rpx);
+		width: calc(33% - 9rpx);
 		border-radius: 20rpx;
 		text-align: center;
 		padding: 30rpx 0;
 		image {
-			width: 159rpx;
-			height: 159rpx;
+			width: 110rpx;
+			height: 110rpx;
 		}
 		.title {
-			font-size: 30rpx;
+			font-size: 28rpx;
 			font-weight: 400;
 			font-family: 'PingFangSC-Regular, PingFang SC';
 			color: #fff;
-			margin: 15rpx 0;
+			margin: 10rpx 0;
 		}
 		.subtitle {
 			font-size: 14rpx;
@@ -49,9 +49,27 @@
 	.pay-way-item-hy {
 		background: linear-gradient(153deg, #FA9460 0%, #FF5065 100%)
 	}
-	.pay-way-item-jh {
+	.pay-way-item-wx {
 		background: linear-gradient(155deg, #5EE3A6 0%, #3EB9C8 100%);
 	}
+	.pay-way-item-jh {
+		background: linear-gradient(155deg, #5AA6FF 0%, #C782FF 100%);
+	}
+}
+.pay-way-subtitle {
+	display: flex;
+	justify-content: space-around;
+	width: calc(100% - 60rpx);
+	margin: 0 auto 60rpx;
+	&-item {
+		width: calc(33% - 9rpx);
+		border-radius: 20rpx;
+		text-align: center;
+		font-size: 20rpx;
+		font-weight: 400;
+		font-family: 'PingFangSC-Regular, PingFang SC';
+		opacity: 0.73;
+	}
 }
 .pay-way-close-btn {
 	width: calc(100% - 80rpx);

+ 232 - 202
pages/paymentMethod/paymentMethod.vue

@@ -3,25 +3,10 @@
 		支付方式选择  微信or贵阳银行
 	 -->
 	<view>
-		<u-modal
-		v-model="payWayPop"
-		:title-style="{color: '#404040'}"
-		title="缴费方式"
-		:show-confirm-button="false"
-		:show-cancel-button="false">
+		<u-modal v-model="payWayPop" :title-style="{ color: '#404040' }" title="缴费方式" width="660rpx" :show-confirm-button="false" :show-cancel-button="false">
 			<view class="slot-content">
-				<!-- <view class="pay-way">
-					<view class="pay-way-item" @click="gyBankPay">
-						<image src="../../static/img/gy-bank-pay-icon.png" mode=""></image>
-						<view>贵州银行</view>
-					</view>
-					<view class="pay-way-item" @click="wechatPay">
-						<image src="../../static/img/wechat-pay-icon.png" mode=""></image>
-						<view>微信支付</view>
-					</view>
-				</view> -->
 				<view class="pay-way-new">
-					<view class="pay-way-item pay-way-item-hy" @click="gyBankPay">
+					<!-- <view class="pay-way-item pay-way-item-hy" @click="gyBankPay">
 						<image src="../../static/img/guiyang-bank-icon.png" mode=""></image>
 						<view class="title">贵州银行</view>
 						<view class="subtitle">前三个月每天首次一分钱<br/>长期八折优惠</view>
@@ -29,7 +14,28 @@
 					<view class="pay-way-item pay-way-item-jh" @click="wechatPay">
 						<image src="../../static/img/juhe-icon.png" mode=""></image>
 						<view class="title">微信/支付宝</view>
+					</view> -->
+					<view class="pay-way-item pay-way-item-hy" @click="gyBankPay">
+						<image src="/static/img/gyyh-icon.svg" mode=""></image>
+						<view class="title">贵州银行</view>
+					</view>
+					<!-- #ifdef H5 || MP-WEIXIN -->
+					<view class="pay-way-item pay-way-item-wx" @click="wechatPay" v-if="wxEnv">
+						<image src="/static/img/weixin-icon.svg" mode=""></image>
+						<view class="title">微信支付</view>
 					</view>
+					<!-- #endif -->
+					<view class="pay-way-item pay-way-item-jh" @click="juhePay">
+						<image src="/static/img/juhe-icon.svg" mode=""></image>
+						<view class="title">聚合支付</view>
+					</view>
+				</view>
+				<view class="pay-way-subtitle">
+					<view class="pay-way-subtitle-item">前三个月每天首次一分钱,长期八折优惠</view>
+					<!-- #ifdef H5 || MP-WEIXIN -->
+					<view class="pay-way-subtitle-item" v-if="wxEnv">&nbsp;</view>
+					<!-- #endif -->
+					<view class="pay-way-subtitle-item">&nbsp;</view>
 				</view>
 				<button class="pay-way-close-btn" @click="closePaymentMethod">关闭</button>
 			</view>
@@ -39,218 +45,242 @@
 </template>
 
 <script>
-	import getUrlParams from "@/utils/getUrlParams.js";
-	// import {
-	// 	getEnvIsWx
-	// } from '@/utils/judgEnvironment.js'
-	export default {
-		props: {
-			// 弹框显示
-			payWayPop: {
-				type: Boolean,
-				default: false
-			},
-			// 订单数组
-			curOrderList: {
-				type: Array,
-				default: null
-			},
-			// 设备编号
-			deviceNo: {
-				type: String,
-				default: null
-			},
-			// 地磁支付需要字段
-			payeeId: {
-				type: String,
-				default: undefined
-			},
-			// 地磁支付需要字段
-			payeeName: {
-				type: String,
-				default: undefined
-			},
-			// 跳转页面
-			jumpUrl: {
-				type: String,
-				default: null
-			}
+import getUrlParams from '@/utils/getUrlParams.js';
+import { getEnvIsWx } from '@/utils/judgEnvironment.js';
+export default {
+	props: {
+		// 弹框显示
+		payWayPop: {
+			type: Boolean,
+			default: false
 		},
-		data() {
-			return {}
+		// 订单数组
+		curOrderList: {
+			type: Array,
+			default: null
 		},
-		methods: {
-			/**
-			 * 贵阳银行支付
-			 * @param {Array} orderList 需要支付的订单号组成的数组
-			 * @param {String} deviceNo 设备编号(只有车位锁部分有)
-			 * */
-			gyBankPay() {
-				uni.showLoading({
-				    title: '加载中'
-				});
-				const params = {
-					orderList: this.curOrderList,
-					deviceNo: this.deviceNo,
-					jumpUrl: this.jumpUrl,
-					payeeId: this.payeeId,
-					payeeName: this.payeeName
-				};
-				this.$u.api.payGzbank(params).then(res=>{
+		// 设备编号
+		deviceNo: {
+			type: String,
+			default: null
+		},
+		// 地磁支付需要字段
+		payeeId: {
+			type: String,
+			default: undefined
+		},
+		// 地磁支付需要字段
+		payeeName: {
+			type: String,
+			default: undefined
+		},
+		// 跳转页面
+		jumpUrl: {
+			type: String,
+			default: null
+		}
+	},
+	data() {
+		return {
+			wxEnv: true
+		};
+	},
+	created() {
+		this.wxEnv = getEnvIsWx();
+	},
+	methods: {
+		/**
+		 * 贵阳银行支付
+		 * @param {Array} orderList 需要支付的订单号组成的数组
+		 * @param {String} deviceNo 设备编号(只有车位锁部分有)
+		 * */
+		gyBankPay() {
+			uni.showLoading({
+				title: '加载中'
+			});
+			const params = {
+				orderList: this.curOrderList,
+				deviceNo: this.deviceNo,
+				jumpUrl: this.jumpUrl,
+				payeeId: this.payeeId,
+				payeeName: this.payeeName
+			};
+			this.$u.api
+				.payGzbank(params)
+				.then(res => {
 					if (res.data.needPay) {
 						let payUrl = res.data.url;
 						location.href = payUrl;
 					} else {
 						this.$refs.uToast.show({
 							title: '无需支付',
-							type: 'info',
+							type: 'info'
 						});
 						setTimeout(() => {
 							uni.hideLoading();
-							location.reload()
-						}, 1000)
+							location.reload();
+						}, 1000);
 					}
-				}).catch(err=>{
+				})
+				.catch(err => {
 					this.$refs.uToast.show({
 						title: err.msg,
-						type: 'error',
+						type: 'error'
 					});
 				});
-			},
-			/**
-			 * 微信支付
-			 * 判断vuex中是否存在openId
-			 * 存在直接调起微信支付
-			 * 不存在则通过微信登录去获取用户的code
-			 * 完成后通过code去获取用户的openId等信息
-			 * 最后再调起微信支付
-			 * */
-			wechatPay() {
-				uni.showLoading({
-				    title: '加载中'
-				});
-				this.getWXPayByJava(this.curOrderList, this.deviceNo)
-			},
-			/**
-			 * 调起微信支付接口
-			 * @param {Array} list 需要支付的订单组合数组
-			 * @param {Number} deviceNo 设备编号(在停车锁部分需要)
-			 * */
-			async getWXPay(orderList, deviceNo){
-				let params = {
-					orderList: orderList,
-					openid: this.$store.state.vuex_wxinfo.openId,
-					deviceNo: deviceNo ? deviceNo : null
-				};
-				
-				await this.$wxApi.config();
-				this.$pay.wechatPay(params).then(res =>{
-					switch (Number(res.code)) {
-						case 0: // 成功
-							//#ifdef H5
-								
-								window.location.reload();
-							//#endif
-							break;
-						case 1: // 取消
-							this.$refs.uToast.show({
-								title: '已取消支付',
-								type: 'info',
-							});
-							break;
-						case 2: // 支付失败
-							this.$refs.uToast.show({
-								title: '支付失败,请检查!',
-								type: 'error',
-							});
-							break;
-					}
-				});
-			},
-			/**
-			 * 直接通过后台获取贵阳银行微信支付地址
-			 * @param {Array} list 需要支付的订单组合数组
-			 * @param {Number} deviceNo 设备编号(在停车锁部分需要)
-			 * */
-			getWXPayByJava(orderList, deviceNo) {
-				let params = {
-					orderList: orderList,
-					openid: '',
-					jumpUrl: this.jumpUrl,
-					deviceNo: deviceNo ? deviceNo : null,
-					payeeId: this.payeeId,
-					payeeName: this.payeeName
-				};
-				this.$u.api.ordinaryWxPay(params)
-					.then(res => {
-						if (res.code === 200) {
-							// if (getEnvIsWx()) {
-							// 	location.href = res.data.qrCodeUrl + '&jump_url=' + encodeURIComponent(this.jumpUrl)
-							// } else {
-							// 	location.href = res.data.qrCodeUrl
-							// }
-							localStorage.setItem('jumpUrl', this.jumpUrl)
-							location.href = res.data.qrCodeUrl
-							// this.cookie.set("jumpUrl",this.jumpUrl);
-						} else {
-							uni.hideLoading();
-						}
-					})
-					.catch(err => {
+		},
+		/**
+		 * 聚合支付
+		 * 判断vuex中是否存在openId
+		 * 存在直接调起微信支付
+		 * 不存在则通过微信登录去获取用户的code
+		 * 完成后通过code去获取用户的openId等信息
+		 * 最后再调起微信支付
+		 * */
+		juhePay() {
+			uni.showLoading({
+				title: '加载中'
+			});
+			this.getWXPayByJava(this.curOrderList, this.deviceNo);
+		},
+		/**
+		 * 微信支付
+		 */
+		wechatPay() {
+			// this.$refs.uToast.show({
+			// 	title: '暂不支持',
+			// 	type: 'info',
+			// });
+			this.$pay.wxPay({ orderList: this.curOrderList, openid: this.vuex_wxinfo.openId }).then(res => {
+				console.log(res);
+			});
+		},
+		/**
+		 * 调起微信支付接口
+		 * @param {Array} list 需要支付的订单组合数组
+		 * @param {Number} deviceNo 设备编号(在停车锁部分需要)
+		 * */
+		async getWXPay(orderList, deviceNo) {
+			let params = {
+				orderList: orderList,
+				openid: this.$store.state.vuex_wxinfo.openId,
+				deviceNo: deviceNo ? deviceNo : null
+			};
+
+			await this.$wxApi.config();
+			this.$pay.wechatPay(params).then(res => {
+				switch (Number(res.code)) {
+					case 0: // 成功
+						//#ifdef H5
+
+						window.location.reload();
+						//#endif
+						break;
+					case 1: // 取消
+						this.$refs.uToast.show({
+							title: '已取消支付',
+							type: 'info'
+						});
+						break;
+					case 2: // 支付失败
 						this.$refs.uToast.show({
-							title: '无法调起微信支付!',
-							type: 'error',
+							title: '支付失败,请检查!',
+							type: 'error'
 						});
-					})
-			},
-			/**
-			 * 获取code
-			 * 1 微信登录获取code
-			 * 2 url中截取
-			 * */
-			getCode () {
-				// 获取页面完整url
-				const local = window.location.href
-				// 获取url后面的参数
-				const locationLocaturl = window.location.search;
-				// 截取url中的code
-				this.code = getUrlParams(locationLocaturl, "code");
-				// 如果没有code,则去请求
-				if (this.code == null || this.code === '') {
-					window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${this.config.wxAppid}&redirect_uri=${encodeURIComponent(local)}&response_type=code&scope=snsapi_userinfo&#wechat_redirect`
-				} else {
-					// 把code传给后台获取用户信息
-					this.handleGetWXInfo(this.code)
+						break;
 				}
-			},
-			/**
-			 * 通过code获取openId等用户信息
-			 * 拿到用户信息后再调起微信支付
-			 * */
-			handleGetWXInfo (code) {
-				let _this = this
-				this.$u.api.getWXInfo(code).then((res) => {
-					if (res.code === 200 ) {
+			});
+		},
+		/**
+		 * 直接通过后台获取贵阳银行微信支付地址
+		 * @param {Array} list 需要支付的订单组合数组
+		 * @param {Number} deviceNo 设备编号(在停车锁部分需要)
+		 * */
+		getWXPayByJava(orderList, deviceNo) {
+			let params = {
+				orderList: orderList,
+				openid: '',
+				jumpUrl: this.jumpUrl,
+				deviceNo: deviceNo ? deviceNo : null,
+				payeeId: this.payeeId,
+				payeeName: this.payeeName
+			};
+			this.$u.api
+				.ordinaryWxPay(params)
+				.then(res => {
+					if (res.code === 200) {
+						// if (getEnvIsWx()) {
+						// 	location.href = res.data.qrCodeUrl + '&jump_url=' + encodeURIComponent(this.jumpUrl)
+						// } else {
+						// 	location.href = res.data.qrCodeUrl
+						// }
+						localStorage.setItem('jumpUrl', this.jumpUrl);
+						location.href = res.data.qrCodeUrl;
+						// this.cookie.set("jumpUrl",this.jumpUrl);
+					} else {
+						uni.hideLoading();
+					}
+				})
+				.catch(err => {
+					this.$refs.uToast.show({
+						title: '无法调起微信支付!',
+						type: 'error'
+					});
+				});
+		},
+		/**
+		 * 获取code
+		 * 1 微信登录获取code
+		 * 2 url中截取
+		 * */
+		getCode() {
+			// 获取页面完整url
+			const local = window.location.href;
+			// 获取url后面的参数
+			const locationLocaturl = window.location.search;
+			// 截取url中的code
+			this.code = getUrlParams(locationLocaturl, 'code');
+			// 如果没有code,则去请求
+			if (this.code == null || this.code === '') {
+				window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${this.config.wxAppid}&redirect_uri=${encodeURIComponent(
+					local
+				)}&response_type=code&scope=snsapi_userinfo&#wechat_redirect`;
+			} else {
+				// 把code传给后台获取用户信息
+				this.handleGetWXInfo(this.code);
+			}
+		},
+		/**
+		 * 通过code获取openId等用户信息
+		 * 拿到用户信息后再调起微信支付
+		 * */
+		handleGetWXInfo(code) {
+			let _this = this;
+			this.$u.api
+				.getWXInfo(code)
+				.then(res => {
+					if (res.code === 200) {
 						this.$u.vuex('vuex_wxinfo', res.data);
-						this.getWXPay(this.currentItem)
+						this.getWXPay(this.currentItem);
 					}
-				}).catch((err) => {
+				})
+				.catch(err => {
 					this.$refs.uToast.show({
 						title: err.msg,
-						type: 'error',
+						type: 'error'
 					});
-				})
-			},
-			/**
-			 * 关闭弹框
-			 * */
-			closePaymentMethod() {
-				this.$emit('closePaymentMethod')
-			}
+				});
+		},
+		/**
+		 * 关闭弹框
+		 * */
+		closePaymentMethod() {
+			this.$emit('closePaymentMethod');
 		}
 	}
+};
 </script>
 
 <style lang="scss" scoped>
-@import './paymentMethod.scss'
+@import './paymentMethod.scss';
 </style>

+ 62 - 40
pay.js

@@ -11,42 +11,64 @@ import $http from "./uview-ui/libs/request"
 
 export default {
 	//微信支付
+	// wxPay(obj = {}) {
+	// 	uni.showLoading({
+	// 		title: '支付中'
+	// 	});
+	// 	return new Promise(r => {
+	// 		$http.post("/client/wechat/pay",obj)
+	// 			.then(res=>{
+	// 				//#ifdef H5
+	// 				$wxApi.JSAPI(res.data).then(r);
+	// 				//#endif
+	// 				this.payError(res);
+	// 			}).catch(err =>{
+	// 				// alert(err.msg);
+	// 				console.log('pay err',err);
+	// 			})
+	// 	});
+	// },
+	// 微信支付
 	wxPay(obj = {}) {
 		uni.showLoading({
 			title: '支付中'
 		});
 		return new Promise(r => {
-			$http.post("/client/wechat/pay",obj)
-				// 区分包月支付和普通支付
-					if (res.data.needPay && !res.data.monthId) {
-						//#ifdef H5
-						$wxApi.JSAPI(res.data.wx, jumpUrl).then(r);
-						//#endif
-					} else if (res.data.monthId) {
-						//#ifdef H5
-						$wxApi.JSAPI(res.data.wx, jumpUrl).then(r);
-						//#endif
+			$http.post("/client/wechat/pay", obj)
+			// 区分包月支付和普通支付
+			if (res.data.needPay && !res.data.monthId) {
+				//#ifdef H5
+				$wxApi.JSAPI(res.data.wx, jumpUrl).then(r);
+				//#endif
+			} else if (res.data.monthId) {
+				//#ifdef H5
+				$wxApi.JSAPI(res.data.wx, jumpUrl).then(r);
+				//#endif
+			} else {
+				uni.showToast({
+					title: "无需支付",
+					icon: "none",
+					duration: 2000
+				});
+				setTimeout(() => {
+					//#ifdef H5
+					if (jumpUrl) {
+						window.location.href = jumpUrl;
 					} else {
-						uni.showToast({
-							title: "无需支付",
-							icon: "none",
-							duration: 2000
-						});
-						setTimeout(() =>{
-							//#ifdef H5
-							if (jumpUrl) {
-								window.location.href = jumpUrl;
-							} else {
-								window.location.reload();
-							}
-							//#endif
-						}, 1500)
+						window.location.reload();
 					}
-					this.payError(res);
-				}).catch(err =>{
-					// alert(err.msg);
-					console.log('pay err',err);
-				})
+					//#endif
+				}, 1500)
+			}
+			// $http.post("/client/pay/wechat", obj)
+			// 	.then(res => {
+			// 		//#ifdef H5
+			// 		$wxApi.JSAPI(res.data).then(r);
+			// 		//#endif
+			// 		this.payError(res);
+			// 	}).catch(err => {
+			// 		console.log('pay err', err);
+			// 	})
 		});
 	},
 	/**
@@ -61,7 +83,7 @@ export default {
 		});
 		return new Promise(r => {
 			$http.post(url, obj)
-				.then(res=>{
+				.then(res => {
 					// 区分包月支付和普通支付
 					if (res.data.needPay && !res.data.monthId) {
 						//#ifdef H5
@@ -77,7 +99,7 @@ export default {
 							icon: "none",
 							duration: 2000
 						});
-						setTimeout(() =>{
+						setTimeout(() => {
 							//#ifdef H5
 							if (jumpUrl) {
 								window.location.href = jumpUrl;
@@ -88,23 +110,23 @@ export default {
 						}, 1500)
 					}
 					this.payError(res);
-				}).catch(err =>{
+				}).catch(err => {
 					// alert(err.msg);
-					console.log('pay err',err);
+					console.log('pay err', err);
 				})
 		});
 	},
 	//支付错误处理
-	payError(res){
+	payError(res) {
 		uni.hideLoading();
-		if(res.code == 623){
-			setTimeout(i=>{
+		if (res.code == 623) {
+			setTimeout(i => {
 				new Vue().$api.goto("/pages/userCenter/myOrder/myOrder");
-			},2000);
+			}, 2000);
 			uni.showToast({
-				title:res.msg + "    即将跳转到订单页",
-				icon:"none",
-				duration:2000
+				title: res.msg + "    即将跳转到订单页",
+				icon: "none",
+				duration: 2000
 			});
 		}
 	}

Dosya farkı çok büyük olduğundan ihmal edildi
+ 20 - 0
static/img/gyyh-icon.svg


Dosya farkı çok büyük olduğundan ihmal edildi
+ 14 - 0
static/img/juhe-icon.svg


Dosya farkı çok büyük olduğundan ihmal edildi
+ 14 - 0
static/img/weixin-icon.svg