Commit bfe5edb8 authored by jz's avatar jz

update

parents a33ea7db 14a6aee4
No preview for this file type
......@@ -12,11 +12,19 @@ target 'GMAILab_Example' do
pod 'GMAILab', :path => '../'
# pod 'GMBase', :git => 'git@git.wanmeizhensuo.com:gengmeiios/GMBase.git', :commit => 'f3b40c7'
pod 'GMPhobos', :git => 'git@git.wanmeizhensuo.com:gengmeiios/GMPhobos.git', :commit => '960bbb8'
# pod 'GMBaseWeb', :git => 'git@git.wanmeizhensuo.com:gengmeiios/GMBaseWeb.git', :commit => '1b01976'
pod 'GMBaseWeb', :git => 'git@git.wanmeizhensuo.com:gengmeiios/GMBaseWeb.git', :commit => '0752677'
#9e91ae1
pod 'GMBase', :git => 'git@git.wanmeizhensuo.com:gengmeiios/GMBase.git', :commit => '9e91ae1'
pod 'GMBaseSwift', :git => 'git@git.wanmeizhensuo.com:gengmeiios/GMBaseSwift.git', :commit => '04bf8c0'
pod 'GMAlbum', :git => 'git@git.wanmeizhensuo.com:gengmeiios/GMAlbum.git', :commit => '31dcd07'
pod 'GMBaseSwift', :path => '../../GMBaseSwift'
pod 'GMBase', :path => '../../GMBase'
pod 'GMBaseWeb', :path => '../../GMBaseWeb'
# pod 'GMBaseSwift', :path => '../../GMBaseSwift'
# pod 'GMBase', :path => '../../GMBase'
# pod 'GMBaseWeb', :path => '../../GMBaseWeb'
# s.dependency 'GMBaseSwift','3.4.0'
# s.dependency 'EVReflection', '5.10.0'
......
......@@ -183,9 +183,9 @@ PODS:
DEPENDENCIES:
- GMAILab (from `../`)
- "GMAlbum (from `git@git.wanmeizhensuo.com:gengmeiios/GMAlbum.git`, commit `31dcd07`)"
- GMBase (from `../../GMBase`)
- GMBaseSwift (from `../../GMBaseSwift`)
- GMBaseWeb (from `../../GMBaseWeb`)
- "GMBase (from `git@git.wanmeizhensuo.com:gengmeiios/GMBase.git`, commit `9e91ae1`)"
- "GMBaseSwift (from `git@git.wanmeizhensuo.com:gengmeiios/GMBaseSwift.git`, commit `04bf8c0`)"
- "GMBaseWeb (from `git@git.wanmeizhensuo.com:gengmeiios/GMBaseWeb.git`, commit `0752677`)"
- "GMPhobos (from `git@git.wanmeizhensuo.com:gengmeiios/GMPhobos.git`, commit `960bbb8`)"
SPEC REPOS:
......@@ -235,11 +235,14 @@ EXTERNAL SOURCES:
:commit: 31dcd07
:git: "git@git.wanmeizhensuo.com:gengmeiios/GMAlbum.git"
GMBase:
:path: "../../GMBase"
:commit: 9e91ae1
:git: "git@git.wanmeizhensuo.com:gengmeiios/GMBase.git"
GMBaseSwift:
:path: "../../GMBaseSwift"
:commit: 04bf8c0
:git: "git@git.wanmeizhensuo.com:gengmeiios/GMBaseSwift.git"
GMBaseWeb:
:path: "../../GMBaseWeb"
:commit: '0752677'
:git: "git@git.wanmeizhensuo.com:gengmeiios/GMBaseWeb.git"
GMPhobos:
:commit: 960bbb8
:git: "git@git.wanmeizhensuo.com:gengmeiios/GMPhobos.git"
......@@ -248,6 +251,15 @@ CHECKOUT OPTIONS:
GMAlbum:
:commit: 31dcd07
:git: "git@git.wanmeizhensuo.com:gengmeiios/GMAlbum.git"
GMBase:
:commit: 9e91ae1
:git: "git@git.wanmeizhensuo.com:gengmeiios/GMBase.git"
GMBaseSwift:
:commit: 04bf8c0
:git: "git@git.wanmeizhensuo.com:gengmeiios/GMBaseSwift.git"
GMBaseWeb:
:commit: '0752677'
:git: "git@git.wanmeizhensuo.com:gengmeiios/GMBaseWeb.git"
GMPhobos:
:commit: 960bbb8
:git: "git@git.wanmeizhensuo.com:gengmeiios/GMPhobos.git"
......@@ -296,6 +308,6 @@ SPEC CHECKSUMS:
Weibo_SDK: 5a4d08f7e1fedbb635435e4585c8c0439c7da089
YYText: 5c461d709e24d55a182d1441c41dc639a18a4849
PODFILE CHECKSUM: debdf0bbf16da46f39f99b9a389d9e6b2035f888
PODFILE CHECKSUM: 6bf81f186728322854cebf9cac5a818e62d181a5
COCOAPODS: 1.9.1
//
// GMConsultantInfoModel.h
// Gengmei
//
// Created by zhouLiang on 2020/3/9.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
@import GMBase;
@protocol GMHospitalInfoModel @end
@interface GMHospitalInfoModel : GMObject
/** 医院名称 */
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *portrait;
@property (nonatomic, assign) NSInteger level;
@property (nonatomic, copy) NSString *id;
@property (nonatomic, copy) NSString *type;
@property (nonatomic, copy) NSString *url;
@end
@interface GMConsultantInfoModel : GMObject
@property (nonatomic, copy) NSString *counsellorId;
/** 状态, 1:离线,2:在线,3:面诊中 */
@property (nonatomic, assign) NSInteger status;
/** 面诊师对应的用户ID */
@property (nonatomic, assign) NSInteger userId;
/** 面诊师头像 */
@property (nonatomic, copy) NSString *portrait;
/** 医院id */
@property (nonatomic, copy) NSString *hospitalId;
/** 性别, 1: 男, 2:女 */
@property (nonatomic, assign) NSInteger gender;
/** 是否已关注 */
@property (nonatomic, assign) BOOL isFollow;
/** 用户昵称 */
@property (nonatomic, copy) NSString *nickname;
/** 目前固定为面诊师 */
@property (nonatomic, copy) NSString *title;
/** 地区 */
@property (nonatomic, copy) NSString *area;
/** 从业时长,单位年 */
@property (nonatomic, assign) NSInteger employmentDuration;
/** 面诊数 */
@property (nonatomic, copy) NSString *historyConsultationCount;
/** 累计在线时长 */
@property (nonatomic, copy) NSString *historyConsultationOnline;
/** 粉丝数 */
@property (nonatomic, copy) NSString *fanNum;
/** 擅长项目 */
@property (nonatomic, strong) NSArray *goodAt;
/** 面诊师简介 */
@property (nonatomic, copy) NSString *introduction;
/** 医院名字 */
@property (nonatomic, strong) GMHospitalInfoModel *hospitalInfo;
/** 私信协议咨询 */
@property (nonatomic, copy) NSString *messageUrl;
/** 好评率 */
@property (nonatomic, copy) NSString *likeRate;
/** 接通率 */
@property (nonatomic, copy) NSString *connectRate;
/** 有效面诊人数 */
@property (nonatomic, copy) NSString *consultPeopleNumber;
@end
//
// GMConsultantInfoModel.m
// Gengmei
//
// Created by zhouLiang on 2020/3/9.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "GMConsultantInfoModel.h"
@implementation GMHospitalInfoModel
@end
@implementation GMConsultantInfoModel
@end
//
// GMToFaceDoctorListModel.h
// Gengmei
//
// Created by zhouLiang on 2020/2/20.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
@import GMBase;
@protocol GMToFaceTabs @end
@interface GMToFaceTabs : GMObject
@property (nonatomic, assign) NSInteger id;
@property (nonatomic, copy) NSString *name;
@property (nonatomic, assign) BOOL selected;
@end
@protocol GMToFaceRecommendsDoctors @end
@interface GMToFaceRecommendsDoctors : GMObject
@property (nonatomic, copy) NSString *counsellorId;
@property (nonatomic, copy) NSString *doctorId;
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *cityName;
@property (nonatomic, copy) NSString *portrait;
// 形象照
@property (nonatomic, copy) NSString *personalPicture;
@property (nonatomic, copy) NSString *userId;
/** 1(不在线)/2(在线)/3(视频面诊中) */
@property (nonatomic, assign) NSInteger status;
/** 0/1 是否是助理 */
@property (nonatomic, assign) NSInteger isAssistant;
/** 医生职称 */
@property (nonatomic, copy) NSString *title;
/** 执业时间 */
@property (nonatomic, copy) NSString *practisingTime;
/** 擅长项目 */
@property (nonatomic, copy) NSString *goodAt;
/** 是否关注 */
@property (nonatomic, assign) BOOL isFollow;
/** 医生主页协议 */
@property (nonatomic, copy) NSString *gm_url;
/** 面诊顾问类型, 1: 医生, 2:面诊师 */
@property (nonatomic, assign) NSInteger type;
/** 好评率 */
@property (nonatomic, copy) NSString *likeRate;
/** 接通率 */
@property (nonatomic, copy) NSString *connectRate;
/** 有效面诊人数 */
@property (nonatomic, copy) NSString *consultPeopleNumber;
/** 展示类型,0:不显示 1: 好评率 + 接通率 2: 好评率 + 有效面诊人数*/
@property (nonatomic, assign) NSInteger showType;
/** 面诊价格 */
@property (nonatomic, assign) NSInteger serviceFee;
/** 面诊价格 */
@property (nonatomic, copy) NSString *serviceFeeStr;
@property (nonatomic, strong) NSDictionary *exposure;
@end
@interface GMToFaceTabsDoctorListModel : GMObject
/** 推荐医生列表 */
@property (nonatomic, strong) NSMutableArray <GMToFaceRecommendsDoctors>*counsellors;
@end
@interface GMToFaceDoctorListModel : GMObject
/** 推荐医生列表 */
@property (nonatomic, strong) NSMutableArray <GMToFaceRecommendsDoctors>*recommendsCounsellors;
/** tab */
@property (nonatomic, strong) NSMutableArray <GMToFaceTabs>*tabs;
/** 没有被封禁则为空对象 */
@property (nonatomic, copy) NSString *blockInfo;
@end
//
// GMToFaceDoctorListModel.m
// Gengmei
//
// Created by zhouLiang on 2020/2/20.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "GMToFaceDoctorListModel.h"
@implementation GMToFaceTabs
@end
@implementation GMToFaceRecommendsDoctors
- (NSString *)serviceFeeStr {
NSString *str;
NSInteger iPrice = self.serviceFee/100;
NSInteger fPrice = self.serviceFee%100;
if (self.serviceFee == 0) {
return @"免费";
}
if (fPrice == 0) {
str = [NSString stringWithFormat:@"%ld",(long)iPrice];
}else if (fPrice<10) {
str = [NSString stringWithFormat:@"%ld.0%ld",(long)iPrice,(long)fPrice];
}else {
str = [NSString stringWithFormat:@"%ld.%ld",(long)iPrice,(long)fPrice];
}
return str;
}
@end
@implementation GMToFaceTabsDoctorListModel
@end
@implementation GMToFaceDoctorListModel
@end
//
// GMToFaceDoctorListViewModel.h
// Gengmei
//
// Created by zhouLiang on 2020/2/20.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "GMToFaceDoctorListModel.h"
@interface GMToFaceDoctorListViewModel : NSObject
@property (nonatomic, assign) NSInteger page;
@property (nonatomic, assign) NSInteger tabId;
@property (nonatomic, copy) NSString *tabName;
@property (nonatomic, strong) NSMutableArray <GMToFaceRecommendsDoctors *>*dataArray;
/** 视频面诊频道tab 医生列表 */
- (void)excuteToFaceTabsDoctorsSuccessBlock:(HttpSuccessBlock)successBlock
failBlock:(HttpFailedBlock)failBlock;
@end
//
// GMToFaceDoctorListViewModel.m
// Gengmei
//
// Created by zhouLiang on 2020/2/20.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "GMToFaceDoctorListViewModel.h"
#import "GMToFaceNetworking.h"
@interface GMToFaceDoctorListViewModel ()<WMFetchDataModelProtocol> {
NSMutableDictionary *_deduplicationDic;
NSString *_deduplicationKey;
}
@end
@implementation GMToFaceDoctorListViewModel
- (instancetype)init {
if (self = [super init]) {
_deduplicationKey = @"counsellorId";
_deduplicationDic = [NSMutableDictionary dictionary];
}
return self;
}
- (void)excuteToFaceTabsDoctorsSuccessBlock:(HttpSuccessBlock)successBlock
failBlock:(HttpFailedBlock)failBlock {
[[GMToFaceNetworking shareInstance] excuteToFaceTabsDoctorsTabsId:self.tabId page:self.page SuccessBlock:^(id response) {
GMToFaceTabsDoctorListModel *model = [[GMToFaceTabsDoctorListModel alloc] initWithDictionary:response error:NULL];
if (self.page == 1) {
[self.dataArray removeAllObjects];
[_deduplicationDic removeAllObjects];
}
if (model.counsellors.count) {
[self deduplicationForArray:model.counsellors buildModelBlock:NULL];
}
successBlock(self.dataArray);
} failureBlock:^(NSInteger errorCode, NSString *message) {
failBlock(message);
}];
}
- (NSMutableArray<GMToFaceRecommendsDoctors *> *)dataArray {
if (!_dataArray) {
_dataArray = [NSMutableArray arrayWithCapacity:15];
}
return _dataArray;
}
- (void)deduplicationForArray:(NSArray *)array buildModelBlock:(id (^)(NSDictionary *))buildBlock {
if (_deduplicationKey.length == 0) {
return;
}
// NSMutableArray 不是线程安全的,不能使用并行枚举。参考https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Multithreading/ThreadSafetySummary/ThreadSafetySummary.html
[array enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
id value = [obj valueForKey:_deduplicationKey];
NSString *key = [value isKindOfClass:[NSString class]] ? value : [value stringValue];
NSAssert(key.length > 0, @"key 怎么会是一个空???!!!");
if (!_deduplicationDic[key]) {
if ([obj isKindOfClass:[NSDictionary class]]) {
id object = buildBlock(obj);
[self.dataArray addObject:object];
}else{
[self.dataArray addObject:obj];
}
_deduplicationDic[key] = @1;
}
}];
}
@end
//
// GMBasicInfoCardView.h
// Gengmei
//
// Created by yefengming on 2020/2/19.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import <GMKit/GMPopupBgView.h>
NS_ASSUME_NONNULL_BEGIN
@interface GMBasicInfoCardView : GMPopupBgView
@property (nonatomic, copy) NSString *doctorId;
//@property (nonatomic, copy) NSString *refferer;
//派单
@property (nonatomic, assign) BOOL isDispatch;
@property (nonatomic, copy) NSString *counsellorId;
@property (nonatomic, strong) NSMutableDictionary *dict;
+ (void)showWithCorrectFrameView:(GMBasicInfoCardView *)cardView resultBlock:(void(^)(void))resultBlock;
@end
NS_ASSUME_NONNULL_END
//
// GMDoctorInfoPopupView.h
// Gengmei
//
// Created by zhouLiang on 2020/3/6.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "GMConsultantInfoModel.h"
#import "GMLibraryHeader.h"
@protocol GMDoctorInfoPopupViewDelegate <NSObject>
- (void)followBtnClick:(BOOL)isFollow;
@end
@interface GMDoctorInfoPopupView : GMPopupBgView
@property (nonatomic, strong) GMConsultantInfoModel *model;
@property (nonatomic, weak) id<GMDoctorInfoPopupViewDelegate>delegate;
@property (nonatomic, copy) void(^blockInfoCallback)(NSString *blockInfo);
@end
//
// GMFaceListPageControl.h
// Gengmei
//
// Created by Jessica on 2020/4/2.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import <GMKit/GMView.h>
NS_ASSUME_NONNULL_BEGIN
@interface GMFaceListPageControl : GMView
@property (nonatomic, assign) NSInteger numberOfPages;
@property (nonatomic, assign) NSInteger currentPage;
@property (nonatomic, strong) UIColor *tintColor;
@property (nonatomic, strong) UIColor *currentTintColor;
@end
NS_ASSUME_NONNULL_END
//
// GMFaceListPageControl.m
// Gengmei
//
// Created by Jessica on 2020/4/2.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "GMFaceListPageControl.h"
#define pointWidth 5
#define pointInterval 8
@interface GMFaceListPageControl ()
@property (nonatomic, strong) NSMutableArray *pageArray;
@end
@implementation GMFaceListPageControl
{
BOOL _shouldSetColor;
BOOL _isInit;
}
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self)
{
_tintColor = [UIColor lightGrayColor];
_currentTintColor = [UIButton buttonWithType:UIButtonTypeSystem].tintColor;
_shouldSetColor = NO;
_isInit = YES;
}
return self;
}
- (void)layoutSubviews {
[super layoutSubviews];
if (self.pageArray.count == 0) return;
if (_shouldSetColor)
{
for (int i = 0; i < self.pageArray.count; i++)
{
UIView *view = self.pageArray[i];
view.backgroundColor = self.tintColor;
if (i == _currentPage)
{
view.backgroundColor = self.currentTintColor;
}
_shouldSetColor = NO;
}
}
if (_isInit)
{
CGFloat totalWidth = _numberOfPages * pointWidth + (_numberOfPages - 1) * pointInterval;
for (int i = 0; i < self.pageArray.count; i++)
{
UIView *view = self.pageArray[i];
CGFloat x = (self.frame.size.width - totalWidth) * 0.5f + (pointWidth + pointInterval) * i;
CGFloat y = (self.frame.size.height - pointWidth) * 0.5f;
CGFloat width = (i==_currentPage?(pointWidth + pointInterval):pointWidth);
CGFloat height = pointWidth;
if (i == _currentPage)
{
x = x - pointInterval * 0.5f;
}
view.frame = CGRectMake(x, y, width, height);
_isInit = NO;
}
}
}
#pragma mark -- setter
- (void)setNumberOfPages:(NSInteger)numberOfPages {
_numberOfPages = numberOfPages;
_isInit = YES;
if (self.pageArray.count > 0)
{
[self.pageArray enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop)
{
[(UIView *)obj removeFromSuperview];
}];
[self.pageArray removeAllObjects];
}
for (int i = 0; i < numberOfPages; i++)
{
UIView *indicatorView = [[UIView alloc] initWithFrame:CGRectZero];
indicatorView.layer.cornerRadius = pointWidth * 0.5f;
[self addSubview:indicatorView];
[self.pageArray addObject:indicatorView];
}
_shouldSetColor = YES;
[self setNeedsLayout];
}
- (void)setCurrentPage:(NSInteger)currentPage
{
if (self.pageArray.count == 0)
{
_currentPage = currentPage;
return;
}
if (_currentPage == currentPage) return;
// 向右
if (currentPage > _currentPage) {
UIView *currentView = self.pageArray[_currentPage];
UIView *nextView = self.pageArray[currentPage];
[self bringSubviewToFront:currentView];
[self bringSubviewToFront:nextView];
currentView.backgroundColor = self.tintColor;
nextView.backgroundColor = self.currentTintColor;
CGRect cFrame = currentView.frame;
nextView.frame = cFrame;
cFrame.origin = CGPointMake(cFrame.origin.x + pointInterval * 0.5f, cFrame.origin.y);
cFrame.size = CGSizeMake(pointWidth, pointWidth);
currentView.frame = cFrame;
CGRect newFrame = nextView.frame;
newFrame.size = CGSizeMake(pointInterval + pointWidth, newFrame.size.height);
if (_currentPage == self.pageArray.count - 1) {
newFrame.origin = CGPointMake(newFrame.origin.x, newFrame.origin.y);
} else {
newFrame.origin = CGPointMake(newFrame.origin.x + (pointInterval + pointWidth) * (currentPage - _currentPage), newFrame.origin.y);
}
nextView.frame = newFrame;
_currentPage = currentPage;
}
// 向左
else
{
UIView *currentView = self.pageArray[_currentPage];
UIView *nextView = self.pageArray[currentPage];
[self bringSubviewToFront:currentView];
CGRect newFrame = currentView.frame;
newFrame.size = CGSizeMake((pointInterval + pointWidth), newFrame.size.height);
newFrame.origin = CGPointMake(newFrame.origin.x - (pointInterval + pointWidth) * (_currentPage - currentPage), newFrame.origin.y);
currentView.frame = newFrame;
[self bringSubviewToFront:nextView];
currentView.backgroundColor = self.tintColor;
nextView.backgroundColor = self.currentTintColor;
CGRect cFrame = currentView.frame;
nextView.frame = cFrame;
cFrame.origin = CGPointMake(cFrame.origin.x + pointInterval * 0.5f + (pointInterval + pointWidth) * (_currentPage - currentPage), cFrame.origin.y);
cFrame.size = CGSizeMake(pointWidth, pointWidth);
currentView.frame = cFrame;
_currentPage = currentPage;
}
}
- (NSMutableArray *)pageArray
{
if (!_pageArray)
{
_pageArray = [NSMutableArray array];
}
return _pageArray;
}
@end
//
// GMToFaceDoctorBlockInfoView.h
// Gengmei
//
// Created by zhouLiang on 2020/2/23.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface GMToFaceDoctorBlockInfoView : UIView
@property (nonatomic, copy) NSString *blockInfo;
@end
NS_ASSUME_NONNULL_END
//
// GMToFaceDoctorBlockInfoView.m
// Gengmei
//
// Created by zhouLiang on 2020/2/23.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "GMToFaceDoctorBlockInfoView.h"
#import "GMLibraryHeader.h"
//#import "UIView+GMGradient.h"
@interface GMToFaceDoctorBlockInfoView ()
@property (nonatomic, strong) GMLabel *titleLabel;
@end
@implementation GMToFaceDoctorBlockInfoView
- (instancetype)init {
if (self = [super init]) {
[self setUI];
}
return self;
}
- (void)setUI {
[self addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(20);
make.right.mas_equalTo(-20);
make.top.mas_equalTo(10);
make.bottom.mas_equalTo(-10);
make.height.mas_equalTo(46);
}];
//渐变色
[self setGradientBackgroundWithColors:@[RGBCOLOR_HEX(0xFF7096),RGBCOLOR_HEX(0xFF5963)] locations:nil startPoint:CGPointMake(0, 0) endPoint:CGPointMake(1, 0)];
self.alpha = 0.7;
}
- (void)setBlockInfo:(NSString *)blockInfo {
self.titleLabel.text = SafeString(blockInfo);
self.hidden = ![SafeString(blockInfo) isNonEmpty];
CGSize size = [self.titleLabel sizeThatFits:CGSizeMake(MAINSCREEN_WIDTH - 40, 100)];
[self.titleLabel mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(size.height);
}];
}
- (GMLabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [GMLabel labelWithTextColor:UIColor.whiteColor fontSize:11];
_titleLabel.font = [UIFont gmBoldFont:11];
_titleLabel.numberOfLines = 0;
}
return _titleLabel;
}
@end
//
// GMToFaceDoctorListHeaderFlowLayout.h
// Gengmei
//
// Created by Jessica on 2020/3/28.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "GMLibraryHeader.h"
NS_ASSUME_NONNULL_BEGIN
@interface GMToFaceDoctorListHeaderFlowLayout : UICollectionViewFlowLayout
@property(nonatomic, assign) NSInteger currentIndex;
// //滑动固定偏移距离 itemSize.width * 倍数
@property(nonatomic, assign) CGFloat contentOffsetX;
@end
NS_ASSUME_NONNULL_END
//
// GMToFaceDoctorListHeaderFlowLayout.m
// Gengmei
//
// Created by Jessica on 2020/3/28.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "GMToFaceDoctorListHeaderFlowLayout.h"
#define ActiveDistance itemWidth
#define itemScale 0.88
#define itemWidth ((MAINSCREEN_WIDTH - 12 - itemLineSpacing) / 1.7)
#define itemSmallWidth (itemWidth * itemScale)
#define itemLineSpacing 0
#define itemInteritemSpacing 12
@interface GMToFaceDoctorListHeaderFlowLayout()
// 存储布局信息
@property(nonatomic, strong) NSArray *layoutInfoArr;
@end
@implementation GMToFaceDoctorListHeaderFlowLayout
- (instancetype)init {
if ([super init] == self) {
self.scrollDirection = UICollectionViewScrollDirectionHorizontal;
self.itemSize = CGSizeMake(itemWidth, itemWidth);
self.sectionInset = UIEdgeInsetsMake(15, 12, 15, 0);
// 因为有放大缩小 所以间距设置为0
self.minimumLineSpacing = itemLineSpacing;
self.minimumInteritemSpacing = itemInteritemSpacing;
self.contentOffsetX = (12 + itemWidth / 2.0) / MAINSCREEN_WIDTH;
}
return self;
}
- (NSArray<UICollectionViewLayoutAttributes *> *)layoutAttributesForElementsInRect:(CGRect)rect {
return [self cardScaleTypeInRect:rect];
}
//卡片缩放
- (NSArray<UICollectionViewLayoutAttributes *> *)cardScaleTypeInRect:(CGRect)rect{
NSArray *array = [self getCopyOfAttributes:[super layoutAttributesForElementsInRect:rect]];
CGRect visibleRect = CGRectZero;
visibleRect.origin = self.collectionView.contentOffset;
visibleRect.size = self.collectionView.bounds.size;
for (int i = 0; i < array.count; i++) {
UICollectionViewLayoutAttributes *attributes = array[i];
// 计算中心点距离
CGFloat delta = fabs(visibleRect.origin.x + 12 + itemWidth / 2.0 - attributes.center.x);
// q计算比例
CGFloat scale = 1 - delta / ActiveDistance * 0.12;
attributes.transform = CGAffineTransformMakeScale(scale, scale);
}
return array;
}
- (NSArray *)getCopyOfAttributes:(NSArray *)attributes
{
NSMutableArray *copyArr = [NSMutableArray new];
for (UICollectionViewLayoutAttributes *attribute in attributes) {
[copyArr addObject:[attribute copy]];
}
return copyArr;
}
- (BOOL)shouldInvalidateLayoutForBoundsChange:(CGRect)newBounds {
return ![self.collectionView isPagingEnabled];
}
/**
* collectionView停止滚动时的偏移量
*/
- (CGPoint)targetContentOffsetForProposedContentOffset:(CGPoint)proposedContentOffset withScrollingVelocity:(CGPoint)velocity
{
CGRect rect;
rect.origin.y = 0;
rect.origin.x = proposedContentOffset.x;
rect.size = self.collectionView.frame.size;
NSArray *array = [super layoutAttributesForElementsInRect:rect];
CGFloat centerX = proposedContentOffset.x + self.collectionView.frame.size.width * self.contentOffsetX;
CGFloat minDelta = MAXFLOAT;
for (UICollectionViewLayoutAttributes *attrs in array) {
if (ABS(minDelta) > ABS(attrs.center.x - centerX)) {
minDelta = attrs.center.x - centerX;
}
}
proposedContentOffset.x += minDelta;
self.currentIndex = round((ABS(proposedContentOffset.x))/(self.itemSize.width + self.minimumLineSpacing));
return proposedContentOffset;
}
@end
//
// GMToFaceDoctorListHorNewCell.h
// Gengmei
//
// Created by Jessica on 2020/3/28.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "GMToFaceDoctorListViewModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface GMToFaceDoctorListHorNewCell : GMCollectionViewCell
@property (nonatomic, strong) GMToFaceRecommendsDoctors *doctorsModel;
/** 获取封禁信息的回调 */
@property (nonatomic, copy) void(^blockInfoCallback)(NSString *blockInfo);
@property (nonatomic, strong) NSIndexPath *indexPath;
@end
NS_ASSUME_NONNULL_END
//
// GMToFaceDoctorListNewHeaderView.h
// Gengmei
//
// Created by Jessica on 2020/3/28.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "GMToFaceDoctorListModel.h"
#import <GMKit/GMView.h>
NS_ASSUME_NONNULL_BEGIN
@interface GMToFaceDoctorListNewHeaderView : GMView
@property (nonatomic, strong) NSMutableArray <GMToFaceRecommendsDoctors *>*dataArray;
/** 获取封禁信息的回调 */
@property (nonatomic, copy, nullable) void(^blockInfoCallback)(NSString *blockInfo);
@property (nonatomic, strong) UICollectionView *collectView;
+ (CGFloat)viewHeight;
@end
NS_ASSUME_NONNULL_END
//
// GMToFaceDoctorListNewHeaderView.m
// Gengmei
//
// Created by Jessica on 2020/3/28.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "GMToFaceDoctorListNewHeaderView.h"
#import "GMToFaceDoctorListHeaderFlowLayout.h"
#import "GMToFaceDoctorListHorNewCell.h"
#import "GMTelephoneProxy.h"
#import "GMFaceListPageControl.h"
#define MaxCount 500
@interface GMToFaceDoctorListNewHeaderView ()<UICollectionViewDelegate, UICollectionViewDataSource> {
BOOL _beganDragging;
}
@property (nonatomic, strong) GMToFaceDoctorListHeaderFlowLayout *layout;
@property (nonatomic,strong) NSTimer *timer;
@property (nonatomic, strong) GMFaceListPageControl *pageControl;
@end
@implementation GMToFaceDoctorListNewHeaderView
- (instancetype)init {
if (self = [super init]) {
[self setUI];
}
return self;
}
- (void)setUI {
self.backgroundColor = RGBCOLOR_HEX(0xF7F6FA);
[self addSubview:self.collectView];
[self addSubview:self.pageControl];
[self.collectView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(0);
make.height.mas_equalTo(((MAINSCREEN_WIDTH - 12 - 12) / 1.7) + 30);
make.top.mas_equalTo(0);
}];
self.pageControl.frame = CGRectMake(0, ((MAINSCREEN_WIDTH - 12 - 12) / 1.7) + 30, MAINSCREEN_WIDTH, 10);
}
- (void)setDataArray:(NSMutableArray<GMToFaceRecommendsDoctors *> *)dataArray {
_dataArray = dataArray;
[self.collectView reloadData];
__weak typeof(self)weakSelf = self;
// 用这个方法是防止 collectionview reloadData 执行完成后 再做接下来的事情
[self.collectView performBatchUpdates:^{
[weakSelf.collectView layoutIfNeeded];
} completion:^(BOOL finished) {
if (finished) {
NSIndexPath *firstIndexPath = [NSIndexPath indexPathForItem: 0 inSection:0];
[self.collectView scrollToItemAtIndexPath:firstIndexPath atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally animated:YES];
_layout.currentIndex = 0;
self.pageControl.numberOfPages = dataArray.count;
[self setUpTimer];
}
}];
}
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
return 1;
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.dataArray.count * MaxCount;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
GMToFaceDoctorListHorNewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([GMToFaceDoctorListHorNewCell class]) forIndexPath:indexPath];
NSIndexPath *currentIndex = [NSIndexPath indexPathForItem:(indexPath.row % self.dataArray.count) inSection:0];
self.pageCtrl.tabName = @"医生推荐";
cell.pageCtrl = self.pageCtrl;
cell.doctorsModel = self.dataArray[currentIndex.row];
cell.indexPath = currentIndex;
__weak __typeof(self)weakSelf = self;
cell.blockInfoCallback = ^(NSString *blockInfo) {
weakSelf.blockInfoCallback(blockInfo);
};
return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
// GMToFaceRecommendsDoctors *model = self.dataArray[indexPath.row];
// [GMBaseTool getCurrentViewController].tabName = @"医生推荐";
// //跳到医生主页
// [[GMRouter sharedInstance] pushScheme:model.gm_url];
}
#pragma mark <UIScrollViewDelegate>
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView{
_beganDragging = YES;
[self invalidateTimer];
}
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{
_beganDragging = NO;
if (decelerate == NO) { // 没有降速的过程,直接在此方法中去添加定时器
[self setUpTimer];
}
}
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{
[self setUpTimer];
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
// 确定当前页数及组数
self.pageControl.currentPage = _layout.currentIndex % self.dataArray.count;
}
- (void)setUpTimer {
if (self.timer.valid) {
[self invalidateTimer];
}
self.timer = [NSTimer timerWithTimeInterval:10 target:[GMTelephoneProxy proxyWithTarget:self] selector:@selector(nextPage) userInfo:nil repeats:YES];
[[NSRunLoop mainRunLoop] addTimer:self.timer forMode:NSDefaultRunLoopMode];
}
- (void)invalidateTimer {
[self.timer invalidate];
self.timer = nil;
}
- (void)nextPage{
if (_beganDragging) return;
if (!self.superview) return;
_layout.currentIndex += 1;
if (_layout.currentIndex == (self.dataArray.count * MaxCount)) {
_layout.currentIndex = 0;
}
NSIndexPath *nextIndexPath = [NSIndexPath indexPathForItem: _layout.currentIndex inSection:0];
[self scrolToPath:nextIndexPath animated:YES];
}
//滚动处理
- (void)scrolToPath:(NSIndexPath*)path animated:(BOOL)animated{
if (path.row > self.dataArray.count * MaxCount - 1){
[self invalidateTimer];
return;
}
if (self.dataArray.count==0) return;
[self.collectView scrollToItemAtIndexPath:path atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally animated:animated];
self.collectView.contentOffset = CGPointMake(self.collectView.contentOffset.x+self.collectView.frame.size.width *(0.5 - _layout.contentOffsetX), self.collectView.contentOffset.y);
}
+ (CGFloat)viewHeight {
return (((MAINSCREEN_WIDTH - 12 - 12) / 1.7) + 40);
}
- (UICollectionViewFlowLayout *)layout {
if (!_layout) {
_layout = [[GMToFaceDoctorListHeaderFlowLayout alloc] init];
}
return _layout;
}
- (UICollectionView *)collectView {
if (!_collectView) {
_collectView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:self.layout];
_collectView.showsHorizontalScrollIndicator = NO;
_collectView.backgroundColor = RGBCOLOR_HEX(0xF7F6FA);
_collectView.decelerationRate = UIScrollViewDecelerationRateFast;
_collectView.delegate = self;
_collectView.dataSource = self;
[_collectView registerClass:[GMToFaceDoctorListHorNewCell class] forCellWithReuseIdentifier:NSStringFromClass([GMToFaceDoctorListHorNewCell class])];
} return _collectView;
}
- (GMFaceListPageControl *)pageControl {
if (!_pageControl) {
_pageControl = [[GMFaceListPageControl alloc] init];
_pageControl.numberOfPages = 0;
_pageControl.tintColor = RGBCOLOR_HEX(0xD8D8D8);
_pageControl.currentTintColor = RGBCOLOR_HEX(0x7DC6CC);
}
return _pageControl;
}
- (void)dealloc {
[self invalidateTimer];
}
@end
//
// GMToFaceDoctorListVerCell.h
// Gengmei
//
// Created by zhouLiang on 2020/2/18.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "GMToFaceDoctorListViewModel.h"
#import "GMLibraryHeader.h"
@interface GMToFaceDoctorInfoView : GMView
- (void)showWithLikeRate:(NSString *)likeRate connectRate:(NSString *)connectRate consultPeopleNumber:(NSString *)consultPeopleNumber showType:(NSInteger)showType;
@end
@interface GMToFaceDoctorListVerCell : GMCollectionViewCell
@property (nonatomic, strong) GMToFaceRecommendsDoctors *doctorsModel;
@end
//
// GMToFaceContainerViewController.h
// Gengmei
//
// Created by zhouLiang on 2020/2/19.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "GMFacePagingViewController.h"
#import "GMToFaceDoctorListViewModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface GMToFaceContainerViewController : GMFacePagingViewController
@property (nonatomic, strong) GMToFaceDoctorListViewModel *viewModel;
@end
NS_ASSUME_NONNULL_END
//
// GMToFaceDoctorListController.h
// Gengmei
//
// Created by zhouLiang on 2020/2/18.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "JXPagerView.h"
#import "GMToFaceDoctorListViewModel.h"
@import GMBase;
@interface GMToFaceDoctorListController : WMBaseViewController<JXPagerViewListViewDelegate>
@property (nonatomic, strong) GMToFaceDoctorListViewModel * _Nullable viewModel;
@property (nonatomic, assign) CGFloat topViewHeight;
@property (nonatomic, copy, nullable) void(^scrollCallback)(UIScrollView * _Nullable scrollView);
/** 获取封禁信息的回调 */
@property (nonatomic, copy, nullable) void(^blockInfoCallback)(NSString * _Nullable blockInfo);
- (void)requestData;
@end
//
// GMPayResultModel.h
// Gengmei
//
// Created by zhouLiang on 2020/4/9.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
@import GMBase;
@interface GMPayResultModel : GMObject
@property (nonatomic, copy) NSString *orderNo;
/** 0:未付款,1:已取消,2:已付款,3:投诉审核中,4:退款处理中,5:已退款,6:已完成 */
@property (nonatomic, assign) NSInteger orderStatus;
@property (nonatomic, assign) NSInteger price;
@property (nonatomic, assign) NSInteger paymentAmont;
@end
//
// GMPayResultModel.m
// Gengmei
//
// Created by zhouLiang on 2020/4/9.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "GMPayResultModel.h"
@implementation GMPayResultModel
@end
//
// GMToFaceOrderInfoModel.h
// Gengmei
//
// Created by zhouLiang on 2020/4/11.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
@import GMBase;
@interface GMToFaceOrderInfoModel : GMObject
@property (nonatomic, copy) NSString *counsellorPortrait;
@property (nonatomic, copy) NSString *orderNo;
/** 面诊时长 */
@property (nonatomic, copy) NSString *consultTime;
@property (nonatomic, copy) NSString *startTime;
@property (nonatomic, copy) NSString *endTime;
@property (nonatomic, assign) NSInteger payAmount;
@property (nonatomic, copy) NSString *paymentAmountStr;
@property (nonatomic, assign) NSInteger needPay;
@property (nonatomic, copy) NSString *needPayStr;
/** 医生姓名 */
@property (nonatomic, copy) NSString *counsellorName;
/** 医生类型 */
@property (nonatomic, assign) NSInteger counsellorType;
/** 医生id */
@property (nonatomic, copy) NSString *counsellorId;
/** 订单类型 */
@property (nonatomic, assign) NSInteger recordType;
/** 面诊id */
@property (nonatomic, copy) NSString *consultationRecordId;
@end
//
// GMToFaceOrderInfoModel.m
// Gengmei
//
// Created by zhouLiang on 2020/4/11.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "GMToFaceOrderInfoModel.h"
@implementation GMToFaceOrderInfoModel
- (NSString *)paymentAmountStr {
NSString *str;
NSInteger iPrice = self.payAmount/100;
NSInteger fPrice = self.payAmount%100;
if (fPrice == 0) {
str = [NSString stringWithFormat:@"%ld.00",iPrice];
}else if (fPrice<10) {
str = [NSString stringWithFormat:@"%ld.0%ld",iPrice,fPrice];
}else {
str = [NSString stringWithFormat:@"%ld.%ld",iPrice,fPrice];
}
return str;
}
- (NSString *)needPayStr {
NSString *str;
NSInteger iPrice = self.needPay/100;
NSInteger fPrice = self.needPay%100;
if (fPrice == 0) {
str = [NSString stringWithFormat:@"%ld.00",iPrice];
}else if (fPrice<10) {
str = [NSString stringWithFormat:@"%ld.0%ld",iPrice,fPrice];
}else {
str = [NSString stringWithFormat:@"%ld.%ld",iPrice,fPrice];
}
return str;
}
@end
//
// GMToFacePayPrepareModel.h
// Gengmei
//
// Created by zhouLiang on 2020/4/8.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
@import GMBase;
@protocol GMToFacePayCounsellorInfoModel @end
@interface GMToFacePayCounsellorInfoModel : GMObject
@property (nonatomic, copy) NSString *id;
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *cityName;
@property (nonatomic, copy) NSString *portrait;
@property (nonatomic, assign) NSInteger status;
@property (nonatomic, assign) NSInteger isAssistant;
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *practisingTime;
@property (nonatomic, copy) NSString *goodAt;
@property (nonatomic, assign) BOOL isFollow;
@property (nonatomic, assign) NSInteger userId;
@property (nonatomic, assign) NSInteger type;
@property (nonatomic, assign) NSInteger serviceFee;
@property (nonatomic, assign) NSInteger serviceFeeType;
@property (nonatomic, copy) NSString *hospitalName;
@end
@protocol GMToFacePayTypeModel @end
@interface GMToFacePayTypeModel : GMObject
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *desc;
@property (nonatomic, assign) BOOL recommend;
@property (nonatomic, copy) NSString *icon;
@end
@interface GMToFacePayPrepareModel : GMObject
/** 订单号 */
@property (nonatomic, copy) NSString *orderNo;
/** 订单状态 */
@property (nonatomic, assign) NSInteger orderStatus;
@property (nonatomic, copy) NSString *orderName;
/** 价格:单位分 */
@property (nonatomic, assign) NSInteger price;
@property (nonatomic, copy) NSString *priceStr;
/** 支付价格 */
@property (nonatomic, assign) NSInteger paymentAmount;
@property (nonatomic, copy) NSString *paymentAmountStr;
/** */
@property (nonatomic, assign) NSInteger needPay;
/** 支付方式 */
@property (nonatomic, strong) NSMutableArray <GMToFacePayTypeModel>*paymentChannels;
@property (nonatomic, strong) GMToFacePayCounsellorInfoModel *counsellorInfo;
@end
//
// GMToFacePayPrepareModel.m
// Gengmei
//
// Created by zhouLiang on 2020/4/8.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "GMToFacePayPrepareModel.h"
@implementation GMToFacePayCounsellorInfoModel
@end
@implementation GMToFacePayTypeModel
@end
@implementation GMToFacePayPrepareModel
- (NSString *)priceStr {
NSString *str;
NSInteger iPrice = self.price/100;
NSInteger fPrice = self.price%100;
if (fPrice == 0) {
str = [NSString stringWithFormat:@"%ld",iPrice];
}else if (fPrice<10) {
str = [NSString stringWithFormat:@"%ld.0%ld",iPrice,fPrice];
}else {
str = [NSString stringWithFormat:@"%ld.%ld",iPrice,fPrice];
}
return str;
}
- (NSString *)paymentAmountStr {
NSString *str;
NSInteger iPrice = self.paymentAmount/100;
NSInteger fPrice = self.paymentAmount%100;
if (fPrice == 0) {
str = [NSString stringWithFormat:@"%ld",iPrice];
}else if (fPrice<10) {
str = [NSString stringWithFormat:@"%ld.0%ld",iPrice,fPrice];
}else {
str = [NSString stringWithFormat:@"%ld.%ld",iPrice,fPrice];
}
return str;
}
@end
//
// GMPayTypeView.h
// Gengmei
//
// Created by zhouLiang on 2020/4/10.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "GMToFacePayPrepareModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface GMPayTypeView : UIView
@property (nonatomic, strong) GMToFacePayTypeModel *typeModel;
@property (nonatomic, assign) BOOL isSelected;
@end
NS_ASSUME_NONNULL_END
//
// GMPayTypeView.m
// Gengmei
//
// Created by zhouLiang on 2020/4/10.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "GMPayTypeView.h"
#import "GMLibraryHeader.h"
@interface GMPayTypeView ()
@property (strong, nonatomic) UIImageView *payWayImage;
@property (strong, nonatomic) GMLabel *payName;
@property (strong, nonatomic) GMLabel *payDesc;
/** 后面勾选的状态 */
@property (strong, nonatomic) GMButton *statusButton;
/** 推荐icon */
@property (strong, nonatomic) UIImageView *recommendIcon;
@end
@implementation GMPayTypeView
- (instancetype)init {
if (self = [super init]) {
[self setUI];
[self setLayout];
}
return self;
}
- (void)setTypeModel:(GMToFacePayTypeModel *)typeModel {
_typeModel = typeModel;
[self.payWayImage sd_setImageWithURL:[NSURL URLWithString:typeModel.icon]];
self.payDesc.text = typeModel.desc;
self.payName.text = typeModel.title;
self.payDesc.textColor = typeModel.recommend?RGBCOLOR_HEX(0xFF5963):RGBCOLOR_HEX(0x999999);
self.recommendIcon.hidden = !typeModel.recommend;
}
- (void)setIsSelected:(BOOL)isSelected {
self.statusButton.selected = isSelected;
}
- (void)setUI {
[self addSubview:self.payWayImage];
[self addSubview:self.payName];
[self addSubview:self.payDesc];
[self addSubview:self.statusButton];
[self addSubview:self.recommendIcon];
}
- (void)setLayout {
[self.payWayImage mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(40, 40));
make.centerY.mas_equalTo(0);
make.left.mas_equalTo(15);
}];
[self.payName mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.payWayImage.mas_right).offset(12);
make.top.equalTo(self.payWayImage.mas_top).offset(4);
make.height.mas_equalTo(15);
make.right.mas_equalTo(-100);
}];
[self.payDesc mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.payName.mas_left);
make.bottom.equalTo(self.payWayImage.mas_bottom).offset(-4);
make.height.mas_equalTo(13);
make.right.mas_equalTo(-100);
}];
[self.statusButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(18, 18));
make.centerY.equalTo(self.payWayImage.mas_centerY);
make.right.equalTo(self.mas_right).offset(-15);
}];
[self.recommendIcon mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(32, 16));
make.top.equalTo(self.statusButton.mas_top);
make.right.equalTo(self.statusButton.mas_left).offset(-18);
}];
}
- (UIImageView *)payWayImage {
if (!_payWayImage) {
_payWayImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"gm_pay_zhifubao"]];
}
return _payWayImage;
}
- (GMLabel *)payName {
if (!_payName) {
_payName = [GMLabel labelWithTextColor:RGBCOLOR_HEX(0x282828) fontSize:14];
_payName.text = @"支付宝支付";
}
return _payName;
}
- (GMLabel *)payDesc {
if (!_payDesc) {
_payDesc = [GMLabel labelWithTextColor:RGBCOLOR_HEX(0xFF5963) fontSize:12];
_payDesc.text = @"推荐使用支付宝支付";
}
return _payDesc;
}
- (UIImageView *)recommendIcon {
if (!_recommendIcon) {
_recommendIcon = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"pay_recommend"]];
}
return _recommendIcon;
}
- (GMButton *)statusButton {
if (!_statusButton) {
_statusButton = [GMButton buttonWithType:(UIButtonTypeCustom)];
[_statusButton setImage:[UIImage imageNamed:@"cart_huiduihao"] forState:(UIControlStateNormal)];
[_statusButton setImage:[UIImage imageNamed:@"cart_duihao"] forState:(UIControlStateSelected)];
}
return _statusButton;
}
@end
//
// GMSureOrderPopView.h
// Gengmei
//
// Created by zhouLiang on 2020/4/7.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "GMToFaceOrderInfoModel.h"
#import "GMLibraryHeader.h"
@interface GMSureOrderPopView : GMPopupBgView
/// 面诊 ID
@property (nonatomic, strong) GMToFaceOrderInfoModel *infoModel;
/// 面诊订单列表页可以关闭界面,面诊结束弹起的界面不可以
@property (nonatomic, assign) BOOL isCloseBtnHidden;
/**
* 确认订单完成(评价或者投诉也操作过),回传给h5,更改订单列表该订单的状态
* 目前只有面诊订单列表才用到此回调
*
* type : 0、只确认订单 1、只投诉 2、确认订单+评价
* desc : 评价描述
* star : 评价星级
*/
@property (nonatomic, copy) void(^completeCallBack)(NSInteger type, NSString *desc, NSInteger star);
/// 传递埋点参数
- (void)clickConfireBtnPhobo:(NSInteger)counsellorType consultationType:(NSInteger)consultationType doctorId:(NSString *)doctorId;
@end
This diff is collapsed.
//
// GMToFaceOrderFooterView.h
// Gengmei
//
// Created by zhouLiang on 2020/4/8.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "GMToFacePayPrepareModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface GMToFaceOrderFooterView : UIView
@property (nonatomic, assign) BOOL isCanClick;
@property (nonatomic, strong) GMToFacePayPrepareModel *model;
- (instancetype)initWithClickBlock:(void(^)(void))block;
@end
NS_ASSUME_NONNULL_END
//
// GMToFaceOrderFooterView.m
// Gengmei
//
// Created by zhouLiang on 2020/4/8.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "GMToFaceOrderFooterView.h"
@import GMBase;
@interface GMToFaceOrderFooterView ()
@property (nonatomic, strong) GMLabel *payNameLabel;
@property (nonatomic, strong) GMLabel *moneyLabel;
@property (nonatomic, strong) GMButton *payBtn;
@property (nonatomic, copy) void(^payBtnBlock)(void);
@end
@implementation GMToFaceOrderFooterView
- (instancetype)initWithClickBlock:(void (^)(void))block {
if (self = [super init]) {
self.payBtnBlock = block;
[self setUI];
[self setLayout];
self.backgroundColor = UIColor.whiteColor;
}
return self;
}
- (void)setIsCanClick:(BOOL)isCanClick {
self.payBtn.userInteractionEnabled = isCanClick;
}
- (void)setModel:(GMToFacePayPrepareModel *)model {
_model = model;
self.moneyLabel.text = [NSString stringWithFormat:@"¥%@",model.paymentAmountStr];
}
- (void)payBtnClick {
if (self.payBtnBlock) {
self.payBtnBlock();
}
}
- (void)setUI {
[self addSubview:self.payNameLabel];
[self addSubview:self.moneyLabel];
[self addSubview:self.payBtn];
}
- (void)setLayout {
[self.payNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(15);
make.top.mas_equalTo(18);
}];
[self.moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.payNameLabel.mas_right);
make.top.mas_equalTo(18);
}];
[self.payBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(112, 40));
make.top.mas_equalTo(5);
make.right.mas_equalTo(-15);
}];
}
- (GMLabel *)payNameLabel {
if (!_payNameLabel) {
_payNameLabel = [GMLabel labelWithTextColor:RGBCOLOR_HEX(0x282828) fontSize:14];
_payNameLabel.text = @"支付金额:";
}
return _payNameLabel;
}
- (GMLabel *)moneyLabel {
if (!_moneyLabel) {
_moneyLabel = [GMLabel labelWithTextColor:RGBCOLOR_HEX(0xFF8C8D) fontSize:14];
}
return _moneyLabel;
}
- (GMButton *)payBtn {
if (!_payBtn) {
_payBtn = [GMButton buttonWithType:(UIButtonTypeCustom)];
[_payBtn addTarget:self action:@selector(payBtnClick) forControlEvents:(UIControlEventTouchUpInside)];
[_payBtn setBackgroundColor:RGBCOLOR_HEX(0xFF8C8D) forState:(UIControlStateNormal)];
[_payBtn setTitle:@"立即支付" forState:(UIControlStateNormal)];
[_payBtn.titleLabel setFont:[UIFont gmBoldFont:16]];
_payBtn.layer.cornerRadius = 20.f;
_payBtn.layer.masksToBounds = YES;
}
return _payBtn;
}
@end
//
// GMToFaceOrderHeaderView.h
// Gengmei
//
// Created by zhouLiang on 2020/4/7.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "GMToFacePayPrepareModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface GMToFaceOrderHeaderView : UIView
@property (nonatomic, strong) GMToFacePayPrepareModel *model;
@end
NS_ASSUME_NONNULL_END
//
// GMToFaceOrderHeaderView.m
// Gengmei
//
// Created by zhouLiang on 2020/4/7.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "GMToFaceOrderHeaderView.h"
#import "GMLibraryHeader.h"
@interface GMToFaceOrderHeaderView ()
@property (nonatomic, strong) UIImageView *headerIcon;
@property (nonatomic, strong) GMLabel *titleLabel;
@property (nonatomic, strong) GMLabel *organizationLabel;
@property (nonatomic, strong) GMLabel *moneyLabel;
@property (nonatomic, strong) GMLabel *payLabel;
@end
@implementation GMToFaceOrderHeaderView
- (instancetype)init {
if (self = [super init]) {
[self setUI];
[self setLayout];
}
return self;
}
- (void)setModel:(GMToFacePayPrepareModel *)model {
_model = model;
[self.headerIcon sd_setImageWithURL:[NSURL URLWithString:SafeString(model.counsellorInfo.portrait)]];
self.titleLabel.text = model.orderName;
self.organizationLabel.text = [NSString stringWithFormat:@"机构:%@",model.counsellorInfo.hospitalName];
self.payLabel.text = [NSString stringWithFormat:@"¥%@/单",model.priceStr];
NSRange range = [self.payLabel.text rangeOfString:@"/"];
range = NSMakeRange(range.location, self.payLabel.text.length - range.location);
NSMutableAttributedString *attribute = [[NSMutableAttributedString alloc] initWithString:self.payLabel.text];
[attribute addAttributes:@{NSForegroundColorAttributeName : RGBCOLOR_HEX(0x999999) } range:range];
[attribute addAttributes:@{NSFontAttributeName : [UIFont gmFont:10]} range:NSMakeRange(0, 1)];
self.payLabel.attributedText = attribute;
}
- (void)setUI {
[self addSubview:self.headerIcon];
[self addSubview:self.titleLabel];
[self addSubview:self.organizationLabel];
[self addSubview:self.moneyLabel];
[self addSubview:self.payLabel];
}
- (void)setLayout {
[self.headerIcon mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(70, 70));
make.left.mas_equalTo(15);
make.top.mas_equalTo(16);
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.headerIcon.mas_top).offset(-5.5);
make.left.equalTo(self.headerIcon.mas_right);
make.height.mas_equalTo(19);
make.right.mas_equalTo(-10);
}];
[self.organizationLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.headerIcon.mas_right).offset(9);
make.top.equalTo(self.titleLabel.mas_bottom).offset(12);
make.height.mas_equalTo(15);
make.right.mas_equalTo(-10);
}];
[self.moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.headerIcon.mas_right).offset(9);
make.bottom.equalTo(self.mas_bottom).offset(-20);
make.height.mas_equalTo(12);
}];
[self.payLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.moneyLabel.mas_right);
make.height.mas_equalTo(18);
make.bottom.equalTo(self.moneyLabel.mas_bottom).offset(1);
}];
}
- (UIImageView *)headerIcon {
if (!_headerIcon) {
_headerIcon = [[UIImageView alloc] init];
_headerIcon.backgroundColor = UIColor.orangeColor;
_headerIcon.layer.cornerRadius = 35.f;
_headerIcon.layer.masksToBounds = YES;
_headerIcon.contentMode = UIViewContentModeScaleAspectFill;
}
return _headerIcon;
}
- (GMLabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [GMLabel labelWithTextColor:RGBCOLOR_HEX(0x282828) fontSize:17];
}
return _titleLabel;
}
- (GMLabel *)organizationLabel {
if (!_organizationLabel) {
_organizationLabel = [GMLabel labelWithTextColor:RGBCOLOR_HEX(0x999999) fontSize:13];
}
return _organizationLabel;
}
- (GMLabel *)moneyLabel {
if (!_moneyLabel) {
_moneyLabel = [GMLabel labelWithTextColor:RGBCOLOR_HEX(0x999999) fontSize:10];
_moneyLabel.text = @"金额:";
}
return _moneyLabel;
}
- (GMLabel *)payLabel {
if (!_payLabel) {
_payLabel = [GMLabel labelWithTextColor:RGBCOLOR_HEX(0xFF5963) fontSize:16];
}
return _payLabel;
}
@end
//
// GMToFacePayPopView.h
// Gengmei
//
// Created by zhouLiang on 2020/4/10.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "GMToFacePayPrepareModel.h"
@interface GMToFacePayPopView : GMPopupBgView
@property (nonatomic, strong) GMToFacePayPrepareModel *orderModel;
/** 医生类型 */
@property (nonatomic, assign) NSInteger counsellorType;
/** 支付成功,回调到信息卡页面去发起派单 */
@property (nonatomic, copy) void(^PaySuccessBlock)(void);
/** 右上键的×关闭view */
@property (nonatomic, copy) void(^CloseView)(void);
@end
This diff is collapsed.
//
// GMToFacePaySectionHeaderView.h
// Gengmei
//
// Created by zhouLiang on 2020/4/7.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface GMToFacePaySectionHeaderView : UIView
@end
NS_ASSUME_NONNULL_END
//
// GMToFacePaySectionHeaderView.m
// Gengmei
//
// Created by zhouLiang on 2020/4/7.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "GMToFacePaySectionHeaderView.h"
@import GMKit;
@interface GMToFacePaySectionHeaderView ()
@property (nonatomic, strong) UIView *labelView;
@property (nonatomic, strong) UIView *lineView;
@property (nonatomic, strong) UIView *grayView;
@end
@implementation GMToFacePaySectionHeaderView
- (instancetype)init {
if (self = [super init]) {
[self setUI];
self.backgroundColor = UIColor.whiteColor;
}
return self;
}
- (void)setUI {
[self addSubview:self.grayView];
[self addSubview:self.labelView];
[self addSubview:self.lineView];
[self.grayView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.top.right.mas_equalTo(0);
make.height.mas_equalTo(5);
}];
[self.labelView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(0);
make.top.equalTo(self.grayView.mas_bottom);
make.height.mas_equalTo(45);
}];
[self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(0.5);
make.left.mas_equalTo(15);
make.right.mas_equalTo(-15);
make.top.equalTo(self.labelView.mas_bottom);
}];
}
- (UIView *)grayView {
if (!_grayView) {
_grayView = [[UIView alloc] init];
_grayView.backgroundColor = RGBCOLOR_HEX(0xF7F6FA);
}
return _grayView;
}
- (UIView *)lineView {
if (!_lineView) {
_lineView = [[UIView alloc] init];
_lineView.backgroundColor = RGBCOLOR_HEX(0xE5E5E5);
}
return _lineView;
}
- (UIView *)labelView {
if (!_labelView) {
_labelView = [[UIView alloc] init];
GMLabel *label = [GMLabel labelWithTextColor:RGBCOLOR_HEX(0x282828) fontSize:15];
label.text = @"请选择支付方式";
[_labelView addSubview:label];
[label mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(0);
make.left.mas_equalTo(15);
}];
}
return _labelView;
}
@end
//
// GMToFacePayTypeCell.h
// Gengmei
//
// Created by zhouLiang on 2020/4/8.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "GMToFacePayPrepareModel.h"
@interface GMToFacePayTypeCell : GMTableViewCell
@property (nonatomic, strong) GMToFacePayTypeModel *typeModel;
@end
//
// GMToFacePayTypeCell.m
// Gengmei
//
// Created by zhouLiang on 2020/4/8.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "GMToFacePayTypeCell.h"
@import GMBase;
@import SDWebImage;
@interface GMToFacePayTypeCell ()
@property (strong, nonatomic) UIImageView *payWayImage;
@property (strong, nonatomic) GMLabel *payName;
@property (strong, nonatomic) GMLabel *payDesc;
/** 后面勾选的状态 */
@property (strong, nonatomic) UIImageView *statusIcon;
/** 推荐icon */
@property (strong, nonatomic) UIImageView *recommendIcon;
@end
@implementation GMToFacePayTypeCell
- (void)setup {
[super setup];
[self setUI];
self.bottomLine.hidden = YES;
}
- (void)setTypeModel:(GMToFacePayTypeModel *)typeModel {
_typeModel = typeModel;
[self.payWayImage sd_setImageWithURL:[NSURL URLWithString:typeModel.icon]];
self.payDesc.text = typeModel.desc;
self.payName.text = typeModel.title;
self.payDesc.textColor = typeModel.recommend?RGBCOLOR_HEX(0xFF5963):RGBCOLOR_HEX(0x999999);
self.recommendIcon.hidden = !typeModel.recommend;
}
- (void)setUI {
[self.contentView addSubview:self.payWayImage];
[self.contentView addSubview:self.payName];
[self.contentView addSubview:self.payDesc];
[self.contentView addSubview:self.statusIcon];
[self.contentView addSubview:self.recommendIcon];
}
- (void)cellConstraints {
[self.payWayImage mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(40, 40));
make.bottom.mas_equalTo(0);
make.left.mas_equalTo(15);
make.top.mas_equalTo(20);
}];
[self.payName mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.payWayImage.mas_right).offset(12);
make.top.equalTo(self.payWayImage.mas_top).offset(4);
make.height.mas_equalTo(15);
make.right.mas_equalTo(-100);
}];
[self.payDesc mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.payName.mas_left);
make.bottom.equalTo(self.payWayImage.mas_bottom).offset(-4);
make.height.mas_equalTo(13);
make.right.mas_equalTo(-100);
}];
[self.statusIcon mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(18, 18));
make.centerY.equalTo(self.payWayImage.mas_centerY);
make.right.equalTo(self.contentView.mas_right).offset(-15);
}];
[self.recommendIcon mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(32, 16));
make.top.equalTo(self.statusIcon.mas_top);
make.right.equalTo(self.statusIcon.mas_left).offset(-18);
}];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
self.statusIcon.highlighted = selected;
}
- (UIImageView *)payWayImage {
if (!_payWayImage) {
_payWayImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"gm_pay_zhifubao"]];
}
return _payWayImage;
}
- (GMLabel *)payName {
if (!_payName) {
_payName = [GMLabel labelWithTextColor:RGBCOLOR_HEX(0x282828) fontSize:14];
}
return _payName;
}
- (GMLabel *)payDesc {
if (!_payDesc) {
_payDesc = [GMLabel labelWithTextColor:RGBCOLOR_HEX(0xFF5963) fontSize:12];
}
return _payDesc;
}
- (UIImageView *)recommendIcon {
if (!_recommendIcon) {
_recommendIcon = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"pay_recommend"]];
}
return _recommendIcon;
}
- (UIImageView *)statusIcon {
if (!_statusIcon) {
_statusIcon = [[UIImageView alloc] init];
_statusIcon.highlightedImage = [UIImage imageNamed:@"cart_duihao"];
_statusIcon.image = [UIImage imageNamed:@"cart_huiduihao"];
}
return _statusIcon;
}
@end
//
// GMToFaceOrderViewController.h
// Gengmei
//
// Created by zhouLiang on 2020/4/7.
// Copyright © 2020 更美互动信息科技有限公司. All rights reserved.
//
#import "GMToFacePayPrepareModel.h"
@interface GMToFaceOrderViewController : WMBaseListViewController
@property (nonatomic, strong) GMToFacePayPrepareModel *orderModel;
@property (nonatomic, copy) void(^PaySuccessBlock)(NSString *referer);
/** 医生id */
@property (nonatomic, copy) NSString *counsellorId;
/** 类型 */
@property (nonatomic, assign) NSInteger counsellorType;
@end
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment