Commit 429a0789 authored by 刘俊宏's avatar 刘俊宏

订单详情,个人中心,支付,商品管理流程完善中

parent d62a8206
......@@ -48,6 +48,6 @@ class GoodsCollectionViewCell: UICollectionViewCell {
}
@IBAction func codeAction(_ sender: UIButton) {
print("点击二维码按钮\(sender.tag)")
HUD.flash(.label("分享功能开发中"),delay: 1.2)
}
}
......@@ -25,7 +25,7 @@ class PersonCenterViewController: BaseViewController,UITableViewDelegate,UITable
let UserToken = UserDefaults.standard.value(forKey: "user_token")
adminInfo(["user_token":UserToken as Any], success: { (data) in
self.dataModel = (data as! AdminInfoModel)
// self.iconImg.kf.setImage(with: URL(string: SERVERCE_ImageHost + (self.dataModel?.data?.shop_img)!))
self.iconImg.sd_setImage(with: URL(string: SERVERCE_ImageHost + (self.dataModel?.data?.shop_img)!))
self.shopNameLbl.text = self.dataModel?.data?.stall_name
self.nameLbl.text = self.dataModel?.data?.admin_name
}) { (error) in
......
......@@ -9,7 +9,7 @@
import UIKit
import IQKeyboardManagerSwift
class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,UITableViewDelegate,DaiKeXiaDanFooterViewDelegate,TitleAndBtnCellDelegate,GLAlertSelectViewDelegate,DZGLViewControllerDelegate,XuanZeShangPinViewControllerDelegate,DaiKeXiaDanGouWuCellDelegate,GuanLianKehuVCDelegate,XiuGaiYuShouJiaViewControllerDelegate,TitleAndTFCellDelegate{
class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,UITableViewDelegate,DaiKeXiaDanFooterViewDelegate,TitleAndBtnCellDelegate,GLAlertSelectViewDelegate,DZGLViewControllerDelegate,XuanZeShangPinViewControllerDelegate,DaiKeXiaDanGouWuCellDelegate,GuanLianKehuVCDelegate,XiuGaiYuShouJiaViewControllerDelegate,TitleAndTFCellDelegate, GeliAlertViewDelegate{
let ddTypeArr = ["普通订单","预售下单"]
let zfTypeArr = ["未付款","欠款","月结","已付款"]
......@@ -89,17 +89,34 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
"goods_info":goods_info as Any,
"order_info":order_info as Any] as [String : Any]
print(order)
// HUD.flash(.progress)
// addOrder(order, success: { (data) in
// let dataM = data as! UpDataModel
// if dataM.code == 1 {
// HUD.flash(.label("提交成功"), delay: 1.2)
// }else{
// HUD.hide()
// }
// }) { (error) in
//
// }
orderData = order
let alertView = GeliAlertView(frame: self.view.window!.bounds)
alertView.delegate = self;
alertView.tishiLbl.text = ""
alertView.titileLbl.text = "是否立即下单?"
alertView.rightBtn.setAttributedTitle(NSAttributedString(string: "确认"), for: .normal)
alertView.rightBtn.tag = 1001
self.view.window?.addSubview(alertView)
}
var orderData:[String:Any]? = nil
func sureGeliAlertViewAction(sender: UIButton) {
if sender.tag == 1001 {
HUD.flash(.progress)
addOrder(orderData!, success: { (data) in
let dataM = data as! UpDataModel
if dataM.code == 1 {
HUD.flash(.label("提交成功"), delay: 1.2)
self.navigationController?.popViewController(animated: true)
}else{
HUD.hide()
}
}) { (error) in
}
}
}
override func viewDidLoad() {
......
......@@ -9,7 +9,7 @@
import UIKit
import ViewAnimator
class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollectionViewDataSource ,UICollectionViewDelegateFlowLayout,HeaderSelectViewDelegate,SelectContentViewDelegate,UISearchBarDelegate, SearchBarViewDelegate, GoodsCollectionViewCellDelegate,ProductDetailViewControllerDelegate{
class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollectionViewDataSource ,UICollectionViewDelegateFlowLayout,HeaderSelectViewDelegate,SelectContentViewDelegate,UISearchBarDelegate, SearchBarViewDelegate, GoodsCollectionViewCellDelegate,ProductDetailViewControllerDelegate, GeliAlertViewDelegate{
var collection : UICollectionView? = nil
var layout = UICollectionViewFlowLayout()
......@@ -430,9 +430,39 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect
self.navigationController?.pushViewController(vc, animated: true)
}
//MARK:-- cell delegate 上下架,入库
func sureGeliAlertViewAction(sender: UIButton) {
if sender.tag == 1001{
let UserToken = UserDefaults.standard.value(forKey: "user_token")
editField(["user_token":UserToken as Any,"function_id":"15","prval":changeGoodsResModel!.goods_id as Any,"value":0,], success: { (data) in
let dataM = data as! UpDataModel
if dataM.code == 1 {
HUD.flash(.label("提交成功"), delay: 1.2)
self.collection?.mj_header?.beginRefreshing()
}
}) { (erro) in
}
}else if sender.tag == 1002 {
let UserToken = UserDefaults.standard.value(forKey: "user_token")
editField(["user_token":UserToken as Any,"function_id":"15","prval":changeGoodsResModel!.goods_id as Any,"value":1,], success: { (data) in
let dataM = data as! UpDataModel
if dataM.code == 1 {
HUD.flash(.label("提交成功"), delay: 1.2)
self.collection?.mj_header?.beginRefreshing()
}
}) { (erro) in
}
}
}
var changeGoodsResModel: GoodsResModel? = nil
func changeGoodsIsShow(isTrue: Bool, byIndex: Int) {
//左按钮为false 右按钮为true
let rowModel = self.items[byIndex]
changeGoodsResModel = rowModel
//添加提示
if rowModel.is_show == 1 {
if isTrue {
......@@ -442,32 +472,27 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect
self.navigationController?.pushViewController(vc, animated: true)
}else{
print("下架啦")
let UserToken = UserDefaults.standard.value(forKey: "user_token")
editField(["user_token":UserToken as Any,"function_id":"15","prval":rowModel.goods_id as Any,"value":0,], success: { (data) in
let dataM = data as! UpDataModel
if dataM.code == 1 {
HUD.flash(.label("提交成功"), delay: 1.2)
self.collection?.mj_header?.beginRefreshing()
}
}) { (erro) in
}
let alertView = GeliAlertView(frame: self.view.window!.bounds)
alertView.delegate = self;
alertView.tishiLbl.text = ""
alertView.titileLbl.text = "是否下架商品?"
alertView.rightBtn.setAttributedTitle(NSAttributedString(string: "确认"), for: .normal)
alertView.rightBtn.tag = 1001
self.view.window?.addSubview(alertView)
}
}else{
if isTrue {
print("赶紧上架")
let UserToken = UserDefaults.standard.value(forKey: "user_token")
editField(["user_token":UserToken as Any,"function_id":"15","prval":rowModel.goods_id as Any,"value":1,], success: { (data) in
let dataM = data as! UpDataModel
if dataM.code == 1 {
HUD.flash(.label("提交成功"), delay: 1.2)
self.collection?.mj_header?.beginRefreshing()
}
}) { (erro) in
}
let alertView = GeliAlertView(frame: self.view.window!.bounds)
alertView.delegate = self;
alertView.tishiLbl.text = ""
alertView.titileLbl.text = "是否上架商品?"
alertView.rightBtn.setAttributedTitle(NSAttributedString(string: "确认"), for: .normal)
alertView.rightBtn.tag = 1002
self.view.window?.addSubview(alertView)
}else{
print("入库哦哦")
let vc = RuKuViewController()
......
......@@ -39,7 +39,7 @@ class ShopInfoViewController: BaseViewController {
//MARK:--需要计算高度,也可以根据行数确定
self.compInfoLbl.text = self.dataModel?.data?.shop_intro
print("简介\(self.compInfoLbl.numberOfLines)")
self.scrollHeight.constant = 950*glscale + CGFloat(self.compInfoLbl.numberOfLines) * 15*glscale
self.scrollHeight.constant = 1031 + CGFloat(self.compInfoLbl.numberOfLines) * 15*glscale
self.stallNameLbl.text = self.dataModel?.data?.stall_name
self.accoutLbl.text = self.dataModel?.data?.contacts_name
self.emailLbl.text = self.dataModel?.data?.shop_email
......
......@@ -9,7 +9,7 @@
import UIKit
import LGButton
class BindViewController: BaseViewController {
class BindViewController: BaseViewController, GeliAlertViewDelegate {
@IBOutlet weak var submitBtn: LGButton!
@IBOutlet weak var accountTF: UITextField!
......@@ -83,6 +83,38 @@ class BindViewController: BaseViewController {
@IBAction func submitBindingAction(_ sender: Any) {
print("确认绑定账号")
if accountTF.text?.count == 0 {
HUD.flash(.label("请填写换绑的格利支付账号"),delay: 1.2)
return
}
if codeTF.text?.count == 0 {
HUD.flash(.label("请填写验证码"),delay: 1.2)
return
}
let alertView = GeliAlertView(frame: self.view.window!.bounds)
alertView.delegate = self;
alertView.tishiLbl.text = ""
alertView.titileLbl.text = "确定更绑格利支付账号?"
alertView.rightBtn.setAttributedTitle(NSAttributedString(string: "确认"), for: .normal)
alertView.rightBtn.tag = 1001
self.view.window?.addSubview(alertView)
}
func sureGeliAlertViewAction(sender: UIButton) {
if sender.tag == 1001 {
HUD.flash(.progress)
let UserToken = UserDefaults.standard.value(forKey: "user_token")
bindGeliPay(["user_token":UserToken as Any,"geli_pay_user":accountTF.text as Any], success: { (data) in
let dataM = data as! UpDataModel
if dataM.code == 1{
HUD.flash(.label("修改成功"),delay: 1.2)
self.navigationController?.popToRootViewController(animated: true)
}else{
HUD.hide()
}
}) { (error) in
}
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_5" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="BindViewController" customModule="GeliBusinessPlatform" customModuleProvider="target">
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="BindViewController" customModule="TestClass" customModuleProvider="target">
<connections>
<outlet property="accountTF" destination="ffm-Wf-cTs" id="OqY-l4-wn0"/>
<outlet property="codeBtn" destination="CmK-Hc-fnD" id="Vvl-l9-psO"/>
......@@ -104,7 +104,7 @@
</connections>
</button>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入验证码" textAlignment="right" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="3oP-hI-HAZ">
<rect key="frame" x="224.33333333333334" y="16.333333333333343" width="79.666666666666657" height="17.333333333333329"/>
<rect key="frame" x="244.33333333333334" y="16.333333333333343" width="79.666666666666657" height="17.333333333333329"/>
<color key="textColor" name="标题字颜色"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<textInputTraits key="textInputTraits"/>
......@@ -113,7 +113,7 @@
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="SjA-bd-foE" firstAttribute="leading" secondItem="bCp-kS-a0t" secondAttribute="leading" constant="15" id="8cF-XK-Uuh"/>
<constraint firstAttribute="trailing" secondItem="3oP-hI-HAZ" secondAttribute="trailing" constant="110" id="Fsg-8Y-iXz"/>
<constraint firstAttribute="trailing" secondItem="3oP-hI-HAZ" secondAttribute="trailing" constant="90" id="Fsg-8Y-iXz"/>
<constraint firstItem="SjA-bd-foE" firstAttribute="centerY" secondItem="bCp-kS-a0t" secondAttribute="centerY" id="bYi-7O-cb0"/>
<constraint firstItem="3oP-hI-HAZ" firstAttribute="centerY" secondItem="bCp-kS-a0t" secondAttribute="centerY" id="dR0-TZ-WdO"/>
<constraint firstAttribute="height" constant="50" id="hua-5S-NOW"/>
......
......@@ -46,6 +46,7 @@ class ShowAlGoodsViewController: BaseViewController , UITableViewDelegate, UITa
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "XuanZeShangPinCell") as! XuanZeShangPinCell
cell.selectBtn.isHidden = true
cell.priceLbl.isHidden = false
let rowModel = order_goods![indexPath.row]
cell.nameLbl.text = rowModel.goods_name
cell.detailLbl.text = rowModel.goods_attr
......
......@@ -21,14 +21,17 @@ class AccountViewController: BaseViewController{
super.viewDidLoad()
navbar.title = "账号信息"
self.view.addSubview(navbar)
print(dataModel)
// Do any additional setup after loading the view.
firstView?.snp.makeConstraints({ (make) in
make.top.equalTo(NavCGRect.height)
make.left.right.equalTo(0)
make.height.equalTo(50)
})
nameLbl.text = dataModel?.data?.admin_name
if dataModel?.data?.admin_name?.count == 0 {
nameLbl.text = "-"
}else{
nameLbl.text = dataModel?.data?.admin_name
}
accountLbl.text = dataModel?.data?.user_name
phoneLbl.text = dataModel?.data?.phone
}
......
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