一毛钱活动

This commit is contained in:
“wanyongkang”
2021-01-18 17:57:11 +08:00
parent e6171147c4
commit c0b77c96df
6 changed files with 110 additions and 8 deletions

View File

@@ -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()
{

View File

@@ -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){
<a asp-action="buy" asp-controller="product" asp-route-id="@package.Id">
<div class="card color_@((item.Packages.IndexOf(package)+1)%5)">
<div class="item">
<p style="font-size: 35px;color:#FFFF00;">@package.Name 首单</p>
<p>@(Math.Round(package.Price/package.DayCount,2))元/天</p>
<p>@package.Profile</p>
</div>
<div class="item">
<p>¥<span>@package.Price</span></p>
<p style="color: #FF9900;text-decoration: line-through">原价:@package.LinePrice 元</p>
</div>
</div>
</a>
}
else if(package.Id == 88||package.Id == 101||package.Id == 103||package.Id == 104||(package.Id>103 && package.Id<1000)){
<a asp-action="buy" asp-controller="product" asp-route-id="@package.Id">
<div class="card color_@((item.Packages.IndexOf(package)+1)%5)">
<div class="item">

View File

@@ -116,7 +116,7 @@
<div class="col-sm-6 col-xs-6 text-right">
<span class="dan zActive">单个注册</span>
</div>
<div class="col-sm-6 col-xs-6 text-left">
<div v-if="OnePayAmount != 0.1" class="col-sm-6 col-xs-6 text-left">
<span class="pi">批量注册</span>
</div>
</div>
@@ -141,7 +141,7 @@
<div class="col-sm-5 col-xs-5">
连接数:
</div>
<div class="col-sm-7 col-xs-7">
<div v-if="OnePayAmount != 0.1" class="col-sm-7 col-xs-7">
<div class="jiajian">
<div class="item" v-on:click="OneBuyModel.ConnectCount>1&&OneBuyModel.ConnectCount--">
-
@@ -155,6 +155,9 @@
</div>
</div>
</div>
<div v-if="OnePayAmount == 0.1" class="col-sm-7 col-xs-7">
1
</div>
</div>
<div class="row">
<div class="col-sm-5 col-xs-5">

View File

@@ -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 @@
</div>
</div>
</div>
<p class="youhuiNew" style="padding:0;margin:0;color:white;background-color:#FF0033;">一毛钱活动:不分新老用户都可参加!</p>
@* @if(item.Product.Id == 5){
<p class="youhuiNew">月卡赠送10天双月卡赠送1个月新开和续费都有赠送活动截止时间2020年11月25日。<br>同一个IP账号仅限一次每位会员不限账号数量您可购买多个IP账号都有赠送</p>
} *@
@@ -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){
<div class="item packageitem packageitem1" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<p><span class="price">@package.Price</span>元</p>
<p class="yuanjia" style="color: #FF9900;">原价:<span>@package.LinePrice</span>元</p>
<p>@(Math.Round(package.Price/package.DayCount,2))元/天</p>
<div class="pkgNameCard" style="background-color:#FF9933">
<p class="tianka" style="font-size:17px;color:#FF0033;">@package.Name</p>
<p class="qixian">@package.Profile</p>
</div>
<img src="~/img/check.png" class="cardCheck">
</div>
}
else if(package.Id == 88||package.Id == 101||package.Id == 103||package.Id==1009){
<div class="item packageitem packageitem86" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
@@ -418,7 +462,7 @@
</div>
<img src="~/img/check.png" class="cardCheck">
</div>
}
}
else if(package.Id == 100||package.Id == 102) {
<div class="item packageitem packageitem19" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">

View File

@@ -123,7 +123,7 @@
<div class="item dan active_dan">
单个注册
</div>
<div class="item pi">
<div v-if="OnePayAmount != 0.1" class="item pi">
批量注册
</div>
</div>
@@ -160,7 +160,7 @@
<div class="col-lg-4 text-right">
连接数:
</div>
<div class="col-lg-4">
<div v-if="OnePayAmount != 0.1" class="col-lg-4">
<div class="buchang">
<input type="hidden" class="form-control ConnectCount" v-model="OneBuyModel.ConnectCount" name="ConnectCount" value="1">
<div class="item cursor" v-on:click="OneBuyModel.ConnectCount>1&&OneBuyModel.ConnectCount--">
@@ -174,6 +174,9 @@
</div>
</div>
</div>
<div v-if="OnePayAmount == 0.1" class="col-lg-4">
1
</div>
<div class="col-lg-4 text-left">
<span class="grayText">可同时在线的设备数</span>
</div>

View File

@@ -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,