reduce.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <template>
  2. <view class="page">
  3. <scroll-view class="scrollList" scroll-y>
  4. <view class="uni-list">
  5. <block v-for="(item, key) in list_data" :key="key">
  6. <view class="uni-list-cell"
  7. hover-class="none"
  8. >
  9. <checkbox-group @change="change(item.user_id + '')">
  10. <label class="uni-list-cell uni-list-cell-pd">
  11. <view>
  12. <checkbox color="#02b300"
  13. :value="item.user_id + ''"
  14. />
  15. </view>
  16. <view class="uni-media-list">
  17. <view class="uni-media-list-logo">
  18. <image :src="staticPhoto + item.photo" :lazy-load="true"/>
  19. </view>
  20. <view class="uni-media-list-body">
  21. <view class="uni-list-cell-navigate">{{item.nickname}}</view>
  22. </view>
  23. </view>
  24. </label>
  25. </checkbox-group>
  26. </view>
  27. </block>
  28. </view>
  29. </scroll-view>
  30. </view>
  31. </template>
  32. <script>
  33. import _get from '../../../common/_get';
  34. import _hook from '../../../common/_hook';
  35. import _data from '../../../common/_data';
  36. export default {
  37. components: {
  38. },
  39. data() {
  40. return {
  41. list_data: [],
  42. list_id: 0,
  43. add_user_ids: [],
  44. }
  45. },
  46. onShow(){
  47. _hook.routeTabBarHook();
  48. },
  49. onLoad(option) {
  50. let _this = this;
  51. _this.list_id = option.list_id;
  52. _this.$httpSend({
  53. path: '/im/message/groupMember',
  54. data: { list_id: _this.list_id },
  55. success(data) {
  56. _this.list_data = data;
  57. }
  58. });
  59. },
  60. computed: {
  61. staticPhoto(){
  62. return _data.staticPhoto();
  63. }
  64. },
  65. methods: {
  66. change(user_id){
  67. if(user_id){
  68. let i = this.add_user_ids.indexOf(user_id);
  69. if(i > -1){
  70. this.add_user_ids.splice(i,1);
  71. }else{
  72. this.add_user_ids.push(user_id);
  73. }
  74. }
  75. },
  76. },
  77. watch: {
  78. },
  79. onNavigationBarButtonTap(e) {
  80. let _this = this;
  81. if(_this.add_user_ids.length){
  82. _this.$httpSend({
  83. path: '/im/message/removeChat',
  84. data: { users: JSON.stringify(_this.add_user_ids),list_id: _this.list_id, },
  85. success_action: true,
  86. success(res) {
  87. uni.showToast({
  88. title: res.msg,
  89. duration: 2000,
  90. icon: 'none',
  91. });
  92. setTimeout(() => {
  93. uni.redirectTo({
  94. url: './more?list_id=' + _this.list_id,
  95. });
  96. },2000);
  97. }
  98. });
  99. }else{
  100. uni.redirectTo({
  101. url: './more?list_id=' + _this.list_id,
  102. });
  103. }
  104. }
  105. }
  106. </script>
  107. <style>
  108. .page {
  109. display: flex;
  110. flex-direction:row;
  111. }
  112. .scrollList {
  113. flex: 1;
  114. height: 100vh;
  115. }
  116. .uni-indexed-list-bar {
  117. width: 40upx;
  118. height: 100vh;
  119. background-color: #e7e7e7;
  120. display: flex;
  121. flex-direction: column;
  122. }
  123. .uni-indexed-list-bar.active {
  124. /* background-color: rgb(200, 200, 200); */
  125. }
  126. .uni-indexed-list-text {
  127. font-size: 22upx;
  128. text-align: center;
  129. }
  130. .uni-indexed-list-bar.active .uni-indexed-list-text {
  131. color: #333;
  132. }
  133. .uni-indexed-list-text.active,
  134. .uni-indexed-list-bar.active .uni-indexed-list-text.active {
  135. color: #02b300;
  136. }
  137. .uni-indexed-list-alert {
  138. position: absolute;
  139. z-index: 20;
  140. width: 160upx;
  141. height: 160upx;
  142. left: 50%;
  143. top: 50%;
  144. margin-left: -80upx;
  145. margin-top: -80upx;
  146. border-radius: 80upx;
  147. text-align: center;
  148. line-height: 160upx;
  149. font-size: 70upx;
  150. color: #fff;
  151. background-color: rgba(0, 0, 0, 0.5);
  152. }
  153. .header {
  154. display: flex;
  155. flex-direction: row;
  156. padding: 10px 15px;
  157. align-items: center;
  158. }
  159. .input-view {
  160. display: flex;
  161. align-items: center;
  162. flex-direction: row;
  163. background-color: #e7e7e7;
  164. height: 30px;
  165. border-radius: 5px;
  166. padding: 0 10px;
  167. flex: 1;
  168. }
  169. .input {
  170. flex: 1;
  171. padding: 0 5px;
  172. height: 24px;
  173. line-height: 24px;
  174. font-size: 16px;
  175. }
  176. .uni-list-cell-navigate {
  177. padding: 0;
  178. }
  179. .uni-media-list-body {
  180. height: auto;
  181. }
  182. </style>