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)
}
});
},

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM