apply.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <view>
  3. <view class="uni-title uni-common-pl">你需要发送验证申请,等对方通过</view>
  4. <view class="uni-textarea">
  5. <textarea auto-height v-model="content" />
  6. </view>
  7. <view class="send">
  8. <button class="mini-btn send_button" type="primary" size="mini" @tap="send">发送</button>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. import _get from '../../common/_get';
  14. import _hook from '../../common/_hook';
  15. export default {
  16. components:{
  17. },
  18. data() {
  19. return {
  20. user_id: '',
  21. is_type: 0,
  22. content: '',
  23. }
  24. },
  25. onShow(){
  26. _hook['routeSonHook']();
  27. },
  28. onLoad(option){
  29. let _this = this;
  30. _this.user_id = option.user_id;
  31. _this.is_type = option.is_type;
  32. },
  33. computed:{
  34. },
  35. methods:{
  36. send(){
  37. let _this = this;
  38. _this.$httpSend({
  39. path: '/im/action/friendAdd',
  40. data: { content: _this.content,user_id: _this.user_id, is_type: _this.is_type },
  41. success_action: true,
  42. success(res) {
  43. // 1是直接添加成功
  44. if(res.err == 1){
  45. _get.getFriendList();
  46. _get.getChatList();
  47. }
  48. uni.showToast({
  49. title: res.msg,
  50. duration: 2000
  51. });
  52. setTimeout(() => {
  53. uni.reLaunch({
  54. url: './index'
  55. });
  56. },2000);
  57. }
  58. });
  59. }
  60. },
  61. watch:{
  62. }
  63. }
  64. </script>
  65. <style>
  66. .send {
  67. width: 100%;
  68. text-align: right;
  69. }
  70. .send_button {
  71. margin-right: 20upx;
  72. background-color: #1AAD19 !important;
  73. margin-top: 30upx;
  74. }
  75. </style>