Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
Fengshui-Seller-iOS
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Monika Agarwal
Fengshui-Seller-iOS
Commits
098f06b8
Commit
098f06b8
authored
Oct 19, 2018
by
SunARcTech2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix audio progress
parent
e7d846fe
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
290 additions
and
180 deletions
+290
-180
.DS_Store
+0
-0
Bhagyashree.xcworkspace/xcuserdata/sunarctech2.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
Bhagyashree.xcworkspace/xcuserdata/sunarctech2.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+0
-0
Bhagyashree/Info.plist
+1
-1
Bhagyashree/Sunarc/Controller/Appointment/Cells/PlayAudioCell.swift
+9
-1
Bhagyashree/Sunarc/Controller/Appointment/CompletedServicesViewController.swift
+7
-5
Bhagyashree/Sunarc/Controller/Appointment/EditResultViewController.swift
+24
-9
Bhagyashree/Sunarc/Controller/Appointment/InvalidServicesViewController.swift
+6
-4
Bhagyashree/Sunarc/Controller/Appointment/OnGoingServicesViewController.swift
+6
-5
Bhagyashree/Sunarc/Controller/Appointment/ProcessingViewController.swift
+6
-5
Bhagyashree/Sunarc/Controller/Appointment/ServiceDetailViewController.swift
+11
-9
Bhagyashree/Sunarc/Controller/Home/HomePageViewController.swift
+7
-4
Bhagyashree/Sunarc/Controller/Home/OnlineEnquiryViewController.swift
+43
-4
Bhagyashree/Sunarc/Controller/Me/MyAllServiceOrderViewController.swift
+6
-5
Bhagyashree/Sunarc/Controller/Me/MyCompletedOrdersViewController.swift
+6
-4
Bhagyashree/Sunarc/Controller/Me/MyOngoingServiceOrderViewController.swift
+6
-3
Bhagyashree/Sunarc/Controller/Me/MyUploadResultViewController.swift
+6
-3
Bhagyashree/Sunarc/Model/Appointment/EditResult.swift
+10
-2
Bhagyashree/Sunarc/Model/Home/HomeScreen/Product.swift
+58
-55
Bhagyashree/Sunarc/Model/Me/Service.swift
+57
-56
Bhagyashree/Sunarc/Other/Audio.swift
+19
-3
Bhagyashree/Sunarc/View/Appointment.storyboard
+0
-0
Bhagyashree/Sunarc/View/Home.storyboard
+2
-2
No files found.
.DS_Store
View file @
098f06b8
No preview for this file type
Bhagyashree.xcworkspace/xcuserdata/sunarctech2.xcuserdatad/UserInterfaceState.xcuserstate
View file @
098f06b8
No preview for this file type
Bhagyashree.xcworkspace/xcuserdata/sunarctech2.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
View file @
098f06b8
This diff is collapsed.
Click to expand it.
Bhagyashree/Info.plist
View file @
098f06b8
...
...
@@ -19,7 +19,7 @@
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
string
>
1.0
<
/string
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
2
<
/string
>
<
string
>
18
<
/string
>
<
k
e
y
>
Fabric
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
APIKey
<
/k
e
y
>
...
...
Bhagyashree/Sunarc/Controller/Appointment/Cells/PlayAudioCell.swift
View file @
098f06b8
...
...
@@ -17,6 +17,7 @@ class PlayAudioCell: UITableViewCell {
// var audioRecording: AudioRecording?
var
delegate
:
PlayAudioCellDelegate
!
@IBOutlet
var
btnPlay
:
UIButton
!
@IBOutlet
var
audioSlider
:
UISlider
!
var
audioRecording
:
AudioRecording
?
{
...
...
@@ -35,6 +36,7 @@ class PlayAudioCell: UITableViewCell {
@IBAction
func
playAudio
()
{
if
audioRecording
?
.
isPlaying
==
true
{
Audio
.
pause
()
delegate
.
audioPlayingAt
(
index
:
10000
)
}
else
{
playAudioFile
()
delegate
.
audioPlayingAt
(
index
:
audioRecording
!.
audioIndex
)
...
...
@@ -49,7 +51,13 @@ class PlayAudioCell: UITableViewCell {
},
failure
:
{
(
errorMesaage
)
in
self
.
viewController
()?
.
view
.
showToast
(
errorMesaage
,
position
:
.
bottom
,
popTime
:
2.0
,
dismissOnTap
:
false
)
})
{
(
progress
,
duration
)
in
print
(
"progress =
\(
progress
)
duration =
\(
duration
)
"
)
self
.
audioSlider
.
maximumValue
=
duration
self
.
audioSlider
.
value
=
progress
if
Int
(
duration
)
==
Int
(
progress
)
{
self
.
delegate
.
audioPlayingAt
(
index
:
10000
)
}
}
}
...
...
Bhagyashree/Sunarc/Controller/Appointment/CompletedServicesViewController.swift
View file @
098f06b8
...
...
@@ -108,15 +108,17 @@ extension CompletedServicesViewController: UITableViewDelegate, UITableViewDataS
let
selectedService
=
service
.
services
[
indexPath
.
row
]
if
selectedService
.
serviceType
==
.
BOOKING
{
if
selectedService
.
typeId
==
"booking"
{
// if selectedService.serviceType == .BOOKING {
let
appointmentdetails
=
Utils
.
viewController
(
storyboardName
:
"Appointment"
,
ofType
:
ServiceDetailViewController
.
self
)
appointmentdetails
.
orderStatus
=
.
COMPLETE
// appointmentdetails.serviceStatus = .completed
appointmentdetails
.
incrementId
=
selectedService
.
incrementId
appointmentdetails
.
orderId
=
selectedService
.
orderId
self
.
navigationController
?
.
pushViewController
(
appointmentdetails
,
animated
:
true
)
}
else
if
selectedService
.
serviceType
==
.
FAQ
{
}
else
if
selectedService
.
typeId
==
"faq"
{
// } else if selectedService.serviceType == .FAQ {
if
selectedService
.
status
==
.
PROCESSING
{
let
chatViewController
=
Utils
.
viewController
(
storyboardName
:
"Home"
,
ofType
:
OnlineEnquiryViewController
.
self
)
if
let
orderId
=
selectedService
.
orderId
{
...
...
@@ -130,8 +132,8 @@ extension CompletedServicesViewController: UITableViewDelegate, UITableViewDataS
enquiryDetailsViewController
.
orderId
=
selectedService
.
orderId
!
self
.
navigationController
?
.
pushViewController
(
enquiryDetailsViewController
,
animated
:
true
)
}
}
else
if
selectedService
.
serviceType
==
.
FORM
{
}
else
if
selectedService
.
typeId
==
"forms"
{
//
} else if selectedService.serviceType == .FORM{
if
let
form
=
Form
.
VC
(
with
:
selectedService
.
incrementId
!
,
orderId
:
selectedService
.
orderId
!
,
categoryType
:
selectedService
.
categoryType
){
self
.
navigationController
?
.
pushViewController
(
form
,
animated
:
true
)
}
...
...
Bhagyashree/Sunarc/Controller/Appointment/EditResultViewController.swift
View file @
098f06b8
...
...
@@ -22,10 +22,9 @@ class EditResultViewController: BaseViewController {
var
recommendedProducts
=
[
RecommendProduct
]()
var
isAllowAccessMicrophone
=
true
var
orderId
=
"0"
var
editResult
=
EditResult
()
var
audioPlayedAtIndex
=
10000
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
...
...
@@ -67,6 +66,10 @@ extension EditResultViewController {
let
alertActionNo
=
UIAlertAction
(
title
:
"No"
,
style
:
.
default
)
{
(
action
)
in
}
let
alertActionYes
=
UIAlertAction
(
title
:
"Yes"
,
style
:
.
default
)
{
(
action
)
in
print
(
self
.
imagesForResult
.
count
)
print
(
self
.
audioRecordings
.
count
)
self
.
editResult
.
images
=
self
.
imagesForResult
self
.
editResult
.
audios
=
self
.
audioRecordings
self
.
editResult
.
products
=
self
.
recommendedProducts
...
...
@@ -181,6 +184,15 @@ extension EditResultViewController: UITableViewDelegate, UITableViewDataSource {
audioRecordings
[
indexPath
.
row
]
.
audioIndex
=
indexPath
.
row
playAudioCell
.
audioRecording
=
audioRecordings
[
indexPath
.
row
]
playAudioCell
.
delegate
=
self
playAudioCell
.
audioSlider
.
value
=
0
playAudioCell
.
btnPlay
.
tag
=
indexPath
.
row
if
audioPlayedAtIndex
==
indexPath
.
row
{
playAudioCell
.
btnPlay
.
setBackgroundImage
(
UIImage
(
named
:
"pause"
),
for
:
.
normal
)
}
else
{
playAudioCell
.
btnPlay
.
setBackgroundImage
(
UIImage
(
named
:
"play"
),
for
:
.
normal
)
}
return
playAudioCell
default
:
return
UITableViewCell
()
...
...
@@ -283,13 +295,16 @@ extension EditResultViewController: PlayAudioCellDelegate {
func
audioPlayingAt
(
index
:
Int
)
{
for
(
arrayIndex
,
audioRecording
)
in
audioRecordings
.
enumerated
()
{
if
arrayIndex
==
index
{
audioRecording
.
isPlaying
=
true
}
else
{
audioRecording
.
isPlaying
=
false
}
}
audioPlayedAtIndex
=
index
// for (arrayIndex, audioRecording) in audioRecordings.enumerated() {
// if arrayIndex == index {
// audioRecording.isPlaying = true
// } else {
// audioRecording.isPlaying = false
// }
// }
tblresult
.
reloadData
()
}
...
...
Bhagyashree/Sunarc/Controller/Appointment/InvalidServicesViewController.swift
View file @
098f06b8
...
...
@@ -108,14 +108,16 @@ extension InvalidServicesViewController: UITableViewDelegate, UITableViewDataSou
let
selectedService
=
service
.
services
[
indexPath
.
row
]
if
selectedService
.
serviceType
==
.
BOOKING
{
if
selectedService
.
typeId
==
"booking"
{
// if selectedService.serviceType == .BOOKING {
let
appointmentdetails
=
Utils
.
viewController
(
storyboardName
:
"Appointment"
,
ofType
:
ServiceDetailViewController
.
self
)
appointmentdetails
.
orderStatus
=
.
CLOSED
// appointmentdetails.serviceStatus = .completed
appointmentdetails
.
incrementId
=
selectedService
.
incrementId
appointmentdetails
.
orderId
=
selectedService
.
orderId
self
.
navigationController
?
.
pushViewController
(
appointmentdetails
,
animated
:
true
)
}
else
if
selectedService
.
serviceType
==
.
FAQ
{
}
else
if
selectedService
.
typeId
==
"faq"
{
// } else if selectedService.serviceType == .FAQ {
if
selectedService
.
status
==
.
PROCESSING
{
let
chatViewController
=
Utils
.
viewController
(
storyboardName
:
"Home"
,
ofType
:
OnlineEnquiryViewController
.
self
)
...
...
@@ -130,8 +132,8 @@ extension InvalidServicesViewController: UITableViewDelegate, UITableViewDataSou
enquiryDetailsViewController
.
orderId
=
selectedService
.
orderId
!
self
.
navigationController
?
.
pushViewController
(
enquiryDetailsViewController
,
animated
:
true
)
}
}
else
if
selectedService
.
serviceType
==
.
FORM
{
}
else
if
selectedService
.
typeId
==
"forms"
{
//
} else if selectedService.serviceType == .FORM{
if
let
form
=
Form
.
VC
(
with
:
selectedService
.
incrementId
!
,
orderId
:
selectedService
.
orderId
!
,
categoryType
:
selectedService
.
categoryType
){
self
.
navigationController
?
.
pushViewController
(
form
,
animated
:
true
)
}
...
...
Bhagyashree/Sunarc/Controller/Appointment/OnGoingServicesViewController.swift
View file @
098f06b8
...
...
@@ -107,8 +107,8 @@ extension OnGoingServicesViewController: UITableViewDelegate, UITableViewDataSou
let
selectedService
=
service
.
services
[
indexPath
.
row
]
if
selectedService
.
serviceType
==
.
BOOKING
{
if
selectedService
.
typeId
!
==
"booking"
{
//
if selectedService.serviceType == .BOOKING {
if
selectedService
.
status
==
.
SERVICE_ONGOING
{
let
videoCallVC
=
Utils
.
viewController
(
storyboardName
:
"Appointment"
,
ofType
:
VideoCallingViewController
.
self
)
videoCallVC
.
orderId
=
selectedService
.
orderId
!
...
...
@@ -120,7 +120,8 @@ extension OnGoingServicesViewController: UITableViewDelegate, UITableViewDataSou
// appointmentdetails.incrementId = selectedService.incrementId
// appointmentdetails.orderId = selectedService.orderId
// self.navigationController?.pushViewController(appointmentdetails, animated: true)
}
else
if
selectedService
.
serviceType
==
.
FAQ
{
}
else
if
selectedService
.
typeId
==
"faq"
{
// } else if selectedService.serviceType == .FAQ {
if
selectedService
.
status
==
.
PROCESSING
{
let
chatViewController
=
Utils
.
viewController
(
storyboardName
:
"Home"
,
ofType
:
OnlineEnquiryViewController
.
self
)
...
...
@@ -135,8 +136,8 @@ extension OnGoingServicesViewController: UITableViewDelegate, UITableViewDataSou
enquiryDetailsViewController
.
orderId
=
selectedService
.
orderId
!
self
.
navigationController
?
.
pushViewController
(
enquiryDetailsViewController
,
animated
:
true
)
}
}
else
if
selectedService
.
serviceType
==
.
FORM
{
}
else
if
selectedService
.
typeId
==
"forms"
{
//
} else if selectedService.serviceType == .FORM{
if
let
form
=
Form
.
VC
(
with
:
selectedService
.
incrementId
!
,
orderId
:
selectedService
.
orderId
!
,
categoryType
:
selectedService
.
categoryType
)
{
self
.
navigationController
?
.
pushViewController
(
form
,
animated
:
true
)
...
...
Bhagyashree/Sunarc/Controller/Appointment/ProcessingViewController.swift
View file @
098f06b8
...
...
@@ -107,15 +107,16 @@ extension ProcessingViewController: UITableViewDelegate, UITableViewDataSource {
let
selectedService
=
service
.
services
[
indexPath
.
row
]
if
selectedService
.
serviceType
==
.
BOOKING
{
if
selectedService
.
typeId
==
"booking"
{
//
if selectedService.serviceType == .BOOKING {
let
appointmentdetails
=
Utils
.
viewController
(
storyboardName
:
"Appointment"
,
ofType
:
ServiceDetailViewController
.
self
)
appointmentdetails
.
orderStatus
=
.
PROCESSING
// appointmentdetails.serviceStatus = .tbc
appointmentdetails
.
incrementId
=
selectedService
.
incrementId
appointmentdetails
.
orderId
=
selectedService
.
orderId
self
.
navigationController
?
.
pushViewController
(
appointmentdetails
,
animated
:
true
)
}
else
if
selectedService
.
serviceType
==
.
FAQ
{
}
else
if
selectedService
.
typeId
==
"faq"
{
// } else if selectedService.serviceType == .FAQ {
if
selectedService
.
status
==
.
PROCESSING
{
let
chatViewController
=
Utils
.
viewController
(
storyboardName
:
"Home"
,
ofType
:
OnlineEnquiryViewController
.
self
)
...
...
@@ -130,8 +131,8 @@ extension ProcessingViewController: UITableViewDelegate, UITableViewDataSource {
enquiryDetailsViewController
.
orderId
=
selectedService
.
orderId
!
self
.
navigationController
?
.
pushViewController
(
enquiryDetailsViewController
,
animated
:
true
)
}
}
else
if
selectedService
.
serviceType
==
.
FORM
{
}
else
if
selectedService
.
typeId
==
"forms"
{
//
} else if selectedService.serviceType == .FORM{
if
let
form
=
Form
.
VC
(
with
:
selectedService
.
incrementId
!
,
orderId
:
selectedService
.
orderId
!
,
categoryType
:
selectedService
.
categoryType
)
{
self
.
navigationController
?
.
pushViewController
(
form
,
animated
:
true
)
...
...
Bhagyashree/Sunarc/Controller/Appointment/ServiceDetailViewController.swift
View file @
098f06b8
...
...
@@ -425,15 +425,16 @@ extension MasterReplyCell: UITableViewDelegate, UITableViewDataSource, ResultAud
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
audioCell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"ResultAudioCell"
,
for
:
indexPath
)
as!
ResultAudioCell
audioCell
.
audioPath
=
arrayOfAudios
[
indexPath
.
row
]
audioCell
.
cellIndex
=
indexPath
.
row
audioCell
.
delegate
=
self
audioCell
.
btnPlay
.
tag
=
0
audioCell
.
btnPlay
.
tag
=
indexPath
.
row
audioCell
.
audioSlider
.
value
=
0
if
indexPath
.
row
==
playingAudioAtIndex
{
audioCell
.
btnPlay
.
setBackgroundImage
(
UIImage
(
named
:
"pause"
),
for
:
.
normal
)
audioCell
.
btnPlay
.
tag
=
8080
audioCell
.
isPlayingAudio
=
true
}
else
{
audioCell
.
btnPlay
.
setBackgroundImage
(
UIImage
(
named
:
"play"
),
for
:
.
normal
)
audioCell
.
isPlayingAudio
=
false
}
return
audioCell
}
...
...
@@ -456,16 +457,16 @@ protocol ResultAudioCellDelegate {
class
ResultAudioCell
:
UITableViewCell
{
@IBOutlet
var
btnPlay
:
UIButton
!
@IBOutlet
var
audioSlider
:
UISlider
!
var
audioPath
:
String
?
var
delegate
:
ResultAudioCellDelegate
?
var
cellIndex
=
0
var
isPlayingAudio
=
false
@IBAction
func
play
()
{
print
(
"tag =
\(
btnPlay
.
tag
)
"
)
if
btnPlay
.
tag
==
8080
{
if
isPlayingAudio
==
true
{
Audio
.
pause
()
btnPlay
.
tag
=
0
delegate
?
.
playingAudioAtIndex
(
index
:
1000
)
...
...
@@ -473,14 +474,15 @@ class ResultAudioCell: UITableViewCell {
}
if
let
audioPath
=
audioPath
{
delegate
?
.
playingAudioAtIndex
(
index
:
btnPlay
.
tag
)
Audio
.
playAudio
(
audioPath
:
audioPath
,
success
:
{
},
failure
:
{
(
errorMesaage
)
in
self
.
viewController
()?
.
view
.
showToast
(
errorMesaage
,
position
:
.
bottom
,
popTime
:
2.0
,
dismissOnTap
:
false
)
})
{
(
progress
,
duration
)
in
print
(
"progress =
\(
progress
)
duration =
\(
duration
)
"
)
self
.
audioSlider
.
maximumValue
=
duration
self
.
audioSlider
.
value
=
progress
}
}
else
{
...
...
Bhagyashree/Sunarc/Controller/Home/HomePageViewController.swift
View file @
098f06b8
...
...
@@ -145,8 +145,9 @@ extension HomePageViewController: UITableViewDelegate, UITableViewDataSource {
let
order
=
dashboard
.
orders
[
indexPath
.
row
-
1
]
if
order
.
products
.
first
?
.
serviceType
==
.
BOOKING
{
if
order
.
products
.
first
?
.
typeId
==
"booking"
{
// if order.products.first?.serviceType == .BOOKING {
if
order
.
status
==
.
SERVICE_ONGOING
{
let
videoCallVC
=
Utils
.
viewController
(
storyboardName
:
"Appointment"
,
ofType
:
VideoCallingViewController
.
self
)
videoCallVC
.
orderId
=
order
.
orderId
!
...
...
@@ -159,7 +160,8 @@ extension HomePageViewController: UITableViewDelegate, UITableViewDataSource {
self
.
navigationController
?
.
pushViewController
(
appointmentdetails
,
animated
:
true
)
}
}
else
if
order
.
products
.
first
?
.
serviceType
==
.
FAQ
{
}
else
if
order
.
products
.
first
?
.
typeId
==
"faq"
{
// } else if order.products.first?.serviceType == .FAQ {
if
order
.
status
==
.
PROCESSING
{
let
chatViewController
=
Utils
.
viewController
(
storyboardName
:
"Home"
,
ofType
:
OnlineEnquiryViewController
.
self
)
...
...
@@ -178,7 +180,8 @@ extension HomePageViewController: UITableViewDelegate, UITableViewDataSource {
self
.
navigationController
?
.
pushViewController
(
enquiryDetailsViewController
,
animated
:
true
)
}
}
else
if
order
.
products
.
first
?
.
serviceType
==
.
FORM
{
}
else
if
order
.
products
.
first
?
.
typeId
==
"forms"
{
// } else if order.products.first?.serviceType == .FORM{
if
order
.
status
==
.
COMPLETE
{
...
...
Bhagyashree/Sunarc/Controller/Home/OnlineEnquiryViewController.swift
View file @
098f06b8
...
...
@@ -32,6 +32,7 @@ class OnlineEnquiryViewController: BaseViewController {
var
customerId
:
String
?
var
chatCountId
=
""
var
recordingPermissionGranted
=
false
var
playAudioAtIndex
:
Int64
=
10000
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
...
...
@@ -277,11 +278,27 @@ extension OnlineEnquiryViewController: UITableViewDelegate, UITableViewDataSourc
if
chat
.
name
==
"Seller"
{
let
masterAudioCell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"masterAudio"
)
as!
OnlineEnquiryMasterAudioCell
masterAudioCell
.
audioPath
=
chat
.
msg
masterAudioCell
.
delegate
=
self
masterAudioCell
.
btnPlay
.
tag
=
indexPath
.
row
masterAudioCell
.
progressSlider
.
value
=
0.0
if
playAudioAtIndex
==
indexPath
.
row
{
masterAudioCell
.
btnPlay
.
setBackgroundImage
(
UIImage
(
named
:
"pause"
),
for
:
.
normal
)
}
else
{
masterAudioCell
.
btnPlay
.
setBackgroundImage
(
UIImage
(
named
:
"play"
),
for
:
.
normal
)
}
return
masterAudioCell
}
else
{
let
customerAudioCell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"customerAudio"
)
as!
OnlineEnquiryCustomerAudioCell
customerAudioCell
.
audioPath
=
chat
.
msg
customerAudioCell
.
customerProfileImage
=
customerProfileImage
customerAudioCell
.
delegate
=
self
customerAudioCell
.
btnPlay
.
tag
=
indexPath
.
row
customerAudioCell
.
progressSlider
.
value
=
0.0
if
playAudioAtIndex
==
indexPath
.
row
{
customerAudioCell
.
btnPlay
.
setBackgroundImage
(
UIImage
(
named
:
"pause"
),
for
:
.
normal
)
}
else
{
customerAudioCell
.
btnPlay
.
setBackgroundImage
(
UIImage
(
named
:
"play"
),
for
:
.
normal
)
}
return
customerAudioCell
}
}
...
...
@@ -290,6 +307,12 @@ extension OnlineEnquiryViewController: UITableViewDelegate, UITableViewDataSourc
}
}
extension
OnlineEnquiryViewController
:
OnlineEnquiryMasterAudioCellDelegate
,
OnlineEnquiryCustomerAudioCellDelegate
{
func
playPausTapped
(
atIndex
:
Int64
)
{
playAudioAtIndex
=
atIndex
self
.
tblChat
.
reloadData
()
}
}
extension
OnlineEnquiryViewController
:
UITextViewDelegate
{
...
...
@@ -352,16 +375,24 @@ class OnlineEnquiryCustomerCell: UITableViewCell {
}
}
protocol
OnlineEnquiryMasterAudioCellDelegate
{
func
playPausTapped
(
atIndex
:
Int64
)
}
class
OnlineEnquiryMasterAudioCell
:
UITableViewCell
{
@IBOutlet
var
btnPlay
:
UIButton
!
var
audioPath
:
String
?
@IBOutlet
var
imgMaster
:
UIImageView
!
@IBOutlet
var
progressSlider
:
UISlider
!
var
audioPath
:
String
?
var
delegate
:
OnlineEnquiryMasterAudioCellDelegate
?
var
isAudioPlaying
=
false
@IBAction
func
play
()
{
delegate
?
.
playPausTapped
(
atIndex
:
Int64
(
btnPlay
!.
tag
))
if
let
audioPath
=
audioPath
{
Audio
.
playAudio
(
audioPath
:
audioPath
,
success
:
{
...
...
@@ -389,16 +420,24 @@ class OnlineEnquiryMasterAudioCell: UITableViewCell {
}
protocol
OnlineEnquiryCustomerAudioCellDelegate
{
func
playPausTapped
(
atIndex
:
Int64
)
}
class
OnlineEnquiryCustomerAudioCell
:
UITableViewCell
{
@IBOutlet
var
btnPlay
:
UIButton
!
var
audioPath
:
String
?
var
customerProfileImage
:
String
?
@IBOutlet
var
imgCostomer
:
UIImageView
!
@IBOutlet
var
progressSlider
:
UISlider
!
var
audioPath
:
String
?
var
customerProfileImage
:
String
?
var
delegate
:
OnlineEnquiryCustomerAudioCellDelegate
?
@IBAction
func
play
()
{
delegate
?
.
playPausTapped
(
atIndex
:
Int64
(
btnPlay
!.
tag
))
if
let
audioPath
=
audioPath
{
Audio
.
playAudio
(
audioPath
:
audioPath
,
success
:
{
...
...
Bhagyashree/Sunarc/Controller/Me/MyAllServiceOrderViewController.swift
View file @
098f06b8
...
...
@@ -123,8 +123,8 @@ extension MyAllServiceOrderViewController: UITableViewDelegate, UITableViewDataS
let
selectedService
=
service
.
services
[
indexPath
.
row
]
if
selectedService
.
serviceType
==
.
BOOKING
{
if
selectedService
.
typeId
==
"booking"
{
//
if selectedService.serviceType == .BOOKING {
let
appointmentdetails
=
Utils
.
viewController
(
storyboardName
:
"Appointment"
,
ofType
:
ServiceDetailViewController
.
self
)
switch
service
.
services
[
indexPath
.
row
]
.
status
{
case
.
CANCELED
:
...
...
@@ -151,7 +151,8 @@ extension MyAllServiceOrderViewController: UITableViewDelegate, UITableViewDataS
appointmentdetails
.
incrementId
=
selectedService
.
incrementId
appointmentdetails
.
orderId
=
selectedService
.
orderId
self
.
navigationController
?
.
pushViewController
(
appointmentdetails
,
animated
:
true
)
}
else
if
selectedService
.
serviceType
==
.
FAQ
{
}
else
if
selectedService
.
typeId
==
"faq"
{
// } else if selectedService.serviceType == .FAQ {
if
selectedService
.
status
==
.
PROCESSING
{
let
chatViewController
=
Utils
.
viewController
(
storyboardName
:
"Home"
,
ofType
:
OnlineEnquiryViewController
.
self
)
...
...
@@ -170,8 +171,8 @@ extension MyAllServiceOrderViewController: UITableViewDelegate, UITableViewDataS
enquiryDetailsViewController
.
customerName
=
service
.
services
[
indexPath
.
row
]
.
customerName
self
.
navigationController
?
.
pushViewController
(
enquiryDetailsViewController
,
animated
:
true
)
}
}
else
if
selectedService
.
serviceType
==
.
FORM
{
}
else
if
selectedService
.
typeId
==
"form"
{
//
} else if selectedService.serviceType == .FORM{
if
selectedService
.
status
==
.
COMPLETE
{
let
appointmentdetails
=
Utils
.
viewController
(
storyboardName
:
"Appointment"
,
ofType
:
ServiceDetailViewController
.
self
)
...
...
Bhagyashree/Sunarc/Controller/Me/MyCompletedOrdersViewController.swift
View file @
098f06b8
...
...
@@ -101,14 +101,15 @@ extension MyCompletedOrdersViewController: UITableViewDelegate, UITableViewDataS
let
selectedService
=
service
.
services
[
indexPath
.
row
]
if
selectedService
.
serviceType
==
.
BOOKING
{
if
selectedService
.
typeId
==
"booking"
{
//
if selectedService.serviceType == .BOOKING {
let
appointmentdetails
=
Utils
.
viewController
(
storyboardName
:
"Appointment"
,
ofType
:
ServiceDetailViewController
.
self
)
appointmentdetails
.
serviceStatus
=
.
completed
appointmentdetails
.
incrementId
=
selectedService
.
incrementId
appointmentdetails
.
orderId
=
selectedService
.
orderId
self
.
navigationController
?
.
pushViewController
(
appointmentdetails
,
animated
:
true
)
}
else
if
selectedService
.
serviceType
==
.
FAQ
{
}
else
if
selectedService
.
typeId
==
"faq"
{
// } else if selectedService.serviceType == .FAQ {
if
selectedService
.
status
==
.
PROCESSING
{
let
chatViewController
=
Utils
.
viewController
(
storyboardName
:
"Home"
,
ofType
:
OnlineEnquiryViewController
.
self
)
...
...
@@ -126,7 +127,8 @@ extension MyCompletedOrdersViewController: UITableViewDelegate, UITableViewDataS
self
.
navigationController
?
.
pushViewController
(
enquiryDetailsViewController
,
animated
:
true
)
}
}
else
if
selectedService
.
serviceType
==
.
FORM
{
}
else
if
selectedService
.
typeId
==
"forms"
{
// } else if selectedService.serviceType == .FORM{
let
appointmentdetails
=
Utils
.
viewController
(
storyboardName
:
"Appointment"
,
ofType
:
ServiceDetailViewController
.
self
)
appointmentdetails
.
incrementId
=
selectedService
.
incrementId
...
...
Bhagyashree/Sunarc/Controller/Me/MyOngoingServiceOrderViewController.swift
View file @
098f06b8
...
...
@@ -102,7 +102,8 @@ extension MyOngoingServiceOrderViewController: UITableViewDelegate, UITableViewD
let
selectedService
=
service
.
services
[
indexPath
.
row
]
if
selectedService
.
serviceType
==
.
BOOKING
{
if
selectedService
.
typeId
==
"booking"
{
// if selectedService.serviceType == .BOOKING {
if
selectedService
.
status
==
.
SERVICE_ONGOING
{
let
videoCallVC
=
Utils
.
viewController
(
storyboardName
:
"Appointment"
,
ofType
:
VideoCallingViewController
.
self
)
...
...
@@ -115,7 +116,8 @@ extension MyOngoingServiceOrderViewController: UITableViewDelegate, UITableViewD
// appointmentdetails.incrementId = selectedService.incrementId
// appointmentdetails.orderId = selectedService.orderId
// self.navigationController?.pushViewController(appointmentdetails, animated: true)
}
else
if
selectedService
.
serviceType
==
.
FAQ
{
}
else
if
selectedService
.
typeId
==
"faq"
{
// } else if selectedService.serviceType == .FAQ {
if
selectedService
.
status
==
.
PROCESSING
{
let
chatViewController
=
Utils
.
viewController
(
storyboardName
:
"Home"
,
ofType
:
OnlineEnquiryViewController
.
self
)
...
...
@@ -131,7 +133,8 @@ extension MyOngoingServiceOrderViewController: UITableViewDelegate, UITableViewD
self
.
navigationController
?
.
pushViewController
(
enquiryDetailsViewController
,
animated
:
true
)
}
}
else
if
selectedService
.
serviceType
==
.
FORM
{
}
else
if
selectedService
.
typeId
==
"forms"
{
// } else if selectedService.serviceType == .FORM{
if
let
form
=
Form
.
VC
(
with
:
selectedService
.
incrementId
!
,
orderId
:
selectedService
.
orderId
!
,
categoryType
:
selectedService
.
categoryType
){
self
.
navigationController
?
.
pushViewController
(
form
,
animated
:
true
)
...
...
Bhagyashree/Sunarc/Controller/Me/MyUploadResultViewController.swift
View file @
098f06b8
...
...
@@ -102,13 +102,15 @@ extension MyUploadResultViewController: UITableViewDelegate, UITableViewDataSour
let
selectedService
=
service
.
services
[
indexPath
.
row
]
if
selectedService
.
serviceType
==
.
BOOKING
{
if
selectedService
.
typeId
==
"booking"
{
// if selectedService.serviceType == .BOOKING {
let
appointmentdetails
=
Utils
.
viewController
(
storyboardName
:
"Appointment"
,
ofType
:
ServiceDetailViewController
.
self
)
appointmentdetails
.
serviceStatus
=
.
tbc
appointmentdetails
.
incrementId
=
selectedService
.
incrementId
appointmentdetails
.
orderId
=
selectedService
.
orderId
self
.
navigationController
?
.
pushViewController
(
appointmentdetails
,
animated
:
true
)
}
else
if
selectedService
.
serviceType
==
.
FAQ
{
}
else
if
selectedService
.
typeId
==
"faq"
{
// } else if selectedService.serviceType == .FAQ {
if
selectedService
.
status
==
.
PROCESSING
{
let
chatViewController
=
Utils
.
viewController
(
storyboardName
:
"Home"
,
ofType
:
OnlineEnquiryViewController
.
self
)
...
...
@@ -124,7 +126,8 @@ extension MyUploadResultViewController: UITableViewDelegate, UITableViewDataSour
self
.
navigationController
?
.
pushViewController
(
enquiryDetailsViewController
,
animated
:
true
)
}
}
else
if
selectedService
.
serviceType
==
.
FORM
{
}
else
if
selectedService
.
typeId
==
"forms"
{
// } else if selectedService.serviceType == .FORM{
if
let
form
=
Form
.
VC
(
with
:
selectedService
.
incrementId
!
,
orderId
:
selectedService
.
orderId
!
,
categoryType
:
selectedService
.
categoryType
)
{
self
.
navigationController
?
.
pushViewController
(
form
,
animated
:
true
)
...
...
Bhagyashree/Sunarc/Model/Appointment/EditResult.swift
View file @
098f06b8
...
...
@@ -23,6 +23,9 @@ class EditResult {
func
updateResult
(
for
orderId
:
String
,
success
:
@escaping
()
->
Void
,
failure
:
@escaping
(
_
errorMesage
:
String
)
->
Void
)
{
print
(
self
.
images
.
count
)
print
(
self
.
audios
.
count
)
self
.
uploadAudios
(
index
:
0
)
{
self
.
uploadImages
(
index
:
0
)
{
...
...
@@ -30,6 +33,13 @@ class EditResult {
self
.
uploadedProducts
=
self
.
uploadedProducts
+
","
+
product
.
entityId
!
}
if
self
.
uploadedImages
.
count
>
0
{
self
.
uploadedImages
.
removeFirst
()
}
if
self
.
uploadedAudios
.
count
>
0
{
self
.
uploadedAudios
.
removeFirst
()
}
let
parameters
:
[
String
:
Any
]
=
[
"storeId"
:
UserDefaults
.
standard
.
value
(
forKey
:
"storeId"
)
as!
String
,
"orderId"
:
orderId
,
"reply_text"
:
self
.
message
,
...
...
@@ -38,7 +48,6 @@ class EditResult {
"products"
:
self
.
uploadedProducts
]
SVProgressHUD
.
show
()
let
headers
=
[
...
...
@@ -184,7 +193,6 @@ class EditResult {
}
}
}
}
}
...
...
Bhagyashree/Sunarc/Model/Home/HomeScreen/Product.swift
View file @
098f06b8
...
...
@@ -54,67 +54,70 @@ class Product {
var
qty
:
Int
=
0
var
serviceType
=
ServiceType
.
UNKNOWN
var
categoryType
=
CategoryType
.
Unknown
var
typeId
:
String
?
func
initWithJSON
(
json
:
Any
)
{
if
let
response
=
json
as?
[
String
:
Any
]
{
self
.
productId
=
response
[
"productId"
]
as?
String
self
.
name
=
response
[
"name"
]
as?
String
self
.
qty
=
response
[
"qty"
]
as!
Int
if
let
categoryType_
=
response
[
"category_type"
]
as?
String
{
self
.
categoryType
=
CategoryType
(
rawValue
:
categoryType_
)
!
switch
self
.
categoryType
{
case
.
OnlineFAQ
:
self
.
serviceType
=
.
FAQ
case
.
FortuneOfTheYear
:
fallthrough
case
.
VideoFortuneTelling
:
fallthrough
case
.
OnlineFaceReading
:
self
.
serviceType
=
.
BOOKING
case
.
IndividualNamingServiceNamed
:
fallthrough
case
.
IndividualNamingServiceReNamedChangeName
:
fallthrough
case
.
CompanyNamingServiceNamed
:
fallthrough
case
.
CompanyNamingServiceReNamedChangeName
:
fallthrough
case
.
FloorPlanFengShuiGeomancy
:
fallthrough
case
.
FloorPlanFengShuiCorporateFengShui
:
fallthrough
case
.
OnsiteServiceGeomancy
:
fallthrough
case
.
OnsiteServiceCorporateFengShui
:
fallthrough
case
.
Groundbreaking
:
fallthrough
case
.
Registration
:
fallthrough
case
.
MovingHouse
:
fallthrough
case
.
MovingCompany
:
fallthrough
case
.
StartOpeningBusiness
:
fallthrough
case
.
Marriage
:
fallthrough
case
.
GODSetting
:
fallthrough
case
.
BedSetting
:
self
.
serviceType
=
.
FORM
case
.
MoreServices
:
self
.
serviceType
=
.
MORE
case
.
Unknown
:
self
.
serviceType
=
.
UNKNOWN
}
}
self
.
typeId
=
response
[
"typeId"
]
as?
String
// if let categoryType_ = response["category_type"] as? String {
// self.categoryType = CategoryType(rawValue: categoryType_)!
//
// switch self.categoryType {
// case .OnlineFAQ:
// self.serviceType = .FAQ
//
// case .FortuneOfTheYear:
// fallthrough
// case .VideoFortuneTelling:
// fallthrough
// case .OnlineFaceReading:
// self.serviceType = .BOOKING
//
//
// case .IndividualNamingServiceNamed:
// fallthrough
// case .IndividualNamingServiceReNamedChangeName:
// fallthrough
// case .CompanyNamingServiceNamed:
// fallthrough
// case .CompanyNamingServiceReNamedChangeName:
// fallthrough
// case .FloorPlanFengShuiGeomancy:
// fallthrough
// case .FloorPlanFengShuiCorporateFengShui:
// fallthrough
// case .OnsiteServiceGeomancy:
// fallthrough
// case .OnsiteServiceCorporateFengShui:
// fallthrough
// case .Groundbreaking:
// fallthrough
// case .Registration:
// fallthrough
// case .MovingHouse:
// fallthrough
// case .MovingCompany:
// fallthrough
// case .StartOpeningBusiness:
// fallthrough
// case .Marriage:
// fallthrough
// case .GODSetting:
// fallthrough
// case .BedSetting:
// self.serviceType = .FORM
//
// case .MoreServices:
// self.serviceType = .MORE
// case .Unknown:
// self.serviceType = .UNKNOWN
// }
// }
}
}
...
...
Bhagyashree/Sunarc/Model/Me/Service.swift
View file @
098f06b8
...
...
@@ -39,6 +39,8 @@ class Service {
var
serviceType
=
ServiceType
.
UNKNOWN
var
categoryType
=
CategoryType
.
Unknown
var
typeId
:
String
?
var
currentPage
=
1
var
maxPageNo
=
0
...
...
@@ -48,8 +50,6 @@ class Service {
func
initWithJSON
(
json
:
[
String
:
Any
])
{
print
(
json
)
if
let
status
=
json
[
"status"
]
as?
String
{
self
.
status
=
MyServiceStatus
(
rawValue
:
status
)
!
}
...
...
@@ -62,60 +62,61 @@ class Service {
self
.
productName
=
productInfo
[
"name"
]
as?
String
self
.
productId
=
productInfo
[
"productId"
]
as?
String
self
.
customerId
=
productInfo
[
"customer_id"
]
as?
String
if
let
categoryType_
=
productInfo
[
"category_type"
]
as?
String
{
self
.
categoryType
=
CategoryType
(
rawValue
:
categoryType_
)
!
switch
self
.
categoryType
{
case
.
OnlineFAQ
:
self
.
serviceType
=
.
FAQ
case
.
FortuneOfTheYear
:
fallthrough
case
.
VideoFortuneTelling
:
fallthrough
case
.
OnlineFaceReading
:
self
.
serviceType
=
.
BOOKING
case
.
IndividualNamingServiceNamed
:
fallthrough
case
.
IndividualNamingServiceReNamedChangeName
:
fallthrough
case
.
CompanyNamingServiceNamed
:
fallthrough
case
.
CompanyNamingServiceReNamedChangeName
:
fallthrough
case
.
FloorPlanFengShuiGeomancy
:
fallthrough
case
.
FloorPlanFengShuiCorporateFengShui
:
fallthrough
case
.
OnsiteServiceGeomancy
:
fallthrough
case
.
OnsiteServiceCorporateFengShui
:
fallthrough
case
.
Groundbreaking
:
fallthrough
case
.
Registration
:
fallthrough
case
.
MovingHouse
:
fallthrough
case
.
MovingCompany
:
fallthrough
case
.
StartOpeningBusiness
:
fallthrough
case
.
Marriage
:
fallthrough
case
.
GODSetting
:
fallthrough
case
.
BedSetting
:
self
.
serviceType
=
.
FORM
case
.
MoreServices
:
self
.
serviceType
=
.
MORE
case
.
Unknown
:
self
.
serviceType
=
.
UNKNOWN
}
}
self
.
typeId
=
productInfo
[
"typeId"
]
as?
String
// if let categoryType_ = productInfo["category_type"] as? String {
// self.categoryType = CategoryType(rawValue: categoryType_)!
//
// switch self.categoryType {
// case .OnlineFAQ:
// self.serviceType = .FAQ
//
// case .FortuneOfTheYear:
// fallthrough
// case .VideoFortuneTelling:
// fallthrough
// case .OnlineFaceReading:
// self.serviceType = .BOOKING
//
// case .IndividualNamingServiceNamed:
// fallthrough
// case .IndividualNamingServiceReNamedChangeName:
// fallthrough
// case .CompanyNamingServiceNamed:
// fallthrough
// case .CompanyNamingServiceReNamedChangeName:
// fallthrough
// case .FloorPlanFengShuiGeomancy:
// fallthrough
// case .FloorPlanFengShuiCorporateFengShui:
// fallthrough
// case .OnsiteServiceGeomancy:
// fallthrough
// case .OnsiteServiceCorporateFengShui:
// fallthrough
// case .Groundbreaking:
// fallthrough
// case .Registration:
// fallthrough
// case .MovingHouse:
// fallthrough
// case .MovingCompany:
// fallthrough
// case .StartOpeningBusiness:
// fallthrough
// case .Marriage:
// fallthrough
// case .GODSetting:
// fallthrough
// case .BedSetting:
// self.serviceType = .FORM
//
// case .MoreServices:
// self.serviceType = .MORE
// case .Unknown:
// self.serviceType = .UNKNOWN
// }
// }
}
}
...
...
Bhagyashree/Sunarc/Other/Audio.swift
View file @
098f06b8
...
...
@@ -16,8 +16,9 @@ class Audio {
var
audioPlayer
:
AVPlayer
?
var
audioPlayerForLocalFile
:
AVAudioPlayer
?
var
currentRecordingPath
:
String
?
var
timer
:
Timer
?
static
let
shared
=
Audio
()
var
Timestamp
:
String
{
let
date
=
Date
();
let
formatter
=
DateFormatter
()
...
...
@@ -63,8 +64,7 @@ class Audio {
class
func
playAudio
(
audioPath
:
String
,
success
:()
->
Void
,
failure
:
(
_
message
:
String
)
->
Void
,
progress
:
@escaping
(
_
progress
:
Float
,
_
duration
:
Float
)
->
Void
)
{
// class func playAudio(audioPath: String, success:() -> Void, failure: (_ message: String) -> Void) {
if
audioPath
.
first
==
"/"
{
// local file path
let
audioURL
=
URL
(
fileURLWithPath
:
audioPath
)
do
{
...
...
@@ -74,6 +74,21 @@ class Audio {
try
Audio
.
shared
.
audioPlayerForLocalFile
=
AVAudioPlayer
(
contentsOf
:
audioURL
)
Audio
.
shared
.
audioPlayerForLocalFile
!.
prepareToPlay
()
Audio
.
shared
.
audioPlayerForLocalFile
!.
play
()
Audio
.
shared
.
timer
=
Timer
.
scheduledTimer
(
withTimeInterval
:
1.0
,
repeats
:
true
)
{
(
timer
)
in
let
currentTime
=
Float
(
Audio
.
shared
.
audioPlayerForLocalFile
!.
currentTime
)
let
duration
=
Float
(
Audio
.
shared
.
audioPlayerForLocalFile
!.
duration
)
progress
(
Float
(
currentTime
),
Float
(
duration
.
isNaN
==
true
?
0.0
:
duration
))
if
Audio
.
shared
.
audioPlayerForLocalFile
?
.
isPlaying
==
true
{
progress
(
Float
(
currentTime
),
Float
(
duration
.
isNaN
==
true
?
0.0
:
duration
))
}
else
{
progress
(
1000.0
,
1000.0
)
Audio
.
shared
.
timer
?
.
invalidate
()
}
}
success
()
}
catch
{
failure
(
error
.
localizedDescription
)
...
...
@@ -112,6 +127,7 @@ class Audio {
if
Audio
.
shared
.
audioPlayer
!=
nil
{
Audio
.
shared
.
audioPlayer
!.
pause
()
Audio
.
shared
.
audioPlayerForLocalFile
?
.
pause
()
Audio
.
shared
.
timer
?
.
invalidate
()
}
}
...
...
Bhagyashree/Sunarc/View/Appointment.storyboard
View file @
098f06b8
This diff is collapsed.
Click to expand it.
Bhagyashree/Sunarc/View/Home.storyboard
View file @
098f06b8
...
...
@@ -1626,7 +1626,7 @@
<constraint
firstAttribute=
"height"
constant=
"45"
id=
"XbZ-vL-zoL"
/>
<constraint
firstAttribute=
"width"
constant=
"45"
id=
"Z29-nc-MV1"
/>
</constraints>
<state
key=
"normal"
i
mage=
"play"
/>
<state
key=
"normal"
backgroundI
mage=
"play"
/>
<connections>
<action
selector=
"play"
destination=
"vtw-sw-ByE"
eventType=
"touchUpInside"
id=
"1bv-0J-FCh"
/>
</connections>
...
...
@@ -1683,7 +1683,7 @@
<constraint
firstAttribute=
"width"
constant=
"45"
id=
"79P-yY-OHu"
/>
<constraint
firstAttribute=
"height"
constant=
"45"
id=
"kNY-xT-qzo"
/>
</constraints>
<state
key=
"normal"
i
mage=
"play"
/>
<state
key=
"normal"
backgroundI
mage=
"play"
/>
<connections>
<action
selector=
"play"
destination=
"LQQ-dP-WjW"
eventType=
"touchUpInside"
id=
"REZ-mg-ckA"
/>
</connections>
...
...
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