|
|
|
|
@ -61,8 +61,8 @@
@@ -61,8 +61,8 @@
|
|
|
|
|
</div> |
|
|
|
|
<div class="info-section"> |
|
|
|
|
<div class="info-item"> |
|
|
|
|
<div class="info-title" v-if="productName">{{ toValueWithout(productName) }}</div> |
|
|
|
|
<div class="info-content">{{ toValueWithout(config.preview.messages.productType) }}</div> |
|
|
|
|
<div class="info-title">{{ toValueWithout('产品类型') }}</div> |
|
|
|
|
<div class="info-content" v-if="typeName">{{ toValueWithout(typeName) }}</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="info-item"> |
|
|
|
|
<div class="info-title">{{ toValueWithout("3D全彩打印") }}</div> |
|
|
|
|
@ -101,6 +101,10 @@
@@ -101,6 +101,10 @@
|
|
|
|
|
<input class="shape-box-input-text" v-if="axisz == 1" type="text" :placeholder="toValueWithout('请输入正面文字')" v-model="frontText" @change="changeFrontText" @input="changeFrontText" @onBlur="changeFrontText" /> |
|
|
|
|
<input class="shape-box-input-text" v-if="axisz == -1" type="text" :placeholder="toValueWithout('请输入背面文字')" v-model="backText" @change="changeBackText" @input="changeBackText" @onBlur="changeBackText" /> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<!-- 后视图 --> |
|
|
|
|
<div> |
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
<div style="padding: 0 16px;"> |
|
|
|
|
<van-divider /> |
|
|
|
|
@ -139,7 +143,6 @@
@@ -139,7 +143,6 @@
|
|
|
|
|
<div style="height: 130px;"></div> |
|
|
|
|
<div class="confirm-box"> |
|
|
|
|
<div class="action-section"> |
|
|
|
|
<!-- <button @click="sureReload" :disabled="flag < 1" class="action-btn"><img class="action-img" :src="reloadImage" alt=""> {{ toValueWithout(config.preview.messages.regenerate) }}</button> --> |
|
|
|
|
<button @click="compare" :disabled="flag < 1" class="action-btn"><img class="action-img" :src="compareImage" alt=""> {{ toValueWithout(config.preview.messages.compare) }}</button> |
|
|
|
|
<button @click="save" :disabled="flag < 1" class="action-btn"><img class="action-img" :src="downloadImage" alt=""> {{ toValueWithout(config.preview.messages.saveImage) }}</button> |
|
|
|
|
</div> |
|
|
|
|
@ -153,13 +156,13 @@
@@ -153,13 +156,13 @@
|
|
|
|
|
<div style="padding: 16px;"> |
|
|
|
|
<div style="display: flex; align-items: center; justify-content: center; gap: 20px;"> |
|
|
|
|
<div style="text-align: center;"> |
|
|
|
|
<img :src="compareList.origin_path" :alt="toValueWithout(config.preview.messages.originalImage)" :style="`max-width: ${config.preview.imageSize.compareImageSize}px; max-height: ${config.preview.imageSize.compareImageSize}px; border-radius: 8px;`"> |
|
|
|
|
<img :src="compareList.origin_path" :alt="toValueWithout(config.preview.messages.originalImage)" :style="`max-width: ${config.preview.imageSize.compareImageSize}px; max-height: ${config.preview.imageSize.compareImageSize}px; border-radius: 8px;object-fit: contain;`"> |
|
|
|
|
</div> |
|
|
|
|
<div style="font-size: 24px; color: #333;"> |
|
|
|
|
<van-icon name="arrow" size="20px" /> |
|
|
|
|
</div> |
|
|
|
|
<div style="text-align: center;"> |
|
|
|
|
<img :src="imageUrl" :alt="toValueWithout(config.preview.messages.previewImage)" :style="`width: ${config.preview.imageSize.compareImageSize}px; height: ${config.preview.imageSize.compareImageSize}px; border-radius: 8px;`"> |
|
|
|
|
<img :src="imageUrl" :alt="toValueWithout(config.preview.messages.previewImage)" :style="`width: ${config.preview.imageSize.compareImageSize}px; height: ${config.preview.imageSize.compareImageSize}px; border-radius: 8px;object-fit: contain;`"> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div style="text-align: center; margin-top: 16px; color: #999; font-size: 12px;"> |
|
|
|
|
@ -176,7 +179,7 @@
@@ -176,7 +179,7 @@
|
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
<script setup lang="ts"> |
|
|
|
|
import { onMounted, ref, onUnmounted, nextTick, computed } from 'vue'; |
|
|
|
|
import { onMounted, ref, onUnmounted, nextTick } from 'vue'; |
|
|
|
|
import { useRouter, useRoute } from 'vue-router'; |
|
|
|
|
import { showSuccessToast, showToast, showConfirmDialog } from 'vant'; |
|
|
|
|
import { localStorage } from '@/utils/local-storage' |
|
|
|
|
@ -187,11 +190,9 @@ import { createTextPosition } from '@/utils/textHelper'
@@ -187,11 +190,9 @@ import { createTextPosition } from '@/utils/textHelper'
|
|
|
|
|
import { cartoonConfig as config } from '@/config/cartoon' |
|
|
|
|
|
|
|
|
|
// 导入图片资源 |
|
|
|
|
import reloadImageSrc from '@/assets/badge/reload.png' |
|
|
|
|
import compareImageSrc from '@/assets/badge/duibi.png' |
|
|
|
|
import downloadImageSrc from '@/assets/badge/down.png' |
|
|
|
|
|
|
|
|
|
const reloadImage = reloadImageSrc |
|
|
|
|
const compareImage = compareImageSrc |
|
|
|
|
const downloadImage = downloadImageSrc |
|
|
|
|
|
|
|
|
|
@ -229,59 +230,10 @@ const textHelper = createTextPosition({
@@ -229,59 +230,10 @@ const textHelper = createTextPosition({
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// 计算产品名称 |
|
|
|
|
const productName = computed(() => { |
|
|
|
|
if (!typeId.value || !prodId.value) return '' |
|
|
|
|
const typeConfig = config.preview.productNames[typeId.value] |
|
|
|
|
if (typeConfig && typeConfig[prodId.value]) { |
|
|
|
|
return typeConfig[prodId.value] |
|
|
|
|
} |
|
|
|
|
return '' |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
function compare() { |
|
|
|
|
showCompare.value = true |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function sureReload() { |
|
|
|
|
console.log('orderStat', orderStat.value) |
|
|
|
|
if (orderStat.value.remain_count <= 0) { |
|
|
|
|
showToast(toValueWithout(config.preview.messages.noRemainingCount)) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
isPreview.value = false |
|
|
|
|
showConfirmDialog({ |
|
|
|
|
title: toValueWithout(config.preview.messages.regenerate), |
|
|
|
|
message: toValueWithout(config.preview.messages.confirmRegenerate), |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
group.value = newGroup.value |
|
|
|
|
const params = { |
|
|
|
|
pid: pid.value, |
|
|
|
|
group: config.preview.defaults.group, |
|
|
|
|
prod_id: prodId.value, |
|
|
|
|
type_id: typeId.value, |
|
|
|
|
kind_id: kindId.value |
|
|
|
|
} |
|
|
|
|
badgeApi.putModeling(params).then((res: any) => { |
|
|
|
|
console.log('putModeling', res) |
|
|
|
|
imageUrl.value = ''; |
|
|
|
|
imageList.value = [] |
|
|
|
|
imgKey.value = ''; |
|
|
|
|
createLog() |
|
|
|
|
}).catch((err) => { |
|
|
|
|
console.log('putModeling', err) |
|
|
|
|
showToast({ |
|
|
|
|
message: err.message, |
|
|
|
|
duration: 2000, |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
.catch(() => { |
|
|
|
|
// on cancel |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const imgKey = ref(config.preview.defaults.imgKey) |
|
|
|
|
const frameUrl = ref('') |
|
|
|
|
const changeImage = (item: any) => { |
|
|
|
|
@ -292,31 +244,6 @@ const changeImage = (item: any) => {
@@ -292,31 +244,6 @@ const changeImage = (item: any) => {
|
|
|
|
|
imageWater.value = item.image_url |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const createLog = () => { |
|
|
|
|
badgeApi.createLog({ |
|
|
|
|
pid: pid.value, |
|
|
|
|
group: config.preview.defaults.group, |
|
|
|
|
prod_id: prodId.value, |
|
|
|
|
type_id: typeId.value, |
|
|
|
|
kind_id: kindId.value |
|
|
|
|
}).then((res: any) => { |
|
|
|
|
console.log('createLog', res) |
|
|
|
|
progressTimer.value = null |
|
|
|
|
getImageList() |
|
|
|
|
progressList() |
|
|
|
|
getCompareImage() |
|
|
|
|
timer.value = setInterval(() => { |
|
|
|
|
getImageList() |
|
|
|
|
}, config.preview.polling.interval) |
|
|
|
|
}).catch((err) => { |
|
|
|
|
console.log('createLog', err) |
|
|
|
|
showToast({ |
|
|
|
|
message: err.message, |
|
|
|
|
duration: 2000, |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const showPreview = ref(false) |
|
|
|
|
function save() { |
|
|
|
|
showPreview.value = true; |
|
|
|
|
@ -426,7 +353,7 @@ const confirm = () => {
@@ -426,7 +353,7 @@ const confirm = () => {
|
|
|
|
|
message: toValueWithout(config.preview.messages.confirmOrder), |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
const parms = { |
|
|
|
|
const parms: any = { |
|
|
|
|
pid: pid.value, |
|
|
|
|
key: imgKey.value, |
|
|
|
|
pay_amount: payAmount.value, |
|
|
|
|
@ -633,7 +560,8 @@ const limitCount = ref(0)
@@ -633,7 +560,8 @@ const limitCount = ref(0)
|
|
|
|
|
const getShapeList = () => { |
|
|
|
|
badgeApi.getShapeList({ |
|
|
|
|
prod_id: prodId.value, |
|
|
|
|
type_id: typeId.value |
|
|
|
|
type_id: typeId.value, |
|
|
|
|
subject_id: subjectId.value |
|
|
|
|
}).then((res: any) => { |
|
|
|
|
console.log('getShapeList', res) |
|
|
|
|
shapeList.value = res.list |
|
|
|
|
@ -1037,12 +965,14 @@ const shapeChange = (item: any) => {
@@ -1037,12 +965,14 @@ const shapeChange = (item: any) => {
|
|
|
|
|
const orderStat = ref({}) |
|
|
|
|
const typeId = ref(0) |
|
|
|
|
const subjectId = ref(0) |
|
|
|
|
const typeName = ref('') |
|
|
|
|
const getOrderStat = () => { |
|
|
|
|
badgeApi.getOrderStat({}).then((res: any) => { |
|
|
|
|
console.log('getOrderStat', res) |
|
|
|
|
orderStat.value = res |
|
|
|
|
typeId.value = res.type_id |
|
|
|
|
subjectId.value = res.subject_id |
|
|
|
|
typeName.value = res.type_name |
|
|
|
|
badgeTypeId.value = res.type_id |
|
|
|
|
getSizeList() |
|
|
|
|
}) |
|
|
|
|
|