admin.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <view>
  3. <view class="list-item">
  4. <view class="item fx-r fx-bc fx-ac" style="padding: 20px 0;" @tap="tapTransfer">
  5. <view class="label">群主转让</view>
  6. <view class="fx-g1"></view>
  7. <image class="pve" src="/static/chat/ic_next.png" mode="widthFix"></image>
  8. </view>
  9. <view class="item fx-r fx-bc fx-ac" style="padding: 20px 0;" @tap="tapAdmin">
  10. <view class="label">群管理员</view>
  11. <view class="fx-g1"></view>
  12. <image class="pve" src="/static/chat/ic_next.png" mode="widthFix"></image>
  13. </view>
  14. <view class="item fx-r fx-bc fx-ac" style="padding: 20px 0;" @tap="tapRed">
  15. <view class="label">未领取红包</view>
  16. <view class="fx-g1"></view>
  17. <image class="pve" src="/static/chat/ic_next.png" mode="widthFix"></image>
  18. </view>
  19. </view>
  20. <view class="list-item" style="margin-top: 10px;">
  21. <view class="item fx-r fx-bc fx-ac" style="padding: 20px 0;" @tap="tapDelGroup">
  22. <view class="label" style="color: red;">解散群聊</view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import {mapState,mapMutations} from 'vuex'
  29. export default {
  30. computed: mapState(['user']),
  31. data() {
  32. return {
  33. groupId : 0
  34. }
  35. },
  36. onLoad(options) {
  37. this.groupId = options.groupId || 0;
  38. },
  39. methods: {
  40. tapTransfer:function(){
  41. uni.navigateTo({
  42. url:"transfer?groupId=" + this.groupId
  43. })
  44. },
  45. /**
  46. * 群管理员
  47. */
  48. tapAdmin:function(){
  49. uni.navigateTo({
  50. url: "adminInfo?groupId=" + this.groupId
  51. })
  52. },
  53. tapDelGroup:function(){
  54. this.utils.showModal("你确定要解散群聊吗,解散之后,将无法恢复?", ()=>{
  55. uni.showLoading({ title:"提交数据中..." });
  56. this
  57. .request
  58. .post("GroupDissolve",{groupId:this.groupId})
  59. .then(res=>{
  60. uni.hideLoading();
  61. if(res.code == 200) {
  62. this.utils.Tip("移除成功");
  63. setTimeout(()=>{
  64. uni.navigateBack();
  65. },200);
  66. } else {
  67. this.utils.Tip(res.msg);
  68. }
  69. })
  70. .catch(err=>{
  71. uni.hideLoading();
  72. this.utils.Tip("加载失败,请重新尝试");
  73. });
  74. });
  75. },
  76. /**
  77. * 未领取红包
  78. */
  79. tapRed:function(){
  80. uni.navigateTo({
  81. url:"not_receive?groupId=" + this.groupId
  82. });
  83. }
  84. }
  85. }
  86. </script>
  87. <style lang="scss">
  88. .list-item{background: #fff;padding: 0px 20px;margin-top: 10px;}
  89. .list-item .item{padding: 10px 0;border-bottom: 1px solid #f1f1f1;}
  90. .list-item .item:last-child{border-bottom: 0;}
  91. .list-item .item .label{font-size: 16px;color:$ic-default-text;}
  92. .list-item .item .pve{width: 20px;}
  93. .tag{color:$ic-default-text ;font-size: 14px;}
  94. </style>