暑期项目实训记录-9

工作概览:

1、实现当前活动在drawer上的展示

2、实现黑名单列表单个移除功能

3、实现黑名单列表批量移除功能

4、实现批量加入黑名单的功能


工作详情:

1、实现当前活动在drawer上的展示

代码:

//使用后端接口,获取当前可选座的所有活动,得到数组allActivities
      this.$axios.get("http://grandland.gl-data.com:14332/manage/usermanage/getallactlist")//向后端发送get请求
        .then((res) => {
          this.allActivities=res.data;
        })
        .catch((err) => {
          console.log("getallactlist-failed")
        })

实现效果:

2、 实现黑名单列表单个移除功能

实现代码:

delsingle(openid){
        this.singleUser=openid.toString();
        console.log(this.singleUser)
        this.$axios.post("http://grandland.gl-data.com:14332/manage/usermanage/deleteblacklistbyopenid",
          this.$qs.stringify({
            user_openid:this.singleUser
          }),{headers:{'Content-Type':'application/x-www-form-urlencoded'}}
        )//向后端发送post请求
          .then((res) => {
            console.log("接收数据res")
            console.log(res)
          })
          .catch((err) => {
            console.log("delsingle-failed")
          })
      },

实现效果:

3、实现黑名单列表批量移除功能

实现代码:

deleteFromBlack(){//从黑名单中批量删除用户
        for (let i = 0; i < this.multipleSelection.length; i++) {
          this.sz_openid_black[i] = this.multipleSelection[i].user_openid;//sz_openid_black存放选中的用户的openid
        }
        this.formData=this.sz_openid_black
        const _this = this
        this.$axios.post('http://grandland.gl-data.com:14332/manage/usermanage/freeblacklist', this.formData).then(function (resp) {
          _this.$message({
            message: '移除成功!',
            type: 'success'
          });
        })
      },

 实现效果:

 4、实现批量加入黑名单的功能

实现代码:

submitActUser(){      //提交表单

        //获取选择的活动
        for(let i=0;i<this.SelectActivities.length;i++){
          this.temp_formData[i]=this.SelectActivities[i].act_id;
        }
        this.act_formData=this.temp_formData;

        const _this = this
        if(this.radio===1){//选择全部活动
          this.isall='1';
          var parm1={
            act_ids:this.act_formData,
            user_openid:this.formData,
            isall:this.isall
          }
          this.$axios.post('http://grandland.gl-data.com:14332/manage/usermanage/addblacklist',
            parm1).then(function (resp) {
            _this.$message({
              message: '加入黑名单成功!',
              type: 'success'
            });
          })
        }else{//选择部分
          this.isall='0';
          var parm={
            act_ids:this.act_formData,
            user_openid:this.formData,
            isall:this.isall
          }
          this.$axios.post('http://grandland.gl-data.com:14332/manage/usermanage/addblacklist', parm).then(function (resp) {
            _this.$message({
              message: '加入黑名单成功!',
              type: 'success'
            });
          })
        }
      },

实现效果:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值