Пример #1
0
        /// <summary>
        /// 获取购物车商品列表
        /// </summary>
        /// <param name="memberId">用户Id</param>
        /// <returns></returns>
        public async Task <CartItemListRD> GetCartItemList(string memberId)
        {
            string url  = "/member/cartList";
            string json = "{\"userId\":" + memberId + "}";

            CartItemListRD cartItemListRD = await RestSharpHelper <CartItemListRD> .PostAsync(url, json);

            return(cartItemListRD);
        }
Пример #2
0
        /// <summary>
        /// 验证码登录
        /// </summary>
        /// <param name="loginPara"></param>
        /// <returns></returns>
        public async Task <LoginRD> LoginByAuthCode(LoginPara loginPara)
        {
            string url  = "/member/loginByAuthCode";
            var    json = JsonConvert.SerializeObject(loginPara);

            LoginRD loginRD = await RestSharpHelper <LoginRD> .PostAsync(url, json);

            return(loginRD);
        }
Пример #3
0
        /// <summary>
        /// 取消订单
        /// </summary>
        /// <param name="orderDetail"></param>
        /// <returns></returns>
        public async Task <SimpleRD> CancelOrder(OrderDetail orderDetail)
        {
            string url  = "/member/cancelOrder";
            string json = JsonConvert.SerializeObject(orderDetail);  //序列化

            SimpleRD simpleRD = await RestSharpHelper <SimpleRD> .PostAsync(url, json);

            return(simpleRD);
        }
Пример #4
0
        /// <summary>
        /// 注册 ok
        /// </summary>
        /// <param name="registerPara"></param>
        /// <returns></returns>
        public async Task <SimpleRD> Register(RegisterPara registerPara)
        {
            string url  = "/member/registerByInvite";
            var    json = JsonConvert.SerializeObject(registerPara);

            SimpleRD simpleRD = await RestSharpHelper <SimpleRD> .PostAsync(url, json);

            return(simpleRD);
        }
Пример #5
0
        /// <summary>
        /// 修改收获地址
        /// </summary>
        /// <param name="addressInfo"></param>
        /// <returns></returns>
        public async Task <SimpleRD> UpdateAddress(AddressInfo addressInfo)
        {
            string url  = "/member/updateAddress";
            string json = JsonConvert.SerializeObject(addressInfo);

            SimpleRD simpleRD = await RestSharpHelper <SimpleRD> .PostAsync(url, json);

            return(simpleRD);
        }
Пример #6
0
        /// <summary>
        /// 删除收货地址
        /// </summary>
        /// <param name="addressInfo"></param>
        /// <returns></returns>
        public async Task <SimpleRD> DeleteAddressById(long addressId)
        {
            string url  = "/member/delAddress";
            string json = "{\"addressId\":" + addressId + "}";

            SimpleRD simpleRD = await RestSharpHelper <SimpleRD> .PostAsync(url, json);

            return(simpleRD);
        }
Пример #7
0
        /// <summary>
        /// 忘记密码、重置密码
        /// </summary>
        /// <param name="resetPwdPara"></param>
        /// <returns></returns>
        public async Task <SimpleRD> ResetPwd(ResetPwdPara resetPwdPara)
        {
            string url  = "/User/resetPwd";
            var    json = JsonConvert.SerializeObject(resetPwdPara);

            SimpleRD simpleRD = await RestSharpHelper <SimpleRD> .PostAsync(url, json);

            return(simpleRD);
        }
Пример #8
0
        /// <summary>
        /// 获取收货地址列表
        /// </summary>
        /// <param name="memberId"></param>
        /// <returns></returns>
        public async Task <AddressRD> GetAddressListById(string memberId)
        {
            string url  = "/member/addressList";
            string json = "{\"userId\":" + memberId + "}";

            AddressRD addressRD = await RestSharpHelper <AddressRD> .PostAsync(url, json);

            return(addressRD);
        }
Пример #9
0
        public async Task <SimpleRD> AddToCart(string memberId, string productId, string num, string attributeValue)
        {
            string url  = "/member/addCart";
            string json = "{\"userId\":" + memberId + ", \"productId\":" + productId + ", \"productNum\":" + num + ", \"attributesValues\":\"" + attributeValue + "\"}";

            SimpleRD simpleRD = await RestSharpHelper <SimpleRD> .PostAsync(url, json);

            return(simpleRD);
        }
Пример #10
0
        public async Task <StupidRD> DeleteItemInCart(CartItemInfo cartItemInfo)
        {
            string url  = "/member/cartDel";
            string json = "{\"userId\":" + GlobalVariables.LoggedUser.id
                          + ",\"checked\":\"" + cartItemInfo.Checked
                          + "\",\"productId\":" + cartItemInfo.productId
                          + ",\"attributesValues\":\"" + cartItemInfo.attributesValues
                          + "\"}";

            StupidRD stupidRD = await RestSharpHelper <StupidRD> .PostAsync(url, json);

            return(stupidRD);
        }
