group.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <view class="">
  3. <view style="padding: 10px 20px;">
  4. <u-divider text="互助组信息"></u-divider>
  5. <u-radio-group v-model="groupId" placement="column" :size="20" iconPlacement="right"
  6. style="margin-top: 25px;">
  7. <view v-for="(item,index) in groupList">
  8. <u-radio style="font-size: 14px;"
  9. :label="(index+1)+'.'+item.orgName+'('+(item.leaderName?item.leaderName:'未分配组长')+')'"
  10. :name="item.id" :customStyle="{marginBottom: '18px'}" :labelSize="19"></u-radio>
  11. <u-divider></u-divider>
  12. </view>
  13. </u-radio-group>
  14. </view>
  15. <view style="height: 50px;"></view>
  16. <view class="mfooter">
  17. <view class="flex">
  18. <view class="f">
  19. <button class="btn" @click="apply()">申请加入</button>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. groupId: undefined,
  30. groupList: [],
  31. };
  32. },
  33. onLoad() {
  34. },
  35. onShow() {
  36. this.checkGroup()
  37. },
  38. methods: {
  39. getGroupList() {
  40. this.http.request({
  41. url: '/level-one-server/app/TbGroup/getList',
  42. data: {
  43. pageNo: 1,
  44. pageSize: 200
  45. },
  46. success: res => {
  47. this.groupList = res.data.data;
  48. }
  49. });
  50. },
  51. checkGroup() {
  52. this.http.request({
  53. url: '/sp-admin/app/AppUser/getAuth',
  54. success: res => {
  55. this.groupId = res.data.data.groupId;
  56. this.getGroupList()
  57. }
  58. });
  59. },
  60. apply() {
  61. let groupId=this.groupId;
  62. if(!groupId){
  63. uni.showModal({
  64. content: '请选择互助组',
  65. showCancel: false
  66. });
  67. return;
  68. }
  69. let groupName=this.groupList.filter(obj=>obj.id==groupId)[0].orgName;
  70. let that=this;
  71. uni.showModal({
  72. title:'提示',
  73. content:'是否申请加入【'+groupName+'】',
  74. success(resp) {
  75. if(resp.confirm){
  76. that.http.request({
  77. url: '/level-one-server/app/TbPeople/joinGroup',
  78. data:{groupId,groupId,groupName:groupName},
  79. success: res => {
  80. uni.showToast({
  81. title: '提交成功'
  82. })
  83. }
  84. });
  85. }
  86. }
  87. })
  88. }
  89. },
  90. }
  91. </script>
  92. <style lang="scss">
  93. page {
  94. background-color: #f5f5f5;
  95. }
  96. .my_top {
  97. position: relative;
  98. overflow: hidden;
  99. image {
  100. width: 100%;
  101. }
  102. }
  103. .list {
  104. position: relative;
  105. padding: 0px 20px 10px 20px;
  106. margin-top: -196px;
  107. .user {
  108. background-color: white;
  109. padding: 20px;
  110. border-radius: 8px;
  111. color: $font-c;
  112. .head {
  113. float: left;
  114. width: 55px;
  115. height: 55px;
  116. }
  117. .con {
  118. float: left;
  119. padding-left: 15px;
  120. width: 60%;
  121. .nickName {
  122. font-size: 17px;
  123. font-weight: bold;
  124. }
  125. .tag {
  126. background-color: #6799ad;
  127. color: white;
  128. float: left;
  129. font-size: 13px;
  130. padding: 2px 6px;
  131. border-radius: 5px;
  132. margin-top: 6px;
  133. }
  134. }
  135. .edit {
  136. float: right;
  137. font-size: 20px;
  138. margin-top: 17px;
  139. }
  140. }
  141. }
  142. .exit {
  143. margin-top: 20px;
  144. background-color: white;
  145. color: #f44336;
  146. }
  147. </style>