MrShi
2025-01-02 a0a1c206612de9a3e9d64f3d45564c0ff03f93f6
h5/pages/polling/task.vue
@@ -55,7 +55,10 @@
      </scroll-view>
      <!--  -->
      <!--  -->
      <view class="reader-box" @click="stopScan" v-if="isScaning">
         <view class="reader" id="reader"></view>
      </view>
   </view>
</template>
@@ -87,7 +90,7 @@
            },
            html5Qrcode: null,
            isScaning: false,
            activeItem: {}
            // activeItem: {}
         };
      },
      onLoad() {
@@ -95,7 +98,6 @@
      },
      methods: {
         openSc(item) {
            this.activeItem = item
            this.isScaning = true;
            Html5Qrcode.getCameras().then((devices) => {
               if (devices && devices.length) {
@@ -115,7 +117,11 @@
                              pointCode: decodeText
                           }).then(ress=> {
                              if(ress.data){
                                 uni.navigateTo({
                                    url: '/pages/polling/point?id=' + ress.data.id
                                 })
                              }else{
                                 this.showToast('未匹配到巡检点,请重新扫描')
                              }
                           })
                        }
@@ -349,4 +355,23 @@
         }
      }
   }
   .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>