diff --git a/src/components/LablesMember.vue b/src/components/LablesMember.vue index 83d29ba..763d536 100644 --- a/src/components/LablesMember.vue +++ b/src/components/LablesMember.vue @@ -18,13 +18,13 @@
- VIP + 金币充值
- SVIP + 基础功能
- 超级VIP + 高级功能
-

12个月

+ @click="currIndex = i, getQrcode(price)"> +

{{ price.remark }}

¥ - 88 + {{ price.price }}
¥ - 88 + {{ price.originPrice }}
@@ -55,7 +55,8 @@ 88
- + +
@@ -80,11 +81,40 @@ return { isShow: false, tabIndex: 0, - currIndex: 0 + currIndex: 0, + qrcode: '', + priceList: [] } }, + mounted() { + this.getPriceList() + }, + methods: { + getPriceList() { + this.$http.post(`/api/priceConfig/page?module=2`).then(res => { + if (res.code === 0) { + this.priceList = res.data.records + } + }) + }, + + getQrcode(item) { + this.$http.post(`/api/order/createOrder`, null, { + params: { + priceConfigId: item.id + } + }).then(res => { + if (res?.data?.id) { + return res.data.id + } + }).then(id => this.$http.post(`/api/order/createPrepayOrder?id=${id}`)).then(res => { + if (res?.data) { + this.qrcode = res.data.codeUrl + } + }) + }, show () { this.isShow = true }, @@ -120,8 +150,9 @@ top: 50%; left: 50%; z-index: 11; - width: 900px; - padding: 40px 40px; + width: 1100px; + height: 560px; + padding: 40px 60px; transform: translate(-50%, -50%); border-radius: 12px; overflow: hidden; @@ -130,7 +161,7 @@ .top { display: flex; align-items: center; - margin-bottom: 30px; + margin-bottom: 60px; img { width: 40px; @@ -180,6 +211,7 @@ .middle { display: flex; + height: 380px; .left { flex: 1; @@ -295,6 +327,7 @@ display: flex; flex-direction: column; align-items: center; + justify-content: center; margin-left: 40px; padding: 20px 0 20px 0; @@ -330,7 +363,7 @@ } } - .code img { + .code { width: 150px; height: 150px; margin: 14px 0; diff --git a/src/components/print/Print.vue b/src/components/print/Print.vue index 1d20c55..f85a7f9 100644 --- a/src/components/print/Print.vue +++ b/src/components/print/Print.vue @@ -196,7 +196,7 @@
模板预览 - 使用 + 使用
@@ -396,6 +396,7 @@ addField() { const num = this.dynamicFromList.length > 9 ? this.dynamicFromList.length + 1 : `0${this.dynamicFromList.length + 1}` + // eslint-disable-next-line no-empty if (this.dynamicFromList.length && !this.dynamicFromList.at(-1)[`field_${num}`]) { } else { this.$set(this.dynamicFrom, `field_${num}`, '') @@ -415,6 +416,9 @@ const config = JSON.parse(res.data.content) this.hiprintTemplate.update(config) this.hiprintTemplate.setPaper(config.panels[0].width, config.panels[0].height) + + this.dynamicFromList = JSON.parse(res.data.params) + this.isShowTemplate = false } this.templateLoading = false diff --git a/src/components/print/customProvider.js b/src/components/print/customProvider.js index 8214864..7789a48 100644 --- a/src/components/print/customProvider.js +++ b/src/components/print/customProvider.js @@ -1,5 +1,7 @@ +/* eslint-disable no-undef */ import { hiprint } from 'vue-plugin-hiprint' -export const customProvider = function (options) { + +export const customProvider = function () { const addElementTypes = function (context) { context.removePrintElementTypes('customProvider') context.addPrintElementTypes('customProvider', [ @@ -24,11 +26,9 @@ export const customProvider = function (options) { printData = sukData } - // eslint-disable-next-line no-undef $('body').append(`
`) - // eslint-disable-next-line no-undef JsBarcode('#' + elId, printData.labelCode, { format: 'CODE128B', width: 2, @@ -37,13 +37,11 @@ export const customProvider = function (options) { displayValue: false }) - // eslint-disable-next-line no-undef const codeHtml = $(`#codewrapper-${elId}`).html() - // eslint-disable-next-line no-undef $(`body>#codewrapper-${elId}`).remove() - // eslint-disable-next-line no-undef + const resizeObserver = new ResizeObserver(() => { - JsBarcode('#' + elId, printData.labelCode, { + JsBarcode('#' + elId, printData.labelCode, { format: "CODE128B", width: 2, height: parseInt(hinnn.pt.toPx(options.height - 22).toString()) * 0.6, diff --git a/src/view/lables/AddTemplate.vue b/src/view/lables/AddTemplate.vue index c61d594..996c0eb 100644 --- a/src/view/lables/AddTemplate.vue +++ b/src/view/lables/AddTemplate.vue @@ -16,7 +16,7 @@