GithubHelp home page GithubHelp logo

heyaf / chosegoodstype Goto Github PK

View Code? Open in Web Editor NEW

This project forked from qlyx/chosegoodstype

0.0 0.0 0.0 8.82 MB

商城组件-仿淘宝加入购物车前选择商品规格属性,可修改tableview数据源创建多种规格属性

Objective-C 100.00%

chosegoodstype's Introduction

ChoseGoodsType

之前写过一个仿淘宝商品详情页和加入购物车的demo,有许多朋友下载了,但是那份代码只适用于商品规格只有两种的商品,拓展性不强,可以参考思路,地址(https://github.com/qlyx/AddShoppingCart) 最近又有朋友问到这个demo是否能添加两个以上规格,所以写了这份代码,希望对大家有帮助 使用tableview可以设置多个商品规格,刷新数据源即可 swift版:https://github.com/qlyx/swiftChooseGoodsType

image

下面代码创建即可

ChoseGoodsTypeAlert *_alert = [[ChoseGoodsTypeAlert alloc] initWithFrame:CGRectMake(0, 0, kWidth, kHeight) andHeight:kSize (450)];
_alert.alpha = 0;
[[UIApplication sharedApplication].keyWindow addSubview:_alert];

_alert.selectSize = ^(SizeAttributeModel *sizeModel) {
//sizeModel 选择的属性模型
[SVProgressHUD showWithString:[NSString stringWithFormat:@"选择了:%@",sizeModel.value]];
};
[_alert initData:model];
[_alert showView];

-(void)initData:(GoodsModel *)model
{

_model = model;
[goodsInfo initData:model];
[_dataSource removeAllObjects];
//传入数据源创建多个属性
[_dataSource addObjectsFromArray:model.itemsList];
//此方法必须在_dataSource赋值后方可调用
[self reloadGoodsInfo];
[self.tableview reloadData];
}

页面布局使用的是SD,提示HUD用的SVProgressHUD,如果使用的是其他HUD,修改JXUIKit下列代码即可

+(void)showWithString:(NSString *)string
{
    [SVProgressHUD showWithString:string];
}

如果觉得对您有帮助请随意打赏一下吧^ _ ^,您的支持是我的无限动力,谢谢

谢谢打赏,使用时如有问题可扫下方二维码加我哦

一起交流,一起进步

chosegoodstype's People

Contributors

qlyx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.