瀏覽代碼

完善扫码

caojunjie 4 年之前
父節點
當前提交
47cfcc2953
共有 3 個文件被更改,包括 22 次插入30 次删除
  1. 14 12
      common/p-scan/scan.vue
  2. 2 2
      pages.json
  3. 6 16
      pages/home/scancode/index.vue

+ 14 - 12
common/p-scan/scan.vue

@@ -1,5 +1,5 @@
 <template>
-	<view id="barcode"></view>
+	<view id="barcode" style="background-color: #18B566;width: 100%;height: 100%"></view>
 </template>
 
 <script>
@@ -12,10 +12,12 @@
 					plus.barcode.CODE93,
 					plus.barcode.CODE128,
 				], //码类型
+				bug:'',
 				// #endif
 			};
 		},
 		created() {
+			
 			var statusBarHeight = uni.getSystemInfoSync().statusBarHeight; //状态栏
 			var height = statusBarHeight + 44 + 144 + 'px';
 			var pages = getCurrentPages();
@@ -23,15 +25,15 @@
 			// #ifdef APP-PLUS
 			var currentWebview = page.$getAppWebview();
 			this.barcode = plus.barcode.create('barcode', this.barcode, {
-				top: '12%',
-				left: '10%',
-				width: '80%',
-				height: '31.5%', //180px
+				top: '0',
+				left: '0',
+				width: '100%',
+				height: '50%', //180px
 				position: 'static',
-				background:'#ffffff',
-				frameColor:'#00A0EA',
-				scanbarColor:'#00A0EA'
-				
+				background: '#ffffff',
+				frameColor: '#00A0EA',
+				scanbarColor: '#00A0EA'
+
 			});
 			this.barcode.onmarked = this.onmarked;
 			currentWebview.append(this.barcode);
@@ -39,10 +41,10 @@
 			if (res.platform == 'android') { //安卓机
 				this.barcode.start();
 			}
-			
+
 			this.barcode.setStyle({
-				
-				});
+
+			});
 			// #endif
 		},
 		onUnload() {

+ 2 - 2
pages.json

@@ -57,11 +57,11 @@
 				"path": "scancode/index",
 				"style": {
 					"navigationBarTitleText": "扫码入库",
-					"navigationBarBackgroundColor": "#0095FF",
+					// "navigationBarBackgroundColor": "#0095FF",
 					"app-plus": {
 						"titleNView": {
 							"type": "float",
-							// "backgroundColor": "rgba(192,192,192,0.5)",
+							"backgroundColor": "rgba(192,192,192,0)",
 							"buttons": [{
 								"type": "transparent"
 							}]

+ 6 - 16
pages/home/scancode/index.vue

@@ -1,12 +1,8 @@
 <template>
 
 	<view class="content">
-		<!-- <u-navbar :title="nbTitle" back-icon-color="#ffffff" title-color="#ffffff" :background="background" :border-bottom="false" :is-fixed="true" :immersive="false"></u-navbar> -->
-		
 		<view class="text-area">
-			<view class="white_b">
 				<scan @getCode="getScanCode"/>
-			</view>
 		</view>
 		<view class="stripe"></view>
 		<view class="roll">
@@ -95,7 +91,7 @@
 	}
 </script>
 
-<style scoped>
+<style lang="scss" scoped>
 	.generate {
 		width: 98%;
 		height: 420rpx;
@@ -106,13 +102,14 @@
 
 	.determine {
 		width: 690rpx;
-		margin-top: 30rpx;
+		margin-top: 330rpx;
 	}
 	.content {
 		display: flex;
 		flex-direction: column;
 		align-items: center;
 		justify-content: center;
+		padding-top: 100%;
 	}
 
 	.logo {
@@ -127,7 +124,7 @@
 	.stripe {
 		width: 720rpx;
 		height: 30rpx;
-		background-color: rgba(0, 0, 0, 0.2);
+		background-color: #00A0EA;
 		border-radius: 12rpx;
 		margin: 0 auto;
 		margin-top: -100rpx;
@@ -135,20 +132,13 @@
 
 	.text-area {
 		width: 100%;
-		height: 850rpx;
-		background-color: #0094fe;
+		background-color: #000;
 		display: flex;
+		position: static;
 		justify-content: center;
 		padding-top: 180rpx;
 	}
 
-	.white_b {
-		width: 83%;
-		height: 540rpx;
-		background-color: rgba(255, 255, 255, 0.5);
-		border-radius: 20rpx;
-	}
-
 	.title {
 		font-size: 36rpx;
 		color: #8f8f94;