Files
juipnet/Host/Views/Product/ReBuyIndex.cshtml
2020-11-02 15:44:07 +08:00

234 lines
9.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@using Hncore.Pass.Vpn.Response.Product
@using Microsoft.Extensions.Configuration
@using Hncore.Pass.BaseInfo.Response
@using Hncore.Infrastructure.Serializer;
@inject IConfiguration m_Configuration
@model ProductWithPackageResponse
@{
ViewData["Title"] = "购买产品";
UserLoginModel user = null;
if (this.Context.Request.Cookies.TryGetValue("userInfo", out string userCookie))
{
user = userCookie.FromJsonTo<UserLoginModel>();
}
var defaultProduct = Model.Product;
var defaultPackage = Model.Packages.FirstOrDefault();
var baseUrl = m_Configuration["BaseInfoUrl"];
Func<string, string> P = (path) => $"{baseUrl}{path}";
}
<style>
.productName {
font-style: oblique;
font-weight: 400;
font-size: 32px;
color: #f49119;
}
.pkgNameCard {
background: #223da4;
height: 90px;
padding: 15px;
}
.youhuiNew {
font-size: 16px;
border: none;
text-align: center;
padding: 10px 0;
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;
}
</style>
<!-- ad -->
<div class="container-fluid ad">
<a asp-action="taobao" asp-controller="article"> <img src="~/img/acBanner.png"></a>
</div>
<div class="container stepOne packagebox" id="@("box"+defaultProduct.Id)">
<div class="container bg_taocan">
<div class="row" style="background:url(/img/products.png) no-repeat; background-size:100% 100%;">
<div class="col-lg-4" style="height:200px;padding-top:30px;padding-left:50px;">
<p class="productName">@defaultProduct.Name</p>
</div>
<div class="col-lg-8" style="height:200px;padding-top:30px">
<p>@defaultProduct.Name</p>
@foreach (var str in defaultProduct.ContentLine)
{
<p>@str</p>
}
<div class="row" style="text-align: right; position: absolute; right: 50px; bottom: 10px;">
<a asp-action="index" asp-controller="product">
<button type="button" class="btn btn-warning">购买通道</button>
</a>
</div>
</div>
</div>
</div>
@if(defaultProduct.Id == 5){
<p class="youhuiNew">新开账号或续费1个月赠送10天2个月赠送1个月每个账号限参加一次活动截止时间2020年11月25日</p>
}
<div class="card">
@foreach (var package in Model.Packages.Where(m => m.IsTest == 0 && m.Status == 1))
{
@if(package.Id == 86){
<div class="item packageitem packageitem86" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<p><span class="price">@package.Price</span>元</p>
<p class="yuanjia">原价:<span>@package.LinePrice</span>元</p>
<p>@(Math.Round(package.Price/package.DayCount,2))元/天</p>
<div class="pkgNameCard" style="background-color:#f64e3d">
<p class="tianka">@package.Name</p>
<p class="qixian">@package.Profile</p>
</div>
<img src="~/img/check.png" class="cardCheck">
</div>
} else if(package.Id == 19) {
<div class="item packageitem packageitem19" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<p><span class="price">@package.Price</span>元</p>
<p class="yuanjia">原价:<span>@package.LinePrice</span>元</p>
<p>@(Math.Round(package.Price/package.DayCount,2))元/天</p>
<div class="pkgNameCard" style="background-color:#f64e3d">
<p class="tianka">@package.Name</p>
<p class="qixian">@package.Profile</p>
</div>
<img src="~/img/check.png" class="cardCheck">
</div>
} else {
<div class="item packageitem" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<p><span class="price">@package.Price</span>元</p>
<p class="yuanjia">原价:<span>@package.LinePrice</span>元</p>
<p>@(Math.Round(package.Price/package.DayCount,2))元/天</p>
<div class="pkgNameCard">
<p class="tianka">@package.Name</p>
<p class="qixian">@package.Profile</p>
</div>
<img src="~/img/check.png" class="cardCheck">
</div>
}
}
@* <div class="item packageitem" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
<p><span class="price">@package.Price</span>元</p>
<p class="yuanjia">原价:<span>@package.LinePrice</span>元</p>
<p>@(package.DayPrice)元/天</p>
<div class="pkgNameCard">
<p class="tianka">@package.Name</p>
<p class="qixian">@package.Profile</p>
</div>
<img src="~/img/check.png" class="cardCheck">
</div> *@
}
</div>
<div style="border: 1px dashed #ccc;margin-top:30px;width:90%;margin-left: 63px;">
<p class="youhuiNew">温馨提示需求5个以上可以联系客服设置优惠价若您之前享优惠价请联系客服帮你改价哦开通后有任何问题可无理由退款</p>
</div>
@if (user == null)
{
<p class="tijiao"><button type="button" class="btn btn-primary login">提交</button></p>
}
else
{
<p class="tijiao"><button type="button" class="btn btn-primary btn-submit">提交</button></p>
}
</div>
@if(!string.IsNullOrWhiteSpace(ViewBag.errorTip))
{
<script>
alert('@ViewBag.errorTip')
history.go(-1);
</script>
}
@section Scripts{
<script type="text/javascript">
var currentPkgId =@defaultPackage.Id;
function selectPackage(id) {
currentPkgId = id;
var el = "#pkg" + id;
//$(".packageitem").hide();
//$(el).show()
$(el).addClass("kuang");
$(el).siblings().removeClass("kuang");
$(el).find(".cardCheck").show();
$(el).siblings().find(".cardCheck").hide();
}
function loginSuccess(data) {
window.location.href = "rebuy?packageId=" + currentPkgId+"&accounts=@ViewBag.accounts";
}
$(function () {
$(".card .item").click(function () {
currentPkgId = $(this).attr('a-pkg-id');
selectPackage(currentPkgId)
})
$(".btn-submit").click(function () {
window.location.href = "rebuy?packageId=" + currentPkgId+"&accounts=@ViewBag.accounts";
})
selectPackage(currentPkgId)
})
</script>
}