Files
juipnet/Host/Views.Mobile/Product/ReBuyIndex.cshtml
“wanyongkang” 345c45c478 极狐推荐
2024-07-15 17:32:00 +08:00

192 lines
9.5 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}";
}
@* <div class="cpBanner">
<img src="~/m/img/cpBanner.png">
</div> *@
<br><br><br><br>
<div class="cpNav">
<div class="item" style="width:100% !important">
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="@Model.Product.Id">
<div style="background:rgb(57, 81, 107);color:#FFFFFF;">
<p class="texing text-center" style="color:#009933;border:none;">@Model.Product.Name 简介</p>
<hr>
<ul class="texingList" style="padding-bottom:0;">
@foreach (var str in Model.Product.ContentLine)
{
<li style="padding:5px;">·@str</li>
}
</ul>
</div>
@foreach (var package in Model.Packages.Where(m=>m.IsTest==0&&m.Status==1 && m.Id != 21&& m.Id != 20).OrderBy(m => m.TenantId))
{
@if(package.Id == 101||package.Id == 103||package.Id == 104||(package.Id>103)){
<a asp-action="rebuy" asp-controller="Product" asp-route-packageId="@package.Id" asp-route-accounts=@ViewBag.accounts>
<div class="card color_2">
<div class="item">
<p style="font-size: 35px;color:#FFFF00;">@package.Name </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 == 19){
<a asp-action="rebuy" asp-controller="Product" asp-route-packageId="@package.Id" asp-route-accounts=@ViewBag.accounts>
<div class="card color_2">
<div class="item">
<p style="font-size: 35px;color:#FFFF00;">@package.Name 送10天</p>
<p>@(package.DayPrice)元/天</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 == 63||package.Id == 64||package.Id == 65||package.Id == 66||package.Id == 67||package.Id == 13||package.Id == 14||package.Id == 15||package.Id == 16){
<a asp-action="rebuy" asp-controller="Product" asp-route-packageId="@package.Id" asp-route-accounts=@ViewBag.accounts>
<div class="card color_2">
<div class="item">
<p style="font-size: 35px;color:#FFFF00;">@package.Name 85折</p>
<p>@(package.DayPrice)元/天</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 == 100 || package.Id == 102){
<a asp-action="rebuy" asp-controller="Product" asp-route-packageId="@package.Id" asp-route-accounts=@ViewBag.accounts>
<div class="card color_2">
<div class="item">
<p style="font-size: 35px;color:#FFFF00;">@package.Name </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) {
<a asp-action="rebuy" asp-controller="Product" asp-route-packageId="@package.Id" asp-route-accounts=@ViewBag.accounts>
<div class="card color_2">
<div class="item">
<p>@package.Name</p>
<p>@package.Profile</p>
</div>
<div class="item">
@if((package.Id == 64||package.Id == 1004)&&package.Price<60){
<p>¥<span>60.00</span></p>
} else {
<p>¥<span>@package.Price</span></p>
}
<p style="color: #FF9900;text-decoration: line-through">原价:@package.LinePrice 元</p>
</div>
</div>
</a>
}
}
</div>
</div>
</div>
</div>
<div class="modal fade" id="product_recommend" tabindex="-1" role="dialog" aria-labelledby="myModalLabelproduct" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
&times;
</button>
<h4 class="modal-title" id="myModalLabelproduct">
产品推荐
</h4>
</div>
<div class="modal-body">
<p style="font-weight:bold;">重磅打造极狐IP聚IP最好的动态产品260城市纯净IP三网混合IP稳定极速视频直播无压力且有不同带宽可选</p>
<p style="font-weight:bold;">现推广期天卡1毛体验周送1天月送1周双月送1月</p>
<p style="font-weight:bold;">承诺不好用48小时内免费退款</p>
<div class="text-right">
<label>
<input id="recommendchechk" type="checkbox"> 7天内不再提示
</label>
</div>
</div>
<div class="modal-footer">
<a href="/product/index" type="button" class="btn btn-primary" >
查看
</a>
<button type="button" class="btn btn-warning" onclick="buyrecommendfunc()" data-dismiss="modal">
忽略
</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
<script type="text/javascript">
function buyrecommendfunc() {
var isChecked = $('#recommendchechk').is(':checked');
if (isChecked) {
localStorage.setItem('rebuyrecommend', new Date().getTime());
}
}
var id = getUrlParam('productId')
if (id != 29 && id != 28 && id != 25 && id != 22 && id != 21 && id != 20 && id != 18 ) {
var lastClosedTime = localStorage.getItem('rebuyrecommend');
if (!lastClosedTime) {
// 如果之前没有关闭时间记录,则显示提示框
$('#product_recommend').modal('show')
} else {
// 如果有关闭时间记录则检查是否超过7天
var sevenDaysInMillis = 7 * 24 * 60 * 60 * 1000; // 7天的毫秒数
var currentTime = new Date().getTime();
if (currentTime - lastClosedTime > sevenDaysInMillis) {
// 超过7天显示提示框
$('#product_recommend').modal('show')
}
}
}
//获取url中的参数
function getUrlParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
var r = window.location.search.substr(1).match(reg); //匹配目标参数
if (r != null) return unescape(r[2]); return null; //返回参数值
}
</script>