call.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <view class="call-box" @click.stop="sayHi">
  3. <view class="call-icon">
  4. <image class="call-img" src="/static/img/circle/Group-100243@2x.png" mode="aspectFill"></image>
  5. </view>
  6. <view class="call-text sys-weight-600 sys-color-black">打招呼</view>
  7. </view>
  8. </template>
  9. <script>
  10. import {sayHi} from "@/api/utility";
  11. import tools from "@/service/tools";
  12. export default {
  13. name: "call",
  14. components: {},
  15. props: {
  16. userId:{
  17. default:''
  18. }
  19. },
  20. data() {
  21. return {
  22. isAjax:false
  23. }
  24. },
  25. watch: {},
  26. mounted() {
  27. },
  28. methods: {
  29. sayHi(){
  30. if(this.isAjax){
  31. return false
  32. }
  33. this.isAjax=true
  34. sayHi(this.userId).then((res)=>{
  35. this.isAjax=false
  36. if(res.code===0){
  37. tools.success('打招呼成功')
  38. }else {
  39. tools.error(res.msg)
  40. }
  41. })
  42. }
  43. }
  44. }
  45. </script>
  46. <style scoped lang="scss">
  47. .call-box{
  48. height: 40rpx;
  49. border-radius: 200rpx;
  50. border: 2rpx solid #141414;
  51. padding: 4rpx 16rpx;
  52. display: flex;
  53. justify-content: space-between;
  54. .call-img{
  55. width: 40rpx;
  56. height: 40rpx;
  57. margin-right: 8rpx;
  58. }
  59. .call-text{
  60. font-size: 28rpx;
  61. line-height: 40rpx;
  62. }
  63. }
  64. </style>