sqInfo.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <view>
  3. <uni-nav-bar statusBar backgroundColor="#fff" fixed title="查看好友" left-icon="left" @clickLeft="utils.navigateBack()">
  4. </uni-nav-bar>
  5. <view class="info fx-r fd-ac fx-bc" v-if="data != null">
  6. <view class="avatar">
  7. <image :src="data.img == '' ? '/static/img/user-avatar1.png' : data.img" mode="aspectFill"></image>
  8. </view>
  9. <view class="user-info">
  10. <view class="nickname fx-r fx-bc">
  11. {{data.name}}
  12. </view>
  13. </view>
  14. </view>
  15. <view class="pannel">
  16. <view class="item fx-r fx-bc fx-ac">
  17. <view class="label">来源</view>
  18. <view class="fx-g1"></view>
  19. <view class="value">{{data.source}}</view>
  20. </view>
  21. <view class="item fx-r fx-bc">
  22. <view class="label">认证方式</view>
  23. <view class="value">{{data.content}}</view>
  24. </view>
  25. </view>
  26. <view class="btn" @tap="tapCheck" v-if="data.status == 0">通过验证</view>
  27. <view class="btn" @tap="tapRefused" v-if="data.status == 0" style="color: red;">拒绝通过</view>
  28. <view class="btn" style="color: #ccc;" v-if="data.status == 1">已通过验证</view>
  29. <view class="btn" style="color: #ccc;" v-if="data.status == 2">已拒绝</view>
  30. <view class="btn" style="color: #ccc;" v-if="data.status == -1">已过时</view>
  31. <view class="btn" style="color: #ccc;" v-if="data.status == -2">已忽略</view>
  32. </view>
  33. </template>
  34. <script>
  35. import {mapState,mapMutations } from 'vuex';
  36. export default {
  37. data() {
  38. return {
  39. data : {},
  40. id : 0,
  41. isPop:false
  42. }
  43. },
  44. onLoad(option){
  45. this.id = option.id || "0";
  46. },
  47. onShow() {
  48. this.getData();
  49. },
  50. methods: {
  51. getData:function(){
  52. uni.showLoading({ title: '获取数据中..'});
  53. this
  54. .request
  55. .post("verificationInfo",{id:this.id})
  56. .then(res => {
  57. uni.hideLoading();
  58. if(res.code == 200) {
  59. this.data = res.data;
  60. } else {
  61. uni.showModal({title: '系统提示',content: res.msg,showCancel: false});
  62. }
  63. })
  64. .catch(res=>{
  65. console.log(res);
  66. uni.hideLoading();
  67. uni.showModal({title: '系统提示',content: '加载失败,重新点击尝试!',showCancel: false});
  68. });
  69. },
  70. /**
  71. * checkBox
  72. */
  73. tapCheck:function(){
  74. uni.showLoading({title: '验证中..'});
  75. this
  76. .request
  77. .post("FriendVerificationSub",{id:this.id,type:1})
  78. .then(res => {
  79. uni.hideLoading();
  80. if(res.code == 200) {
  81. this.getData();
  82. uni.$emit('checkInvite',{type:1,id:this.id});
  83. uni.navigateBack();
  84. } else {
  85. uni.showModal({title: '系统提示',content: res.msg,showCancel: false});
  86. }
  87. })
  88. .catch(res=>{
  89. console.log(res);
  90. uni.hideLoading();
  91. uni.showModal({title: '系统提示',content: '加载失败,重新点击尝试!',showCancel: false});
  92. });
  93. },
  94. tapRefused:function(){
  95. uni.showLoading({title: '验证中..'});
  96. this
  97. .request
  98. .post("FriendVerificationSub",{id:this.id,type:2})
  99. .then(res => {
  100. uni.hideLoading();
  101. if(res.code == 200) {
  102. this.getData();
  103. uni.$emit('checkInvite',{type:2,id:this.id});
  104. } else {
  105. uni.showModal({title: '系统提示',content: res.msg,showCancel: false});
  106. }
  107. })
  108. .catch(res=>{
  109. console.log(res);
  110. uni.hideLoading();
  111. uni.showModal({title: '系统提示',content: '加载失败,重新点击尝试!',showCancel: false});
  112. });
  113. },
  114. /**
  115. * 添加好友
  116. */
  117. tapAddBtn:function(){
  118. uni.showLoading({ title: '获取数据中..'});
  119. this
  120. .request
  121. .post("FriendAdd",{usercode:this.usercode})
  122. .then(res => {
  123. uni.hideLoading();
  124. if(res.code == 200) {
  125. if(res.data.stats == 1) {
  126. this.utils.Tip("加入成功");
  127. this.getData();
  128. } else {
  129. uni.navigateTo({
  130. url:"checkAdd?userCode=" + this.usercode
  131. })
  132. }
  133. } else {
  134. uni.showModal({title: '系统提示',content: res.msg,showCancel: false});
  135. }
  136. })
  137. .catch(res=>{
  138. console.log(res);
  139. uni.hideLoading();
  140. uni.showModal({title: '系统提示',content: '加载失败,重新点击尝试!',showCancel: false});
  141. });
  142. }
  143. }
  144. }
  145. </script>
  146. <style lang="scss">
  147. .info{background: #fff;padding: 10px;}
  148. .info .avatar{}
  149. .info .avatar image{width: 60px;height: 60px;border-radius: 60px;}
  150. .user-info{margin-left: 10px;width: calc(100% - 70px);}
  151. .user-info .nickname{font-size: 16px;}
  152. .user-info .nickname image{width: 15px;}
  153. .info-name{color: $ic-default-text;font-size: 12px;margin-top: 6px;}
  154. .info-qm{padding: 10px;background: #fff;}
  155. .info-qm .label{color:$ic-default-text;font-size: 14px;}
  156. .info-qm .mono{color:$ic-default-text;font-size: 14px;padding: 20px;}
  157. .pannel{background: #fff;padding: 10px;margin-top:10px;}
  158. .pannel .item{padding: 16px 0;border-bottom: 1px solid #f1f1f1;}
  159. .pannel .item:last-child{border-bottom: 0;}
  160. .pannel .item .label{margin-right: 10px}
  161. .pannel .value{color:$ic-default-text}
  162. .btn{background: #fff;padding: 10px;margin-top: 10px;text-align: center;}
  163. </style>