// // KMMemberProductResult.swift // PDF Reader Pro // // Created by wanjun on 2024/11/4. // import Cocoa class KMMemberProductResult: NSObject { var code : Int? var msg : String? var result : String? var result_Bool : Bool? var result_Dict : Bool? var listingProducts : [KMListingProductsModel]? // 上架中的产品 var batchProductPrice : KMBatchProductPriceModel? // 批量阶段购买价格 var checkCoupon : KMCheckCouponModel? // 商品优惠券 var createOrder : KMCreateOrderModel? // 创建订单(买断、订阅) /** @abstract 通用返回字符串 @param code @param msg @param result */ init(code: Int, msg: String, result: String) { self.code = code self.msg = msg self.result = result } /** @abstract 获取上架中的产品 @param code @param msg @param listingProducts */ init(code: Int, msg: String, listingProducts: [KMListingProductsModel]) { self.code = code self.msg = msg self.listingProducts = listingProducts } /** @abstract 批量阶段购买价格 @param code @param msg @param batchProductPrice */ init(code: Int, msg: String, batchProductPrice: KMBatchProductPriceModel) { self.code = code self.msg = msg self.batchProductPrice = batchProductPrice } /** @abstract 商品优惠 @param code @param msg @param checkCoupon */ init(code: Int, msg: String, checkCoupon: KMCheckCouponModel) { self.code = code self.msg = msg self.checkCoupon = checkCoupon } /** @abstract 创建订单(买断、订阅) @param code @param msg @param createOrder */ init(code: Int, msg: String, createOrder: KMCreateOrderModel) { self.code = code self.msg = msg self.createOrder = createOrder } } class KMListingProductsModel: NSObject { var id : String = "" // 【可选】id var productName : String = "" // 【可选】名称 var maxDeviceNum : Int = 0 // 【可选】最大可登录设备数 var levels : String = "" // 【可选】3高级2标准1免费 var platforms : String = "" // 【可选】产品支持平台 var productLineId : Int = 0 // 【可选】所属业务线id (1pdf产品线2compdfkit产品线) var paymentModel : Int = 0 // 【可选】付费模式(1自动续订 2单次付费) var cycle : Int = 0 // 【可选】订阅周期:1、月(30天);2、季(90天);3、半年(183天);4、年(365天) var code : String = "" // 【可选】产品code var priceString : String? // 【可选】美金价格 var cnyPriceString : String? // 【可选】人民币价格 var displayCnyPriceString : String? // 【可选】人民币优惠价格 var displayPriceString : String? // 【可选】教育优惠价格 var upgradePriceString : String? // 【可选】买断升级订阅价格 var cnyUpgradePriceString : String? // 【可选】买断升级订阅价格 var individualPriceString : String? // 每个单价 var individualCnyPriceString : String? // 每个单价 var totalPrice : String = "" // 【可选】批量购买总价 var cnyTotalPrice : String = "" // 【可选】批量购买优惠总价人民币总价 var verifyofferCode : String = "" // 优惠码 init(id: String, productName: String, price: String?, maxDeviceNum: Int, displayPrice: String?, levels: String, platforms: String, productLineId: Int, paymentModel: Int, cycle: Int, cnyPrice: String?, displayCnyPrice: String?, upgradePrice: String?, code: String) { self.id = id self.productName = productName self.priceString = price self.maxDeviceNum = maxDeviceNum self.displayPriceString = displayPrice self.levels = levels self.platforms = platforms self.productLineId = productLineId self.paymentModel = paymentModel self.cycle = cycle self.cnyPriceString = cnyPrice self.displayCnyPriceString = displayCnyPrice self.upgradePriceString = upgradePrice self.code = code self.totalPrice = String(format: "%.2f", Float(price ?? "") ?? 0) self.cnyTotalPrice = String(format: "%.2f", Float(cnyPrice ?? "") ?? 0) } override init() { } } class KMBatchProductPriceModel: NSObject { var productId : String = "" // 【必需】产品id var totalPrice : String = "" // 【必需】总价 var price : String = "" // 【必需】总价 var batchPrice : String = "" // 【必需】批量购买优惠后单价 var cnyPrice : String = "" // 【必需】人民币单价 var cnyBatchPrice : String = "" // 【必需】批量购买优惠后人民币单价 var cnyTotalPrice : String = "" // 【必需】cnyTotalPrice init(productId: String, totalPrice: String, price: String, batchPrice: String, cnyPrice: String, cnyBatchPrice: String, cnyTotalPrice: String) { self.productId = productId self.totalPrice = totalPrice self.price = price self.batchPrice = batchPrice self.cnyPrice = cnyPrice self.cnyBatchPrice = cnyBatchPrice self.cnyTotalPrice = cnyTotalPrice } } class KMCheckCouponModel: NSObject { var id : String = "" // 【必需】id var productName : String = "" // 【必需】名称 var maxDeviceNum : Int = 0 // 【必需】最大可登录设备数 var levels : String = "" // 【必需】3高级2标准1免费 var platforms : String = "" // 【必需】产品支持平台 var productLineId : Int = 0 // 【必需】所属业务线id (1pdf产品线2compdfkit产品线) var paymentModel : Int = 0 // 【必需】付费模式(1自动续订 2单次付费) var cycle : Int = 0 // 【必需】订阅周期:1、月(30天);2、季(90天);3、半年(183天);4、年(365天) var code : String = "" // 【可选】产品code var priceString : String? // 【必需】价格 var cnyPriceString : String? // 【可选】人民币价格 var displayCnyPriceString : String? // 【可选】人民币优惠价格 var displayPriceString : String? // 【可选】教育优惠价格 var upgradePriceString : String? // 【可选】买断升级订阅价格 var verifyofferCode : String = "" // 优惠码 var upgradecnyPriceString:String? init(id: String, productName: String, price: String?, maxDeviceNum: Int, displayPrice: String?, levels: String, platforms: String, productLineId: Int, paymentModel: Int, cycle: Int, cnyPrice: String?, displayCnyPrice: String?, upgradePrice: String?, code: String) { self.id = id self.productName = productName self.priceString = price self.maxDeviceNum = maxDeviceNum self.displayPriceString = displayPrice self.levels = levels self.platforms = platforms self.productLineId = productLineId self.paymentModel = paymentModel self.cycle = cycle self.cnyPriceString = cnyPrice self.displayCnyPriceString = displayCnyPrice self.upgradePriceString = upgradePrice } } /** 创建 买断/订阅 订单数据模型 */ class KMCreateOrderModel: NSObject { var thirdOrderNo : String = "" // 【必需】 var orderId : String = "" // 【必需】 var payHref : String = "" // 【必需】 var qrCode : String = "" // 【必需】 init(thirdOrderNo: String, orderId: String, payHref: String, qrCode: String) { self.thirdOrderNo = thirdOrderNo self.orderId = orderId self.payHref = payHref self.qrCode = qrCode } } /** 获取订单列表 */ class KMOrderListModel: NSObject { var id : String = "" var appId : String = "" var subscriptionId : String = "" var tradeNo : String = "" var thirdOrderNo : String = "" var price : Int = 0 var payment : Int = 0 var status : Int = 0 var createdAt : String = "" var updatedAt : String = "" var result : String = "" var pagePayUrl : String = "" var invoiceNo : String = "" var thirdTradeNo : String = "" var productId : String = "" var discount : String = "" var reducedPrice : String = "" var isVpp : String = "" var type : Int = 0 var detailType : String = "" var userId : String = "" var email : String = "" var payNumber : Int = 0 var isEducation : Int = 0 var subscriptionType : Int = 0 var paymentModel : Int = 0 }