瀏覽代碼

0元提示弹框

carljin 3 年之前
父節點
當前提交
6f15428888
共有 5 個文件被更改,包括 112 次插入22 次删除
  1. 4 4
      common/config.js
  2. 0 8
      main.js
  3. 80 0
      node_modules/vue-jsonp/package.json
  4. 2 7
      package-lock.json
  5. 26 3
      pages/index/index.vue

+ 4 - 4
common/config.js

@@ -1,9 +1,9 @@
 const config = {
-	// wxAppid:'wxbe90cc7c5233dd84',// 测试wxAppid 
-	wxAppid: 'wx45c3cf2b632f5fd5', // 正式wxAppid
+	wxAppid:'wxbe90cc7c5233dd84',// 测试wxAppid 
+	// wxAppid: 'wx45c3cf2b632f5fd5', // 正式wxAppid
 	
-	// baseUrl:'https://wx.hw.hongweisoft.com/parking',// 64服务器
-	baseUrl: 'https://parking.pdzhtc.com', //正式接口访问地址
+	baseUrl:'https://wx.hw.hongweisoft.com/parking',// 64服务器
+	// baseUrl: 'https://parking.pdzhtc.com', //正式接口访问地址
 }
 export {
 	config

+ 0 - 8
main.js

@@ -27,10 +27,6 @@ Vue.prototype.$wxApi = $wxApi;
 import $pay from "./pay.js";
 Vue.prototype.$pay = $pay
 
-// jsonp
-import { VueJsonp } from 'vue-jsonp'
-Vue.use(VueJsonp);
-
 const app = new Vue({
 	store,
     ...App
@@ -45,7 +41,3 @@ import httpApi from '@/common/http.api.js';
 Vue.use(httpApi, app);
 
 app.$mount()
-// //导入
-// import cookie from "js-cookie"
-// //将cookie转换为 vue 原型
-// Vue.prototype.Cook = cookie

+ 80 - 0
node_modules/vue-jsonp/package.json

@@ -0,0 +1,80 @@
+{
+  "_from": "vue-jsonp",
+  "_id": "vue-jsonp@2.0.0",
+  "_inBundle": false,
+  "_integrity": "sha512-Mzd9GNeuKP5hHFDWZNMWOsCuMILSkA6jo2l4A02wheFz3qqBzH7aSEFTey1BRCZCLizlaf1EqJ5YUtF392KspA==",
+  "_location": "/vue-jsonp",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "tag",
+    "registry": true,
+    "raw": "vue-jsonp",
+    "name": "vue-jsonp",
+    "escapedName": "vue-jsonp",
+    "rawSpec": "",
+    "saveSpec": null,
+    "fetchSpec": "latest"
+  },
+  "_requiredBy": [
+    "#USER",
+    "/"
+  ],
+  "_resolved": "https://registry.npmjs.org/vue-jsonp/-/vue-jsonp-2.0.0.tgz",
+  "_shasum": "3bfac56bb72941a2511c11e1a123b876f03427f7",
+  "_spec": "vue-jsonp",
+  "_where": "D:\\daze\\parking_h5",
+  "author": {
+    "name": "LancerComet",
+    "email": "chw644@hotmail.com"
+  },
+  "bugs": {
+    "url": "https://github.com/LancerComet/vue-jsonp/issues"
+  },
+  "bundleDependencies": false,
+  "deprecated": false,
+  "description": "A tiny library for handling JSONP request.",
+  "devDependencies": {
+    "@types/expect-puppeteer": "^4.4.3",
+    "@types/jest": "^26.0.14",
+    "@types/jest-environment-puppeteer": "^4.4.0",
+    "@types/puppeteer": "^3.0.2",
+    "jest": "^26.4.2",
+    "jest-puppeteer": "^4.4.0",
+    "puppeteer": "^5.3.1",
+    "rollup": "^2.28.2",
+    "rollup-plugin-cleanup": "^3.2.1",
+    "rollup-plugin-delete": "^2.0.0",
+    "rollup-plugin-terser": "^7.0.2",
+    "rollup-plugin-typescript2": "^0.27.3",
+    "ts-jest": "^26.4.1",
+    "tslint": "^6.1.3",
+    "typescript": "^4.0.3",
+    "vue": "^2.6.12"
+  },
+  "files": [
+    "dist/",
+    "index.d.ts",
+    "README.md"
+  ],
+  "homepage": "https://github.com/LancerComet/vue-jsonp#readme",
+  "keywords": [
+    "Vue",
+    "JSONP"
+  ],
+  "license": "MIT",
+  "main": "./dist/index.js",
+  "module": "./dist/index.esm.js",
+  "name": "vue-jsonp",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/LancerComet/vue-jsonp.git"
+  },
+  "scripts": {
+    "build": "rollup -c",
+    "prepublish": "npm run test",
+    "pretest": "npm run build",
+    "preversion": "npm run test",
+    "test": "jest"
+  },
+  "version": "2.0.0"
+}

+ 2 - 7
package-lock.json

@@ -2,15 +2,10 @@
   "requires": true,
   "lockfileVersion": 1,
   "dependencies": {
-    "js-cookie": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.0.tgz",
-      "integrity": "sha512-oUbbplKuH07/XX2YD2+Q+GMiPpnVXaRz8npE7suhBH9QEkJe2W7mQ6rwuMXHue3fpfcftQwzgyvGzIHyfCSngQ=="
-    },
     "vue-jsonp": {
       "version": "2.0.0",
-      "resolved": "https://registry.npm.taobao.org/vue-jsonp/download/vue-jsonp-2.0.0.tgz",
-      "integrity": "sha1-O/rFa7cpQaJRHBHhoSO4dvA0J/c="
+      "resolved": "https://registry.npmjs.org/vue-jsonp/-/vue-jsonp-2.0.0.tgz",
+      "integrity": "sha512-Mzd9GNeuKP5hHFDWZNMWOsCuMILSkA6jo2l4A02wheFz3qqBzH7aSEFTey1BRCZCLizlaf1EqJ5YUtF392KspA=="
     }
   }
 }

