group_nickname.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <view class="page">
  3. <view class="page-content">
  4. <input type="text" class="uni-input" v-model="nickname"/>
  5. <view class="page-content-info">设置您在群里的昵称,这个昵称只会在群内显示</view>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. import _hook from '../../../common/_hook';
  11. import _get from '../../../common/_get';
  12. export default {
  13. data() {
  14. return {
  15. nickname:'',
  16. list_id:''
  17. }
  18. },
  19. onShow(){
  20. _hook.routeSonHook();
  21. let _this = this;
  22. },
  23. onLoad(options){
  24. if('nickname' in options){
  25. this.nickname = options.nickname
  26. this.list_id = options.list_id
  27. }
  28. },
  29. methods: {
  30. },
  31. onNavigationBarButtonTap(e) {
  32. //保存昵称
  33. _get.saveGroupNickName({nickname:this.nickname,list_id:this.list_id},function () {
  34. uni.showToast({title:'操作成功',duration: 2000,icon:'none'});
  35. setTimeout(function () {
  36. uni.navigateBack();
  37. },1000)
  38. },function (ret) {
  39. uni.showToast({title:ret.msg,duration: 2000,icon:'none'})
  40. });
  41. }
  42. }
  43. </script>
  44. <style>
  45. page{
  46. background-color: #ffffff;
  47. }
  48. .page-content-info{
  49. word-break: break-all;
  50. margin-top: 10px;
  51. }
  52. .page{
  53. margin-top: 40px;
  54. display: flex;
  55. justify-content: center;
  56. }
  57. .page-content{
  58. display: flex;
  59. justify-content: center;
  60. flex-direction: column;
  61. width: 80%;
  62. height: 100%
  63. ;
  64. }
  65. .page-content input{
  66. background-color: #f1f1f1;
  67. height: 35px;
  68. border-radius: 5px;
  69. }
  70. </style>