鸿蒙5.0开发进阶:NDK代码开发-JSVM-API使用指南(使用JSVM-API接口设置JavaScript对象的属性)

百度飞桨+文心大模型实战:生成式AI工程师认证备考全攻略(含真题解析) 本文详细解析百度飞桨与文心大模型结合的生成式AI工程师认证备考策略,涵盖认证体系、学习路径、核心技能突破及真题分析。帮助开发者掌握大模型原理、飞桨平台操作和文心大模型应用,高效通过工信部与百度联合认证考试。 阅读详情

往期鸿蒙5.0全套实战文章必看:(文中附带全栈鸿蒙5.0学习资料)


使用JSVM-API接口设置JavaScript对象的属性

简介

使用JSVM-API接口获取和设置JavaScript对象的属性。通过合理使用这些函数,实现更复杂的功能和逻辑。

基本概念

在JavaScript对象属性的相关开发中,需要处理JavaScript对象属性,确保正确地访问、设置、删除属性,并了解属性的继承关系和枚举特性。以下是一些关键概念:

  • 对象(Object):在JavaScript中,对象是一种复合数据类型,它允许存储多个不同类型的值作为一个单独的实体。对象是属性和方法的集合。属性是与对象相关联的值,而方法则是对象可以执行的操作。
  • 属性(Property):在JavaScript中,属性是对象特征的键值对。每个属性都有一个名字(也称为键或标识符)和一个值。属性的值可以是任意数据类型,包括基本类型、对象和函数。
  • 可枚举属性(EnumerableProperty):在JavaScript中,对象的属性分为可枚举和不可枚举之分,它们是由属性的enumerable值决定的,即内部 “可枚举” 标志设置为true或false。可枚举性决定了这个属性能否被 for...in 查找遍历到。
  • 自有属性(OwnProperty):自有属性是直接定义在对象上的属性,而不是从原型链上继承来的属性。

接口说明

接口功能说明
OH_JSVM_GetPropertyNames获取给定对象的所有可枚举属性名称,结果变量将存储一个包含所有可枚举属性名称的JavaScript数组
OH_JSVM_SetProperty为给定对象设置一个属性
OH_JSVM_GetProperty用给定的属性的名称,检索目标对象的属性
OH_JSVM_HasProperty用给定的属性的名称,查询目标对象是否有此属性
OH_JSVM_DeleteProperty用给定的属性的名称,删除目标对象属性
OH_JSVM_HasOwnProperty判断给定Object中是否有名为key的own property。
OH_JSVM_SetNamedProperty用给定的属性的名称为目标对象设置属性,此方法等效于调用OH_JSVM_SetProperty, 其中,通过utf8Name传入的字符串用于创建JSVM_Value。
OH_JSVM_GetNamedProperty用给定的属性的名称,检索目标对象的属性,此方法等效于调用OH_JSVM_GetProperty, 其中,通过utf8Name传入的字符串用于创建JSVM_Value。
OH_JSVM_HasNamedProperty用给定的属性的名称,查询目标对象是否有此属性,此方法等效于使用从作为utf8Name传入的字符串创建的JSVM_Value调用OH_JSVM_HasProperty。
OH_JSVM_DefineProperties批量的向给定对象中定义属性
OH_JSVM_GetAllPropertyNames获取给定对象的所有可用属性名称,结果变量将存储一个包含所有可枚举属性名称的JavaScript数组

使用示例

JSVM-API接口开发流程参考使用JSVM-API实现JS与C/C++语言交互开发流程,本文仅对接口对应C++相关代码进行展示。

OH_JSVM_GetPropertyNames

以字符串数组的形式获取对象的可枚举属性的名称,如果接口调用成功则返回JSVM_OK。

cpp部分代码

// OH_JSVM_GetPropertyNames的样例方法
static JSVM_Value GetPropertyNames(JSVM_Env env, JSVM_CallbackInfo info)
{
    // 将obj作为参数传入
    size_t argc = 1;
    JSVM_Value args[1] = {nullptr};
    OH_JSVM_GetCbInfo(env, info, &argc, args, nullptr, nullptr);
    // 以字符串数组的形式获取对象的可枚举属性的名称,以result传出
    JSVM_Value result = nullptr;
    JSVM_Status status = OH_JSVM_GetPropertyNames(env, args[0], &result);
    if (status != JSVM_OK) {
        OH_JSVM_ThrowError(env, nullptr, "Failed to get propertynames");
        return nullptr;
    } else {
        OH_LOG_INFO(LOG_APP, "JSVM OH_JSVM_GetPropertyNames success");
    }
    return result;
}
// GetPropertyNames注册回调
static JSVM_CallbackStruct param[] = {
    {.data = nullptr, .callback = GetPropertyNames},
};
static JSVM_CallbackStruct *method = param;
// GetPropertyNames方法别名,供JS调用
static JSVM_PropertyDescriptor descriptor[] = {
    {"getPropertyNames", nullptr, method++, nullptr, nullptr, nullptr, JSVM_DEFAULT},
};

// 样例测试js
const char *srcCallNative = R"JS(
    let obj = '{ data: 0, message: "hello world"}';
    let script = getPropertyNames(obj);
)JS";

