ShopCarModel.swift 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. //
  2. // ShopCarModel.swift
  3. // ADHTuanCan
  4. //
  5. // Created by 敖德亨 on 2023/10/30.
  6. //
  7. import UIKit
  8. class ShopCarModel: MCBaseRequestModel {
  9. }
  10. class GetShoppingCarMsgResultMeal: MCBaseRequestModel {
  11. /// 购物车id
  12. var shopcartId : NSNumber?
  13. /// 购物时间id
  14. var shopcartTimeId : NSNumber?
  15. override func requestMethod() -> MCHttpMethod {
  16. .post
  17. }
  18. override func requestUrl() -> String {
  19. "/app/shopcart/getShopcartMsg"
  20. }
  21. }
  22. /// 购物车详情
  23. class ShopMealMsgModel : MCBaseModel{
  24. /// 菜品信息
  25. var shopMealMsgVos : [ShopMealMsgDetailModel]?
  26. /// 供餐类型名称
  27. var supplyType : String?
  28. }
  29. /// shopMealMsgVos
  30. class ShopMealMsgDetailModel : MCBaseModel{
  31. /// 活动id
  32. var activityId : String?
  33. /// 单品/套餐,备注
  34. var comment : String?
  35. /// 送达时间-结束
  36. var deliveryEnd : String?
  37. /// 送达时间-开始
  38. var deliveryStart : String?
  39. /// 折扣id
  40. var discountId : String?
  41. /// 非固定套餐-选品明细
  42. var fixedFoods : String?
  43. /// 是否固定套餐,1是,0不是
  44. var isFixed : String?
  45. /// 单品/套餐,1单品,2套餐
  46. var isMeal : String?
  47. /// 套餐内菜品信息
  48. var mealFoodMsgs : [MealFoodMsgModel]?
  49. /// 菜品/套餐id
  50. var shopMealId : NSNumber?
  51. /// 菜品/套餐id
  52. var mealId : NSNumber?
  53. /// 单品/套餐,1单品,2套餐
  54. var mealType : String?
  55. /// 就餐人数
  56. var numPeople : String?
  57. /// 最低就餐人数
  58. var lowestNum : String?
  59. /// 原价
  60. var originalPrice : String?
  61. /// 售价
  62. var price : String?
  63. /// 时间id
  64. var shopcartId : NSNumber?
  65. /// 供餐类型名称
  66. var supplyType : String?
  67. /// 图片
  68. var link : String?
  69. ///
  70. var name : String?
  71. ///
  72. var isFistLine = false
  73. }
  74. //MARK: 获取购物车价格
  75. class GetShoppingCarPriceRequestModel: MCBaseRequestModel {
  76. /// 购物车id
  77. var id : NSNumber?
  78. override func requestMethod() -> MCHttpMethod {
  79. .post
  80. }
  81. override func requestUrl() -> String {
  82. "/app/order/calculatePrice"
  83. }
  84. }
  85. /// 购物车详情
  86. class ShopCarPriceDetailModel : MCBaseModel{
  87. /// 优惠金额,优惠了多少金额
  88. var discountAmount : String?
  89. /// 购物车id
  90. var shopcartId : NSNumber?
  91. /// 售价
  92. var price : String?
  93. ///
  94. var mealPriceMsgs : [SaleDetailModel]?
  95. /// 原价
  96. var originalPrice : String?
  97. }
  98. /// 购物车优惠信息
  99. class SaleDetailModel : MCBaseModel{
  100. /// 1优惠 2折扣 3活动
  101. var showType : String?
  102. /// 优惠内容
  103. var name : String?
  104. /// "打折/送/减 多少"
  105. var showAmount : String?
  106. }
  107. //MARK: 获取购物车价格
  108. class EditorShoppingCarRequestModel: MCBaseRequestModel {
  109. /// 从购物车删除此菜品,未做修改则不传值
  110. var del : String?
  111. /// 送餐时间ID
  112. var deliveryId : NSNumber?
  113. /// 购物车id
  114. var shopcartId : NSNumber?
  115. /// 就餐人数,未做修改则不传值
  116. var numPeople : String?
  117. /// 时间id
  118. var shopcartTimeId : NSNumber?
  119. /// 菜品/套餐id
  120. var shopMealId : NSNumber?
  121. /// 单品/套餐,1单品,2套餐
  122. var mealType : String?
  123. override func requestMethod() -> MCHttpMethod {
  124. .post
  125. }
  126. override func requestUrl() -> String {
  127. "/app/shopcart/update"
  128. }
  129. }
  130. //MARK: 获取默认地址
  131. class CleanShopcarModel: MCBaseRequestModel {
  132. /// 购物车id
  133. var id : NSNumber?
  134. override func requestMethod() -> MCHttpMethod {
  135. .post
  136. }
  137. override func requestUrl() -> String {
  138. "/app/shopcart/emptyShopcart"
  139. }
  140. }
  141. //MARK: 获取默认地址
  142. class GetDefAddressRequestModel: MCBaseRequestModel {
  143. /// 购物车id
  144. var shopcartId : NSNumber?
  145. override func requestMethod() -> MCHttpMethod {
  146. .get
  147. }
  148. override func requestUrl() -> String {
  149. "/app/usermsg/getDefAddress"
  150. }
  151. }
  152. //MARK: 通过购物车购买
  153. class AddOrderModel: MCBaseRequestModel {
  154. /// 购物车id
  155. var shopcartId : NSNumber?
  156. /// 地址id
  157. var addressId : NSNumber?
  158. /// comment
  159. var 订单备注 : NSNumber?
  160. /// 支付方式
  161. var payTypeId : NSNumber?
  162. /// 结算方式
  163. var settleId : NSNumber?
  164. ///
  165. var userType : String?
  166. override func requestMethod() -> MCHttpMethod {
  167. .post
  168. }
  169. override func requestUrl() -> String {
  170. "/app/order/saveByShopcart"
  171. }
  172. }
  173. /// 获取订单ID
  174. class OrderIDmModel : MCBaseModel{
  175. /// 优惠金额,优惠了多少金额
  176. var orderId : NSNumber?
  177. /// 订单编号
  178. var orderNo : String?
  179. /// 需不需要拉起支付,1需要,0不需要
  180. var pullUp : String?
  181. }
  182. //MARK: 根据支付方式获取价格
  183. class GetPriceWithTypeModel: MCBaseRequestModel {
  184. /// 购物车id
  185. var shopcartId : NSNumber?
  186. var settleId : NSNumber?
  187. override func requestMethod() -> MCHttpMethod {
  188. .post
  189. }
  190. override func requestUrl() -> String {
  191. "/app/order/getSettlePrice"
  192. }
  193. }
  194. /// 支付方式价格
  195. class PriceWithTypeModel : MCBaseModel{
  196. ///
  197. var price : String?
  198. }
  199. //MARK: 获取支付配置信息
  200. class GetPayConfiguration: MCBaseRequestModel {
  201. ///
  202. var orderId : NSNumber?
  203. override func requestMethod() -> MCHttpMethod {
  204. .post
  205. }
  206. override func requestUrl() -> String {
  207. "/stripePay/create"
  208. }
  209. }
  210. /// 支付配置信息
  211. class PayConfigurationModel : MCBaseModel{
  212. ///
  213. var clientSecret : String?
  214. /// 商户名
  215. var merchantDisplayName : String?
  216. ///用户ID
  217. var customerId : String?
  218. /// Ephemeral Key 密钥
  219. var ephemeralKey : String?
  220. var publicKey : String?
  221. }
  222. //MARK: 获取结算方式/app/order/getSettleType
  223. class GetPaySettleTypeModel: MCBaseRequestModel {
  224. ///输入订单或购物车类型,类型,1普团,2白团
  225. var type : String?
  226. override func requestMethod() -> MCHttpMethod {
  227. .get
  228. }
  229. override func requestUrl() -> String {
  230. "/app/order/getSettleType"
  231. }
  232. }
  233. /// 结算方式Model
  234. class PaySettleTypeModel : MCBaseModel{
  235. /// id
  236. var id : NSNumber?
  237. var name : String?
  238. var isSelect = false
  239. }
  240. //MARK: 获取支付方式
  241. class GetPayPaymentTypeModel: MCBaseRequestModel {
  242. ///输入订单或购物车类型,类型,1普团,2白团
  243. var type : String?
  244. ///订单id,由订单列表拉起支付必传
  245. var orderId : NSNumber?
  246. ///获取支付方式来源,1由购物车发起购买,2由订单列表拉起支付,3用户充值
  247. var source : String?
  248. override func requestMethod() -> MCHttpMethod {
  249. .post
  250. }
  251. override func requestUrl() -> String {
  252. "/app/order/getPaymentType"
  253. }
  254. }
  255. /// 支付方式Model
  256. class PayMentTypeModel : MCBaseModel{
  257. /// id
  258. var id : NSNumber?
  259. var name : String?
  260. var isSelect = false
  261. }
  262. //MARK: 获取从订单列表或订单详情拉起支付或密码支付
  263. class GetIsStripePayModel: MCBaseRequestModel {
  264. /// 订单ID
  265. var orderId : NSNumber?
  266. /// 支付方式ID
  267. var payTypeId : NSNumber?
  268. override func requestMethod() -> MCHttpMethod {
  269. .post
  270. }
  271. override func requestUrl() -> String {
  272. "/app/order/pullOrderPay"
  273. }
  274. }
  275. class IsStripePayModel : MCBaseModel{
  276. /// 订单ID
  277. var orderId : NSNumber?
  278. /// 需不需要拉起第三方支付,1需要,0不需要
  279. var pullUp : String?
  280. }
  281. //MARK: 密码支付
  282. class PSWPayRequestModel: MCBaseRequestModel {
  283. /// 订单ID
  284. var orderId : NSNumber?
  285. /// PSW
  286. var payPassword : String?
  287. override func requestMethod() -> MCHttpMethod {
  288. .post
  289. }
  290. override func requestUrl() -> String {
  291. "/app/order/passwordPayment"
  292. }
  293. }
  294. /// 支付成功显示Model
  295. class PaySuccessModel : MCBaseModel{
  296. /// 金额
  297. var money : String?
  298. /// 订单编号
  299. var orderNum : String?
  300. /// 支付方式
  301. var payTypeName : String?
  302. /// 支付时间
  303. var time : String?
  304. }