import { VueLikePage } from '../../../utils/page'
import UserApi from '../../../apis/user'
VueLikePage([], {
  data: {
    
  },
  methods: {
    onLoad (options) {
      this.detail = {}
      this.viewerId = options.id
      this.getUserInfoById()
    },
    getUserInfoById () {
      UserApi.getVisitCardDetail(this.viewerId).then(res => {
        this.detail = res.data
        this.setData({
          detail: res.data
        })
      })
    },
    bindinput (e) {
      const { key } = e.currentTarget.dataset
      this.detail[key] = e.detail.value
    },

    updateVisitCard () {
      return UserApi.updateVisitCard(this.detail).then(res => {
        wx.showToast({
          title: '修改成功',
        })
      })
    }
  }
})