Explorar el Código

Merge branch 'gczdev' of http://172.16.90.201:3000/parking/parking_h5 into gczdev

# Conflicts:
#	common/http.interceptor.js
zaijin hace 3 años
padre
commit
76775289ed

+ 4 - 4
common/config.js

@@ -14,12 +14,12 @@ const config = {
 	
 	// 登录重定向首页地址
 	// jumpHomeUrl: 'http://h5.pdzhtc.com/#/', // 正式服务器地址
-	// jumpHomeUrl: 'http://wx.hw.hongweisoft.com/wxpaydemoh5/#/', // 64服务器地址
-	jumpHomeUrl: 'http://localhost:8080/#/', // 本地测试地址
+	jumpHomeUrl: 'http://wx.hw.hongweisoft.com/wxpaydemoh5/#/', // 64服务器地址
+	// jumpHomeUrl: 'http://localhost:8080/#/', // 本地测试地址
 	// 重定位登录页
 	// jumpLoginUrl: 'http://h5.pdzhtc.com/#/pages/center/phoneLogin/phoneLogin', // 正式环境地址
-	// jumpLoginUrl: 'http://wx.hw.hongweisoft.com/wxpaydemoh5/#/pages/center/phoneLogin/phoneLogin', // 64环境地址
-	jumpLoginUrl: 'http://localhost:8080/#/pages/center/phoneLogin/phoneLogin', // 本地环境地址
+	jumpLoginUrl: 'http://wx.hw.hongweisoft.com/wxpaydemoh5/#/pages/center/phoneLogin/phoneLogin', // 64环境地址
+	// jumpLoginUrl: 'http://localhost:8080/#/pages/center/phoneLogin/phoneLogin', // 本地环境地址
 	
 }
 export {

+ 0 - 1
common/http.interceptor.js

@@ -57,7 +57,6 @@ const install = (Vue, vm) => {
 			uni.navigateTo({
 				url: "/pages/center/phoneLogin/phoneLogin"
 			})
-			// setTimeout(()=>{location.href = config.jumpLoginUrl});
 			
 		}else return res;
 	}

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

@@ -24,7 +24,7 @@
 									<view class="order-center-item">应付金额:<span class="pay-amount">{{orderItem.payAmount}}</span></view>
 								</view>
 								<view class="order-bottom">
-									<u-cell-item title="收费标准"></u-cell-item>
+									<u-cell-item title="收费标准" @click.native.stop="jumpChargeStandard(orderItem)"></u-cell-item>
 								</view>
 							</view>
 							<u-loadmore :status="loadStatus[index]" bgColor="#F6F6FF"></u-loadmore>
@@ -142,6 +142,15 @@ export default {
 					orderId: id
 				}
 			});
