gcz 3 anni fa
parent
commit
cbfc46cefc

+ 3 - 3
common/apiurl.js

@@ -35,11 +35,11 @@ const apiurl = {
 	parkInInfoUrl:'/payee/memberinfo/parkIn/info',
 	
 	//现金支付
-	cashPayUrl:'/payment/cash',
+	cashPayUrl:'/pay/cash',
 	//贵州银行扫码支付
-	gzbankSweptUrl:'/payment/gzbank/swept',
+	gzbankSweptUrl:'/pay/gzbank/swept',
 	//贵州银行二维码支付
-	gzbankPolypayUrl:'/payment/gzbank/polypay',
+	gzbankPolypayUrl:'/pay/gzbank/polypay',
 	
 	//七牛文件上传
 	qiniuUploadUrl:'/file/qiniu/upload',

+ 274 - 0
package-lock.json

@@ -0,0 +1,274 @@
+{
+  "requires": true,
+  "lockfileVersion": 1,
+  "dependencies": {
+    "@chenfengyuan/vue-qrcode": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npm.taobao.org/@chenfengyuan/vue-qrcode/download/@chenfengyuan/vue-qrcode-1.0.2.tgz",
+      "integrity": "sha1-N9cZAuFm4a5YF2vWy5xAkFwbCUk=",
+      "requires": {
+        "qrcode": "^1.4.4"
+      }
+    },
+    "ansi-regex": {
+      "version": "4.1.0",
+      "resolved": "https://registry.nlark.com/ansi-regex/download/ansi-regex-4.1.0.tgz",
+      "integrity": "sha1-i5+PCM8ay4Q3Vqg5yox+MWjFGZc="
+    },
+    "ansi-styles": {
+      "version": "3.2.1",
+      "resolved": "https://registry.nlark.com/ansi-styles/download/ansi-styles-3.2.1.tgz?cache=0&sync_timestamp=1618995588464&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fansi-styles%2Fdownload%2Fansi-styles-3.2.1.tgz",
+      "integrity": "sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0=",
+      "requires": {
+        "color-convert": "^1.9.0"
+      }
+    },
+    "base64-js": {
+      "version": "1.5.1",
+      "resolved": "https://registry.npm.taobao.org/base64-js/download/base64-js-1.5.1.tgz?cache=0&sync_timestamp=1605123440207&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbase64-js%2Fdownload%2Fbase64-js-1.5.1.tgz",
+      "integrity": "sha1-GxtEAWClv3rUC2UPCVljSBkDkwo="
+    },
+    "buffer": {
+      "version": "5.7.1",
+      "resolved": "https://registry.npm.taobao.org/buffer/download/buffer-5.7.1.tgz?cache=0&sync_timestamp=1606098159535&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbuffer%2Fdownload%2Fbuffer-5.7.1.tgz",
+      "integrity": "sha1-umLnwTEzBTWCGXFghRqPZI6Z7tA=",
+      "requires": {
+        "base64-js": "^1.3.1",
+        "ieee754": "^1.1.13"
+      }
+    },
+    "buffer-alloc": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npm.taobao.org/buffer-alloc/download/buffer-alloc-1.2.0.tgz",
+      "integrity": "sha1-iQ3ZDZI6hz4I4Q5f1RpX5bfM4Ow=",
+      "requires": {
+        "buffer-alloc-unsafe": "^1.1.0",
+        "buffer-fill": "^1.0.0"
+      }
+    },
+    "buffer-alloc-unsafe": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npm.taobao.org/buffer-alloc-unsafe/download/buffer-alloc-unsafe-1.1.0.tgz",
+      "integrity": "sha1-vX3CauKXLQ7aJTvgYdupkjScGfA="
+    },
+    "buffer-fill": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npm.taobao.org/buffer-fill/download/buffer-fill-1.0.0.tgz",
+      "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw="
+    },
+    "buffer-from": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npm.taobao.org/buffer-from/download/buffer-from-1.1.1.tgz",
+      "integrity": "sha1-MnE7wCj3XAL9txDXx7zsHyxgcO8="
+    },
+    "camelcase": {
+      "version": "5.3.1",
+      "resolved": "https://registry.npm.taobao.org/camelcase/download/camelcase-5.3.1.tgz?cache=0&sync_timestamp=1603923709404&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcamelcase%2Fdownload%2Fcamelcase-5.3.1.tgz",
+      "integrity": "sha1-48mzFWnhBoEd8kL3FXJaH0xJQyA="
+    },
+    "cliui": {
+      "version": "5.0.0",
+      "resolved": "https://registry.npm.taobao.org/cliui/download/cliui-5.0.0.tgz?cache=0&sync_timestamp=1604880033053&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcliui%2Fdownload%2Fcliui-5.0.0.tgz",
+      "integrity": "sha1-3u/P2y6AB4SqNPRvoI4GhRx7u8U=",
+      "requires": {
+        "string-width": "^3.1.0",
+        "strip-ansi": "^5.2.0",
+        "wrap-ansi": "^5.1.0"
+      }
+    },
+    "color-convert": {
+      "version": "1.9.3",
+      "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-1.9.3.tgz",
+      "integrity": "sha1-u3GFBpDh8TZWfeYp0tVHHe2kweg=",
+      "requires": {
+        "color-name": "1.1.3"
+      }
+    },
+    "color-name": {
+      "version": "1.1.3",
+      "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.3.tgz",
+      "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
+    },
+    "decamelize": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npm.taobao.org/decamelize/download/decamelize-1.2.0.tgz?cache=0&sync_timestamp=1610348702723&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdecamelize%2Fdownload%2Fdecamelize-1.2.0.tgz",
+      "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA="
+    },
+    "dijkstrajs": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npm.taobao.org/dijkstrajs/download/dijkstrajs-1.0.1.tgz",
+      "integrity": "sha1-082BIh4+pAdCz83lVtTpnpjdxxs="
+    },
+    "emoji-regex": {
+      "version": "7.0.3",
+      "resolved": "https://registry.npm.taobao.org/emoji-regex/download/emoji-regex-7.0.3.tgz?cache=0&sync_timestamp=1614682725186&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Femoji-regex%2Fdownload%2Femoji-regex-7.0.3.tgz",
+      "integrity": "sha1-kzoEBShgyF6DwSJHnEdIqOTHIVY="
+    },
+    "find-up": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npm.taobao.org/find-up/download/find-up-3.0.0.tgz",
+      "integrity": "sha1-SRafHXmTQwZG2mHsxa41XCHJe3M=",
+      "requires": {
+        "locate-path": "^3.0.0"
+      }
+    },
+    "get-caller-file": {
+      "version": "2.0.5",
+      "resolved": "https://registry.npm.taobao.org/get-caller-file/download/get-caller-file-2.0.5.tgz",
+      "integrity": "sha1-T5RBKoLbMvNuOwuXQfipf+sDH34="
+    },
+    "ieee754": {
+      "version": "1.2.1",
+      "resolved": "https://registry.npm.taobao.org/ieee754/download/ieee754-1.2.1.tgz?cache=0&sync_timestamp=1603838208740&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fieee754%2Fdownload%2Fieee754-1.2.1.tgz",
+      "integrity": "sha1-jrehCmP/8l0VpXsAFYbRd9Gw01I="
+    },
+    "is-fullwidth-code-point": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-2.0.0.tgz?cache=0&sync_timestamp=1618552469710&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-fullwidth-code-point%2Fdownload%2Fis-fullwidth-code-point-2.0.0.tgz",
+      "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8="
+    },
+    "isarray": {
+      "version": "2.0.5",
+      "resolved": "https://registry.npm.taobao.org/isarray/download/isarray-2.0.5.tgz",
+      "integrity": "sha1-ivHkwSISRMxiRZ+vOJQNTmRKVyM="
+    },
+    "locate-path": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npm.taobao.org/locate-path/download/locate-path-3.0.0.tgz",
+      "integrity": "sha1-2+w7OrdZdYBxtY/ln8QYca8hQA4=",
+      "requires": {
+        "p-locate": "^3.0.0",
+        "path-exists": "^3.0.0"
+      }
+    },
+    "p-limit": {
+      "version": "2.3.0",
+      "resolved": "https://registry.npm.taobao.org/p-limit/download/p-limit-2.3.0.tgz?cache=0&sync_timestamp=1606290276843&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fp-limit%2Fdownload%2Fp-limit-2.3.0.tgz",
+      "integrity": "sha1-PdM8ZHohT9//2DWTPrCG2g3CHbE=",
+      "requires": {
+        "p-try": "^2.0.0"
+      }
+    },
+    "p-locate": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npm.taobao.org/p-locate/download/p-locate-3.0.0.tgz?cache=0&sync_timestamp=1597081605529&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fp-locate%2Fdownload%2Fp-locate-3.0.0.tgz",
+      "integrity": "sha1-Mi1poFwCZLJZl9n0DNiokasAZKQ=",
+      "requires": {
+        "p-limit": "^2.0.0"
+      }
+    },
+    "p-try": {
+      "version": "2.2.0",
+      "resolved": "https://registry.npm.taobao.org/p-try/download/p-try-2.2.0.tgz",
+      "integrity": "sha1-yyhoVA4xPWHeWPr741zpAE1VQOY="
+    },
+    "path-exists": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npm.taobao.org/path-exists/download/path-exists-3.0.0.tgz",
+      "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU="
+    },
+    "pngjs": {
+      "version": "3.4.0",
+      "resolved": "https://registry.npm.taobao.org/pngjs/download/pngjs-3.4.0.tgz",
+      "integrity": "sha1-mcp9clll+2VYFOr2XzjxK72/VV8="
+    },
+    "qrcode": {
+      "version": "1.4.4",
+      "resolved": "https://registry.npm.taobao.org/qrcode/download/qrcode-1.4.4.tgz",
+      "integrity": "sha1-8MQ1aKfnUQpV78O4jZYC9xlj6oM=",
+      "requires": {
+        "buffer": "^5.4.3",
+        "buffer-alloc": "^1.2.0",
+        "buffer-from": "^1.1.1",
+        "dijkstrajs": "^1.0.1",
+        "isarray": "^2.0.1",
+        "pngjs": "^3.3.0",
+        "yargs": "^13.2.4"
+      }
+    },
+    "require-directory": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npm.taobao.org/require-directory/download/require-directory-2.1.1.tgz",
+      "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I="
+    },
+    "require-main-filename": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npm.taobao.org/require-main-filename/download/require-main-filename-2.0.0.tgz",
+      "integrity": "sha1-0LMp7MfMD2Fkn2IhW+aa9UqomJs="
+    },
+    "set-blocking": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npm.taobao.org/set-blocking/download/set-blocking-2.0.0.tgz",
+      "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
+    },
+    "string-width": {
+      "version": "3.1.0",
+      "resolved": "https://registry.npm.taobao.org/string-width/download/string-width-3.1.0.tgz",
+      "integrity": "sha1-InZ74htirxCBV0MG9prFG2IgOWE=",
+      "requires": {
+        "emoji-regex": "^7.0.1",
+        "is-fullwidth-code-point": "^2.0.0",
+        "strip-ansi": "^5.1.0"
+      }
+    },
+    "strip-ansi": {
+      "version": "5.2.0",
+      "resolved": "https://registry.npm.taobao.org/strip-ansi/download/strip-ansi-5.2.0.tgz?cache=0&sync_timestamp=1618553320591&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstrip-ansi%2Fdownload%2Fstrip-ansi-5.2.0.tgz",
+      "integrity": "sha1-jJpTb+tq/JYr36WxBKUJHBrZwK4=",
+      "requires": {
+        "ansi-regex": "^4.1.0"
+      }
+    },
+    "vue": {
+      "version": "2.6.12",
+      "resolved": "https://registry.npm.taobao.org/vue/download/vue-2.6.12.tgz",
+      "integrity": "sha1-9evU+mvShpQD4pqJau1JBEVskSM="
+    },
+    "which-module": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npm.taobao.org/which-module/download/which-module-2.0.0.tgz",
+      "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho="
+    },
+    "wrap-ansi": {
+      "version": "5.1.0",
+      "resolved": "https://registry.npm.taobao.org/wrap-ansi/download/wrap-ansi-5.1.0.tgz",
+      "integrity": "sha1-H9H2cjXVttD+54EFYAG/tpTAOwk=",
+      "requires": {
+        "ansi-styles": "^3.2.0",
+        "string-width": "^3.0.0",
+        "strip-ansi": "^5.0.0"
+      }
+    },
+    "y18n": {
+      "version": "4.0.3",
+      "resolved": "https://registry.npm.taobao.org/y18n/download/y18n-4.0.3.tgz?cache=0&sync_timestamp=1617822642544&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fy18n%2Fdownload%2Fy18n-4.0.3.tgz",
+      "integrity": "sha1-tfJZyCzW4zaSHv17/Yv1YN6e7t8="
+    },
+    "yargs": {
+      "version": "13.3.2",
+      "resolved": "https://registry.nlark.com/yargs/download/yargs-13.3.2.tgz",
+      "integrity": "sha1-rX/+/sGqWVZayRX4Lcyzipwxot0=",
+      "requires": {
+        "cliui": "^5.0.0",
+        "find-up": "^3.0.0",
+        "get-caller-file": "^2.0.1",
+        "require-directory": "^2.1.1",
+        "require-main-filename": "^2.0.0",
+        "set-blocking": "^2.0.0",
+        "string-width": "^3.0.0",
+        "which-module": "^2.0.0",
+        "y18n": "^4.0.0",
+        "yargs-parser": "^13.1.2"
+      }
+    },
+    "yargs-parser": {
+      "version": "13.1.2",
+      "resolved": "https://registry.npm.taobao.org/yargs-parser/download/yargs-parser-13.1.2.tgz",
+      "integrity": "sha1-Ew8JcC667vJlDVTObj5XBvek+zg=",
+      "requires": {
+        "camelcase": "^5.0.0",
+        "decamelize": "^1.2.0"
+      }
+    }
+  }
+}

