1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
| static v8::Local<v8::ObjectTemplate> CreateGetLevelCountGlobalObject(v8::Isolate* isolate, const PaymentUserInfo& userInfo) { v8::Local<v8::ObjectTemplate> global_object = v8::ObjectTemplate::New(isolate); v8::Local<v8::ObjectTemplate> global_user_info_object = v8::ObjectTemplate::New(isolate); global_user_info_object->Set(v8::String::NewFromUtf8(isolate, "id").ToLocalChecked(), v8::Integer::New(isolate, userInfo.userInfo.id)); global_user_info_object->Set(v8::String::NewFromUtf8(isolate, "userNewId").ToLocalChecked(), v8::String::NewFromUtf8(isolate, userInfo.userInfo.userNewId.c_str()).ToLocalChecked()); global_user_info_object->Set(v8::String::NewFromUtf8(isolate, "userOldId").ToLocalChecked(), v8::String::NewFromUtf8(isolate, userInfo.userInfo.userOldId.c_str()).ToLocalChecked()); global_user_info_object->Set(v8::String::NewFromUtf8(isolate, "userName").ToLocalChecked(), v8::String::NewFromUtf8(isolate, userInfo.userInfo.userName.c_str()).ToLocalChecked()); global_user_info_object->Set(v8::String::NewFromUtf8(isolate, "phone").ToLocalChecked(), v8::String::NewFromUtf8(isolate, userInfo.userInfo.phone.c_str()).ToLocalChecked()); global_user_info_object->Set(v8::String::NewFromUtf8(isolate, "cardNo").ToLocalChecked(), v8::String::NewFromUtf8(isolate, userInfo.userInfo.cardNo.c_str()).ToLocalChecked()); global_user_info_object->Set(v8::String::NewFromUtf8(isolate, "compnayId").ToLocalChecked(), v8::String::NewFromUtf8(isolate, userInfo.userInfo.compnayId.c_str()).ToLocalChecked()); global_user_info_object->Set(v8::String::NewFromUtf8(isolate, "payCnt").ToLocalChecked(), v8::Integer::New(isolate, userInfo.userInfo.payCnt)); global_user_info_object->Set(v8::String::NewFromUtf8(isolate, "fillCnt").ToLocalChecked(), v8::Integer::New(isolate, userInfo.userInfo.fillCnt)); global_user_info_object->Set(v8::String::NewFromUtf8(isolate, "meterId").ToLocalChecked(), v8::Integer::New(isolate, userInfo.userInfo.meterId));
v8::Local<v8::ObjectTemplate> global_common_info_object = v8::ObjectTemplate::New(isolate); global_common_info_object->Set(v8::String::NewFromUtf8(isolate, "buyTotalQuantity").ToLocalChecked(), v8::Integer::New(isolate, userInfo.commonField.buyTotalQuantity)); global_common_info_object->Set(v8::String::NewFromUtf8(isolate, "buyTotalMoney").ToLocalChecked(), v8::Integer::New(isolate, userInfo.commonField.buyTotalMoney)); global_common_info_object->Set(v8::String::NewFromUtf8(isolate, "yearTotalQuantity").ToLocalChecked(), v8::Integer::New(isolate, userInfo.commonField.buyTotalMoney)); global_common_info_object->Set(v8::String::NewFromUtf8(isolate, "chargePoorId").ToLocalChecked(), v8::String::NewFromUtf8(isolate, userInfo.commonField.chargePoorId.c_str()).ToLocalChecked()); global_common_info_object->Set(v8::String::NewFromUtf8(isolate, "chargePoorPrice").ToLocalChecked(), v8::Integer::New(isolate, userInfo.commonField.chargePoorPrice)); global_common_info_object->Set(v8::String::NewFromUtf8(isolate, "chargePoorMonthMaxMoney").ToLocalChecked(), v8::Integer::New(isolate, userInfo.commonField.chargePoorMonthMaxMoney)); global_common_info_object->Set(v8::String::NewFromUtf8(isolate, "monthTotalMoney").ToLocalChecked(), v8::Integer::New(isolate, userInfo.commonField.monthTotalMoney));
v8::Local<v8::ObjectTemplate> global_price_info_object = v8::ObjectTemplate::New(isolate); global_price_info_object->Set(v8::String::NewFromUtf8(isolate, "id").ToLocalChecked(), v8::Integer::New(isolate, userInfo.userPriceType.id)); global_price_info_object->Set(v8::String::NewFromUtf8(isolate, "detailId").ToLocalChecked(), v8::Integer::New(isolate, userInfo.userPriceType.detailId)); global_price_info_object->Set(v8::String::NewFromUtf8(isolate, "price").ToLocalChecked(), v8::String::NewFromUtf8(isolate, userInfo.userPriceType.price.c_str()).ToLocalChecked());
v8::Local<v8::ObjectTemplate> global_last_pay_info_object = v8::ObjectTemplate::New(isolate); global_last_pay_info_object->Set(v8::String::NewFromUtf8(isolate, "payMoney").ToLocalChecked(), v8::Integer::New(isolate, userInfo.lastPaymentRecord.payMoney)); global_last_pay_info_object->Set(v8::String::NewFromUtf8(isolate, "surplus").ToLocalChecked(), v8::Number::New(isolate, userInfo.lastPaymentRecord.surplus)); global_last_pay_info_object->Set(v8::String::NewFromUtf8(isolate, "lastSurplus").ToLocalChecked(), v8::Number::New(isolate, userInfo.lastPaymentRecord.lastSurplus));
v8::Local<v8::ObjectTemplate> global_card_info_object = v8::ObjectTemplate::New(isolate); global_card_info_object->Set(v8::String::NewFromUtf8(isolate, "id").ToLocalChecked(), v8::Integer::New(isolate, userInfo.cardParamInfo.id)); global_card_info_object->Set(v8::String::NewFromUtf8(isolate, "isDelete").ToLocalChecked(), v8::Integer::New(isolate, userInfo.cardParamInfo.isDelete)); global_card_info_object->Set(v8::String::NewFromUtf8(isolate, "name").ToLocalChecked(), v8::String::NewFromUtf8(isolate, userInfo.cardParamInfo.name.c_str()).ToLocalChecked()); global_card_info_object->Set(v8::String::NewFromUtf8(isolate, "paramSet").ToLocalChecked(), v8::String::NewFromUtf8(isolate, userInfo.cardParamInfo.paramSet.c_str()).ToLocalChecked());
global_object->Set(v8::String::NewFromUtf8(isolate, "userInfo").ToLocalChecked(), global_user_info_object); global_object->Set(v8::String::NewFromUtf8(isolate, "commonInfo").ToLocalChecked(), global_common_info_object); global_object->Set(v8::String::NewFromUtf8(isolate, "priceInfo").ToLocalChecked(), global_price_info_object); global_object->Set(v8::String::NewFromUtf8(isolate, "lastPayInfo").ToLocalChecked(), global_last_pay_info_object); global_object->Set(v8::String::NewFromUtf8(isolate, "cardInfo").ToLocalChecked(), global_card_info_object); global_object->Set(v8::String::NewFromUtf8(isolate, "log").ToLocalChecked(), v8::FunctionTemplate::New(isolate, LogCallback)); return global_object; }
|