#
whycq
2022-05-11 9995b49c2681f8a8c7149081e21779c3715b3e7f
pages/basics/offline.vue
@@ -8,7 +8,8 @@
            </view>
            <view class="square-content">
               <view class="content-input">
                  <input v-model="barcode" type="text" placeholder="扫码 / 输入" maxlength="8">
                  <input v-model="barcode" type="text" placeholder="扫码 / 输入"
                        maxlength="8" :focus="barcodeFocus" @focus="focuss">
                  <uni-icons type="closeempty" size="20" color="#dadada" @click="removeBarcode()"></uni-icons>
               </view>
            </view>
@@ -34,7 +35,8 @@
            </view>
            <view class="square-content">
               <view class="content-input">
                  <input v-model="matNo" type="text" placeholder="扫码 / 输入" @input="findMat()" :focus="focus">
                  <input v-model="matNo" type="text" placeholder="扫码 / 输入"
                        @input="findMat()" :focus="focus" @focus="focuss" >
                  <uni-icons type="closeempty" size="20" color="#dadada" @click="removeMat()"></uni-icons>
               </view>
            </view>
@@ -132,6 +134,8 @@
      data() {
         return {
            barcode: '',
            barcodeFocus:true,
            focus:false,
            matList:[],
            matNo:'',
            mat:null,
@@ -146,7 +150,8 @@
            enableQty:'',
            msgType: 'success',
            messageText: '这是一条成功提示',
            focus:true
         }
      },
      mounted(){
@@ -156,6 +161,9 @@
         this.basePORT = UPORT
      },
      methods: {
         focuss() {
            uni.hideKeyboard()
         },
         messageToggle(type) {
            this.msgType = type
            this.messageText = `这是一条${type}消息提示`
@@ -170,10 +178,18 @@
         removeBarcode() {
            this.barcode = ''
            uni.vibrateShort();
            this.barcodeFocus = false;
            this.$nextTick(function() {
               this.barcodeFocus = true;
            });
         },
         removeMat() {
            this.matNo = ''
            uni.vibrateShort();
            this.focus = false;
            this.$nextTick(function() {
               this.focus = true;
            });
         },
         eject(type) {
            this.type = type
@@ -281,7 +297,10 @@
                        that.addMatList(that.mat)
                        that.initAnfme()
                        that.matNo = '',
                        console.log(that.focus)
                        that.focus = false;
                        that.$nextTick(function() {
                           that.focus = true;
                        });
                     } else {
                        that.messageToggle('warn')
                        that.messageText = '请重新扫码 \ 输入'