feat: There is no way the,  56904 问答库-订阅 程序异常 api/lawss/Subscription/insertSubscription 这个接口 , 添加 取消订阅功能

This commit is contained in:
396572590@qq.com
2022-08-04 16:08:25 +08:00
parent dcd11dfb65
commit ef1b19b1a4
@@ -59,7 +59,8 @@
<i class="iconfont">&#xe61e;</i>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="[scope.row, '查看']">查看</el-dropdown-item>
<el-dropdown-item :command="[scope.row, '订阅']">订阅</el-dropdown-item>
<el-dropdown-item v-if="!scope.row.subState || scope.row.subState === 'n'" :command="[scope.row, '订阅']">订阅</el-dropdown-item>
<el-dropdown-item v-if="scope.row.subState === 'y'" :command="[scope.row, '取消订阅']">取消订阅</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
@@ -673,7 +674,10 @@ export default {
this.handleDetail(command[0])
break
case '订阅':
this.subscribe(command[0])
this.subscribe(command[0],'y')
break
case '取消订阅':
this.subscribe(command[0],'n')
break
}
},
@@ -690,14 +694,15 @@ export default {
}, e => {
})
},
subscribe(row){
subscribe(row,subState){
this.$http.postData('lawss/Subscription/insertSubscription',{
askId: row.id,
usId: this.$store.getters.userInfo.userId,
subState: subState,
},{
_this: this
}, res => {
console.log(res);
row.subState = subState
})
},
refreshStandMap(){