+ 16 - 0
pages/getout/getoutpage/getoutpage.scss

@@ -149,4 +149,20 @@
 		font-weight: 500;
 		color: #FFFFFF;
 	}
+}
+
+.qrcode-popup{
+	text-align: center;
+	.qrcode-popup-btn{
+		margin-top: 42rpx;
+		height: 85rpx;
+		line-height: 85rpx;
+		background: #3397FA;
+		box-shadow: 0px 9rpx 9rpx 0px rgba(0, 0, 0, 0.03);
+		text-align: center;
+		border-radius: 10rpx;
+		font-size: 30rpx;
+		font-weight: 500;
+		color: #FFFFFF;
+	}
 }

+ 50 - 18
pages/getout/getoutpage/getoutpage.vue

@@ -84,6 +84,10 @@
 				<view class="payway-popup-btn" @click="closePayway">关闭</view>
 			</view>
 		</u-popup>
+		<u-popup class="popup qrcode-popup" v-model="showQrcode" :mask-close-able="false" mode="center" border-radius="20" width="90%">
+			<vue-qrcode :value='qrcontent' :options="{ width: 200 }"></vue-qrcode>
+			<view class="qrcode-popup-btn" @click="hideQrcode">关闭</view>
+		</u-popup>
 		<u-toast ref="uToast" />
 	</view>
 </template>
