条码生成页面样式完善

parent cbc73c17
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
v-model="nowBarCode" v-model="nowBarCode"
clearable clearable
placeholder="请选择条码类型" placeholder="请选择条码类型"
style="width: 185px;" style="width: 185px; top:-5px"
> >
<el-option <el-option
v-for="item in options" v-for="item in options"
...@@ -23,22 +23,48 @@ ...@@ -23,22 +23,48 @@
:value="item.value" :value="item.value"
/> />
</el-select> </el-select>
<el-button @click="firstButton">二维码</el-button> </div>
<div class="body-container">
<el-button @click="SecButton">条形码</el-button> <div class="cardOne" style="margin-top:40px; margin-left:40px ">
<div v-if="(qrDisplay = true)"> <el-card class="box-card">
<div slot="header" class="clearfix">
<el-button
type="primary"
@click="firstButton"
>点击生成二维码</el-button>
<el-button
style="float: right; padding: 3px 0"
type="text"
>导出二维码</el-button>
</div>
<div class="item1">
<div>
<qrcode-vue :value="qrCode" :size="size" level="H" /> <qrcode-vue :value="qrCode" :size="size" level="H" />
</div> </div>
</div>
</el-card>
</div>
<div class="cardTwo" style="margin-left:52%; margin-top:-38%">
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-button
type="primary"
@click="SecButton"
>点击生成条形码</el-button>
<el-button
style="float: right; padding: 3px 0"
type="text"
>导出条形码</el-button>
</div>
<div class="item2">
<div> <div>
<barcode :value="qrCode" :format="barcodeFormat" /> <barcode :value="qrCode" :format="barcodeFormat" />
</div> </div>
</div> </div>
</el-card>
</div>
</div>
</div> </div>
<!-- <div>
<qrcode-vue :value="value" :size="size" level="H" />
<input v-model="barcodeValue" /><br />
<barcode :value="barcodeValue" :format="barcodeFormat" />
</div> -->
</template> </template>
<script> <script>
import QrcodeVue from 'qrcode.vue' import QrcodeVue from 'qrcode.vue'
...@@ -50,12 +76,10 @@ export default { ...@@ -50,12 +76,10 @@ export default {
}, },
data() { data() {
return { return {
// value: "https://www.baidu.com",
nowBarCode: '', nowBarCode: '',
size: 300, size: 300,
barcodeValue: 'test', barcodeValue: 'test',
barcodeFormat: '', barcodeFormat: '',
qrDisplay: false,
qrCode: '', qrCode: '',
materialCode: '', materialCode: '',
options: [ options: [
...@@ -114,7 +138,6 @@ export default { ...@@ -114,7 +138,6 @@ export default {
mounted() {}, mounted() {},
methods: { methods: {
firstButton() { firstButton() {
this.qrDisplay = true
this.qrCode = this.materialCode this.qrCode = this.materialCode
console.log(this.materialCode) console.log(this.materialCode)
this.$message({ this.$message({
...@@ -123,7 +146,6 @@ export default { ...@@ -123,7 +146,6 @@ export default {
}) })
}, },
SecButton() { SecButton() {
this.qrCode = this.materialCode
if (this.nowBarCode === '') { if (this.nowBarCode === '') {
this.$message({ this.$message({
message: '请先选择条形码类型', message: '请先选择条形码类型',
...@@ -131,6 +153,7 @@ export default { ...@@ -131,6 +153,7 @@ export default {
}) })
return return
} }
this.qrCode = this.materialCode
console.log('nowBarCode', this.nowBarCode) console.log('nowBarCode', this.nowBarCode)
this.barcodeFormat = this.nowBarCode.value this.barcodeFormat = this.nowBarCode.value
} }
...@@ -138,4 +161,37 @@ export default { ...@@ -138,4 +161,37 @@ export default {
} }
</script> </script>
<style scoped></style> <style scoped>
.app-container .body-container {
padding: 20px 20px 20px 20px;
}
.head-container {
margin-top: 0px;
}
.text {
font-size: 14px;
}
.item1 {
margin-bottom: 24px;
margin-left: 64px;
}
.item2 {
margin-bottom: 24px;
margin-left: 64px;
height: 300px;
}
.clearfix:before,
.clearfix:after {
display: table;
content: "";
}
.clearfix:after {
clear: both;
}
.box-card {
width: 480px;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment