chenrui hace 3 años
padre
commit
6d14459062
Se han modificado 2 ficheros con 18 adiciones y 6 borrados
  1. 5 0
      App.vue
  2. 13 6
      pages/common/printTag/printTag.vue

+ 5 - 0
App.vue

@@ -211,4 +211,9 @@
 	    -webkit-flex: 1;
 	    flex: 1;    
 	}
+	// ios15原生input的type=search时会默认自带搜索图标。
+	// 在全局的公共样式隐藏ios自带搜索图标即可
+	[type="search"]::-webkit-search-decoration {
+		display: none;
+	}
 </style>

+ 13 - 6
pages/common/printTag/printTag.vue

@@ -16,8 +16,8 @@
 			<view>{{fromPage == 'smdy'?'实发':'库存'}}数量:{{fromPage == 'smdy'?infoData.confirmQty : infoData.qty}}</view>
 		</view>
 		<view class="buttons flex align_center justify_center">
-			<view v-if="fromPage == 'bdtq'"><u-button @click="cansel" shape="circle" plain>返回列表</u-button></view>
-			<view v-if="fromPage == 'smdy'"><u-button @click="cansel" shape="circle" plain>重新扫描</u-button></view>
+			<view v-if="fromPage == 'bdtq'"><u-button @click="cancel" shape="circle" plain>返回列表</u-button></view>
+			<view v-if="fromPage == 'smdy'"><u-button @click="cancel" shape="circle" plain>重新扫描</u-button></view>
 			<view>
 				<kk-printer ref="kkprinter" @startPrint="startPrint"></kk-printer>
 			</view>
@@ -60,12 +60,19 @@
 		},
 		// 监听页面返回,返回 event = {from:backbutton、 navigateBack} ,backbutton 表示来源是左上角返回按钮或 android 返回键;navigateBack表示来源是 uni.navigateBack
 		onBackPress(event){
-			this.cansel()
+			if(event.from == 'backbutton'){
+				this.cancel()
+				return true  // 阻止默认返回行为(会导致无限循环)
+			}
 		},
 		methods: {
-			cansel(){
-				uni.$emit('refreshBL')
-				uni.navigateBack()
+			cancel(){
+				if(this.fromPage == 'bdtq'){  // 补打贴签
+					uni.navigateBack({delta: 1})
+				}else if(this.fromPage == 'smdy'){  // 扫码打印
+					uni.$emit('refreshBL')
+					uni.navigateBack({delta: 1})
+				}
 			},
 			// 获取打印内容
 			getPrintContent(){