index.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. var utils = require("../../utils/index");
  2. var location = require("../../utils/Location");
  3. var app = getApp();
  4. Component({
  5. /**
  6. * 组件的属性列表
  7. */
  8. properties: {
  9. item: {
  10. type: Object,
  11. value: {}
  12. },
  13. city: Object,
  14. isOld: {
  15. type: Boolean,
  16. value: false
  17. },
  18. groupInfo: {
  19. type: Object,
  20. value: {
  21. group_name: '社区',
  22. owner_name: '团长'
  23. }
  24. },
  25. hiddenDetails: {
  26. type: Number,
  27. value: 0
  28. }
  29. },
  30. /**
  31. * 组件的方法列表
  32. */
  33. methods: {
  34. chooseCommunity: function (event) {
  35. var community = event.currentTarget.dataset.val;
  36. if ("火星社区" !== community.communityName || community.communityId) {
  37. var disUserHeadImg = community.disUserHeadImg || community.headImg || "",
  38. disUserName = community.disUserName || community.realName || "",
  39. data = {
  40. communityId: community.communityId,
  41. communityName: community.communityName,
  42. disUserName: disUserName,
  43. disUserHeadImg: disUserHeadImg,
  44. communityAddress: community.communityAddress,
  45. distance: community.distance,
  46. fullAddress: community.fullAddress || community.communityAddress
  47. },
  48. city = this.data.city;
  49. (0, utils.changeCommunity)(data, city);
  50. } else {
  51. location.openSetting(app).then(function () {
  52. location.checkGPS(app, function () { });
  53. });
  54. }
  55. }
  56. }
  57. })