member.ts 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. import request from '@/utils/request'
  2. export function getMemberInfo() {
  3. return request.get('customer/miniEnterprise/info')
  4. }
  5. /**
  6. * 获取积分流水
  7. */
  8. export function getPointList(data: AnyObject) {
  9. return request.get('member/account/point', data)
  10. }
  11. /**
  12. * 获取积分来源用途
  13. */
  14. export function getPointType(account_type: string) {
  15. return request.get(`member/account/fromtype/${ account_type }`)
  16. }
  17. /**
  18. * 获取不可提现余额流水
  19. */
  20. export function getBalanceList(data: AnyObject) {
  21. return request.get('member/account/balance', data)
  22. }
  23. /**
  24. * 获取余额流水,条件获取
  25. */
  26. export function getBalanceListAll(data: AnyObject) {
  27. return request.get('member/account/balance_list', data)
  28. }
  29. /**
  30. * 获取可提现余额流水
  31. */
  32. export function getMoneyList(data: AnyObject) {
  33. return request.get('member/account/money', data)
  34. }
  35. /**
  36. * 会员信息修改
  37. */
  38. export function modifyMember(data: AnyObject) {
  39. return request.put(`member/modify/${ data.field }`, data, { showErrorMessage: true })
  40. }
  41. /**
  42. * 登录会员绑定手机号
  43. */
  44. export function bindMobile(data: AnyObject) {
  45. if (uni.getStorageSync('pid')) {
  46. data.pid = uni.getStorageSync('pid');
  47. }
  48. return request.put('member/mobile', data, { showErrorMessage: true })
  49. }
  50. /**
  51. * 获取手机号
  52. */
  53. export function getMobile(data: AnyObject) {
  54. if (uni.getStorageSync('pid')) {
  55. data.pid = uni.getStorageSync('pid');
  56. }
  57. return request.put('member/getmobile', data, { showErrorMessage: true })
  58. }
  59. /**
  60. * 提现转账方式
  61. */
  62. export function cashOutTransferType() {
  63. return request.get('member/cash_out/transfertype')
  64. }
  65. /**
  66. * 提现配置
  67. */
  68. export function cashOutConfig() {
  69. return request.get('member/cash_out/config')
  70. }
  71. /**
  72. * 申请余额提现
  73. */
  74. export function cashOutApply(data: AnyObject) {
  75. return request.post('member/cash_out/apply', data, { showSuccessMessage: false, showErrorMessage: true })
  76. }
  77. /**
  78. * 获取提现账户信息
  79. */
  80. export function getCashoutAccountInfo(data: AnyObject) {
  81. return request.get(`member/cashout_account/${ data.account_id }`, {})
  82. }
  83. /**
  84. * 获取首条提现账户信息
  85. */
  86. export function getFirstCashOutAccountInfo(data: AnyObject) {
  87. return request.get('member/cashout_account/firstinfo', data)
  88. }
  89. /**
  90. * 获取提现账户列表
  91. */
  92. export function getCashOutAccountList(data: AnyObject) {
  93. return request.get(`member/cashout_account`, data)
  94. }
  95. /**
  96. * 获取提现记录列表
  97. */
  98. export function getCashOutList(data: AnyObject) {
  99. return request.get(`member/cash_out`, data)
  100. }
  101. /**
  102. * 获取提现记录详情
  103. */
  104. export function getCashOutDetail(id: number) {
  105. return request.get(`member/cash_out/${ id }`)
  106. }
  107. /**
  108. * 获取提现转账
  109. */
  110. export function getCashOutTransfer(data: AnyObject) {
  111. return request.post(`member/cash_out/transfer/${ data.id }`, data)
  112. }
  113. /**
  114. * 添加提现账户
  115. */
  116. export function addCashoutAccount(data: AnyObject) {
  117. return request.post('member/cashout_account', data, { showSuccessMessage: true, showErrorMessage: true })
  118. }
  119. /**
  120. * 添加提现账户
  121. */
  122. export function editCashoutAccount(data: AnyObject) {
  123. return request.put(`member/cashout_account/${ data.account_id }`, data, {
  124. showSuccessMessage: true,
  125. showErrorMessage: true
  126. })
  127. }
  128. /**
  129. * 删除提现账户
  130. */
  131. export function deleteCashoutAccount(accountId: number) {
  132. return request.delete(`member/cashout_account/${ accountId }`, { showSuccessMessage: true, showErrorMessage: true })
  133. }
  134. /**
  135. * 会员取消提现
  136. * @param params
  137. */
  138. export function memberCancel(params: Record<string, any>) {
  139. return request.put(`member/cash_out/cancel/${params.id}`, params, { showSuccessMessage: true,showErrorMessage: true })
  140. }
  141. /**
  142. * 佣金账户流水
  143. */
  144. export function getMemberCommission(data: AnyObject) {
  145. return request.get(`member/account/commission`, data)
  146. }
  147. /**
  148. * 佣金列表
  149. */
  150. export function getCommissionList(data: AnyObject) {
  151. return request.get(`member/account/commission`, data)
  152. }
  153. /**
  154. * 获取账号变动类型
  155. */
  156. export function getAccountType(params: Record<string, any>) {
  157. return request.get(`member/account/fromtype/${ params.account_type }`)
  158. }
  159. /**
  160. * 获取会员收货地址列表
  161. * @param params
  162. * @returns
  163. */
  164. export function getAddressList(params: Record<string, any>) {
  165. return request.get(`member/address`, params)
  166. }
  167. /**
  168. * 获取会员收货地址详情
  169. * @param id 会员收货地址id
  170. * @returns
  171. */
  172. export function getAddressInfo(id: number) {
  173. return request.get(`member/address/${ id }`);
  174. }
  175. /**
  176. * 添加会员收货地址
  177. * @param params
  178. * @returns
  179. */
  180. export function addAddress(params: Record<string, any>) {
  181. return request.post('member/address', params, { showErrorMessage: true, showSuccessMessage: true })
  182. }
  183. /**
  184. * 编辑会员收货地址
  185. * @param params
  186. * @returns
  187. */
  188. export function editAddress(params: Record<string, any>) {
  189. return request.put(`member/address/${ params.id }`, params, { showErrorMessage: true, showSuccessMessage: true })
  190. }
  191. /**
  192. * 删除会员收货地址
  193. * @param id
  194. * @returns
  195. */
  196. export function deleteAddress(id: number) {
  197. return request.delete(`member/address/${ id }`, { showErrorMessage: true, showSuccessMessage: true })
  198. }
  199. /**
  200. * 获取会员等级
  201. */
  202. export function getMemberLevel() {
  203. return request.get(`member/level`);
  204. }
  205. /**
  206. * 获取成长值任务
  207. */
  208. export function getTaskGrowth() {
  209. return request.get(`task/growth`);
  210. }
  211. /**
  212. * 获取签到日期
  213. */
  214. export function getSignInfo(data: AnyObject) {
  215. return request.get(`member/sign/info/${ data.year }/${ data.month }`, {})
  216. }
  217. /**
  218. * 获取日签到奖励
  219. */
  220. export function getDayPack(data: AnyObject) {
  221. return request.get(`member/sign/award/${ data.year }/${ data.month }/${ data.day }`)
  222. }
  223. /**
  224. * 获取签到设置
  225. */
  226. export function getSignConfig() {
  227. return request.get(`member/sign/config`)
  228. }
  229. /**
  230. * 点击签到
  231. * @returns
  232. */
  233. export function setSign() {
  234. return request.post('member/sign')
  235. }
  236. /**
  237. * 获取个人积分
  238. */
  239. export function getMemberAccountPointcount() {
  240. return request.get(`member/account/pointcount`)
  241. }
  242. /**
  243. * 获取积分任务
  244. */
  245. export function getTaskPoint() {
  246. return request.get(`task/point`)
  247. }
  248. /**
  249. * 充值配置
  250. */
  251. export function rechargeConfig() {
  252. return request.get('recharge/config')
  253. }