Files
juipnet/Host/Views.Mobile/Product/ReBuyIndex.cshtml
2025-05-16 17:13:25 +08:00

253 lines
12 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;">重磅打造:</p>
<p style="font-weight:bold;">1.极光IP聚IP池子最大的动态产品240城市纯净住宅IP</p>
<p style="font-weight:bold;">2.极狐IP聚IP网速最快的动态产品260城市纯净住宅IP</p>
<p style="font-weight:bold;">现推广期天卡1毛体验</p>
<p style="font-weight:bold;">承诺不好用24小时内免费退款</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>
<div class="modal fade" id="product_recommend_2" 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;color: red;">强子IP即将停运IP资源池将加进极狐IP。</p>
<p style="font-weight:bold;">重磅打造:</p>
<p style="font-weight:bold;">1.极光IP聚IP池子最大的动态产品240城市纯净住宅IP</p>
<p style="font-weight:bold;">2.极狐IP聚IP网速最快的动态产品260城市纯净住宅IP</p>
<p style="font-weight:bold;">现推广期天卡1毛体验</p>
<p style="font-weight:bold;">承诺不好用24小时内免费退款</p>
<div class="text-right">
<label>
<input id="recommendchechk_2" 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_2()" 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());
}
}
function buyrecommendfunc_2() {
var isChecked = $('#recommendchechk_2').is(':checked');
if (isChecked) {
localStorage.setItem('buyrecommend_2', new Date().getTime());
}
}
var id = getUrlParam('productId')
if (id != 29 && id != 26 && id != 3 && id != 28 && id != 22 && id != 21 && id != 20 && id != 18 && id != 1 ) {
var lastClosedTime = localStorage.getItem('buyrecommend');
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')
}
}
}
if (id == 1) {
var lastClosedTime = localStorage.getItem('buyrecommend_2');
if (!lastClosedTime) {
// 如果之前没有关闭时间记录,则显示提示框
$('#product_recommend_2').modal('show')
} else {
// 如果有关闭时间记录则检查是否超过7天
var sevenDaysInMillis = 7 * 24 * 60 * 60 * 1000; // 7天的毫秒数
var currentTime = new Date().getTime();
if (currentTime - lastClosedTime > sevenDaysInMillis) {
// 超过7天显示提示框
$('#product_recommend_2').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>