Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GeliBusinessPlatform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ljy
GeliBusinessPlatform
Commits
29f9ccc3
Commit
29f9ccc3
authored
May 19, 2020
by
刘俊宏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对接新增商品ing
parent
e4cda593
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
221 additions
and
4 deletions
+221
-4
GeliBusinessPlatform.xcodeproj/project.pbxproj
GeliBusinessPlatform.xcodeproj/project.pbxproj
+4
-0
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
...ata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/Define/Define.swift
GeliBusinessPlatform/Define/Define.swift
+1
-1
GeliBusinessPlatform/View/AlertView/GLAlertSelectView.swift
GeliBusinessPlatform/View/AlertView/GLAlertSelectView.swift
+1
-0
GeliBusinessPlatform/View/TimeSelectView/ShowTimeSelectView.swift
...nessPlatform/View/TimeSelectView/ShowTimeSelectView.swift
+145
-0
GeliBusinessPlatform/ViewController/商品详情/ProductDetailViewController.swift
...orm/ViewController/商品详情/ProductDetailViewController.swift
+0
-0
GeliBusinessPlatform/ViewController/新增规格/CreatNewSpecsViewController.swift
...orm/ViewController/新增规格/CreatNewSpecsViewController.swift
+1
-0
GeliBusinessPlatform/ViewController/蓝牙连接/BluetoothConnectViewController.swift
.../ViewController/蓝牙连接/BluetoothConnectViewController.swift
+69
-3
No files found.
GeliBusinessPlatform.xcodeproj/project.pbxproj
View file @
29f9ccc3
...
...
@@ -325,6 +325,7 @@
F933F6CF2452C68B00189561
/* PKHUDErrorView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F933F6BE2452C68B00189561
/* PKHUDErrorView.swift */
;
};
F933F6D22452DAE100189561
/* TabBarContentClassView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F933F6D12452DAE000189561
/* TabBarContentClassView.swift */
;
};
F93E31F724721C4200524DFC
/* EditOGPAdModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F93E31F624721C4200524DFC
/* EditOGPAdModel.swift */
;
};
F93E31FD24727A2D00524DFC
/* ShowTimeSelectView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F93E31FC24727A2D00524DFC
/* ShowTimeSelectView.swift */
;
};
F94A314724624E9500FEC38E
/* GetGelipayInfoModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F94A314624624E9500FEC38E
/* GetGelipayInfoModel.swift */
;
};
F94A314924624FA400FEC38E
/* ShopAdministratorInfoModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F94A314824624FA400FEC38E
/* ShopAdministratorInfoModel.swift */
;
};
F94A314B246250DB00FEC38E
/* GoodsDetailModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F94A314A246250DB00FEC38E
/* GoodsDetailModel.swift */
;
};
...
...
@@ -812,6 +813,7 @@
F933F6BF2452C68B00189561
/* PKHUD.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
PKHUD.h
;
sourceTree
=
"<group>"
;
};
F933F6D12452DAE000189561
/* TabBarContentClassView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
TabBarContentClassView.swift
;
sourceTree
=
"<group>"
;
};
F93E31F624721C4200524DFC
/* EditOGPAdModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
EditOGPAdModel.swift
;
sourceTree
=
"<group>"
;
};
F93E31FC24727A2D00524DFC
/* ShowTimeSelectView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ShowTimeSelectView.swift
;
sourceTree
=
"<group>"
;
};
F94A314624624E9500FEC38E
/* GetGelipayInfoModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
GetGelipayInfoModel.swift
;
sourceTree
=
"<group>"
;
};
F94A314824624FA400FEC38E
/* ShopAdministratorInfoModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ShopAdministratorInfoModel.swift
;
sourceTree
=
"<group>"
;
};
F94A314A246250DB00FEC38E
/* GoodsDetailModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
GoodsDetailModel.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -1972,6 +1974,7 @@
F950FDE92451920200C40530
/* DIYCalendarCell.swift */
,
F9956B1B2463D941001A617D
/* WorkSelectTimeView.xib */
,
F9956B1D2463D94E001A617D
/* WorkSelectTimeView.swift */
,
F93E31FC24727A2D00524DFC
/* ShowTimeSelectView.swift */
,
);
path
=
TimeSelectView
;
sourceTree
=
"<group>"
;
...
...
@@ -2684,6 +2687,7 @@
F950FDA92451613500C40530
/* GetMobileModel.swift in Sources */
,
F94A314724624E9500FEC38E
/* GetGelipayInfoModel.swift in Sources */
,
E0B5307E247266F400FFCC15
/* DKXDAdrCell.swift in Sources */
,
F93E31FD24727A2D00524DFC
/* ShowTimeSelectView.swift in Sources */
,
E0B94623245671E100FBEC9A
/* DaiKeXiaDanGouWuViewController.swift in Sources */
,
E0A320C52456D01300AF321C
/* DaiKeXiaDanFooterView.swift in Sources */
,
E0336DD5244EC40000380BE9
/* CreatNewSpecsViewController.swift in Sources */
,
...
...
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
View file @
29f9ccc3
No preview for this file type
GeliBusinessPlatform/Define/Define.swift
View file @
29f9ccc3
...
...
@@ -124,7 +124,7 @@ func isPurnInt(string: String) -> Bool {
return
scan
.
scanInt
(
&
val
)
&&
scan
.
isAtEnd
}
//MARK:--是否是正确的数值
func
isPurnNumber
(
str
:
String
)
->
Bool
{
if
isPurnInt
(
string
:
str
)
||
isPurnFloat
(
string
:
str
){
return
true
...
...
GeliBusinessPlatform/View/AlertView/GLAlertSelectView.swift
View file @
29f9ccc3
...
...
@@ -36,6 +36,7 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
var
tempNum
:
Int
?
var
tempArr
:
Array
<
Int
>
?
=
[]
var
selectLblText
:
String
?
=
""
var
isShangPinType
:
Bool
=
false
var
kuWeiArr
=
Array
<
Any
>
(){
didSet
{
var
tbvH
=
CGFloat
(
kuWeiArr
.
count
*
49
)
...
...
GeliBusinessPlatform/View/TimeSelectView/ShowTimeSelectView.swift
0 → 100644
View file @
29f9ccc3
//
// ShowTimeSelectView.swift
// GeliBusinessPlatform
//
// Created by 刘俊宏 on 2020/5/18.
// Copyright © 2020 junye lu. All rights reserved.
//
import
UIKit
protocol
ShowTimeSelectViewDelegate
{
func
showTimeSelectByData
(
timeStr
:
String
,
beginDate
:
Date
,
endginDate
:
Date
)
}
class
ShowTimeSelectView
:
UIView
,
TimeSelectViewDelgate
{
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
self
.
backgroundColor
=
UIColor
.
clear
blackView
.
backgroundColor
=
UIColor
.
init
(
named
:
"提示视图背景色"
)
blackView
.
addTarget
(
self
,
action
:
#selector(
hideAction(sender:)
)
,
for
:
.
touchUpInside
)
self
.
addSubview
(
blackView
)
blackView
.
snp
.
makeConstraints
{
(
make
)
in
make
.
left
.
top
.
bottom
.
right
.
equalToSuperview
()
}
self
.
addSubview
(
contetV
)
self
.
addSubview
(
sureBtn
)
contetV
.
backgroundColor
=
UIColor
.
white
contetV
.
layer
.
cornerRadius
=
5
contetV
.
snp
.
makeConstraints
{
(
make
)
in
make
.
left
.
right
.
equalToSuperview
()
make
.
bottom
.
equalTo
(
sureBtn
.
snp_top
)
.
offset
(
3*
glscale
)
make
.
height
.
equalTo
(
340*
glscale
)
}
sureBtn
.
snp
.
makeConstraints
{
(
make
)
in
make
.
left
.
right
.
bottom
.
equalToSuperview
()
make
.
height
.
equalTo
(
TabHeight
)
}
sureBtn
.
setTitle
(
"确定"
,
for
:
.
normal
)
sureBtn
.
addTarget
(
self
,
action
:
#selector(
sureAction(sender:)
)
,
for
:
.
touchUpInside
)
sureBtn
.
backgroundColor
=
UIColor
.
init
(
named
:
"蓝色字体颜色"
)
sureBtn
.
setTitleColor
(
UIColor
.
white
,
for
:
.
normal
)
sureBtn
.
titleLabel
?
.
font
=
UIFont
.
boldSystemFont
(
ofSize
:
17
)
titleLbl
.
text
=
"选择时间段"
titleLbl
.
textColor
=
UIColor
.
init
(
named
:
"标题字颜色"
)
titleLbl
.
font
=
UIFont
.
boldSystemFont
(
ofSize
:
15
)
contetV
.
addSubview
(
titleLbl
)
titleLbl
.
snp
.
makeConstraints
{
(
make
)
in
make
.
top
.
equalTo
(
15*
glscale
)
make
.
centerX
.
equalToSuperview
()
}
let
lineV
=
UIView
()
lineV
.
backgroundColor
=
UIColor
.
init
(
named
:
"灰色分界线"
)
contetV
.
addSubview
(
lineV
)
lineV
.
snp
.
makeConstraints
{
(
make
)
in
make
.
left
.
right
.
equalToSuperview
()
make
.
top
.
equalTo
(
titleLbl
.
snp_bottom
)
.
offset
(
15*
glscale
)
make
.
height
.
equalTo
(
1
)
}
let
kuangV
=
UIView
()
kuangV
.
layer
.
borderColor
=
UIColor
.
init
(
named
:
"灰色字体颜色"
)?
.
cgColor
kuangV
.
layer
.
borderWidth
=
1
kuangV
.
layer
.
cornerRadius
=
3
contetV
.
addSubview
(
kuangV
)
kuangV
.
snp
.
makeConstraints
{
(
make
)
in
make
.
height
.
equalTo
(
32*
glscale
)
make
.
width
.
equalTo
(
180*
glscale
)
make
.
left
.
equalTo
(
15*
glscale
)
make
.
top
.
equalTo
(
lineV
.
snp_bottom
)
.
offset
(
15*
glscale
)
}
clearBtn
.
setImage
(
UIImage
.
init
(
named
:
"workTimeDel"
),
for
:
.
normal
)
clearBtn
.
addTarget
(
self
,
action
:
#selector(
clearBtnAction(sender:)
)
,
for
:
.
touchUpInside
)
contetV
.
addSubview
(
clearBtn
)
clearBtn
.
snp
.
makeConstraints
{
(
make
)
in
make
.
right
.
equalTo
(
kuangV
.
snp_right
)
.
offset
(
-
7*
glscale
)
make
.
centerY
.
equalTo
(
kuangV
)
}
timeLbl
.
text
=
"-"
timeLbl
.
font
=
UIFont
.
systemFont
(
ofSize
:
13
)
timeLbl
.
textColor
=
UIColor
.
init
(
named
:
"标题字颜色"
)
contetV
.
addSubview
(
timeLbl
)
timeLbl
.
snp
.
makeConstraints
{
(
make
)
in
make
.
centerY
.
equalTo
(
kuangV
)
make
.
left
.
equalTo
(
kuangV
.
snp_left
)
.
offset
(
10*
glscale
)
}
calendarV
.
moreSelection
=
true
contetV
.
addSubview
(
calendarV
)
calendarV
.
delegate
=
self
}
let
blackView
=
UIButton
(
type
:
.
custom
)
let
sureBtn
=
UIButton
(
type
:
.
custom
)
let
contetV
=
UIView
()
let
titleLbl
=
UILabel
()
let
timeLbl
=
UILabel
()
let
clearBtn
=
UIButton
(
type
:
.
custom
)
let
calendarV
=
TimeSelectView
(
frame
:
CGRect
(
x
:
0
,
y
:
105*
glscale
,
width
:
fullScreenWidth
,
height
:
235*
glscale
))
var
delegate
:
ShowTimeSelectViewDelegate
?
var
BeginDate
:
Date
!
=
nil
var
EndDate
:
Date
!
=
nil
func
selectMoreDate
(
beginDate
:
Date
,
endginDate
:
Date
)
{
print
(
"选择日期·····"
)
let
timeInterval
:
TimeInterval
=
beginDate
.
timeIntervalSince1970
let
timeIntervalEnd
:
TimeInterval
=
endginDate
.
timeIntervalSince1970
timeLbl
.
text
=
dayByDouble
(
sender
:
timeInterval
)
+
"-"
+
dayByDouble
(
sender
:
timeIntervalEnd
)
EndDate
=
endginDate
BeginDate
=
beginDate
}
@objc
func
sureAction
(
sender
:
UIButton
)
{
print
(
"确定日期·····"
)
if
EndDate
==
nil
{
HUD
.
flash
(
.
label
(
"请选择时间段"
),
delay
:
1.2
)
return
}
self
.
delegate
?
.
showTimeSelectByData
(
timeStr
:
timeLbl
.
text
!
,
beginDate
:
BeginDate
,
endginDate
:
EndDate
)
self
.
removeFromSuperview
()
}
@objc
func
clearBtnAction
(
sender
:
UIButton
){
print
(
"清除日期·····"
)
EndDate
=
nil
BeginDate
=
nil
timeLbl
.
text
=
"-"
calendarV
.
clearTheSelect
()
}
@objc
func
hideAction
(
sender
:
UIButton
){
self
.
removeFromSuperview
()
}
required
init
?(
coder
aDecoder
:
NSCoder
)
{
super
.
init
(
coder
:
aDecoder
)
}
}
GeliBusinessPlatform/ViewController/商品详情/ProductDetailViewController.swift
View file @
29f9ccc3
This diff is collapsed.
Click to expand it.
GeliBusinessPlatform/ViewController/新增规格/CreatNewSpecsViewController.swift
View file @
29f9ccc3
...
...
@@ -355,6 +355,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
item
=
jieTiArr
[
indexPath
.
row
]
as!
NSString
}
if
item
!=
""
{
//MARK:--阶梯价格切割
let
arr
=
item
.
components
(
separatedBy
:
"_"
)
cell
.
priceTF
.
text
=
arr
[
0
]
cell
.
countTF
.
text
=
arr
[
1
]
...
...
GeliBusinessPlatform/ViewController/蓝牙连接/BluetoothConnectViewController.swift
View file @
29f9ccc3
...
...
@@ -8,7 +8,7 @@
import
UIKit
import
Dollar
class
BluetoothConnectViewController
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
{
class
BluetoothConnectViewController
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
,
CBPeripheralDelegate
{
...
...
@@ -64,6 +64,13 @@ class BluetoothConnectViewController: BaseViewController,UITableViewDelegate,UIT
self
.
selectDataArray
.
insert
(
peripheral
!
,
at
:
0
)
self
.
tableView
.
reloadData
()
HUD
.
flash
(
.
labeledSubSuccess
(
subtitle
:
"连接成功"
),
delay
:
1.5
)
//停在扫描?
self
.
baby
?
.
cancelScan
()
peripheral
?
.
delegate
=
self
//[peripheral discoverServices:@[[CBUUID UUIDWithString:SERVICE_UUID]]];
//外设发现服务,传nil代表不过滤,一次性读出外设的所有服务
peripheral
?
.
discoverServices
(
nil
)
})
baby
?
.
setBlockOnFailToConnect
({
(
central
,
peripheral
,
error
)
in
...
...
@@ -80,6 +87,57 @@ class BluetoothConnectViewController: BaseViewController,UITableViewDelegate,UIT
})
//获取外围设备服务和特征1
// baby?.discoverServices()//发现Services
// baby?.setBlockOnDiscoverServices({ (peripheral, error) in
// //遍历服务
// peripheral?.services?.forEach({ (service) in
// print("遍历发现的服务\(service)")
// peripheral?.discoverCharacteristics(nil, for: service)
// })
// })
}
//MARK:--发现外围设备服务1
func
peripheral
(
_
peripheral
:
CBPeripheral
,
didDiscoverServices
error
:
Error
?)
{
//遍历服务
print
(
"-发现外围设备服务1"
)
peripheral
.
services
?
.
forEach
({
(
service
)
in
print
(
"遍历发现的服务
\(
service
)
"
)
peripheral
.
discoverCharacteristics
(
nil
,
for
:
service
)
//服务注册
})
}
//MARK:--发现外围设备特征2
func
peripheral
(
_
peripheral
:
CBPeripheral
,
didDiscoverCharacteristicsFor
service
:
CBService
,
error
:
Error
?)
{
print
(
"-发现外围设备特征2"
)
if
error
==
nil
{
service
.
characteristics
?
.
forEach
({
(
characteristic
)
in
print
(
"遍历特征
\(
characteristic
.
uuid
)
"
)
//要跟UUID
peripheral
.
setNotifyValue
(
true
,
for
:
characteristic
)
//特征注册
})
}
}
//MARK:--外设返回数据(回调)
func
peripheral
(
_
peripheral
:
CBPeripheral
,
didUpdateValueFor
characteristic
:
CBCharacteristic
,
error
:
Error
?)
{
let
data
=
characteristic
.
value
let
resultByte
=
data
?
.
bytes
print
(
"外设回调数据----
\(
data
)
==
\(
resultByte
)
"
)
if
data
!.
count
>=
1
{
if
resultByte
!
[
0
]
==
16
{
print
(
"---打印机打开--"
)
}
else
if
resultByte
!
[
0
]
==
1
{
print
(
"---打印机缺纸--"
)
}
}
}
func
peripheral
(
_
peripheral
:
CBPeripheral
,
didWriteValueFor
characteristic
:
CBCharacteristic
,
error
:
Error
?)
{
print
(
"写入数据的回调么"
)
}
...
...
@@ -87,8 +145,16 @@ class BluetoothConnectViewController: BaseViewController,UITableViewDelegate,UIT
@IBAction
func
searchAction
(
_
sender
:
Any
)
{
print
(
"搜索"
)
baby
?
.
scanForPeripherals
()
baby
?
.
begin
()
//临时处理给外设写入数据
let
byte
=
[
0x1B
,
0x68
]
let
data
=
Data
.
init
(
bytes
:
byte
,
count
:
3
)
let
currPeripheral
:
CBPeripheral
=
self
.
selectDataArray
[
0
]
//写入数据
// currPeripheral.writeValue(data, for: <#T##CBCharacteristic#>, type: CBCharacteristicWriteType)
// baby?.scanForPeripherals()
// baby?.begin()
}
//MARK: -Cell delegate
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
...
...
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