You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

154 lines
2.7 KiB

1 month ago
  1. import upload from '@/utils/upload'
  2. import request from '@/utils/request'
  3. // 用户密码重置
  4. export function updateUserPwd(oldPassword, newPassword) {
  5. const data = {
  6. oldPassword,
  7. newPassword
  8. }
  9. return request({
  10. url: '/system/user/profile/updatePwd',
  11. method: 'put',
  12. params: data
  13. })
  14. }
  15. // 查询用户个人信息
  16. export function getUserProfile() {
  17. return request({
  18. url: '/system/user/profile',
  19. method: 'get'
  20. })
  21. }
  22. // 修改用户个人信息
  23. export function updateUserProfile(data) {
  24. return request({
  25. url: '/system/user/profile',
  26. method: 'put',
  27. data: data
  28. })
  29. }
  30. // 用户头像上传
  31. export function uploadAvatar(data) {
  32. return upload({
  33. url: '/system/user/profile/avatar',
  34. name: data.name,
  35. filePath: data.filePath
  36. })
  37. }
  38. // 人员列表
  39. export function getStaffList(){
  40. return request({
  41. url: '/h5/staff/list',
  42. method: 'get'
  43. })
  44. }
  45. // 产品列表
  46. export function getProductList(data){
  47. return request({
  48. url: '/no-auth/product/list',
  49. method: 'post',
  50. data:data
  51. })
  52. }
  53. // 产品详情
  54. export function getProductDetails(data){
  55. return request({
  56. url: `/no-auth/product/detail/${data}`,
  57. method: 'get',
  58. })
  59. }
  60. // 字典
  61. export function getDictList(type){
  62. return request({
  63. url: `/h5/system/dict/data/type/${type}`,
  64. method: 'get'
  65. })
  66. }
  67. //获取openId
  68. export function getOpenId(code){
  69. return request({
  70. url: `/no-auth/wechat/getOpenId?code=${code}`,
  71. method: 'get'
  72. })
  73. }
  74. // 创建订单
  75. export function createOrder(data){
  76. return request({
  77. url: `/no-auth/appointment/add`,
  78. method: 'post',
  79. data:data
  80. })
  81. }
  82. // 创建订单新
  83. export function createOrderNew(data){
  84. return request({
  85. url: `/h5/appointment/add`,
  86. method: 'post',
  87. headers:{ "isToken":true},
  88. data:data
  89. })
  90. }
  91. export function getOrderList(data){
  92. return request({
  93. url: `/h5/order/listByOpenid?status=${data.status}&openid=${data.openId}&page=${data.page}&size=${data.size}`,
  94. method: 'get'
  95. })
  96. }
  97. export function getBannerList(){
  98. return request({
  99. url: `/h5/system/dict/data/type/sys_banner`,
  100. method: 'get'
  101. })
  102. }
  103. export function getCity(){
  104. return request({
  105. url: `/h5/system/config/order.city.list`,
  106. method: 'get'
  107. })
  108. }
  109. export function getCouponList(){
  110. return request({
  111. url: `/h5/coupon/list`,
  112. headers:{ "isToken":true},
  113. method: 'get'
  114. })
  115. }
  116. export function receiveCoupon(data){
  117. return request({
  118. url: `/h5/coupon/get`,
  119. headers:{ "isToken":true},
  120. method: 'post',
  121. data
  122. })
  123. }
  124. export function getCouponListNoAuth(){
  125. return request({
  126. url: `/no-auth/h5/coupon/list`,
  127. method: 'get'
  128. })
  129. }
  130. //获取手机号
  131. export function getPhoneNumber(data){
  132. return request({
  133. url: `/no-auth/wechat/getPhoneNumber`,
  134. method: 'post',
  135. data
  136. })
  137. }