';
var disable_blocks = Math.floor(process_width / every_left); // 进度条走过几个 progress-bar-node
if (shop == "trackingmore-5.myshopify.com" || shop == 'sheetsgiggles.myshopify.com') {
for (var i = 0, left = 0, color_str = ''; i < length; i++) {
color_str = left > process_width ? '' : 'background:' + config_color + ';';
var more_class = left > process_width ? 'will_to' : '';
var backgroundImg = color_str ? ((i === disable_blocks && status_number != 4) ? '//s.trackingmore.com/shopify/user_icon/icon-clock.png' : '//s.trackingmore.com/shopify/user_icon/icon-check-blue.svg') : '//s.trackingmore.com/shopify/status/blank.png';
str += '
' + progress_arr[i].svg + '' + progress_arr[i].name + '';
if (progress_arr[i].time) str += ' COMPLETE: ' + progress_arr[i].time + '';
str += '';
left += every_left;
if (i === length - 2) left = 100;
}
} else {
for (var i = 0, left = 0, color_str = ''; i < length; i++) {
color_str = left > process_width ? '' : 'background:' + config_color + ';';
var more_class = left > process_width ? 'will_to' : '';
str += '
' + progress_arr[i].svg + '' + progress_arr[i].name + '';
if (progress_arr[i].time) str += ' ' + progress_arr[i].time + '';
if (i === length - 2 && estimated_show === 2 && shipping_time_con.length!==0) str += 'ETA: ' + shipping_time_con + '';
str += '';
left += every_left;
if (i === length - 2) left = 100;
}
}
str += '
';
// Add mobile progress bar style
if (process_width < 100) process_width += 2;
str += '';
str += '
';
for (var i = 0, color_str = '', class_name = '', check_status = false; i < length; i++) {
// Check if the status is exceeded
check_status = tmCheckStatusProcess(status_number, progress_arr[i].status);
var backgroundImg = check_status ? ((i === disable_blocks && status_number != 4) ? '//s.trackingmore.com/shopify/user_icon/icon-clock.png' : '//s.trackingmore.com/shopify/user_icon/icon-check-blue.svg') : '//s.trackingmore.com/shopify/status/blank.png';
color_str = check_status ? 'background:' + config_color + ';' : '';
class_name = "progress-bar-mobile-list";
if (!progress_arr[i].time) {
class_name = "progress-bar-mobile-list progress-bar-mobile-disabled";
if (check_status) class_name = "progress-bar-mobile-list progress-bar-mobile-abled";
}
str += '
';
if (shop == "trackingmore-5.myshopify.com" || shop == 'sheetsgiggles.myshopify.com') {
str += '
';
} else {
str += '
';
}
str += progress_arr[i].msvg ? progress_arr[i].msvg : progress_arr[i].svg;
str += '
';
str += '' + progress_arr[i].name + '';
if (progress_arr[i].time) str += ' ' + progress_arr[i].time + '';
str += '
';
str += '
';
}
str += '
';
str += '
';
return [str, order_ready_status];
}
// Check the current status position
function tmCheckStatusProcess(status_number, status) {
// If the current state is between custom states
if (status_number > 1000) {
// Exceeded current status
if (status_number < status) return false;
// Other status
if (status < 1000) return false;
}
// Non-custom status
else {
status_number = status_number > 4 ? 2 : status_number;
if (status < 1000 && status_number < status) return false;
}
return true;
}
// Returns the current progress bar length based on the state and number of nodes
function get_process_width(over_width, status_number, every_left, node_count) {
status_number = parseInt(status_number);
var max_width = 100, width = 0;
switch (status_number) {
case 1001:
width = 3;
break;
case 1002:
width = max_width - ((3 + node_count) * every_left) + over_width;
break;
case 1003:
width = max_width - ((2 + node_count) * every_left) + over_width;
break;
case 1004:
width = max_width - (4 * every_left) + over_width;
break;
case 1100:
width = max_width - (3 * every_left) + over_width;
break;
case 3:
width = max_width - every_left + over_width;
break;
case 4:
width = max_width;
break;
default:
width = max_width - (2 * every_left) + over_width;
break;
}
return width;
}
// add set recommend node
function get_recommend_set_product_style(config_may_like, product, position, type) {
if (!product) return "";
product_arr.push(product);
var str = '