report.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <view class="page">
  3. <view style="text-align: center;height: 320px;width:80%;margin: 0px auto;padding-top:40px;vertical-align: top;">
  4. <div class="info">
  5. <li>
  6. <image :src="userInfo.avatar" style="height: 50px;width: 50px;border-radius: 5px;vertical-align: middle;"></image>
  7. </li>
  8. <li style='padding-left: 5px;line-height: 25px;;'>
  9. {{userInfo.nickname}}<br>
  10. 账号:{{userInfo.name}}
  11. </li>
  12. </div>
  13. <view class="content">
  14. <textarea placeholder="请填写投诉理由" v-model="content" ></textarea>
  15. </view>
  16. <view style="width: 80%;margin: 10px auto;">
  17. <button class="button1" @tap="submit">
  18. 确认并提交
  19. </button>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import http from "../../library/http.js"
  26. import config from "../../config.js"
  27. export default {
  28. data() {
  29. return {
  30. content: '',
  31. user:uni.getStorageSync('userInfo'),
  32. userInfo:[]
  33. }
  34. },
  35. methods: {
  36. getUserInfo(id){
  37. var userid=id;
  38. if(uni.getStorageSync('members_'+userid)) this.userInfo=uni.getStorageSync('members_'+userid);
  39. http.setWait(false).get('user.php?act=userdetail',{id:userid,userid:this.user.id}).then(res=>{
  40. if(res.code==200){
  41. this.userInfo=res.data;
  42. uni.setStorageSync('members_'+userid,res.data)
  43. }
  44. })
  45. },
  46. submit(){
  47. if(this.content==''){
  48. uni.showToast({
  49. icon:'none',
  50. title:'请填写投诉理由'
  51. })
  52. return false;
  53. }
  54. uni.showModal({
  55. title: '提示',
  56. content: '是否确认投诉'+this.userInfo.nickname+'?',
  57. showCancel: true,
  58. cancelText: '取消',
  59. confirmText: '确认投诉',
  60. success: res => {
  61. if(res.confirm) {
  62. http.setWait(false).post('user.php?act=toreport',{id:this.userInfo.id,userid:this.user.id,content:this.content}).then(res=>{
  63. if(res.code==200){
  64. uni.showToast({
  65. title:'投诉已提交'
  66. })
  67. setTimeout(function(){
  68. uni.navigateBack({
  69. delta:1
  70. })
  71. },1000)
  72. }
  73. })
  74. }
  75. else{
  76. }
  77. }
  78. });
  79. }
  80. },
  81. onLoad(opts) {
  82. this.getUserInfo(opts.id)
  83. }
  84. }
  85. </script>
  86. <style lang="scss" scoped>
  87. @import "@/static/css/group.css";
  88. .page{
  89. background-color: #fff;
  90. }
  91. .info{
  92. width: 100%;
  93. display: table;
  94. table-layout: fixed;
  95. height: 50px;
  96. line-height: 50px;
  97. text-align: left;
  98. }
  99. .info > li{
  100. display: table-cell;
  101. vertical-align: middle;
  102. overflow: hidden;
  103. text-overflow:ellipsis;
  104. white-space: nowrap;
  105. }
  106. .info > li:first-child{
  107. width: 60px;
  108. }
  109. .info > li:first-child img{
  110. width: 50px;
  111. height: 50px;
  112. vertical-align: middle;
  113. border-radius: 5px;
  114. }
  115. .info > li:nth-child(2){
  116. line-height: 25px;
  117. }
  118. .content{
  119. padding: 10px 0px;
  120. }
  121. .content textarea{
  122. width: calc(100% - 20px);
  123. height: 90px;
  124. padding: 5px 10px;
  125. border: 1px #eee solid;
  126. border-radius: 5px;
  127. text-align: left;
  128. font-size: 14px;
  129. justify-content: left;
  130. }
  131. </style>