+		},
+		jumpChargeStandard(item) {
+			console.log(item)
+			this.$u.route({
+				url: 'pages/chargeStandard/chargeStandard',
+				params: {
+					roadNo: item.roadNo
+				}
+			});
 		}
 	},
 	filters:{

+ 9 - 2
pages/center/order/orderDetails/orderDetails.vue

@@ -3,7 +3,8 @@
 		<view class="order-info">
 			<u-image class="order-info-img" width="90rpx" height="90rpx" src="../../../../static/img/position.png"></u-image>
 			<view class="addr">{{orderInfo.roadName}}</view>
-			<view class="pay-amount">-{{orderInfo.payAmount}}</view>
+			<view class="pay-amount" v-if="orderInfo.payAmount">-{{orderInfo.payAmount}}</view>
+			<view class="pay-amount" v-else>{{orderInfo.payAmount}}</view>
 			<u-cell-group :border="false">
 				<u-cell-item title="车牌号" :arrow="false" :border-bottom="false" :border-top="false" :value="orderInfo.vehicleNo"></u-cell-item>
 				<u-cell-item title="优惠总金额" :arrow="false" :border-bottom="false" :border-top="false" :value="orderInfo.preferentialAmount"></u-cell-item>
@@ -106,11 +107,17 @@
 		filters:{
 			verifyPaySource(value) {
 				if (value === 0) {
-				  return '支付';
+				  return '现金支付';
 				}else if(value === 1){
 					return '微信支付';				
 				} else if(value === 2){
 					return '支付宝支付';				
+				}else if(value === 3){
+					return '贵州银行快捷支付';				
+				}else if(value === 4){
+					return '贵州银行扫码支付';				
+				}else if(value === 5){
+					return '贵州银行被扫支付';				
 				}else {
 				  return '';
 				}

+ 92 - 101
pages/index/index.vue

@@ -178,37 +178,22 @@
 				知道了
 			</view>
 		</u-popup>
-		<!-- 缴费方式-->
-		<u-modal
-		v-model="payWayPop"
-		:title-style="{color: '#404040'}"
-		title="缴费方式"
-		: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>
-				<button class="pay-way-close-btn" @click="payWayPop = false">关闭</button>
-			</view>
-		</u-modal>
+		<!-- 支付方式 -->
+		<PaymentMethod
+			:payWayPop="payWayPop"
+			:curOrderList="curOrderList"
+			@closePaymentMethod="closePaymentMethod"></PaymentMethod>
 		<u-toast ref="uToast" />
 	</view>
 </template>
 
 <script>
 	import getUrlParams from "../../utils/getUrlParams.js";
+	import PaymentMethod from '@/pages/paymentMethod/paymentMethod.vue'
 	export default {
-		// components: {
-		// 	citySelect
-		// },
+		components: {
+			PaymentMethod
+		},
 		data() {
 			return {
 				city: '普定县',
@@ -257,6 +242,7 @@
 			if(this.code&&!this.$store.state.vuex_wxinfo.openId){this.handleGetWXInfo(this.code)};
 		},
 		methods: {
+			// 定位
 			getLocation(){
 				const that = this
 				uni.getLocation({
@@ -308,6 +294,7 @@
 					url: path
 				})
 			},
+			// 搜索
 			handleSearch(){
 				console.log('this.keyword',this.keyword);
 				uni.reLaunch({
@@ -389,83 +376,87 @@
 					}
 				})
 			},
-			gyBankPay() {
-				this.$u.api.payGzbank({orderList: this.curOrderList}).then(res=>{
-					let payUrl = res.data.url;
-					this.currentPayUrl=encodeURIComponent(res.data.url);
-					this.$u.route({
-						url: 'pages/payLists/pay',
-						params: {
-							currentPayUrl: this.currentPayUrl
-						}
-					});
-				}).catch(err=>{
-					this.$refs.uToast.show({
-						title: err.msg,
-						type: 'error',
-					});
-				});
-			},
-			// 微信支付
-			wechatPay() {
-				const openId = this.$store.state.vuex_wxinfo.openId
-				if (openId) {
-					this.getWXPay(this.curOrderList)
-				} else {
-					this.getCode()
-				}
-			},
-			async getWXPay(list){
-				let params = {
-					orderList: list,
-					openid: this.$store.state.vuex_wxinfo.openId
-				};
-				await this.$wxApi.config();
-				this.$pay.wechatPay(params).then(res =>{
-					if(res.code == 0){
-						// 成功
-						this.$u.route({
-							url:'/',
-						});
-					}else if(res.code == 1){
-						// 取消
-						// uni.redirectTo({
-						// 	url: '/pages/userCenter/myOrder/myOrder'
-						// })
-					}else if(res.code == 2){
-						this.$refs.uToast.show({
-							title: '支付失败,请检查!',
-							type: 'error',
-							// url: '/pages/user/index'
-						});
-					}
-				});
-			},
-			getCode () {
-				var local = window.location.href // 获取页面url
-				let locationLocaturl = window.location.search;
-				this.code = getUrlParams(locationLocaturl,"code"); // 截取code
-				if (this.code == null || this.code === '') { // 如果没有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 {
-					this.handleGetWXInfo(this.code) //把code传给后台获取用户信息
-				}
-			},
-			handleGetWXInfo (code) { // 通过code获取 openId等用户信息,/api/user/wechat/login 为后台接口
-				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)
-					}
-				}).catch((err) => {
-					this.$refs.uToast.show({
-						title: err.msg,
-						type: 'error',
-					});
-				})
-			},
+			// gyBankPay() {
+			// 	this.$u.api.payGzbank({orderList: this.curOrderList}).then(res=>{
+			// 		let payUrl = res.data.url;
+			// 		this.currentPayUrl=encodeURIComponent(res.data.url);
+			// 		this.$u.route({
+			// 			url: 'pages/payLists/pay',
+			// 			params: {
+			// 				currentPayUrl: this.currentPayUrl
+			// 			}
+			// 		});
+			// 	}).catch(err=>{
+			// 		this.$refs.uToast.show({
+			// 			title: err.msg,
+			// 			type: 'error',
+			// 		});
+			// 	});
+			// },
+			// // 微信支付
+			// wechatPay() {
+			// 	const openId = this.$store.state.vuex_wxinfo.openId
+			// 	if (openId) {
+			// 		this.getWXPay(this.curOrderList)
+			// 	} else {
+			// 		this.getCode()
+			// 	}
+			// },
+			// async getWXPay(list){
+			// 	let params = {
+			// 		orderList: list,
+			// 		openid: this.$store.state.vuex_wxinfo.openId
+			// 	};
+			// 	await this.$wxApi.config();
+			// 	this.$pay.wechatPay(params).then(res =>{
+			// 		if(res.code == 0){
+			// 			// 成功
+			// 			this.$u.route({
+			// 				url:'/',
+			// 			});
+			// 		}else if(res.code == 1){
+			// 			// 取消
+			// 			// uni.redirectTo({
+			// 			// 	url: '/pages/userCenter/myOrder/myOrder'
+			// 			// })
+			// 		}else if(res.code == 2){
+			// 			this.$refs.uToast.show({
+			// 				title: '支付失败,请检查!',
+			// 				type: 'error',
+			// 				// url: '/pages/user/index'
+			// 			});
+			// 		}
+			// 	});
+			// },
+			// getCode () {
+			// 	var local = window.location.href // 获取页面url
+			// 	let locationLocaturl = window.location.search;
+			// 	this.code = getUrlParams(locationLocaturl,"code"); // 截取code
+			// 	if (this.code == null || this.code === '') { // 如果没有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 {
+			// 		this.handleGetWXInfo(this.code) //把code传给后台获取用户信息
+			// 	}
+			// },
+			// handleGetWXInfo (code) { // 通过code获取 openId等用户信息,/api/user/wechat/login 为后台接口
+			// 	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)
+			// 		}
+			// 	}).catch((err) => {
+			// 		this.$refs.uToast.show({
+			// 			title: err.msg,
+			// 			type: 'error',
+			// 		});
+			// 	})
+			// },
+			// 关闭弹框
+			closePaymentMethod() {
+				this.payWayPop = false
+			}
 		}
 	}
 </script>