预期输出结果

JSVM OH_JSVM_GetPropertyNames success

OH_JSVM_SetProperty

将给定的属性与值设置入给定的Object。

cpp部分代码

// OH_JSVM_SetProperty的样例方法
static JSVM_Value SetProperty(JSVM_Env env, JSVM_CallbackInfo info)
{
    // 接收js侧传入的三个参数:第一个参数为想要设置的object,第二个参数为属性,第三个参数为属性对应的值
    size_t argc = 3;
    JSVM_Value args[3] = {nullptr};
    JSVM_Status status = OH_JSVM_GetCbInfo(env, info, &argc, args, nullptr, nullptr);
    if (status != JSVM_OK) {
        OH_JSVM_ThrowError(env, nullptr, "JSVM OH_JSVM_GetCbInfo fail");
        return nullptr;
    }
    // 通过调用OH_JSVM_SetProperty接口将属性与值设置入object如果失败,直接抛出错误
    status = OH_JSVM_SetProperty(env, args[0], args[1], args[2]);
    if (status != JSVM_OK) {
        OH_JSVM_ThrowError(env, nullptr, "JSVM OH_JSVM_SetProperty fail");
        return nullptr;
    } else {
        OH_LOG_INFO(LOG_APP, "JSVM OH_JSVM_SetProperty success");
    }
    // 将设置成功后的object返回出去
    return args[0];
}
// SetProperty注册回调
static JSVM_CallbackStruct param[] = {
    {.data = nullptr, .callback = SetProperty},
};
static JSVM_CallbackStruct *method = param;
// SetProperty方法别名,供JS调用
static JSVM_PropertyDescriptor descriptor[] = {
    {"setProperty", nullptr, method++, nullptr, nullptr, nullptr, JSVM_DEFAULT},
};

// 样例测试js
const char *srcCallNative = R"JS(
    let obj = { data: 0, message: "hello world", 50: 1};
    setProperty(obj, "code", "hi")
)JS";

预期输出结果

JSVM OH_JSVM_SetProperty success

OH_JSVM_GetProperty

获取给定Object的给定属性对应的值。

cpp部分代码

// OH_JSVM_GetProperty的样例方法
static JSVM_Value GetProperty(JSVM_Env env, JSVM_CallbackInfo info)
{
    // 接收两个js传来的参数
    size_t argc = 2;
    JSVM_Value args[2] = {nullptr};
    OH_JSVM_GetCbInfo(env, info, &argc, args, nullptr, nullptr);
    // 传入的第一个参数为要检测的object,第二个对象为要检测的属性,通过调用OH_JSVM_GetProperty接口获取对应的值
    JSVM_Value result = nullptr;
    JSVM_Status status = OH_JSVM_GetProperty(env, args[0], args[1], &result);
    if (status != JSVM_OK) {
        OH_JSVM_ThrowError(env, nullptr, "JSVM OH_JSVM_GetProperty fail");
        return nullptr;
    } else {
        OH_LOG_INFO(LOG_APP, "JSVM OH_JSVM_GetProperty success");
    }
    return result;
}
// GetProperty注册回调
static JSVM_CallbackStruct param[] = {
    {.data = nullptr, .callback = GetProperty},
};
static JSVM_CallbackStruct *method = param;
// GetProperty方法别名,供JS调用
static JSVM_PropertyDescriptor descriptor[] = {
    {"getProperty", nullptr, method++, nullptr, nullptr, nullptr, JSVM_DEFAULT},
};

// 样例测试js
const char *srcCallNative = R"JS(
    let obj = { data: 0, message: "hello world", 50: 1};
    getProperty(obj, "message")
)JS";

预期输出结果

JSVM OH_JSVM_GetProperty success

OH_JSVM_HasProperty

检查对象中是否存在指定的属性,可以避免访问不存在属性导致的异常或错误。

cpp部分代码

// OH_JSVM_HasProperty的样例方法
static JSVM_Value HasProperty(JSVM_Env env, JSVM_CallbackInfo info)
{
    // 从js侧传入两个参数:第一个参数为要检验的对象,第二个参数为要检测是否存在对象的属性
    size_t argc = 2;
    JSVM_Value args[2] = {nullptr};
    OH_JSVM_GetCbInfo(env, info, &argc, args, nullptr, nullptr);
    // 将参数传入OH_JSVM_HasProperty方法中,若接口调用成功则将结果转化为JSVM_Value类型抛出,否则抛出错误
    bool result;
    JSVM_Status status = OH_JSVM_HasProperty(env, args[0], args[1], &result);
    if (status != JSVM_OK) {
        OH_JSVM_ThrowError(env, nullptr, "JSVM OH_JSVM_HasProperty fail");
        return nullptr;
    } else {
        OH_LOG_INFO(LOG_APP, "JSVM OH_JSVM_HasProperty success:%{public}d", result);
    }
    // 若传入属性存在传入对象中,则输出true将结果转化为JSVM_Value类型抛出
    JSVM_Value returnReslut = nullptr;
    OH_JSVM_GetBoolean(env, result, &returnReslut);
    return returnReslut;
}
// HasProperty注册回调
static JSVM_CallbackStruct param[] = {
    {.data = nullptr, .callback = HasProperty},
};
static JSVM_CallbackStruct *method = param;
// HasProperty方法别名,供JS调用
static JSVM_PropertyDescriptor descriptor[] = {
    {"hasProperty", nullptr, method++, nullptr, nullptr, nullptr, JSVM_DEFAULT},
};

