Commit 7b02401cd8df50c08478e089fcdf2dd0bcc86ae1
1 parent
f49732e4
no message
Showing
120 changed files
with
1102 additions
and
26 deletions
CNLiveMineModule.podspec
| @@ -54,13 +54,19 @@ TODO: 网家家-我的模块. | @@ -54,13 +54,19 @@ TODO: 网家家-我的模块. | ||
| 54 | end | 54 | end |
| 55 | 55 | ||
| 56 | s.resource_bundles = { | 56 | s.resource_bundles = { |
| 57 | - 'CNLiveMineModule' => ['CNLiveMineModule/Assets/Images.xcassets'] | 57 | + 'CNLiveMineModule' => ['CNLiveMineModule/Assets/CNLiveMineModule.xcassets'] |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | # s.public_header_files = 'Pod/Classes/**/*.h' | 60 | # s.public_header_files = 'Pod/Classes/**/*.h' |
| 61 | # s.frameworks = 'UIKit', 'MapKit' | 61 | # s.frameworks = 'UIKit', 'MapKit' |
| 62 | # s.dependency 'AFNetworking', '~> 2.3' | 62 | # s.dependency 'AFNetworking', '~> 2.3' |
| 63 | 63 | ||
| 64 | + # pod | ||
| 65 | + s.dependency 'CNLiveTripartiteManagement/QMUIKit' | ||
| 66 | + s.dependency 'CNLiveTripartiteManagement/SDWebImage' | ||
| 67 | + s.dependency 'CNLiveTripartiteManagement/Masonry' | ||
| 68 | + s.dependency 'CNLiveTripartiteManagement/MJExtension' | ||
| 69 | + | ||
| 64 | # 服务层 | 70 | # 服务层 |
| 65 | s.dependency 'CNLiveServices' | 71 | s.dependency 'CNLiveServices' |
| 66 | 72 |
CNLiveMineModule/Assets/Images.xcassets/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/Contents.json
CNLiveMineModule/Assets/Images.xcassets/code_refresh.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/code_refresh.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/code_refresh.imageset/code_refresh@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/code_refresh.imageset/code_refresh@2x.png
1.46 KB
CNLiveMineModule/Assets/Images.xcassets/code_refresh.imageset/code_refresh@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/code_refresh.imageset/code_refresh@3x.png
2.57 KB
CNLiveMineModule/Assets/Images.xcassets/default_avatar_f.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/default_avatar_f.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/default_avatar_f.imageset/default_avatar_f.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/default_avatar_f.imageset/default_avatar_f.png
11.1 KB
CNLiveMineModule/Assets/Images.xcassets/default_avatar_y.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/default_avatar_y.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/default_avatar_y.imageset/default_avatar_y.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/default_avatar_y.imageset/default_avatar_y.png
10.7 KB
CNLiveMineModule/Assets/Images.xcassets/flashlight_close.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/flashlight_close.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/flashlight_close.imageset/flashlight_close@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/flashlight_close.imageset/flashlight_close@2x.png
1.29 KB
CNLiveMineModule/Assets/Images.xcassets/flashlight_close.imageset/flashlight_close@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/flashlight_close.imageset/flashlight_close@3x.png
1.41 KB
CNLiveMineModule/Assets/Images.xcassets/flashlight_open.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/flashlight_open.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/flashlight_open.imageset/flashlight_open@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/flashlight_open.imageset/flashlight_open@2x.png
1.34 KB
CNLiveMineModule/Assets/Images.xcassets/flashlight_open.imageset/flashlight_open@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/flashlight_open.imageset/flashlight_open@3x.png
1.52 KB
CNLiveMineModule/Assets/Images.xcassets/mine_activity.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_activity.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_activity.imageset/mine_activity@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_activity.imageset/mine_activity@2x.png
2.73 KB
CNLiveMineModule/Assets/Images.xcassets/mine_activity.imageset/mine_activity@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_activity.imageset/mine_activity@3x.png
6.3 KB
CNLiveMineModule/Assets/Images.xcassets/mine_address.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_address.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_address.imageset/mine_address@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_address.imageset/mine_address@2x.png
2.89 KB
CNLiveMineModule/Assets/Images.xcassets/mine_address.imageset/mine_address@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_address.imageset/mine_address@3x.png
5.49 KB
CNLiveMineModule/Assets/Images.xcassets/mine_back_white_b.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_back_white_b.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_back_white_b.imageset/mine_back_white_b@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_back_white_b.imageset/mine_back_white_b@2x.png
2.03 KB
CNLiveMineModule/Assets/Images.xcassets/mine_back_white_b.imageset/mine_back_white_b@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_back_white_b.imageset/mine_back_white_b@3x.png
2.28 KB
CNLiveMineModule/Assets/Images.xcassets/mine_bg.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_bg.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_bg.imageset/mine_bg@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_bg.imageset/mine_bg@2x.png
25.9 KB
CNLiveMineModule/Assets/Images.xcassets/mine_bg.imageset/mine_bg@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_bg.imageset/mine_bg@3x.png
50.7 KB
CNLiveMineModule/Assets/Images.xcassets/mine_buy_commodity.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_buy_commodity.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_buy_commodity.imageset/mine_buy_commodity@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_buy_commodity.imageset/mine_buy_commodity@2x.png
1.71 KB
CNLiveMineModule/Assets/Images.xcassets/mine_buy_commodity.imageset/mine_buy_commodity@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_buy_commodity.imageset/mine_buy_commodity@3x.png
3.16 KB
CNLiveMineModule/Assets/Images.xcassets/mine_card.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_card.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_card.imageset/mine_card@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_card.imageset/mine_card@2x.png
2.48 KB
CNLiveMineModule/Assets/Images.xcassets/mine_card.imageset/mine_card@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_card.imageset/mine_card@3x.png
4.57 KB
CNLiveMineModule/Assets/Images.xcassets/mine_china_sport.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_china_sport.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_china_sport.imageset/mine_china_sport@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_china_sport.imageset/mine_china_sport@2x.png
2.83 KB
CNLiveMineModule/Assets/Images.xcassets/mine_china_sport.imageset/mine_china_sport@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_china_sport.imageset/mine_china_sport@3x.png
6.34 KB
CNLiveMineModule/Assets/Images.xcassets/mine_code.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_code.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_code.imageset/mine_code@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_code.imageset/mine_code@2x.png
1.06 KB
CNLiveMineModule/Assets/Images.xcassets/mine_code.imageset/mine_code@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_code.imageset/mine_code@3x.png
2.03 KB
CNLiveMineModule/Assets/Images.xcassets/mine_code_more.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_code_more.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_code_more.imageset/mine_code_more@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_code_more.imageset/mine_code_more@2x.png
205 Bytes
CNLiveMineModule/Assets/Images.xcassets/mine_code_more.imageset/mine_code_more@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_code_more.imageset/mine_code_more@3x.png
962 Bytes
CNLiveMineModule/Assets/Images.xcassets/mine_common.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_common.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_common.imageset/mine_common@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_common.imageset/mine_common@2x.png
2.14 KB
CNLiveMineModule/Assets/Images.xcassets/mine_common.imageset/mine_common@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_common.imageset/mine_common@3x.png
4.11 KB
CNLiveMineModule/Assets/Images.xcassets/mine_e-ticket.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_e-ticket.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_e-ticket.imageset/mine_e-ticket@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_e-ticket.imageset/mine_e-ticket@2x.png
5.94 KB
CNLiveMineModule/Assets/Images.xcassets/mine_e-ticket.imageset/mine_e-ticket@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_e-ticket.imageset/mine_e-ticket@3x.png
11.8 KB
CNLiveMineModule/Assets/Images.xcassets/mine_evaluate.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_evaluate.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_evaluate.imageset/mine_evaluate@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_evaluate.imageset/mine_evaluate@2x.png
2.09 KB
CNLiveMineModule/Assets/Images.xcassets/mine_evaluate.imageset/mine_evaluate@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_evaluate.imageset/mine_evaluate@3x.png
4.1 KB
CNLiveMineModule/Assets/Images.xcassets/mine_front.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_front.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_front.imageset/mine_front@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_front.imageset/mine_front@2x.png
266 Bytes
CNLiveMineModule/Assets/Images.xcassets/mine_front.imageset/mine_front@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_front.imageset/mine_front@3x.png
615 Bytes
CNLiveMineModule/Assets/Images.xcassets/mine_invitation.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_invitation.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_invitation.imageset/mine_invitation@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_invitation.imageset/mine_invitation@2x.png
2.6 KB
CNLiveMineModule/Assets/Images.xcassets/mine_invitation.imageset/mine_invitation@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_invitation.imageset/mine_invitation@3x.png
4.99 KB
CNLiveMineModule/Assets/Images.xcassets/mine_like.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_like.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_like.imageset/mine_like@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_like.imageset/mine_like@2x.png
2.51 KB
CNLiveMineModule/Assets/Images.xcassets/mine_like.imageset/mine_like@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_like.imageset/mine_like@3x.png
4.95 KB
CNLiveMineModule/Assets/Images.xcassets/mine_location.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_location.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_location.imageset/mine_location@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_location.imageset/mine_location@2x.png
767 Bytes
CNLiveMineModule/Assets/Images.xcassets/mine_location.imageset/mine_location@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_location.imageset/mine_location@3x.png
1.47 KB
CNLiveMineModule/Assets/Images.xcassets/mine_observer.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_observer.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_observer.imageset/mine_observer@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_observer.imageset/mine_observer@2x.png
68.8 KB
CNLiveMineModule/Assets/Images.xcassets/mine_order.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_order.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_order.imageset/mine_order@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_order.imageset/mine_order@2x.png
623 Bytes
CNLiveMineModule/Assets/Images.xcassets/mine_order.imageset/mine_order@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_order.imageset/mine_order@3x.png
1.38 KB
CNLiveMineModule/Assets/Images.xcassets/mine_overbadge.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_overbadge.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_overbadge.imageset/mine_overbadge@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_overbadge.imageset/mine_overbadge@2x.png
1.91 KB
CNLiveMineModule/Assets/Images.xcassets/mine_overbadge.imageset/mine_overbadge@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_overbadge.imageset/mine_overbadge@3x.png
3.61 KB
CNLiveMineModule/Assets/Images.xcassets/mine_pending.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_pending.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_pending.imageset/mine_pending@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_pending.imageset/mine_pending@2x.png
732 Bytes
CNLiveMineModule/Assets/Images.xcassets/mine_pending.imageset/mine_pending@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_pending.imageset/mine_pending@3x.png
1.38 KB
CNLiveMineModule/Assets/Images.xcassets/mine_received.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_received.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_received.imageset/mine_received@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_received.imageset/mine_received@2x.png
2.33 KB
CNLiveMineModule/Assets/Images.xcassets/mine_received.imageset/mine_received@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_received.imageset/mine_received@3x.png
4.88 KB
CNLiveMineModule/Assets/Images.xcassets/mine_record.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_record.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_record.imageset/mine_record@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_record.imageset/mine_record@2x.png
2.31 KB
CNLiveMineModule/Assets/Images.xcassets/mine_record.imageset/mine_record@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_record.imageset/mine_record@3x.png
6.51 KB
CNLiveMineModule/Assets/Images.xcassets/mine_refund.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_refund.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_refund.imageset/mine_refund@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_refund.imageset/mine_refund@2x.png
3.32 KB
CNLiveMineModule/Assets/Images.xcassets/mine_refund.imageset/mine_refund@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_refund.imageset/mine_refund@3x.png
6.67 KB
CNLiveMineModule/Assets/Images.xcassets/mine_release.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_release.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_release.imageset/mine_release@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_release.imageset/mine_release@2x.png
1.61 KB
CNLiveMineModule/Assets/Images.xcassets/mine_release.imageset/mine_release@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_release.imageset/mine_release@3x.png
3.1 KB
CNLiveMineModule/Assets/Images.xcassets/mine_set.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_set.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_set.imageset/mine_set@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_set.imageset/mine_set@2x.png
2.83 KB
CNLiveMineModule/Assets/Images.xcassets/mine_set.imageset/mine_set@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_set.imageset/mine_set@3x.png
5.77 KB
CNLiveMineModule/Assets/Images.xcassets/mine_soccer_task.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_soccer_task.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_soccer_task.imageset/mine_soccer_task@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_soccer_task.imageset/mine_soccer_task@2x.png
30 KB
CNLiveMineModule/Assets/Images.xcassets/mine_soccer_task.imageset/mine_soccer_task@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_soccer_task.imageset/mine_soccer_task@3x.png
67.4 KB
CNLiveMineModule/Assets/Images.xcassets/mine_tool_map.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_tool_map.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_tool_map.imageset/mine_tool_map@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_tool_map.imageset/mine_tool_map@2x.png
2.73 KB
CNLiveMineModule/Assets/Images.xcassets/mine_tool_map.imageset/mine_tool_map@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_tool_map.imageset/mine_tool_map@3x.png
7.13 KB
CNLiveMineModule/Assets/Images.xcassets/mine_wjj_certification.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_wjj_certification.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/mine_wjj_certification.imageset/mine_wjj_certification@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_wjj_certification.imageset/mine_wjj_certification@2x.png
6.92 KB
CNLiveMineModule/Assets/Images.xcassets/mine_wjj_certification.imageset/mine_wjj_certification@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/mine_wjj_certification.imageset/mine_wjj_certification@3x.png
15.1 KB
CNLiveMineModule/Assets/Images.xcassets/qr_code_bg.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/qr_code_bg.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/qr_code_bg.imageset/qr_code_bg@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/qr_code_bg.imageset/qr_code_bg@2x.png
104 KB
CNLiveMineModule/Assets/Images.xcassets/qr_code_bg.imageset/qr_code_bg@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/qr_code_bg.imageset/qr_code_bg@3x.png
142 KB
CNLiveMineModule/Assets/Images.xcassets/qr_code_green.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/qr_code_green.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/qr_code_green.imageset/qr_code_green@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/qr_code_green.imageset/qr_code_green@2x.png
1.57 KB
CNLiveMineModule/Assets/Images.xcassets/qr_code_green.imageset/qr_code_green@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/qr_code_green.imageset/qr_code_green@3x.png
1.72 KB
CNLiveMineModule/Assets/Images.xcassets/qr_code_icon.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/qr_code_icon.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/qr_code_icon.imageset/qr_code_icon@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/qr_code_icon.imageset/qr_code_icon@2x.png
7.47 KB
CNLiveMineModule/Assets/Images.xcassets/qr_code_icon.imageset/qr_code_icon@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/qr_code_icon.imageset/qr_code_icon@3x.png
11.1 KB
CNLiveMineModule/Assets/Images.xcassets/sign_in_soccer.imageset/Contents.json renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/sign_in_soccer.imageset/Contents.json
CNLiveMineModule/Assets/Images.xcassets/sign_in_soccer.imageset/sign_in_soccer@2x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/sign_in_soccer.imageset/sign_in_soccer@2x.png
1.64 KB
CNLiveMineModule/Assets/Images.xcassets/sign_in_soccer.imageset/sign_in_soccer@3x.png renamed to CNLiveMineModule/Assets/CNLiveMineModule.xcassets/sign_in_soccer.imageset/sign_in_soccer@3x.png
4.54 KB
CNLiveMineModule/Classes/Controller/CNLiveMineController.m
| @@ -8,13 +8,339 @@ | @@ -8,13 +8,339 @@ | ||
| 8 | 8 | ||
| 9 | #import "CNLiveMineController.h" | 9 | #import "CNLiveMineController.h" |
| 10 | 10 | ||
| 11 | -@interface CNLiveMineController() | 11 | +#import "MJExtension.h" |
| 12 | +#import "QMUIKit.h" | ||
| 13 | + | ||
| 14 | +#import "CNLiveMineHeaderView.h" | ||
| 15 | +#import "CNLiveMineCell.h" | ||
| 16 | +#import "CNLiveMineModel.h" | ||
| 17 | + | ||
| 18 | +// HexColor(0x333333) | ||
| 19 | +#define HexColor(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] | ||
| 20 | + | ||
| 21 | +@interface CNLiveMineController()<UITableViewDelegate, UITableViewDataSource, CNLiveMineHeaderViewDelegate, CNLiveMineCellDelegate> | ||
| 22 | +@property (nonatomic, strong) UITableView *tableView; | ||
| 23 | +@property (nonatomic, weak) CNLiveMineHeaderView *headerView; | ||
| 24 | +@property (nonatomic, strong) UIButton *soccerBtn; | ||
| 25 | +@property (nonatomic, strong) NSMutableArray *data; | ||
| 12 | 26 | ||
| 13 | @end | 27 | @end |
| 14 | 28 | ||
| 15 | @implementation CNLiveMineController | 29 | @implementation CNLiveMineController |
| 16 | -- (void)viewDidLoad{ | 30 | +static const NSInteger kHEIGHT = 240; |
| 31 | + | ||
| 32 | +#pragma mark - 加载数据 | ||
| 33 | +- (void)loadData { | ||
| 34 | + NSArray *data = @[ | ||
| 35 | + @{ | ||
| 36 | + @"name":@"我的订单", | ||
| 37 | + @"style":@"1", | ||
| 38 | + @"margin":@"10", | ||
| 39 | + @"titles":@[@"订单", @"待付款", @"待收货",@"待评价",@"售后"], | ||
| 40 | + @"images":@[@"mine_order",@"mine_pending",@"mine_received",@"mine_evaluate",@"mine_refund"] | ||
| 41 | + }, | ||
| 42 | + | ||
| 43 | + @{ | ||
| 44 | + @"name":@"常用工具", | ||
| 45 | + @"style":@"2", | ||
| 46 | + @"margin":@"10", | ||
| 47 | + @"titles": @[@"收货地址", @"余额", @"我的收藏",@"发布记录",@"邀请好友",@"设置",@"路径工具"], @"images":@[@"mine_address",@"mine_card",@"mine_like",@"mine_release",@"mine_invitation",@"mine_set",@"mine_tool_map"] | ||
| 48 | + }, | ||
| 49 | + @{ | ||
| 50 | + @"name":@"购买的商品", | ||
| 51 | + @"pic":@"mine_buy_commodity", | ||
| 52 | + @"style":@"3", | ||
| 53 | + @"margin":@"10", | ||
| 54 | + @"titles": @[@"电子票"], | ||
| 55 | + @"images":@[@"mine_e-ticket"] | ||
| 56 | + | ||
| 57 | + }, | ||
| 58 | + @{ | ||
| 59 | + @"name":@"大众体育", | ||
| 60 | + @"pic":@"mine_china_sport", | ||
| 61 | + @"style":@"4", | ||
| 62 | + @"margin":@"10", | ||
| 63 | + @"titles": @[@"我的活动", @"我的记录"], @"images":@[@"mine_activity",@"mine_record"] | ||
| 64 | + | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + ]; | ||
| 68 | + for(NSDictionary *dic in data){ | ||
| 69 | + [self.data addObject:[CNLiveMineModel mj_objectWithKeyValues:dic]]; | ||
| 70 | + } | ||
| 71 | + [self.tableView reloadData]; | ||
| 72 | + | ||
| 73 | +} | ||
| 74 | + | ||
| 75 | +#pragma mark - 生命周期 | ||
| 76 | +- (void)viewWillAppear:(BOOL)animated{ | ||
| 77 | + [super viewWillAppear:animated]; | ||
| 78 | + self.navigationController.navigationBarHidden = YES; | ||
| 79 | + | ||
| 80 | + if(self.headerView){ | ||
| 81 | + self.headerView.frame = CGRectMake(0, -kHEIGHT, SCREEN_WIDTH, kHEIGHT); | ||
| 82 | + } | ||
| 83 | + if(self.soccerBtn){ | ||
| 84 | + self.soccerBtn.frame = CGRectMake(SCREEN_WIDTH-67-10, SCREEN_HEIGHT-71-10-TabBarHeight, 67, 71); | ||
| 85 | + } | ||
| 86 | +} | ||
| 87 | + | ||
| 88 | +- (void)viewDidLoad { | ||
| 17 | [super viewDidLoad]; | 89 | [super viewDidLoad]; |
| 90 | + self.view.backgroundColor = HexColor(0xf4f4f4); | ||
| 91 | + if (@available(iOS 11, *)) { | ||
| 92 | + self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; | ||
| 93 | + } | ||
| 94 | + else { | ||
| 95 | + self.automaticallyAdjustsScrollViewInsets = NO; | ||
| 96 | + } | ||
| 97 | + [self createSubViews]; | ||
| 98 | + [self loadData]; | ||
| 99 | + | ||
| 100 | +} | ||
| 101 | + | ||
| 102 | +- (void)dealloc { | ||
| 103 | + | ||
| 104 | + | ||
| 105 | +} | ||
| 106 | + | ||
| 107 | +- (void)createSubViews { | ||
| 108 | + [self.view addSubview:self.tableView]; | ||
| 109 | + CNLiveMineHeaderView *headerView = [[CNLiveMineHeaderView alloc]initWithFrame:CGRectMake(0, -kHEIGHT, SCREEN_WIDTH, kHEIGHT)]; | ||
| 110 | + headerView.delegate = self; | ||
| 111 | + headerView.tag = 666; | ||
| 112 | + [self.tableView addSubview:headerView]; | ||
| 113 | + self.headerView = headerView; | ||
| 114 | + [self.view addSubview:self.soccerBtn]; | ||
| 115 | + | ||
| 116 | +} | ||
| 117 | + | ||
| 118 | +#pragma mark - UITableViewDelegate | ||
| 119 | +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ | ||
| 120 | + CNLiveMineModel *model = self.data[indexPath.row]; | ||
| 121 | + return model.height; | ||
| 122 | + | ||
| 123 | +} | ||
| 124 | + | ||
| 125 | +#pragma mark - UITableViewDataSource | ||
| 126 | +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { | ||
| 127 | + return self.data.count; | ||
| 128 | +} | ||
| 129 | + | ||
| 130 | +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | ||
| 131 | + CNLiveMineCell *cell = [tableView dequeueReusableCellWithIdentifier:kCNLiveMineCell]; | ||
| 132 | + cell.selectionStyle = UITableViewCellSelectionStyleNone; | ||
| 133 | + CNLiveMineModel *model = self.data[indexPath.row]; | ||
| 134 | + cell.model = model; | ||
| 135 | + cell.delegate = self; | ||
| 136 | + return cell; | ||
| 137 | +} | ||
| 138 | + | ||
| 139 | +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ | ||
| 140 | + | ||
| 141 | +} | ||
| 142 | +#pragma mark - CNLiveMineHeaderViewDelegate | ||
| 143 | +- (void)headerView:(CNLiveMineHeaderView *)headerView pushToController:(CNLiveMineHeaderViewType)type{ | ||
| 144 | + switch (type) { | ||
| 145 | + case CNLiveMineHeaderViewTypeUerInfo: | ||
| 146 | + { | ||
| 147 | +// XWUserInfoController *vc = [[XWUserInfoController alloc]init]; | ||
| 148 | +// [self.navigationController pushViewController:vc animated:YES]; | ||
| 149 | + } | ||
| 150 | + break; | ||
| 151 | + case CNLiveMineHeaderViewTypeCode: | ||
| 152 | + { | ||
| 153 | +// CNLiveMineQrCodeController *vc = [[CNLiveMineQrCodeController alloc]init]; | ||
| 154 | +// [self.navigationController pushViewController:vc animated:YES]; | ||
| 155 | + } | ||
| 156 | + break; | ||
| 157 | + case CNLiveMineHeaderViewTypeWintess: | ||
| 158 | + { | ||
| 159 | +// XWAddressController *vc = [[XWAddressController alloc]init]; | ||
| 160 | +// [self.navigationController pushViewController:vc animated:YES]; | ||
| 161 | + } | ||
| 162 | + break; | ||
| 163 | + | ||
| 164 | + default: | ||
| 165 | + break; | ||
| 166 | + } | ||
| 167 | +} | ||
| 168 | +- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView{ | ||
| 169 | + [UIView animateWithDuration: 0.5 animations: ^{ | ||
| 170 | +// self.soccerBtn.x = SCREEN_WIDTH+10; | ||
| 171 | + } completion: nil]; | ||
| 172 | + | ||
| 173 | +} | ||
| 174 | +- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{ | ||
| 175 | + [UIView animateWithDuration: 0.5 animations: ^{ | ||
| 176 | +// self.soccerBtn.x = SCREEN_WIDTH-67-10; | ||
| 177 | + } completion: nil]; | ||
| 178 | + | ||
| 179 | +} | ||
| 180 | +- (void)scrollViewDidScroll:(UIScrollView *)scrollView { | ||
| 181 | + CGPoint point = scrollView.contentOffset; | ||
| 182 | + if (point.y < -kHEIGHT) { | ||
| 183 | + CGRect rect = [self.tableView viewWithTag:666].frame; | ||
| 184 | + rect.origin.y = point.y; | ||
| 185 | + rect.size.height = -point.y; | ||
| 186 | + [self.tableView viewWithTag:666].frame = rect; | ||
| 187 | + NSLog(@"%f",point.y); | ||
| 188 | + if(point.y < -320){ | ||
| 189 | +// XWWitnessController *vc = [[XWWitnessController alloc]init]; | ||
| 190 | +// CATransition *transition = [CATransition animation]; | ||
| 191 | +// transition.duration = 0.5; | ||
| 192 | +// transition.timingFunction = [CAMediaTimingFunction | ||
| 193 | +// functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; | ||
| 194 | +// transition.type = kCATransitionPush; | ||
| 195 | +// transition.subtype = kCATransitionFromBottom; | ||
| 196 | +// [self.view.window.layer addAnimation:transition forKey:nil]; | ||
| 197 | +// [self.navigationController pushViewController:vc animated:NO]; | ||
| 198 | + | ||
| 199 | + } | ||
| 200 | + } | ||
| 201 | + | ||
| 202 | +} | ||
| 203 | +#pragma mark - CNLiveMineCellDelegate | ||
| 204 | +- (void)cell:(CNLiveMineCell *)cell clickedButtonWithType:(CNLiveMineCellType)type tag:(NSInteger)tag{ | ||
| 205 | + switch (type) { | ||
| 206 | + case CNLiveMineCellTypeOrder: | ||
| 207 | + { | ||
| 208 | + if(tag-10000 == 4){ | ||
| 209 | + //售后 | ||
| 210 | + | ||
| 211 | + }else{ | ||
| 212 | +// XWOrdersController *vc = [[XWOrdersController alloc]initWithIndex:tag-10000]; | ||
| 213 | +// [self.navigationController pushViewController:vc animated:YES]; | ||
| 214 | + } | ||
| 215 | + } | ||
| 216 | + break; | ||
| 217 | + case CNLiveMineCellTypeTool: | ||
| 218 | + { | ||
| 219 | + if(tag == 10000){ | ||
| 220 | + // 收货地址 | ||
| 221 | +// XWAddressController *vc = [[XWAddressController alloc]init]; | ||
| 222 | +// [self.navigationController pushViewController:vc animated:YES]; | ||
| 223 | + } | ||
| 224 | + else if(tag == 10001){ | ||
| 225 | + // 余额 | ||
| 226 | +// XWBalanceController *vc = [[XWBalanceController alloc]init]; | ||
| 227 | +// [self.navigationController pushViewController:vc animated:YES]; | ||
| 228 | + } | ||
| 229 | + else if(tag == 10002){ | ||
| 230 | + // 收藏 | ||
| 231 | +// XWCollectionController *vc = [[XWCollectionController alloc]init]; | ||
| 232 | +// [self.navigationController pushViewController:vc animated:YES]; | ||
| 233 | + } | ||
| 234 | + else if(tag == 10003){ | ||
| 235 | + // 发布记录 | ||
| 236 | +// XWOrdersController *vc = [[XWOrdersController alloc]init]; | ||
| 237 | +// [self.navigationController pushViewController:vc animated:YES]; | ||
| 238 | + } | ||
| 239 | + else if(tag == 10004){ | ||
| 240 | + // 邀请好友 | ||
| 241 | +// XWOrdersController *vc = [[XWOrdersController alloc]init]; | ||
| 242 | +// [self.navigationController pushViewController:vc animated:YES]; | ||
| 243 | + } | ||
| 244 | + else if(tag == 10005){ | ||
| 245 | + // 设置 | ||
| 246 | +// XWSettingController *vc = [[XWSettingController alloc]init]; | ||
| 247 | +// [self.navigationController pushViewController:vc animated:YES]; | ||
| 248 | + } | ||
| 249 | + else if(tag == 10006){ | ||
| 250 | + //路径工具 | ||
| 251 | +// XWOrdersController *vc = [[XWOrdersController alloc]init]; | ||
| 252 | +// [self.navigationController pushViewController:vc animated:YES]; | ||
| 253 | + } | ||
| 254 | + } | ||
| 255 | + break; | ||
| 256 | + case CNLiveMineCellTypeGoods: | ||
| 257 | + { | ||
| 258 | + | ||
| 259 | + } | ||
| 260 | + break; | ||
| 261 | + case CNLiveMineCellTypeSports: | ||
| 262 | + { | ||
| 263 | + | ||
| 264 | + } | ||
| 265 | + break; | ||
| 266 | + | ||
| 267 | + default: | ||
| 268 | + break; | ||
| 269 | + } | ||
| 270 | + | ||
| 271 | +} | ||
| 272 | + | ||
| 273 | +#pragma mark - 状态栏 | ||
| 274 | +/** | ||
| 275 | + * 状态栏的颜色 | ||
| 276 | + * | ||
| 277 | + * @return UIStatusBarStyle | ||
| 278 | + * | ||
| 279 | + */ | ||
| 280 | +- (UIStatusBarStyle)preferredStatusBarStyle{ | ||
| 281 | + return UIStatusBarStyleLightContent; | ||
| 282 | + | ||
| 283 | +} | ||
| 284 | + | ||
| 285 | +#pragma mark - 懒加载 | ||
| 286 | +- (NSMutableArray *)data { | ||
| 287 | + if (!_data) { | ||
| 288 | + _data = [NSMutableArray array]; | ||
| 289 | + | ||
| 290 | + } | ||
| 291 | + return _data; | ||
| 292 | +} | ||
| 293 | + | ||
| 294 | +- (UITableView *)tableView{ | ||
| 295 | + if(!_tableView){ | ||
| 296 | + _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-TabBarHeight) style:UITableViewStylePlain]; | ||
| 297 | + _tableView.showsVerticalScrollIndicator = NO; | ||
| 298 | + _tableView.delegate = self; | ||
| 299 | + _tableView.dataSource = self; | ||
| 300 | + _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; | ||
| 301 | + _tableView.backgroundColor = HexColor(0xf4f4f4); | ||
| 302 | + _tableView.estimatedRowHeight = 0; | ||
| 303 | + _tableView.estimatedSectionHeaderHeight = 0; | ||
| 304 | + _tableView.estimatedSectionFooterHeight = 0; | ||
| 305 | + [_tableView registerClass:[CNLiveMineCell class] forCellReuseIdentifier:kCNLiveMineCell]; | ||
| 306 | + _tableView.contentInset = UIEdgeInsetsMake(kHEIGHT, 0, 0, 0); | ||
| 307 | + | ||
| 308 | + } | ||
| 309 | + return _tableView; | ||
| 310 | +} | ||
| 311 | +- (UIButton *)soccerBtn{ | ||
| 312 | + if(!_soccerBtn){ | ||
| 313 | + _soccerBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 314 | + _soccerBtn.adjustsImageWhenHighlighted = NO; | ||
| 315 | + _soccerBtn.frame = CGRectMake(SCREEN_WIDTH-67-10, SCREEN_HEIGHT-71-10-TabBarHeight, 67, 71); | ||
| 316 | + UIImage *xw_image = [self xw_getImageName:@"mine_soccer_task" bundle:@"CNLiveMineModule" targetClass:[CNLiveMineController class]]; | ||
| 317 | + [_soccerBtn setImage:xw_image forState:UIControlStateNormal]; | ||
| 318 | + [_soccerBtn addTarget:self action:@selector(soccerDidClicked:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 319 | + | ||
| 320 | + } | ||
| 321 | + return _soccerBtn; | ||
| 322 | + | ||
| 323 | +} | ||
| 324 | + | ||
| 325 | +#pragma mark - 响应方法 | ||
| 326 | +- (void)soccerDidClicked:(UIButton *)btn{ | ||
| 327 | + | ||
| 328 | +} | ||
| 329 | + | ||
| 330 | +/** | ||
| 331 | + * 创建图片 | ||
| 332 | + * | ||
| 333 | + * @param imageName 图片名字 | ||
| 334 | + * @param bundleName 图片所在的bundle名字 | ||
| 335 | + * @param targetClass 类和bundle的同级目录 | ||
| 336 | + * @return 返回UIImage | ||
| 337 | + */ | ||
| 338 | +- (UIImage *)xw_getImageName:(NSString *)imageName bundle:(NSString *)bundleName targetClass:(Class)targetClass{ | ||
| 339 | + NSBundle *bundle = [NSBundle bundleForClass:targetClass]; | ||
| 340 | + NSURL *url = [bundle URLForResource:bundleName withExtension:@"bundle"]; | ||
| 341 | + NSBundle *targetBundle = [NSBundle bundleWithURL:url]; | ||
| 342 | + UIImage *image = [UIImage imageNamed:imageName inBundle:targetBundle compatibleWithTraitCollection:nil]; | ||
| 343 | + return image?image:[UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil]; | ||
| 18 | 344 | ||
| 19 | } | 345 | } |
| 20 | 346 |
CNLiveMineModule/Classes/Model/CNLiveMineModel.h
| @@ -3,14 +3,33 @@ | @@ -3,14 +3,33 @@ | ||
| 3 | // CNLiveMineModule | 3 | // CNLiveMineModule |
| 4 | // | 4 | // |
| 5 | // Created by 153993236@qq.com on 11/12/2019. | 5 | // Created by 153993236@qq.com on 11/12/2019. |
| 6 | -// Copyright (c) 2019 153993236@qq.com. All rights reserved. | 6 | +// Copyright © 2019 153993236@qq.com. All rights reserved. |
| 7 | // | 7 | // |
| 8 | 8 | ||
| 9 | #import <Foundation/Foundation.h> | 9 | #import <Foundation/Foundation.h> |
| 10 | 10 | ||
| 11 | NS_ASSUME_NONNULL_BEGIN | 11 | NS_ASSUME_NONNULL_BEGIN |
| 12 | +typedef NS_ENUM(NSInteger, CNLiveMineCellType) { | ||
| 13 | + CNLiveMineCellTypeOrder = 0, | ||
| 14 | + CNLiveMineCellTypeTool = 1, | ||
| 15 | + CNLiveMineCellTypeGoods = 2, | ||
| 16 | + CNLiveMineCellTypeSports = 3 | ||
| 17 | + | ||
| 18 | +}; | ||
| 12 | 19 | ||
| 13 | @interface CNLiveMineModel : NSObject | 20 | @interface CNLiveMineModel : NSObject |
| 21 | +@property (nonatomic, copy) NSString *name; | ||
| 22 | +@property (nonatomic, copy) NSString *pic; | ||
| 23 | + | ||
| 24 | +@property (nonatomic, copy) NSString *style; | ||
| 25 | + | ||
| 26 | +@property (nonatomic, strong) NSArray *titles; | ||
| 27 | +@property (nonatomic, strong) NSArray *images; | ||
| 28 | + | ||
| 29 | +@property (nonatomic, assign) CNLiveMineCellType type; | ||
| 30 | + | ||
| 31 | +@property (nonatomic, assign) CGFloat height; | ||
| 32 | +@property (nonatomic, assign) CGFloat margin; | ||
| 14 | 33 | ||
| 15 | @end | 34 | @end |
| 16 | 35 |
CNLiveMineModule/Classes/Model/CNLiveMineModel.m
| @@ -3,12 +3,58 @@ | @@ -3,12 +3,58 @@ | ||
| 3 | // CNLiveMineModule | 3 | // CNLiveMineModule |
| 4 | // | 4 | // |
| 5 | // Created by 153993236@qq.com on 11/12/2019. | 5 | // Created by 153993236@qq.com on 11/12/2019. |
| 6 | -// Copyright (c) 2019 153993236@qq.com. All rights reserved. | 6 | +// Copyright © 2019 153993236@qq.com. All rights reserved. |
| 7 | // | 7 | // |
| 8 | 8 | ||
| 9 | #import "CNLiveMineModel.h" | 9 | #import "CNLiveMineModel.h" |
| 10 | 10 | ||
| 11 | @implementation CNLiveMineModel | 11 | @implementation CNLiveMineModel |
| 12 | +static const NSInteger margin = 10; | ||
| 12 | 13 | ||
| 14 | +- (CNLiveMineCellType)type{ | ||
| 15 | + if([self.style isEqualToString:@"1"]){ | ||
| 16 | + return CNLiveMineCellTypeOrder; | ||
| 17 | + } | ||
| 18 | + else if([self.style isEqualToString:@"2"]){ | ||
| 19 | + return CNLiveMineCellTypeTool; | ||
| 20 | + | ||
| 21 | + } | ||
| 22 | + else if([self.style isEqualToString:@"3"]){ | ||
| 23 | + return CNLiveMineCellTypeGoods; | ||
| 24 | + | ||
| 25 | + } | ||
| 26 | + else if([self.style isEqualToString:@"4"]){ | ||
| 27 | + return CNLiveMineCellTypeSports; | ||
| 28 | + | ||
| 29 | + } | ||
| 30 | + return CNLiveMineCellTypeOrder; | ||
| 31 | +} | ||
| 32 | + | ||
| 33 | +- (CGFloat)height{ | ||
| 34 | + CGFloat titleHeight = 50; | ||
| 35 | + CGFloat btnHeight = 60; | ||
| 36 | + | ||
| 37 | + //订单 | ||
| 38 | + if(self.type == CNLiveMineCellTypeOrder){ | ||
| 39 | + return 2*margin+titleHeight+btnHeight+margin; | ||
| 40 | + } | ||
| 41 | + //工具 | ||
| 42 | + else if(self.type == CNLiveMineCellTypeTool){ | ||
| 43 | + return 2*margin+titleHeight+ceilf(self.titles.count/4.0)*(btnHeight+margin); | ||
| 44 | + | ||
| 45 | + } | ||
| 46 | + //商品 | ||
| 47 | + else if(self.type == CNLiveMineCellTypeGoods){ | ||
| 48 | + // 电票的高度 80 | ||
| 49 | + return 2*margin+titleHeight+80+margin; | ||
| 50 | + | ||
| 51 | + } | ||
| 52 | + //大众体育 | ||
| 53 | + else if(self.type == CNLiveMineCellTypeSports){ | ||
| 54 | + return 2*margin+titleHeight+ceilf(self.titles.count/4.0)*(btnHeight+margin); | ||
| 55 | + | ||
| 56 | + } | ||
| 57 | + return 0.0000001f; | ||
| 58 | +} | ||
| 13 | 59 | ||
| 14 | @end | 60 | @end |
CNLiveMineModule/Classes/View/CNLiveMineView.h renamed to CNLiveMineModule/Classes/View/CNLiveMineCell.h
| 1 | // | 1 | // |
| 2 | -// CNLiveMineView.h | 2 | +// CNLiveMineCell.h |
| 3 | // CNLiveMineModule | 3 | // CNLiveMineModule |
| 4 | // | 4 | // |
| 5 | // Created by 153993236@qq.com on 11/12/2019. | 5 | // Created by 153993236@qq.com on 11/12/2019. |
| 6 | -// Copyright (c) 2019 153993236@qq.com. All rights reserved. | 6 | +// Copyright © 2019 153993236@qq.com. All rights reserved. |
| 7 | // | 7 | // |
| 8 | 8 | ||
| 9 | #import <UIKit/UIKit.h> | 9 | #import <UIKit/UIKit.h> |
| 10 | +#import "CNLiveMineModel.h" | ||
| 10 | 11 | ||
| 11 | NS_ASSUME_NONNULL_BEGIN | 12 | NS_ASSUME_NONNULL_BEGIN |
| 13 | +@class CNLiveMineCell; | ||
| 12 | 14 | ||
| 13 | -@interface CNLiveMineView : UIView | 15 | +static NSString * const kCNLiveMineCell = @"CNLiveMineCell"; |
| 16 | +@protocol CNLiveMineCellDelegate <NSObject> | ||
| 17 | +@optional | ||
| 18 | +- (void)cell:(CNLiveMineCell *)cell clickedButtonWithType:(CNLiveMineCellType)type tag:(NSInteger)tag; | ||
| 19 | + | ||
| 20 | +@end | ||
| 21 | + | ||
| 22 | +@interface CNLiveMineCell : UITableViewCell | ||
| 23 | +@property (nonatomic, strong) CNLiveMineModel *model; | ||
| 24 | +@property (nonatomic, weak) id<CNLiveMineCellDelegate> delegate; | ||
| 14 | 25 | ||
| 15 | @end | 26 | @end |
| 16 | 27 |
CNLiveMineModule/Classes/View/CNLiveMineCell.m
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveMineCell.m | ||
| 3 | +// CNLiveMineModule | ||
| 4 | +// | ||
| 5 | +// Created by 153993236@qq.com on 11/12/2019. | ||
| 6 | +// Copyright © 2019 153993236@qq.com. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "CNLiveMineCell.h" | ||
| 10 | +#import <Masonry/Masonry.h> | ||
| 11 | +#import "QMUIKit.h" | ||
| 12 | + | ||
| 13 | +//#import "UIView+Layout.h" | ||
| 14 | +//#import "UIImage+Bundle.h" | ||
| 15 | +// | ||
| 16 | +//#import "UIButton+ImageTitleSpace.h" | ||
| 17 | + | ||
| 18 | +// HexColor(0x333333) | ||
| 19 | +#define HexColor(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] | ||
| 20 | + | ||
| 21 | +@interface CNLiveMineCell() | ||
| 22 | +@property (nonatomic, strong) UIView *bgView; | ||
| 23 | +@property (nonatomic, strong) UIButton *titleButton; | ||
| 24 | + | ||
| 25 | +@property (nonatomic, strong) UIView *line; | ||
| 26 | + | ||
| 27 | +@end | ||
| 28 | + | ||
| 29 | +@implementation CNLiveMineCell | ||
| 30 | + | ||
| 31 | +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier | ||
| 32 | +{ | ||
| 33 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | ||
| 34 | + if (self) { | ||
| 35 | + self.contentView.backgroundColor = HexColor(0xf4f4f4); | ||
| 36 | + [self xw_layoutSubviews]; | ||
| 37 | + } | ||
| 38 | + return self; | ||
| 39 | +} | ||
| 40 | +- (void)xw_layoutSubviews{ | ||
| 41 | + self.bgView = [[UIView alloc] init]; | ||
| 42 | + _bgView.backgroundColor = [UIColor whiteColor]; | ||
| 43 | + _bgView.layer.masksToBounds = YES; | ||
| 44 | + _bgView.layer.cornerRadius = 5; | ||
| 45 | + [self.contentView addSubview:self.bgView]; | ||
| 46 | + | ||
| 47 | + self.titleButton = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 48 | + _titleButton.titleLabel.font = [UIFont boldSystemFontOfSize:16]; | ||
| 49 | + [_titleButton setTitleColor:[UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0] forState:UIControlStateNormal]; | ||
| 50 | + _titleButton.adjustsImageWhenHighlighted = NO; | ||
| 51 | +// [_titleButton addTarget:self action:@selector(btnDidClicked:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 52 | + [self.contentView addSubview:self.titleButton]; | ||
| 53 | + | ||
| 54 | + self.line = [[UIView alloc] init]; | ||
| 55 | + _line.backgroundColor = HexColor(0xebebeb); | ||
| 56 | + [self.contentView addSubview:self.line]; | ||
| 57 | + | ||
| 58 | + | ||
| 59 | +} | ||
| 60 | +- (void)setModel:(CNLiveMineModel *)model{ | ||
| 61 | + _model = model; | ||
| 62 | + [_titleButton setTitle:model.name forState:UIControlStateNormal]; | ||
| 63 | + UIImage *xw_image = [self xw_getImageName:model.pic bundle:@"CNLiveMineModule" targetClass:[CNLiveMineCell class]]; | ||
| 64 | + [_titleButton setImage:xw_image forState:UIControlStateNormal]; | ||
| 65 | + | ||
| 66 | + switch (model.type) { | ||
| 67 | + case CNLiveMineCellTypeOrder: | ||
| 68 | + { | ||
| 69 | + [self order_layoutSubviews]; | ||
| 70 | + } | ||
| 71 | + break; | ||
| 72 | + | ||
| 73 | + case CNLiveMineCellTypeTool: | ||
| 74 | + { | ||
| 75 | + [self tool_layoutSubviews]; | ||
| 76 | + } | ||
| 77 | + break; | ||
| 78 | + | ||
| 79 | + case CNLiveMineCellTypeGoods: | ||
| 80 | + { | ||
| 81 | + [self goods_layoutSubviews]; | ||
| 82 | + } | ||
| 83 | + break; | ||
| 84 | + | ||
| 85 | + case CNLiveMineCellTypeSports: | ||
| 86 | + { | ||
| 87 | + [self sports_layoutSubviews]; | ||
| 88 | + } | ||
| 89 | + break; | ||
| 90 | + } | ||
| 91 | +} | ||
| 92 | + | ||
| 93 | +- (void)order_layoutSubviews{ | ||
| 94 | + [_bgView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 95 | + make.left.equalTo(self.contentView.mas_left).with.offset(self.model.margin); | ||
| 96 | + make.right.equalTo(self.contentView.mas_right).with.offset(-self.model.margin); | ||
| 97 | + make.top.equalTo(self.contentView.mas_top).with.offset(0); | ||
| 98 | + make.bottom.equalTo(self.contentView.mas_bottom).with.offset(-self.model.margin); | ||
| 99 | + | ||
| 100 | + }]; | ||
| 101 | + [_titleButton setImage:nil forState:UIControlStateNormal]; | ||
| 102 | + _titleButton.titleLabel.textAlignment = NSTextAlignmentLeft; | ||
| 103 | + _titleButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;//使图片和文字水平居中显示 | ||
| 104 | + [_titleButton mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 105 | + make.top.equalTo(self.bgView.mas_top).with.offset(0); | ||
| 106 | + make.left.equalTo(self.bgView.mas_left).with.offset(self.model.margin); | ||
| 107 | + make.right.equalTo(self.bgView.mas_right).with.offset(-self.model.margin); | ||
| 108 | + make.height.with.offset(50); | ||
| 109 | + | ||
| 110 | + }]; | ||
| 111 | + [_line mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 112 | + make.top.equalTo(self.titleButton.mas_bottom).with.offset(0); | ||
| 113 | + make.left.equalTo(self.bgView.mas_left).with.offset(self.model.margin); | ||
| 114 | + make.right.equalTo(self.bgView.mas_right).with.offset(-self.model.margin); | ||
| 115 | + make.height.with.offset(0.5); | ||
| 116 | + | ||
| 117 | + }]; | ||
| 118 | + | ||
| 119 | + CGFloat width = SCREEN_WIDTH-2*self.model.margin; | ||
| 120 | + CGFloat btnWidth = width/self.model.titles.count*1.0; | ||
| 121 | + CGFloat btnHeight = 60; | ||
| 122 | + | ||
| 123 | + for(int i = 0; i < self.model.titles.count; i++){ | ||
| 124 | + UIButton *btn = [self createButtonWithFrame:CGRectMake(self.model.margin+btnWidth*i, 50+self.model.margin, btnWidth, btnHeight) title:self.model.titles[i] image:self.model.images[i] tag:10000+i]; | ||
| 125 | + [self addSubview:btn]; | ||
| 126 | + | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | +} | ||
| 130 | +- (void)tool_layoutSubviews{ | ||
| 131 | + [_bgView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 132 | + make.left.equalTo(self.contentView.mas_left).with.offset(self.model.margin); | ||
| 133 | + make.right.equalTo(self.contentView.mas_right).with.offset(-self.model.margin); | ||
| 134 | + make.top.equalTo(self.contentView.mas_top).with.offset(0); | ||
| 135 | + make.bottom.equalTo(self.contentView.mas_bottom).with.offset(-self.model.margin); | ||
| 136 | + | ||
| 137 | + }]; | ||
| 138 | + [_titleButton setImage:nil forState:UIControlStateNormal]; | ||
| 139 | + _titleButton.titleLabel.textAlignment = NSTextAlignmentLeft; | ||
| 140 | + _titleButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;//使图片和文字水平居中显示 | ||
| 141 | + [_titleButton mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 142 | + make.top.equalTo(self.bgView.mas_top).with.offset(0); | ||
| 143 | + make.left.equalTo(self.bgView.mas_left).with.offset(self.model.margin); | ||
| 144 | + make.right.equalTo(self.bgView.mas_right).with.offset(-self.model.margin); | ||
| 145 | + make.height.with.offset(50); | ||
| 146 | + | ||
| 147 | + }]; | ||
| 148 | + [_line mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 149 | + make.top.equalTo(self.titleButton.mas_bottom).with.offset(0); | ||
| 150 | + make.left.equalTo(self.bgView.mas_left).with.offset(self.model.margin); | ||
| 151 | + make.right.equalTo(self.bgView.mas_right).with.offset(-self.model.margin); | ||
| 152 | + make.height.with.offset(0.5); | ||
| 153 | + | ||
| 154 | + }]; | ||
| 155 | + | ||
| 156 | + CGFloat width = SCREEN_WIDTH-2*self.model.margin; | ||
| 157 | + | ||
| 158 | + CGFloat btnWidth = width/4.0; | ||
| 159 | + CGFloat btnHeight = 60; | ||
| 160 | + | ||
| 161 | + for(int i = 0; i < self.model.titles.count; i++){ | ||
| 162 | + NSInteger row = i % 4; | ||
| 163 | + NSInteger col = floorf(i / 4.0); | ||
| 164 | + UIButton *btn = [self createButtonWithFrame:CGRectMake(self.model.margin+btnWidth*row, (col*(btnHeight+self.model.margin))+50+self.model.margin, btnWidth, btnHeight) title:self.model.titles[i] image:self.model.images[i] tag:10000+i]; | ||
| 165 | + [self addSubview:btn]; | ||
| 166 | + | ||
| 167 | + } | ||
| 168 | +} | ||
| 169 | +- (void)goods_layoutSubviews{ | ||
| 170 | + //图片相对于button的偏移量 | ||
| 171 | + [_titleButton setImageEdgeInsets:UIEdgeInsetsMake(0, -self.model.margin/2.0, 0, 0)]; | ||
| 172 | + //文字相对于图片的偏移量 | ||
| 173 | + [_titleButton setTitleEdgeInsets:UIEdgeInsetsMake(0, self.model.margin/2.0, 0, 0)]; | ||
| 174 | + | ||
| 175 | + [_bgView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 176 | + make.left.equalTo(self.contentView.mas_left).with.offset(self.model.margin); | ||
| 177 | + make.right.equalTo(self.contentView.mas_right).with.offset(-self.model.margin); | ||
| 178 | + make.top.equalTo(self.contentView.mas_top).with.offset(0); | ||
| 179 | + make.bottom.equalTo(self.contentView.mas_bottom).with.offset(-self.model.margin); | ||
| 180 | + | ||
| 181 | + }]; | ||
| 182 | + _titleButton.titleLabel.textAlignment = NSTextAlignmentCenter; | ||
| 183 | + _titleButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;//使图片和文字水平居中显示 | ||
| 184 | + [_titleButton mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 185 | + make.top.equalTo(self.bgView.mas_top).with.offset(0); | ||
| 186 | + make.left.equalTo(self.bgView.mas_left).with.offset(self.model.margin); | ||
| 187 | + make.right.equalTo(self.bgView.mas_right).with.offset(-self.model.margin); | ||
| 188 | + make.height.with.offset(50); | ||
| 189 | + | ||
| 190 | + }]; | ||
| 191 | + [_line mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 192 | + make.top.equalTo(self.titleButton.mas_bottom).with.offset(0); | ||
| 193 | + make.left.equalTo(self.bgView.mas_left).with.offset(self.model.margin); | ||
| 194 | + make.right.equalTo(self.bgView.mas_right).with.offset(-self.model.margin); | ||
| 195 | + make.height.with.offset(0.5); | ||
| 196 | + | ||
| 197 | + }]; | ||
| 198 | + CGFloat width = SCREEN_WIDTH-2*self.model.margin; | ||
| 199 | + CGFloat btnWidth = width/4.0; | ||
| 200 | + CGFloat btnHeight = 80; | ||
| 201 | + | ||
| 202 | + // 电子票 | ||
| 203 | + UIButton *btn = [self createButtonWithFrame:CGRectMake((width-btnWidth)/2.0, self.model.margin+50, btnWidth, btnHeight) title:self.model.titles[0] image:self.model.images[0] tag:10000]; | ||
| 204 | + [self addSubview:btn]; | ||
| 205 | + | ||
| 206 | +} | ||
| 207 | +- (void)sports_layoutSubviews{ | ||
| 208 | + //图片相对于button的偏移量 | ||
| 209 | + [_titleButton setImageEdgeInsets:UIEdgeInsetsMake(0, -self.model.margin/2.0, 0, 0)]; | ||
| 210 | + //文字相对于图片的偏移量 | ||
| 211 | + [_titleButton setTitleEdgeInsets:UIEdgeInsetsMake(0, self.model.margin/2.0, 0, 0)]; | ||
| 212 | + | ||
| 213 | + [_bgView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 214 | + make.left.equalTo(self.contentView.mas_left).with.offset(self.model.margin); | ||
| 215 | + make.right.equalTo(self.contentView.mas_right).with.offset(-self.model.margin); | ||
| 216 | + make.top.equalTo(self.contentView.mas_top).with.offset(0); | ||
| 217 | + make.bottom.equalTo(self.contentView.mas_bottom).with.offset(-self.model.margin); | ||
| 218 | + | ||
| 219 | + }]; | ||
| 220 | + _titleButton.titleLabel.textAlignment = NSTextAlignmentCenter; | ||
| 221 | + _titleButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;//使图片和文字水平居中显示 | ||
| 222 | + [_titleButton mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 223 | + make.top.equalTo(self.bgView.mas_top).with.offset(0); | ||
| 224 | + make.left.equalTo(self.bgView.mas_left).with.offset(self.model.margin); | ||
| 225 | + make.right.equalTo(self.bgView.mas_right).with.offset(-self.model.margin); | ||
| 226 | + make.height.with.offset(50); | ||
| 227 | + | ||
| 228 | + }]; | ||
| 229 | + [_line mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 230 | + make.top.equalTo(self.titleButton.mas_bottom).with.offset(0); | ||
| 231 | + make.left.equalTo(self.bgView.mas_left).with.offset(self.model.margin); | ||
| 232 | + make.right.equalTo(self.bgView.mas_right).with.offset(-self.model.margin); | ||
| 233 | + make.height.with.offset(0.5); | ||
| 234 | + | ||
| 235 | + }]; | ||
| 236 | + | ||
| 237 | + CGFloat width = SCREEN_WIDTH-2*self.model.margin; | ||
| 238 | + | ||
| 239 | + CGFloat btnWidth = width/4.0; | ||
| 240 | + CGFloat btnHeight = 60; | ||
| 241 | + | ||
| 242 | + for(int i = 0; i < self.model.titles.count; i++){ | ||
| 243 | + NSInteger row = i % 4; | ||
| 244 | + NSInteger col = floorf(i / 4.0); | ||
| 245 | + UIButton *btn = [self createButtonWithFrame:CGRectMake(self.model.margin+btnWidth*row, (col*(btnHeight+self.model.margin))+50+self.model.margin, btnWidth, btnHeight) title:self.model.titles[i] image:self.model.images[i] tag:10000+i]; | ||
| 246 | + [self addSubview:btn]; | ||
| 247 | + | ||
| 248 | + } | ||
| 249 | +} | ||
| 250 | + | ||
| 251 | +- (UIButton *)createButtonWithFrame:(CGRect)frame title:(NSString *)title image:(NSString *)image tag:(NSInteger)tag{ | ||
| 252 | + UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 253 | + btn.tag = tag; | ||
| 254 | + btn.frame = frame; | ||
| 255 | + btn.titleLabel.font = [UIFont systemFontOfSize:14]; | ||
| 256 | + btn.titleLabel.textAlignment = NSTextAlignmentCenter; | ||
| 257 | + btn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;//使图片和文字水平居中显示 | ||
| 258 | + | ||
| 259 | + [btn setTitle:title forState:UIControlStateNormal]; | ||
| 260 | + [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; | ||
| 261 | + UIImage *xw_image = [self xw_getImageName:image bundle:@"CNLiveMineModule" targetClass:[CNLiveMineCell class]]; | ||
| 262 | + [btn setImage:xw_image forState:UIControlStateNormal]; | ||
| 263 | + btn.adjustsImageWhenHighlighted = NO; | ||
| 264 | + [btn addTarget:self action:@selector(btnDidClicked:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 265 | + btn.titleEdgeInsets = UIEdgeInsetsMake(btn.imageView.frame.size.height+self.model.margin, -btn.imageView.frame.size.width, 0, 0); | ||
| 266 | + btn.imageEdgeInsets = UIEdgeInsetsMake(-btn.titleLabel.bounds.size.height, 0, self.model.margin, -btn.titleLabel.bounds.size.width); | ||
| 267 | + return btn; | ||
| 268 | + | ||
| 269 | +} | ||
| 270 | + | ||
| 271 | +- (void)awakeFromNib { | ||
| 272 | + [super awakeFromNib]; | ||
| 273 | + // Initialization code | ||
| 274 | +} | ||
| 275 | + | ||
| 276 | +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { | ||
| 277 | + [super setSelected:selected animated:animated]; | ||
| 278 | + | ||
| 279 | + // Configure the view for the selected state | ||
| 280 | +} | ||
| 281 | + | ||
| 282 | +- (void)btnDidClicked:(UIButton *)btn{ | ||
| 283 | + if (self.delegate && [self.delegate respondsToSelector:@selector(cell:clickedButtonWithType:tag:)]) { | ||
| 284 | + [self.delegate cell:self clickedButtonWithType:self.model.type tag:btn.tag]; | ||
| 285 | + } | ||
| 286 | +} | ||
| 287 | + | ||
| 288 | +/** | ||
| 289 | + * 创建图片 | ||
| 290 | + * | ||
| 291 | + * @param imageName 图片名字 | ||
| 292 | + * @param bundleName 图片所在的bundle名字 | ||
| 293 | + * @param targetClass 类和bundle的同级目录 | ||
| 294 | + * @return 返回UIImage | ||
| 295 | + */ | ||
| 296 | +- (UIImage *)xw_getImageName:(NSString *)imageName bundle:(NSString *)bundleName targetClass:(Class)targetClass{ | ||
| 297 | + NSBundle *bundle = [NSBundle bundleForClass:targetClass]; | ||
| 298 | + NSURL *url = [bundle URLForResource:bundleName withExtension:@"bundle"]; | ||
| 299 | + NSBundle *targetBundle = [NSBundle bundleWithURL:url]; | ||
| 300 | + UIImage *image = [UIImage imageNamed:imageName inBundle:targetBundle compatibleWithTraitCollection:nil]; | ||
| 301 | + return image?image:[UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil]; | ||
| 302 | + | ||
| 303 | +} | ||
| 304 | + | ||
| 305 | +@end |
CNLiveMineModule/Classes/View/CNLiveMineHeaderView.h
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveMineHeaderView.h | ||
| 3 | +// CNLiveMineModule | ||
| 4 | +// | ||
| 5 | +// Created by 153993236@qq.com on 11/12/2019. | ||
| 6 | +// Copyright © 2019 153993236@qq.com. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <UIKit/UIKit.h> | ||
| 10 | + | ||
| 11 | +NS_ASSUME_NONNULL_BEGIN | ||
| 12 | +typedef NS_ENUM(NSInteger, CNLiveMineHeaderViewType) { | ||
| 13 | + CNLiveMineHeaderViewTypeUerInfo = 0, | ||
| 14 | + CNLiveMineHeaderViewTypeCode = 1, | ||
| 15 | + CNLiveMineHeaderViewTypeWintess = 2, | ||
| 16 | + CNLiveMineHeaderViewTypeSign = 3 | ||
| 17 | + | ||
| 18 | +}; | ||
| 19 | +@class CNLiveMineHeaderView; | ||
| 20 | + | ||
| 21 | +@protocol CNLiveMineHeaderViewDelegate <NSObject> | ||
| 22 | +@optional | ||
| 23 | +- (void)headerView:(CNLiveMineHeaderView *)headerView pushToController:(CNLiveMineHeaderViewType)type; | ||
| 24 | + | ||
| 25 | +@end | ||
| 26 | +@interface CNLiveMineHeaderView : UIView | ||
| 27 | +@property (nonatomic, weak) id<CNLiveMineHeaderViewDelegate> delegate; | ||
| 28 | +- (void)layoutSubviews; | ||
| 29 | + | ||
| 30 | +@end | ||
| 31 | + | ||
| 32 | +NS_ASSUME_NONNULL_END |
CNLiveMineModule/Classes/View/CNLiveMineHeaderView.m
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveMineHeaderView.m | ||
| 3 | +// CNLiveMineModule | ||
| 4 | +// | ||
| 5 | +// Created by 153993236@qq.com on 11/12/2019. | ||
| 6 | +// Copyright © 2019 153993236@qq.com. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "CNLiveMineHeaderView.h" | ||
| 10 | +#import <Masonry/Masonry.h> | ||
| 11 | +#import <SDWebImage/SDWebImage.h> | ||
| 12 | +#import "QMUIKit.h" | ||
| 13 | + | ||
| 14 | +//#import "XWHeader.h" | ||
| 15 | +//#import <XWUserCenter/XWUserCenter.h>// 用户中心 | ||
| 16 | +//#import "UIView+Layout.h" | ||
| 17 | +//#import "UIView+Events.h" | ||
| 18 | +//#import "UIImage+Bundle.h" | ||
| 19 | +//#import "XWUserInfoModel.h" | ||
| 20 | +//#import "XWUserInfoNotification.h" | ||
| 21 | + | ||
| 22 | +// HexColor(0x333333) | ||
| 23 | +#define HexColor(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] | ||
| 24 | + | ||
| 25 | +@interface CNLiveMineHeaderView () | ||
| 26 | +@property (nonatomic, strong) UIImageView *bgView; | ||
| 27 | +@property (nonatomic, strong) UIButton *witness; | ||
| 28 | + | ||
| 29 | +@property (nonatomic, strong) UIImageView *header; | ||
| 30 | +@property (nonatomic, strong) UILabel *name; | ||
| 31 | +@property (nonatomic, strong) UILabel *certification; | ||
| 32 | +@property (nonatomic, strong) UILabel *address; | ||
| 33 | +@property (nonatomic, strong) UIButton *sign; | ||
| 34 | + | ||
| 35 | +@end | ||
| 36 | + | ||
| 37 | +@implementation CNLiveMineHeaderView | ||
| 38 | +static const NSInteger margin = 20; | ||
| 39 | + | ||
| 40 | +- (instancetype)initWithFrame:(CGRect)frame{ | ||
| 41 | + self = [super initWithFrame:frame]; | ||
| 42 | + if(self){ | ||
| 43 | + self.userInteractionEnabled = YES; | ||
| 44 | + self.backgroundColor = HexColor(0xf4f4f4); | ||
| 45 | +// [XWUserInfoNotification addUserInfoUpdateObserver:self selector:@selector(userInfoUpdateNotification:)]; | ||
| 46 | + [self createSubViews]; | ||
| 47 | + } | ||
| 48 | + return self; | ||
| 49 | +} | ||
| 50 | +// 实现方法 | ||
| 51 | +- (void)userInfoUpdateNotification:(NSNotification *)noti{ | ||
| 52 | + //使用userInfo处理消息 | ||
| 53 | +// NSDictionary *dic = [noti userInfo]; | ||
| 54 | +// XWUserInfoDataType type = [[dic objectForKey:@"type"] integerValue]; | ||
| 55 | +// if(type == XWUserInfoDataTypeHead){ | ||
| 56 | +// UIImage *info = [dic objectForKey:@"info"]; | ||
| 57 | +// _header.image = info; | ||
| 58 | +// | ||
| 59 | +// }else if(type == XWUserInfoDataTypeNickname){ | ||
| 60 | +// NSString *info = [dic objectForKey:@"info"]; | ||
| 61 | +// _name.attributedText = [self createAttributedImageName:@"mine_code" string:info isFront:NO]; | ||
| 62 | +// | ||
| 63 | +// }else if(type == XWUserInfoDataTypeAddress){ | ||
| 64 | +// NSString *info = [dic objectForKey:@"info"]; | ||
| 65 | +// _address.attributedText = [self createAttributedImageName:@"mine_location" string:info isFront:YES]; | ||
| 66 | +// | ||
| 67 | +// } | ||
| 68 | +} | ||
| 69 | + | ||
| 70 | +- (void)dealloc { | ||
| 71 | + NSLog(@"CNLiveMineHeaderView -- dealloc"); | ||
| 72 | +// [XWUserInfoNotification removeObserver:self]; | ||
| 73 | + | ||
| 74 | +} | ||
| 75 | + | ||
| 76 | +- (void)createSubViews { | ||
| 77 | + [self addSubview:self.bgView]; | ||
| 78 | + [self addSubview:self.witness]; | ||
| 79 | + | ||
| 80 | + [self addSubview:self.header]; | ||
| 81 | + [self addSubview:self.name]; | ||
| 82 | + [self addSubview:self.certification]; | ||
| 83 | + [self addSubview:self.address]; | ||
| 84 | + [self addSubview:self.sign]; | ||
| 85 | + | ||
| 86 | +} | ||
| 87 | + | ||
| 88 | +- (void)layoutSubviews{ | ||
| 89 | + [super layoutSubviews]; | ||
| 90 | + [_witness mas_remakeConstraints:^(MASConstraintMaker *make) { | ||
| 91 | + make.left.equalTo(self.mas_left).with.offset(1.5*margin); | ||
| 92 | + make.right.equalTo(self.mas_right).with.offset(-1.5*margin); | ||
| 93 | + make.width.height.offset(60); | ||
| 94 | + make.bottom.equalTo(self.mas_bottom).with.offset(-0.5*margin); | ||
| 95 | + | ||
| 96 | + }]; | ||
| 97 | + | ||
| 98 | + [_bgView mas_remakeConstraints:^(MASConstraintMaker *make) { | ||
| 99 | + make.left.equalTo(self.mas_left).with.offset(0); | ||
| 100 | + make.right.equalTo(self.mas_right).with.offset(-0); | ||
| 101 | + make.top.equalTo(self.mas_top).with.offset(0); | ||
| 102 | + make.bottom.equalTo(self.witness.mas_centerY).with.offset(0.5*margin); | ||
| 103 | + | ||
| 104 | + }]; | ||
| 105 | + | ||
| 106 | + [_header mas_remakeConstraints:^(MASConstraintMaker *make) { | ||
| 107 | + make.left.equalTo(self.mas_left).with.offset(margin); | ||
| 108 | + make.centerY.equalTo(self.bgView.mas_centerY).with.offset(0); | ||
| 109 | + make.width.height.offset(60); | ||
| 110 | + | ||
| 111 | + }]; | ||
| 112 | + | ||
| 113 | + [_certification mas_remakeConstraints:^(MASConstraintMaker *make) { | ||
| 114 | + make.centerY.equalTo(self.header.mas_centerY); | ||
| 115 | + make.left.equalTo(self.header.mas_right).with.offset(margin/2.0); | ||
| 116 | + make.height.offset(30); | ||
| 117 | + | ||
| 118 | + }]; | ||
| 119 | + | ||
| 120 | + [_name mas_remakeConstraints:^(MASConstraintMaker *make) { | ||
| 121 | + make.bottom.equalTo(self.certification.mas_top); | ||
| 122 | + make.left.equalTo(self.certification.mas_left); | ||
| 123 | + make.right.equalTo(self.bgView.mas_right).with.offset(-margin); | ||
| 124 | + make.height.equalTo(self.certification.mas_height); | ||
| 125 | + | ||
| 126 | + }]; | ||
| 127 | + | ||
| 128 | + [_address mas_remakeConstraints:^(MASConstraintMaker *make) { | ||
| 129 | + make.top.equalTo(self.certification.mas_bottom); | ||
| 130 | + make.left.equalTo(self.name.mas_left); | ||
| 131 | + make.right.equalTo(self.name.mas_right); | ||
| 132 | + make.height.equalTo(self.name.mas_height); | ||
| 133 | + | ||
| 134 | + }]; | ||
| 135 | + | ||
| 136 | + [_sign mas_remakeConstraints:^(MASConstraintMaker *make) { | ||
| 137 | + make.right.equalTo(self.mas_right).with.offset(0); | ||
| 138 | + make.centerY.equalTo(self.header.mas_centerY).with.offset(0); | ||
| 139 | + make.width.mas_equalTo(105); | ||
| 140 | + make.height.mas_equalTo(32); | ||
| 141 | + | ||
| 142 | + }]; | ||
| 143 | +} | ||
| 144 | +/* | ||
| 145 | + // Only override drawRect: if you perform custom drawing. | ||
| 146 | + // An empty implementation adversely affects performance during animation. | ||
| 147 | + - (void)drawRect:(CGRect)rect { | ||
| 148 | + // Drawing code | ||
| 149 | + } | ||
| 150 | + */ | ||
| 151 | +#pragma mark - Private Methods | ||
| 152 | +- (NSMutableAttributedString *)createAttributedImageName:(NSString *)imageName string:(NSString *)string isFront:(BOOL)isFront{ | ||
| 153 | + if(isFront){ | ||
| 154 | + string = [NSString stringWithFormat:@" %@",string]; | ||
| 155 | + } | ||
| 156 | + // 1.创建一个富文本 | ||
| 157 | + NSMutableAttributedString *attri = [[NSMutableAttributedString alloc] initWithString:string]; | ||
| 158 | + // 修改富文本中的不同文字的样式 | ||
| 159 | +// [attri addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:NSMakeRange(0, string.length)]; | ||
| 160 | +// [attri addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:14] range:NSMakeRange(0, string.length)]; | ||
| 161 | + // 2.添加表情图片 | ||
| 162 | + NSTextAttachment *attch = [[NSTextAttachment alloc] init]; | ||
| 163 | + // 表情图片 | ||
| 164 | + UIImage *xw_image = [self xw_getImageName:imageName bundle:@"CNLiveMineModule" targetClass:[CNLiveMineHeaderView class]]; | ||
| 165 | + attch.image = xw_image; | ||
| 166 | + if(isFront){ | ||
| 167 | + // 设置图片大小 | ||
| 168 | + attch.bounds = CGRectMake(0, -1.5, 10, 12); | ||
| 169 | + // 创建带有图片的富文本 | ||
| 170 | + NSAttributedString *str = [NSAttributedString attributedStringWithAttachment:attch]; | ||
| 171 | + [attri insertAttributedString:str atIndex:0];// 插入某个位置 | ||
| 172 | + }else{ | ||
| 173 | + // 设置图片大小 | ||
| 174 | + attch.bounds = CGRectMake(10, -2, 15, 15); | ||
| 175 | + // 创建带有图片的富文本 | ||
| 176 | + NSAttributedString *str = [NSAttributedString attributedStringWithAttachment:attch]; | ||
| 177 | + [attri insertAttributedString:str atIndex:string.length];// 插入某个位置 | ||
| 178 | + | ||
| 179 | + } | ||
| 180 | + return attri; | ||
| 181 | + | ||
| 182 | +} | ||
| 183 | +- (NSMutableAttributedString *)createAttributedImages:(NSArray *)images { | ||
| 184 | + // 1.创建一个富文本 | ||
| 185 | + NSMutableAttributedString *attri = [[NSMutableAttributedString alloc] initWithString:@""]; | ||
| 186 | + for(NSString *image in images){ | ||
| 187 | + // 2.添加表情图片 | ||
| 188 | + NSTextAttachment *attch = [[NSTextAttachment alloc] init]; | ||
| 189 | + // 表情图片 | ||
| 190 | + UIImage *xw_image = [self xw_getImageName:image bundle:@"CNLiveMineModule" targetClass:[CNLiveMineHeaderView class]]; | ||
| 191 | + attch.image = xw_image; | ||
| 192 | + // 创建带有图片的富文本 | ||
| 193 | + NSAttributedString *str = [NSAttributedString attributedStringWithAttachment:attch]; | ||
| 194 | + NSAttributedString *space = [[NSAttributedString alloc]initWithString:@" "]; | ||
| 195 | + | ||
| 196 | + [attri insertAttributedString:space atIndex:0]; | ||
| 197 | + [attri insertAttributedString:str atIndex:0];// 插入某个位置 | ||
| 198 | + | ||
| 199 | + } | ||
| 200 | + return attri; | ||
| 201 | + | ||
| 202 | +} | ||
| 203 | + | ||
| 204 | +#pragma mark - 懒加载 | ||
| 205 | +- (UIButton *)witness { | ||
| 206 | + if (!_witness) { | ||
| 207 | + _witness = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 208 | + UIImage *xw_image = [self xw_getImageName:@"mine_observer" bundle:@"CNLiveMineModule" targetClass:[CNLiveMineHeaderView class]]; | ||
| 209 | + _witness.imageView.contentMode = UIViewContentModeScaleAspectFit; | ||
| 210 | + [_witness setImage:xw_image forState:UIControlStateNormal]; | ||
| 211 | + _witness.adjustsImageWhenHighlighted = NO; | ||
| 212 | + [_witness addTarget:self action:@selector(witnessDidClicked:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 213 | + } | ||
| 214 | + return _witness; | ||
| 215 | +} | ||
| 216 | +- (UIImageView *)bgView { | ||
| 217 | + if (!_bgView) { | ||
| 218 | + _bgView = [[UIImageView alloc] init]; | ||
| 219 | + _bgView.userInteractionEnabled = YES; | ||
| 220 | + UIImage *xw_image = [self xw_getImageName:@"mine_bg" bundle:@"CNLiveMineModule" targetClass:[CNLiveMineHeaderView class]]; | ||
| 221 | + _bgView.image = xw_image; | ||
| 222 | + } | ||
| 223 | + return _bgView; | ||
| 224 | +} | ||
| 225 | +- (UIImageView *)header { | ||
| 226 | + if (!_header) { | ||
| 227 | + _header = [[UIImageView alloc] init]; | ||
| 228 | + _header.userInteractionEnabled = YES; | ||
| 229 | + _header.layer.masksToBounds = YES; | ||
| 230 | + _header.layer.cornerRadius = 30; | ||
| 231 | + UIImage *xw_image = [self xw_getImageName:@"default_avatar_y" bundle:@"CNLiveMineModule" targetClass:[CNLiveMineHeaderView class]]; | ||
| 232 | + [_header sd_setImageWithURL:[NSURL URLWithString:@"头像"] placeholderImage:xw_image]; | ||
| 233 | + __weak typeof(self) weakSelf = self; | ||
| 234 | +// [_header addGestureTapEventHandle:^(id _Nonnull sender, UITapGestureRecognizer * _Nonnull gestureRecognizer) { | ||
| 235 | +// __strong typeof(weakSelf) strongSelf = weakSelf; | ||
| 236 | +// if(!strongSelf) return ; | ||
| 237 | +// if (strongSelf.delegate && [strongSelf.delegate respondsToSelector:@selector(headerView:pushToController:)]) { | ||
| 238 | +// [strongSelf.delegate headerView:strongSelf pushToController:CNLiveMineHeaderViewTypeUerInfo]; | ||
| 239 | +// } | ||
| 240 | +// }]; | ||
| 241 | + } | ||
| 242 | + return _header; | ||
| 243 | +} | ||
| 244 | + | ||
| 245 | +- (UILabel *)name { | ||
| 246 | + if (!_name) { | ||
| 247 | + _name = [[UILabel alloc] init]; | ||
| 248 | + _name.userInteractionEnabled = YES; | ||
| 249 | + _name.numberOfLines = 1; | ||
| 250 | + _name.textColor = [UIColor whiteColor]; | ||
| 251 | + _name.font = [UIFont systemFontOfSize:16]; | ||
| 252 | + _name.attributedText = [self createAttributedImageName:@"mine_code" string:@"张晓文" isFront:NO]; | ||
| 253 | + __weak typeof(self) weakSelf = self; | ||
| 254 | +// [_name addGestureTapEventHandle:^(id _Nonnull sender, UITapGestureRecognizer * _Nonnull gestureRecognizer) { | ||
| 255 | +// __strong typeof(weakSelf) strongSelf = weakSelf; | ||
| 256 | +// if(!strongSelf) return ; | ||
| 257 | +// if (strongSelf.delegate && [strongSelf.delegate respondsToSelector:@selector(headerView:pushToController:)]) { | ||
| 258 | +// [strongSelf.delegate headerView:strongSelf pushToController:CNLiveMineHeaderViewTypeCode]; | ||
| 259 | +// } | ||
| 260 | +// }]; | ||
| 261 | + | ||
| 262 | + } | ||
| 263 | + return _name; | ||
| 264 | +} | ||
| 265 | +- (UILabel *)certification { | ||
| 266 | + if (!_certification) { | ||
| 267 | + _certification = [[UILabel alloc] init]; | ||
| 268 | + _certification.numberOfLines = 1; | ||
| 269 | + _certification.textColor = [UIColor whiteColor]; | ||
| 270 | + _certification.font = [UIFont systemFontOfSize:16]; | ||
| 271 | + _certification.attributedText = [self createAttributedImages:@[@"mine_common", @"mine_overbadge", @"mine_wjj_certification"]]; | ||
| 272 | + } | ||
| 273 | + return _certification; | ||
| 274 | +} | ||
| 275 | +- (UILabel *)address { | ||
| 276 | + if (!_address) { | ||
| 277 | + _address = [[UILabel alloc] init]; | ||
| 278 | + _address.numberOfLines = 1; | ||
| 279 | + _address.textColor = [UIColor colorWithRed:140/255.0 green:140/255.0 blue:142/255.0 alpha:1.0]; | ||
| 280 | + _address.font = [UIFont systemFontOfSize:14]; | ||
| 281 | + _address.attributedText = [self createAttributedImageName:@"mine_location" string:@"北京" isFront:YES]; | ||
| 282 | + } | ||
| 283 | + return _address; | ||
| 284 | +} | ||
| 285 | +- (UIButton *)sign { | ||
| 286 | + if (!_sign) { | ||
| 287 | + _sign = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 288 | + _sign.frame = CGRectMake(0, 0, 105, 32); | ||
| 289 | + _sign.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.2]; | ||
| 290 | + [_sign setTitle:@"签到赚积分" forState:UIControlStateNormal]; | ||
| 291 | + _sign.titleLabel.font = [UIFont systemFontOfSize:13.0]; | ||
| 292 | + [_sign setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | ||
| 293 | + UIImage *xw_image = [self xw_getImageName:@"sign_in_soccer" bundle:@"CNLiveMineModule" targetClass:[CNLiveMineHeaderView class]]; | ||
| 294 | + [_sign setImage:xw_image forState:UIControlStateNormal]; | ||
| 295 | + [_sign addTarget:self action:@selector(signDidClicked:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 296 | + UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:_sign.layer.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerTopLeft cornerRadii:CGSizeMake(16, 16)]; | ||
| 297 | + CAShapeLayer *maskLayer = [CAShapeLayer layer]; | ||
| 298 | + maskLayer.frame = _sign.bounds; | ||
| 299 | + maskLayer.path = maskPath.CGPath; | ||
| 300 | + _sign.layer.mask = maskLayer; | ||
| 301 | + } | ||
| 302 | + return _sign; | ||
| 303 | +} | ||
| 304 | + | ||
| 305 | +#pragma mark - 响应方法 | ||
| 306 | +- (void)signDidClicked:(UIButton *)btn{ | ||
| 307 | + if (self.delegate && [self.delegate respondsToSelector:@selector(headerView:pushToController:)]) { | ||
| 308 | + [self.delegate headerView:self pushToController:CNLiveMineHeaderViewTypeSign]; | ||
| 309 | + } | ||
| 310 | +} | ||
| 311 | + | ||
| 312 | +- (void)witnessDidClicked:(UIButton *)btn{ | ||
| 313 | + if (self.delegate && [self.delegate respondsToSelector:@selector(headerView:pushToController:)]) { | ||
| 314 | + [self.delegate headerView:self pushToController:CNLiveMineHeaderViewTypeWintess]; | ||
| 315 | + } | ||
| 316 | +} | ||
| 317 | + | ||
| 318 | +/** | ||
| 319 | + * 创建图片 | ||
| 320 | + * | ||
| 321 | + * @param imageName 图片名字 | ||
| 322 | + * @param bundleName 图片所在的bundle名字 | ||
| 323 | + * @param targetClass 类和bundle的同级目录 | ||
| 324 | + * @return 返回UIImage | ||
| 325 | + */ | ||
| 326 | +- (UIImage *)xw_getImageName:(NSString *)imageName bundle:(NSString *)bundleName targetClass:(Class)targetClass{ | ||
| 327 | + NSBundle *bundle = [NSBundle bundleForClass:targetClass]; | ||
| 328 | + NSURL *url = [bundle URLForResource:bundleName withExtension:@"bundle"]; | ||
| 329 | + NSBundle *targetBundle = [NSBundle bundleWithURL:url]; | ||
| 330 | + UIImage *image = [UIImage imageNamed:imageName inBundle:targetBundle compatibleWithTraitCollection:nil]; | ||
| 331 | + return image?image:[UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil]; | ||
| 332 | + | ||
| 333 | +} | ||
| 334 | + | ||
| 335 | +@end |
CNLiveMineModule/Classes/View/CNLiveMineView.m deleted
100644 → 0
| 1 | -// | ||
| 2 | -// CNLiveMineView.m | ||
| 3 | -// CNLiveMineModule | ||
| 4 | -// | ||
| 5 | -// Created by 153993236@qq.com on 11/12/2019. | ||
| 6 | -// Copyright (c) 2019 153993236@qq.com. All rights reserved. | ||
| 7 | -// | ||
| 8 | - | ||
| 9 | -#import "CNLiveMineView.h" | ||
| 10 | - | ||
| 11 | -@interface CNLiveMineView() | ||
| 12 | - | ||
| 13 | -@end | ||
| 14 | - | ||
| 15 | -@implementation CNLiveMineView | ||
| 16 | - | ||
| 17 | - | ||
| 18 | -@end |
Example/CNLiveMineModule.xcodeproj/project.pbxproj
| @@ -305,16 +305,24 @@ | @@ -305,16 +305,24 @@ | ||
| 305 | "${BUILT_PRODUCTS_DIR}/CNLiveBeeHive/CNLiveBeeHive.framework", | 305 | "${BUILT_PRODUCTS_DIR}/CNLiveBeeHive/CNLiveBeeHive.framework", |
| 306 | "${BUILT_PRODUCTS_DIR}/CNLiveMineModule/CNLiveMineModule.framework", | 306 | "${BUILT_PRODUCTS_DIR}/CNLiveMineModule/CNLiveMineModule.framework", |
| 307 | "${BUILT_PRODUCTS_DIR}/CNLiveServices/CNLiveServices.framework", | 307 | "${BUILT_PRODUCTS_DIR}/CNLiveServices/CNLiveServices.framework", |
| 308 | + "${BUILT_PRODUCTS_DIR}/CNLiveTripartiteManagement/CNLiveTripartiteManagement.framework", | ||
| 308 | "${BUILT_PRODUCTS_DIR}/CNLiveUserManagement/CNLiveUserManagement.framework", | 309 | "${BUILT_PRODUCTS_DIR}/CNLiveUserManagement/CNLiveUserManagement.framework", |
| 309 | "${BUILT_PRODUCTS_DIR}/MJExtension/MJExtension.framework", | 310 | "${BUILT_PRODUCTS_DIR}/MJExtension/MJExtension.framework", |
| 311 | + "${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework", | ||
| 312 | + "${BUILT_PRODUCTS_DIR}/QMUIKit/QMUIKit.framework", | ||
| 313 | + "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", | ||
| 310 | ); | 314 | ); |
| 311 | name = "[CP] Embed Pods Frameworks"; | 315 | name = "[CP] Embed Pods Frameworks"; |
| 312 | outputPaths = ( | 316 | outputPaths = ( |
| 313 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBeeHive.framework", | 317 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBeeHive.framework", |
| 314 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveMineModule.framework", | 318 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveMineModule.framework", |
| 315 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveServices.framework", | 319 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveServices.framework", |
| 320 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveTripartiteManagement.framework", | ||
| 316 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveUserManagement.framework", | 321 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveUserManagement.framework", |
| 317 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJExtension.framework", | 322 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJExtension.framework", |
| 323 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Masonry.framework", | ||
| 324 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/QMUIKit.framework", | ||
| 325 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", | ||
| 318 | ); | 326 | ); |
| 319 | runOnlyForDeploymentPostprocessing = 0; | 327 | runOnlyForDeploymentPostprocessing = 0; |
| 320 | shellPath = /bin/sh; | 328 | shellPath = /bin/sh; |
Example/CNLiveMineModule/CNLIVEAppDelegate.m
| @@ -7,12 +7,18 @@ | @@ -7,12 +7,18 @@ | ||
| 7 | // | 7 | // |
| 8 | 8 | ||
| 9 | #import "CNLIVEAppDelegate.h" | 9 | #import "CNLIVEAppDelegate.h" |
| 10 | +#import "CNLiveMineController.h" | ||
| 10 | 11 | ||
| 11 | @implementation CNLIVEAppDelegate | 12 | @implementation CNLIVEAppDelegate |
| 12 | 13 | ||
| 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | 14 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions |
| 14 | { | 15 | { |
| 15 | // Override point for customization after application launch. | 16 | // Override point for customization after application launch. |
| 17 | + self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];//UIScreen mainScreen].bounds个人理解获取屏幕的硬件信息然后设置尺寸大小 | ||
| 18 | + CNLiveMineController *vc = [[CNLiveMineController alloc] init]; | ||
| 19 | + UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc]; | ||
| 20 | + self.window.rootViewController = nav;//设置根视图控制器 | ||
| 21 | + [self.window makeKeyAndVisible];//设置成为 | ||
| 16 | return YES; | 22 | return YES; |
| 17 | } | 23 | } |
| 18 | 24 |