From c0b77c96dfbc279f5ffad887617e8c6753adaedc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwanyongkang=E2=80=9D?= <“937888580@qq.com”> Date: Mon, 18 Jan 2021 17:57:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E6=AF=9B=E9=92=B1=E6=B4=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Host/Controllers/ProductController.cs | 25 +++++++++- Host/Views.Mobile/Product/Index.cshtml | 18 ++++++- Host/Views.Mobile/Product/buy.cshtml | 7 ++- Host/Views/Product/Index.cshtml | 48 ++++++++++++++++++- Host/Views/Product/buy.cshtml | 7 ++- .../Service/ProductOrderService.cs | 13 +++++ 6 files changed, 110 insertions(+), 8 deletions(-) diff --git a/Host/Controllers/ProductController.cs b/Host/Controllers/ProductController.cs index f90fdb1..519f0aa 100644 --- a/Host/Controllers/ProductController.cs +++ b/Host/Controllers/ProductController.cs @@ -82,8 +82,12 @@ namespace Home.Controllers var userInfo = this.Request.GetUserInfo(); if (userInfo != null) { + + //从user表获取用户信息 + var user_Info = await m_UserService.GetById(userInfo.UserId); + var ProductAccountCount = user_Info.ProductAccountCount; var userPrices = await m_ProductUserPriceService.GetProductUserPrice(userInfo.UserId); - + foreach(var product in respList) { product.Packages.ForEach(m => { @@ -93,6 +97,18 @@ namespace Home.Controllers { m.Price = userPrice.UserPrice; } + if (ProductAccountCount == 0 && m.DayCount == 1 && m.ProductId!=5){ + m.Price = 0.1M; + } + }); + } + } else { + foreach(var product in respList) + { + product.Packages.ForEach(m => { + if ( m.DayCount == 1 && m.ProductId!=5){ + m.Price = 0.1M; + } }); } } @@ -656,11 +672,18 @@ namespace Home.Controllers var package = await m_ProductPackageService.GetById(id); var product = await m_ProductService.GetById(package.ProductId); + //从user表获取用户信息 + var user_Info = await m_UserService.GetById(userId); + var ProductAccountCount = user_Info.ProductAccountCount; + var userPrice = await m_ProductUserPriceService.GetPackageUserPrice(package.Id, userId); if (userPrice != null && userPrice.UserPrice > 0) { package.Price = userPrice.UserPrice; } + if (ProductAccountCount == 0 && package.DayCount == 1 && package.ProductId!=5){ + package.Price = 0.1M; + } return View("buy", new PackageInfoResponse() { diff --git a/Host/Views.Mobile/Product/Index.cshtml b/Host/Views.Mobile/Product/Index.cshtml index 707fc8e..32c2be9 100644 --- a/Host/Views.Mobile/Product/Index.cshtml +++ b/Host/Views.Mobile/Product/Index.cshtml @@ -89,7 +89,23 @@ } else { - @if(package.Id == 88||package.Id == 101||package.Id == 103||package.Id == 104||(package.Id>103 && package.Id<1000)){ + @if(package.Price == 0.1M){ + +
+
+

@package.Name 首单

+

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

+

@package.Profile

+
+
+

¥@package.Price

+

原价:@package.LinePrice 元

+ +
+
+
+ } + else if(package.Id == 88||package.Id == 101||package.Id == 103||package.Id == 104||(package.Id>103 && package.Id<1000)){
diff --git a/Host/Views.Mobile/Product/buy.cshtml b/Host/Views.Mobile/Product/buy.cshtml index 3ca0cd6..ef20550 100644 --- a/Host/Views.Mobile/Product/buy.cshtml +++ b/Host/Views.Mobile/Product/buy.cshtml @@ -116,7 +116,7 @@
单个注册
-
+
批量注册
@@ -141,7 +141,7 @@
连接数:
-
+
- @@ -155,6 +155,9 @@
+
+ 1 +
diff --git a/Host/Views/Product/Index.cshtml b/Host/Views/Product/Index.cshtml index 930dd63..2339713 100644 --- a/Host/Views/Product/Index.cshtml +++ b/Host/Views/Product/Index.cshtml @@ -158,6 +158,35 @@ border-bottom-color: transparent; } + .packageitem1{ + position: relative; + } + .packageitem1::before { + position: absolute; + top: 0.3rem; + left: -0.5rem; + z-index: 1; + padding-right: 0.625rem; + font-weight: bold; + line-height: 0px; + color: #FF0033; + height: 0px; + border: 1.0rem solid #FF9933; + border-right-color: transparent; + content: "首单0.1元"; + box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000; + } + + .packageitem1::after { + content: ""; + position: absolute; + top: 2.1875rem; + left: -0.5rem; + border: 0.25rem solid #f64e3d; + border-left-color: transparent; + border-bottom-color: transparent; + } + .packageitem81{ position: relative; } @@ -362,6 +391,7 @@
+

一毛钱活动:不分新老用户都可参加!

@* @if(item.Product.Id == 5){

月卡赠送10天,双月卡赠送1个月,新开和续费都有赠送,活动截止时间2020年11月25日。
(同一个IP账号仅限一次,每位会员不限账号数量,您可购买多个IP账号都有赠送)

} *@ @@ -405,7 +435,21 @@ @foreach (var package in item.Packages.Where(m => m.IsTest == 0 && m.Status == 1).OrderBy(m => m.TenantId)) { - @if(package.Id == 88||package.Id == 101||package.Id == 103||package.Id==1009){ + @if(package.Price == 0.1M){ + +
+ +

@package.Price

+

原价:@package.LinePrice

+

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

+
+

@package.Name

+

@package.Profile

+
+ +
+ } + else if(package.Id == 88||package.Id == 101||package.Id == 103||package.Id==1009){
@@ -418,7 +462,7 @@
- } + } else if(package.Id == 100||package.Id == 102) {
diff --git a/Host/Views/Product/buy.cshtml b/Host/Views/Product/buy.cshtml index 638f94c..c0cf0e5 100644 --- a/Host/Views/Product/buy.cshtml +++ b/Host/Views/Product/buy.cshtml @@ -123,7 +123,7 @@
单个注册
-
+
批量注册
@@ -160,7 +160,7 @@
连接数:
-
+
@@ -174,6 +174,9 @@
+
+ 1 +
可同时在线的设备数
diff --git a/Services/Hncore.Pass.Vpn/Service/ProductOrderService.cs b/Services/Hncore.Pass.Vpn/Service/ProductOrderService.cs index 31d9132..4735655 100644 --- a/Services/Hncore.Pass.Vpn/Service/ProductOrderService.cs +++ b/Services/Hncore.Pass.Vpn/Service/ProductOrderService.cs @@ -219,6 +219,9 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel, var userEntity = await m_UserService.GetById(userId); + //天卡0.1元 + var ProductAccountCount = userEntity.ProductAccountCount; + var is_verify = userEntity.is_verify; if (is_verify == 0) @@ -230,6 +233,10 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel, var userPrice = await this.m_ProductUserPriceService.Query(true).FirstOrDefaultAsync(m => m.UserId == userId && m.PackageId == packageEntity.Id && m.Status == 1); if (userPrice != null && userPrice.UserPrice > 0) price = userPrice.UserPrice; + + if (ProductAccountCount == 0 && packageEntity.DayCount == 1 && packageEntity.ProductId!=5 && request.ConnectCount == 1){ + price = 0.1M; + } var order = new ProductOrderEntity() { AccountCount = 1, @@ -296,6 +303,11 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel, var ret = await CaclePaymentAmount(order, request.UseAccountAmount); if (ret.Code != ResultCode.C_SUCCESS) return ret; + + if (order.AccountPayAmount == 0.1M){ + userEntity.ProductAccountCount = 1; + await m_UserService.Update(userEntity); + } using (var tran = await m_DbContext.Database.BeginTransactionAsync()) { try @@ -361,6 +373,7 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel, //账户余额支付 if (order.AccountPayAmount > 0) { + var amountInfo = new UpdateAmountRequest() { Amount = order.AccountPayAmount.Value,