@@ -93,7 +97,11 @@
 	let speak = uni.requireNativePlugin("SpeechPlug");
 	let ALog = uni.requireNativePlugin("AndroidLog")
 	//#endif
+	import VueQrcode from '@chenfengyuan/vue-qrcode'
 	export default {
+		components:{
+			VueQrcode
+		},
 		data() {
 			return {
 				vehicleImage:'/static/img/default-car.png',
@@ -113,7 +121,10 @@
 				payParams:{
 					orderList:[],
 					code:''
-				}
+				},
+				showQrcode:false,
+				qrcontent:'',
+				
 				
 			}
 		},
@@ -182,46 +193,67 @@
 			},
 			scanPay(){
 				console.log('this.payParams',this.payParams);
-				ALog('开始扫描');
-				//#ifdef APP-PLUS
-				ALog('开始扫描111');
-				//#endif
 				uni.scanCode({
 				    onlyFromCamera: true,
 				    success: function (res) {
 						//#ifdef APP-PLUS
-						plus.nativeUI.toast(res.result);
-						ALog('条码类型:' + res.scanType);
+						ALog.info({msg:'条码内容:' + res.result});
 						//#endif
+						this.payParams.code = res.result;
+						this.$u.api.gzbankSwept(this.payParams)
+						.then(res=>{
+							this.$refs.uToast.show({
+								title: res.msg,
+								type: 'success',
+							});
+							console.log('gzbankSwept',res)
+						}).catch(err=>{
+							this.$refs.uToast.show({
+								title: err.msg,
+								type: 'error',
+							});
+							console.log('gzbankSwept ',err)
+						});
 						
 				        console.log('条码类型:' + res.scanType);
 				        console.log('条码内容:' + res.result);
 				    },
 					fail:function(err){
 						//#ifdef APP-PLUS
-						ALog('条码类型:err' + err);
+						plus.nativeUI.toast('扫码失败');
+						ALog.info({msg:'条码类型:err' + err});
 						//#endif
 					}
 				});
-				this.$u.api.gzbankSwept()
+				
+			},
+			qrPay(){
+				console.log('this.payParams',this.payParams);
+				this.$u.api.gzbankPolypay(this.payParams)
 				.then(res=>{
-					this.$refs.uToast.show({
-						title: res.msg,
-						type: 'success',
-					});
-					console.log('gzbankSwept',res)
+					// this.$refs.uToast.show({
+					// 	title: res.msg,
+					// 	type: 'success',
+					// });
+					this.qrcontent = res.data;
+					this.showPayway = false;
+					this.showQrcode = true;
+					console.log('gzbankPolypay',res)
 				}).catch(err=>{
 					this.$refs.uToast.show({
 						title: err.msg,
 						type: 'error',
 					});
-					console.log('gzbankSwept ',err)
+					console.log('gzbankPolypay ',err)
 				});
-			},
-			qrPay(){
-				console.log('this.payParams',this.payParams);
 				
 			},
+			hideQrcode(){
+				this.showQrcode = false;
+				this.$u.route({
+					url: 'pages/getout/getout',
+				});
+			},
 			confirmOut(){
 				this.$u.api.getOut({spaceId:this.orderID})
 				.then(res=>{