14 Achegas 24ae517354 ... 63d81f24e4

Autor SHA1 Mensaxe Data
  “HeShaoZe” 63d81f24e4 add添加 hai 4 meses
  “HeShaoZe” 0bf2bfd661 替你 hai 4 meses
  “HeShaoZe” 4d97885986 优化 hai 4 meses
  “HeShaoZe” 7dd85a8cd3 添加文件 hai 4 meses
  “HeShaoZe” 01d879f309 优化 hai 4 meses
  “HeShaoZe” 0f2c9ce48d fix:添加。 hai 4 meses
  “HeShaoZe” a6a0398479 1 hai 4 meses
  “HeShaoZe” ec255edc7a 优化。 hai 4 meses
  “HeShaoZe” 677db69fcb Merge branch 'v1.1.0' into v1.1.0-iOS hai 4 meses
  “HeShaoZe” 813a5b1fe8 fix:修复支付失败后展示缺少支付失败引导弹窗。 hai 4 meses
  “HeShaoZe” 49f96c4592 fix:解决bug列表的一些问题。 hai 4 meses
  “HeShaoZe” 2a6af263ed 优化 hai 4 meses
  “HeShaoZe” 8ae54a8ab1 fix:怎家锚点样式 hai 4 meses
  “HeShaoZe” 10f83dc6c9 fix:锚点样式设置。 hai 4 meses

+ 1 - 0
assets/string/base/string.xml

@@ -49,6 +49,7 @@
     <string name="member_level_undefined">未知</string>
 
     <string name="member_try_out">会员试用</string>
+    <string name="member_received_membership">已领会员</string>
 
     <string name="member_card_no_login_desc">升级VIP会员,享受更多权益</string>
     <string name="member_card_no_vip_desc">开通VIP会员,享受更多权益</string>

+ 1 - 1
lib/module/main/main_controller.dart

