if (item2.shifoushiyong === 1) { if( typeof(item2.koufen) == "undefined" ) { item2.koufen = 0; } total += item2.koufen; }