uni 获取扫码

扫码进入后,再onload里拿参数,如果页面在列表中也有使用,那做下判断是否是扫码,然后赋值,执行方法就行

         onLoad(options){ 
			let is_scene = options.hasOwnProperty("scene")
			const item = decodeURIComponent(options.scene)
			var car_id = options.car_id
		    if (is_scene) {
		      car_id = item;
		    } 
			 this.$store.state.scan_to_bus_id = car_id;
			 console.log(car_id);
		},
posted @ 2020-08-14 16:22  Twoknives_li  阅读(43)  评论(0)    收藏  举报