| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- <template>
- <view class="share-content">
- <view class="share-inner">
- <view class="share-item" @click="doReport()">
- <image src="/static/svg/report_icon.svg" mode=""></image>
- <text class="text">举报</text>
- </view>
- <view class="share-item" @click="doBlock()">
- <image src="/static/svg/block_icon.svg" mode=""></image>
- <text class="text">{{expertItem.isBlackTalent?"解除拉黑":"拉黑"}}</text>
- </view>
-
- </view>
- <view class="cancel-btn" @click="closeShare">取消</view>
- </view>
- </template>
- <script>
- import { addBlackVideo,addBlackTalent,cancelBlack } from '@/api/expert'
- export default {
- name: "expert-box",
- props: {
- expertItem: {
- type: Object,
- default: function() {
- return {
- imageUrl: "",
- title: "",
- url: "",
- summary: url,
- courseId: 0,
- videoId: 0,
- talentId:0,
- isBlackTalent:false
- };
- }
- },
- },
- data() {
- return {
-
- };
- },
- methods: {
- doReport() {
- uni.navigateTo({
- url: "/pages/user/feedback?talentId="+this.expertItem.talentId+"&type=2"
- });
- },
- doBlock() {
- let that=this;
- if(this.expertItem.isBlackTalent){
- this.cancelBlackAct();
- }else{
- uni.showActionSheet({
- title:"拉黑后,将屏蔽对方作品",
- itemList: ["确定拉黑"],
- success: function(res) {
- that.doBlockAct();
- }
- });
- }
- },
- doBlockAct() {
- let params={"talentId":this.expertItem.talentId, "type": "1" };
- addBlackTalent(params).then(res => {
- if (res.code == 200) {
- uni.showToast({
- title: "操作成功",
- icon: 'none'
- });
- this.$emit('refreshExpert');
-
- }else{
- uni.showToast({
- title: res.msg,
- icon: 'none'
- });
- }
- },
- rej => {}
- );
- },
- cancelBlackAct() {
- let params={"talentId":this.expertItem.talentId };
- cancelBlack(params).then(res => {
- if (res.code == 200) {
- uni.showToast({
- title: "操作成功",
- icon: 'none'
- });
- this.$emit('refreshExpert');
-
- }else{
- uni.showToast({
- title: res.msg,
- icon: 'none'
- });
- }
- },
- rej => {}
- );
- },
- closeShare() {
- return this.$emit('closeExpert');
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .share-content {
- background-color: #FFF;
- border-radius: 40upx 40upx 0px 0px;
- .share-inner {
- padding: 50upx 0 0 0;
- display: flex;
- flex-wrap: wrap;
- .share-item {
- width: 25%;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- margin-bottom: 66upx;
- image {
- width: 80upx;
- height: 80upx;
- margin-bottom: 20upx;
- }
- .text {
- font-size: 28upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #111111;
- line-height: 1;
- }
- }
- }
-
- .cancel-btn {
- height: 96upx;
- line-height: 96upx;
- text-align: center;
- font-size: 32upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #111111;
- border-top: 2upx solid #E8E8E8;
- background-color: #FFF;
- }
- }
- </style>
|