/// <summary> /// UU跑腿发送验证码 /// </summary> /// <param name="aId"></param> /// <returns></returns> public ActionResult UUSendPhoneCode(int aId = 0, string phone = "", int storeId = 0) { //参数验证 if (aId <= 0) { _result.msg = "参数错误"; return(Json(_result)); } if (string.IsNullOrWhiteSpace(phone)) { _result.msg = "请输入手机号码"; return(Json(_result)); } UUBaseResult uuResult = UUApi.BindUserApply(phone); if (uuResult != null) { _result.msg = uuResult.return_msg; _result.code = uuResult.return_code == "ok" ? 1 : 0; } else { _result.msg = "uu接口异常"; _result.code = 0; } return(Json(_result)); }
/// <summary> /// 解绑UU跑腿 /// </summary> /// <param name="aId"></param> /// <returns></returns> public ActionResult UUCancelBind(int aId = 0, int storeId = 0, int id = 0) { //参数验证 if (aId <= 0 || id <= 0) { _result.msg = "参数错误"; return(Json(_result)); } UUCustomerRelation model = UUCustomerRelationBLL.SingleModel.GetModel(id); if (model == null) { _result.msg = "请刷新重试"; return(Json(_result)); } if (model.AId != aId || model.StoreId != storeId) { _result.msg = "无效权限"; return(Json(_result)); } UUBaseResult uuResult = UUApi.CancelBind(model.OpenId); if (uuResult != null) { _result.msg = uuResult.return_msg; if (uuResult.return_code == "ok") { model.State = -1; UUCustomerRelationBLL.SingleModel.Update(model, "state"); _result.code = 1; } } else { _result.msg = "uu接口异常"; _result.code = 0; } return(Json(_result)); }
/// <summary> /// UU跑腿配置 /// </summary> /// <returns></returns> public ActionResult UUPeiSongConfig(int aId = 0, string act = "", int storeId = 0, UUCustomerRelation model = null) { //参数验证 if (aId <= 0) { _result.msg = "参数错误"; return(Json(_result)); } //显示 if (string.IsNullOrEmpty(act)) { EditModel <UUCustomerRelation> em = new EditModel <UUCustomerRelation>(); em.appId = aId; em.storeId = storeId; em.aId = aId; UUCustomerRelation storemodel = UUCustomerRelationBLL.SingleModel.GetModelByAid(aId, storeId, 0); if (storemodel == null) { storemodel = new UUCustomerRelation(); } em.DataModel = storemodel; return(View(em)); } else { if (act == "edit") { if (model == null) { _result.msg = "参数出错"; return(Json(_result)); } if (string.IsNullOrEmpty(model.Phone)) { _result.msg = "请输入商户手机号"; return(Json(_result)); } if (string.IsNullOrEmpty(model.PhoneCode)) { _result.msg = "请输入验证码"; return(Json(_result)); } UUBaseResult result = UUApi.BindUserSubmit(model.Phone, model.PhoneCode, model.CityName, model.CountyName); if (result != null && result.return_code == "ok" && !string.IsNullOrEmpty(result.openid)) { model.OpenId = result.openid; model.UpdateTime = DateTime.Now; if (model.Id <= 0) { model.State = 0; model.AId = aId; model.StoreId = storeId; model.AddTime = DateTime.Now; UUCustomerRelationBLL.SingleModel.Add(model); } else { UUCustomerRelationBLL.SingleModel.Update(model); } _result.msg = "注册成功"; _result.code = 1; } } } return(Json(_result)); }