// 样例测试js
const char *srcCallNative = R"JS(
    let obj = { data: 0, message: "hello world", 50: 1};
    hasProperty(obj, "data")
    hasProperty(obj, 0)
)JS";

预期输出结果

// hasProperty(obj, "data")输出
JSVM OH_JSVM_HasProperty success:1
// hasProperty(obj, 0)输出
JSVM OH_JSVM_HasProperty success:0

OH_JSVM_DeleteProperty

尝试从给定的Object中删除由key指定的属性,并返回操作的结果。

如果对象是一个不可扩展的对象,或者属性是不可配置的,则可能无法删除该属性。

cpp部分代码

// OH_JSVM_DeleteProperty的样例方法
static JSVM_Value DeleteProperty(JSVM_Env env, JSVM_CallbackInfo info)
{
    // 获取js侧传入的两个参数
    size_t argc = 2;
    JSVM_Value args[2] = {nullptr};
    OH_JSVM_GetCbInfo(env, info, &argc, args, nullptr, nullptr);
    JSVM_ValueType valueType;
    OH_JSVM_Typeof(env, args[0], &valueType);
    if (valueType != JSVM_OBJECT) {
        OH_JSVM_ThrowError(env, nullptr, "Expects an object as argument.");
        return nullptr;
    }
    // 从传入的Object对象中删除指定属性,返回是否删除成功的bool结果值
    bool result = false;
    JSVM_Status status = OH_JSVM_DeleteProperty(env, args[0], args[1], &result);
    if (status != JSVM_OK) {
        OH_JSVM_ThrowError(env, nullptr, "JSVM OH_JSVM_DeleteProperty failed");
        return nullptr;
    } else {
        OH_LOG_INFO(LOG_APP, "JSVM OH_JSVM_DeleteProperty success:%{public}d", result);
    }
    // 将bool结果转换为JSVM_value并返回
    JSVM_Value ret;
    OH_JSVM_GetBoolean(env, result, &ret);
    return ret;
}
// DeleteProperty注册回调
static JSVM_CallbackStruct param[] = {
    {.data = nullptr, .callback = DeleteProperty},
};
static JSVM_CallbackStruct *method = param;
// DeleteProperty方法别名,供JS调用
static JSVM_PropertyDescriptor descriptor[] = {
    {"deleteProperty", nullptr, method++, nullptr, nullptr, nullptr, JSVM_DEFAULT},
};

// 样例测试js
const char *srcCallNative = R"JS(
    let obj = { data: 0, message: "hello world", 50: 1};
    deleteProperty(obj, "message")
)JS";

预期输出结果

JSVM OH_JSVM_DeleteProperty success:1

OH_JSVM_HasOwnProperty

用于检查传入的Object是否具有自己的命名属性,不包括从原型链上继承的属性。

cpp部分代码

// OH_JSVM_HasOwnProperty的样例方法
static JSVM_Value HasOwnProperty(JSVM_Env env, JSVM_CallbackInfo info)
{
    // 获取js侧传入的两个参数
    size_t argc = 2;
    JSVM_Value args[2] = {nullptr};
    OH_JSVM_GetCbInfo(env, info, &argc, args, nullptr, nullptr);
    // 检查第一个参数是否为对象
    JSVM_ValueType valueType1;
    OH_JSVM_Typeof(env, args[0], &valueType1);
    if (valueType1 != JSVM_OBJECT) {
        OH_JSVM_ThrowError(env, nullptr, "First argument must be an object.");
        return nullptr;
    }
    // 检查第二个参数是否为string
    JSVM_ValueType valuetype2;
    OH_JSVM_Typeof(env, args[1], &valuetype2);
    if (valuetype2 != JSVM_STRING ) {
        OH_JSVM_ThrowError(env, nullptr, "Second argument must be a string.");
        return nullptr;
    }
    // 检查对象是否具有指定属性,结果存储在hasProperty中
    bool hasProperty;
    JSVM_Status status = OH_JSVM_HasOwnProperty(env, args[0], args[1], &hasProperty);
    if (status != JSVM_OK) {
        OH_JSVM_ThrowError(env, nullptr, "JSVM OH_JSVM_HasOwnProperty failed");
        return nullptr;
    } else {
        OH_LOG_INFO(LOG_APP, "JSVM OH_JSVM_HasOwnProperty success:%{public}d", hasProperty);
    }
    // 将bool结果转换为JSVM_Value并返回
    JSVM_Value result;
    OH_JSVM_GetBoolean(env, hasProperty, &result);
    return result;
}
// HasOwnProperty注册回调
static JSVM_CallbackStruct param[] = {
    {.data = nullptr, .callback = HasOwnProperty},
};
static JSVM_CallbackStruct *method = param;
// HasOwnProperty方法别名,供JS调用
static JSVM_PropertyDescriptor descriptor[] = {
    {"hasOwnProperty", nullptr, method++, nullptr, nullptr, nullptr, JSVM_DEFAULT},
};

