Commit 8618676d authored by lujunye's avatar lujunye

订单详情,编辑修改完成

parent 9fdd4c98
......@@ -43,12 +43,12 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg
//MARK:--loginVC
func addLoginVc (isAgain:Bool){
let vc = LoginViewController()
vc.delegate = self
let contentView = vc
//
// let vc = DaiKeXiaDanGouWuViewController()
// let vc = LoginViewController()
// vc.delegate = self
// let contentView = vc
//
let vc = EPViewController()
let contentView = vc
if let windowScene = sceneC as? UIWindowScene {
if isAgain {
......@@ -94,7 +94,9 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg
// Create the SwiftUI view that provides the window contents.
tabBarController.viewControllers = [v1, v2, v3, v4, v5]
tabBarController.selectedIndex = 2
let contentView = tabBarController
......
......@@ -8,6 +8,7 @@
import UIKit
@objc protocol AddGuiGeCellDelegate {
@objc optional func AddGuiGeCellClick(cell:AddGuiGeCell)
}
......@@ -19,8 +20,10 @@ class AddGuiGeCell: UITableViewCell {
}
@IBOutlet weak var webView: UIWebView!
@IBOutlet weak var imgBtn: UIButton!
override func awakeFromNib() {
super.awakeFromNib()
......
......@@ -27,6 +27,7 @@
<action selector="btnClick:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="f2z-zc-fd6"/>
</connections>
</button>
<<<<<<< Updated upstream
<webView hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="VPT-Oe-WSi">
<rect key="frame" x="0.0" y="0.0" width="375" height="123.5"/>
<color key="backgroundColor" red="0.36078431370000003" green="0.38823529410000002" blue="0.4039215686" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
......@@ -40,6 +41,23 @@
<constraint firstItem="VPT-Oe-WSi" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="Req-lk-rDq"/>
<constraint firstAttribute="trailing" secondItem="VPT-Oe-WSi" secondAttribute="trailing" id="Xg4-F3-bgr"/>
<constraint firstAttribute="bottom" secondItem="VPT-Oe-WSi" secondAttribute="bottom" id="kSn-lp-ILF"/>
=======
<wkWebView hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="CAr-OI-1ll">
<rect key="frame" x="0.0" y="0.0" width="375" height="123.5"/>
<color key="backgroundColor" red="0.36078431370000003" green="0.38823529410000002" blue="0.4039215686" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<wkWebViewConfiguration key="configuration">
<audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/>
<wkPreferences key="preferences"/>
</wkWebViewConfiguration>
</wkWebView>
</subviews>
<constraints>
<constraint firstItem="FpT-RN-ad7" firstAttribute="centerX" secondItem="H2p-sc-9uM" secondAttribute="centerX" id="CTD-cA-1jp"/>
<constraint firstItem="CAr-OI-1ll" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="ONc-Hx-udy"/>
<constraint firstAttribute="trailing" secondItem="CAr-OI-1ll" secondAttribute="trailing" id="TDz-Oa-TvQ"/>
<constraint firstItem="CAr-OI-1ll" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="YRm-tl-0No"/>
<constraint firstAttribute="bottom" secondItem="CAr-OI-1ll" secondAttribute="bottom" id="jKB-ok-a3G"/>
>>>>>>> Stashed changes
<constraint firstAttribute="bottom" secondItem="FpT-RN-ad7" secondAttribute="bottom" constant="50" id="log-wz-xog"/>
<constraint firstItem="VPT-Oe-WSi" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="z8u-Ne-QN3"/>
</constraints>
......@@ -48,7 +66,11 @@
<connections>
<outlet property="btmH" destination="log-wz-xog" id="axu-Jf-zWN"/>
<outlet property="imgBtn" destination="FpT-RN-ad7" id="DdI-mW-7wW"/>
<<<<<<< Updated upstream
<outlet property="webView" destination="VPT-Oe-WSi" id="zDL-Pq-yMr"/>
=======
<outlet property="webView" destination="CAr-OI-1ll" id="L9y-OD-5rY"/>
>>>>>>> Stashed changes
</connections>
<point key="canvasLocation" x="131.15942028985509" y="121.875"/>
</tableViewCell>
......
......@@ -17,6 +17,7 @@ class XuanZeShangPinCell: UITableViewCell{
var sku_id:Int?
var model:GetGoodsInfoDataModel?
var maxNum :Int? = 0
@IBOutlet weak var iconImg: UIImageView!
@IBOutlet weak var priceLbl: UILabel!
@IBOutlet weak var yuShouImg: UIImageView!
......
......@@ -10,7 +10,7 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" restorationIdentifier="GoodsCollectionViewCell" id="gTV-IL-0wX" customClass="GoodsCollectionViewCell" customModule="GeliBusinessPlatform" customModuleProvider="target">
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" restorationIdentifier="GoodsCollectionViewCell" id="gTV-IL-0wX" customClass="GoodsCollectionViewCell" customModule="TestClass" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="165" height="283"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
......@@ -41,7 +41,7 @@
<action selector="lgBtnAction:" destination="gTV-IL-0wX" eventType="touchUpInside" id="oZP-vs-LlL"/>
</connections>
</view>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="T8c-YA-14K">
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="T8c-YA-14K">
<rect key="frame" x="0.0" y="0.0" width="165" height="165"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
......@@ -49,7 +49,7 @@
</constraints>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4Xi-Jf-NQw">
<rect key="frame" x="119" y="0.0" width="46" height="30"/>
<rect key="frame" x="121" y="-1" width="46" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="46" id="53T-yQ-mQh">
<userDefinedRuntimeAttributes>
......@@ -151,7 +151,7 @@
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="T8c-YA-14K" secondAttribute="trailing" id="0aE-7k-Jte"/>
<constraint firstItem="4Xi-Jf-NQw" firstAttribute="top" secondItem="DBH-ay-Cni" secondAttribute="top" id="5dP-Ts-A7R"/>
<constraint firstItem="4Xi-Jf-NQw" firstAttribute="top" secondItem="T8c-YA-14K" secondAttribute="top" constant="-1" id="5dP-Ts-A7R"/>
<constraint firstItem="p8r-r3-3OB" firstAttribute="leading" secondItem="w99-DC-tI2" secondAttribute="trailing" id="6Hf-Yf-TPI"/>
<constraint firstAttribute="bottom" secondItem="zEv-lz-wzj" secondAttribute="bottom" constant="30" id="9hh-F4-uqi">
<userDefinedRuntimeAttributes>
......@@ -170,7 +170,7 @@
<constraint firstItem="w99-DC-tI2" firstAttribute="leading" secondItem="DBH-ay-Cni" secondAttribute="leading" id="TfR-Fm-4jT"/>
<constraint firstAttribute="trailing" secondItem="MEL-J8-S3c" secondAttribute="trailing" id="To8-m8-AMm"/>
<constraint firstItem="50H-P6-uG6" firstAttribute="leading" secondItem="DBH-ay-Cni" secondAttribute="leading" constant="10" id="U8x-b9-F6R"/>
<constraint firstAttribute="trailing" secondItem="4Xi-Jf-NQw" secondAttribute="trailing" id="UE8-ZL-mKw"/>
<constraint firstItem="T8c-YA-14K" firstAttribute="trailing" secondItem="4Xi-Jf-NQw" secondAttribute="trailing" constant="-2" id="UE8-ZL-mKw"/>
<constraint firstItem="Ygg-2c-Pm9" firstAttribute="leading" secondItem="p8r-r3-3OB" secondAttribute="trailing" id="WYO-ft-e4n"/>
<constraint firstAttribute="bottom" secondItem="Ygg-2c-Pm9" secondAttribute="bottom" id="XGh-zL-1Lu"/>
<constraint firstAttribute="trailing" secondItem="Ygg-2c-Pm9" secondAttribute="trailing" id="ZTd-5t-9tY"/>
......@@ -223,7 +223,7 @@
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="灰色字体颜色">
<color red="0.40000000596046448" green="0.40000000596046448" blue="0.40000000596046448" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="白色背景色">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
......
......@@ -106,6 +106,11 @@ class ShowTimeSelectView: UIView ,TimeSelectViewDelgate{
let clearBtn = UIButton(type: .custom)
let calendarV = TimeSelectView(frame: CGRect(x: 0, y: 105*glscale, width: fullScreenWidth, height: 235*glscale))
var delegate : ShowTimeSelectViewDelegate?
var beginDateByWork: Date? = nil {
didSet {
calendarV.beginDateByWork = beginDateByWork
}
}
var BeginDate: Date! = nil
var EndDate: Date! = nil
......
......@@ -88,6 +88,9 @@ class TimeSelectView: UIView, FSCalendarDataSource, FSCalendarDelegate {
var EndDate: Date!
var SelectAction: Bool = false
//MARKl:--新增限定时间 ,如果不为nil就是有限定的时间
var beginDateByWork: Date? = nil
func setOldDate (beginD: Date , endD:Date) {
// let previousDate = self.gregorian.date(byAdding: .day, value: -1, to: beginD)!
// let nextDate = self.gregorian.date(byAdding: .day, value: -1, to: endD)!
......@@ -124,21 +127,37 @@ class TimeSelectView: UIView, FSCalendarDataSource, FSCalendarDelegate {
func calendar(_ calendar: FSCalendar, didSelect date: Date, at monthPosition: FSCalendarMonthPosition) {
let dateA = self.gregorian.date(byAdding: .day, value: 1, to: date)!
print("第一次选中\(dateA)")
if moreSelection {
if !SelectAction {
let selectArr = calendar.selectedDates
for select in selectArr{
calendar.deselect(select)
}
calendarC.select(date)
BeginDate = date
SelectAction = true
EndDate = nil
if beginDateByWork != nil {
let number = numberOfDaysWithFromDate(fromDate: beginDateByWork!, toDate: date)!
if number < 0 {
let beginDateByWorkT:TimeInterval = beginDateByWork!.timeIntervalSince1970
HUD.flash(.label("所选日期不得小于" + dayByDouble(sender: beginDateByWorkT)), delay: 1.2)
SelectAction = false
}else{
calendarC.select(date)
BeginDate = date
SelectAction = true
EndDate = nil
}
}else{
calendarC.select(date)
BeginDate = date
SelectAction = true
EndDate = nil
}
}else{
//MARK:--日期小于方法
let number = numberOfDaysWithFromDate(fromDate: BeginDate, toDate: date)!
if number < 0 {
print("小于开始日期,请重新选择")
......@@ -146,10 +165,26 @@ class TimeSelectView: UIView, FSCalendarDataSource, FSCalendarDelegate {
for select in selectArr{
calendar.deselect(select)
}
calendarC.select(date)
BeginDate = date
SelectAction = true
EndDate = nil
if beginDateByWork != nil {
let number = numberOfDaysWithFromDate(fromDate: beginDateByWork!, toDate: date)!
if number < 0 {
let beginDateByWorkT:TimeInterval = beginDateByWork!.timeIntervalSince1970
HUD.flash(.label("所选日期不得小于" + dayByDouble(sender: beginDateByWorkT)), delay: 1.2)
SelectAction = false
}else{
calendarC.select(date)
BeginDate = date
SelectAction = true
EndDate = nil
}
}else{
calendarC.select(date)
BeginDate = date
SelectAction = true
EndDate = nil
}
}else{
SelectAction = false
......@@ -159,10 +194,6 @@ class TimeSelectView: UIView, FSCalendarDataSource, FSCalendarDelegate {
calendarC.select(dateA)
}
// let previousDate = self.gregorian.date(byAdding: .day, value: 1, to: BeginDate)!
// print("选中开始时间\(previousDate)")
// let nextDate = self.gregorian.date(byAdding: .day, value: 1, to: EndDate)!
// print("选中结束时间\(nextDate)")
self.delegate?.selectMoreDate(beginDate: BeginDate, endginDate: EndDate)
}
......
......@@ -120,6 +120,7 @@ class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITab
searchBar.resignFirstResponder()
}
func getSearch(sender:String) {
seacrchArr.removeAll()
......@@ -147,6 +148,7 @@ class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITab
}
}
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
textField.resignFirstResponder()
if barTitle == "修改价格"{
......@@ -272,8 +274,6 @@ class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITab
cell.selectBtn.isSelected = false
cell.btmView.isHidden = true
cell.btmViewHeight.constant = 0
var isSelectByData = false
selectArr.forEach { (md) in
if md.sku_id == model.sku_id {
......@@ -286,11 +286,13 @@ class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITab
cell.btmViewHeight.constant = 89
}
}
}
return cell
}
func XuanZeShangPinCellTextChange(index: IndexPath,sender:XuanZeShangPinCell) {
......@@ -298,6 +300,7 @@ class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITab
let item = inputData[i]
if sender.sku_id == item.sku_id{
inputData.insert(sender, at: i)
inputData.remove(at: i+1)
}
}
......@@ -326,11 +329,13 @@ class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITab
func XuanZeShangPinCellBtnClick(index:IndexPath) {
let cell = listView.cellForRow(at: index) as! XuanZeShangPinCell
if isYuShou{//预售
let model = datas[index.row]
if model.adsale_inventory == 0 {
HUD.flash(.label("库存为0,无法下单"),delay: 1.2)
return
}
idx = index
inputData.removeAll()
inputData.append(cell)
......@@ -366,12 +371,14 @@ class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITab
if barTitle == "修改价格"{
return inputData.count
}
if isSearch {
return seacrchArr.count
}
return datas.count
}
}
......@@ -376,7 +376,8 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect
cell.delegate = self
cell.goodsName.text = rowModel.goods_name
cell.priceLbl.text = "¥" + rowModel.price!
// cell.goodsImgV.kf.setImage(with: URL.init(string:SERVERCE_ImageHost + rowModel.goods_thumb!)!, placeholder: nil, options: nil, progressBlock: nil, completionHandler: nil)
cell.goodsImgV.sd_setImage(with: URL(string: SERVERCE_ImageHost + rowModel.goods_thumb!))
if rowModel.is_show == 1 {
cell.leftBtn.setTitle("下架", for: .normal)
......
......@@ -12,7 +12,9 @@ import Photos
import IQKeyboardManagerSwift
import Dollar
class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndBtnCellDelegate,GLAlertSelectViewDelegate,GoodsClassViewControllerDelegate,PinPaiListViewControllerDelegate,AddImgCellDelegate,AddGuiGeCellDelegate,CreatNewSpecsViewControllerDelegate,ShangPinGguiGeCellDelegate,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,TitleAndSwitchCellDelegate,TitleAndTFCellDelegate,YuShouWeiKuanFaHuoCellDelegate,UITextFieldDelegate,ShowTimeSelectViewDelegate, LMNoteViewControllerDelegate {
@IBOutlet weak var btmBtnViewH: NSLayoutConstraint!
......@@ -79,7 +81,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
var shiFouXJ = false//是否询价
var keyWord = ""//关键字
var wuLiuPrice = ""//物流费用
var countrySelect:Int?//选择国家
var countrySelect:Int? = 0//选择国家
var guiGeArr:Array<GuiGeModel> = []//规格数组,根据规格资料数量控制右上角新增按钮是否显示
var shiFouSH = false //是否审核
var faHuoTime = ""//发货时间
......@@ -452,17 +454,22 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
self.shiFouSH = true
}
//预设预付定金时间段
let begin = dayByDouble(sender: (model.data?.goods_res!.dj_time_start)!) + "-" + dayByDouble(sender: (model.data?.goods_res!.dj_time_end)!)
self.dj_time_start = (model.data?.goods_res!.dj_time_start)
self.dj_time_end = (model.data?.goods_res!.dj_time_end)
self.ysszHolder.insert(begin, at: 1)
self.ysszHolder.remove(at: 2)
// print("abcl === ",model.data?.goods_res!.dj_time_start!)
if model.data?.goods_res!.dj_time_start != 0 {
let begin = dayByDouble(sender: (model.data?.goods_res!.dj_time_start)!) + "-" + dayByDouble(sender: (model.data?.goods_res!.dj_time_end)!)
self.dj_time_start = (model.data?.goods_res!.dj_time_start)
self.dj_time_end = (model.data?.goods_res!.dj_time_end)
self.ysszHolder.insert(begin, at: 1)
self.ysszHolder.remove(at: 2)
}
//预设预付尾款时间段
let end = dayByDouble(sender: (model.data?.goods_res!.wk_time_start)!) + "-" + dayByDouble(sender: (model.data?.goods_res!.wk_time_end)!)
self.wk_time_start = (model.data?.goods_res!.wk_time_start)
self.wk_time_end = (model.data?.goods_res!.wk_time_end)
self.ysszHolder.insert(end, at: 2)
self.ysszHolder.remove(at: 3)
if model.data?.goods_res!.wk_time_start != 0 {
let end = dayByDouble(sender: (model.data?.goods_res!.wk_time_start)!) + "-" + dayByDouble(sender: (model.data?.goods_res!.wk_time_end)!)
self.wk_time_start = (model.data?.goods_res!.wk_time_start)
self.wk_time_end = (model.data?.goods_res!.wk_time_end)
self.ysszHolder.insert(end, at: 2)
self.ysszHolder.remove(at: 3)
}
//发货时间
if model.data?.goods_res?.set_time != nil {
self.faHuoTime = "\(model.data!.goods_res!.set_time!)"
......@@ -632,7 +639,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
let cell = tableView.dequeueReusableCell(withIdentifier: "AddGuiGe") as! AddGuiGeCell
cell.imgBtn.isUserInteractionEnabled = isAllEditing
cell.imgBtn.setImage(UIImage(named: "xinzeng"), for: .normal)
cell.imgBtn.addTarget(self, action: #selector(addGuiGe(sender:)), for: .touchUpInside)
return cell
case 3:
if indexPath.row == 0 {
......@@ -690,17 +697,19 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
}
default:
let cell = tableView.dequeueReusableCell(withIdentifier: "AddGuiGe") as! AddGuiGeCell
cell.delegate = self
cell.imgBtn.isUserInteractionEnabled = isAllEditing
cell.imgBtn.tag = indexPath.row
if goodsDesc.count > 0 {
cell.webView.isHidden = false
let goodsDescHmtl = "<html>" + goodsDesc + "</html>"
cell.webView.loadHTMLString(goodsDescHmtl, baseURL: nil)
}
cell.imgBtn.setImage(UIImage(named: "tjxq"), for: .normal)
cell.btmH.constant = 25
cell.imgBtn.addTarget(self, action: #selector(AddGuiGeCellClick(cell:)), for: .touchUpInside)
return cell
}
}
......@@ -712,6 +721,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
@objc func editHtml(){
print("编辑软文")
let vc = LMNoteViewController()
vc.htmlStr = goodsDesc;
vc.delegatedata = self
self.navigationController?.pushViewController(vc, animated: true)
......@@ -722,6 +732,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
vc.htmlStr = goodsDesc;
vc.delegatedata = self
self.navigationController?.pushViewController(vc, animated: true)
}
//MARK: -- 点击按钮事件,跳转或者展示选择界面
func btnClick(content: String, cell: TitleAndBtnCell) {
......@@ -807,9 +818,11 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
self.view.addSubview(view)
glSelectView = view
}
if cell.nameLbl.text == "预设预付定金时间段" {
print("定金时间段")
let timeSelectV = ShowTimeSelectView(frame: self.view.window!.bounds)
timeSelectV.beginDateByWork = Date()
timeSelectV.titleLbl.text = "预设预付定金时间段"
timeSelectV.delegate = self
self.view.window?.addSubview(timeSelectV)
......@@ -818,9 +831,16 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
}
if cell.nameLbl.text == "预设预付尾款时间段" {
print("预付尾款时")
if dj_time_start == 0 {
HUD.flash(.label("请先选择预付定金时间段"), delay: 1.2)
return
}
let timeSelectV = ShowTimeSelectView(frame: self.view.window!.bounds)
timeSelectV.titleLbl.text = "预设预付尾款时间段"
timeSelectV.delegate = self
let dijitime:TimeInterval = TimeInterval(exactly: (dj_time_start! + (24 * 60 * 60)))!
let beginDate = Date(timeIntervalSince1970: dijitime)
timeSelectV.beginDateByWork = beginDate
self.view.window?.addSubview(timeSelectV)
isWeiTime = true
}
......@@ -1597,8 +1617,8 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
var goodsDesc = ""
func getHTMLByVc(_ model: String!) {
goodsDesc = model
listTbv.reloadData()
listTbv.reloadData()
}
}
......
......@@ -43,7 +43,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
let titleArr = ["商品信息","商品图片","商品规格","预售设置","其它信息","商品详情"]
let spxxArr = ["商品名称","商品类型","商品分类","品牌","起卖数量","是否清真","是否询价"]
var tishixxArr = ["请输入商品名称","请选择商品类型","请选择商品分类","请选择品牌","请输入起卖数量"]
var tishixxArr1 = ["请输入关键字","请输入物流费用","请选择国家","请选择商品状态","请选择运输方式"]
var tishixxArr1 = ["请输入关键字","请输入物流费用","中国","请选择商品状态","请选择运输方式"] //国家默认值
let sptpArr = ["商品封面图(限一张)","商品主图(限五张)"]
let qtxxArr = ["关键字","物流费用","国家","商品状态","运输方式"]
let ysszArr = ["用户付款是否需要审核","预设预付定金时间段","预设预付尾款时间段","预设预付尾款发货时间"]
......@@ -70,7 +70,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
var shiFouXJ = false//是否询价
var keyWord = ""//关键字
var wuLiuPrice = ""//物流费用
var countrySelect:Int?//选择国家
var countrySelect:Int? = 0//选择国家
var guiGeArr:Array<GuiGeModel> = []//规格数组,根据规格资料数量控制右上角新增按钮是否显示
var shiFouSH = false //是否审核
var faHuoTime = ""//发货时间
......@@ -284,6 +284,8 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
listTbv.register(UINib(nibName: "YuShouWeiKuanFaHuoCell", bundle: nil), forCellReuseIdentifier: "YuShouWeiKuanFaHuoCell")
listTbv.register(UINib(nibName: "ShangPinGguiGeCell", bundle: nil), forCellReuseIdentifier: "ShangPinGguiGeCell")
// Do any additional setup after loading the view.
}
//MARK: - cell delegate
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
......@@ -444,8 +446,10 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
cell.imgBtn.tag = indexPath.row
if goodsDesc.count > 0 {
cell.webView.isHidden = false
let goodsDescHmtl = "<html>" + goodsDesc + "</html>"
cell.webView.loadHTMLString(goodsDescHmtl, baseURL: nil)
}
cell.imgBtn.setImage(UIImage(named: "tjxq"), for: .normal)
cell.btmH.constant = 25
......@@ -464,12 +468,14 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
@objc func editHtml(){
print("编辑软文")
let vc = LMNoteViewController()
vc.htmlStr = goodsDesc;
vc.delegatedata = self
self.navigationController?.pushViewController(vc, animated: true)
}
func AddGuiGeCellClick(cell: AddGuiGeCell) {
let vc = LMNoteViewController()
vc.htmlStr = goodsDesc;
vc.delegatedata = self
......@@ -563,6 +569,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
if cell.nameLbl.text == "预设预付定金时间段" {
print("定金时间段")
let timeSelectV = ShowTimeSelectView(frame: self.view.window!.bounds)
timeSelectV.beginDateByWork = Date()
timeSelectV.titleLbl.text = "预设预付定金时间段"
timeSelectV.delegate = self
self.view.window?.addSubview(timeSelectV)
......@@ -571,9 +578,16 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
}
if cell.nameLbl.text == "预设预付尾款时间段" {
print("预付尾款时")
if dj_time_start == 0 {
HUD.flash(.label("请先选择预付定金时间段"), delay: 1.2)
return
}
let timeSelectV = ShowTimeSelectView(frame: self.view.window!.bounds)
timeSelectV.titleLbl.text = "预设预付尾款时间段"
timeSelectV.delegate = self
let dijitime:TimeInterval = TimeInterval(exactly: (dj_time_start! + (24 * 60 * 60)))!
let beginDate = Date(timeIntervalSince1970: dijitime)
timeSelectV.beginDateByWork = beginDate
self.view.window?.addSubview(timeSelectV)
isWeiTime = true
}
......@@ -1063,7 +1077,9 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
case 4:return 49
default:
if goodsDesc.count > 0 {
return 450*glscale
}
return 98
......@@ -1223,6 +1239,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
}
}
//MARK:---商品详情回调的数据
var goodsDesc = ""
func getHTMLByVc(_ model: String!) {
......@@ -1230,5 +1247,6 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
listTbv.reloadData()
}
}
......@@ -20,19 +20,20 @@ class PinPaiListViewController: BaseViewController,UISearchBarDelegate,SearchBar
@IBOutlet weak var sureBtn: UIButton!
@IBOutlet weak var topView: UIView!
@IBOutlet weak var listView: UITableView!
var tempArr:Array<GeneralInfoBrandModel>? = []
var searchV : SearchBarView? = nil
override func viewDidLoad() {
super.viewDidLoad()
if isSelectData {
navbar.title = "请选择品牌"
tableBottom.constant = CGFloat(TabHeight)
}else{
}else{
navbar.title = "品牌列表"
navbar.rightTitle = "新增"
sureBtn.isHidden = true
sureLbl.isHidden = true
}
self.view.addSubview(navbar)
SetTopFrame(view: topView, height: 44)
listView.separatorStyle = .none
......@@ -50,7 +51,7 @@ class PinPaiListViewController: BaseViewController,UISearchBarDelegate,SearchBar
searchBr.cornerRadius = 35/2.0
searchBr.delegate = self
searchBr.delegateL = self
tempArr = dataModelArray
listView.register(UINib(nibName: "TitleAndSelectCell", bundle: nil), forCellReuseIdentifier: "TitleAndSelectCell")
// Do any additional setup after loading the view.
}
......@@ -59,13 +60,29 @@ class PinPaiListViewController: BaseViewController,UISearchBarDelegate,SearchBar
vc.navTitle = "新增品牌"
self.navigationController?.pushViewController(vc, animated: true)
}
func clearSearchAction() {
print("清楚搜索文字")
dataModelArray?.removeAll()
dataModelArray = tempArr
listView.reloadData()
}
func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
print("点击搜索进行--")
searchBar.resignFirstResponder()
searchBar.resignFirstResponder()
if searchBar.text!.count > 0{
dataModelArray?.removeAll()
let str = searchBar.text
for item in tempArr! {
let strName = item.brand_name as! NSString
if strName.contains(str!){
dataModelArray?.append(item)
}
}
}
listView.reloadData()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 49
......@@ -88,7 +105,7 @@ class PinPaiListViewController: BaseViewController,UISearchBarDelegate,SearchBar
cell.selectBtn.isSelected = true
}
}
return cell
}
var selectModel : GeneralInfoBrandModel? = nil
......@@ -102,27 +119,26 @@ class PinPaiListViewController: BaseViewController,UISearchBarDelegate,SearchBar
vc.navTitle = "编辑品牌"
self.navigationController?.pushViewController(vc, animated: true)
}
}
//MARK:--选择品牌确定按钮
@IBAction func sureAction(_ sender: UIButton) {
print("选择品牌确定按钮")
if selectModel == nil {
HUD.flash(.label("请选择品牌"), delay: 1.2)
}else{
self.delegate?.blackSelectPinPaiData(sender: selectModel!)
self.navigationController?.popViewController(animated: true)
}
}
//MARK:--自定义celldelegate
//MARK:--自定义celldelegate
func TitleAndSelectCellClick(content: UIButton, cell: TitleAndSelectCell) {
print(cell.tag)
let rowModel = dataModelArray![cell.tag] as! GeneralInfoBrandModel
selectModel = rowModel
listView.reloadData()
}
}
......@@ -137,56 +137,63 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
@IBAction func saveAction(_ sender: Any) {
print("save")
print("open = ",isJieTiOpen)
// if price.count == 0 {
// HUD.flash(.label("请输入售价"), delay: 1.2)
// return
// }
// if guiGe.count == 0 {
// HUD.flash(.label("请输入规格"), delay: 1.2)
// return
// }
// if weight.count == 0 {
// HUD.flash(.label("请输入重量"), delay: 1.2)
// return
// }
// if wenDu.count == 0 {
// HUD.flash(.label("请选择温藏"), delay: 1.2)
// return
// }
// if danWei.count == 0 {
// HUD.flash(.label("请选择单位"), delay: 1.2)
// return
// }
//
// for item in jieTiArr {
// let str = item as! String
// let arr = str.components(separatedBy: "_")
// for letter in arr {
// if letter.count == 0 {//提示阶梯数据未完整
// HUD.flash(.label("请完整填写数据"), delay: 1.2)
// return
// }
// }
// }
//
// for item in specalArr {
// let str = item as! String
// let arr = str.components(separatedBy: "_")
// for letter in arr {
// if letter.count == 0 {//提示预售阶梯数据未完整
// HUD.flash(.label("请完整填写数据"), delay: 1.2)
// return
// }
// }
// }
//
// let letters = yuShouPrice.components(separatedBy: "_")
// for letter in letters {
// if letter.count == 0 {//提示预售阶梯数据未完整
// HUD.flash(.label("请完整填写数据"), delay: 1.2)
// return
// }
// }
if price.count == 0 {
HUD.flash(.label("请输入售价"), delay: 1.2)
return
}
if guiGe.count == 0 {
HUD.flash(.label("请输入规格"), delay: 1.2)
return
}
if weight.count == 0 {
HUD.flash(.label("请输入重量"), delay: 1.2)
return
}
if wenDu.count == 0 {
HUD.flash(.label("请选择温藏"), delay: 1.2)
return
}
if danWei.count == 0 {
HUD.flash(.label("请选择单位"), delay: 1.2)
return
}
if isYuShouSetting {
if isPurnNumber(str: yuShouPrice) == false{
HUD.flash(.label("请输入正确的预售价格"), delay: 1.2)
return
}
if isPurnNumber(str: ysKuCun) == false {
HUD.flash(.label("请输入正确的库存"), delay: 1.2)
return
}
}
if jieTiArr.count > 0 {
for item in jieTiArr {
let str = item as! String
let arr = str.components(separatedBy: "_")
for letter in arr {
if letter.count == 0 {//提示阶梯数据未完整
HUD.flash(.label("请完整填写阶梯价数据"), delay: 1.2)
return
}
}
}
}
if specalArr.count > 0 {
for item in specalArr {
let str = item as! String
let arr = str.components(separatedBy: "_")
for letter in arr {
if letter.count == 0 {//提示预售阶梯数据未完整
HUD.flash(.label("请完整填写预售阶梯价数据"), delay: 1.2)
return
}
}
}
}
dataModel.price = price
dataModel.guiGe = guiGe
......@@ -203,6 +210,9 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
dataModel.tempSelect = tempSelect
dataModel.isJieTiOpen = isJieTiOpen
dataModel.isOpenYSSetting = isOpenYSSetting
if DJBiLi.count == 0 {
DJBiLi = "0"
}
dataModel.DJBiLi = DJBiLi
dataModel.ysKuCun = ysKuCun
if barTitle?.contains("编辑") == true {
......@@ -275,6 +285,9 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
//keyboardType
cell.textTF.returnKeyType = .done
cell.textTF.delegate = self
if indexPath.row == 0 || indexPath.row == 2{
cell.textTF.keyboardType = .decimalPad
}
let str = NSAttributedString(string: pliceHolderArr[indexPath.row], attributes: [NSAttributedString.Key.foregroundColor:UIColor(named: "灰色字体颜色")])
cell.textTF.attributedPlaceholder = str
if datasArr.count > 0 {
......
......@@ -11,7 +11,7 @@ import UIKit
@objc optional func YuShouCellSwitchStatus(sender:UISwitch)
@objc optional func YuShouCellTFContent(Price:NSString)
}
class YuShouCell: UITableViewCell {
class YuShouCell: UITableViewCell,UITextFieldDelegate {
var delegate:YuShouCellDelegate?
@IBOutlet weak var inputTF3: UITextField!
@IBOutlet weak var inputTF2: UITextField!
......@@ -23,15 +23,34 @@ var delegate:YuShouCellDelegate?
infoSw.transform = CGAffineTransform(scaleX: 0.8, y: 0.8)
infoSw.addTarget(self, action: #selector(switchChange(sender:)), for: .valueChanged)
inputTF3.returnKeyType = .done
inputTF1.returnKeyType = .done
inputTF3.keyboardType = .decimalPad
inputTF1.keyboardType = .decimalPad
inputTF1.delegate = self
inputTF3.delegate = self
inputTF2.keyboardType = .numberPad
inputTF1.addTarget(self, action: #selector(textTfValueChange(sender:)), for: .editingChanged)
inputTF2.addTarget(self, action: #selector(textTfValueChange(sender:)), for: .editingChanged)
inputTF3.addTarget(self, action: #selector(textTfValueChange(sender:)), for: .editingChanged)
// Initialization code
}
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
textField.resignFirstResponder()
}
@objc func textTfValueChange(sender:UITextField){
delegate?.YuShouCellTFContent?(Price: "\(inputTF1.text!)_\(inputTF2.text!)_\(inputTF3.text!)" as NSString)
if sender == inputTF3{
let str = sender.text as! NSString
if str.floatValue > 20{
HUD.flash(.label("预售定金比例不高于20%"), delay: 1.2)
inputTF3.text = "20"
}
}
delegate?.YuShouCellTFContent?(Price:"\(inputTF1.text!)_\(inputTF2.text!)_\(inputTF3.text!)" as NSString)
}
@objc func switchChange(sender:UISwitch){
delegate?.YuShouCellSwitchStatus?(sender: sender)
}
......
......@@ -10,7 +10,7 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="YuShouCell" customModule="GeliBusinessPlatform" customModuleProvider="target">
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="YuShouCell" customModule="TestClass" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="320" height="184.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
......@@ -77,7 +77,7 @@
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" tag="1" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入预售库存" textAlignment="right" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Qb7-aM-usa">
<rect key="frame" x="100" y="89" width="204" height="34"/>
<rect key="frame" x="100" y="89" width="205" height="34"/>
<constraints>
<constraint firstAttribute="height" constant="34" id="JmO-9y-uwH"/>
</constraints>
......@@ -114,10 +114,10 @@
</subviews>
<constraints>
<constraint firstItem="COH-zY-OUo" firstAttribute="leading" secondItem="gDh-Mx-qdQ" secondAttribute="trailing" constant="15" id="2Gu-fB-DY7"/>
<constraint firstAttribute="trailingMargin" secondItem="Qb7-aM-usa" secondAttribute="trailing" id="5OZ-X0-Dvh"/>
<constraint firstItem="65l-Cs-6yM" firstAttribute="top" secondItem="ZyU-aV-HmY" secondAttribute="bottom" constant="16" id="5i4-Xk-Wrs"/>
<constraint firstAttribute="trailing" secondItem="7Ri-WT-Tkw" secondAttribute="trailing" id="8XF-H9-e6S"/>
<constraint firstItem="ZyU-aV-HmY" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="Avr-9G-c2l"/>
<constraint firstAttribute="trailing" secondItem="Qb7-aM-usa" secondAttribute="trailing" constant="15" id="BUC-XP-jMI"/>
<constraint firstAttribute="trailing" secondItem="05q-1N-wvO" secondAttribute="trailing" constant="15" id="BVi-tR-PMA"/>
<constraint firstItem="COH-zY-OUo" firstAttribute="centerY" secondItem="gDh-Mx-qdQ" secondAttribute="centerY" id="Cku-Mu-C62"/>
<constraint firstItem="XRF-Gv-9pf" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="DFI-bQ-jVB"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment