dots.js 945 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import request from './request.js'
  2. const CryptoJS = require('../utils/aes_util');
  3. /**
  4. * 打点上报通用方法
  5. * @param {string} code
  6. * @param {number} time
  7. */
  8. class Dots {
  9. constructor(args) {
  10. }
  11. // 打点上传
  12. save(oType, bType, val) {
  13. let {id, petName} = uni.getStorageSync('setUerInfo')? uni.getStorageSync('setUerInfo').user : {id: '', petName: ''};
  14. let params = {
  15. userId: id,
  16. userName: petName,
  17. operateType: oType,
  18. businessType: bType,
  19. businessValue: val
  20. }
  21. request.post({
  22. url: 'userOperateLog/saveLog',
  23. loadingTip: "加载中...",
  24. data: params
  25. }).then(res => {
  26. console.log(res);
  27. })
  28. }
  29. search(type, val) {
  30. this.save(0, type, val)
  31. }
  32. share(type, val) {
  33. this.save(1, type, val)
  34. }
  35. view(type, val) {
  36. this.save(2, type, val)
  37. }
  38. submit(type, val) {
  39. this.save(3, type, val)
  40. }
  41. pay(type, val) {
  42. this.save(4, type, val)
  43. }
  44. }
  45. const dots = new Dots();
  46. export default dots