Пример #11
0
        /// <summary>
        /// 获取购物车商品列表
        /// </summary>
        /// <param name="memberId">用户Id</param>
        /// <returns></returns>
        public static async Task <CartItemListRD> GetCartItemList(string memberId)
        {
            try
            {
                string url  = "/member/cartList";
                string json = "{\"userId\":" + memberId + "}";

                CartItemListRD cartItemListRD = await RestSharpHelper <CartItemListRD> .PostAsync(url, json);

                return(cartItemListRD);
            }
            catch (ApplicationException ex)
            {
                throw ex;
            }
        }
Пример #12
0
        /// <summary>
        /// 修改用户信息
        /// </summary>
        /// <param name="updateUserPara"></param>
        /// <returns></returns>
        public static async Task <SimpleRD> UpdateUserInfo(UpdateUserPara updateUserPara)
        {
            try
            {
                string url  = "/member/updateInfo";
                var    json = JsonConvert.SerializeObject(updateUserPara);

                SimpleRD simpleRD = await RestSharpHelper <SimpleRD> .PostAsync(url, json);

                return(simpleRD);
            }
            catch (ApplicationException ex)
            {
                throw ex;
            }
        }
Пример #13
0
        /// <summary>
        /// openid注册
        /// </summary>
        /// <param name="registerPara"></param>
        /// <returns></returns>
        public static async Task <SimpleRD> RegisterByOpenId(RegisterByOpenIdPara registerByOpenIdPara)
        {
            try
            {
                string url  = "/member/registerByOpenId";
                var    json = JsonConvert.SerializeObject(registerByOpenIdPara);

                SimpleRD simpleRD = await RestSharpHelper <SimpleRD> .PostAsync(url, json);

                return(simpleRD);
            }
            catch (ApplicationException ex)
            {
                throw ex;
            }
        }
Пример #14
0
        /// <summary>
        /// 取消订单
        /// </summary>
        /// <param name="orderDetail"></param>
        /// <returns></returns>
        public static async Task <SimpleRD> CancelOrder(OrderDetail orderDetail)
        {
            try
            {
                string url  = "/member/cancelOrder";
                string json = JsonConvert.SerializeObject(orderDetail);  //序列化

                SimpleRD simpleRD = await RestSharpHelper <SimpleRD> .PostAsync(url, json);

                return(simpleRD);
            }
            catch (ApplicationException ex)
            {
                throw ex;
            }
        }
Пример #15
0
        /// <summary>
        /// 删除收货地址
        /// </summary>
        /// <param name="addressInfo"></param>
        /// <returns></returns>
        public static async Task <SimpleRD> DeleteAddressById(long addressId)
        {
            try
            {
                string url  = "/member/delAddress";
                string json = "{\"addressId\":" + addressId + "}";

                SimpleRD simpleRD = await RestSharpHelper <SimpleRD> .PostAsync(url, json);

                return(simpleRD);
            }
            catch (ApplicationException ex)
            {
                throw ex;
            }
        }
Пример #16
0
        /// <summary>
        /// 修改收获地址
        /// </summary>
        /// <param name="addressInfo"></param>
        /// <returns></returns>
        public static async Task <SimpleRD> UpdateAddress(AddressInfo addressInfo)
        {
            try
            {
                string url  = "/member/updateAddress";
                string json = JsonConvert.SerializeObject(addressInfo);

                SimpleRD simpleRD = await RestSharpHelper <SimpleRD> .PostAsync(url, json);

                return(simpleRD);
            }
            catch (ApplicationException ex)
            {
                throw ex;
            }
        }
Пример #17
0
        /// <summary>
        /// 获取收货地址列表
        /// </summary>
        /// <param name="memberId"></param>
        /// <returns></returns>
        public static async Task <AddressRD> GetAddressListById(string memberId)
        {
            try
            {
                string url  = "/member/addressList";
                string json = "{\"userId\":" + memberId + "}";

                AddressRD addressRD = await RestSharpHelper <AddressRD> .PostAsync(url, json);

                return(addressRD);
            }
            catch (ApplicationException ex)
            {
                throw ex;
            }
        }
Пример #18
0
        /// <summary>
        /// 验证码登录
        /// </summary>
        /// <param name="loginPara"></param>
        /// <returns></returns>
        public static async Task <LoginRD> LoginByAuthCode(LoginPara loginPara)
        {
            try
            {
                string url  = "/member/loginByAuthCode";
                var    json = JsonConvert.SerializeObject(loginPara);

                LoginRD loginRD = await RestSharpHelper <LoginRD> .PostAsync(url, json);

                return(loginRD);
            }
            catch (ApplicationException ex)
            {
                throw ex;
            }
        }
Пример #19
0
        /// <summary>
        /// 修改用户信息
        /// </summary>
        /// <param name="updateUserPara"></param>
        /// <returns></returns>
        public static async Task <SimpleRD> UploadImage(string imgData)
        {
            try
            {
                string url  = "/member/imageUpload";
                var    json = "{\"imgData\":\"" + imgData + "\",\"userId\":\"" + GlobalVariables.LoggedUser.id + "\"}";

                SimpleRD simpleRD = await RestSharpHelper <SimpleRD> .PostAsync(url, json);

                return(simpleRD);
            }
            catch (ApplicationException ex)
            {
                throw ex;
            }
        }