Ver Fonte

更换二维码插件

gcz há 3 anos atrás
pai
commit
7b3e288843
3 ficheiros alterados com 31 adições e 14 exclusões
  1. 2 1
      README.md
  2. 5 8
      package-lock.json
  3. 24 5
      pages/getout/getoutpage/getoutpage.vue

+ 2 - 1
README.md

@@ -1,6 +1,7 @@
 ## 城市智慧停车PDA
 #### 安装二维码生成插件
-`npm i @chenfengyuan/vue-qrcode`
+`npm i tki-qrcode`
+[https://github.com/q310550690/uni-app-qrcode](https://github.com/q310550690/uni-app-qrcode)
 
 #### H5调试,因为没有app方法,有些数据是写死的
 

+ 5 - 8
package-lock.json

@@ -2,14 +2,6 @@
   "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",
@@ -219,6 +211,11 @@
         "ansi-regex": "^4.1.0"
       }
     },
+    "tki-qrcode": {
+      "version": "0.1.6",
+      "resolved": "https://registry.npm.taobao.org/tki-qrcode/download/tki-qrcode-0.1.6.tgz",
+      "integrity": "sha1-cTc9nEs/iUT6pU0+6Ziroz2X3n8="
+    },
     "vue": {
       "version": "2.6.12",
       "resolved": "https://registry.npm.taobao.org/vue/download/vue-2.6.12.tgz",

+ 24 - 5
pages/getout/getoutpage/getoutpage.vue

@@ -85,7 +85,22 @@
 			</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>
+			<tki-qrcode
+			    ref="qrcode"
+			    cid="tki-qrcode-canvas"
+			    :val="qrcontent"
+			    :size="200"
+			    unit="px"
+			    background="#000000"
+			    foreground="#ffffff"
+			    pdground="#ffffff"
+			    :iconSize="40"
+			    :onval="true"
+			    :loadMake="false"
+			    :usingComponents="true"
+			    :showLoading="false"
+			    loadingText="loadingText"
+			     />
 			<view class="qrcode-popup-btn" @click="hideQrcode">关闭</view>
 		</u-popup>
 		<u-toast ref="uToast" />
@@ -97,10 +112,10 @@
 	let speak = uni.requireNativePlugin("SpeechPlug");
 	let ALog = uni.requireNativePlugin("AndroidLog")
 	//#endif
-	import VueQrcode from '@chenfengyuan/vue-qrcode'
+	import tkiQrcode from "tki-qrcode";
 	export default {
 		components:{
-			VueQrcode
+			tkiQrcode
 		},
 		data() {
 			return {
@@ -235,10 +250,14 @@
 					// 	title: res.msg,
 					// 	type: 'success',
 					// });
-					this.qrcontent = res.data.qrCodeUrl;
-					console.log('this.qrcontent',this.qrcontent);
 					this.showPayway = false;
 					this.showQrcode = true;
+					setTimeout(()=>{
+						this.qrcontent = res.data.qrCodeUrl;
+					},500)
+					
+					// tkiQrcode.methods._makeCode({val:"val"});
+					
 					console.log('gzbankPolypay',res)
 				}).catch(err=>{
 					this.$refs.uToast.show({