/// <summary> /// 发布宝贝页面 /// </summary> public void PublishPage(IdleFishActionViewModel idleFishViewModel, WMPoint wmPoint) { var currentViewModel = idleFishViewModel; currentViewModel.XMLName = "publishactivity"; ///分析布局 Action <IdleFishActionViewModel, string, XmlDocument, Action <IdleFishActionViewModel, WMPoint> > func = (model, xmlSelectStr, doc, action) => { ///标题 XmlNode node = doc.SelectSingleNode(xmlSelectStr); var strValue = node.Attributes["bounds"].Value; var returnData = baseAction.GetStartBoundsWithEndBounds <IdleFishActionViewModel>(model, strValue); returnData.CurrentContent = returnData.Title; if (xmlSelectStr.Contains("content")) { returnData.CurrentContent = returnData.Description; } action(returnData, wmPoint); }; baseAction.CreatUIXML <IdleFishActionViewModel>(currentViewModel, (o, doc) => { ///标题 func(o, "//node[@resource-id='com.taobao.idlefish:id/title']", doc, TxtAction); ///描述 func(o, "//node[@resource-id='com.taobao.idlefish:id/content']", doc, TxtAction); ///价格 func(o, "//node[@resource-id='com.taobao.idlefish:id/price']", doc, PriceAction); //分类 func(o, "//node[@resource-id='com.taobao.idlefish:id/cate_name']", doc, CategoryAction); //确认发布按钮 func(o, "//node[@resource-id='com.taobao.idlefish:id/publish_button']", doc, ClickAction); return(o); }); }
/// <summary> /// 通过搜索加好友 /// </summary> /// <param name="viewModel"></param> public void AddFriendWithSearch(WXActionViewModel viewModel, WMPoint wmPoint) { var searchContentList = viewModel.SearchContents; if (null == searchContentList || searchContentList.Count == 0) { return; } ///点击添加朋友 _baseAction.actionDirectStr(viewModel.Device, 700, 100, wmPoint); ///是否进入添加朋友界面 var isSuccess = _baseAction.CircleDetection("AddMoreFriendsUI", viewModel.Device); if (!isSuccess) { return; } //点击搜索框 _baseAction.actionDirectStr(viewModel.Device, 360, 250, wmPoint); ///是否进入搜索界面 isSuccess = _baseAction.CircleDetection("FTSAddFriendUI", viewModel.Device); if (!isSuccess) { return; } foreach (var searchContent in searchContentList) { viewModel.IsGoOn = true; viewModel.XMLName = "DetailUI"; ///检测设备是否处于连接状态 if (_baseAction.CheckEquipmentIsConnecting(viewModel.Device)) { break; } ///清空输入框 _baseAction.actionDirectStr(viewModel.Device, 700, 100, wmPoint); ///输入搜索内容 _baseAction.InitProcessWithTaskState(viewModel.Device, "shell am broadcast -a ADB_INPUT_TEXT --es msg '" + searchContent + "'"); ///点击搜索按钮 _baseAction.actionDirectStr(viewModel.Device, 360, 200, wmPoint); //检测是否进入详细资料 isSuccess = _baseAction.CircleDetection("ContactInfoUI", viewModel.Device); if (!isSuccess) { continue; } viewModel = _baseAction.CreatUIXML(viewModel, (o, doc) => { return(BeforeAddFriendWithValidate(doc, o)); }); FromDetailPageToValidatePage(viewModel, wmPoint: wmPoint); //返回 _baseAction.actionDirectStr(viewModel.Device, 50, 100, wmPoint); } }