/// <summary> /// 打开计划页面 /// </summary> /// <param name="url">The URL.</param> public void GoPlanPage(SyncGoodsList item) { if (!string.IsNullOrEmpty(item.url)) { goods = item; isLoadPlanCompleted = false; planUrl = item.url.Trim(); browser.Load(planUrl); } else { isLoadPlanCompleted = true; //提交完成 SubmitSuccessHandle?.Invoke(false, goods); } }
/// <summary> /// 页面加载完成 /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="FrameLoadEndEventArgs"/> instance containing the event data.</param> private void Browser_FrameLoadEnd(object sender, FrameLoadEndEventArgs e) { log.Debug(e.Url); if (e.Url == LoginUrl) { if (!isLoadCompleted) { isLoadCompleted = true; new Thread(() => { //页面加载完成回调 LoadSuccessHandle?.Invoke(true); }) { IsBackground = true }.Start(); } } //登录成功后的页面 else if (e.Url == LoginSuccessUrl) { HideWindow(); isLoginSuccess = true; if (!isLoginCompleted) { isLoginCompleted = true; new Thread(() => { LoginSuccess(); }) { IsBackground = true }.Start(); } } else if (!string.IsNullOrEmpty(planUrl) && e.Url.Contains(planUrl)) { if (!isLoadPlanCompleted) { isLoadPlanCompleted = true; new Thread(() => { ClickCampaignElement(); }) { IsBackground = true }.Start(); } } else if (e.Url == callback || e.Url.Contains("alisec.alimama.com/deny.html")) { new Thread(() => { //提交完成 SubmitSuccessHandle?.Invoke(true, goods); }) { IsBackground = true }.Start(); } }