feat:概念测试、口味测试改版;

This commit is contained in:
钱冠学
2024-11-19 16:26:53 +08:00
parent d3a7aad9d0
commit d2ea8f3dfd
3 changed files with 50 additions and 34 deletions

View File

@@ -28,7 +28,8 @@ async function onActive(item) {
<template> <template>
<div class="steps"> <div class="steps">
<template v-for="(item, index) in props.list" :key="index"> <template v-for="(item, index) in props.list" :key="index">
<div v-if="index" class="line"></div> <div v-if="!index" class="placeholder" />
<div v-if="index" class="line" />
<div <div
class="step" class="step"
:class="{ active: props.value === item.id, disabled: item.disabled }" :class="{ active: props.value === item.id, disabled: item.disabled }"
@@ -39,6 +40,7 @@ async function onActive(item) {
</div> </div>
<div class="name">{{ item.name }}</div> <div class="name">{{ item.name }}</div>
</div> </div>
<div v-if="index === props.list.length - 1" class="placeholder" />
</template> </template>
</div> </div>
</template> </template>
@@ -51,7 +53,11 @@ async function onActive(item) {
width: 100%; width: 100%;
height: 64px; height: 64px;
//margin-bottom: 25px; //margin-bottom: 25px;
padding: 0 40px; //padding: 0 40px;
.placeholder {
flex: auto;
}
.line { .line {
align-self: flex-start; align-self: flex-start;

View File

@@ -78,6 +78,8 @@ const templateSnList = ref([]);
function onReset() { function onReset() {
stepId.value = conceptTypeEnum.basic; stepId.value = conceptTypeEnum.basic;
expandNewest.value = true;
expandStandard.value = true;
// 标准版 // 标准版
newList1.value = [getNewItem(standardNewestEnum.newest), getNewItem(standardNewestEnum.newest)]; newList1.value = [getNewItem(standardNewestEnum.newest), getNewItem(standardNewestEnum.newest)];
@@ -128,6 +130,9 @@ function getSnByTestType(type) {
function onTestTypeChange(evt) { function onTestTypeChange(evt) {
testType.value = evt.id; testType.value = evt.id;
templateSn.value = getSnByTestType(evt.id); templateSn.value = getSnByTestType(evt.id);
expandNewest.value = true;
expandStandard.value = true;
} }
function getNewItem(type) { function getNewItem(type) {
@@ -137,7 +142,7 @@ function getNewItem(type) {
key: uuid(), key: uuid(),
data: { data: {
concept_type: type, // 概念类型 0标杆概念 1新品概念 concept_type: type, // 概念类型 0标杆概念 1新品概念
// concept_encode: '', // 概念编号 concept_encode: '', // 概念编号
concept_name: '', concept_name: '',
concept_url: '' concept_url: ''
} }
@@ -193,21 +198,21 @@ function scrollTo(idSelector) {
} }
function updateEncode() { function updateEncode() {
// [newList1.value, standardList1.value] = updateEncodeForGroup( [newList1.value, standardList1.value] = updateEncodeForGroup(
// newList1.value, newList1.value,
// standardList1.value, standardList1.value,
// '概念' '概念'
// ); );
// [newList2.value, standardList2.value] = updateEncodeForGroup( [newList2.value, standardList2.value] = updateEncodeForGroup(
// newList2.value, newList2.value,
// standardList2.value, standardList2.value,
// '概念' '概念'
// ); );
// [newList3.value, standardList3.value] = updateEncodeForGroup( [newList3.value, standardList3.value] = updateEncodeForGroup(
// newList3.value, newList3.value,
// standardList3.value, standardList3.value,
// '概念' '概念'
// ); );
} }
function updateEncodeForGroup(list1, list2, prefix = '') { function updateEncodeForGroup(list1, list2, prefix = '') {

View File

@@ -72,6 +72,8 @@ const templateSnList = ref([]);
function onReset() { function onReset() {
stepId.value = tasteTypeEnum.basic; stepId.value = tasteTypeEnum.basic;
expandNewest.value = true;
expandStandard.value = true;
// 标准版 // 标准版
newList1.value = [getNewItem(standardNewestEnum.newest), getNewItem(standardNewestEnum.newest)]; newList1.value = [getNewItem(standardNewestEnum.newest), getNewItem(standardNewestEnum.newest)];
@@ -122,6 +124,9 @@ function getSnByTestType(type) {
function onTestTypeChange(evt) { function onTestTypeChange(evt) {
testType.value = evt.id; testType.value = evt.id;
templateSn.value = getSnByTestType(evt.id); templateSn.value = getSnByTestType(evt.id);
expandNewest.value = true;
expandStandard.value = true;
} }
function getNewItem(type) { function getNewItem(type) {
@@ -131,7 +136,7 @@ function getNewItem(type) {
key: uuid(), key: uuid(),
data: { data: {
taste_type: type, // 口味类型 0标杆口味 1新品口味 taste_type: type, // 口味类型 0标杆口味 1新品口味
// taste_encode: '', // 口味编号 taste_encode: '', // 口味编号
taste_name: '', // 口味名称 taste_name: '', // 口味名称
taste_attr_indicator: ['', ''] // 关键属性指标(字符串列表) taste_attr_indicator: ['', ''] // 关键属性指标(字符串列表)
} }
@@ -187,21 +192,21 @@ function scrollTo(idSelector) {
} }
function updateEncode() { function updateEncode() {
// [newList1.value, standardList1.value] = updateEncodeForGroup( [newList1.value, standardList1.value] = updateEncodeForGroup(
// newList1.value, newList1.value,
// standardList1.value, standardList1.value,
// '口味' '口味'
// ); );
// [newList2.value, standardList2.value] = updateEncodeForGroup( [newList2.value, standardList2.value] = updateEncodeForGroup(
// newList2.value, newList2.value,
// standardList2.value, standardList2.value,
// '口味' '口味'
// ); );
// [newList3.value, standardList3.value] = updateEncodeForGroup( [newList3.value, standardList3.value] = updateEncodeForGroup(
// newList3.value, newList3.value,
// standardList3.value, standardList3.value,
// '口味' '口味'
// ); );
} }
function updateEncodeForGroup(list1, list2, prefix = '') { function updateEncodeForGroup(list1, list2, prefix = '') {