WebApp【公共组件库】@前端(For Git Submodule)
Tevin
2022-07-20 ff52ea040c49f33c6cb84cdda2deb75c637bc545
forms/input/CInputScanCode.vue
@@ -15,14 +15,12 @@
            :value="itemRes.formData[itemRes.name]"
            :onChange="evt=>itemRes.onChange(evt)"
        >
            <view
                class="c-input-scan-btn"
                @tap="evt => handleScan()"
            ></view>
            <view class="c-input-scan-space"></view>
            <AtButton
                class="c-input-scan-show"
                class="c-input-scan-btn"
                size="small"
                type="primary"
                :onClick="evt => handleScan()"
            >
                <text v-show="!scaning">扫描</text>
                <AtIcon
@@ -52,6 +50,8 @@
        itemRes: Object,
        // 占位提示
        placeholder: String,
        // 由业务层调用app
        onScaning: Function,
    },
    data() {
        return {
@@ -96,10 +96,14 @@
                    },
                });
            } else if (type === 'app') {
                // TODO:扫码
                setTimeout(() => {
                    this.scaning = false;
                }, 1000);
                if (this.onScaning) {
                    this.onScaning(result => {
                        this.scaning = false;
                        if (result) {
                            this.itemRes.onChange(result);
                        }
                    });
                }
            }
        },
    },