新增实名及修复bug
This commit is contained in:
@@ -1667,7 +1667,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.3;
|
MARKETING_VERSION = 1.0.4;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "linyudan.yinmeng-ios";
|
PRODUCT_BUNDLE_IDENTIFIER = "linyudan.yinmeng-ios";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||||
@@ -1711,7 +1711,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.3;
|
MARKETING_VERSION = 1.0.4;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "linyudan.yinmeng-ios";
|
PRODUCT_BUNDLE_IDENTIFIER = "linyudan.yinmeng-ios";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||||
|
@@ -22,7 +22,7 @@ class YMNetworkHelper: NSObject {
|
|||||||
parameters["ispType"] = "1"
|
parameters["ispType"] = "1"
|
||||||
parameters["channel"] = APPUtils.currentChannle
|
parameters["channel"] = APPUtils.currentChannle
|
||||||
parameters["netType"] = "2"
|
parameters["netType"] = "2"
|
||||||
parameters["app"] = "yinmeng"
|
parameters["app"] = "mew"
|
||||||
parameters["appVersion"] = APPUtils.appVersion
|
parameters["appVersion"] = APPUtils.appVersion
|
||||||
parameters["deviceId"] = APPUtils.currentDeveiceId
|
parameters["deviceId"] = APPUtils.currentDeveiceId
|
||||||
return parameters
|
return parameters
|
||||||
|
@@ -11,9 +11,11 @@ enum AppKeys {
|
|||||||
static let nimAppid = "5d5a833a2d0ff1304a5d8bed53d2af5b"
|
static let nimAppid = "5d5a833a2d0ff1304a5d8bed53d2af5b"
|
||||||
static let api = "http://beta.api.ymlive.fun/"
|
static let api = "http://beta.api.ymlive.fun/"
|
||||||
static let agoraKey = "5b4d929b6c4e4af190550c4a2ec5cd4c"
|
static let agoraKey = "5b4d929b6c4e4af190550c4a2ec5cd4c"
|
||||||
|
static let H5_URL = "http://beta.api.ymlive.fun"
|
||||||
#else
|
#else
|
||||||
static let nimAppid = "5e76ec47632d86c30ce18eabfa332b6a"
|
static let nimAppid = "5e76ec47632d86c30ce18eabfa332b6a"
|
||||||
static let api = "https://api.ymlive.fun/"
|
static let api = "https://api.ymlive.fun/"
|
||||||
static let agoraKey = "5b4d929b6c4e4af190550c4a2ec5cd4c"
|
static let agoraKey = "5b4d929b6c4e4af190550c4a2ec5cd4c"
|
||||||
|
static let H5_URL = "https://h5.ymlive.fun"
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@@ -13,4 +13,5 @@ enum H5Utils:String {
|
|||||||
case logoff = "modules/logout/index.html"
|
case logoff = "modules/logout/index.html"
|
||||||
case pay = "mew/modules/rule/rechargeAgreement.html"
|
case pay = "mew/modules/rule/rechargeAgreement.html"
|
||||||
case rank = "modules/roomRank/index.html"
|
case rank = "modules/roomRank/index.html"
|
||||||
|
case autonym = "modules/identity/new.html"
|
||||||
}
|
}
|
||||||
|
@@ -21,7 +21,7 @@ let keyWindow = UIApplication.shared.windows.first!
|
|||||||
|
|
||||||
let DesKey = "1ea53d260ecf11e7b56e00163e046a26"
|
let DesKey = "1ea53d260ecf11e7b56e00163e046a26"
|
||||||
|
|
||||||
let H5_URL = "http://beta.h5.ymlive.fun"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -7,12 +7,14 @@
|
|||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
import WebKit
|
import WebKit
|
||||||
|
import MJExtension
|
||||||
class WebViewWeakScriptMessage: NSObject, WKScriptMessageHandler {
|
class WebViewWeakScriptMessage: NSObject, WKScriptMessageHandler {
|
||||||
|
|
||||||
private(set) weak var target: WKScriptMessageHandler?
|
private(set) weak var target: WKScriptMessageHandler?
|
||||||
|
|
||||||
required init(target: WKScriptMessageHandler?) {
|
required init(target: WKScriptMessageHandler?) {
|
||||||
self.target = target
|
self.target = target
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -30,8 +32,20 @@ class WebViewController: BaseViewController {
|
|||||||
|
|
||||||
private(set) var progressView = UIProgressView()
|
private(set) var progressView = UIProgressView()
|
||||||
|
|
||||||
private lazy var userContentController = WKUserContentController()
|
|
||||||
|
private lazy var userContentController:WKUserContentController = {
|
||||||
|
let scriptMessage = WebViewWeakScriptMessage(target: self);
|
||||||
|
|
||||||
|
let _userContentController = WKUserContentController()
|
||||||
|
_userContentController.add(self, name: "getUid")
|
||||||
|
_userContentController.add(self, name: "getDeviceId")
|
||||||
|
_userContentController.add(self, name: "getTicket")
|
||||||
|
_userContentController.add(self, name: "getDeviceInfo")
|
||||||
|
_userContentController.add(self, name: "initShowNav")
|
||||||
|
_userContentController.add(self, name: "closeWebView")
|
||||||
|
_userContentController.add(self, name: "cancelAccount")
|
||||||
|
return _userContentController
|
||||||
|
}()
|
||||||
private var callbacks: [String: [OnReceiveMessage]] = [:]
|
private var callbacks: [String: [OnReceiveMessage]] = [:]
|
||||||
|
|
||||||
private(set) weak var navigationDelegate: WKNavigationDelegate?
|
private(set) weak var navigationDelegate: WKNavigationDelegate?
|
||||||
@@ -47,7 +61,7 @@ class WebViewController: BaseViewController {
|
|||||||
self.isHalf = isHalf
|
self.isHalf = isHalf
|
||||||
if var url = url {
|
if var url = url {
|
||||||
if !url.hasPrefix("http") {
|
if !url.hasPrefix("http") {
|
||||||
url = "\(H5_URL)/\(url)"
|
url = "\(AppKeys.H5_URL)/\(url)"
|
||||||
}
|
}
|
||||||
self.url = url
|
self.url = url
|
||||||
}
|
}
|
||||||
@@ -59,7 +73,9 @@ class WebViewController: BaseViewController {
|
|||||||
loadSubViews()
|
loadSubViews()
|
||||||
loadWebView()
|
loadWebView()
|
||||||
}
|
}
|
||||||
|
deinit{
|
||||||
|
print("1111")
|
||||||
|
}
|
||||||
override func viewWillAppear(_ animated: Bool) {
|
override func viewWillAppear(_ animated: Bool) {
|
||||||
super.viewWillAppear(animated)
|
super.viewWillAppear(animated)
|
||||||
addObserve()
|
addObserve()
|
||||||
@@ -157,8 +173,11 @@ class WebViewController: BaseViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
webview.load(URLRequest(url: theUrl))
|
webview.load(URLRequest(url: theUrl))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func reloadWebViewWithUrl(_ url: String) {
|
func reloadWebViewWithUrl(_ url: String) {
|
||||||
self.url = url
|
self.url = url
|
||||||
loadWebView()
|
loadWebView()
|
||||||
@@ -170,8 +189,18 @@ class WebViewController: BaseViewController {
|
|||||||
configuration.allowsInlineMediaPlayback = true
|
configuration.allowsInlineMediaPlayback = true
|
||||||
configuration.allowsPictureInPictureMediaPlayback = true
|
configuration.allowsPictureInPictureMediaPlayback = true
|
||||||
configuration.selectionGranularity = .character
|
configuration.selectionGranularity = .character
|
||||||
configuration.userContentController = userContentController
|
|
||||||
|
let cookie = "uid=\(AuthManager.userUid)"
|
||||||
|
let cookieScript = WKUserScript.init(source: "document.cookie = '\(cookie)';", injectionTime: .atDocumentStart, forMainFrameOnly: false)
|
||||||
|
self.userContentController.addUserScript(cookieScript)
|
||||||
|
|
||||||
|
let scale = "$('meta[name=description]').remove(); $('head').append( '<meta name=\"viewport\" content=\"width=device-width, initial-scale=1,user-scalable=no\">' );"
|
||||||
|
|
||||||
|
let scaleScript = WKUserScript.init(source: scale, injectionTime: .atDocumentEnd, forMainFrameOnly: false)
|
||||||
|
self.userContentController.addUserScript(scaleScript)
|
||||||
|
configuration.userContentController = self.userContentController
|
||||||
|
|
||||||
|
|
||||||
let preferences = WKPreferences()
|
let preferences = WKPreferences()
|
||||||
if #available(iOS 14, *) {
|
if #available(iOS 14, *) {
|
||||||
let webpagePreferences = WKWebpagePreferences()
|
let webpagePreferences = WKWebpagePreferences()
|
||||||
@@ -185,6 +214,18 @@ class WebViewController: BaseViewController {
|
|||||||
configuration.preferences = preferences
|
configuration.preferences = preferences
|
||||||
let webview = WKWebView(frame: UIScreen.main.bounds, configuration: configuration)
|
let webview = WKWebView(frame: UIScreen.main.bounds, configuration: configuration)
|
||||||
webview.navigationDelegate = self
|
webview.navigationDelegate = self
|
||||||
|
webview.evaluateJavaScript("navigator.userAgent") {[weak self] res, error in
|
||||||
|
guard let self = self else{return}
|
||||||
|
if let text = res as? NSString{
|
||||||
|
if !text.contains("tutuAppIos erbanAppIos"){
|
||||||
|
let newText = (text as String) + "tutuAppIos erbanAppIos"
|
||||||
|
let dic = ["UserAgent":newText]
|
||||||
|
UserDefaults.standard.register(defaults: dic)
|
||||||
|
UserDefaults.standard.synchronize()
|
||||||
|
self.webview.customUserAgent = newText
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return webview
|
return webview
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,10 +241,54 @@ extension WebViewController: WKScriptMessageHandler {
|
|||||||
|
|
||||||
func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
|
func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
|
||||||
//TODO: 拦截一些h5的事件
|
//TODO: 拦截一些h5的事件
|
||||||
|
webview.evaluateJavaScript("document.location.href") {[weak self] res, error in
|
||||||
|
guard let self = self else{return}
|
||||||
|
if let curUrl = res{
|
||||||
|
if message.name == "getUid"{
|
||||||
|
let uid = "getMessage(\"uid\",\(AuthManager.userUid))"
|
||||||
|
self.webview.evaluateJavaScript(uid) { other, error in
|
||||||
|
|
||||||
|
}
|
||||||
|
}else if message.name == "getTicket"{
|
||||||
|
let ticket = "getMessage(\"ticket\",\"\(AuthManager.ticket)\")"
|
||||||
|
self.webview.evaluateJavaScript(ticket) { other, error in
|
||||||
|
|
||||||
|
}
|
||||||
|
}else if message.name == "getDeviceId"{
|
||||||
|
let deviceId = "getMessage(\"deviceId\",\"\(APPUtils.currentDeveiceId)\")"
|
||||||
|
self.webview.evaluateJavaScript(deviceId) { other, error in
|
||||||
|
|
||||||
|
}
|
||||||
|
}else if message.name == "getDeviceInfo"{
|
||||||
|
let info = NSDictionary(dictionary: YMNetworkHelper.share.baseParameters)
|
||||||
|
if let infoText = info.mj_JSONString() {
|
||||||
|
let text = "getMessage(\"deviceInfo\",\(infoText))"
|
||||||
|
self.webview.evaluateJavaScript(text) { other, error in
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}else if message.name == "initShowNav"{
|
||||||
|
if let body = message.body as? Int,body == 0{
|
||||||
|
if self.navigationController != nil{
|
||||||
|
self.navigationController?.setNavigationBarHidden(true, animated: false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else if message.name == "closeWebView"{
|
||||||
|
if let body = message.body as? Int,body == 0{
|
||||||
|
if self.navigationController != nil{
|
||||||
|
self.navigationController?.popViewController(animated: true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else if message.name == "cancelAccount"{
|
||||||
|
AuthViewModel.authVM.logout()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension WebViewController: WKNavigationDelegate {
|
extension WebViewController: WKNavigationDelegate{
|
||||||
|
|
||||||
func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) {
|
func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) {
|
||||||
progressView.alpha = 1
|
progressView.alpha = 1
|
||||||
@@ -224,4 +309,5 @@ extension WebViewController: WKNavigationDelegate {
|
|||||||
}
|
}
|
||||||
navigationDelegate?.webView?(webView, didFailProvisionalNavigation: navigation, withError: error)
|
navigationDelegate?.webView?(webView, didFailProvisionalNavigation: navigation, withError: error)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -41,9 +41,9 @@ class AuthViewModel: NSObject {
|
|||||||
if let token = token {
|
if let token = token {
|
||||||
let params = ["auaccess_token": token]
|
let params = ["auaccess_token": token]
|
||||||
RequestPost(path: "acc/logout", parma: params) { data in
|
RequestPost(path: "acc/logout", parma: params) { data in
|
||||||
print("你好")
|
|
||||||
} fail: { code, msg in
|
} fail: { code, msg in
|
||||||
print("de")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.loginSuccess.onNext(false)
|
self.loginSuccess.onNext(false)
|
||||||
|
@@ -219,7 +219,17 @@ public class UserPayViewManager: NSObject {
|
|||||||
_ConditionBlock(StoreConditionResult.VerifiedServer,dic)
|
_ConditionBlock(StoreConditionResult.VerifiedServer,dic)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 退订
|
||||||
|
@objc public func refunRequest(view: UIView,transactionId:UInt64) async{
|
||||||
|
do {
|
||||||
|
if let scene = await view.window?.windowScene{
|
||||||
|
try await Transaction.beginRefundRequest(for:transactionId , in: scene)
|
||||||
|
}
|
||||||
|
|
||||||
|
}catch{
|
||||||
|
print("iap error")
|
||||||
|
}
|
||||||
|
}
|
||||||
// 支付监听事件
|
// 支付监听事件
|
||||||
func _listenForTransactions() -> Task<Void, Error> {
|
func _listenForTransactions() -> Task<Void, Error> {
|
||||||
return Task.detached {
|
return Task.detached {
|
||||||
|
@@ -25,5 +25,7 @@ struct RoomDataModel : HandyJSON {
|
|||||||
var type:Int = 3
|
var type:Int = 3
|
||||||
var audioSdkType = ""
|
var audioSdkType = ""
|
||||||
var showGiftValue = false
|
var showGiftValue = false
|
||||||
|
var leaveMode = false
|
||||||
|
var gender:UserSexType? = .Boy
|
||||||
|
var isReselect = false
|
||||||
}
|
}
|
||||||
|
@@ -30,7 +30,7 @@ class YinRoomTRTCManager: NSObject {
|
|||||||
cloud.enableAudioVolumeEvaluation(true, with: params)
|
cloud.enableAudioVolumeEvaluation(true, with: params)
|
||||||
let yinParams = TRTCParams()
|
let yinParams = TRTCParams()
|
||||||
if AuthViewModel.authVM.appId.isEmpty{
|
if AuthViewModel.authVM.appId.isEmpty{
|
||||||
yinParams.sdkAppId = UInt32("1400798783") ?? 0
|
yinParams.sdkAppId = UInt32("1400820672") ?? 0
|
||||||
}else{
|
}else{
|
||||||
yinParams.sdkAppId = UInt32(AuthViewModel.authVM.appId) ?? 0
|
yinParams.sdkAppId = UInt32(AuthViewModel.authVM.appId) ?? 0
|
||||||
}
|
}
|
||||||
|
@@ -31,6 +31,11 @@ class NormalMicSeatCell: UICollectionViewCell {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var isShowGiftValue = false{
|
||||||
|
didSet{
|
||||||
|
micSeatView.isShowGiftValue = isShowGiftValue
|
||||||
|
}
|
||||||
|
}
|
||||||
var user:UserObject? = nil{
|
var user:UserObject? = nil{
|
||||||
didSet{
|
didSet{
|
||||||
micSeatView.user = user
|
micSeatView.user = user
|
||||||
|
@@ -95,8 +95,6 @@ class NormalMicSeatSuperView: MicSeatSuperView {
|
|||||||
addSubview(roomOwnerView)
|
addSubview(roomOwnerView)
|
||||||
addSubview(collectionView)
|
addSubview(collectionView)
|
||||||
roomOwnerView.snp.makeConstraints { make in
|
roomOwnerView.snp.makeConstraints { make in
|
||||||
|
|
||||||
|
|
||||||
make.height.equalTo(UIDevice.scaleWidth(width: 103))
|
make.height.equalTo(UIDevice.scaleWidth(width: 103))
|
||||||
make.top.leading.trailing.equalTo(UIDevice.scaleWidth(width: 0))
|
make.top.leading.trailing.equalTo(UIDevice.scaleWidth(width: 0))
|
||||||
}
|
}
|
||||||
@@ -123,28 +121,41 @@ class NormalMicSeatSuperView: MicSeatSuperView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if roomOwnerView.user != nil{
|
if roomOwnerView.user != nil{
|
||||||
if roomOwnerView.user!.uid == AuthManager.userUid{
|
if let leaveMode = self.roomData?.leaveMode,leaveMode == false{
|
||||||
let popUpView = PlanetStarPopUpView.init(frame: CGRect(x: 0, y: 0, width: ScreenWidth, height: ScreenHeight))
|
if roomOwnerView.user!.uid == AuthManager.userUid{
|
||||||
keyWindow.addSubview(popUpView)
|
|
||||||
popUpView.textView.text = "确定下麦旁听吗?"
|
let popUpView = PlanetStarPopUpView.init(frame: CGRect(x: 0, y: 0, width: ScreenWidth, height: ScreenHeight))
|
||||||
popUpView.senderView.setTitle("确定", for: .normal)
|
keyWindow.addSubview(popUpView)
|
||||||
popUpView.bgPointView.isHidden = true
|
popUpView.textView.text = "确定下麦旁听吗?"
|
||||||
popUpView.pointTextView.isHidden = true
|
popUpView.senderView.setTitle("确定", for: .normal)
|
||||||
popUpView.clickSendBlcok = {
|
popUpView.bgPointView.isHidden = true
|
||||||
let downRequest = NIMChatroomQueueRemoveRequest()
|
popUpView.pointTextView.isHidden = true
|
||||||
downRequest.key = "\(-1)"
|
popUpView.clickSendBlcok = {
|
||||||
downRequest.roomId = roomid
|
let downRequest = NIMChatroomQueueRemoveRequest()
|
||||||
NIMSDK.shared().chatroomManager.removeChatroomQueueObject(downRequest) { (error, info) in
|
downRequest.key = "\(-1)"
|
||||||
|
downRequest.roomId = roomid
|
||||||
|
NIMSDK.shared().chatroomManager.removeChatroomQueueObject(downRequest) { (error, info) in
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if let showUserInfoBlock = self.showUserInfoBlock,let user = roomOwnerView.user{
|
||||||
|
showUserInfoBlock(["-1":user])
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if let showUserInfoBlock = self.showUserInfoBlock,let user = roomOwnerView.user{
|
if roomOwnerView.user!.uid == AuthManager.userUid{
|
||||||
showUserInfoBlock(["-1":user])
|
HUDTool.show(with: "请关闭离开模式")
|
||||||
|
}else{
|
||||||
|
if let showUserInfoBlock = self.showUserInfoBlock,let user = roomOwnerView.user{
|
||||||
|
showUserInfoBlock(["-1":user])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,7 +183,11 @@ class NormalMicSeatSuperView: MicSeatSuperView {
|
|||||||
|
|
||||||
func setMicList(){
|
func setMicList(){
|
||||||
if let roomid = self.roomData?.roomId{
|
if let roomid = self.roomData?.roomId{
|
||||||
NIMSDK.shared().chatroomManager.fetchChatroomQueue(roomid) { error, data in
|
if let showGiftValue = self.roomData?.showGiftValue{
|
||||||
|
roomOwnerView.isShowGiftValue = showGiftValue;
|
||||||
|
}
|
||||||
|
NIMSDK.shared().chatroomManager.fetchChatroomQueue(roomid) {[weak self] error, data in
|
||||||
|
guard let self = self else { return}
|
||||||
if error == nil,let _data = data{
|
if error == nil,let _data = data{
|
||||||
for item in _data {
|
for item in _data {
|
||||||
|
|
||||||
@@ -188,12 +203,20 @@ class NormalMicSeatSuperView: MicSeatSuperView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let leaveMode = self.roomData?.leaveMode,leaveMode == true{
|
||||||
|
var obj = UserObject()
|
||||||
|
obj.avatar = self.roomData?.avatar
|
||||||
|
obj.nick = self.roomData?.nick;
|
||||||
|
obj.uid = Int(self.roomData?.uid ?? "")
|
||||||
|
obj.gender = self.roomData?.gender
|
||||||
|
self.roomOwnerView.user = obj
|
||||||
|
self.roomOwnerView.isLeaveMode = true
|
||||||
|
}
|
||||||
|
|
||||||
self.collectionView.reloadData()
|
self.collectionView.reloadData()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -249,6 +272,9 @@ extension NormalMicSeatSuperView:UICollectionViewDelegate,UICollectionViewDataSo
|
|||||||
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "NormalMicSeatCell", for: indexPath) as! NormalMicSeatCell
|
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "NormalMicSeatCell", for: indexPath) as! NormalMicSeatCell
|
||||||
let user = roomUserList[indexPath.row ]
|
let user = roomUserList[indexPath.row ]
|
||||||
cell.text = "\(indexPath.row + 1)"
|
cell.text = "\(indexPath.row + 1)"
|
||||||
|
if let showGiftValue = self.roomData?.showGiftValue{
|
||||||
|
cell.isShowGiftValue = showGiftValue;
|
||||||
|
}
|
||||||
if user.user != nil{
|
if user.user != nil{
|
||||||
|
|
||||||
cell.user = user.user
|
cell.user = user.user
|
||||||
@@ -260,7 +286,10 @@ extension NormalMicSeatSuperView:UICollectionViewDelegate,UICollectionViewDataSo
|
|||||||
}
|
}
|
||||||
|
|
||||||
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
|
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
|
||||||
|
if let leaveMode = self.roomData?.leaveMode,leaveMode == true,roomData?.uid == "\(AuthManager.userUid)"{
|
||||||
|
HUDTool.show(with: "请关闭离开模式")
|
||||||
|
return
|
||||||
|
}
|
||||||
guard let roomUid = self.roomData?.roomId else { return }
|
guard let roomUid = self.roomData?.roomId else { return }
|
||||||
let user = roomUserList[indexPath.row]
|
let user = roomUserList[indexPath.row]
|
||||||
var index:Int = -2
|
var index:Int = -2
|
||||||
@@ -298,6 +327,9 @@ extension NormalMicSeatSuperView:UICollectionViewDelegate,UICollectionViewDataSo
|
|||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (index == -2){
|
if (index == -2){
|
||||||
upMicAction(index: "\(indexPath.row)")
|
upMicAction(index: "\(indexPath.row)")
|
||||||
return
|
return
|
||||||
@@ -347,11 +379,12 @@ extension NormalMicSeatSuperView:UICollectionViewDelegate,UICollectionViewDataSo
|
|||||||
if let pos = data[NIMChatroomEventInfoQueueChangeItemKey] as? String,let value = data[NIMChatroomEventInfoQueueChangeItemValueKey],let userData = Deserialized<UserObject>.toModel(with: value) ,let changeType = data[NIMChatroomEventInfoQueueChangeTypeKey] as? Int{
|
if let pos = data[NIMChatroomEventInfoQueueChangeItemKey] as? String,let value = data[NIMChatroomEventInfoQueueChangeItemValueKey],let userData = Deserialized<UserObject>.toModel(with: value) ,let changeType = data[NIMChatroomEventInfoQueueChangeTypeKey] as? Int{
|
||||||
if pos == "-1"{
|
if pos == "-1"{
|
||||||
if changeType == 1{
|
if changeType == 1{
|
||||||
|
|
||||||
roomOwnerView.user = userData
|
roomOwnerView.user = userData
|
||||||
|
|
||||||
if userData.uid == AuthManager.userUid,let showGiftValue = roomData?.showGiftValue,showGiftValue == true{
|
// if userData.uid == AuthManager.userUid{
|
||||||
upMicAction(index: pos)
|
// upMicAction(index: pos)
|
||||||
}
|
// }
|
||||||
|
|
||||||
}else if changeType == 2{
|
}else if changeType == 2{
|
||||||
roomOwnerView.user = nil
|
roomOwnerView.user = nil
|
||||||
@@ -361,9 +394,9 @@ extension NormalMicSeatSuperView:UICollectionViewDelegate,UICollectionViewDataSo
|
|||||||
if changeType == 1,let i = Int(pos){
|
if changeType == 1,let i = Int(pos){
|
||||||
let user = roomUserList[i]
|
let user = roomUserList[i]
|
||||||
user.user = userData
|
user.user = userData
|
||||||
if userData.uid == AuthManager.userUid,let showGiftValue = roomData?.showGiftValue,showGiftValue == true{
|
// if userData.uid == AuthManager.userUid{
|
||||||
upMicAction(index: pos)
|
// upMicAction(index: pos)
|
||||||
}
|
// }
|
||||||
}else if changeType == 2,let i = Int(pos){
|
}else if changeType == 2,let i = Int(pos){
|
||||||
let user = roomUserList[i]
|
let user = roomUserList[i]
|
||||||
if collectionView.cellForItem(at: IndexPath(row: i, section: 0)) is NormalMicSeatCell{
|
if collectionView.cellForItem(at: IndexPath(row: i, section: 0)) is NormalMicSeatCell{
|
||||||
@@ -401,7 +434,12 @@ extension NormalMicSeatSuperView:UICollectionViewDelegate,UICollectionViewDataSo
|
|||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
updateGiftNumber()
|
if let showGiftValue = roomData?.showGiftValue,showGiftValue == true{
|
||||||
|
updateGiftNumber()
|
||||||
|
}else{
|
||||||
|
self.collectionView.reloadData()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -21,6 +21,17 @@ class NormalMicSeatView: UIView {
|
|||||||
setUILayout()
|
setUILayout()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
var isShowGiftValue = false{
|
||||||
|
didSet{
|
||||||
|
giftValueView.isHidden = !isShowGiftValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var isLeaveMode:Bool = false {
|
||||||
|
didSet{
|
||||||
|
leaveView.isHidden = !isLeaveMode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var user:UserObject? = nil{
|
var user:UserObject? = nil{
|
||||||
didSet{
|
didSet{
|
||||||
|
|
||||||
@@ -52,7 +63,7 @@ class NormalMicSeatView: UIView {
|
|||||||
addSubview(speakView)
|
addSubview(speakView)
|
||||||
addSubview(avatarView)
|
addSubview(avatarView)
|
||||||
addSubview(nameStackView)
|
addSubview(nameStackView)
|
||||||
|
addSubview(leaveView)
|
||||||
|
|
||||||
nameStackView.addArrangedSubview(postionView)
|
nameStackView.addArrangedSubview(postionView)
|
||||||
nameStackView.addArrangedSubview(nameView)
|
nameStackView.addArrangedSubview(nameView)
|
||||||
@@ -68,6 +79,9 @@ class NormalMicSeatView: UIView {
|
|||||||
make.top.equalTo(UIDevice.scaleWidth(width: 5))
|
make.top.equalTo(UIDevice.scaleWidth(width: 5))
|
||||||
make.centerX.equalTo(self)
|
make.centerX.equalTo(self)
|
||||||
}
|
}
|
||||||
|
leaveView.snp.makeConstraints { make in
|
||||||
|
make.edges.equalTo(avatarView)
|
||||||
|
}
|
||||||
nameStackView.snp.makeConstraints { make in
|
nameStackView.snp.makeConstraints { make in
|
||||||
make.top.equalTo(avatarView.snp.bottom).offset(UIDevice.scaleWidth(width: 10))
|
make.top.equalTo(avatarView.snp.bottom).offset(UIDevice.scaleWidth(width: 10))
|
||||||
make.width.lessThanOrEqualTo(self)
|
make.width.lessThanOrEqualTo(self)
|
||||||
@@ -189,6 +203,12 @@ class NormalMicSeatView: UIView {
|
|||||||
return _speakParser
|
return _speakParser
|
||||||
}()
|
}()
|
||||||
var isPlay = false
|
var isPlay = false
|
||||||
|
|
||||||
|
private lazy var leaveView:UILabel = {
|
||||||
|
let _leaveView = UILabel.getCustomLabel(text: "离开",font: UIFont.getScaleFont(ofSize: 16, weight: .regular),color: .white,textAlignment: .center,backgroundColor: ThemeColor(hexStr: "#000000",alpha: 0.45),masksToBounds: true,cornerRadius: UIDevice.scaleWidth(width: 50)/2)
|
||||||
|
_leaveView.isHidden = true
|
||||||
|
return _leaveView
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
extension NormalMicSeatView:SVGAPlayerDelegate{
|
extension NormalMicSeatView:SVGAPlayerDelegate{
|
||||||
func svgaPlayerDidFinishedAnimation(_ player: SVGAPlayer!) {
|
func svgaPlayerDidFinishedAnimation(_ player: SVGAPlayer!) {
|
||||||
|
@@ -204,7 +204,7 @@ class PlanetStarClickItemView: UIView {
|
|||||||
self.isStop = true
|
self.isStop = true
|
||||||
self.vapView.transform = CGAffineTransformIdentity
|
self.vapView.transform = CGAffineTransformIdentity
|
||||||
let j = view.tag - 100
|
let j = view.tag - 100
|
||||||
self.chooseModel = self.dataList[j]
|
self.chooseModel = self.dataList[safe: j]
|
||||||
if let _chooseModel = self.chooseModel{
|
if let _chooseModel = self.chooseModel{
|
||||||
self.sexImageVeiw.image = _chooseModel.gender == 1 ? UIImage(named: "yin_plane_star_man") : UIImage(named: "yin_plane_star__woman")
|
self.sexImageVeiw.image = _chooseModel.gender == 1 ? UIImage(named: "yin_plane_star_man") : UIImage(named: "yin_plane_star__woman")
|
||||||
self.nameLabelView.text = _chooseModel.nick
|
self.nameLabelView.text = _chooseModel.nick
|
||||||
|
@@ -26,13 +26,17 @@ class BindMobileVC: BaseViewController, HiddenNavigationBarProtocol {
|
|||||||
view.addSubview(phoneNumView)
|
view.addSubview(phoneNumView)
|
||||||
view.addSubview(backBtn)
|
view.addSubview(backBtn)
|
||||||
view.addSubview(titleLb)
|
view.addSubview(titleLb)
|
||||||
|
view.addSubview(codeView)
|
||||||
|
|
||||||
phoneNumView.addSubview(areaLb)
|
phoneNumView.addSubview(areaLb)
|
||||||
phoneNumView.addSubview(phonetextFiled)
|
phoneNumView.addSubview(phonetextFiled)
|
||||||
|
|
||||||
codeView.addSubview(codetextFiled)
|
codeView.addSubview(codetextFiled)
|
||||||
codeView.addSubview(sepView)
|
codeView.addSubview(sepView)
|
||||||
codeView.addSubview(getCodeBtn)
|
codeView.addSubview(getCodeBtn)
|
||||||
|
|
||||||
|
view.addSubview(confirmBtn)
|
||||||
|
|
||||||
backImgView.snp.makeConstraints { make in
|
backImgView.snp.makeConstraints { make in
|
||||||
make.edges.equalTo(view)
|
make.edges.equalTo(view)
|
||||||
}
|
}
|
||||||
@@ -44,14 +48,14 @@ class BindMobileVC: BaseViewController, HiddenNavigationBarProtocol {
|
|||||||
}
|
}
|
||||||
|
|
||||||
titleLb.snp.makeConstraints { make in
|
titleLb.snp.makeConstraints { make in
|
||||||
make.centerX.equalToSuperview()
|
make.centerX.equalToSuperview()
|
||||||
make.centerY.equalTo(backBtn)
|
make.centerY.equalTo(backBtn)
|
||||||
}
|
}
|
||||||
|
|
||||||
phoneNumView.snp.makeConstraints { make in
|
phoneNumView.snp.makeConstraints { make in
|
||||||
make.left.right.equalToSuperview().inset(36)
|
make.left.right.equalToSuperview().inset(36)
|
||||||
make.height.equalTo(52)
|
make.height.equalTo(52)
|
||||||
make.top.equalToSuperview().offset(60)
|
make.top.equalToSuperview().offset(NavHeight + 20)
|
||||||
}
|
}
|
||||||
|
|
||||||
areaLb.snp.makeConstraints { make in
|
areaLb.snp.makeConstraints { make in
|
||||||
@@ -87,7 +91,7 @@ make.centerX.equalToSuperview()
|
|||||||
}
|
}
|
||||||
|
|
||||||
confirmBtn.snp.makeConstraints { make in
|
confirmBtn.snp.makeConstraints { make in
|
||||||
make.left.right.equalToSuperview().inset(36)
|
make.left.right.equalToSuperview().inset(36)
|
||||||
make.top.equalTo(codeView.snp.bottom).offset(30)
|
make.top.equalTo(codeView.snp.bottom).offset(30)
|
||||||
make.height.equalTo(52)
|
make.height.equalTo(52)
|
||||||
}
|
}
|
||||||
|
@@ -37,6 +37,7 @@ class UserInfoVC: BaseViewController, HiddenNavigationBarProtocol {
|
|||||||
view.addSubview(aboutView)
|
view.addSubview(aboutView)
|
||||||
view.addSubview(logOffView)
|
view.addSubview(logOffView)
|
||||||
view.addSubview(logoutBtn)
|
view.addSubview(logoutBtn)
|
||||||
|
view.addSubview(autonymView)
|
||||||
|
|
||||||
backImgView.snp.makeConstraints { make in
|
backImgView.snp.makeConstraints { make in
|
||||||
make.edges.equalTo(view)
|
make.edges.equalTo(view)
|
||||||
@@ -51,17 +52,25 @@ class UserInfoVC: BaseViewController, HiddenNavigationBarProtocol {
|
|||||||
rechargeView.snp.makeConstraints { make in
|
rechargeView.snp.makeConstraints { make in
|
||||||
make.left.equalTo(view).inset(28)
|
make.left.equalTo(view).inset(28)
|
||||||
make.height.equalTo(68)
|
make.height.equalTo(68)
|
||||||
make.right.equalTo(myRoomView.snp.left).offset(-11)
|
make.right.equalTo(-28)
|
||||||
make.top.equalTo(view).offset(NavHeight + 20)
|
make.top.equalTo(view).offset(NavHeight + 20)
|
||||||
}
|
}
|
||||||
|
let width = (ScreenWidth - 56 - 11)/2
|
||||||
myRoomView.snp.makeConstraints { make in
|
myRoomView.snp.makeConstraints { make in
|
||||||
make.centerY.height.width.equalTo(rechargeView)
|
make.height.equalTo(rechargeView)
|
||||||
make.right.equalTo(view).offset(-28)
|
make.width.equalTo(width)
|
||||||
|
make.top.equalTo(rechargeView.snp.bottom).offset(12)
|
||||||
|
make.left.equalTo(view).inset(28)
|
||||||
|
}
|
||||||
|
autonymView.snp.makeConstraints { make in
|
||||||
|
make.height.width.equalTo(myRoomView)
|
||||||
|
make.top.equalTo(rechargeView.snp.bottom).offset(12)
|
||||||
|
make.right.equalTo(view).inset(28)
|
||||||
}
|
}
|
||||||
mobileView.snp.makeConstraints { make in
|
mobileView.snp.makeConstraints { make in
|
||||||
make.left.equalTo(view).offset(28)
|
make.left.equalTo(view).offset(28)
|
||||||
make.height.equalTo(68)
|
make.height.equalTo(68)
|
||||||
make.top.equalTo(rechargeView.snp.bottom).offset(12)
|
make.top.equalTo(myRoomView.snp.bottom).offset(12)
|
||||||
make.right.equalTo(passwordView.snp.left).offset(-11)
|
make.right.equalTo(passwordView.snp.left).offset(-11)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,13 +94,15 @@ class UserInfoVC: BaseViewController, HiddenNavigationBarProtocol {
|
|||||||
make.height.equalTo(48)
|
make.height.equalTo(48)
|
||||||
make.top.equalTo(logOffView.snp.bottom).offset(48)
|
make.top.equalTo(logOffView.snp.bottom).offset(48)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@objc func logoutBtnAction() {
|
@objc func logoutBtnAction() {
|
||||||
AuthViewModel.authVM.logout()
|
AuthViewModel.authVM.logout()
|
||||||
}
|
}
|
||||||
|
|
||||||
private lazy var backImgView: UIImageView = {
|
private lazy var backImgView: UIImageView = {
|
||||||
let imageView = UIImageView()
|
let imageView = UIImageView()
|
||||||
imageView.image = UIImage(named: "auth_login_bg")
|
imageView.image = UIImage(named: "auth_login_bg")
|
||||||
@@ -122,6 +133,13 @@ class UserInfoVC: BaseViewController, HiddenNavigationBarProtocol {
|
|||||||
let item = UserFunctionItem(title: "我的房间", isHiddenIcon: true ,itmeType: .myRoom)
|
let item = UserFunctionItem(title: "我的房间", isHiddenIcon: true ,itmeType: .myRoom)
|
||||||
_myRoomView.item = item
|
_myRoomView.item = item
|
||||||
return _myRoomView
|
return _myRoomView
|
||||||
|
}()
|
||||||
|
private lazy var autonymView: UserFunctionView = {
|
||||||
|
let _autonymView = UserFunctionView()
|
||||||
|
_autonymView.delegate = self
|
||||||
|
let item = UserFunctionItem(title: "实名认证", isHiddenIcon: true ,itmeType: .autonym)
|
||||||
|
_autonymView.item = item
|
||||||
|
return _autonymView
|
||||||
}()
|
}()
|
||||||
private lazy var mobileView: UserFunctionView = {
|
private lazy var mobileView: UserFunctionView = {
|
||||||
let view = UserFunctionView()
|
let view = UserFunctionView()
|
||||||
@@ -181,12 +199,34 @@ extension UserInfoVC: UserFunctionViewProtocol{
|
|||||||
self.navigationController?.pushViewController(vc, animated: true)
|
self.navigationController?.pushViewController(vc, animated: true)
|
||||||
print("aaa")
|
print("aaa")
|
||||||
case .myRoom:
|
case .myRoom:
|
||||||
|
let params = ["uid":"\(AuthManager.userUid)","intoUid":"\(AuthManager.userUid)"]
|
||||||
let vc = RoomVC(roomUid: "\(AuthManager.userUid)")
|
RequestGet(path: "room/get", parma: params) { data in
|
||||||
vc.roomText = (self.info?.nick ?? "") + "的房间"
|
if let info = Deserialized<RoomDataModel>.toModel(with: data) {
|
||||||
let nav = BaseNavigationViewController.init(rootViewController: vc)
|
if info.isReselect{
|
||||||
nav.modalPresentationStyle = .fullScreen
|
if let isCertified = self.info?.isCertified,isCertified == false{
|
||||||
self.present(nav, animated: true, completion: nil)
|
let popUpView = PlanetStarPopUpView.init(frame: CGRect(x: 0, y: 0, width: ScreenWidth, height: ScreenHeight))
|
||||||
|
self.view.addSubview(popUpView)
|
||||||
|
popUpView.textView.text = "为了营造更安全的网络环境\n在 开通个人房间前\n需要先进行实名认证"
|
||||||
|
popUpView.senderView.setTitle("去认证", for: .normal)
|
||||||
|
popUpView.bgPointView.isHidden = true
|
||||||
|
popUpView.pointTextView.isHidden = true
|
||||||
|
popUpView.clickSendBlcok = {[weak self] in
|
||||||
|
let web = WebViewController(url: "mew/\(H5Utils.autonym.rawValue)")
|
||||||
|
self?.navigationController?.pushViewController(web, animated: true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
let vc = RoomVC(roomUid: "\(AuthManager.userUid)")
|
||||||
|
vc.roomText = (self.info?.nick ?? "") + "的房间"
|
||||||
|
let nav = BaseNavigationViewController.init(rootViewController: vc)
|
||||||
|
nav.modalPresentationStyle = .fullScreen
|
||||||
|
self.present(nav, animated: true, completion: nil)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} fail: { code, message in
|
||||||
|
HUDTool.show(with: message)
|
||||||
|
}
|
||||||
|
|
||||||
case .mobile:
|
case .mobile:
|
||||||
if self.info?.isBindPhone == true {
|
if self.info?.isBindPhone == true {
|
||||||
HUDTool.show(with: "您已绑定手机号")
|
HUDTool.show(with: "您已绑定手机号")
|
||||||
@@ -202,12 +242,16 @@ extension UserInfoVC: UserFunctionViewProtocol{
|
|||||||
} else {
|
} else {
|
||||||
self.navigationController?.pushViewController(BindMobileVC(), animated: true)
|
self.navigationController?.pushViewController(BindMobileVC(), animated: true)
|
||||||
}
|
}
|
||||||
print("aaa")
|
|
||||||
case .logoff:
|
case .logoff:
|
||||||
let web = WebViewController(url: "yinmeng/\(H5Utils.logoff.rawValue)")
|
let web = WebViewController(url: "yinmeng/\(H5Utils.logoff.rawValue)")
|
||||||
self.navigationController?.pushViewController(web, animated: true)
|
self.navigationController?.pushViewController(web, animated: true)
|
||||||
case .about:
|
case .about:
|
||||||
self.navigationController?.pushViewController(AboutUsVC(), animated: true)
|
self.navigationController?.pushViewController(AboutUsVC(), animated: true)
|
||||||
|
case .autonym:
|
||||||
|
let web = WebViewController(url: "mew/\(H5Utils.autonym.rawValue)")
|
||||||
|
self.navigationController?.pushViewController(web, animated: true)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -14,6 +14,7 @@ enum UserFunctionType:Int {
|
|||||||
case password
|
case password
|
||||||
case about
|
case about
|
||||||
case logoff
|
case logoff
|
||||||
|
case autonym
|
||||||
}
|
}
|
||||||
|
|
||||||
struct UserFunctionItem {
|
struct UserFunctionItem {
|
||||||
@@ -37,6 +38,7 @@ struct UserObject: HandyJSON {
|
|||||||
var userLevelVo:userLevelModel?
|
var userLevelVo:userLevelModel?
|
||||||
var userVoice = ""
|
var userVoice = ""
|
||||||
var voiceDura = ""
|
var voiceDura = ""
|
||||||
|
var isCertified = false
|
||||||
}
|
}
|
||||||
|
|
||||||
struct userLevelModel:HandyJSON{
|
struct userLevelModel:HandyJSON{
|
||||||
|
Reference in New Issue
Block a user