myGroup.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <view class="">
  3. <view style="padding: 10px 20px;">
  4. <u-divider text="互助组信息"></u-divider>
  5. <view class="info" v-if="info">
  6. <view>场所:{{info.tradeAreaName}}</view>
  7. <view>名称:{{info.orgName}}</view>
  8. <view>组长:{{info.leaderName}}</view>
  9. <view style="display: flex;">
  10. <view>
  11. 联系号码:{{info.leaderPhone}}
  12. </view>
  13. <u-icon @click.stop="makePhoneCall(info.leaderPhone)" v-if="info.leaderPhone" name="phone-fill"
  14. size="25" style="margin-left:10px;cursor: pointer;" color="#07c5ff"></u-icon>
  15. </view>
  16. </view>
  17. <view v-else style="display: flex;text-align: center;">
  18. <view>
  19. 未查询到互助组信息(
  20. </view>
  21. <view style="color: blue;" text="" @click="joinGroup">加入互助组</view>)
  22. </view>
  23. <button class="btn back" @click="back()">返回</button>
  24. </view>
  25. <view style="height: 50px;"></view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. data() {
  31. return {
  32. info: null,
  33. };
  34. },
  35. onLoad() {
  36. },
  37. onShow() {
  38. this.checkGroup()
  39. },
  40. methods: {
  41. joinGroup() {
  42. uni.navigateTo({
  43. url:'/pages/personal/group'
  44. })
  45. },
  46. back() {
  47. uni.navigateBack()
  48. },
  49. makePhoneCall(phone) {
  50. uni.makePhoneCall({
  51. phoneNumber: phone
  52. });
  53. },
  54. getGroupList() {
  55. this.http.request({
  56. url: '/level-one-server/app/TbPeople/getGroupInfo',
  57. success: res => {
  58. this.info = res.data.data;
  59. }
  60. });
  61. },
  62. checkGroup() {
  63. this.http.request({
  64. url: '/sp-admin/app/AppUser/getAuth',
  65. success: res => {
  66. this.groupId = res.data.data.groupId;
  67. this.getGroupList()
  68. }
  69. });
  70. },
  71. apply() {
  72. let groupId = this.groupId;
  73. if (!groupId) {
  74. uni.showModal({
  75. content: '请选择互助组',
  76. showCancel: false
  77. });
  78. return;
  79. }
  80. let groupName = this.groupList.filter(obj => obj.id == groupId)[0].orgName;
  81. let that = this;
  82. uni.showModal({
  83. title: '提示',
  84. content: '是否申请加入【' + groupName + '】',
  85. success(resp) {
  86. if (resp.confirm) {
  87. that.http.request({
  88. url: '/level-one-server/app/TbPeople/joinGroup',
  89. data: {
  90. groupId,
  91. groupId,
  92. groupName: groupName
  93. },
  94. success: res => {
  95. uni.showToast({
  96. title: '提交成功'
  97. })
  98. }
  99. });
  100. }
  101. }
  102. })
  103. }
  104. },
  105. }
  106. </script>
  107. <style lang="scss">
  108. page {
  109. background-color: #f5f5f5;
  110. }
  111. .info {
  112. font-size: 18px;
  113. line-height: 30px;
  114. }
  115. .back {
  116. margin-top: 50px;
  117. }
  118. </style>