JSPatch下发笔记5

简介: JSPatch下发笔记5
OC代码:
- (void)layoutSaleViews{
    [self startTime];
    if (self.isEarlyBird == YES) {
        _homeDetailView.saleTodayImg.width = 0;
        _homeDetailView.moneyIcon.left = 12;
        _homeDetailView.tipImageView.hidden = NO;
    }else{
        _homeDetailView.tipImageView.hidden = YES;
        _homeDetailView.saleTodayImg.hidden = NO;
    }
    [_homeDetailView.messageView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.height.equalTo(@94.5);
    }];
    _homeDetailView.dayAllMoney.hidden = YES;
    _homeDetailView.moneyIcon1.hidden = YES;
    _homeDetailView.rentDay.hidden = YES;
    _homeDetailView.weekOrMonthView.hidden = YES;
    [_homeDetailView.weekOrMonthView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.height.equalTo(@0);
    }];
    _homeDetailView.collectBtn.hidden = YES;
    _homeDetailView.line.hidden = YES;
    _homeDetailView.rentDateLbl.text = [NSString stringWithFormat:@"%@-%@",[[_saleModel.act_begin_date substringWithRange:NSMakeRange(0, 10)] stringByReplacingOccurrencesOfString:@"-" withString:@"."],[[_saleModel.act_end_date substringWithRange:NSMakeRange(0, 10)] stringByReplacingOccurrencesOfString:@"-" withString:@"."]];
    if ([NSString isBlankString:_saleModel.masterNeedKnow]) {
        [_homeDetailView.rentExplainView mas_updateConstraints:^(MASConstraintMaker *make) {
            make.height.equalTo(@0);
        }];
        _homeDetailView.rentExplainView.hidden = YES;
        [_homeDetailView.calendarView mas_updateConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(_homeDetailView.messageView.mas_bottom).offset(10);
        }];
    }else{
        _homeDetailView.rentExplainLbl.text = _saleModel.masterNeedKnow;
    }
}


JS代码:

require('NSString');
defineClass('NewHomeDetailController', {
            layoutSaleViews: function() {
            self.startTime();
            var _homeDetailView = self.valueForKey("_homeDetailView");
            var _saleModel = self.valueForKey("_saleModel");
            if (self.isEarlyBird() == YES) {
            _homeDetailView.saleTodayImg().setWidth(0);
            _homeDetailView.moneyIcon().setLeft(12);
            _homeDetailView.tipImageView().setHidden(NO);
            } else {
            _homeDetailView.tipImageView().setHidden(YES);
            _homeDetailView.saleTodayImg().setHidden(NO);
            }
            _homeDetailView.messageView().mas__updateConstraints(block('MASConstraintMaker*', function(make) {
                                                                       make.height().equalTo()(94.5);                                                                      }));
            _homeDetailView.dayAllMoney().setHidden(YES);
            _homeDetailView.moneyIcon1().setHidden(YES);
            _homeDetailView.rentDay().setHidden(YES);
            _homeDetailView.weekOrMonthView().setHidden(YES);
            _homeDetailView.weekOrMonthView().mas__updateConstraints(block('MASConstraintMaker*', function(make) {
                                                                           make.height().equalTo()(0);
                                                                           }));
            _homeDetailView.collectBtn().setHidden(YES);
            _homeDetailView.line().setHidden(YES);
            _homeDetailView.rentDateLbl().setText(NSString.stringWithFormat("%@-%@", _saleModel.act__begin__date().substringWithRange({location: 0, length: 10}).stringByReplacingOccurrencesOfString_withString("-", "."), _saleModel.act__end__date().substringWithRange({location: 0, length: 10}).stringByReplacingOccurrencesOfString_withString("-", ".")));
            if (NSString.isBlankString(_saleModel.masterNeedKnow())) {
            _homeDetailView.rentExplainView().mas__updateConstraints(block('MASConstraintMaker*', function(make) {
                                                                           make.height().equalTo()(0);
                                                                           }));
            _homeDetailView.rentExplainView().setHidden(YES);
            _homeDetailView.calendarView().mas__updateConstraints(block('MASConstraintMaker*', function(make) {
                                                                        make.top().equalTo()(_homeDetailView.messageView().mas__bottom()).offset()(10);
                                                                        }));
            } else {
            _homeDetailView.rentExplainLbl().setText(_saleModel.masterNeedKnow());
            }
            },
            });


总结:


1.Masonry中遇到单下划线要改成双下划线 ,数值@2,要改成2

2.变量名中遇到单下划线要改成双下划线

如:_saleModel.act__end__date()

目录
相关文章
|
2月前
|
JavaScript 前端开发
Vue、ElementUI配合Node、multiparty模块实现图片上传并反显_小demo
如何使用Vue和Element UI配合Node.js及multiparty模块实现图片上传并反显的功能,包括前端的Element UI组件配置和后端的Node.js服务端代码实现。
28 1
Vue、ElementUI配合Node、multiparty模块实现图片上传并反显_小demo
|
6月前
|
安全
JSPatch被停用了,也就是不能使用JSPatch第三方框架热修复了
JSPatch被停用了,也就是不能使用JSPatch第三方框架热修复了
93 0
|
6月前
|
JavaScript
JS逆向 -- HOOK关键数据
JS逆向 -- HOOK关键数据
82 0
|
6月前
|
JavaScript
Rspack 创建 vue2/3 项目接入 antdv(rspack.config.js 配置 less 主题)
Rspack 创建 vue2/3 项目接入 antdv(rspack.config.js 配置 less 主题)
93 0
|
算法
vue2-patch流程分析
我们在上篇文章分析了虚拟节点的创建及渲染流程,其中也有简单分析了 patch 过程,但是对于新旧节点的对比逻没有去仔细分析,所以我们打算好好梳理下 patch 的整个流程。
|
Web App开发 JavaScript iOS开发
JSPatch 断点调试
JSPatch 断点调试
143 0
JSPatch 断点调试
JSPatch下发笔记6
JSPatch下发笔记6
99 0
|
JavaScript
JSPatch下发笔记10
JSPatch下发笔记10
110 0
|
JavaScript
JSPatch下发笔记1
JSPatch下发笔记1
116 0
|
JavaScript
JSPatch下发笔记4
JSPatch下发笔记4
122 0