msg.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <view class="app">
  3. <u--textarea :maxlength="-1" v-model="msg" height="600" placeholder="请输入公告内容" confirmType="done" border="bottom"></u--textarea>
  4. <view class="btn" @tap="tapSubmit">完成</view>
  5. </view>
  6. </template>
  7. <style lang="scss">
  8. .btn{font-size: 16px;color:#fff;background: $ic-appcolor;height: 40px;width: calc(100% - 40px);margin: 20px;border-radius: 40px;text-align: center;line-height: 40px;}
  9. </style>
  10. <script>
  11. import {mapState,mapMutations } from 'vuex';
  12. export default {
  13. data() {
  14. return {
  15. msg : "",
  16. groupId : "",
  17. isPop:false
  18. }
  19. },
  20. onLoad(option){
  21. this.groupId = option.groupId || "";
  22. this.msg = option.msg || "";
  23. },
  24. methods: {
  25. tapSubmit:function(){
  26. if(this.msg == ''){
  27. this.utils.Tip("请输入群公告");
  28. return;
  29. }
  30. uni.showLoading({ title:"操作中.." });
  31. this
  32. .request
  33. .post("chatGroupEditMsg",{groupId:this.groupId,msg:this.msg})
  34. .then(res=>{
  35. uni.hideLoading();
  36. if(res.code == 200) {
  37. this.utils.Tip("操作成功");
  38. uni.navigateBack();
  39. } else {
  40. this.utils.Tip(res.msg);
  41. }
  42. })
  43. .catch(error=>{
  44. uni.hideLoading();
  45. this.utils.Tip("提交失败,请重新尝试");
  46. });
  47. }
  48. }
  49. }
  50. </script>