jiGuangXieZuo/ProductApp/ProductApp/ProductMain/首页/cell/职场/ShouYeZCXZTableViewCell.m

105 lines
3.9 KiB
Objective-C

//
// ShouYeZCXZTableViewCell.m
// ProductApp
//
// Created by 工作 on 2024/9/26.
//
#import "ShouYeZCXZTableViewCell.h"
#import "ZhiNengXieZuoViewController.h"
@interface ShouYeZCXZTableViewCell ()
@end
@implementation ShouYeZCXZTableViewCell
-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
if(self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
{
UIImageView *viewback = [[UIImageView alloc] init];
[viewback setBackgroundColor:[UIColor whiteColor]];
[self.contentView addSubview:viewback];
[viewback mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self);
}];
[viewback.layer setMasksToBounds:YES];
[viewback.layer setCornerRadius:8];
[viewback setImage:[UIImage imageNamed:@"home_znxzback"]];
UIImageView *viewback1 = [[UIImageView alloc] init];
[self.contentView addSubview:viewback1];
[viewback1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self);
}];
[viewback1.layer setMasksToBounds:YES];
[viewback1.layer setCornerRadius:8];
[viewback1 setImage:[UIImage imageNamed:@"home_ppt_znxz_back"]];
UILabel *lbname = [[UILabel alloc] init];
[lbname setText:@"写作生成"];
[lbname setTextColor:RGBCOLOR(26, 26, 26)];
[lbname setTextAlignment:NSTextAlignmentLeft];
[lbname setFont:[UIFont fontWithName:@"AlimamaShuHeiTi-Bold" size:24]];
[viewback addSubview:lbname];
[lbname mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.offset(29);
make.top.offset(20);
}];
UILabel *lbinfo = [[UILabel alloc] init];
[lbinfo setText:@"优秀的虚拟作家"];
[lbinfo setTextColor:RGBCOLOR(102, 102, 102)];
[lbinfo setTextAlignment:NSTextAlignmentLeft];
[lbinfo setFont:[UIFont systemFontOfSize:14]];
[viewback addSubview:lbinfo];
[lbinfo mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(lbname);
make.top.equalTo(lbname.mas_bottom).offset(4);
}];
UIButton *btsy = [[UIButton alloc] init];
[btsy setTitle:@"立即使用" forState:UIControlStateNormal];
[btsy setTitleColor:RGBCOLOR(27, 123, 103) forState:UIControlStateNormal];
[btsy.titleLabel setFont:[UIFont systemFontOfSize:16]];
[btsy setBackgroundImage:[UIImage imageNamed:@"home_znxz_bt"] forState:UIControlStateNormal];
[viewback addSubview:btsy];
[btsy mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.offset(26);
make.size.sizeOffset(CGSizeMake(102, 33));
make.top.equalTo(lbinfo.mas_bottom).offset(15);
}];
[btsy setUserInteractionEnabled:NO];
UILabel *lbts = [[UILabel alloc] init];
[lbts setText:@"100万+正在使用"];
[lbts setTextColor:RGBCOLOR(27, 123, 103)];
[lbts setTextAlignment:NSTextAlignmentLeft];
[lbts setFont:[UIFont systemFontOfSize:14]];
[viewback addSubview:lbts];
[lbts mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.offset(11);
make.right.equalTo(viewback).offset(-18);
}];
UIButton *btnext = [[UIButton alloc] init];
[viewback addSubview:btnext];
[btnext mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(viewback);
}];
[btnext addTarget:self action:@selector(nextAction) forControlEvents:UIControlEventTouchUpInside];
}
return self;
}
-(void)nextAction
{
ZhiNengXieZuoViewController *vc = [ZhiNengXieZuoViewController new];
[self.viewController.navigationController pushViewController:vc animated:YES];
[UserInfoModel shijianShangBao:0 key:@"client.jump.to.ai.write" value:@"home" extra:@""];
}
@end