business-card-detail.js 786 B

1234567891011121314151617181920212223242526272829303132333435
  1. import { VueLikePage } from '../../../utils/page'
  2. import UserApi from '../../../apis/user'
  3. import Router from '../../../utils/routes'
  4. VueLikePage([], {
  5. data: {
  6. },
  7. methods: {
  8. onLoad (options) {
  9. this.detail = {}
  10. this.viewerId = options.id
  11. this.getUserInfoById()
  12. },
  13. getUserInfoById () {
  14. UserApi.getVisitCardDetail(this.viewerId).then(res => {
  15. this.detail = res.data
  16. this.setData({
  17. detail: res.data
  18. })
  19. })
  20. },
  21. bindinput (e) {
  22. const { key } = e.currentTarget.dataset
  23. this.detail[key] = e.detail.value
  24. },
  25. updateVisitCard () {
  26. return UserApi.updateVisitCard(this.detail).then(res => {
  27. wx.showToast({
  28. title: '修改成功',
  29. })
  30. })
  31. }
  32. }
  33. })