index.js 776 B

1234567891011121314151617181920212223242526272829303132333435
  1. import event from '~/mixins/event'
  2. import {
  3. createStoreBindings
  4. } from 'mobx-miniprogram-bindings'
  5. import {
  6. store
  7. } from '~/store/index'
  8. Page({
  9. behaviors: [event],
  10. data: {
  11. userInfo: {},
  12. },
  13. async onLoad() {
  14. // 手工绑定
  15. this.storeBindings = createStoreBindings(this, {
  16. store,
  17. fields: {
  18. userInfo: 'userInfo',
  19. }
  20. })
  21. },
  22. clipboar({
  23. currentTarget
  24. }) {
  25. wx.setClipboardData({
  26. data: currentTarget.dataset.value,
  27. success: function (res) { //成功回调函数
  28. wx.showToast({
  29. title: '复制成功',
  30. icon: "success"
  31. })
  32. }
  33. })
  34. },
  35. })