| | |
| | | </scroll-view>
|
| | |
|
| | | <!-- --> |
| | | |
| | | <!-- --> |
| | | <view class="reader-box" @click="stopScan" v-if="isScaning"> |
| | | <view class="reader" id="reader"></view> |
| | | </view>
|
| | | </view>
|
| | | </template>
|
| | |
|
| | |
| | | }, |
| | | html5Qrcode: null, |
| | | isScaning: false, |
| | | activeItem: {}
|
| | | // activeItem: {}
|
| | | };
|
| | | },
|
| | | onLoad() {
|
| | |
| | | },
|
| | | methods: { |
| | | openSc(item) { |
| | | this.activeItem = item |
| | | this.isScaning = true; |
| | | Html5Qrcode.getCameras().then((devices) => { |
| | | if (devices && devices.length) { |
| | |
| | | pointCode: decodeText |
| | | }).then(ress=> { |
| | | if(ress.data){ |
| | | |
| | | uni.navigateTo({ |
| | | url: '/pages/polling/point?id=' + ress.data.id |
| | | }) |
| | | }else{ |
| | | this.showToast('未匹配到巡检点,请重新扫描') |
| | | } |
| | | }) |
| | | } |
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | .reader-box { |
| | | position: fixed; |
| | | top: 0; |
| | | bottom: 0; |
| | | left: 0; |
| | | right: 0; |
| | | background-color: rgba(0, 0, 0, 0.5); |
| | | } |
| | | |
| | | .reader { |
| | | width: 100%; |
| | | // width: 540rpx; |
| | | // height: 540rpx; |
| | | position: absolute; |
| | | top: 50%; |
| | | left: 50%; |
| | | transform: translate(-50%, -50%); |
| | | } |
| | | </style> |