Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
GMBase
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
GMBase
Commits
1a2a9e6b
Commit
1a2a9e6b
authored
May 12, 2020
by
jz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add files
parent
42d48fd1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
124 additions
and
0 deletions
+124
-0
GMBaseWebViewController.h
GMBase/Classes/Common/GMBaseWebViewController.h
+124
-0
GMBaseWebViewController.m
GMBase/Classes/Common/GMBaseWebViewController.m
+0
-0
No files found.
GMBase/Classes/Common/GMBaseWebViewController.h
0 → 100644
View file @
1a2a9e6b
//
// GMBaseWebViewController.h
// ZhengXing
//
// Created by wangyang on 3/5/19.
// Copyright (c) 2019 Wanmei Creative. All rights reserved.
// 后期替代WMBaseViewController&WMBrowserViewController
@import
GMShareSDK
;
//#import <GMShareSDK/GMShareSDK.h>
#define kWebPhantom @"phantom"// 常用于H5新页面
#define kWebHybrid @"hybrid" // 常用于H5老页面
//#import <GMShareSDK/GMShareView.h>
////#import "GMShareView.h"
//#import <GMShareSDK/WMShareObject.h>
//#import <GMShareSDK/GMDiaryShareView.h>
//#import <GMShareSDK/GMClientH5Object.h>
#import "GMWebViewModel.h"
typedef
NS_ENUM
(
NSInteger
,
GMWebPageType
)
{
GMWebPageTypeNomal
=
0
,
GMWebPageTypeSign
=
1
,
// 签到H5页面
GMWebPageTypeTopicDetail
=
2
,
// 日记贴
GMWebPageTypeAnswer
=
3
,
// 回答
GMWebPageTypeArticle
=
4
,
// 话题
GMWebPageTypeSpecial
=
5
,
// 专栏
GMWebPageTypeUserTopic
=
6
,
// 用户贴
GMWebPageTypeQuestion
=
7
,
// 回答 7.20 灰度用
GMWebPageTypeHospitalRank
=
8
,
// 医院榜单
GMWebPageTypeDoctorRank
=
9
,
// 医生榜单
};
@import
GMKit
;
@class
GMWebViewComponent
;
@interface
GMBaseWebViewController
:
WMBaseViewController
<
GMClientH5BridgeDelegate
>
{
/**
* @brief 下面都是从js中得到的数据。其中_jsGlobalObject字典包含其它数据
*/
NSDictionary
*
_jsGlobalObject
;
// 是否显示了分享
BOOL
_isShowShare
;
// 是否收藏
BOOL
_isFavored
;
// 是否是自己发的贴
BOOL
_isPrivate
;
// 是否是签到,签到导航栏透明,返回按钮、title颜色、rightIcon单独设置
BOOL
_isSign
;
}
@property
(
nonatomic
,
strong
)
GMWebViewComponent
*
webCompent
;
/// web上数据处理
@property
(
nonatomic
,
strong
)
GMWebViewModel
*
viewModel
;
/**
* @brief 要请求的 H5 url 除了 http://backend.dev.gengmei.cc/hybrid" 这部分后的path。比如一个h5是 http://backend.dev.gengmei.cc/hybrid/topic/3332214,那么path指需要赋值@"/topic/3332214"即可.
@note 在viewDidLoad前配置好。必须以"/"开头。重写moreQueryParameters可以添加额外query
*/
@property
(
nonatomic
,
strong
)
NSString
*
path
;
/**
* @brief 对于从服务器那儿获取到的完整H5 url,使用该属性。
@note 在viewDidLoad前配置好。会覆盖path属性。重写moreQueryParameters可以添加额外query
*/
@property
(
nonatomic
,
strong
)
NSString
*
fullURL
;
/// 通过webPageType 页面不同设置不同的差异性
@property
(
nonatomic
,
assign
)
GMWebPageType
webPageType
;
#pragma mark - 分享
@property
(
nonatomic
,
strong
)
GMShareView
*
shareView
;
@property
(
nonatomic
,
strong
)
GMDiaryShareView
*
diaryShareView
;
/*** @brief 收藏url**/
@property
(
nonatomic
,
strong
)
NSString
*
favUrl
;
/*** @brief 从_jsGlobalObject中获取的分享Model */
@property
(
nonatomic
,
strong
)
WMShareObject
*
shareObject
;
/*** @brief 日记分享Model数组 */
@property
(
nonatomic
,
strong
)
NSMutableArray
*
diaryShareArr
;
/*** @brief 微信分享Model */
@property
(
nonatomic
,
strong
)
WMShareObject
*
weixinShareObject
;
/*** @brief 分享的配置 */
@property
(
nonatomic
,
strong
)
GMShareConfigObject
*
shareConfigObject
;
@property
(
nonatomic
,
strong
)
NSString
*
favorType
;
/**
设置打开的权限类型
*/
@property
(
nonatomic
,
assign
)
NSInteger
settingType
;
@property
(
nonatomic
,
assign
)
BOOL
backNeedRefresh
;
/**
* @brief 重写该方法,为fullURL在请求前添加更多参数。必须以 & 开头
* 原方法只返回了空字符串,不需要call super
*
* @return 要额外添加的参数。如:&key1=value&key2=value
*/
-
(
NSString
*
)
moreQueryParameters
;
/**
调用该方法以重新构造URL并且[_webView loadRequest:request];
*/
-
(
void
)
reloadURL
;
/**
处理请求URL
*/
-
(
void
)
handleURL
;
// 一般情况下 页面刷新时候调用
-
(
void
)
refreshWebView
;
// 本地获取通用数据
-
(
NSString
*
)
nativeCommonParam
;
@end
GMBase/Classes/Common/GMBaseWebViewController.m
0 → 100644
View file @
1a2a9e6b
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment