gql.js 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. const productbyprops = `
  2. query productbyprops($category: String, $updatedAt: String, $name: String, $createdAt: String, $status: String, $intro: String, $price: Float, $img: String, $stock: Int) {
  3. productbyprops: product_by_props(category: $category updatedAt: $updatedAt name: $name createdAt: $createdAt status: $status intro: $intro price: $price img: $img stock: $stock) {
  4. category
  5. updatedAt
  6. unit
  7. name
  8. createdAt
  9. status
  10. id
  11. intro
  12. price
  13. img
  14. stock
  15. }
  16. }
  17. `
  18. const productbyid = `
  19. query productbyid($id: ID) {
  20. productbyid: product_by_id(id: $id) {
  21. category
  22. updatedAt
  23. unit
  24. name
  25. createdAt
  26. status
  27. id
  28. intro
  29. price
  30. img
  31. stock
  32. }
  33. }
  34. `
  35. const cart_by_userid = `
  36. query findUserCart($user_id:ID){
  37. cartList:userCart_by_props(user_id:$user_id){
  38. count
  39. createdAt
  40. id
  41. product_id{
  42. id
  43. category
  44. img
  45. intro
  46. name
  47. price
  48. status
  49. stock
  50. unit
  51. }
  52. specificationStock_id{
  53. id
  54. color
  55. size
  56. stock
  57. status
  58. }
  59. }
  60. }
  61. `
  62. const delete_userCart_by_id = `
  63. mutation delete_userCart($id: [String]) {
  64. delete_userCart(where: {
  65. id: {
  66. _in: $id
  67. }
  68. })
  69. }
  70. `
  71. const userAddressbyprops = `
  72. query userAddressbyprops($user_id: ID) {
  73. userAddressbyprops: userAddress_by_props(user_id: $user_id) {
  74. address
  75. updatedAt
  76. telephone
  77. default
  78. city
  79. username
  80. postcode
  81. createdAt
  82. deletedAt
  83. id
  84. user_id {
  85. email
  86. telephone
  87. username
  88. openid
  89. id
  90. }
  91. area
  92. province
  93. }
  94. }
  95. `
  96. const user_default_address = `
  97. query user_default_address($user_id: ID, $default: Int) {
  98. defaultAddress: userAddress_by_props(user_id: $user_id default: $default) {
  99. id
  100. default
  101. username
  102. telephone
  103. province
  104. area
  105. city
  106. address
  107. user_id {
  108. openid
  109. id
  110. }
  111. }
  112. }
  113. `
  114. const orderbyprops = `
  115. query orderbyprops($deliveryTime: String, $updatedAt: String, $orderLogistics_id: ID, $payTime: String, $orderTotalPay: Float, $createdAt: String, $orderStatus: String, $userAddress_id: ID, $orderShipFee: Float, $count: Int, $user_id: ID, $productTotalPay: Float, $orderPay_id: ID) {
  116. orderbyprops: order_by_props(deliveryTime: $deliveryTime updatedAt: $updatedAt orderLogistics_id: $orderLogistics_id payTime: $payTime orderTotalPay: $orderTotalPay createdAt: $createdAt orderStatus: $orderStatus userAddress_id: $userAddress_id orderShipFee: $orderShipFee count: $count user_id: $user_id productTotalPay: $productTotalPay orderPay_id: $orderPay_id) {
  117. deliveryTime
  118. updatedAt
  119. orderLogistics_id {
  120. updatedAt
  121. logisticsFee
  122. expressId
  123. createdAt
  124. consigneeTel
  125. id
  126. consignAddress
  127. LogisticsStatus
  128. consigneeName
  129. }
  130. payTime
  131. orderTotalPay
  132. createdAt
  133. orderStatus
  134. userAddress_id {
  135. address
  136. updatedAt
  137. telephone
  138. default
  139. city
  140. username
  141. postcode
  142. createdAt
  143. deletedAt
  144. id
  145. area
  146. province
  147. }
  148. id
  149. orderShipFee
  150. count
  151. productTotalPay
  152. orderPay_id {
  153. id
  154. totalPay
  155. transactionId
  156. payTime
  157. }
  158. }
  159. }
  160. `
  161. const orderProduct_by_props = `
  162. query orderProductbyprops($order_id: ID) {
  163. orderProductbyprops: orderProduct_by_props(order_id: $order_id) {
  164. updatedAt
  165. productColor
  166. unit
  167. product_id {
  168. category
  169. updatedAt
  170. unit
  171. name
  172. createdAt
  173. status
  174. id
  175. intro
  176. price
  177. img
  178. stock
  179. }
  180. productSize
  181. orderPay
  182. createdAt
  183. productImg
  184. productName
  185. productPrice
  186. id
  187. count
  188. productPay
  189. }
  190. }
  191. `
  192. const create_order = `
  193. mutation createorder($deliveryTime: String, $remark: String, $updatedAt: String, $orderLogistics_id: ID, $payTime: String, $orderTotalPay: Float, $createdAt: String, $orderStatus: String, $userAddress_id: ID, $id: ID!, $orderShipFee: Float, $count: Int, $user_id: ID, $productTotalPay: Float, $orderPay_id: ID,
  194. $deleteId: [String]) {
  195. createorder: create_order(deliveryTime: $deliveryTime remark: $remark updatedAt: $updatedAt orderLogistics_id: $orderLogistics_id payTime: $payTime orderTotalPay: $orderTotalPay createdAt: $createdAt orderStatus: $orderStatus userAddress_id: $userAddress_id id: $id orderShipFee: $orderShipFee count: $count user_id: $user_id productTotalPay: $productTotalPay orderPay_id: $orderPay_id) {
  196. result
  197. order {
  198. deliveryTime
  199. remark
  200. updatedAt
  201. orderLogistics_id {
  202. updatedAt
  203. logisticsFee
  204. expressId
  205. createdAt
  206. consigneeTel
  207. id
  208. consignAddress
  209. LogisticsStatus
  210. consigneeName
  211. }
  212. payTime
  213. orderTotalPay
  214. createdAt
  215. orderStatus
  216. userAddress_id {
  217. address
  218. updatedAt
  219. telephone
  220. default
  221. city
  222. username
  223. postcode
  224. createdAt
  225. deletedAt
  226. id
  227. area
  228. province
  229. }
  230. id
  231. orderShipFee
  232. count
  233. productTotalPay
  234. orderPay_id {
  235. id
  236. totalPay
  237. transactionId
  238. payTime
  239. }
  240. }
  241. }
  242. delete_userCart(where: {
  243. id: {
  244. _in: $deleteId
  245. }
  246. })
  247. }
  248. `
  249. const create_order_product = `
  250. mutation createorderProduct($updatedAt: String, $productColor: String, $unit: String, $product_id: ID, $productSize: String, $orderPay: Float, $createdAt: String, $productImg: String, $productName: String, $specificationStock_id: ID, $order_id: ID, $productPrice: Float, $id: ID!, $count: Int, $productPay: Float, $user_id: ID, $orderPay_id: ID) {
  251. createorderProduct: create_orderProduct(updatedAt: $updatedAt productColor: $productColor unit: $unit product_id: $product_id productSize: $productSize orderPay: $orderPay createdAt: $createdAt productImg: $productImg productName: $productName specificationStock_id: $specificationStock_id order_id: $order_id productPrice: $productPrice id: $id count: $count productPay: $productPay user_id: $user_id orderPay_id: $orderPay_id) {
  252. result
  253. orderProduct {
  254. updatedAt
  255. productColor
  256. unit
  257. productSize
  258. orderPay
  259. createdAt
  260. productImg
  261. productName
  262. productPrice
  263. id
  264. count
  265. productPay
  266. }
  267. }
  268. }
  269. `
  270. export {
  271. productbyprops,
  272. productbyid,
  273. cart_by_userid,
  274. delete_userCart_by_id,
  275. userAddressbyprops,
  276. user_default_address,
  277. orderbyprops,
  278. orderProduct_by_props,
  279. create_order,
  280. create_order_product
  281. }