Files
quinn-wx/pages/myself/about/index.js
2022-12-14 19:39:14 +08:00

48 lines
1.4 KiB
JavaScript

Page({
data: {
customStepCurrent: 4,
customStepItems: [
{
title: '二级步骤描述',
content: '可自定义此处内容',
extra: '可自定义此处内容',
},
{
content: '可自定义此处内容',
extra: '可自定义此处内容',
},
{
content: '可自定义此处内容',
extra: '可自定义此处内容',
},
{
title: '二级步骤描述',
extra: '可自定义此处内容',
content: '可自定义此处内容',
},
{
title: '二级步骤描述',
extra: '可自定义此处内容',
content: '可自定义此处内容',
},
],
},
onShow() {
const { customStepCurrent, customStepItems } = this.data;
const newCustomStepItems = customStepItems.map((element, elementIndex) => {
if (elementIndex < customStepCurrent) {
element.status = 'finish';
} else if (elementIndex === customStepCurrent) {
element.status = 'active';
} else {
element.status = 'default';
}
return element;
});
this.setData({
customStepItems: newCustomStepItems,
});
}
});