diff --git a/src/api/badge.ts b/src/api/badge.ts index 0e44464..ebd4ae7 100644 --- a/src/api/badge.ts +++ b/src/api/badge.ts @@ -159,3 +159,11 @@ export const getMultiUrl = (params: any) => { params, }) } + +// 获取坐骑列表 +export const getMountsList = (params: any) => { + return request('products/mountsList', { + method: 'GET', + params, + }) +} \ No newline at end of file diff --git a/src/config/cartoon.ts b/src/config/cartoon.ts index 85b079c..b7ed2fd 100644 --- a/src/config/cartoon.ts +++ b/src/config/cartoon.ts @@ -175,7 +175,7 @@ export const cartoonConfig = { }, // 图片缩放比例 - imageScale: 0.6, + imageScale: 1, // 默认值配置 defaults: { diff --git a/src/views/cartoon/index.vue b/src/views/cartoon/index.vue index e245b17..2d4867f 100644 --- a/src/views/cartoon/index.vue +++ b/src/views/cartoon/index.vue @@ -14,8 +14,16 @@
{{ toValueWithout("产品类型") }}
-
- {{ toValueWithout(productTypeConfig.name) }} +
+ {{ toValueWithout(typeName) }} +
+
+
+
+ {{ toValueWithout("主体类型") }} +
+
+ {{ toValueWithout(subjectName) }}
@@ -322,39 +330,30 @@ const prodId = ref(0) const prop = ref('') const typeId = ref(0) const subjectId = ref(0) - +const typeName = ref('') +const subjectName = ref('') const getOrderStat = () => { badgeApi.getOrderStat({}).then((res: any) => { orderStat.value = res - const oldProdId = prodId.value - const oldTypeId = typeId.value prodId.value = res.prod_id prop.value = res.prop typeId.value = res.type_id + typeName.value = res.type_name subjectId.value = res.subject_id + subjectName.value = res.subject_name if (res.type_id === 4) { getKindList() - } else { - // 非类型4的产品需要获取形状列表 - // 如果产品ID或类型ID发生变化,重置选中的形状 - if (oldProdId !== res.prod_id || oldTypeId !== res.type_id) { - mountsId.value = 0 - } + } else if (res.type_id === 8) { + mountsId.value = 0 getmountsList() + } else if (res.type_id === 9) { + method.value = 1 + scenePropsInputs.value = [''] + scene_prop.value = '' } }) } -// 计算属性:当前产品类型配置 -const productTypeConfig = computed(() => { - return config.productTypes[typeId.value] -}) - -// 计算属性:是否是宠物主体 -const isPetSubject = computed(() => { - return config.subjectTypes.pet.prodIds.includes(prodId.value) -}) - // 计算属性:是否显示照片示例 const shouldShowPhotoExample = computed(() => { return config.productLimits.photoExampleTypes.includes(prop.value) @@ -373,19 +372,14 @@ const shouldShowMultiView = computed(() => { const kindList = ref([]) const getKindList = () => { badgeApi.getKindList({ - support_subject: getSupportSubject(), - type_id: 4 + prod_id: prodId.value }).then((res: any) => { kindList.value = res.list kindId.value = res.list && res.list[0]?.id }) } -const getSupportSubject = (): number => { - return isPetSubject.value - ? config.subjectTypes.pet.supportSubject - : config.subjectTypes.person.supportSubject -} + const kindId = ref(0) const kindChange = (id: number) => { @@ -407,7 +401,7 @@ const getmountsList = () => { if (!prodId.value || !typeId.value) { return } - badgeApi.getShapeList({ + badgeApi.getMountsList({ prod_id: prodId.value, type_id: typeId.value }).then((res: any) => { @@ -639,7 +633,6 @@ const getPid = async () => { }) const params = { prod_id: prodId.value, - extend_value: -1, type_id: typeId.value, subject_id: subjectId.value } @@ -740,7 +733,10 @@ const createLog = () => { prod_id: prodId.value, type_id: typeId.value, kind_id: kindId.value, - subject_id: subjectId.value + subject_id: subjectId.value, + scene_prop: typeId.value === 9 && method.value === 2 && scene_prop.value ? scene_prop.value : undefined, + mounts_id: mountsId.value || undefined, + method: method.value } badgeApi.createLog(params).then(() => { closeToast() @@ -758,9 +754,7 @@ const createLog = () => { prod_id: prodId.value, type_id: typeId.value, kind_id: kindId.value, - mounts_id: mountsId.value || undefined, - subject_id: subjectId.value, - scene_prop: typeId.value === 9 && method.value === 2 && scene_prop.value ? scene_prop.value : undefined + subject_id: subjectId.value }, }) }, 1000); @@ -1074,6 +1068,7 @@ onMounted(() => { } .kind-box-item { margin-right: 10px; + margin-bottom: 10px; padding: 6px 10px; background: #f5f5f5; border-radius: 8px; diff --git a/src/views/cartoon/myOrder.vue b/src/views/cartoon/myOrder.vue index c35a519..814b56c 100644 --- a/src/views/cartoon/myOrder.vue +++ b/src/views/cartoon/myOrder.vue @@ -40,7 +40,7 @@ function getOrder() { page: page.value, size: config.myOrder.pagination.pageSize, status: config.myOrder.pagination.defaultStatus, - }).then(res => { + }).then((res: any) => { if(page.value === config.myOrder.pagination.initialPage) { orders.value = res.list } else { diff --git a/src/views/cartoon/orderDetail.vue b/src/views/cartoon/orderDetail.vue index 80edc52..4b27ff6 100644 --- a/src/views/cartoon/orderDetail.vue +++ b/src/views/cartoon/orderDetail.vue @@ -44,8 +44,8 @@
{{ toValueWithout(config.orderDetail.messages.productName) }} - - {{ toValueWithout(config.preview.productNames[order.type_id][order.prod_id] || '') }} + + {{ toValueWithout(order.prod_name) }}
@@ -70,11 +70,11 @@
{{ toValueWithout(config.orderDetail.messages.orderId) }} - {{order.sw_oid}} + {{order.id}}
{{ toValueWithout(config.orderDetail.messages.orderTime) }} - {{order.pay_at}} + {{order.created_at}}
@@ -109,35 +109,19 @@ const imageList = ref([]) function getOrderDetail() { badgeApi.getOrderDetail({ id: id.value, - }).then(res => { + }).then((res: any) => { order.value = res; - imageUrl.value = res.path; - backImageUrl.value = res.back_path; - shapeImage.value = res.shape_details?.frame_path || ''; - shape_name.value = res.shape_details?.name || ''; + imageUrl.value = res?.path; + backImageUrl.value = res?.back_path; + shapeImage.value = res?.shape_details?.frame_path || ''; + shape_name.value = res?.shape_details?.name || ''; imageList.value = [ - res.path, - res.back_path, + res?.path, + res?.back_path, ]; }) } -const ImageShow = (item: any) => { - const scale = config.orderDetail.imageScale - const img = new Image() - img.src = item.frame_path - img.onload = () => { - console.log('img', img) - const ratioWidth = config.orderDetail.imageSize.width / img.width; - const ratioHeight = config.orderDetail.imageSize.height / img.height; - const x = item.axisx * ratioWidth * scale; - const y = item.axisy * ratioHeight * scale; - const path_width = item.width * ratioWidth * scale; - const path_height = item.height * ratioHeight * scale; - getStyle.value = `left: ${x}px;top: ${y}px;width: ${path_width}px;height: ${path_height}px;transform: rotate3D(1, 1, 0, 0deg)` - } -} - function goBack() { router.back() } diff --git a/src/views/cartoon/previewOrder.vue b/src/views/cartoon/previewOrder.vue index d7f5365..dbd5d02 100644 --- a/src/views/cartoon/previewOrder.vue +++ b/src/views/cartoon/previewOrder.vue @@ -61,8 +61,8 @@
-
{{ toValueWithout(productName) }}
-
{{ toValueWithout(config.preview.messages.productType) }}
+
{{ toValueWithout('产品类型') }}
+
{{ toValueWithout(typeName) }}
{{ toValueWithout("3D全彩打印") }}
@@ -101,6 +101,10 @@
+
+ +
+
@@ -139,7 +143,6 @@
-
@@ -153,13 +156,13 @@
- +
- +
@@ -176,7 +179,7 @@