module.exports = {
    handleRes(res) {
        wx.showToast({
            title: res.msg != '成功' ? res.msg : '保存成功',
            icon: "none",
            mask: true
        })
        if (res.msg == '成功') setTimeout(() => {
            let page = getCurrentPages()[getCurrentPages().length - 2];
            if (page.__route__ == 'packageA/contract/detail') {
                page.getDetail();
                wx.navigateBack();
            } else {
                wx.redirectTo({
                    url: `/packageA/contract/detail?id=${res.data.sa_contractid}`,
                });
            }

            let page1 = getCurrentPages().find(v => v.__route__ == 'packageA/project/detail');
            if (page1) {
                let p = page1.selectComponent("#Contract");
                if (p) p.getList(p.data.sa_projectid, true);
            }
        }, 500)
    }
}