// 样例测试js
const char *srcCallNative = R"JS(
    let obj = { data: 0, message: "hello world", 50: 1};
    hasOwnProperty(obj, "message")
    hasOwnProperty(obj, "__defineGetter__")
)JS";

预期输出结果

// hasOwnProperty(obj, "message")输出
JSVM OH_JSVM_HasOwnProperty success:1
// hasOwnProperty(obj, "__defineGetter__")输出
// `__defineGetter__`为Object原型方法,非OwnProperty,预期返回0
JSVM OH_JSVM_HasOwnProperty success:0

OH_JSVM_SetNamedProperty

用于在传入的Javascript对象上设置一个命名属性。

cpp部分代码

// OH_JSVM_SetNamedProperty的样例方法
static JSVM_Value SetNamedProperty(JSVM_Env env, JSVM_CallbackInfo info)
{
    // 获取js侧传入的一个参数
    size_t argc = 1;
    JSVM_Value str;
    char strKey[32] = "";
    OH_JSVM_GetCbInfo(env, info, &argc, &str, nullptr, nullptr);
    // 获取传入参数字符串并存储在strKey中
    size_t keyLength;
    OH_JSVM_GetValueStringUtf8(env, str, strKey, 32, &keyLength);
    // 创建一个新对象
    JSVM_Value newObj;
    OH_JSVM_CreateObject(env, &newObj);
    // 设置整数值1234为属性值
    int32_t value = 1234;
    JSVM_Value numValue;
    OH_JSVM_CreateInt32(env, value, &numValue);
    // 将整数值与指定属性名关联
    JSVM_Status status = OH_JSVM_SetNamedProperty(env, newObj, strKey, numValue);
    if (status != JSVM_OK) {
        OH_JSVM_ThrowError(env, nullptr, "JSVM OH_JSVM_SetNamedProperty failed");
        return nullptr;
    } else {
        OH_LOG_INFO(LOG_APP, "JSVM OH_JSVM_SetNamedProperty success");
    }
    // 返回新创建并设置命名属性的对象
    return newObj;
}
// SetNamedProperty注册回调
static JSVM_CallbackStruct param[] = {
    {.data = nullptr, .callback = SetNamedProperty},
};
static JSVM_CallbackStruct *method = param;
// SetNamedProperty方法别名,供JS调用
static JSVM_PropertyDescriptor descriptor[] = {
    {"setNamedProperty", nullptr, method++, nullptr, nullptr, nullptr, JSVM_DEFAULT},
};

// 样例测试js
const char *srcCallNative = R"JS(
    setNamedProperty("message")
)JS";

预期输出结果

JSVM OH_JSVM_SetNamedProperty success

OH_JSVM_GetNamedProperty

用于从Javascript对象中获取命名属性的值。

cpp部分代码

// OH_JSVM_GetNamedProperty的样例方法
static JSVM_Value GetNamedProperty(JSVM_Env env, JSVM_CallbackInfo info)
{
    // 获取js侧传入的两个参数
    size_t argc = 2;
    JSVM_Value args[2] = {nullptr};
    char strKey[32] = "";
    OH_JSVM_GetCbInfo(env, info, &argc, args, nullptr, nullptr);
    // 获取要获取的属性名
    size_t keyLength;
    OH_JSVM_GetValueStringUtf8(env, args[1], strKey, 32, &keyLength);
    // 获取指定属性的值并存储在result中
    JSVM_Value result;
    JSVM_Status status = OH_JSVM_GetNamedProperty(env, args[0], strKey, &result);
    if (status != JSVM_OK) {
        OH_JSVM_ThrowError(env, nullptr, "JSVM OH_JSVM_GetNamedProperty failed");
        return nullptr;
    } else {
        OH_LOG_INFO(LOG_APP, "JSVM OH_JSVM_GetNamedProperty success");
    }
    return result;
}
// GetNamedProperty注册回调
static JSVM_CallbackStruct param[] = {
    {.data = nullptr, .callback = GetNamedProperty},
};
static JSVM_CallbackStruct *method = param;
// GetNamedProperty方法别名,供JS调用
static JSVM_PropertyDescriptor descriptor[] = {
    {"getNamedProperty", nullptr, method++, nullptr, nullptr, nullptr, JSVM_DEFAULT},
};

// 样例测试js
const char *srcCallNative = R"JS(
    let obj = { data: 0, message: "hello world", 50: 1};
    getNamedProperty(obj, "message")
)JS";

预期输出结果

JSVM OH_JSVM_GetNamedProperty success

OH_JSVM_HasNamedProperty

用于检查Javascript对象中是否包含指定的命名属性。

cpp部分代码

