取一个数组中想要的值,放到一个新的对象里

	//方法:
	let param={};
	param[""]=""

 //例子:
 open_details:function(e){
    var cxid = e.currentTarget.dataset.cxid;
    var detailactivity={};
    var mj_list = this.data.zd_list; 
    for(var a=0;a<mj_list.length;a++){
      if(cxid==mj_list[a].cxid){
        detailactivity["jsrq"] = mj_list[a].jsrq;
        detailactivity["ksrq"] = mj_list[a].ksrq;
        detailactivity["other"] = mj_list[a].cx_goods_custom[0].notes2;
      }
    }
    console.log(detailactivity);
    //打印
    //{jsrq: "2020-07-31 00:00:00", ksrq: "2020-07-27 00:00:00", other: "已满100元,减10元,送1张直送充值券;"}
  },

你可能感兴趣的:(前端)