zoukankan      html  css  js  c++  java
  • 取值传入后端

    数组里面多个对象,取其中对象的某个属性值 传入后端作为提交参数

    首先 v-if="tab_index == 0" v-for="(item, index) in list    data里list: []然后

     @click="pendingConsent(item.id)"

    然后

    // 同意
    pendingConsent(id) {
    console.log(this.list)
    this.consentSubmit(id)
    },

    然后

    // 同意
    consentSubmit(id) {
    uni.showLoading({
    title: "同意中",
    mask: true
    })
    this.http
    .request({
    method: 'GET',
    url: 'center.Pending/pass',
    data: {
    // 请求参数
    apply_id: id
    }
    })
    .then(res => {
    console.log(res);
    uni.hideLoading()
    if (res.data.code == 1) {
    uni.showToast({
    icon: "none",
    title: "同意成功",
    duration: 2000
    });
    } else {
    uni.showToast({
    icon: "none",
    title: res.data.msg,
    duration: 2000
    });
    }
    })
    .catch(e => {
    this.mescroll.endSuccess(0);
    uni.hideLoading()
    });
    },

    即可做到data: {
    // 请求参数
    apply_id: id
    }

    传入给后端

  • 相关阅读:
    Android一些问题
    内存泄漏(Memory Leak)
    内存溢出OOM
    Android面试题集合
    Handler之同步屏障机制(sync barrier)
    IdleHandler 原理浅析
    OkHttp原理
    RxJava操作符
    Android电量优化全解析
    Android内存优化大盘点
  • 原文地址:https://www.cnblogs.com/lilamisu/p/13725418.html
Copyright © 2011-2022 走看看