layui.define(['layer', 'carousel'], function (exports) {
var $ = layui.jquery;
var layer = layui.layer;
var carousel = layui.carousel;
// 添加步骤条dom节点
var renderDom = function (elem, stepItems, postion) {
var stepDiv = '
';
for (var i = 0; i < stepItems.length; i++) {
stepDiv += '
';
// 线
if (i < (stepItems.length - 1)) {
if (i < postion) {
stepDiv += '
';
} else {
stepDiv += '
';
}
}
// 数字
var number = stepItems[i].number;
if (!number) {
number = i + 1;
}
if (i == postion) {
stepDiv += '
' + number + '
';
} else if (i < postion) {
stepDiv += '
';
} else {
stepDiv += '
' + number + '
';
}
// 标题和描述
var title = stepItems[i].title;
var desc = stepItems[i].desc;
if (title || desc) {
stepDiv += '