picker.js 1008 B

1234567891011121314151617181920212223242526
  1. import store from "../store";
  2. export default {
  3. install(Vue) {
  4. Vue.prototype.$pickUser = function (options) {
  5. uni.navigateTo({
  6. url: '/pages/pick/PickUserPage',
  7. events: {
  8. pickedUsers: users => {
  9. options.successCB && options.successCB(users);
  10. }
  11. },
  12. success: (res) => {
  13. res.eventChannel.emit('pickOptions', {
  14. users: options.users ? options.users : store.state.contact.favContactList.concat(store.state.contact.friendList),
  15. initialCheckedUsers: options.initialCheckedUsers,
  16. uncheckableUsers: options.uncheckableUsers,
  17. showCategoryLabel: options.showCategoryLabel !== false,
  18. confirmTitle: options.confirmTitle ? options.confirmTitle : '确定',
  19. });
  20. }
  21. })
  22. };
  23. }
  24. }