@@ -471,7 +471,7 @@ class MainController extends BaseController {
   void onShowRequestHelpTip() {
     String? memberPageKeyStr = KVUtil.getString(_kChickHelpAlertKey, '');
     if (memberStatusInfo.value?.expired == true &&
-        (memberPageKeyStr ?? '').isEmpty) {
+        (memberPageKeyStr ?? '').length == 0) {
       ///永久化存储
       KVUtil.putString(_kChickHelpAlertKey, _kChickHelpAlertKey);
       UrgentContactClickHelpDialog.show(confirmOnTap: () {

+ 3 - 7
lib/module/member/member_controller.dart

@@ -324,16 +324,9 @@ class MemberController extends BaseController implements PaymentStatusCallback {
 
   ///支付错误的时候调用
   void showRetainDialog() {
-    if (_isPopBackInProgress) {
-      // 如果正在处理返回逻辑,直接跳过
-      return;
-    }
-    _isPopBackInProgress = true; // 锁定状态
     MemberRetainDialog.show(payClick: () {
       onBuyClick();
-      _isPopBackInProgress = false;
     }, cancelClick: () {
-      _isPopBackInProgress = false;
       if (!Platform.isIOS) {
         back();
       }
@@ -424,6 +417,7 @@ class MemberController extends BaseController implements PaymentStatusCallback {
       LoadingDialog.hide();
       ToastUtil.show("支付失败,请稍后重试");
       print('购买失败: ${result['error']}');
+      showRetainDialog();
     }
   }
 
@@ -572,10 +566,12 @@ class MemberController extends BaseController implements PaymentStatusCallback {
       debugPrint('zk---payError: $error, $errorMessage');
       errorPayToast(error);
       errorEventReport(payMethod);
+      showRetainDialog();
     }, error: (int errno, String? error) {
       debugPrint('zk---error: $errno, $error');
       errorPayToast(errno);
       errorEventReport(payMethod);
+      showRetainDialog();
     });
   }
 

+ 1 - 1
lib/module/member/member_header_cycle_widget.dart

@@ -42,7 +42,7 @@ class _MemberHeaderCycleWidgetState extends State<MemberHeaderCycleWidget> {
   }
 
   void _startAutoPlay() {
-    Future.delayed(Duration(seconds: 3), () {
+    Future.delayed(Duration(seconds: 5), () {
       if (_controller.hasClients) {
         _controller.nextPage(
           duration: Duration(milliseconds: 500),

+ 1 - 1
lib/module/mine/mine_page.dart

@@ -213,7 +213,7 @@ class MinePage extends BasePage<MineController> {
       decoration: BoxDecoration(
           color: '#267B7DFF'.color, borderRadius: BorderRadius.circular(26.w)),
       padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 5.w),
-      child: Text(StringName.memberTryOut,
+      child: Text((controller.memberStatusInfo?.trialed == false) ? StringName.memberTryOut : StringName.memberReceivedMembership,
           style: TextStyle(fontSize: 12.sp, color: '#8163FF'.color)),
     );
   }

+ 2 - 0
lib/resource/string.gen.dart

@@ -40,6 +40,7 @@ class StringName {
   static String get memberLevel3660000 => 'member_level_3660000'.tr; // 终身会员
   static String get memberLevelUndefined => 'member_level_undefined'.tr; // 未知
   static String get memberTryOut => 'member_try_out'.tr; // 会员试用
+  static String get memberReceivedMembership => 'member_received_membership'.tr; // 已领会员
   static String get memberCardNoLoginDesc => 'member_card_no_login_desc'.tr; // 升级VIP会员,享受更多权益
   static String get memberCardNoVipDesc => 'member_card_no_vip_desc'.tr; // 开通VIP会员,享受更多权益
   static String get memberCardExpirationDesc => 'member_card_expiration_desc'.tr; // 到期
@@ -351,6 +352,7 @@ class StringMultiSource {
       'member_level_3660000': '终身会员',
       'member_level_undefined': '未知',
       'member_try_out': '会员试用',
+      'member_received_membership': '已领会员',
       'member_card_no_login_desc': '升级VIP会员,享受更多权益',
       'member_card_no_vip_desc': '开通VIP会员,享受更多权益',
       'member_card_expiration_desc': '到期',

+ 33 - 0
plugins/map_mapkit_ios/ios/Classes/MapView/Extension/String+Size.swift

@@ -0,0 +1,33 @@
+//
+//  String+Size.swift
+//  map_mapkit_ios
+//
+//  Created by 诺诺诺的言 on 2025/7/16.
+//
+
+import Foundation
+
+
+extension String {
+    func width(withConstrainedHeight height: CGFloat, font: UIFont) -> CGFloat {
+        let constraintRect = CGSize(width: .greatestFiniteMagnitude, height: height)
+        let boundingBox = self.boundingRect(
+            with: constraintRect,
+            options: [.usesLineFragmentOrigin, .usesFontLeading],
+            attributes: [NSAttributedString.Key.font: font],
+            context: nil
+        )
+        return ceil(boundingBox.width)
+    }
+    
+    func height(withConstrainedWidth width: CGFloat, font: UIFont) -> CGFloat {
+        let constraintRect = CGSize(width: width, height: .greatestFiniteMagnitude)
+        let boundingBox = self.boundingRect(
+            with: constraintRect,
+            options: [.usesLineFragmentOrigin, .usesFontLeading],
+            attributes: [NSAttributedString.Key.font: font],
+            context: nil
+        )
+        return ceil(boundingBox.height)
+    }
+}

+ 13 - 2
plugins/map_mapkit_ios/ios/Classes/MapView/MapViewController.swift

@@ -112,7 +112,18 @@ extension MapViewController: MKMapViewDelegate {
         guard let marker = annotation as? ATMapMarker else {
             return nil
         }
-        
+        print("markerTypesfdsdfs---\(marker.markerType.markType)");
+        if marker.markerType.isMapAchorPoint {
+            let annotationView = (mapView.dequeueReusableAnnotationView(withIdentifier: MapAnnotationAnchorPointView.identifier) as? MapAnnotationAnchorPointView) ?? MapAnnotationAnchorPointView(annotation: marker, reuseIdentifier: MapAnnotationAnchorPointView.identifier)
+            annotationView.marker = marker
+            annotationView.prepareForDisplay()
+            return annotationView
+        } else if (marker.markerType.isTracePopup) {
+            let annotationBubbleView = (mapView.dequeueReusableAnnotationView(withIdentifier: MapAnotationBubbleView.identifier) as? MapAnotationBubbleView) ?? MapAnotationBubbleView(annotation: marker, reuseIdentifier: MapAnotationBubbleView.identifier)
+            annotationBubbleView.marker = marker
+            annotationBubbleView.prepareForDisplay()
+            return annotationBubbleView
+        }
         let annotationView = (mapView.dequeueReusableAnnotationView(withIdentifier: MapAnnotationView.identifier) as? MapAnnotationView) ?? MapAnnotationView(annotation: marker, reuseIdentifier: MapAnnotationView.identifier)
         annotationView.marker = marker
         annotationView.prepareForDisplay()
@@ -142,7 +153,7 @@ extension MapViewController: MKMapViewDelegate {
         // 设置箭头样式
         renderer.arrowColor = UIColor.white // 箭头颜色
         renderer.arrowSize = 12      // 增大箭头大小
-        renderer.arrowSpacing = 40   // 减小箭头间距
+        renderer.arrowSpacing = 50   // 减小箭头间距
         renderer.borderWidth = 1
         renderer.borderColor = UIColor(red: 0.35, green: 0.36, blue: 0.99, alpha: 1)
         

+ 24 - 0
plugins/map_mapkit_ios/ios/Classes/MapView/Model/MapMarkerSupportType.swift

@@ -16,6 +16,14 @@ protocol MapMarkerSupportType: Codable {
     func imageName(selected: Bool) -> String
 
     var size: CGSize { get }
+    
+    var isMapAchorPoint : Bool {get}
+    
+    var isTracePopup : Bool {get}
+    
+    var markType : MapMarkerSupportType {get}
+    
+    var isTracePassing : Bool {get}
 }
 
 // 创建一个全局辅助类来处理解码/编码
@@ -84,4 +92,20 @@ enum MarkerType: Int, MapMarkerSupportType {
                 return CGSize(width: 44, height: 52)
         }
     }
+    
+    var isMapAchorPoint : Bool {
+        return self == .tracePassing || self == .trackError
+    }
+    
+    var markType: MapMarkerSupportType {
+        return self
+    }
+    
+    var isTracePassing : Bool {
+        return self == .tracePassing
+    }
+    
+    var isTracePopup : Bool {
+        return self == .tracePopup
+    }
 }

+ 122 - 0
plugins/map_mapkit_ios/ios/Classes/MapView/Views/MapAnnotationAnchorPointView.swift

@@ -0,0 +1,122 @@
+//
+//  MapAnnotationAnchorPointView.swift
+//  map_mapkit_ios
+//
+//  Created by 诺诺诺的言 on 2025/7/15.
+//
+
+import UIKit
+import MapKit
+
+class MapAnnotationAnchorPointView: MKAnnotationView {
+    
+    static let identifier: String = "MapAnnotationAnchorPointView"
+
+    var marker: ATMapMarker? {
+        didSet {
+            updateView()
+        }
+    }
+
+    var centerContentView: UIView?
+    
+
+    override init(annotation: MKAnnotation?, reuseIdentifier: String?) {
+        super.init(annotation: annotation, reuseIdentifier: reuseIdentifier)
+        self.backgroundColor = UIColor.purple
+        self.marker = annotation as? ATMapMarker
+//        self.isEnabled = marker?.markerType.supportSelected ?? false
+//        self.isHidden = false
+    }
+
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    // MARK: - 视图更新与重用
+    
+    override func prepareForReuse() {
+        super.prepareForReuse()
+        // 清除当前所有子视图
+        for subview in subviews {
+            subview.removeFromSuperview()
+        }
+    }
+    
+    private func updateView() {
+        // 确保在更新视图前移除所有子视图
+        for subview in subviews {
+            subview.removeFromSuperview()
+        }
+        
+        
+        guard marker != nil else { return }
+        
+        let supContentView = UIView();
+        supContentView.frame = CGRect(x: 0, y: 0, width: 30, height: 30)
+        supContentView.backgroundColor = UIColor.clear
+        addSubview(supContentView)
+        
+        if (marker?.markerType.isTracePassing ?? false) {
+            let whiteView = UIView(frame: CGRect(x: 0, y: 0, width: 18, height: 18))
+            whiteView.center = supContentView.center;
+            whiteView.backgroundColor = UIColor.white
+            whiteView.layer.cornerRadius = 9
+            whiteView.layer.masksToBounds = true
+            supContentView.addSubview(whiteView)
+            //supContentView.addSubview(whiteView)
+            
+            centerContentView = UIView();
+            centerContentView?.frame = CGRect(x: 2, y: 2, width: 14, height: 14)
+            centerContentView?.backgroundColor = UIColor(hex: "#15CBA1") //UIColor(hex: "#15CBA1")
+            centerContentView?.layer.cornerRadius = 7
+            centerContentView?.layer.masksToBounds = true // 裁剪超出圆角部分的内容
+            whiteView.addSubview(centerContentView ?? UIView())
+        } else {
+            let errorImage = UIImageView(frame: supContentView.bounds)
+            errorImage.contentMode = .scaleAspectFit
+            errorImage.image = readImageContentFrom(imageName: "com.shishi.dingwei_location_error.png")
+            //errorImage.translatesAutoresizingMaskIntoConstraints = false
+            supContentView.addSubview(errorImage)
+        }
+        
+        supContentView.translatesAutoresizingMaskIntoConstraints = false
+        NSLayoutConstraint.activate([
+            supContentView.centerXAnchor.constraint(equalTo: centerXAnchor),
+            supContentView.centerYAnchor.constraint(equalTo: centerYAnchor),
+            supContentView.widthAnchor.constraint(equalToConstant: 30),
+            supContentView.heightAnchor.constraint(equalToConstant: 30)
+        ])
+    }
+    
+    
+    private func readImageContentFrom(imageName : String) -> UIImage {
+        if let image = UIImage(named: imageName) {
+            return image
+        }
+        
+        // 尝试从插件资源束加载
+        let bundleURL = Bundle(for: MapAnnotationView.self).url(forResource: "map_mapkit_ios_resources", withExtension: "bundle")
+        if let bundleURL = bundleURL, let resourceBundle = Bundle(url: bundleURL) {
+            return UIImage(named: imageName, in: resourceBundle, compatibleWith: nil) ?? UIImage()
+        }
+        
+        return  UIImage()
+    }
+    
+    
+    // MARK: - 更新视图
+    
+    override func layoutSubviews() {
+        super.layoutSubviews()
+        print("layoutSubviewssfsfsdf----");
+        updateCenterOffset()
+    }
+    
+    private func updateCenterOffset() {
+        let markerSize = CGSize(width: 30, height: 30)
+        // 没有文本时,仅需要将图片底部对准坐标点
+        centerOffset = CGPoint(x: 0, y: -markerSize.height/2)
+    }
+    
+}

+ 240 - 0
plugins/map_mapkit_ios/ios/Classes/MapView/Views/MapAnotationBubbleView.swift

@@ -0,0 +1,240 @@
+//
+//  MapAnotationBubbleView.swift
+//  map_mapkit_ios
+//
+//  Created by 诺诺诺的言 on 2025/7/16.
+//
+
+import MapKit
+
+class MapAnotationBubbleView : MKAnnotationView {
+    
+    static let identifier: String = "MapAnotationBubbleView"
+
+    var marker: ATMapMarker? {
+        didSet {
+            updateView()
+        }
+    }
+    
+    private var allContentView : UIView!
+    private var markerContentView : UIView!
+    private var bgImageView : UIImageView!
+    
+    private var titleLabelView: UILabel!
+    private var bottomView : UIView!
+    private var triangleLayer: CAShapeLayer!
+    
+    private var bubbleHeight: CGFloat = 24
+    private var triangleHeight: CGFloat = 6
+    
+    // spacing between text and image
+    let spacing: CGFloat = 6
+    
+    var annotationSelected: Bool {
+        return (marker?.isSelected ?? false) || self.isSelected
+    }
+    
+    override init(annotation: MKAnnotation?, reuseIdentifier: String?) {
+        super.init(annotation: annotation, reuseIdentifier: reuseIdentifier)
+        self.marker = annotation as? ATMapMarker
+        self.isEnabled = marker?.markerType.supportSelected ?? false
+        self.isHidden = false
+    }
+
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    // MARK: - 视图更新与重用
+    
+    override func prepareForReuse() {
+        super.prepareForReuse()
+        // 清除当前所有子视图
+        for subview in subviews {
+            subview.removeFromSuperview()
+        }
+        markerContentView = nil
+        markerContentView = nil
+    }
+    
+    private func updateView() {
+        // 确保在更新视图前移除所有子视图
+        for subview in subviews {
+            subview.removeFromSuperview()
+        }
+        
+        guard let marker = marker else { return }
+        
+        let tags = marker.tags
+        let mainTiel : String =  tags?["title"] ?? "";
+        let mainDesc : String = tags?["desc"] ?? "";
+        
+        let markerContentViewW = 170
+        
+        markerContentView = UIView()
+        markerContentView.backgroundColor = UIColor(hex: "#FFFFFF")
+        markerContentView.layer.cornerRadius = 12
+        markerContentView.layer.masksToBounds = true
+        markerContentView.layer.shadowColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.08).cgColor
+        markerContentView.layer.shadowOpacity = 1
+        markerContentView.layer.shadowRadius = 4
+        markerContentView.layer.shadowOffset = CGSize(width: 0, height: 4)
+        addSubview(markerContentView)
+        
+        
+        titleLabelView = UILabel()
+        titleLabelView.translatesAutoresizingMaskIntoConstraints = false // 关键
+        titleLabelView.text = mainTiel
+        titleLabelView.font = UIFont.systemFont(ofSize: 10, weight: .bold)
+        titleLabelView.textColor = UIColor(hex: "#333333")
+        titleLabelView.backgroundColor = .clear
+        titleLabelView.textAlignment = .left
+        titleLabelView.numberOfLines = 0
+        markerContentView.addSubview(titleLabelView)
+        
+        bottomView = UIView()
+        bottomView.translatesAutoresizingMaskIntoConstraints = false // 关键
+        markerContentView.addSubview(bottomView)
+    
+        let mapIconView = UIImageView(frame: CGRect(x: 0, y: 0, width: 12, height: 12))
+        mapIconView.image = readImageContentFrom(imageName: "com.shishi.dingwei_map_pin.png")
+        mapIconView.contentMode = .scaleAspectFit
+        bottomView.addSubview(mapIconView)
+            
+        
+        let mapLableW = markerContentViewW - 16 - 14
+        let mapLable = UILabel(frame: CGRect(x: 14, y: 0, width: mapLableW, height: 14))
+        mapLable.text = mainDesc
+        mapLable.font = UIFont.systemFont(ofSize: 10, weight: .regular)
+        mapLable.textColor = UIColor(hex: "#666666")
+        mapLable.backgroundColor = .clear
+        mapLable.textAlignment = .left
+        mapLable.lineBreakMode = .byTruncatingTail
+        mapLable.numberOfLines = 1  // 限制为单行
+        bottomView.addSubview(mapLable)
+        
+        
+        // 创建气泡三角形
+        triangleLayer = CAShapeLayer()
+        triangleLayer.fillColor = UIColor.white.cgColor
+        
+        let trianglePath = UIBezierPath()
+        trianglePath.move(to: CGPoint(x: 0, y: 0))    // 左点
+        trianglePath.addLine(to: CGPoint(x: 5, y: 6)) // 底点
+        trianglePath.addLine(to: CGPoint(x: 10, y: 0)) // 右点
+        trianglePath.close()
+        
+        triangleLayer.path = trianglePath.cgPath
+        layer.addSublayer(triangleLayer)
+        
+        // 设置AutoLayout
+        setupConstraints()
+    }
+    
+    // MARK: - 布局
+    
+    private func setupConstraints() {
+        // 禁用自动约束转换
+        translatesAutoresizingMaskIntoConstraints = false
+        
+        
+        guard let marker = marker else { return }
+        
+        let tags = marker.tags
+        let mainTiel : String = tags?["title"] ?? "";
+        
+        let markerContentViewW : CGFloat = 170
+        let mainTitleH : CGFloat = mainTiel.height(withConstrainedWidth: CGFloat(markerContentViewW - 16), font: UIFont.systemFont(ofSize: 10, weight: .bold))
+        let markerContentViewH : CGFloat = CGFloat(mainTitleH) + 8 + 14 + 5 + 8
+        bubbleHeight = markerContentViewH;
+        //let markerSize = CGSize(width: markerContentViewW, height: markerContentViewH)
+                
+        
+        // 设置图像视图约束 - 居中显示在标记视图中
+        guard let markerContentView = markerContentView else { return }
+        markerContentView.translatesAutoresizingMaskIntoConstraints = false
+        NSLayoutConstraint.activate([
+            markerContentView.centerXAnchor.constraint(equalTo: centerXAnchor),
+            markerContentView.centerYAnchor.constraint(equalTo: centerYAnchor),
+            markerContentView.widthAnchor.constraint(equalToConstant: markerContentViewW),
+            markerContentView.heightAnchor.constraint(equalToConstant: markerContentViewH)
+        ])
+        
+        // 标题(动态高度)
+        NSLayoutConstraint.activate([
+            titleLabelView.topAnchor.constraint(equalTo: markerContentView.topAnchor, constant: 8),
+            titleLabelView.leadingAnchor.constraint(equalTo: markerContentView.leadingAnchor, constant: 8),
+            titleLabelView.trailingAnchor.constraint(equalTo: markerContentView.trailingAnchor, constant: -8),
+            titleLabelView.heightAnchor.constraint(equalToConstant: mainTitleH)
+            // 移除固定高度约束,让标题根据内容自动调整
+        ])
+
+        // 底部区域(动态高度)
+        NSLayoutConstraint.activate([
+            bottomView.topAnchor.constraint(equalTo: titleLabelView.bottomAnchor, constant: 5),
+            bottomView.leadingAnchor.constraint(equalTo: markerContentView.leadingAnchor, constant: 8),
+            bottomView.trailingAnchor.constraint(equalTo: markerContentView.trailingAnchor, constant: -8),
+            bottomView.bottomAnchor.constraint(equalTo: markerContentView.bottomAnchor, constant: -8)
+            // 移除固定高度约束,让底部视图根据内容自动调整
+        ])
+        
+        // 设置整个视图的高度(包含三角形)和最小宽度
+        NSLayoutConstraint.activate([
+            heightAnchor.constraint(equalToConstant: bubbleHeight + 6),
+            widthAnchor.constraint(greaterThanOrEqualToConstant: markerContentViewW)
+        ])
+        
+        layoutIfNeeded()
+        updateTrianglePosition()
+    
+        // 更新偏移量
+        //updateCenterOffset()
+    }
+    
+    private func readImageContentFrom(imageName : String) -> UIImage {
+        if let image = UIImage(named: imageName) {
+            return image
+        }
+        
+        // 尝试从插件资源束加载
+        let bundleURL = Bundle(for: MapAnnotationView.self).url(forResource: "map_mapkit_ios_resources", withExtension: "bundle")
+        if let bundleURL = bundleURL, let resourceBundle = Bundle(url: bundleURL) {
+            return UIImage(named: imageName, in: resourceBundle, compatibleWith: nil) ?? UIImage()
+        }
+        
+        return  UIImage()
+    }
+    
+    
+    // MARK: - 更新视图
+    
+    private func updateCenterOffset() {
+        let markerSize = CGSize(width: bubbleHeight + 6, height: 30)
+        
+        // 没有文本时,仅需要将图片底部对准坐标点
+        centerOffset = CGPoint(x: 0, y: -markerSize.height/2)
+    }
+    
+    override func prepareForDisplay() {
+        super.prepareForDisplay()
+        // 确保视图已经设置好
+    }
+
+    override func setSelected(_ selected: Bool, animated: Bool) {
+        super.setSelected(selected, animated: animated)
+    }
+    
+    
+    override func layoutSubviews() {
+        super.layoutSubviews()
+        updateTrianglePosition()
+        updateCenterOffset()
+    }
+    
+    private func updateTrianglePosition() {
+        // 更新三角形位置到底部中心
+        let width = bounds.width
+        triangleLayer.frame = CGRect(x: (width - 10) / 2, y: bubbleHeight + 3, width: 10, height: triangleHeight)
+    }
+}

BIN=BIN
plugins/map_mapkit_ios/ios/Resources/com.shishi.dingwei_location_error.png


BIN=BIN
plugins/map_mapkit_ios/ios/Resources/com.shishi.dingwei_map_pin.png