Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
S
ShorthandMaster
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
ShorthandMaster
Commits
638d81ba
Commit
638d81ba
authored
Sep 30, 2020
by
lmj_521aiau@163.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
02c88254
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
124 additions
and
20 deletions
+124
-20
project.pbxproj
ShorthandMaster.xcodeproj/project.pbxproj
+2
-2
CRConstants.swift
ShorthandMaster/Contstants/CRConstants.swift
+1
-0
SHMineViewController.swift
ShorthandMaster/Mine/SHMineViewController.swift
+2
-1
SHRecordDetailsVC.swift
ShorthandMaster/Record/SHRecordDetailsVC.swift
+46
-0
SHRecordListViewController.swift
ShorthandMaster/Record/SHRecordListViewController.swift
+45
-6
SHRecordMoveFileVC.swift
ShorthandMaster/Record/SHRecordMoveFileVC.swift
+18
-0
SHRecordDetailsBottomView.swift
ShorthandMaster/Record/View/SHRecordDetailsBottomView.swift
+1
-1
SHAVAudioManager.swift
ShorthandMaster/Share/Managers/SHAVAudioManager.swift
+8
-9
SHUserAccountManager.swift
ShorthandMaster/Share/Managers/SHUserAccountManager.swift
+1
-1
No files found.
ShorthandMaster.xcodeproj/project.pbxproj
View file @
638d81ba
...
...
@@ -1378,7 +1378,7 @@
"$(PROJECT_DIR)/ShorthandMaster/Other/Lame"
,
"$(PROJECT_DIR)/ShorthandMaster/Other/lame"
,
);
MARKETING_VERSION
=
1.
0.1
;
MARKETING_VERSION
=
1.
1.0
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.ShorthandMaster.www
;
PRODUCT_NAME
=
"速记大师"
;
PROVISIONING_PROFILE_SPECIFIER
=
ShorthandMasterDevProfile
;
...
...
@@ -1412,7 +1412,7 @@
"$(PROJECT_DIR)/ShorthandMaster/Other/Lame"
,
"$(PROJECT_DIR)/ShorthandMaster/Other/lame"
,
);
MARKETING_VERSION
=
1.
0.1
;
MARKETING_VERSION
=
1.
1.0
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.ShorthandMaster.www
;
PRODUCT_NAME
=
"速记大师"
;
PROVISIONING_PROFILE_SPECIFIER
=
ShorthandMasterDevProfile
;
...
...
ShorthandMaster/Contstants/CRConstants.swift
View file @
638d81ba
...
...
@@ -31,3 +31,4 @@ let kAutoHeight = SCREEN_HEIGHT / 667
let
DocumentPath
=
(
NSSearchPathForDirectoriesInDomains
(
.
documentDirectory
,
.
userDomainMask
,
true
)
.
first
)
!
let
RecordMp3
=
"/record.mp3"
let
RecordCaf
=
"/xbMixData.caf"
let
DefaultRecordName
=
"默认笔记本"
ShorthandMaster/Mine/SHMineViewController.swift
View file @
638d81ba
...
...
@@ -34,7 +34,7 @@ class SHMineViewController: SHBaseViewController {
override
func
setupUI
()
{
self
.
navigationItem
.
title
=
"
我的
"
self
.
navigationItem
.
title
=
"
设置
"
tableHeaderView
.
frame
=
CGRect
.
init
(
x
:
0
,
y
:
0
,
width
:
SCREEN_WIDTH
,
height
:
118*
kAutoWidth
)
tableView
.
tableHeaderView
=
tableHeaderView
...
...
@@ -160,6 +160,7 @@ extension SHMineViewController:UITableViewDelegate, UITableViewDataSource{
switch
indexPath
.
row
{
case
0
:
let
webView
=
SHWebViewController
()
print
(
SHUserAccountManager
.
shared
.
h5_urlDic
[
"user"
]
as?
String
)
webView
.
url
=
SHUserAccountManager
.
shared
.
h5_urlDic
[
"user"
]
as?
String
webView
.
title
=
"用户协议"
self
.
navigationController
?
.
pushViewController
(
webView
,
animated
:
true
)
...
...
ShorthandMaster/Record/SHRecordDetailsVC.swift
View file @
638d81ba
...
...
@@ -352,6 +352,52 @@ extension SHRecordDetailsVC {
@IBAction
func
markAlertBtnClick
(
_
sender
:
UIButton
){
self
.
markAlertViewShow
(
false
)
bottomView
?
.
cancel
=
true
/*
if SHUserAccountManager.shared.isMember == false {
let contains = CRUserDefaults.recordList?.contains(where: {
var model = SHRecordFolderModel()
model = getDataDictWith(dict: $0)
return model.dataSources.contains(where: {
$0.pathFile == "/" + DefaultRecordName + RecordMp3
})
})
var voiceCount = 0
var noteCount = 0
if let list = CRUserDefaults.recordList {
for dict in list.reversed(){
var model = SHRecordFolderModel()
model = getDataDictWith(dict: dict)
let voiceC = model.dataSources.filter({ $0.recordingType == 0 }).count
let noteC = model.dataSources.filter({ $0.recordingType == 1 }).count
voiceCount = voiceCount + voiceC
noteCount = noteCount + noteC
}
}
if contains == true && voiceCount > 1 && sender.tag == 201 {
self.goGoods("new_note_card_voice_note")
return
}
if contains == false && voiceCount > 0 && sender.tag == 201 {
self.goGoods("new_note_card_voice_note")
return
}
if contains == true && noteCount > 1 && sender.tag == 200 {
self.goGoods("new_note_card_note")
return
}
if contains == false && noteCount > 0 && sender.tag == 200 {
self.goGoods("new_note_card_note")
return
}
}
*/
if
SHUserAccountManager
.
shared
.
isMember
==
false
{
...
...
ShorthandMaster/Record/SHRecordListViewController.swift
View file @
638d81ba
...
...
@@ -185,12 +185,18 @@ class SHRecordListViewController: SHBaseViewController {
dataSources
=
topDataSources
+
dataSources
if
dataSources
.
count
==
0
{
/*
let path = DocumentPath + "/" + DefaultRecordName
if dataSources.count == 0 && FileManager.default.fileExists(atPath: path) == false{
//没有 先创建
try! FileManager.default.createDirectory(atPath: path, withIntermediateDirectories: true, attributes: nil)
let folderModel = SHRecordFolderModel()
folderModel.createDate = nowDate
folderModel.modifyDate = nowDate
folderModel
.
name
=
"默认笔记本"
;
folderModel
.
id
=
nowDate
.
milliStamp
folderModel.name =
DefaultRecordName
folderModel.id =
DefaultRecordName + "000"
let recordModel = SHRecordModel()
recordModel.recordingType = 0
...
...
@@ -198,16 +204,37 @@ class SHRecordListViewController: SHBaseViewController {
recordModel.modifyDate = nowDate
recordModel.address = "默认笔记"
recordModel.rename = "默认笔记"
recordModel
.
txt
=
"
默认笔记
"
recordModel
.
pathFile
=
"
"
recordModel.txt = ""
recordModel.pathFile = "
/" + DefaultRecordName + RecordMp3
recordModel.pcmPathFile = ""
recordModel.during = 0
recordModel.imagesPath = []
recordModel.imagesIndex = []
// let images = ["goods_bg"]
// let indexs = [0]
// for (index, imageStr) in images.enumerated(){
// let image = UIImage.init(named: imageStr)
// let filePath = DocumentPath+"/"+DefaultRecordName+"/"+"\(index).jpeg"
// let imageData = image!.jpegData(compressionQuality: 1)
// try? imageData?.write(to: URL(fileURLWithPath: filePath))
// recordModel.imagesPath.append("/"+DefaultRecordName+"/"+"\(index).jpeg")
// recordModel.imagesIndex.append(indexs[index])
// }
//
// let mp3Path = Bundle.main.path(forResource: "callRing", ofType: "mp3")
// //路径找不到就会报内存错误的
// let soundUrl = URL(fileURLWithPath: mp3Path!)
// if let videoData = try? Data(contentsOf: soundUrl){
// SHMp3RecordManager.shared().write(videoData, path: DocumentPath + "/" + DefaultRecordName + RecordMp3)
// }
let modelDict = getDictWith(obj: folderModel)
CRUserDefaults.recordList = [modelDict]
dataSources.append(folderModel)
}
*/
recordsDataSource
=
[]
for
folder
in
dataSources
{
...
...
@@ -235,12 +262,24 @@ class SHRecordListViewController: SHBaseViewController {
}
@objc
func
userCilck
(){
/*
let contains = self.dataSources.contains(where: { $0.id == DefaultRecordName + "000" })
if SHUserAccountManager.shared.isMember == false {
if self.dataSources.count > 1 && contains == true {
self.goGoods("new_notebook_add")
return
}
if self.dataSources.count > 0 && contains == false {
self.goGoods("new_notebook_add")
return
}
}
*/
if
SHUserAccountManager
.
shared
.
isMember
==
false
&&
self
.
dataSources
.
count
>
0
{
self
.
goGoods
(
"new_notebook_add"
)
return
}
addModel
()
}
...
...
ShorthandMaster/Record/SHRecordMoveFileVC.swift
View file @
638d81ba
...
...
@@ -102,6 +102,24 @@ class SHRecordMoveFileVC: SHBaseViewController {
//MARK:添加新笔记
@objc
func
addModel
(){
/*
let contains = self.dataSources.contains(where: { $0.id == DefaultRecordName + "000" })
if SHUserAccountManager.shared.isMember == false {
if self.dataSources.count > 1 && contains == true {
self.goGoods("new_notebook_add")
return
}
if self.dataSources.count > 0 && contains == false {
self.goGoods("new_notebook_add")
return
}
}
*/
if
SHUserAccountManager
.
shared
.
isMember
==
false
&&
self
.
dataSources
.
count
>
0
{
self
.
goGoods
(
"new_notebook_add"
)
return
}
let
newFolder
=
SHRecordRenameAlertView
.
loadFromNibAndClass
(
SHRecordRenameAlertView
.
self
)
!
newFolder
.
placeHolder
=
"笔记本名称"
newFolder
.
title
=
"新笔记本"
...
...
ShorthandMaster/Record/View/SHRecordDetailsBottomView.swift
View file @
638d81ba
...
...
@@ -14,7 +14,7 @@ class SHRecordDetailsBottomView: UIView {
var
recordCount
:
NSInteger
=
0
{
didSet
{
countLab
?
.
text
=
"
总笔记本
数:
\(
recordCount
)
"
countLab
?
.
text
=
"
笔记总
数:
\(
recordCount
)
"
}
}
...
...
ShorthandMaster/Share/Managers/SHAVAudioManager.swift
View file @
638d81ba
...
...
@@ -191,7 +191,7 @@ class SHAVAudioManager: NSObject {
if
headphones
{
decibelsFloat
=
-
44
}
else
{
decibelsFloat
=
-
24
decibelsFloat
=
-
18
}
if
Int
(
decibels
)
>
decibelsFloat
{
...
...
@@ -213,14 +213,13 @@ class SHAVAudioManager: NSObject {
self
.
state
=
SHRecordState
.
start
self
.
configRecorder
{
result
in
self
.
configSpeechTask
()
self
.
monitor
?
.
record
()
self
.
startTime
=
CACurrentMediaTime
()
if
self
.
recorderTimer
==
nil
{
self
.
recorderTimer
=
SHTimer
.
scheduledTimer
(
timeInterval
:
0.1
,
target
:
self
,
selector
:
#selector(
self.updateMeters
)
,
userInfo
:
nil
,
repeats
:
true
)
}
}
self
.
configSpeechTask
()
self
.
monitor
?
.
record
()
self
.
startTime
=
CACurrentMediaTime
()
if
self
.
recorderTimer
==
nil
{
self
.
recorderTimer
=
SHTimer
.
scheduledTimer
(
timeInterval
:
0.1
,
target
:
self
,
selector
:
#selector(
self.updateMeters
)
,
userInfo
:
nil
,
repeats
:
true
)
}
}
...
...
ShorthandMaster/Share/Managers/SHUserAccountManager.swift
View file @
638d81ba
...
...
@@ -27,7 +27,7 @@ import SwiftyJSON
var
threeDayText
:
String
=
""
@objc
var
h5_urlDic
:
Dictionary
<
String
,
Any
>
{
return
h5_url
.
dictionary
!
return
h5_url
.
dictionary
Object
!
}
var
servicePhone
:
String
?
...
...
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