Browse Source

形状选择

lzm_web
Linzm 6 months ago
parent
commit
e78d31c8b8
  1. 8
      src/views/badge/index.vue
  2. 40
      src/views/badge/preview.vue

8
src/views/badge/index.vue

@ -312,14 +312,6 @@ const sizeList = ref([]) @@ -312,14 +312,6 @@ const sizeList = ref([])
const getSizeList = () => {
badgeApi.getOrderPrice({}).then((res: any) => {
sizeList.value = res
if (orderStat.value.use_type == 1) {
sizeList.value.forEach((item: any) => {
if (item.shape_item == null || item.shape_item == undefined || item.shape_item == '' || !item.shape_item) {
showToast('该链接异常,请联系客服')
return
}
})
}
})
}

40
src/views/badge/preview.vue

@ -93,8 +93,8 @@ @@ -93,8 +93,8 @@
<div class="order-section" v-if="trialCode == false && imageUrl">
<div class="order-title">订购数量</div>
<block v-for="item in sizeList" :key="item.id">
<block v-if="orderStat.use_type == 1">
<div class="order-item" v-show="item.shape_id == shapeId">
<block>
<div class="order-item">
<span class="order-size">{{ item.size }}</span>
<span class="order-free">(剩余兑换{{ item.remaining }})</span>
<div class="order-ctrl">
@ -102,7 +102,7 @@ @@ -102,7 +102,7 @@
</div>
</div>
</block>
<block v-if="orderStat.use_type == 2">
<!-- <block v-if="orderStat.use_type == 2">
<div class="order-item">
<span class="order-size">{{ item.size }}</span>
<span class="order-free">(剩余兑换{{ item.remaining }})</span>
@ -110,7 +110,7 @@ @@ -110,7 +110,7 @@
<van-stepper v-model="item.count" :min="0" :max="item.remaining" @change="changeValue" />
</div>
</div>
</block>
</block> -->
</block>
</div>
<div class="address-box" v-if="orderStat.use_type == 2 && imageUrl">
@ -303,23 +303,7 @@ const getSizeList = () => { @@ -303,23 +303,7 @@ const getSizeList = () => {
badgeApi.getOrderPrice({}).then((res: any) => {
console.log('getSizeList', res);
sizeList.value = res
if (orderStat.value.use_type == 1) {
sizeList.value.forEach((item: any) => {
if (item.shape_item) {
if (!shapeList.value.some(shape => shape.id === item.shape_id)) {
shapeList.value.push(item.shape_item)
}
} else {
showToast('该链接异常,请联系客服')
return
}
})
if (shapeList.value.length > 0) {
shapeChange(shapeList.value[0])
}
} else {
getShapeList()
}
})
}
@ -605,20 +589,6 @@ const getImageList = () => { @@ -605,20 +589,6 @@ const getImageList = () => {
})
}
// const typeId = ref(1)
// const typesList = ref([])
// const getTypesList = () => {
// badgeApi.getTypesList({}).then((res: any) => {
// console.log('getTypesList', res)
// typesList.value = res.list
// typeId.value = res.list[0].id
// getShapeList()
// }).catch((err) => {
// console.log('getTypesList', err)
// }).finally((err) => {
// })
// }
const shapeId = ref(0)
const shapeImage = ref('')
@ -984,6 +954,7 @@ onUnmounted(() => { @@ -984,6 +954,7 @@ onUnmounted(() => {
width: 100%;
height: auto;
border-radius: 10px;
background: rgba(0, 0, 0, 0.3);
}
.box1-round-shadow {
position: absolute;
@ -1275,6 +1246,7 @@ onUnmounted(() => { @@ -1275,6 +1246,7 @@ onUnmounted(() => {
height: 20vw;
border-radius: 12px;
border: 3px solid #fff;
background: rgba(0, 0, 0, 0.3);
}
.image-list-item-img.imgActive {
border: 3px solid #50cf54;

Loading…
Cancel
Save