通用配网业务包

更新时间:2024-11-18 11:32:38下载pdf

通用配网业务包提供配网列表数据获取能力,提供获取数据列表自定义展示的方法。您可以结合涂鸦开发者平台支持的配网列表页数据,来配置列表页。

功能说明

您需要通过 TuyaSmartActivatorService 提供的对应方法,获取对应的数据类目信息。

接入组件

在工程的 Podfile 文件中添加技能快绑业务包组件,并执行 pod update 命令:

source 'https://github.com/tuya/tuya-pod-specs.git'
source 'https://cdn.cocoapods.org/'
platform :ios, '11.0'

target 'your_target_name' do
  pod 'TuyaSmartActivatorExtraBizBundle'
end

依赖服务

无。

获取配网列表一级品类数据

参数

- (void)requestLevelOneListWithSuccess:(void(^)(TuyaSmartACategoryModel * _Nullable model))success
                               failure:(void(^)(NSError *error))failure;

参数

Objective-C 示例

#import <TuyaSmartActivatorRequest/TuyaSmartActivatorRequest.h>

self.service = [TuyaSmartActivatorService new];
[self.service requestLevelOneListWithSuccess:^(TuyaSmartACategoryModel * _Nullable model) {

} failure:^(NSError * _Nonnull error) {

}];

Swift 示例

service = TuyaSmartActivatorService()
service.requestLevelOneList(withSuccess: { (result) in

}, failure: { (error) in

})

获取配网列表二级品类数据

参数

- (void)requestLevelSecondListWithLevelOneCode:(NSString *)levelOneCode
                                          type:(NSString *)type
                                       success:(void(^)(NSArray<TuyaSmartACategoryLevel2Model *> * _Nullable modelList))success
                                       failure:(void(^)(NSError *error))failure;

参数

名称 参数类型 说明
levelOneCode NSString 一级类目的 levelOneCode
type NSString 一级类目的 type

Objective-C 示例

#import <TuyaSmartActivatorRequest/TuyaSmartActivatorRequest.h>

self.service = [TuyaSmartActivatorService new];
[self.service requestLevelSecondListWithLevelOneCode:levelOneCode type:type success:^(NSArray<TuyaSmartACategoryLevel2Model *> * _Nullable modelList) {

} failure:^(NSError * _Nonnull error) {

}];

Swift 示例

service = TuyaSmartActivatorService()
service.requestLevelSecondList(withLevelOneCode: levelOneCode, type: type, success: { (result) in

}, failure: { (error) in

})

获取配网列表三级品类详情数据

参数

- (void)requestCategoryDetailWithPID:(NSString * _Nullable)PID
                            category:(NSString * _Nullable)category
                             success:(void(^)(TuyaSmartDeviceCategoryModel * _Nullable model))success
                             failure:(void(^)(NSError *error))failure;

参数

名称 参数类型 说明
PID NSString 产品 ID
category NSString 品类

Objective-C 示例

self.service = [TuyaSmartActivatorService new];
[service requestCategoryDetailWithPID:pid category:category success:^(TuyaSmartDeviceCategoryModel * _Nullable model) {

} failure:^(NSError * _Nonnull error) {

}];

Swift 示例

#import <TuyaSmartActivatorRequest/TuyaSmartActivatorRequest.h>

service = TuyaSmartActivatorService()
service.requestCategoryDetail(withPID: pid, category: category, success: { (result) in

}, failure: { (error) in

})