expert-box.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <view class="share-content">
  3. <view class="share-inner">
  4. <view class="share-item" @click="doReport()">
  5. <image src="/static/svg/report_icon.svg" mode=""></image>
  6. <text class="text">举报</text>
  7. </view>
  8. <view class="share-item" @click="doBlock()">
  9. <image src="/static/svg/block_icon.svg" mode=""></image>
  10. <text class="text">{{expertItem.isBlackTalent?"解除拉黑":"拉黑"}}</text>
  11. </view>
  12. </view>
  13. <view class="cancel-btn" @click="closeShare">取消</view>
  14. </view>
  15. </template>
  16. <script>
  17. import { addBlackVideo,addBlackTalent,cancelBlack } from '@/api/expert'
  18. export default {
  19. name: "expert-box",
  20. props: {
  21. expertItem: {
  22. type: Object,
  23. default: function() {
  24. return {
  25. imageUrl: "",
  26. title: "",
  27. url: "",
  28. summary: url,
  29. courseId: 0,
  30. videoId: 0,
  31. talentId:0,
  32. isBlackTalent:false
  33. };
  34. }
  35. },
  36. },
  37. data() {
  38. return {
  39. };
  40. },
  41. methods: {
  42. doReport() {
  43. uni.navigateTo({
  44. url: "/pages/user/feedback?talentId="+this.expertItem.talentId+"&type=2"
  45. });
  46. },
  47. doBlock() {
  48. let that=this;
  49. if(this.expertItem.isBlackTalent){
  50. this.cancelBlackAct();
  51. }else{
  52. uni.showActionSheet({
  53. title:"拉黑后,将屏蔽对方作品",
  54. itemList: ["确定拉黑"],
  55. success: function(res) {
  56. that.doBlockAct();
  57. }
  58. });
  59. }
  60. },
  61. doBlockAct() {
  62. let params={"talentId":this.expertItem.talentId, "type": "1" };
  63. addBlackTalent(params).then(res => {
  64. if (res.code == 200) {
  65. uni.showToast({
  66. title: "操作成功",
  67. icon: 'none'
  68. });
  69. this.$emit('refreshExpert');
  70. }else{
  71. uni.showToast({
  72. title: res.msg,
  73. icon: 'none'
  74. });
  75. }
  76. },
  77. rej => {}
  78. );
  79. },
  80. cancelBlackAct() {
  81. let params={"talentId":this.expertItem.talentId };
  82. cancelBlack(params).then(res => {
  83. if (res.code == 200) {
  84. uni.showToast({
  85. title: "操作成功",
  86. icon: 'none'
  87. });
  88. this.$emit('refreshExpert');
  89. }else{
  90. uni.showToast({
  91. title: res.msg,
  92. icon: 'none'
  93. });
  94. }
  95. },
  96. rej => {}
  97. );
  98. },
  99. closeShare() {
  100. return this.$emit('closeExpert');
  101. },
  102. }
  103. }
  104. </script>
  105. <style lang="scss" scoped>
  106. .share-content {
  107. background-color: #FFF;
  108. border-radius: 40upx 40upx 0px 0px;
  109. .share-inner {
  110. padding: 50upx 0 0 0;
  111. display: flex;
  112. flex-wrap: wrap;
  113. .share-item {
  114. width: 25%;
  115. display: flex;
  116. flex-direction: column;
  117. align-items: center;
  118. justify-content: center;
  119. margin-bottom: 66upx;
  120. image {
  121. width: 80upx;
  122. height: 80upx;
  123. margin-bottom: 20upx;
  124. }
  125. .text {
  126. font-size: 28upx;
  127. font-family: PingFang SC;
  128. font-weight: 500;
  129. color: #111111;
  130. line-height: 1;
  131. }
  132. }
  133. }
  134. .cancel-btn {
  135. height: 96upx;
  136. line-height: 96upx;
  137. text-align: center;
  138. font-size: 32upx;
  139. font-family: PingFang SC;
  140. font-weight: 500;
  141. color: #111111;
  142. border-top: 2upx solid #E8E8E8;
  143. background-color: #FFF;
  144. }
  145. }
  146. </style>