diff --git a/.env.development b/.env.development index ff634ef..ba1388d 100644 --- a/.env.development +++ b/.env.development @@ -1,7 +1,7 @@ VITE_APP_PREVIEW=true # VITE_APP_API_BASE_URL=http://172.16.0.47:8166/web/ -# VITE_APP_API_BASE_URL=https://wechat-test.api.puabadge.com/web/ -VITE_APP_API_BASE_URL=https://wechat.api.puabadge.com/web/ +VITE_APP_API_BASE_URL=https://wechat-test.api.puabadge.com/web/ +# VITE_APP_API_BASE_URL=https://wechat.api.puabadge.com/web/ # VITE_APP_API_WX_URL=https://wechat.api.puabadge.com/web/ # http://web.suwa3d.dev:28499/ VITE_HTTP_MOCK=true diff --git a/components.d.ts b/components.d.ts index d819104..109a968 100644 --- a/components.d.ts +++ b/components.d.ts @@ -24,7 +24,6 @@ declare module '@vue/runtime-core' { VanDivider: typeof import('vant/es')['Divider'] VanField: typeof import('vant/es')['Field'] VanIcon: typeof import('vant/es')['Icon'] - VanImage: typeof import('vant/es')['Image'] VanList: typeof import('vant/es')['List'] VanPullRefresh: typeof import('vant/es')['PullRefresh'] VanStepper: typeof import('vant/es')['Stepper'] diff --git a/src/api/badge.ts b/src/api/badge.ts index 8b274e5..dd932ff 100644 --- a/src/api/badge.ts +++ b/src/api/badge.ts @@ -127,3 +127,27 @@ export const faceCheck = (params: any) => { params, }) } + +// 获取形状列表 +export const getShapeList = (params: any) => { + return request('products/shapeList', { + method: 'GET', + params, + }) +} + +// 获取形状类别列表 +export const getTypesList = (params: any) => { + return request('products/typesList', { + method: 'GET', + params, + }) +} + +// 上传合成图 +export const composite = (data: any) => { + return request('uploads/composite', { + method: 'POST', + data, + }) +} diff --git a/src/assets/font/font.css b/src/assets/font/font.css new file mode 100644 index 0000000..26b4a00 --- /dev/null +++ b/src/assets/font/font.css @@ -0,0 +1,4 @@ +@font-face { + font-family: "chinese"; + src: url('jingnan-Nunito.ttf'); +} \ No newline at end of file diff --git a/src/assets/font/jingnan-Nunito.ttf b/src/assets/font/jingnan-Nunito.ttf new file mode 100644 index 0000000..6651ab3 Binary files /dev/null and b/src/assets/font/jingnan-Nunito.ttf differ diff --git a/src/main.ts b/src/main.ts index 26de12f..d766720 100644 --- a/src/main.ts +++ b/src/main.ts @@ -7,6 +7,7 @@ import router from './router' import './app.less' import './assets/icon/iconfont.css' +import "./assets/font/font.css"; // import I18n from "@/lang/i18n" import I18NextVue from 'i18next-vue' diff --git a/src/views/badge/index.vue b/src/views/badge/index.vue index a8ab011..145337a 100644 --- a/src/views/badge/index.vue +++ b/src/views/badge/index.vue @@ -12,10 +12,15 @@ const show = ref(false) const imgShow = ref(false) const router = useRouter() const option = ref({ + canScale: true, autoCropWidth: 1024, autoCropHeight: 1024, ceilbutton: false, infoTrue: true, + fixed: false, + fixedNumber: [3, 4], + fixedBox: false, + canMoveBox: true, enlarge: 6 }) const options = ref({ @@ -135,19 +140,23 @@ function getbase64Data(data) { img.onload = () => { imageWidth.value = img.naturalWidth; imageHeight.value = img.naturalHeight; - if (imageWidth.value < 800 || imageHeight.value < 800) { - showToast('请上传尺寸大于800*800像素的照片') - return + if (imageWidth.value < 500 || imageHeight.value < 500) { + showToast('请上传尺寸大于500*500像素的照片') + imgurl.value = null + picture.value = null + return false; + } + const blob = base64ToBlob(data); + if (blob.size > 1024 * 1024 * 10) { + showToast('照片大小不能超过10M') + imgurl.value = null + picture.value = null + return false; + } + imgurl.value = blob; + if (prodId.value == 7) { + getUploadUrl() } - } - const blob = base64ToBlob(data); - if (blob.size > 1024 * 1024 * 10) { - showToast('照片大小不能超过10M') - return - } - imgurl.value = blob; - if (prodId.value == 7) { - getUploadUrl() } } @@ -172,8 +181,8 @@ function imgorigoinf(data) { img.onload = () => { imageWidth.value = img.naturalWidth; imageHeight.value = img.naturalHeight; - if (imageWidth.value < 800 || imageHeight.value < 800) { - showToast('请上传尺寸大于800*800像素的照片') + if (imageWidth.value < 500 || imageHeight.value < 500) { + showToast('请上传尺寸大于500*500像素的照片') setTimeout(() => { const btn = document.querySelector('.btn') if (btn) { @@ -795,7 +804,7 @@ onMounted(() => { } .step-title { font-size: 16px; - color: #808080;; + color: #808080; } .step-desc { font-size: 12px; @@ -808,6 +817,7 @@ onMounted(() => { width: 80vw; height: 80vw; margin: 16px auto 0 auto; + text-align: center; } .photo-upload-box { margin: 16px auto 0 auto; @@ -833,8 +843,8 @@ onMounted(() => { right: 0; } .photo-upload-img { - width: 80vw; - height: 80vw; + max-width: 80vw; + max-height: 80vw; border-radius: 12px; } .photo-upload-header { diff --git a/src/views/badge/orderDetail.vue b/src/views/badge/orderDetail.vue index fdbd7a8..174e214 100644 --- a/src/views/badge/orderDetail.vue +++ b/src/views/badge/orderDetail.vue @@ -5,8 +5,10 @@