// OH_JSVM_HasNamedProperty的样例方法
static JSVM_Value HasNamedProperty(JSVM_Env env, JSVM_CallbackInfo info)
{
    // 获取js侧传入的两个参数
    size_t argc = 2;
    JSVM_Value args[2] = {nullptr};
    char strKey[32] = "";
    OH_JSVM_GetCbInfo(env, info, &argc, args, nullptr, nullptr);
    // 获取要检查的属性名
    size_t keyLength;
    OH_JSVM_GetValueStringUtf8(env, args[1], strKey, 32, &keyLength);
    // 检查对象是否具有指定命名的属性,并将结果存储在hasProperty中
    bool hasProperty = false;
    JSVM_Status status = OH_JSVM_HasNamedProperty(env, args[0], strKey, &hasProperty);
    if (status != JSVM_OK) {
        OH_JSVM_ThrowError(env, nullptr, "JSVM OH_JSVM_HasNamedProperty failed");
        return nullptr;
    } else {
        OH_LOG_INFO(LOG_APP, "JSVM OH_JSVM_HasNamedProperty success:%{public}d", hasProperty);
    }
    // 将bool结果转换为JSVM_Value并返回
    JSVM_Value result;
    OH_JSVM_GetBoolean(env, hasProperty, &result);
    return result;
}
// HasNamedProperty注册回调
static JSVM_CallbackStruct param[] = {
    {.data = nullptr, .callback = HasNamedProperty},
};
static JSVM_CallbackStruct *method = param;
// HasNamedProperty方法别名,供JS调用
static JSVM_PropertyDescriptor descriptor[] = {
    {"hasNamedProperty", nullptr, method++, nullptr, nullptr, nullptr, JSVM_DEFAULT},
};

// 样例测试js
const char *srcCallNative = R"JS(
    let obj = { data: 0, message: "hello world", 50: 1};
    hasNamedProperty(obj, "message")
)JS";

预期输出结果

JSVM OH_JSVM_HasNamedProperty success:1

OH_JSVM_DefineProperties

用于定义对象的自定义属性,可一次性为对象设置多个属性。

cpp部分代码

// 属性描述符列表中defineMethodPropertiesExample属性的回调函数
static JSVM_Value DefineMethodPropertiesExample(JSVM_Env env, JSVM_CallbackInfo info)
{
    int32_t propValue = 26;
    JSVM_Value returnValue;
    OH_JSVM_CreateInt32(env, propValue, &returnValue);
    return returnValue;
}
// 属性描述符列表中getterCallback属性的回调函数
static JSVM_Value GetterCallback(JSVM_Env env, JSVM_CallbackInfo info)
{
    JSVM_Value result;
    const char *str = "Hello world!";
    size_t length = strlen(str);
    // 创建属性的值
    OH_JSVM_CreateStringUtf8(env, str, length, &result);
    return result;
}

// 执行JavaScript字符串的函数
static JSVM_Value RunScriptAndLogResult(JSVM_Env env, const std::string &srcCode) {
    JSVM_Value sourceCodeValue;
    OH_JSVM_CreateStringUtf8(env, srcCode.c_str(), srcCode.size(), &sourceCodeValue);
    JSVM_Script script;
    // 编译JavaScript代码字符串并返回编译后的脚本
    OH_JSVM_CompileScript(env, sourceCodeValue, nullptr, 0, true, nullptr, &script);
    JSVM_Value jsVmResult;
    // 执行JavaScript代码字符串
    OH_JSVM_RunScript(env, script, &jsVmResult);
    return jsVmResult;
}