+ 21 - 3
pages/message/message.vue

@@ -35,7 +35,8 @@
 		data() {
 			return {
 				messageList: [],
-				newId:''
+				newId:'',
+				list: []
 			};
 		},
 		computed: {
@@ -73,8 +74,17 @@
 				// this.getMessageList()
 				this.$u.api.getMessageList({pageSize:pageSize ,pageNum: pageNum})
 				.then(res=>{
+					if(res.code == 200){
 					console.log(res)
-					this.newId = res.data.rows[0].id;
+					this.list=[],
+					res.data.rows.forEach(item =>{
+						const obj = {
+							id: item.id,
+						}
+						this.list.push(obj)
+						console.log(obj)
+					})
+					this.newId = this.list[0]
 					console.log(this.newId)
 					// 接口返回的当前页数据列表 (数组)
 					let curPageData = res.data.rows;
@@ -97,7 +107,15 @@
 					setTimeout(()=>{
 						this.mescroll.endSuccess(curPageLen)
 					},20)
-				})
+					}else{
+						this.mescroll.endErr()
+					}
+				}).catch(err=>{
+					this.$refs.uToast.show({
+						title: err.msg,
+						type: 'error',
+					});
+				});
 				
 			},
 			goDetails(content,createTime,title){

+ 17 - 12
pages/parkingLock/parkingLock.vue

@@ -200,15 +200,19 @@
 			},
 			// 贵阳银行支付
 			gyBankPay() {
-				this.$u.api.payGzbank({orderList: this.orderList, deviceNo: this.deviceNo}).then(res=>{
-					let payUrl = res.data.url;
-					this.currentPayUrl=encodeURIComponent(res.data.url);
-					this.$u.route({
-						url: 'pages/payLists/pay',
-						params: {
-							currentPayUrl: this.currentPayUrl
-						}
-					});
+				this.$u.api.payGzbank({
+						orderList: this.orderList,
+						deviceNo: this.deviceNo,
+						jumpUrl: window.location.href
+					}).then(res=>{
+						let payUrl = res.data.url;
+						this.currentPayUrl=encodeURIComponent(res.data.url);
+						this.$u.route({
+							url: 'pages/payLists/pay',
+							params: {
+								currentPayUrl: this.currentPayUrl
+							}
+						});
 				}).catch(err=>{
 					this.$refs.uToast.show({
 						title: err.msg,
@@ -235,9 +239,7 @@
 				this.$pay.wechatPay(params).then(res =>{
 					if(res.code == 0){
 						// 成功
-						this.$u.route({
-							url:'/',
-						});
+						
 					}else if(res.code == 1){
 						// 取消
 						// uni.redirectTo({
@@ -250,6 +252,9 @@
 							// url: '/pages/user/index'
 						});
 					}
+					setTimeout(() => {
+						window.location.reload()
+					}, 1000)
 				});
 			},
 			getCode () {

+ 15 - 126
pages/payLists/payLists.vue

@@ -50,27 +50,11 @@
 				</view>
 			</view>
 		</u-modal>
-		<!-- 缴费方式-->
-		<u-modal
-		v-model="payWayPop"
-		:title-style="{color: '#404040'}"
-		title="缴费方式"
-		: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>
-				<button class="pay-way-close-btn" @click="payWayPop = false">关闭</button>
-			</view>
-		</u-modal>
+		<!-- 支付方式 -->
+		<PaymentMethod
+			:payWayPop="payWayPop"
+			:curOrderList="currentItem"
+			@closePaymentMethod="closePaymentMethod"></PaymentMethod>
 		<u-toast ref="uToast" />
 	</view>
 </template>
@@ -78,8 +62,12 @@
 <script>
 	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
 	import getUrlParams from "../../utils/getUrlParams.js";
+	import PaymentMethod from '@/pages/paymentMethod/paymentMethod.vue'
 	export default {
 		mixins: [MescrollMixin], // 使用mixin
+		components: {
+			PaymentMethod
+		},
 		data() {
 			return {
 				currentPayUrl: "",
@@ -118,17 +106,7 @@
 			}
 		},
 		onLoad(){
-			// let locationLocaturl = window.location.hash;
-			// this.orderId = getUrlParams(locationLocaturl,"orderId"); // 截取orderId
-			// console.log('this.orderId',this.orderId);
-			// if (this.orderId) {
-			// 	this.handleGetOrderinfo(this.orderId);
-			// }
-			// this.code = getUrlParams(locationLocaturl,"code");
-			// if (this.code) {
-			// 	this.handleGetWXInfo(this.code)
-			// }
-			
+
 		},
 		methods: {
 			customBack(){
@@ -226,54 +204,23 @@
 			},
 			// 去支付,选择支付方式
 			choosePayWay(item) {
-				console.log(item)
 				this.currentItem = []
 				this.currentItem.push(item)
 				this.payWayPop = true
 			},
-			// 贵阳银行支付
-			gyBankPay(list) {
-				this.$u.api.payGzbank({orderList: this.currentItem}).then(res=>{
-					let payUrl = res.data.url;
-					this.currentPayUrl=encodeURIComponent(res.data.url);
-					// console.log('this.currentPayUrl',this.currentPayUrl);
-					// return;
-					this.$u.route({
-						url: 'pages/payLists/pay',
-						params: {
-							currentPayUrl:this.currentPayUrl
-						}
-					});
-				}).catch(err=>{
-					this.$refs.uToast.show({
-						title: err.msg,
-						type: 'error',
-					});
-				});
-			},
-			// 微信支付
-			wechatPay() {
-				const openId = this.$store.state.vuex_wxinfo.openId
-				if (openId) {
-					this.getWXPay(this.currentItem)
-				} else {
-					this.getCode()
-				}
-			},
 			// 全部缴费确认
 			confirmPrice() {
 				let orderNum = 0, price = 0
 				this.currentItem = []
 				this.payList.forEach(item => {
-					console.log(item)
 					if (item.orderStatus !== 4 && item.payStatus !== 1 ) {
-						price += item.payAmount
+						price += Number(item.payAmount)
 						orderNum ++
 						this.currentItem.push(item.orderId)
 					}
 				})
 				this.payTipsItem.num = orderNum
-				this.payTipsItem.price = price
+				this.payTipsItem.price = price.toFixed(2)
 				if (orderNum !== 0 && price !== 0) {
 					this.payTipsPop = true
 				} else {
@@ -287,69 +234,9 @@
 			payTipsPopConfirm() {
 				this.payWayPop = true
 			},
-			getCode () {
-				var local = window.location.href // 获取页面url
-				let locationLocaturl = window.location.search;
-				this.code = getUrlParams(locationLocaturl,"code"); // 截取code
-				if (this.code == null || this.code === '') { // 如果没有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 {
-					this.handleGetWXInfo(this.code) //把code传给后台获取用户信息
-				}
-			},
-			handleGetWXInfo (code) { // 通过code获取 openId等用户信息,/api/user/wechat/login 为后台接口
-				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)
-					} else {
-						this.$refs.uToast.show({
-							title: res.msg,
-							type: 'error',
-						});
-					}
-				}).catch((err) => {
-					this.$refs.uToast.show({
-						title: err.msg,
-						type: 'error',
-					});
-				})
-			},
-			async getWXPay(list){
-				let params = {
-					orderList: list,
-					openid:this.$store.state.vuex_wxinfo.openId
-				};
-				await this.$wxApi.config();
-				this.$pay.wechatPay(params).then(res =>{
-					if(res.code == 0){
-						// 成功
-						this.$u.route({
-							url:'pages/payLists/payLists',
-						});
-					}else if(res.code == 1){
-						// 取消
-						// uni.redirectTo({
-						// 	url: '/pages/userCenter/myOrder/myOrder'
-						// })
-					}else if(res.code == 2){
-						this.$refs.uToast.show({
-							title: '支付失败,请检查!',
-							type: 'error',
-							// url: '/pages/user/index'
-						});
-					}
-				});
-			},
 			handleGetOrderinfo(orderId){
 				this.$u.api.getOrderinfo({id:orderId})
 				.then(res=>{
-					// this.$refs.uToast.show({
-					// 	title: res.msg,
-					// 	type: 'success',
-					// });
 					this.orderInfo = res.data;
 					console.log('handleGetOrderinfo',JSON.parse(JSON.stringify(res)));
 				}).catch(err=>{
@@ -357,10 +244,12 @@
 						title: err.msg,
 						type: 'error',
 					});
-					console.log('handleGetOrderinfo ',err)
 				});
 				
 			},
+			closePaymentMethod() {
+				this.payWayPop = false
+			}
 		}
 	};
 </script>

+ 23 - 21
pages/paymentMethod/paymentMethod.vue

@@ -1,9 +1,8 @@
 <template>
 	<!-- 
-		支付方式选择  微信or支付宝
+		支付方式选择  微信or贵阳银行
 	 -->
 	<view>
-		<!-- 缴费方式-->
 		<u-modal
 		v-model="payWayPop"
 		:title-style="{color: '#404040'}"
@@ -49,9 +48,7 @@
 			}
 		},
 		data() {
-			return {
-				
-			}
+			return {}
 		},
 		methods: {
 			/**
@@ -62,7 +59,8 @@
 			gyBankPay() {
 				const params = {
 					orderList: this.curOrderList,
-					deviceNo: this.deviceNo
+					deviceNo: this.deviceNo,
+					jumpUrl: window.location.href
 				};
 				this.$u.api.payGzbank(params).then(res=>{
 					let payUrl = res.data.url;
@@ -99,6 +97,7 @@
 			/**
 			 * 调起微信支付接口
 			 * @param {Array} list 需要支付的订单组合数组
+			 * @param {Number} deviceNo 设备编号(在停车锁部分需要)
 			 * */
 			async getWXPay(orderList, deviceNo){
 				let params = {
@@ -108,21 +107,24 @@
 				};
 				await this.$wxApi.config();
 				this.$pay.wechatPay(params).then(res =>{
-					if(res.code == 0){
-						// 成功
-						this.$u.route({
-							url:'/',
-						});
-					}else if (res.code == 1){
-						// 取消
-						// uni.redirectTo({
-						// 	url: '/pages/userCenter/myOrder/myOrder'
-						// })
-					}else if (res.code == 2){
-						this.$refs.uToast.show({
-							title: '支付失败,请检查!',
-							type: 'error',
-						});
+					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;
 					}
 				});
 			},