Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
weihan-plugin
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Wei Han
weihan-plugin
Commits
9a381188
Commit
9a381188
authored
Oct 30, 2025
by
Wei Han
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code update
parent
c8fb728f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
145 additions
and
8 deletions
+145
-8
QmsPluginFramework
...ios-arm64/QmsPluginFramework.framework/QmsPluginFramework
+0
-0
QmsPluginFramework
...simulator/QmsPluginFramework.framework/QmsPluginFramework
+0
-0
project.pbxproj
...ginFramework/QmsPluginFramework.xcodeproj/project.pbxproj
+0
-2
DashboardViewController.mm
...k/QmsPluginFramework/Dashboard/DashboardViewController.mm
+31
-6
IssueAPIClient.h
...PluginFramework/QmsPluginFramework/Issue/IssueAPIClient.h
+9
-0
IssueAPIClient.mm
...luginFramework/QmsPluginFramework/Issue/IssueAPIClient.mm
+80
-0
IssueDetailViewController.h
...work/QmsPluginFramework/Issue/IssueDetailViewController.h
+14
-0
IssueDetailViewController.mm
...ork/QmsPluginFramework/Issue/IssueDetailViewController.mm
+0
-0
IssuesViewController.h
...Framework/QmsPluginFramework/Issue/IssuesViewController.h
+11
-0
IssuesViewController.mm
...ramework/QmsPluginFramework/Issue/IssuesViewController.mm
+0
-0
QmsPluginFramework
...ios-arm64/QmsPluginFramework.framework/QmsPluginFramework
+0
-0
QmsPluginFramework
...simulator/QmsPluginFramework.framework/QmsPluginFramework
+0
-0
No files found.
framework/QmsPluginFramework/QmsPluginFramework.xcframework/ios-arm64/QmsPluginFramework.framework/QmsPluginFramework
View file @
9a381188
No preview for this file type
framework/QmsPluginFramework/QmsPluginFramework.xcframework/ios-arm64_x86_64-simulator/QmsPluginFramework.framework/QmsPluginFramework
View file @
9a381188
No preview for this file type
framework/QmsPluginFramework/QmsPluginFramework.xcodeproj/project.pbxproj
View file @
9a381188
...
@@ -120,8 +120,6 @@
...
@@ -120,8 +120,6 @@
2F9647672E86307D002CC7CB
/* QmsPluginFramework */
,
2F9647672E86307D002CC7CB
/* QmsPluginFramework */
,
);
);
name
=
QmsPluginFramework
;
name
=
QmsPluginFramework
;
packageProductDependencies
=
(
);
productName
=
QmsPluginFramework
;
productName
=
QmsPluginFramework
;
productReference
=
2F9647652E86307D002CC7CB
/* QmsPluginFramework.framework */
;
productReference
=
2F9647652E86307D002CC7CB
/* QmsPluginFramework.framework */
;
productType
=
"com.apple.product-type.framework"
;
productType
=
"com.apple.product-type.framework"
;
...
...
framework/QmsPluginFramework/QmsPluginFramework/Dashboard/DashboardViewController.mm
View file @
9a381188
...
@@ -2,8 +2,11 @@
...
@@ -2,8 +2,11 @@
#import "DashboardViewController.h"
#import "DashboardViewController.h"
#import "DashboardHeaderView.h"
#import "DashboardHeaderView.h"
#import <CoreGraphics/CoreGraphics.h>
#import <CoreGraphics/CoreGraphics.h>
#import <objc/runtime.h>
#import "PlanViewController.h"
#import "PlanViewController.h"
#import "DashboardAPIClient.h"
#import "DashboardAPIClient.h"
#import "IssueDetailViewController.h"
#import "IssuesViewController.h"
@interface DashboardViewController ()
@interface DashboardViewController ()
...
@@ -345,7 +348,6 @@
...
@@ -345,7 +348,6 @@
- (void)handleInspectionBannerTap {
- (void)handleInspectionBannerTap {
NSLog(@"🟥 Inspection checklist banner tapped");
NSLog(@"🟥 Inspection checklist banner tapped");
// In future: open WebView screen or perform navigation
[UIView animateWithDuration:0.1 animations:^{
[UIView animateWithDuration:0.1 animations:^{
_inspectionBanner.alpha = 0.6;
_inspectionBanner.alpha = 0.6;
} completion:^(BOOL finished) {
} completion:^(BOOL finished) {
...
@@ -616,7 +618,7 @@
...
@@ -616,7 +618,7 @@
title.textColor = [UIColor blackColor];
title.textColor = [UIColor blackColor];
title.userInteractionEnabled = YES; // 👈 enable taps
title.userInteractionEnabled = YES; // 👈 enable taps
UITapGestureRecognizer *titleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(
section
HeaderTapped:)];
UITapGestureRecognizer *titleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(
issue
HeaderTapped:)];
[title addGestureRecognizer:titleTap];
[title addGestureRecognizer:titleTap];
UIImageView *arrow = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_green_arrowright"]];
UIImageView *arrow = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_green_arrowright"]];
arrow.frame = CGRectMake(self.view.bounds.size.width - 40, 2, 24, 24);
arrow.frame = CGRectMake(self.view.bounds.size.width - 40, 2, 24, 24);
...
@@ -846,6 +848,13 @@
...
@@ -846,6 +848,13 @@
infoLabel.attributedText = [self notificationTextForIssue:item];
infoLabel.attributedText = [self notificationTextForIssue:item];
[card addSubview:infoLabel];
[card addSubview:infoLabel];
// Keep a reference to its issue data
card.accessibilityValue = item[@"issue_reference"]; // for debugging
card.tag = self.issues.count; // optional index tagging
// Store the data for later use (simplest way)
objc_setAssociatedObject(card, "issueData", item, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
// === Tap gesture ===
// === Tap gesture ===
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleIssueTap:)];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleIssueTap:)];
...
@@ -972,10 +981,19 @@
...
@@ -972,10 +981,19 @@
}
}
- (void)handleIssueTap:(UITapGestureRecognizer *)gesture {
- (void)handleIssueTap:(UITapGestureRecognizer *)gesture {
UIView *card = gesture.view;
UIView *tappedCard = gesture.view;
[self animateTapForView:card];
NSDictionary *issueData = objc_getAssociatedObject(tappedCard, "issueData");
NSLog(@"🪲 Issue card tapped");
// TODO: open IssueDetails later
if (issueData && [issueData isKindOfClass:[NSDictionary class]]) {
NSLog(@"🧭 Navigating to IssueDetailViewController with issue: %@", issueData);
IssueDetailViewController *nextVC = [[IssueDetailViewController alloc] init];
nextVC.modalPresentationStyle = UIModalPresentationFullScreen;
nextVC.issueData = issueData;
[self presentViewController:nextVC animated:YES completion:nil];
} else {
NSLog(@"⚠️ No valid issue data found for tapped card: %@", issueData);
}
}
}
- (UIImage *)downloadImageFrom:(NSString *)urlString {
- (UIImage *)downloadImageFrom:(NSString *)urlString {
...
@@ -1013,6 +1031,13 @@
...
@@ -1013,6 +1031,13 @@
NSLog(@"📘 Section tapped: %@", header.text);
NSLog(@"📘 Section tapped: %@", header.text);
}
}
-(void)issueHeaderTapped:(UITapGestureRecognizer *)gesture {
IssuesViewController *nextVC = [[IssuesViewController alloc] init];
nextVC.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:nextVC animated:YES completion:nil];
}
- (void)cardTapped:(UITapGestureRecognizer *)gesture {
- (void)cardTapped:(UITapGestureRecognizer *)gesture {
UIView *card = gesture.view;
UIView *card = gesture.view;
[self animateTapForView:card];
[self animateTapForView:card];
...
...
framework/QmsPluginFramework/QmsPluginFramework/Issue/IssueAPIClient.h
0 → 100644
View file @
9a381188
// IssueAPIClient.h
#import <Foundation/Foundation.h>
@interface
IssueAPIClient
:
NSObject
+
(
void
)
fetchIssues
:(
void
(
^
)(
NSDictionary
*
data
,
NSError
*
error
))
completion
;
@end
framework/QmsPluginFramework/QmsPluginFramework/Issue/IssueAPIClient.mm
0 → 100644
View file @
9a381188
// IssueAPIClient.mm
#import "IssueAPIClient.h"
@implementation IssueAPIClient
+ (void)fetchIssues:(void (^)(NSDictionary *data, NSError *error))completion {
// ✅ URL
NSString *urlString = @"https://kitadev.commudesk.com/api/owner/issue/getIssue?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6ImF0aGlyYWh6YWlkaUBjb252ZXAuY29tIiwicGFzc3dvcmQiOiIkMnkkMTAkNU9xYklqMnZ6UHJwckJrcVd5c3I2LmJCc1hVYS9Hd014eUhnL3RhUUhPUkNQcGdmTG8yakciLCJzdWIiOjIxNzAsImlzcyI6Imh0dHBzOi8va2l0YWRldi5jb21tdWRlc2suY29tL2FwaS9vd25lci9hdXRoL3Bhc3N3b3JkbGVzc19sb2dpbiIsImlhdCI6MTc2MDMxNTM1MiwiZXhwIjoyMDc1ODg0ODcyLCJuYmYiOjE3NjAzMTUzNTIsImp0aSI6IktoQmNyQnJEdDVNdDZlWmMifQ.JnxGbZ7hTeoOr6oibIzZMphgyKtTo2Aq9Efx6mrGfFA";
NSURL *url = [NSURL URLWithString:urlString];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
request.HTTPMethod = @"POST";
// ✅ JSON headers
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[request setValue:@"application/json" forHTTPHeaderField:@"Accept"];
// ✅ Build JSON body
NSDictionary *deviceInfo = @{
@"OS": @"AND",
@"IMEI": @"AND:2a2f13ff17b1cbb5",
@"OS_VERSION": @"35",
@"MODEL": @"2306EPN60G",
@"APP_VERSION": @"1.22.26"
};
NSDictionary *jsonBody = @{
@"data": @{
@"os": @"AND",
@"drawing_plan_id": @"135",
@"information": deviceInfo
}
};
// ✅ Convert dictionary → NSData
NSError *jsonError;
NSData *bodyData = [NSJSONSerialization dataWithJSONObject:jsonBody options:0 error:&jsonError];
if (jsonError) {
NSLog(@"❌ JSON Serialization Error: %@", jsonError);
if (completion) completion(nil, jsonError);
return;
}
request.HTTPBody = bodyData;
// 🧭 Debug logs
NSLog(@"🌍 URL: %@", urlString);
NSLog(@"📦 Body JSON: %@", jsonBody);
// ✅ Make request
NSURLSessionDataTask *task = [[NSURLSession sharedSession]
dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"❌ Network Error: %@", error);
dispatch_async(dispatch_get_main_queue(), ^{
if (completion) completion(nil, error);
});
return;
}
NSError *jsonParseError;
NSDictionary *jsonResponse = [NSJSONSerialization JSONObjectWithData:data options:0 error:&jsonParseError];
if (jsonParseError) {
NSLog(@"⚠️ JSON Parse Error: %@", jsonParseError);
} else {
NSLog(@"✅ Issues API Response:\n%@", jsonResponse);
}
dispatch_async(dispatch_get_main_queue(), ^{
if (completion) completion(jsonResponse, jsonParseError);
});
}];
[task resume];
}
@end
framework/QmsPluginFramework/QmsPluginFramework/Issue/IssueDetailViewController.h
0 → 100644
View file @
9a381188
// IssueDetailViewController.h
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface
IssueDetailViewController
:
UIViewController
@property
(
nonatomic
,
strong
)
NSDictionary
*
issueData
;
@end
NS_ASSUME_NONNULL_END
framework/QmsPluginFramework/QmsPluginFramework/Issue/IssueDetailViewController.mm
0 → 100644
View file @
9a381188
This diff is collapsed.
Click to expand it.
framework/QmsPluginFramework/QmsPluginFramework/Issue/IssuesViewController.h
0 → 100644
View file @
9a381188
// IssuesViewControlller.h
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface
IssuesViewController
:
UIViewController
@end
NS_ASSUME_NONNULL_END
framework/QmsPluginFramework/QmsPluginFramework/Issue/IssuesViewController.mm
0 → 100644
View file @
9a381188
This diff is collapsed.
Click to expand it.
ios/QmsPluginFramework.xcframework/ios-arm64/QmsPluginFramework.framework/QmsPluginFramework
View file @
9a381188
No preview for this file type
ios/QmsPluginFramework.xcframework/ios-arm64_x86_64-simulator/QmsPluginFramework.framework/QmsPluginFramework
View file @
9a381188
No preview for this file type
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