// OH_JSVM_DefineProperties的样例方法
static JSVM_Value DefineProperties(JSVM_Env env, JSVM_CallbackInfo info) {
    // 接受一个JavaScript侧传入的空object
    size_t argc = 1;
    JSVM_Value argv[1] = {nullptr};
    OH_JSVM_GetCbInfo(env, info, &argc, argv, nullptr, nullptr);
    // 创建一个string类型的属性值
    JSVM_Value stringValue;
    OH_JSVM_CreateStringUtf8(env, "Hello!", JSVM_AUTO_LENGTH, &stringValue);
    // 创建属性描述符对应的回调函数列表
    JSVM_CallbackStruct param[] = {
        {.data = nullptr, .callback = DefineMethodPropertiesExample},
        {.data = nullptr, .callback = GetterCallback},

    };
    // 创建属性描述符列表,不同类型属性值添加位置参考JSVM_PropertyDescriptor定义
    JSVM_PropertyDescriptor descriptor[] = {
        // 定义method类型的属性值
        {"defineMethodPropertiesExample", nullptr, &param[0], nullptr, nullptr, nullptr, JSVM_DEFAULT},
        // 定义string类型的属性值
        {"defineStringPropertiesExample", nullptr, nullptr, nullptr, nullptr, stringValue, JSVM_DEFAULT},
        // 定义getter类型的属性值
        {"getterCallback", nullptr, nullptr, &param[1], nullptr, nullptr,JSVM_DEFAULT}};
    // 根据属性描述符列表为obj对象创建属性
    JSVM_Status statusProperty;
    statusProperty = OH_JSVM_DefineProperties(env, *argv, sizeof(descriptor) / sizeof(descriptor[0]), descriptor);
    if (statusProperty != JSVM_OK) {
        OH_JSVM_ThrowError(env, nullptr, "JSVM DefineProperties fail");
        return nullptr;
    }
    // 调用obj对象中添加的属性
    // 运行obj.defineMethodPropertiesExample()并将结果返回给JavaScript
    static std::string srcMethod;
    srcMethod = R"JS(obj.defineMethodPropertiesExample();)JS";
    JSVM_Value jsVmResult = RunScriptAndLogResult(env, srcMethod);
    if (jsVmResult != nullptr) {
        int32_t number;
        OH_JSVM_GetValueInt32(env, jsVmResult, &number);
        OH_LOG_INFO(LOG_APP, "JSVM DefineMethodPropertiesExample success:%{public}d", number);
    }
    // 运行obj.defineStringPropertiesExample()并将结果返回给JavaScript
    static std::string srcString;
    srcString = R"JS(obj.defineStringPropertiesExample;)JS";
    JSVM_Value jsVmResult1 = RunScriptAndLogResult(env, srcString);
    if (jsVmResult1 != nullptr) {
        size_t length = 0;
        OH_JSVM_GetValueStringUtf8(env, jsVmResult1, nullptr, 0, &length);
        char *buf = (char *)malloc(length + 1);
        OH_JSVM_GetValueStringUtf8(env, jsVmResult1, buf, length + 1, &length);
        OH_LOG_INFO(LOG_APP, "JSVM defineStringPropertiesExample success:%{public}s", buf);
        free(buf);
    }
    // 调用obj的getterCallback()并将结果字符串返回给JavaScript
    static std::string srcGetter;
    srcGetter = R"JS(obj.getterCallback;)JS";
    JSVM_Value jsVmResult2 = RunScriptAndLogResult(env, srcGetter);
    if (jsVmResult2 != nullptr) {
        size_t length = 0;
        OH_JSVM_GetValueStringUtf8(env, jsVmResult2, nullptr, 0, &length);
        char *buf = (char *)malloc(length + 1);
        OH_JSVM_GetValueStringUtf8(env, jsVmResult2, buf, length + 1, &length);
        OH_LOG_INFO(LOG_APP, "JSVM getterCallback success:%{public}s", buf);
        free(buf);
    }
    return jsVmResult;
}

// DefineProperties注册回调
static JSVM_CallbackStruct param[] = {
    {.data = nullptr, .callback = DefineProperties},
};
static JSVM_CallbackStruct *method = param;
// DefineProperties方法别名,供JS调用
static JSVM_PropertyDescriptor descriptor[] = {
    {"defineProperties", nullptr, method++, nullptr, nullptr, nullptr, JSVM_DEFAULT},
};

// 样例测试js
const char *srcCallNative = R"JS(
    let obj = {};
    defineProperties(obj)
)JS";

预期输出结果

JSVM DefineMethodPropertiesExample success:26
JSVM defineStringPropertiesExample success:Hello!
JSVM getterCallback success:Hello world!

OH_JSVM_GetAllPropertyNames

获取给定对象的所有可用属性名称, 结果变量将存储一个包含所有可枚举属性名称的JavaScript数组。

cpp部分代码

// OH_JSVM_GetAllPropertyNames的样例方法
static JSVM_Value GetAllPropertyNames(JSVM_Env env, JSVM_CallbackInfo info)
{
    // // 获取js侧传入的一个参数
    size_t argc = 1;
    JSVM_Value args[1];
    OH_JSVM_GetCbInfo(env, info, &argc, args, nullptr, nullptr);
    // 获取给定对象的所有属性名称(自有属性)
    JSVM_Value result;
    JSVM_Status status = OH_JSVM_GetAllPropertyNames(env, args[0],
                                         JSVM_KeyCollectionMode::JSVM_KEY_OWN_ONLY,
                                         JSVM_KeyFilter::JSVM_KEY_WRITABLE,
                                         JSVM_KeyConversion::JSVM_KEY_NUMBERS_TO_STRINGS, &result);
    if (status != JSVM_OK) {
        OH_JSVM_ThrowError(env, nullptr, "Failed to get allpropertynames");
        return nullptr;
    } else {
        OH_LOG_INFO(LOG_APP, "JSVM OH_JSVM_GetAllPropertyNames success");
    }
    return result;
}
// GetAllPropertyNames注册回调
static JSVM_CallbackStruct param[] = {
    {.data = nullptr, .callback = GetAllPropertyNames},
};
static JSVM_CallbackStruct *method = param;
// GetAllPropertyNames方法别名,供JS调用
static JSVM_PropertyDescriptor descriptor[] = {
    {"getAllPropertyNames", nullptr, method++, nullptr, nullptr, nullptr, JSVM_DEFAULT},
};

// 样例测试js
const char *srcCallNative = R"JS(
    let obj = '{ data: 0, message: "hello world", 50: 1}';
    let script = getAllPropertyNames(obj);
)JS";

预期输出结果

JSVM OH_JSVM_GetAllPropertyNames success

【OpenStack】OpenStack原理(一)——OpenStack发展及架构 OpenStack目前的七个核心组件,分别是计算(Compute)、对象存储(Object Storage)、认证(Identity)、用户界面(Dashboard)、块存储(Block Storage)、网络(Network)和镜像服务(Image Service)。 阅读详情

相关推荐

MQTT阿里云OTA 调试记录

