Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
Z
ZhiJi-Overseas
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lmj
ZhiJi-Overseas
Commits
fbc1b8de
Commit
fbc1b8de
authored
Jul 08, 2020
by
Mazy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimize mine logic
parent
e97306ac
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
30 deletions
+39
-30
UserInterfaceState.xcuserstate
...cuserdata/mazy.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
ZTPurchaseManager.swift
ZhiJi/Classes/Goods/Controller/ZTPurchaseManager.swift
+23
-24
ZJMineHeaderView.m
ZhiJi/Classes/Mine/View/ZJMineHeaderView.m
+15
-5
Localizable.strings
ZhiJi/en.lproj/Localizable.strings
+1
-1
No files found.
ZhiJi.xcworkspace/xcuserdata/mazy.xcuserdatad/UserInterfaceState.xcuserstate
View file @
fbc1b8de
No preview for this file type
ZhiJi/Classes/Goods/Controller/ZTPurchaseManager.swift
View file @
fbc1b8de
...
@@ -158,34 +158,33 @@ class ZTPurchaseManager: NSObject {
...
@@ -158,34 +158,33 @@ class ZTPurchaseManager: NSObject {
print
(
"Restore Success:
\(
results
.
restoredPurchases
)
"
)
print
(
"Restore Success:
\(
results
.
restoredPurchases
)
"
)
if
let
product
=
results
.
restoredPurchases
.
last
{
if
let
product
=
results
.
restoredPurchases
.
last
{
let
receiptData
=
SwiftyStoreKit
.
localReceiptData
if
product
.
needsFinishTransaction
{
let
receiptString
=
receiptData
?
.
base64EncodedString
(
options
:
[])
??
""
let
receiptData
=
SwiftyStoreKit
.
localReceiptData
print
(
"receiptString:
\(
receiptString
)
"
)
let
receiptString
=
receiptData
?
.
base64EncodedString
(
options
:
[])
??
""
let
dict
=
[
"productId"
:
product
.
productId
,
"transactionId"
:
(
product
.
transaction
.
transactionIdentifier
??
""
),
"receiptData"
:
receiptString
]
print
(
"receiptString:
\(
receiptString
)
"
)
print
(
"productId transactionId receiptData:
\(
dict
)
"
)
let
dict
=
[
"productId"
:
product
.
productId
,
"transactionId"
:
(
product
.
transaction
.
transactionIdentifier
??
""
),
"receiptData"
:
receiptString
]
// TODO: 服务器验证
print
(
"productId transactionId receiptData:
\(
dict
)
"
)
let
innerHud
=
MBProgressHUD
.
showAdded
(
to
:
view
,
animated
:
true
)
// TODO: 服务器验证
TQNetworkTools
.
shared
()
.
post
(
withBodyAction
:
iosIPAVerifyReceipt
,
parameters
:
[:],
body
:
dict
,
success
:
{
(
data
)
in
let
innerHud
=
MBProgressHUD
.
showAdded
(
to
:
view
,
animated
:
true
)
innerHud
.
hide
(
animated
:
true
)
TQNetworkTools
.
shared
()
.
post
(
withBodyAction
:
iosIPAVerifyReceipt
,
parameters
:
[:],
body
:
dict
,
success
:
{
(
data
)
in
print
(
"success----iosIPAVerifyReceipt-----------------
\(
data
)
------"
)
innerHud
.
hide
(
animated
:
true
)
guard
let
dict
=
data
as?
[
String
:
Any
],
let
result
=
dict
[
"result"
]
as?
[
String
:
Any
],
let
data
=
result
[
"data"
]
as?
[
String
:
Any
]
else
{
print
(
"success----iosIPAVerifyReceipt-----------------
\(
data
)
------"
)
return
guard
let
dict
=
data
as?
[
String
:
Any
],
let
result
=
dict
[
"result"
]
as?
[
String
:
Any
],
let
data
=
result
[
"data"
]
as?
[
String
:
Any
]
else
{
}
return
}
guard
let
status
=
data
[
"status"
]
as?
Bool
,
status
==
true
else
{
return
guard
let
status
=
data
[
"status"
]
as?
Bool
,
status
==
true
else
{
}
return
if
product
.
needsFinishTransaction
{
}
print
(
"Purchase Success:
\(
product
.
productId
)
"
)
SwiftyStoreKit
.
finishTransaction
(
product
.
transaction
)
SwiftyStoreKit
.
finishTransaction
(
product
.
transaction
)
success
()
})
{
(
error
)
in
innerHud
.
hide
(
animated
:
true
)
}
}
print
(
"Purchase Success:
\(
product
.
productId
)
"
)
success
()
})
{
(
error
)
in
innerHud
.
hide
(
animated
:
true
)
}
}
}
}
}
else
{
}
else
{
MBProgressHUD
.
showError
(
"没有商品可恢复"
)
MBProgressHUD
.
showError
(
"没有商品可恢复"
)
print
(
"Nothing to Restore"
)
print
(
"Nothing to Restore"
)
...
...
ZhiJi/Classes/Mine/View/ZJMineHeaderView.m
View file @
fbc1b8de
...
@@ -185,7 +185,7 @@
...
@@ -185,7 +185,7 @@
if
(
Member
)
{
if
(
Member
)
{
_gongNengLabel
.
text
=
kLocalizedString
(
@"mine_unlocked"
);
_gongNengLabel
.
text
=
kLocalizedString
(
@"mine_unlocked"
);
_timeLabel
.
text
=
kLocalizedString
(
@"mine_free_used"
);
_timeLabel
.
text
=
kLocalizedString
(
@"mine_free_used"
);
//
_xuFeiButton.hidden = YES;
_xuFeiButton
.
hidden
=
YES
;
}
else
{
}
else
{
_gongNengLabel
.
text
=
kLocalizedString
(
@"mine_premium_services_locked"
);
_gongNengLabel
.
text
=
kLocalizedString
(
@"mine_premium_services_locked"
);
_timeLabel
.
text
=
kLocalizedString
(
@"mine_unlock_more_services"
);
_timeLabel
.
text
=
kLocalizedString
(
@"mine_unlock_more_services"
);
...
@@ -197,10 +197,20 @@
...
@@ -197,10 +197,20 @@
_nicknameLabel
.
text
=
userInfo
.
nickname
;
_nicknameLabel
.
text
=
userInfo
.
nickname
;
}
}
}
else
{
}
else
{
_nicknameLabel
.
text
=
kLocalizedString
(
@"mine_sign"
);
// [[data Read] objectForKey:@"NickName"];
if
(
Member
)
{
_gongNengLabel
.
text
=
kLocalizedString
(
@"mine_premium_services_locked"
);
_gongNengLabel
.
text
=
kLocalizedString
(
@"mine_unlocked"
);
_timeLabel
.
text
=
kLocalizedString
(
@"mine_unlock_more_services"
);
_timeLabel
.
text
=
kLocalizedString
(
@"mine_free_used"
);
[
_xuFeiButton
setTitle
:
kLocalizedString
(
@"mine_unlock"
)
forState
:(
UIControlStateNormal
)];
_nicknameLabel
.
text
=
kLocalizedString
(
@"mine_sign"
);
// [[data Read] objectForKey:@"NickName"];
_xuFeiButton
.
hidden
=
true
;
}
else
{
_gongNengLabel
.
text
=
kLocalizedString
(
@"mine_premium_services_locked"
);
_timeLabel
.
text
=
kLocalizedString
(
@"mine_unlock_more_services"
);
[
_xuFeiButton
setTitle
:
kLocalizedString
(
@"mine_unlock"
)
forState
:(
UIControlStateNormal
)];
_xuFeiButton
.
hidden
=
false
;
}
// _gongNengLabel.text = kLocalizedString(@"mine_premium_services_locked");
// _timeLabel.text = kLocalizedString(@"mine_unlock_more_services");
// [_xuFeiButton setTitle:kLocalizedString(@"mine_unlock") forState:(UIControlStateNormal)];
}
}
if
([
userInfo
.
uid
isEqual
:
@""
])
{
if
([
userInfo
.
uid
isEqual
:
@""
])
{
...
...
ZhiJi/en.lproj/Localizable.strings
View file @
fbc1b8de
...
@@ -156,7 +156,7 @@ appName = "Family Mapp";
...
@@ -156,7 +156,7 @@ appName = "Family Mapp";
"mine_sign"="Sign in";
"mine_sign"="Sign in";
"mine_click_nickname"="Click name to edit";
"mine_click_nickname"="Click name to edit";
"mine_unlock_more_services"="Unlock to access Premium services";
"mine_unlock_more_services"="Unlock to access Premium services";
"mine_unlock"="Unlock
ed
";
"mine_unlock"="Unlock";
"mine_userID"="User ID";
"mine_userID"="User ID";
"mine_track"="My track";
"mine_track"="My track";
"mine_emergenry_contacts"="Emergency contacts";
"mine_emergenry_contacts"="Emergency contacts";
...
...
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