diff --git a/Host/Views.Mobile/Product/Index.cshtml b/Host/Views.Mobile/Product/Index.cshtml index f5107cf..87e7d9c 100644 --- a/Host/Views.Mobile/Product/Index.cshtml +++ b/Host/Views.Mobile/Product/Index.cshtml @@ -33,9 +33,17 @@ @@ -74,18 +82,49 @@ } else { - -
-
-

@package.Name

-

@(package.DayPrice)元/天

-

@package.Profile

+ @if(package.Id == 86){ +
+
+
+

@package.Name 送1月

+

@(Math.Round(package.Price/package.DayCount,2))元/天

+

@package.Profile

+
+
+

¥@package.Price

+
-
- + + + + } else { + +
+
+

@package.Name

+

@(Math.Round(package.Price/package.DayCount,2))元/天

+

@package.Profile

+
+
+

¥@package.Price

+
+
+
+ } } }
diff --git a/Host/Views.Mobile/Product/ReBuyIndex.cshtml b/Host/Views.Mobile/Product/ReBuyIndex.cshtml index 55a7146..a9733ef 100644 --- a/Host/Views.Mobile/Product/ReBuyIndex.cshtml +++ b/Host/Views.Mobile/Product/ReBuyIndex.cshtml @@ -41,18 +41,46 @@ @foreach (var package in Model.Packages.Where(m=>m.IsTest==0&&m.Status==1)) { - -
-
diff --git a/Host/Views/Product/Index.cshtml b/Host/Views/Product/Index.cshtml index a7b4e15..e4d792d 100644 --- a/Host/Views/Product/Index.cshtml +++ b/Host/Views/Product/Index.cshtml @@ -122,6 +122,64 @@ .mtop { margin-top:30px; } + .packageitem86{ + position: relative; + } + .packageitem86::before { + position: absolute; + top: 0.3rem; + left: -0.5rem; + z-index: 1; + padding-right: 0.625rem; + font-weight: bold; + line-height: 0px; + color: white; + height: 0px; + border: 1.0rem solid #f64e3d; + border-right-color: transparent; + content: "免费送一个月"; + box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000; + } + + .packageitem86::after { + content: ""; + position: absolute; + top: 2.1875rem; + left: -0.5rem; + border: 0.25rem solid #f64e3d; + border-left-color: transparent; + border-bottom-color: transparent; + } + + .packageitem19{ + position: relative; + } + .packageitem19::before { + position: absolute; + top: 0.3rem; + left: -0.5rem; + z-index: 1; + padding-right: 0.625rem; + font-weight: bold; + line-height: 0px; + color: white; + height: 0px; + border: 1.0rem solid #f64e3d; + border-right-color: transparent; + content: "免费送十天"; + box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000; + } + + .packageitem19::after { + content: ""; + position: absolute; + top: 2.1875rem; + left: -0.5rem; + border: 0.25rem solid #f64e3d; + border-left-color: transparent; + border-bottom-color: transparent; + } +
@@ -135,7 +193,11 @@ @@ -177,21 +239,54 @@
+ @if(item.Product.Id == 5){ +

新开账号或续费,1个月赠送10天,2个月赠送1个月,(每个账号限参加一次,活动截止时间2020年11月25日)

+ } + @*

@item.Product.Name

*@
@foreach (var package in item.Packages.Where(m => m.IsTest == 0 && m.Status == 1)) { -
+ @if(package.Id == 86){ + +
-

@package.Price

-

原价:@package.LinePrice

-

@(Math.Round(package.Price/package.DayCount,2))元/天

-
-

@package.Name

-

@package.Profile

-
- -
+

@package.Price

+

原价:@package.LinePrice

+

@(Math.Round(package.Price/package.DayCount,2))元/天

+
+

@package.Name

+

@package.Profile

+
+ +
+ } else if(package.Id == 19) { +
+ +

@package.Price

+

原价:@package.LinePrice

+

@(Math.Round(package.Price/package.DayCount,2))元/天

+
+

@package.Name

+

@package.Profile

+
+ +
+ + } else { + +
+ +

@package.Price

+

原价:@package.LinePrice

+

@(Math.Round(package.Price/package.DayCount,2))元/天

+
+

@package.Name

+

@package.Profile

+
+ +
+ } }
diff --git a/Host/Views/Product/ReBuyIndex.cshtml b/Host/Views/Product/ReBuyIndex.cshtml index e868c32..ebe5439 100644 --- a/Host/Views/Product/ReBuyIndex.cshtml +++ b/Host/Views/Product/ReBuyIndex.cshtml @@ -37,6 +37,64 @@ color: red; font-weight: bold; } + .packageitem86{ + position: relative; + } + .packageitem86::before { + position: absolute; + top: 0.3rem; + left: -0.5rem; + z-index: 1; + padding-right: 0.625rem; + font-weight: bold; + line-height: 0px; + color: white; + height: 0px; + border: 1.0rem solid #f64e3d; + border-right-color: transparent; + content: "免费送一个月"; + box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000; + } + + .packageitem86::after { + content: ""; + position: absolute; + top: 2.1875rem; + left: -0.5rem; + border: 0.25rem solid #f64e3d; + border-left-color: transparent; + border-bottom-color: transparent; + } + + .packageitem19{ + position: relative; + } + .packageitem19::before { + position: absolute; + top: 0.3rem; + left: -0.5rem; + z-index: 1; + padding-right: 0.625rem; + font-weight: bold; + line-height: 0px; + color: white; + height: 0px; + border: 1.0rem solid #f64e3d; + border-right-color: transparent; + content: "免费送十天"; + box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000; + } + + .packageitem19::after { + content: ""; + position: absolute; + top: 2.1875rem; + left: -0.5rem; + border: 0.25rem solid #f64e3d; + border-left-color: transparent; + border-bottom-color: transparent; + } +
@@ -63,10 +121,54 @@
+ @if(defaultProduct.Id == 5){ +

新开账号或续费,1个月赠送10天,2个月赠送1个月,(每个账号限参加一次,活动截止时间2020年11月25日)

+ }
@foreach (var package in Model.Packages.Where(m => m.IsTest == 0 && m.Status == 1)) { -
+ @if(package.Id == 86){ + +
+ +

@package.Price

+

原价:@package.LinePrice

+

@(Math.Round(package.Price/package.DayCount,2))元/天

+
+

@package.Name

+

@package.Profile

+
+ +
+ } else if(package.Id == 19) { +
+ +

@package.Price

+

原价:@package.LinePrice

+

@(Math.Round(package.Price/package.DayCount,2))元/天

+
+

@package.Name

+

@package.Profile

+
+ +
+ + } else { + +
+ +

@package.Price

+

原价:@package.LinePrice

+

@(Math.Round(package.Price/package.DayCount,2))元/天

+
+

@package.Name

+

@package.Profile

+
+ +
+ } + } + @*

@package.Price

原价:@package.LinePrice

@@ -76,7 +178,7 @@

@package.Profile

-
+
*@ }
diff --git a/Services/Hncore.Pass.Vpn/Service/AgentClient1Service.cs b/Services/Hncore.Pass.Vpn/Service/AgentClient1Service.cs index 68ec76b..59ed0be 100644 --- a/Services/Hncore.Pass.Vpn/Service/AgentClient1Service.cs +++ b/Services/Hncore.Pass.Vpn/Service/AgentClient1Service.cs @@ -187,7 +187,7 @@ namespace Hncore.Pass.Vpn.Service /// /// /// - public override async Task NewReAccount(string packageKey, string account, int connCount) + public override async Task NewReAccount(string packageKey, string account, int connCount, int payCount = 1) { var client = CreateHttpClient(); var map = new Dictionary(){ diff --git a/Services/Hncore.Pass.Vpn/Service/AgentClient2Service.cs b/Services/Hncore.Pass.Vpn/Service/AgentClient2Service.cs index e0d8182..b238b61 100644 --- a/Services/Hncore.Pass.Vpn/Service/AgentClient2Service.cs +++ b/Services/Hncore.Pass.Vpn/Service/AgentClient2Service.cs @@ -236,7 +236,7 @@ namespace Hncore.Pass.Vpn.Service /// /// /// - public override async Task NewReAccount(string packageKey,string account, int connCount) + public override async Task NewReAccount(string packageKey,string account, int connCount, int payCount = 1) { var client = CreateHttpClient(); Dictionary priceMap = new Dictionary() diff --git a/Services/Hncore.Pass.Vpn/Service/AgentClient3Service.cs b/Services/Hncore.Pass.Vpn/Service/AgentClient3Service.cs index 61eebcc..e2074dc 100644 --- a/Services/Hncore.Pass.Vpn/Service/AgentClient3Service.cs +++ b/Services/Hncore.Pass.Vpn/Service/AgentClient3Service.cs @@ -102,6 +102,12 @@ namespace Hncore.Pass.Vpn.Service return await NewTestAccount(account, pwd); } var client = CreateHttpClient(); + //user: ceshiyiha + // passwd: ceshiyiha + // conn_max: 1 + // type: m + // paynum: 2 + // details: ce var map = new Dictionary(){ {"user",account }, {"passwd",pwd }, @@ -215,13 +221,13 @@ namespace Hncore.Pass.Vpn.Service /// /// /// - public override async Task NewReAccount(string packageKey, string account, int connCount) + public override async Task NewReAccount(string packageKey, string account, int connCount, int payCount = 1) { var client = CreateHttpClient(); var map = new Dictionary(){ {"user",account }, {"type",packageKey }, - {"paynum","1"}, + {"paynum",payCount.ToString()}, }; var title = GetOpTitle("NewReAccount", account); LogHelper.Info(title, map.ToJson()); diff --git a/Services/Hncore.Pass.Vpn/Service/AgentClient4Service.cs b/Services/Hncore.Pass.Vpn/Service/AgentClient4Service.cs index 839af6d..8331b37 100644 --- a/Services/Hncore.Pass.Vpn/Service/AgentClient4Service.cs +++ b/Services/Hncore.Pass.Vpn/Service/AgentClient4Service.cs @@ -192,7 +192,7 @@ namespace Hncore.Pass.Vpn.Service /// /// /// - public override async Task NewReAccount(string packageKey, string account, int connCount) + public override async Task NewReAccount(string packageKey, string account, int connCount, int payCount = 1) { var client = CreateHttpClient(); var map = new Dictionary(){ diff --git a/Services/Hncore.Pass.Vpn/Service/AgentClient6Service.cs b/Services/Hncore.Pass.Vpn/Service/AgentClient6Service.cs index 6f61ad9..46f2c08 100644 --- a/Services/Hncore.Pass.Vpn/Service/AgentClient6Service.cs +++ b/Services/Hncore.Pass.Vpn/Service/AgentClient6Service.cs @@ -296,7 +296,7 @@ namespace Hncore.Pass.Vpn.Service /// /// /// - public override async Task NewReAccount(string packageKey, string account, int connCount) + public override async Task NewReAccount(string packageKey, string account, int connCount, int payCount = 1) { var ret = await this.GetAccountInfo(account); if (ret.Code != ResultCode.C_SUCCESS|| ret.Data==null) diff --git a/Services/Hncore.Pass.Vpn/Service/AgentClient7Service.cs b/Services/Hncore.Pass.Vpn/Service/AgentClient7Service.cs index f954566..8ad3d1a 100644 --- a/Services/Hncore.Pass.Vpn/Service/AgentClient7Service.cs +++ b/Services/Hncore.Pass.Vpn/Service/AgentClient7Service.cs @@ -224,7 +224,7 @@ namespace Hncore.Pass.Vpn.Service /// 原始的账号的id /// /// - public override async Task NewReAccount(string packageKey, string id, int connCount) + public override async Task NewReAccount(string packageKey, string id, int connCount, int payCount = 1) { var ret = await this.GetAccountInfo(id); if (ret.Code != ResultCode.C_SUCCESS|| ret.Data==null) diff --git a/Services/Hncore.Pass.Vpn/Service/AgentClientBaseService.cs b/Services/Hncore.Pass.Vpn/Service/AgentClientBaseService.cs index d5557d4..baaa79e 100644 --- a/Services/Hncore.Pass.Vpn/Service/AgentClientBaseService.cs +++ b/Services/Hncore.Pass.Vpn/Service/AgentClientBaseService.cs @@ -145,7 +145,7 @@ namespace Hncore.Pass.Vpn.Service /// /// /// - public virtual async Task NewReAccount(string packageKey,string account,int connCount) + public virtual async Task NewReAccount(string packageKey,string account,int connCount, int payCount = 1) { return new ApiResult(); } diff --git a/Services/Hncore.Pass.Vpn/Service/AgentService.cs b/Services/Hncore.Pass.Vpn/Service/AgentService.cs index 411a516..5d09454 100644 --- a/Services/Hncore.Pass.Vpn/Service/AgentService.cs +++ b/Services/Hncore.Pass.Vpn/Service/AgentService.cs @@ -180,7 +180,7 @@ namespace Hncore.Pass.Vpn.Service /// /// /// - public virtual async Task NewAccount(int orderId, int packageId, string account, string pwd, int connCount = 1, int accountType = 1) + public virtual async Task NewAccount(int orderId, int packageId, string account, string pwd, int connCount = 1, int accountType = 1,int payCount = 1) { ApiResult flagResult = new ApiResult(ResultCode.C_SUCCESS); var package = await m_ProductPackageService.GetById(packageId); @@ -190,7 +190,7 @@ namespace Hncore.Pass.Vpn.Service if (package.PackageType == PackageType.Base) { - var ret = await agent.NewAccount(package.OriginKey, account, pwd, connCount, accountType); + var ret = await agent.NewAccount(package.OriginKey, account, pwd, connCount, accountType,payCount); //var ret = new ApiResult(ResultCode.C_INVALID_ERROR); var status = ret.Code == ResultCode.C_SUCCESS ? ChargeStatus.Ok : ChargeStatus.Faild; await m_AccountChargeService.RecordNew(package, orderId, product.GroupNO, account, pwd, accountType, connCount, status); @@ -206,7 +206,7 @@ namespace Hncore.Pass.Vpn.Service firstPackage.Count--; basePackages.Insert(0, firstPackage); } - var ret = await agent.NewAccount(firstPackage.Package.OriginKey, account, pwd, connCount, accountType); + var ret = await agent.NewAccount(firstPackage.Package.OriginKey, account, pwd, connCount, accountType,payCount); //var ret = new ApiResult(ResultCode.C_INVALID_ERROR); var status = ret.Code == ResultCode.C_SUCCESS ? ChargeStatus.Ok : ChargeStatus.Faild; await m_AccountChargeService.RecordNew(firstPackage.Package, orderId, product.GroupNO, account, pwd, accountType, connCount, status); @@ -238,7 +238,7 @@ namespace Hncore.Pass.Vpn.Service /// /// /// - public virtual async Task ReNewAccount(int orderId, int packageId, string account, int connCount) + public virtual async Task ReNewAccount(int orderId, int packageId, string account, int connCount,int payCount = 1) { var package = await m_ProductPackageService.GetById(packageId); var product = await m_ProductService.GetById(package.ProductId); @@ -253,7 +253,7 @@ namespace Hncore.Pass.Vpn.Service ApiResult flagResult = new ApiResult(ResultCode.C_SUCCESS); if (package.PackageType == PackageType.Base) { - var ret = await agent.NewReAccount(package.OriginKey, account, connCount); + var ret = await agent.NewReAccount(package.OriginKey, account, connCount,payCount); // var ret = new ApiResult(ResultCode.C_INVALID_ERROR); var status = ret.Code == ResultCode.C_SUCCESS ? ChargeStatus.Ok : ChargeStatus.Faild; await m_AccountChargeService.RecordReNew(package, orderId, product.GroupNO, account, connCount, status); @@ -266,7 +266,7 @@ namespace Hncore.Pass.Vpn.Service { for (var j = 0; j < basePackage.Count; j++) { - var ret = await agent.NewReAccount(basePackage.Package.OriginKey, account, connCount); + var ret = await agent.NewReAccount(basePackage.Package.OriginKey, account, connCount,payCount); //var ret = new ApiResult(ResultCode.C_INVALID_ERROR); var status = ret.Code == ResultCode.C_SUCCESS ? ChargeStatus.Ok : ChargeStatus.Faild; await m_AccountChargeService.RecordReNew(basePackage.Package, orderId, product.GroupNO, account, connCount, status); diff --git a/Services/Hncore.Pass.Vpn/Service/ProductAccountService.cs b/Services/Hncore.Pass.Vpn/Service/ProductAccountService.cs index 0ac105e..886bd71 100644 --- a/Services/Hncore.Pass.Vpn/Service/ProductAccountService.cs +++ b/Services/Hncore.Pass.Vpn/Service/ProductAccountService.cs @@ -51,6 +51,17 @@ namespace Hncore.Pass.Vpn.Service return false; } + //检查参加活动账号是否已经存在 + public async Task CheckMonthAccountExist(string account) + { + var flag = this.Exist(m => m.Account == account && m.PackageId == 86); + if (flag) + { + return true; + } + + return false; + } public bool CheckUserAccountExist(int product, List accouts, int userId) { return this.Exist(m => accouts.Contains(m.Account) && m.UserId == userId); diff --git a/Services/Hncore.Pass.Vpn/Service/ProductOrderService.cs b/Services/Hncore.Pass.Vpn/Service/ProductOrderService.cs index 7e1c97d..bde4bde 100644 --- a/Services/Hncore.Pass.Vpn/Service/ProductOrderService.cs +++ b/Services/Hncore.Pass.Vpn/Service/ProductOrderService.cs @@ -250,6 +250,10 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel, { order.OrderAmount = price * request.ConnectCount; order.Accounts = request.Account; + var isExit = await m_ProductAccountService.CheckMonthAccountExist(request.Account); + if(isExit){ + return new ApiResult(ResultCode.C_INVALID_ERROR, request.Account + "此IP账号已享受该优惠套餐,无法再次购买,若要购买此优惠套餐,请新开或续费其他账号。"); + } } if (request.OrderType == OrderType.News) @@ -267,6 +271,13 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel, order.OrderAmount = price * request.ConnectCount * count; order.Accounts = request.Account; } + foreach (var account in order.Accounts.Split(",").ToList()) + { + var isExit = await m_ProductAccountService.CheckMonthAccountExist(account); + if(isExit){ + return new ApiResult(ResultCode.C_INVALID_ERROR, account + "此IP账号已享受该优惠套餐,无法再次购买,若要购买此优惠套餐,请新开或续费其他账号。"); + } + } await CheckRequest(order); @@ -518,7 +529,13 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel, var accountError = ""; await accountEntitys.ForEachAsync(async accountEntity => { - var ret = await m_AgentService.NewAccount(order.Id, accountEntity.PackageId.Value, accountEntity.Account, accountEntity.Pwd, accountEntity.ConnectCount); + var ret = new ApiResult(); + if(accountEntity.PackageId.Value == 86){ + ret = await m_AgentService.NewAccount(order.Id, accountEntity.PackageId.Value, accountEntity.Account, accountEntity.Pwd, accountEntity.ConnectCount,1,2); + } else { + ret = await m_AgentService.NewAccount(order.Id, accountEntity.PackageId.Value, accountEntity.Account, accountEntity.Pwd, accountEntity.ConnectCount); + } + if (ret.Code != ResultCode.C_SUCCESS) { accountEntity.ChargeStatus = AccountChargeStatus.Exception; @@ -588,7 +605,12 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel, { var account = accountEntity.Account; if (product.GroupNO == "g7") account = accountEntity.Raw; - var ret = await m_AgentService.ReNewAccount(order.Id, order.PackageId, account, order.ConnectCount); + var ret = new ApiResult(); + if (order.PackageId == 86){ + ret = await m_AgentService.ReNewAccount(order.Id, order.PackageId, account, order.ConnectCount,2); + } else { + ret = await m_AgentService.ReNewAccount(order.Id, order.PackageId, account, order.ConnectCount); + } if (ret.Code != ResultCode.C_SUCCESS) { accountEntity.ChargeStatus = AccountChargeStatus.Exception;