Commit 87e2b9b9 authored by Steven杜宇's avatar Steven杜宇

Merge branch 'kjzf' into 'develop'

跨境支付

See merge request !23
parents eb98cc51 5cbf9035
......@@ -45,10 +45,11 @@ platform :ios do
GZL = "GZL"
xq = "xq"
webFix = "develop_bugfix_web"
kjzf = "kjzf"
#打包正使用的分支
myPack_branch = xq
myPack_branch = kjzf
# 打adhoc包 执行命令 fastlane galaxyTest
......
......@@ -8616,7 +8616,7 @@
CODE_SIGN_ENTITLEMENTS = yinheReplayExt/yinheReplayExt.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 4;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = RXHYW88XR7;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = yinheReplayExt/Info.plist;
......@@ -8628,7 +8628,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.3.0;
MARKETING_VERSION = 2.3.1;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy.yinheReplayExt;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......@@ -8646,7 +8646,7 @@
CODE_SIGN_ENTITLEMENTS = yinheReplayExt/yinheReplayExt.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 4;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = RXHYW88XR7;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = yinheReplayExt/Info.plist;
......@@ -8658,7 +8658,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.3.0;
MARKETING_VERSION = 2.3.1;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy.yinheReplayExt;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......@@ -8676,7 +8676,7 @@
CODE_SIGN_ENTITLEMENTS = yinheReplayExt/yinheReplayExt.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 4;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = RXHYW88XR7;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = yinheReplayExt/Info.plist;
......@@ -8688,7 +8688,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.3.0;
MARKETING_VERSION = 2.3.1;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy.yinheReplayExt;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......@@ -8706,7 +8706,7 @@
CODE_SIGN_ENTITLEMENTS = yinheReplayExt/yinheReplayExt.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 4;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = RXHYW88XR7;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = yinheReplayExt/Info.plist;
......@@ -8718,7 +8718,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.3.0;
MARKETING_VERSION = 2.3.1;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy.yinheReplayExt;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......@@ -8795,7 +8795,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxyTestEnv.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 4;
CURRENT_PROJECT_VERSION = 2;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......@@ -8823,7 +8823,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.3.0;
MARKETING_VERSION = 2.3.1;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......@@ -8944,7 +8944,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxy.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 4;
CURRENT_PROJECT_VERSION = 2;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......@@ -8972,7 +8972,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.3.0;
MARKETING_VERSION = 2.3.1;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......@@ -9155,7 +9155,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxyDebug.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 4;
CURRENT_PROJECT_VERSION = 2;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......@@ -9183,7 +9183,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.3.0;
MARKETING_VERSION = 2.3.1;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......@@ -9206,7 +9206,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxy.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 4;
CURRENT_PROJECT_VERSION = 2;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......@@ -9234,7 +9234,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.3.0;
MARKETING_VERSION = 2.3.1;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......
......@@ -330,6 +330,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
if let host = url.host, host.contains("platformId=wechat") {
return WXApi.handleOpen(url, delegate: self)
}
if handleAntomPayWithString(from: url.absoluteString) {
return true
}
if YHAnalytics.handleSchemeUrl(url) ?? false {
return true
}
......@@ -341,10 +344,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
}
func application(_ application: UIApplication, handleOpen url: URL) -> Bool {
if handleAntomPayWithString(from: url.absoluteString) {
return true
}
return WXApi.handleOpen(url, delegate: self)
}
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
if handleAntomPayWithString(from: url.absoluteString) {
return true
}
return WXApi.handleOpen(url, delegate: self)
}
......@@ -353,12 +362,55 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
// return isAppLinking
// }
func handleAntomPayWithString(from url: String) -> Bool {
if url.hasPrefix(YhConstant.AntomPay.universalLink + YhConstant.AntomPay.returnPath), let recordId = getAntomPayRecordIdWithString(from: url) {
if !YHLoginManager.shared.isLogin() {
return true
}
var tempUrl = ""
let baseUrl = YHBaseUrlManager.shared.curH5URL()
// baseUrl = "http://192.168.34.113:10301/"
tempUrl = baseUrl + YhConstant.AntomPay.gotoPath + "?\(YhConstant.AntomPay.recordId)=\(recordId)"
if YHLoginManager.shared.isLogin() {
let token = YHLoginManager.shared.h5Token
tempUrl = tempUrl + "&param=" + token
}
var tUrl = tempUrl
if !tempUrl.contains("navigationH=") {
tUrl = tempUrl + "?navigationH=\(k_Height_NavigationtBarAndStatuBar)"
if tempUrl.contains("?") {
tUrl = tempUrl + "&navigationH=\(k_Height_NavigationtBarAndStatuBar)"
}
}
let vc = YHH5WebViewVC()
vc.url = tUrl
UIViewController.current?.navigationController?.pushViewController(vc, animated: true)
return true
}
return false
}
func getAntomPayRecordIdWithString(from urlString: String) -> String? {
guard let url = URL(string: urlString),
let components = URLComponents(url: url, resolvingAgainstBaseURL: false) else {
return nil
}
return components.queryItems?.first { $0.name == YhConstant.AntomPay.recordId }?.value
}
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
if handleAntomPayWithString(from: userActivity.webpageURL?.absoluteString ?? "") {
return true
}
let isAppLinking = AGCAppLinking.instance().continueUserActivity(userActivity)
return isAppLinking == false ? WXApi.handleOpenUniversalLink(userActivity, delegate: self) : true
}
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
if handleAntomPayWithString(from: userActivity.webpageURL?.absoluteString ?? "") {
return true
}
let isAppLinking = AGCAppLinking.instance().continueUserActivity(userActivity)
return isAppLinking == false ? WXApi.handleOpenUniversalLink(userActivity, delegate: self) : true
}
......
......@@ -184,9 +184,9 @@ class YHBaseViewModel {
}
}
}
// 获取公链URL
func getPublicImageUrl(_ url: String, _ isPublic: Bool = false, callBackBlock: @escaping (_ success: String?, _ error: YHErrorModel?) -> Void) {
private func getCurrentPublicImageUrl(_ url: String, _ isPublic: Bool = false, callBackBlock: @escaping (_ success: String?, _ error: YHErrorModel?) -> Void) {
if YHNetworkStatusManager.shared.isNetWorkOK == false {
DispatchQueue.main.async {
YHHUD.flash(message: "网络不可用,请检查网络设置")
......@@ -206,6 +206,19 @@ class YHBaseViewModel {
}
}
// 获取公链URL,后续用getRealUsefulUrl,前期的调用默认中转到getRealUsefulUrl
func getPublicImageUrl(_ url: String, _ isPublic: Bool = false, callBackBlock: @escaping (_ success: String?, _ error: YHErrorModel?) -> Void) {
getRealUsefulUrl(url) { str in
if str.count > 0 {
callBackBlock(str, nil)
} else {
let errorModel = YHErrorModel(errorCode: 0, errorMsg: "网络不可用,请检查网络设置")
callBackBlock(nil, errorModel)
}
}
}
// 上传方法
func uploadFile(_ url: String, _ isPublic: Bool = false, callBackBlock: @escaping (_ success: String?, _ error: YHErrorModel?) -> Void) {
if YHNetworkStatusManager.shared.isNetWorkOK == false {
......@@ -272,7 +285,7 @@ class YHBaseViewModel {
}
// url不能直接访问
// 进行私链转公链处理
self.getPublicImageUrl(url) { success, _ in
self.getCurrentPublicImageUrl(url) { success, _ in
if let successUrl = success {
DispatchQueue.main.async {
callback(successUrl)
......
......@@ -285,9 +285,10 @@ class YHSelectLookTableViewCell: UITableViewCell {
if dataSource.catAttr == 2 {
flagLabel.isHidden = false
}
let a: ASAttributedString = .init("¥", .font(UIFont(name: "D-DIN-PRO-Bold", size: 14) ?? UIFont()), .foreground(UIColor.mainTextColor))
let b: ASAttributedString = .init("\(dataSource.linePrice.formattedPrice()) ", .font(UIFont(name: "D-DIN-PRO-Bold", size: 20) ?? UIFont()), .foreground(UIColor.mainTextColor))
let c: ASAttributedString = .init(\(dataSource.price.formattedPrice())", .font(UIFont(name: "D-DIN-PRO-Medium", size: 14) ?? UIFont()), .foreground(UIColor(hex: 0x8993a2)), .strikethrough(.single))
let currencyString = (dataSource.currency == "HKD") ? "HK$" : "¥"
let a: ASAttributedString = .init("\(currencyString)", .font(UIFont(name: "D-DIN-PRO-Medium", size: 14) ?? UIFont.PFSC_M(ofSize: 14)), .foreground(UIColor.mainTextColor))
let b: ASAttributedString = .init("\(dataSource.linePrice.formattedPrice()) ", .font(UIFont(name: "D-DIN-PRO-Bold", size: 20) ?? UIFont.PFSC_B(ofSize: 20)), .foreground(UIColor.mainTextColor))
let c: ASAttributedString = .init("\(currencyString)\(dataSource.price.formattedPrice())", .font(UIFont(name: "D-DIN-PRO-Medium", size: 14) ?? UIFont.PFSC_M(ofSize: 14)), .foreground(UIColor(hex: 0x8993a2)), .strikethrough(.single))
if dataSource.linePrice == dataSource.price {
self.subTitleLabel.attributed.text = a + b
} else {
......
......@@ -62,6 +62,9 @@ class YHSelectGoodsModel: SmartCodable {
var statusText: String = ""
var catAttrText: String = ""
var icons: [YHSelectGoodIconModel] = []
// 货币符号 HKD、CNY
var currency: String = ""
required init() {
}
}
......
......@@ -11,6 +11,7 @@ import UIKit
import dsBridge
import Photos
import Kingfisher
import SafariServices
/*
快速测评 及 其他与H5交互的界面
......@@ -547,6 +548,53 @@ extension YHH5WebViewVC {
func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) {
printLog("\(error.localizedDescription)")
}
func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
// WKWebView intercepts the redirection by default. Enable the redirection in the following ways.
// Operations such as opening Safari
printLog("navigationAction.request.url = ")
printLog(navigationAction.request.url)
guard let url = navigationAction.request.url else {
decisionHandler(.cancel)
printLog("decisionHandler(.cancel)")
return
}
let absoluteString = url.absoluteString
printLog("navigationAction.request.URL.absoluteString=====> \(absoluteString)")
if absoluteString == "about:blank" {
decisionHandler(.cancel)
return
}
if !(absoluteString.hasPrefix("https://") || absoluteString.hasPrefix("http://")) {
if absoluteString.hasPrefix("alipayconnect://") || absoluteString.hasPrefix("alipayhk://") {
self.openApp(with: url)
decisionHandler(.allow)
return
} else if absoluteString.hasPrefix("alipay://") || absoluteString.hasPrefix("alipays://") {
self.openApp(with: url)
decisionHandler(.allow) // fort test hjl 需要测试
return
}
}
decisionHandler(.allow)
}
// 辅助方法 - 打开应用
private func openApp(with url: URL?) {
guard let url = url else { return }
if UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
} else if url.absoluteString.hasPrefix("https://") || url.absoluteString.hasPrefix("http://") {
// 排除没加白名单导致应用没法打开导致崩溃
let safariViewController = SFSafariViewController(url: url)
safariViewController.dismissButtonStyle = .close
safariViewController.modalPresentationStyle = .fullScreen
UIViewController.current?.present(safariViewController, animated: true, completion: nil)
}
}
}
// MARK: - h5实现的接口
......
......@@ -18,6 +18,16 @@ class YHJsApi: NSObject {
}
extension YHJsApi {
// 37、查看是否安装了某个应用
@objc func isSomeAppInstalled(_ tag: String, handler: @escaping (String) -> Void) {
DispatchQueue.main.async {
if let url = URL(string: tag), UIApplication.shared.canOpenURL(url) {
handler("1")
} else {
handler("0")
}
}
}
// 32、 H5跳转App智能体会话页面
@objc func goAgentChatPage(_ dicData: String) {
......@@ -492,13 +502,21 @@ extension YHJsApi {
let isFullScreen: Int = jsonObject["isFullScreen"] as? Int ?? 1
let navTitle: String = jsonObject["navTitle"] as? String ?? ""
let hideNavigationTitleFlag: Int = jsonObject["hideNavigationTitleFlag"] as? Int ?? 0
let closeCurrentView: Int = jsonObject["closeCurrentView"] as? Int ?? 0
if isInformationUrl == 1 {
// 资讯详情
let vc = YHHomeWebViewController()
vc.id = id
vc.url = YHBaseUrlManager.shared.curH5URL() + "articleDetail.html" + "?id=\(id)"
self.delegate?.navigationController?.pushViewController(vc)
if let navigationController = UIViewController.current?.navigationController, closeCurrentView == 1, (navigationController.viewControllers.count) > 1 {
var viewControllers = navigationController.viewControllers
viewControllers.removeLast()
viewControllers.append(vc)
navigationController.setViewControllers(viewControllers, animated: true)
} else {
UIViewController.current?.navigationController?.pushViewController(vc)
}
} else {
// 普通界面
if !url.isEmpty {
......@@ -522,7 +540,14 @@ extension YHJsApi {
vc.isFullScreenFlag = isFullScreen == 1 ? true : false
vc.showNavigationTitleFlag = hideNavigationTitleFlag == 0 ? true : false
vc.navTitle = navTitle
self.delegate?.navigationController?.pushViewController(vc)
if let navigationController = UIViewController.current?.navigationController, closeCurrentView == 1, (navigationController.viewControllers.count) > 1 {
var viewControllers = navigationController.viewControllers
viewControllers.removeLast()
viewControllers.append(vc)
navigationController.setViewControllers(viewControllers, animated: true)
} else {
UIViewController.current?.navigationController?.pushViewController(vc)
}
}
}
} else {
......
......@@ -7,6 +7,7 @@
//
import UIKit
import SafariServices
enum YHFunctionGroupType: Int {
case none = 0
......@@ -302,6 +303,11 @@ class YHMyNewViewController: YHBaseViewController {
if !checkLogin() { return }
let vc = YHMySettingViewController()
self.navigationController?.pushViewController(vc)
// let vc = YHH5WebViewVC()
// vc.isFullScreenFlag = false
// vc.url = "http://192.168.34.113:10301/superAppBridge.html#/order/antom-pay?id=1864&param=eyJhbGbolyFeciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NTc0NzI5MzAsImkiOjQyMzgxNzEzODcwNzAyMSwidSI6IumTtuays-mbhuWboiIsInIiOiJzdXBlcl9hcHAifQ.Phsg13OfN5XJ0cLe759U2W0hH1iTZeneimgTlnouPcg"
// self.navigationController?.pushViewController(vc)
}
}
......
......@@ -362,7 +362,7 @@ class YHPlanTestViewController: YHBaseViewController {
policyVieiw.bannerArr = policyArr
let url = "https://test-hklife.galaxy-immi.com/superAppBridge.html#/plan-analysis?code="
let url = YHBaseUrlManager.shared.curH5URL() + "superAppBridge.html#/plan-analysis?code="
pdfCreateUrl = url + self.viewModel.planListModel.code
pdfDownloadUrl = self.viewModel.planListModel.pdf_url
shareUrl = self.viewModel.planListModel.share_url
......
......@@ -274,6 +274,14 @@ extension YhConstant {
}
// MARK: - 跨境支付
struct AntomPay {
static let universalLink = "https://www.galaxy-immi.com/yinheApp/"
static let returnPath = "antomPayReturnUrl"
static let gotoPath = "superAppBridge.html#/order/antom-pay-result"
static let recordId = "record_id"
}
// MARK: - 七鱼客服系统SDK
struct QiYuSDK {
static let appKey = "7922dbeb48141b15d2ae2e91cc156af5"
......
......@@ -2,8 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
......@@ -106,6 +104,10 @@
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>alipay</string>
<string>alipays</string>
<string>alipayconnect</string>
<string>alipayhk</string>
<string>weixin</string>
<string>weixinULAPI</string>
<string>weixinURLParamsAPI</string>
......@@ -136,6 +138,8 @@
<key>UIImageName</key>
<string>AppIcon</string>
</dict>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
<key>agc_applinking_not_read_pasteboard</key>
<false/>
</dict>
......
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