weixin.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. import request from '@/apis/utils/request'
  2. import requestWhite from '@/apis/utils/requestWhite.js';
  3. // import requestAli from '../utils/requestParking.js';
  4. import Qs from 'qs';
  5. //微信支付
  6. export function wxpay(data) {
  7. if(data){
  8. data.type="E"
  9. }
  10. if(data&&!data.recordId){
  11. data.recordId=''
  12. }
  13. return request({
  14. url: '/wxPay/wxJsapiPay',
  15. data: data,
  16. method: 'post',
  17. })
  18. }
  19. export function findByCNameAndPhone(code,phone,companyName) {
  20. return requestWhite({
  21. url: '/mobile/employeeUser/findByCNameAndPhone?phone='+phone+'&companyName='+companyName+'&code=reading&unionId=' + code,
  22. params: {},
  23. method: 'get',
  24. })
  25. }
  26. export function findByPhone(data,phone) {
  27. var url='/mobile/employeeUser/findByPhone?phone='+phone+'&code=reading&unionId='+data;
  28. return requestWhite({
  29. method: 'get',
  30. url: url
  31. })
  32. }
  33. export function alpay(data) {
  34. if(data&&!data.recordId){
  35. data.recordId=''
  36. }
  37. return request({
  38. url: '/aliPay/tradePrecreatePay',
  39. data: data,
  40. method: 'post',
  41. })
  42. }
  43. //根据code换取openid
  44. export function getDataByCode(code) {
  45. return request({
  46. url: '/wechat/findUserInfo/' + code,
  47. params: {},
  48. method: 'get',
  49. })
  50. }
  51. // export function getDataByCodeALI(code) {
  52. // return requestAli({
  53. // url: '/aliPay/findUserInfo/' + code,
  54. // params: {},
  55. // method: 'get',
  56. // })
  57. // }
  58. //获得配置
  59. export function getConfig() {
  60. return requestWhite({
  61. url: '/wechat/getConfig',
  62. data: {
  63. url: window.location.href.split('#')[0]
  64. },
  65. method: 'get',
  66. })
  67. }
  68. export function checkSubscribe(data) {
  69. return requestWhite({
  70. url: '/wechat/checkSubscribe',
  71. data: data,
  72. method: 'post',
  73. })
  74. }
  75. export function addPoint(data) {
  76. return request({
  77. url: '/mobile/points/addPoint',
  78. data: data,
  79. method: 'post',
  80. })
  81. }