index.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. rest: 0
  13. }
  14. },
  15. city: Object,
  16. isOld: {
  17. type: Boolean,
  18. value: false
  19. },
  20. groupInfo: {
  21. type: Object,
  22. value: {
  23. group_name: '社区',
  24. owner_name: '团长'
  25. }
  26. },
  27. hiddenDetails: {
  28. type: Number,
  29. value: 0
  30. },
  31. skin: {
  32. type: Object
  33. }
  34. },
  35. /**
  36. * 组件的方法列表
  37. */
  38. methods: {
  39. chooseCommunity: function (event) {
  40. var community = event.currentTarget.dataset.val;
  41. if ("火星社区" !== community.communityName || community.communityId) {
  42. var disUserHeadImg = community.disUserHeadImg || community.headImg || "",
  43. disUserName = community.disUserName || community.realName || "",
  44. data = {
  45. communityId: community.communityId,
  46. communityName: community.communityName,
  47. disUserName: disUserName,
  48. disUserHeadImg: disUserHeadImg,
  49. communityAddress: community.communityAddress,
  50. distance: community.distance,
  51. fullAddress: community.fullAddress || community.communityAddress,
  52. lat: community.lat,
  53. lon: community.lon
  54. },
  55. city = this.data.city;
  56. (0, utils.changeCommunity)(data, city);
  57. } else {
  58. location.openSetting(app).then(function () {
  59. location.checkGPS(app, function () { });
  60. });
  61. }
  62. }
  63. }
  64. })