uniapp 新增数据跳转后刷新页面

// 新增页面

this.$u.post('/Reporting/GhtPersonSign/UpdateExamine', this.formPersonnel).then(res => {
  if (res.errcode == 0) {
    const eventChannel = this.getOpenerEventChannel();
    eventChannel.emit('reloadPersonnels');

    uni.showToast({
      title: '审核绑定成功',
      icon: 'success',
      mask: true,
      success: () => {
        setTimeout(function() {
          console.log('审核ok');
          uni.navigateBack(); //返回上一页
        }, 1000);
      }
    });
  } else {
    this.$u.toast(res.errmsg);
  }
});

 

// 查询页面

audit_binding(uid) {
  let that = this;
  this.$u.post('/Reporting/Common/BindTask',{ uid:uid,type:6,flag:1 }).then(res => {
    if(res.errcode == 0){
      uni.navigateTo({
        url: '/pages/toexamine/personnel_audit_binding',
        events: {
        // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
        reloadPersonnels: function(data){
          that.reloadList();
          uni.$emit('refreshUnVerify_IndexManage')
        }
    },
    success: function(res) {
    // 通过eventChannel向被打开页面传送数据
      res.eventChannel.emit('acceptDataFromOpenerPage', { uid: uid });
    }
  });
}else{
  this.$u.toast(res.errmsg)
}
});
},

 

posted @ 2022-04-01 10:40  QQc198  阅读(1391)  评论(0)    收藏  举报