猫妈狗爸伴宠师小程序前端代码
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.

138 lines
2.4 KiB

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