+ 26 - 3
pages/index/index.vue

@@ -168,6 +168,14 @@
 			:jumpUrl="jumpUrl"
 			@closePaymentMethod="closePaymentMethod"
 		></PaymentMethod>
+		
+		<!-- ===================================== 0元提示弹出层 ===================================== -->
+		<u-modal
+			v-model="jumpMsgModal"
+			:content="jumpMsgContent"
+			:show-title="false"
+			:show-confirm-button="false"
+		/>
 		<u-toast ref="uToast" />
 	</view>
 </template>
@@ -175,6 +183,7 @@
 <script>
 	import getUrlParams from '../../utils/getUrlParams.js'
 	import PaymentMethod from '@/pages/paymentMethod/paymentMethod.vue'
+	import { jsonp } from 'vue-jsonp'
 	export default {
 		components: {
 			PaymentMethod
@@ -254,11 +263,16 @@
 				totalActualAmount: '', //缴费总额
 				totalPayAmount: '', //应支付总额
 				totalCount: '', //缴费总笔数 
-				totalPayCount: '' //应支付总笔数
+				totalPayCount: '', //应支付总笔数
+				// 0元提示框
+				jumpMsgModal: false,
+				// 0元提示内容
+				jumpMsgContent: ''
 			}
 		},
 		onLoad(page) {
-			const locationLocaturl = window.location.search
+			const locationLocaturl = window.location.href
+			// 微信聚合支付完成跳转过来重定向到详情页
 			const type = getUrlParams(locationLocaturl, 'type')
 			if (type && type === 'jumpurl') {
 				const jumpurl = localStorage.getItem('jumpUrl')
@@ -272,6 +286,15 @@
 					}, 0)
 				}
 			}
+			// 0元支付情况添加一个加载层
+			const jumpMsg = getUrlParams(locationLocaturl, 'jumpMsg')
+			if (jumpMsg) {
+				this.jumpMsgModal = true
+				this.jumpMsgContent = jumpMsg
+				setTimeout(() => {
+					this.jumpMsgModal = false
+				}, 3000)
+			}
 		},
 		onShow() {
 			this.handleGetIndexData()
@@ -328,7 +351,7 @@
 					mask: true
 				})
 				const str = `output=jsonp&key=BOGBZ-2BZ33-O4L32-Y3QJR-PGN66-RFFEL&location=${latitude},${longitude}`
-				this.$jsonp('https://apis.map.qq.com/ws/geocoder/v1/?' + str, {}).then(res => {
+				jsonp('https://apis.map.qq.com/ws/geocoder/v1/?' + str, {}).then(res => {
 					uni.hideLoading()
 					if (res.status == 0) {
 						if (res.result.ad_info) {