2.验证,这个验证是什么意思呢,就是阿里云会把你包的信息,比如包大小,streamid(相当于包的识别码),版本号发送给你的设备,然后如果你没发送升级成功的包给阿里云,这里会是一直验证中的状态,那你的设备每次重新连接阿里云,发送connect包给阿里云的时候,阿里云就会发送一次这个验证(upgrade)包。提取到了之后就可以发送请求包了,这个请求包比较坑,也可能是我没付费,他的包一次最多只有1024个字节的数据。之前说了,验证状态下,设备发送connect包给阿里云,阿里云就会发一个upgrade包给你。

qq_42585211的博客 1234

鸿蒙5.0&next开发【使用JSVM-API接口设置JavaScript对象的属性】使用JSVM-API实现JS与C/C++语言交互

使用JSVM-API接口获取和设置JavaScript对象的属性。通过合理使用这些函数,实现更复杂的功能和逻辑。

bbq的博客 1045

从零搭建《火影忍者》手游服务端:Linux环境部署与全流程实战

游戏服务器后端开发是构建大型多人在线体验的核心技术,其原理涉及高并发网络通信、分布式系统架构与数据一致性保障。在技术价值上,一套稳定高效的服务端不仅能支撑海量玩家实时交互,更是游戏业务逻辑、经济系统和安全防线的基石。典型的应用场景包括MMORPG、回合制卡牌、SLG等中重度手游。本文以《火影忍者》IP的横版卡牌回合制手游为例,聚焦于**手工服务端**的完整搭建过程,详细拆解从Linux系统初始化、MySQL与**Redis**缓存部署、核心服务编译、到代理后台联调的全链路实践,为开发者深入理解游戏后端架构提

weixin_30800615的博客 367

鸿蒙js调用c++详解

需要注意:如果 C++ 在其它线程想通知 JS,比如定时发送进度,需要使用 线程安全函数 napi_create_threadsafe_function 来实现,将回调封装成事件投递到 JS 事件循环,否则直接从工作线程调用 JS 函数是不被支持的 。**绑定 C++ 接口为 JS 可调用接口:**在模块初始化 (Init) 函数中,通常会使用 napi_define_properties 或 napi_create_function 等接口,将 C++实现的函数注册为 JS 对象的属性/方法 。

DADADEBAICHI的博客 1226

在安装之后使用labelme出现qtpy.PythonQtError:No Qt bindings could be found错误

我在base环境(python3.7)可成功安装和使用labelme,而在同py37版本和py36的虚拟环境中可安装labelme包,但在使用的时候出现报错,如下: 我尝试着去解决第一个错误提示,错误提示为:moduleNotFoundError:No module named ‘PySide’,结果掉入了一个无止无尽的坑,看到网上有朋友说这个只能在py27-py35才能安装,还有说需要VC+ 140等,他们说的这个解决方案只针对于这个缺包的描述,而我们仅仅只需要一个labelme,因此我直接对后面的错误

qq_33538651的博客 9820

Unity AssetBundle 之 (入门)简单的资源打包成AB包的方法

Unity AssetBundle 之 (入门)简单的资源打包成AB包的方法 目录 Unity AssetBundle 之 (入门)简单的资源打包成AB包的方法 一、简单介绍 二、实现原理 三、注意事项 四、效果预览 五、实现步骤 六、关键代码 一、简单介绍 Unity中的一些基础知识点。 本节介绍,Asset Bundle 在 Unity中的使用,入门第一篇,如何AssetBundle标记,如何打包成AssetBundle的操作方法,有不对的地方欢迎指正。...

仙魁XAN 1万+

【鸿蒙HarmonyOS Next实战开发】实现ArkTS/JS和C/C++的交互-Node-API

一般情况下HarmonyOS应用开发使用ArkTS/JS语言,但部分场景由于性能、效率等要求,比如游戏、物理模拟等,需要依赖使用现有的C/C++库。Node-API规范封装了I/O、CPU密集型、OS底层等能力并对外暴露ArkTS/JS接口,从而实现ArkTS/JS和C/C++的交互。HarmonyOS Node-API是基于Node.js 12.x LTS的Node-API规范扩展开发的机制,为开发者提供了ArkTS/JS与C/C++模块之间的交互能力。它提供了一组稳定的、跨平台的API,可以在不同的操作

liuhaikang的博客 2642

用C++从零复刻Wordle:手把手教你实现命令行猜词游戏(含完整源码解析)

本文详细介绍了如何使用C++从零开始实现一个命令行版本的Wordle猜词游戏,包含完整的源码解析和核心模块设计。通过游戏逻辑控制器、单词库管理器等模块的构建,开发者可以学习C++实战技巧和性能优化方法,适合提升编程能力和游戏开发兴趣。

weixin_26763955的博客 338

鸿蒙仓颉语言【cryptocj 库】(介绍与SHA、MD5、HMAC摘要算法)

cryptocj 是一个安全的密码库,包括常用的密码算法、常用的密钥生成和签名验证。 该库是对 C 语言的 openSSL 封装的仓颉加密算法

鸿蒙的技术博客 1690

瑞芯微rv1126 rtsp+mpp+rga取流

瑞芯微rv1109 rtsp+mpp+rga取流

