WebApp【公共组件库】@前端(For Git Submodule)
Tevin
2023-08-18 fe114d0f8524ee7ce817d17a48ac69758bac8b3d
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
@@ -82,7 +80,7 @@
            this.scaning = true;
            if (type === 'taro') {
                Taro.scanCode({
                    onlyFromCamera: true,
                    onlyFromCamera: false,
                    scanType: 'barCode',
                    success: res => {
                        this.scaning = false;
@@ -99,10 +97,10 @@
                });
            } else if (type === 'app') {
                if (this.onScaning) {
                    this.onScaning(res => {
                    this.onScaning(result => {
                        this.scaning = false;
                        if (res.result) {
                            this.itemRes.onChange(res.result);
                        if (result) {
                            this.itemRes.onChange(result);
                        }
                    });
                }