ZuoSeDiao的博客 6344

Concentration Inequality(集中不等式)更新版

欢迎来我博客 https://wyue.name/2020/04/17/1/阅读这一篇博文 转载前请联系我,联系方式请见我博客 https://wyue.name/ Concentration inequality 刻画了一组随机变量的和(或者样本平均数)与其期望值的偏离程度,在算法收敛性分析过程中是非常有用的一类不等式。 这次主要总结一下最近一段时间遇到的集中不等式,不仅是不等式形式,...

Yue的博客 4560

鸿蒙5.0开发进阶:NDK代码开发-JSVM-API使用指南(使用JSVM-API接口进行object相关开发)

使用JSVM-API接口进行object相关开发........

Androidbye的博客 948

YOLOv11涨点改进| CVPR 2026 |独家创新首发、特征融合改进篇| 引入FAAFusion傅里叶角对准融合模块,促进高低频特征融合,增强模型在小目标、密集目标检测和旋转目标检测任务高效涨点

🔥本文提出FAAFusion傅里叶角对准融合模块,用于改进YOLOv11网络模型。该模块通过在特征金字塔融合阶段对齐高低层特征的方向信息,缓解传统FPN直接融合带来的方向冲突问题。FAAFusion利用傅里叶旋转等变性原理,在频域估计主方向并进行特征对齐,显著提升了多尺度特征表达的一致性与有效性。实验表明,该方法在DOTA等遥感数据集上取得了新的最先进水平,特别适用于旋转目标检测任务。文章详细介绍了模块原理、结构优势,并提供了三种不同的YOLOv11改进配置方案和完整的核心代码实现。

Ai缝合怪、助力小伙伴高效发论文 158

鸿蒙5.0开发进阶:NDK代码开发-JSVM-API使用指南(使用JSVM-API接口进行WebAssembly模块相关开发)

JSVM-API WebAssembly 接口提供了 WebAssembly 字节码编译、WebAssembly 函数优化、WebAssembly cache 序列化和反序列化的能力。

Androidbye的博客 1105

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

鸿蒙5.0开发进阶:NDK代码开发-JSVM-API使用指南(使用JSVM-API接口进行错误处理开发)

使用JSVM-API接口进行错误处理开发..........

Androidbye的博客 1045

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

鸿蒙5.0开发进阶:NDK代码开发-JSVM-API使用指南(使用JSVM-API接口处理异步操作)

使用JSVM-API接口处理异步操作。

Androidbye的博客 1094

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

鸿蒙5.0开发进阶:NDK代码开发-JSVM-API使用指南(使用JSVM-API接口进行primitive类相关开发)

在使用JSVM-API接口时......

Androidbye的博客 1039

鸿蒙5.0开发进阶:NDK代码开发-JSVM-API调优&高性能使用(JSVM 通用调优实践)

使用 JSVM 的过程中....

Androidbye的博客 836

鸿蒙5.0开发进阶:NDK开发-JSVM-API开发规范

每个JSVM_Value属于特定的HandleScope.....

Androidbye的博客 1068

鸿蒙5.0开发进阶:NDK代码开发-JSVM-API典型使用场景指南(JSVM-API调试&定位)

本文将介绍调试、CPU Profiler、Heap Snapshot的使用方法。

Androidbye的博客 697

鸿蒙5.0开发进阶:NDK代码开发-JSVM-API使用指南(使用JSVM-API接口进行生命周期相关开发)

JSVM_Value的生命周期与其在JavaScript中的对应值的生命周期紧密相关。

Androidbye的博客 644

鸿蒙5.0开发进阶:NDK代码开发-JSVM-API使用指南(使用JSVM-API接口操作bigint类型值)

BigInt是JavaScript中用于表示任意精度整数的数据类型......

Androidbye的博客 699

鸿蒙5.0开发进阶:NDK代码开发-JSVM-API使用指南(使用JSVM-API接口进行JavaScript代码调试调优)

这些JSVM-API接口涵盖了虚拟机实例检索、内存分析、性能剖析和调试支持.........

Androidbye的博客 682

鸿蒙5.0开发进阶:NDK代码开发-JSVM-API使用指南(使用JSVM进行class相关开发)

使用JSVM-API接口进行class相关开发,处理JavaScript中的类,例如定义类、构造实例等。

Androidbye的博客 797

鸿蒙5.0开发进阶:NDK代码开发-JSVM-API使用指南(使用JSVM-API接口创建基本数据类型)

在JavaScript中,整数类型是一种基本数据类型,用于表示没有小数部分的数值。

Androidbye的博客 865

鸿蒙5.0开发进阶:NDK代码开发-JSVM-API开发规范(JSVM-API使用规范)

每个JSVM_Value属于特定的HandleScope..........

Androidbye的博客 909
上一篇: 鸿蒙5.0开发进阶:NDK代码开发-JSVM-API使用指南(使用JSVM-API接口处理异步操作)
下一篇: 鸿蒙5.0开发进阶:NDK代码开发-JSVM-API使用指南(使用JSVM-API接口创建和获取string值)
懂你的大海
博客等级 码龄6年 9049粉丝 1381原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值