Compare commits
3 Commits
d51b2319dc
...
2b7a4996e6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2b7a4996e6 | ||
|
|
aada71df8a | ||
|
|
aeec6dbab6 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -54,4 +54,6 @@ TestResult.xml
|
||||
nunit-*.xml
|
||||
|
||||
.idea/
|
||||
.volumes/
|
||||
.vscode/
|
||||
.volumes/
|
||||
appsettings.Development.json
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -39,7 +39,7 @@ namespace Home.Controllers
|
||||
{
|
||||
[Controller]
|
||||
[Route("[Controller]/[Action]")]
|
||||
public class UserController:Controller
|
||||
public class UserController : Controller
|
||||
{
|
||||
UserService m_UserService;
|
||||
ProductAccountService m_ProductAccountService;
|
||||
@@ -68,7 +68,7 @@ namespace Home.Controllers
|
||||
, Hncore.Pass.BaseInfo.Service.UserScoreService _UserScoreService
|
||||
, AgentService _AgentService
|
||||
, ProductPackageService _PackageService
|
||||
,ProductService _ProductService
|
||||
, ProductService _ProductService
|
||||
, CouponService _CouponService
|
||||
, SellerTaoBaoService _TaoBaoService
|
||||
, TaoBaoRefundService _TaoBaoRefundService
|
||||
@@ -76,7 +76,7 @@ namespace Home.Controllers
|
||||
, WxAppUserService _WxAppUserService
|
||||
, UserChargeOrderService _ChargeService
|
||||
, IConfiguration _Configuration
|
||||
,WxPayClient _WxPayClient
|
||||
, WxPayClient _WxPayClient
|
||||
, AgentService _agentService
|
||||
, CouponUserOrginService _CouponUserOrginService)
|
||||
{
|
||||
@@ -107,28 +107,28 @@ namespace Home.Controllers
|
||||
var model = new UserHomeModel();
|
||||
model.UserModel = await m_UserService.GetById(userId);
|
||||
|
||||
var accountQuery = m_ProductAccountService.Query(m => m.UserId == userId && m.DeleteTag==0);
|
||||
var accountQuery = m_ProductAccountService.Query(m => m.UserId == userId && m.DeleteTag == 0);
|
||||
model.AccountModel.TotalCount = await accountQuery.CountAsync();
|
||||
model.AccountModel.ExpriedCount = await accountQuery.Where(m => m.EndTime < DateTime.Now).CountAsync();
|
||||
|
||||
var orderQuery= m_OrderService.Query(m => m.UserId == userId);
|
||||
var orderQuery = m_OrderService.Query(m => m.UserId == userId);
|
||||
|
||||
var todayOrderQuery = orderQuery.Where(m => (m.CreateTime - DateTime.Now).Days == 0);
|
||||
model.Statistic.TodayExpend = todayOrderQuery.Where(m => (m.OrderState == OrderStatus.PayOk || m.OrderState == OrderStatus.Complete)).Sum(m => m.PaymentAmount);
|
||||
model.Statistic.TodayRefund = todayOrderQuery.Where(m =>(m.OrderState == OrderStatus.AutoRefundOver || m.OrderState == OrderStatus.UserRefundOver)).Sum(m => m.RefundAmount);
|
||||
model.Statistic.TodayRefund = todayOrderQuery.Where(m => (m.OrderState == OrderStatus.AutoRefundOver || m.OrderState == OrderStatus.UserRefundOver)).Sum(m => m.RefundAmount);
|
||||
|
||||
|
||||
var monthOrderQuery = orderQuery.Where(m =>m.CreateTime.Month== DateTime.Now.Month);
|
||||
var monthOrderQuery = orderQuery.Where(m => m.CreateTime.Month == DateTime.Now.Month);
|
||||
model.Statistic.MonthExpend = monthOrderQuery.Where(m => (m.OrderState == OrderStatus.PayOk || m.OrderState == OrderStatus.Complete)).Sum(m => m.PaymentAmount);
|
||||
model.Statistic.MonthRefund = monthOrderQuery.Where(m =>(m.OrderState == OrderStatus.AutoRefundOver || m.OrderState == OrderStatus.UserRefundOver)).Sum(m => m.RefundAmount);
|
||||
model.Statistic.MonthRefund = monthOrderQuery.Where(m => (m.OrderState == OrderStatus.AutoRefundOver || m.OrderState == OrderStatus.UserRefundOver)).Sum(m => m.RefundAmount);
|
||||
|
||||
var yearOrderQuery = orderQuery.Where(m => (m.CreateTime - DateTime.Now).Days == 0);
|
||||
model.Statistic.YearExpend= yearOrderQuery.Where(m => (m.OrderState == OrderStatus.PayOk || m.OrderState == OrderStatus.Complete)).Sum(m => m.PaymentAmount);
|
||||
model.Statistic.YearExpend = yearOrderQuery.Where(m => (m.OrderState == OrderStatus.PayOk || m.OrderState == OrderStatus.Complete)).Sum(m => m.PaymentAmount);
|
||||
|
||||
|
||||
var chargeQuery = m_UserScoreService.Query(m => m.UserId == userId);
|
||||
model.Statistic.TodayCharege = chargeQuery.Where(m =>(m.ScoreType == ScoreType.ManagerAdd || m.ScoreType == ScoreType.TaoBaoAdd) && (m.CreateTime - DateTime.Now).Days == 0).Sum(m => m.ScoreValue);
|
||||
model.Statistic.MonthCharege = chargeQuery.Where(m => (m.ScoreType == ScoreType.ManagerAdd || m.ScoreType == ScoreType.TaoBaoAdd) && m.CreateTime.Month==DateTime.Now.Year).Sum(m => m.ScoreValue);
|
||||
model.Statistic.TodayCharege = chargeQuery.Where(m => (m.ScoreType == ScoreType.ManagerAdd || m.ScoreType == ScoreType.TaoBaoAdd) && (m.CreateTime - DateTime.Now).Days == 0).Sum(m => m.ScoreValue);
|
||||
model.Statistic.MonthCharege = chargeQuery.Where(m => (m.ScoreType == ScoreType.ManagerAdd || m.ScoreType == ScoreType.TaoBaoAdd) && m.CreateTime.Month == DateTime.Now.Year).Sum(m => m.ScoreValue);
|
||||
|
||||
|
||||
model.TopNewsModel = await m_ArticleService.GetTop(6, Hncore.Pass.Vpn.Domain.ArticleCatalog.Top);
|
||||
@@ -269,9 +269,9 @@ namespace Home.Controllers
|
||||
LoginCode = request.Phone,
|
||||
Password = request.Pwd,
|
||||
Phone = request.Phone,
|
||||
Wx=request.Wx,
|
||||
QQ=request.QQ,
|
||||
id_code=""
|
||||
Wx = request.Wx,
|
||||
QQ = request.QQ,
|
||||
id_code = ""
|
||||
};
|
||||
|
||||
var ret = await m_UserService.Regist(userEntity);
|
||||
@@ -319,7 +319,7 @@ namespace Home.Controllers
|
||||
return new ApiResult(ResultCode.C_Access_Forbidden, "验证码不正确或者过期");
|
||||
}
|
||||
var user = await m_UserService.GetByPhone(request.Phone);
|
||||
if (user==null) return new ApiResult(ResultCode.C_Access_Forbidden, "手机号不存在");
|
||||
if (user == null) return new ApiResult(ResultCode.C_Access_Forbidden, "手机号不存在");
|
||||
return await m_UserService.UpdatePwd(user, request.Pwd);
|
||||
|
||||
}
|
||||
@@ -336,7 +336,7 @@ namespace Home.Controllers
|
||||
// return new ApiResult(ResultCode.C_SUCCESS, "验证码已发送到您的手机");
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 发送手机验证码
|
||||
@@ -344,11 +344,11 @@ namespace Home.Controllers
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, AllowAnonymous]
|
||||
public async Task<ApiResult> SendPhoneCodevefy(string phone,string key)
|
||||
public async Task<ApiResult> SendPhoneCodevefy(string phone, string key)
|
||||
{
|
||||
key = $"{key}:{phone}";
|
||||
|
||||
if (key.StartsWith("User_Code:") &&m_UserService.Exist(m => m.LoginCode == phone || m.Phone == phone))
|
||||
key = $"{key}:{phone}";
|
||||
|
||||
if (key.StartsWith("User_Code:") && m_UserService.Exist(m => m.LoginCode == phone || m.Phone == phone))
|
||||
{
|
||||
return new ApiResult(ResultCode.C_ALREADY_EXISTS_ERROR, "该手机号已经被注册了");
|
||||
}
|
||||
@@ -361,7 +361,7 @@ namespace Home.Controllers
|
||||
}
|
||||
code = ValidateCodeHelper.MakeNumCode(4);
|
||||
await RedisHelper.SetAsync(key, code, 60);
|
||||
var ret = AliSmsService.Send( "SMS_186355045", new { code }, "河南华连网络科技", phone);
|
||||
var ret = AliSmsService.Send("SMS_186355045", new { code }, "河南华连网络科技", phone);
|
||||
if (ret)
|
||||
{
|
||||
return new ApiResult(ResultCode.C_SUCCESS, "验证码已发送到您的手机");
|
||||
@@ -370,7 +370,7 @@ namespace Home.Controllers
|
||||
}
|
||||
|
||||
[HttpPost, UserAuth]
|
||||
public async Task<ApiResult> OrginAccountAuth([FromBody]OriginAccountAuthRequest request)
|
||||
public async Task<ApiResult> OrginAccountAuth([FromBody] OriginAccountAuthRequest request)
|
||||
{
|
||||
var user = this.Request.GetUserInfo();
|
||||
|
||||
@@ -381,9 +381,9 @@ namespace Home.Controllers
|
||||
var end = request.StartNum + request.Count;
|
||||
for (var i = request.StartNum; i < end; i++)
|
||||
{
|
||||
var account = $"{ request.Account}{i}";
|
||||
// if (!m_ProductAccountService.Exist(m => m.Account == account))//m.ProductId == request.ProductId &&
|
||||
accounts.Add(account);
|
||||
var account = $"{request.Account}{i}";
|
||||
// if (!m_ProductAccountService.Exist(m => m.Account == account))//m.ProductId == request.ProductId &&
|
||||
accounts.Add(account);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -397,12 +397,12 @@ namespace Home.Controllers
|
||||
List<string> error = new List<string>();
|
||||
foreach (var accountItem in accounts)
|
||||
{
|
||||
if (m_ProductAccountService.Exist(m =>m.ProductId== request.ProductId&& m.Account == accountItem))
|
||||
if (m_ProductAccountService.Exist(m => m.ProductId == request.ProductId && m.Account == accountItem))
|
||||
{
|
||||
error.Add($"[{accountItem}]已存在");
|
||||
continue;
|
||||
}
|
||||
var originModel = await m_AgentService.GetOriginAccountInfo(request.ProductId, accountItem, request.Pwd);
|
||||
var originModel = await m_AgentService.GetOriginAccountInfo(request.ProductId, accountItem, request.Pwd);
|
||||
if (originModel.Code != ResultCode.C_SUCCESS)
|
||||
{
|
||||
|
||||
@@ -438,9 +438,9 @@ namespace Home.Controllers
|
||||
|
||||
[HttpGet]
|
||||
[UserAuth]
|
||||
public async Task<IActionResult> MyOrders([FromQuery]OrderSearchModel request)
|
||||
public async Task<IActionResult> MyOrders([FromQuery] OrderSearchModel request)
|
||||
{
|
||||
var userId = this.Request.GetUserInfo().UserId;
|
||||
var userId = this.Request.GetUserInfo().UserId;
|
||||
|
||||
var orderQuery = m_OrderService.Query(m => m.UserId == userId && m.DeleteTag == 0);
|
||||
orderQuery = orderQuery.Where(m => m.OrderState == OrderStatus.PayOk || m.OrderState == OrderStatus.Complete);
|
||||
@@ -453,7 +453,7 @@ namespace Home.Controllers
|
||||
orderQuery = orderQuery.Where(m => m.ProductId == request.ProductId);
|
||||
}
|
||||
|
||||
if (request.PackageId !="0")
|
||||
if (request.PackageId != "0")
|
||||
{
|
||||
orderQuery = orderQuery.Where(m => m.PackageName == request.PackageId);
|
||||
}
|
||||
@@ -465,20 +465,20 @@ namespace Home.Controllers
|
||||
|
||||
if (request.KeyWord.Has())
|
||||
{
|
||||
orderQuery = orderQuery.Where(m =>m.OrderNo.Contains(request.KeyWord)||m.Accounts.Contains(request.KeyWord));
|
||||
orderQuery = orderQuery.Where(m => m.OrderNo.Contains(request.KeyWord) || m.Accounts.Contains(request.KeyWord));
|
||||
}
|
||||
var data =await orderQuery.OrderByDescending(m => m.Id).ListPagerAsync(request.PageSize, request.PageIndex, true);
|
||||
var data = await orderQuery.OrderByDescending(m => m.Id).ListPagerAsync(request.PageSize, request.PageIndex, true);
|
||||
return View(data);
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[UserAuth]
|
||||
public async Task<IActionResult> MyRefundOrders([FromQuery]OrderSearchModel request)
|
||||
public async Task<IActionResult> MyRefundOrders([FromQuery] OrderSearchModel request)
|
||||
{
|
||||
var userId = this.Request.GetUserInfo().UserId;
|
||||
|
||||
var orderQuery = m_OrderService.Query(m => m.UserId == userId);
|
||||
orderQuery = orderQuery.Where(m => m.OrderState == OrderStatus.AutoRefundOver || m.OrderState == OrderStatus.UserRefundOver || m.OrderState == OrderStatus.RequestRefund);
|
||||
orderQuery = orderQuery.Where(m => m.OrderState == OrderStatus.AutoRefundOver || m.OrderState == OrderStatus.UserRefundOver || m.OrderState == OrderStatus.RequestRefund);
|
||||
if (request.OrderType > 0)
|
||||
{
|
||||
orderQuery = orderQuery.Where(m => (int)m.OrderType == request.OrderType);
|
||||
@@ -509,7 +509,7 @@ namespace Home.Controllers
|
||||
|
||||
[HttpGet]
|
||||
[UserAuth]
|
||||
public async Task<IActionResult> MyAccounts([FromQuery]AccountSearchModel request=null )
|
||||
public async Task<IActionResult> MyAccounts([FromQuery] AccountSearchModel request = null)
|
||||
{
|
||||
request = request ?? new AccountSearchModel();
|
||||
var userId = this.Request.GetUserInfo().UserId;
|
||||
@@ -528,15 +528,24 @@ namespace Home.Controllers
|
||||
|
||||
if (request.ExpiredDay > -100)
|
||||
{
|
||||
if (request.ExpiredDay > 0){
|
||||
if (request.ExpiredDay > 0)
|
||||
{
|
||||
exp = exp.And(m => Math.Ceiling((m.EndTime - DateTime.Now).Value.TotalDays) <= request.ExpiredDay && m.EndTime > DateTime.Now);
|
||||
} else if (request.ExpiredDay < 0 && request.ExpiredDay>-4) {
|
||||
}
|
||||
else if (request.ExpiredDay < 0 && request.ExpiredDay > -4)
|
||||
{
|
||||
exp = exp.And(m => Math.Ceiling((DateTime.Now - m.EndTime).Value.TotalDays) <= Math.Abs(request.ExpiredDay) && m.EndTime < DateTime.Now);
|
||||
} else if (request.ExpiredDay==-4) {
|
||||
}
|
||||
else if (request.ExpiredDay == -4)
|
||||
{
|
||||
exp = exp.And(m => Math.Ceiling((m.EndTime - DateTime.Now).Value.TotalDays) <= -4);
|
||||
} else if (request.ExpiredDay==-5) {
|
||||
}
|
||||
else if (request.ExpiredDay == -5)
|
||||
{
|
||||
exp = exp.And(m => m.EndTime > DateTime.Now);
|
||||
} else if (request.ExpiredDay==-6) {
|
||||
}
|
||||
else if (request.ExpiredDay == -6)
|
||||
{
|
||||
exp = exp.And(m => m.EndTime < DateTime.Now);
|
||||
}
|
||||
exp = exp.And(m => m.PackageName != "测试卡");
|
||||
@@ -553,14 +562,14 @@ namespace Home.Controllers
|
||||
}
|
||||
|
||||
//var ret = await m_ProductAccountService.PageDesc(request.PageIndex,request.PageSize, exp,true,m=>m.Id);
|
||||
var ret = await m_ProductAccountService.Query(exp, true).OrderByDescending(m=>m.Id).QueryPager(1000,1).ToListAsync();
|
||||
var ret = await m_ProductAccountService.Query(exp, true).OrderByDescending(m => m.Id).QueryPager(1000, 1).ToListAsync();
|
||||
return View(ret);
|
||||
}
|
||||
[HttpGet]
|
||||
[UserAuth]
|
||||
public async Task<IActionResult> AssignAddress([FromQuery]AccountSearchModel request=null )
|
||||
public async Task<IActionResult> AssignAddress([FromQuery] AccountSearchModel request = null)
|
||||
{
|
||||
|
||||
|
||||
return View();
|
||||
}
|
||||
|
||||
@@ -568,8 +577,8 @@ namespace Home.Controllers
|
||||
[UserAuth]
|
||||
public async Task<IActionResult> MyCoupons()
|
||||
{
|
||||
var userId =this.Request.GetUserInfo().UserId;
|
||||
var model = await m_CouponService.GetUserCoupon(userId);
|
||||
var userId = this.Request.GetUserInfo().UserId;
|
||||
var model = await m_CouponService.GetUserCoupon(userId);
|
||||
return View(model);
|
||||
}
|
||||
|
||||
@@ -577,16 +586,16 @@ namespace Home.Controllers
|
||||
[UserAuth]
|
||||
public IActionResult CashOut()
|
||||
{
|
||||
var userId =this.Request.GetUserInfo().UserId;
|
||||
var userId = this.Request.GetUserInfo().UserId;
|
||||
return View();
|
||||
}
|
||||
|
||||
|
||||
|
||||
[HttpGet]
|
||||
[UserAuth]
|
||||
public IActionResult RosOrder()
|
||||
{
|
||||
var userId =this.Request.GetUserInfo().UserId;
|
||||
var userId = this.Request.GetUserInfo().UserId;
|
||||
return View();
|
||||
}
|
||||
|
||||
@@ -594,21 +603,21 @@ namespace Home.Controllers
|
||||
[UserAuth]
|
||||
public IActionResult jinqiao()
|
||||
{
|
||||
var userId =this.Request.GetUserInfo().UserId;
|
||||
var userId = this.Request.GetUserInfo().UserId;
|
||||
return View();
|
||||
}
|
||||
[HttpGet]
|
||||
[UserAuth]
|
||||
public IActionResult api()
|
||||
{
|
||||
var userId =this.Request.GetUserInfo().UserId;
|
||||
var userId = this.Request.GetUserInfo().UserId;
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[UserAuth]
|
||||
public IActionResult upload()
|
||||
{
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
@@ -616,45 +625,53 @@ namespace Home.Controllers
|
||||
[UserAuth]
|
||||
public IActionResult MyMoney()
|
||||
{
|
||||
var userId =this.Request.GetUserInfo().UserId;
|
||||
var userId = this.Request.GetUserInfo().UserId;
|
||||
return View();
|
||||
}
|
||||
[HttpGet]
|
||||
[UserAuth]
|
||||
public IActionResult HttpRecharge()
|
||||
{
|
||||
var userId =this.Request.GetUserInfo().UserId;
|
||||
var userId = this.Request.GetUserInfo().UserId;
|
||||
return View();
|
||||
}
|
||||
[HttpGet]
|
||||
[UserAuth]
|
||||
public IActionResult HttpPackageList()
|
||||
{
|
||||
var userId =this.Request.GetUserInfo().UserId;
|
||||
var userId = this.Request.GetUserInfo().UserId;
|
||||
ViewData["BaseUrl"] = m_Configuration["BaseInfoUrl"];
|
||||
return View();
|
||||
}
|
||||
[HttpGet]
|
||||
[UserAuth]
|
||||
public IActionResult HttpLongterm()
|
||||
{
|
||||
var userId =this.Request.GetUserInfo().UserId;
|
||||
var userId = this.Request.GetUserInfo().UserId;
|
||||
return View();
|
||||
}
|
||||
[HttpGet]
|
||||
[UserAuth]
|
||||
public IActionResult HttpUseHistory()
|
||||
{
|
||||
var userId =this.Request.GetUserInfo().UserId;
|
||||
var userId = this.Request.GetUserInfo().UserId;
|
||||
return View();
|
||||
}
|
||||
[HttpGet]
|
||||
[UserAuth]
|
||||
public IActionResult HttpWhiteIp()
|
||||
{
|
||||
var userId =this.Request.GetUserInfo().UserId;
|
||||
var userId = this.Request.GetUserInfo().UserId;
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[UserAuth]
|
||||
public IActionResult HttpWhiteIpSU()
|
||||
{
|
||||
ViewData["BaseUrl"] = m_Configuration["BaseInfoUrl"];
|
||||
return View();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发送手机验证码
|
||||
@@ -662,7 +679,7 @@ namespace Home.Controllers
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet, AllowAnonymous]
|
||||
public IActionResult WebLogin(string redirect="")
|
||||
public IActionResult WebLogin(string redirect = "")
|
||||
{
|
||||
ViewBag.redirect = redirect;
|
||||
return View("Login");
|
||||
@@ -680,9 +697,10 @@ namespace Home.Controllers
|
||||
{
|
||||
var notifyOrder = data.FromJsonTo<TaoBaoNotifyModel>();
|
||||
var taobaoEntity = notifyOrder.MapTo<TaoBaoOrderEntity>();
|
||||
|
||||
if((notifyOrder.SellerNick == "聚ip商城动态ip代理" || notifyOrder.SellerNick == "老鹰动态pptp")||notifyOrder.SellerNick == "强子pptp动态"||notifyOrder.SellerNick == "可乐开发商"){
|
||||
|
||||
|
||||
if ((notifyOrder.SellerNick == "聚ip商城动态ip代理" || notifyOrder.SellerNick == "老鹰动态pptp") || notifyOrder.SellerNick == "强子pptp动态" || notifyOrder.SellerNick == "可乐开发商")
|
||||
{
|
||||
|
||||
taobaoEntity.Phone = "none";
|
||||
taobaoEntity.SkuPropertiesName = notifyOrder.Orders.FirstOrDefault()?.SkuPropertiesName;
|
||||
|
||||
@@ -709,7 +727,7 @@ namespace Home.Controllers
|
||||
}
|
||||
|
||||
// Console.WriteLine("==================================================================");
|
||||
|
||||
|
||||
string msg = "";
|
||||
|
||||
if (userEntity == null)
|
||||
@@ -720,27 +738,30 @@ namespace Home.Controllers
|
||||
LoginCode = phone,
|
||||
Password = pas_result,
|
||||
Phone = phone,
|
||||
TaoBao= notifyOrder.BuyerNick,
|
||||
id_code=""
|
||||
TaoBao = notifyOrder.BuyerNick,
|
||||
id_code = ""
|
||||
};
|
||||
var ret = await m_UserService.Regist(userEntity);
|
||||
msg = "您好,打开网址:juip.com,登录会员名:"+phone+"("+notifyOrder.Payment+"元已充值到此账户),密码:"+pas_result+"。这个会员名和密码不能直接使用,是用来登录官网的。登录后点击网站上方的-产品购买,即可完成开通或续费。在官网购买的账号密码可以直接使用。恭喜您本次获得优惠券(满4元减1元,满20元减3元,满54元减5元,满130元减15元,满490元减30元),各一张。欢迎您多来淘宝下单(人工客服在线时间:上午八点到晚上十一点半)";
|
||||
msg = "您好,打开网址:juip.com,登录会员名:" + phone + "(" + notifyOrder.Payment + "元已充值到此账户),密码:" + pas_result + "。这个会员名和密码不能直接使用,是用来登录官网的。登录后点击网站上方的-产品购买,即可完成开通或续费。在官网购买的账号密码可以直接使用。恭喜您本次获得优惠券(满4元减1元,满20元减3元,满54元减5元,满130元减15元,满490元减30元),各一张。欢迎您多来淘宝下单(人工客服在线时间:上午八点到晚上十一点半)";
|
||||
if (ret.Code != ResultCode.C_SUCCESS) return msg;
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
phone = userEntity.Phone;
|
||||
|
||||
if(userEntity.TaoBao == null){
|
||||
userEntity.TaoBao= notifyOrder.BuyerNick;
|
||||
|
||||
if (userEntity.TaoBao == null)
|
||||
{
|
||||
userEntity.TaoBao = notifyOrder.BuyerNick;
|
||||
await m_UserService.Update(userEntity);
|
||||
}
|
||||
msg = "您好,"+notifyOrder.Payment+"元已充值到充值到您的会员中,会员号为:"+userEntity.LoginCode+",打开网址:www.juip.com,登录后点击网站上方的-产品购买,即可完成开通或续费。恭喜您本次获得优惠券(满4元减1元,满20元减3元,满54元减5元,满130元减15元,满490元减30元),各一张。欢迎您多来淘宝下单(人工客服在线时间:上午八点到晚上十一点半)";
|
||||
|
||||
msg = "您好," + notifyOrder.Payment + "元已充值到充值到您的会员中,会员号为:" + userEntity.LoginCode + ",打开网址:www.juip.com,登录后点击网站上方的-产品购买,即可完成开通或续费。恭喜您本次获得优惠券(满4元减1元,满20元减3元,满54元减5元,满130元减15元,满490元减30元),各一张。欢迎您多来淘宝下单(人工客服在线时间:上午八点到晚上十一点半)";
|
||||
|
||||
}
|
||||
|
||||
var amountInfo = new UpdateAmountRequest()
|
||||
{
|
||||
OperateUserName= phone,
|
||||
OperateUserName = phone,
|
||||
Amount = decimal.Parse(notifyOrder.Payment),
|
||||
OpAmountType = ScoreType.TaoBaoAdd,
|
||||
UserId = userEntity.Id,
|
||||
@@ -759,7 +780,7 @@ namespace Home.Controllers
|
||||
|
||||
await m_TaoBaoService.Add(taobaoEntity);
|
||||
|
||||
|
||||
|
||||
// await Task.Delay(3000);
|
||||
// Console.WriteLine("===================================================================");
|
||||
// var send_msg_info = await m_TaoBaoService.SengMsg(notifyOrder.Tid,msg);
|
||||
@@ -777,55 +798,67 @@ namespace Home.Controllers
|
||||
if (refundInfo == null || refundInfo.RefundId.NotHas())
|
||||
return false;
|
||||
|
||||
var his_order= m_TaoBaoService.Query(m => m.Tid == refundInfo.Tid).FirstOrDefault();
|
||||
var his_order = m_TaoBaoService.Query(m => m.Tid == refundInfo.Tid).FirstOrDefault();
|
||||
refundInfo.Phone = his_order.Phone;
|
||||
|
||||
var taobaoEntity = refundInfo.MapTo<TaoBaoRefundEntity>();
|
||||
|
||||
|
||||
await m_TaoBaoRefundService.Add(taobaoEntity);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
long aopic = long.Parse(this.Request.Query["aopic"]);
|
||||
string datainfo = this.Request.Form["json"];
|
||||
var refundInfos = datainfo.FromJsonTo<TaoBaoRefundModel>();
|
||||
LogHelper.Info("淘宝参数回调", $"json={datainfo.ToJson()}");
|
||||
var info = "";
|
||||
if (aopic == 2){
|
||||
if (aopic == 2)
|
||||
{
|
||||
info = await m_TaoBaoService.ReceivedMsg(this.Request, process);
|
||||
} else if(aopic == 256){//退款
|
||||
var his_order= m_TaoBaoRefundService.Query(m => m.Tid == refundInfos.Tid).FirstOrDefault();
|
||||
if (his_order == null){
|
||||
}
|
||||
else if (aopic == 256)
|
||||
{//退款
|
||||
var his_order = m_TaoBaoRefundService.Query(m => m.Tid == refundInfos.Tid).FirstOrDefault();
|
||||
if (his_order == null)
|
||||
{
|
||||
info = await m_TaoBaoRefundService.ReceivedRefundMsg(this.Request, refunds);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
his_order.status = 0;
|
||||
his_order.RefundFee = refundInfos.RefundFee;
|
||||
his_order.Modified = refundInfos.Modified;
|
||||
await m_TaoBaoRefundService.Update(his_order);
|
||||
}
|
||||
|
||||
}else if(aopic == 65536){//卖家同意退款
|
||||
|
||||
var his_order= m_TaoBaoRefundService.Query(m => m.Tid == refundInfos.Tid).FirstOrDefault();
|
||||
|
||||
}
|
||||
else if (aopic == 65536)
|
||||
{//卖家同意退款
|
||||
|
||||
var his_order = m_TaoBaoRefundService.Query(m => m.Tid == refundInfos.Tid).FirstOrDefault();
|
||||
his_order.status = 1;
|
||||
|
||||
|
||||
await m_TaoBaoRefundService.Update(his_order);
|
||||
|
||||
}else if(aopic == 262144){//拒绝退款
|
||||
var his_order= m_TaoBaoRefundService.Query(m => m.Tid == refundInfos.Tid).FirstOrDefault();
|
||||
|
||||
}
|
||||
else if (aopic == 262144)
|
||||
{//拒绝退款
|
||||
var his_order = m_TaoBaoRefundService.Query(m => m.Tid == refundInfos.Tid).FirstOrDefault();
|
||||
his_order.status = 2;
|
||||
|
||||
|
||||
|
||||
await m_TaoBaoRefundService.Update(his_order);
|
||||
|
||||
}else if(aopic == 32768){//关闭
|
||||
var his_order= m_TaoBaoRefundService.Query(m => m.Tid == refundInfos.Tid).FirstOrDefault();
|
||||
|
||||
}
|
||||
else if (aopic == 32768)
|
||||
{//关闭
|
||||
var his_order = m_TaoBaoRefundService.Query(m => m.Tid == refundInfos.Tid).FirstOrDefault();
|
||||
his_order.status = 3;
|
||||
|
||||
|
||||
|
||||
await m_TaoBaoRefundService.Update(his_order);
|
||||
|
||||
|
||||
}
|
||||
return Content(info);
|
||||
}
|
||||
@@ -847,23 +880,23 @@ namespace Home.Controllers
|
||||
}
|
||||
|
||||
[HttpPost, UserAuth]
|
||||
public async Task<ApiResult> UpdatePwd([FromBody]UpdatePwdModel request)
|
||||
public async Task<ApiResult> UpdatePwd([FromBody] UpdatePwdModel request)
|
||||
{
|
||||
if (request.NewPwd != request.ConfirmPwd)
|
||||
{
|
||||
return new ApiResult(ResultCode.C_INVALID_ERROR,"密码不一致");
|
||||
return new ApiResult(ResultCode.C_INVALID_ERROR, "密码不一致");
|
||||
}
|
||||
var ret = await this.m_UserService.UpdatePwd(this.Request.GetUserInfo().UserId, request.OldPwd, request.NewPwd);
|
||||
return ret;
|
||||
}
|
||||
[HttpPost, UserAuth]
|
||||
public async Task<ApiResult> UpdateAccountPwd([FromBody]UpdateAccountPwdRequest request)
|
||||
public async Task<ApiResult> UpdateAccountPwd([FromBody] UpdateAccountPwdRequest request)
|
||||
{
|
||||
return await m_ProductAccountService.UpdateAccountPwd(request);
|
||||
return await m_ProductAccountService.UpdateAccountPwd(request);
|
||||
}
|
||||
|
||||
[HttpPost, AllowAnonymous]
|
||||
public async Task<ApiResult> ApiUpdateAccountPwd([FromBody]UpdateAccountPwdRequest request)
|
||||
public async Task<ApiResult> ApiUpdateAccountPwd([FromBody] UpdateAccountPwdRequest request)
|
||||
{
|
||||
//通过apikey获取用户信息
|
||||
var userEntity = m_UserService.Query(m => m.apikey == request.apikey).FirstOrDefault();
|
||||
@@ -871,7 +904,7 @@ namespace Home.Controllers
|
||||
{
|
||||
return new ApiResult(ResultCode.C_INVALID_ERROR, "apikey不正确");
|
||||
}
|
||||
return await m_ProductAccountService.ApiUpdateAccountPwd(request,userEntity.Id);
|
||||
return await m_ProductAccountService.ApiUpdateAccountPwd(request, userEntity.Id);
|
||||
}
|
||||
|
||||
|
||||
@@ -927,9 +960,9 @@ namespace Home.Controllers
|
||||
|
||||
var userInfo = await WxOpenApi.GetUserinfoByWebAccessToken(access_token, openid);
|
||||
|
||||
if (userInfo==null)
|
||||
if (userInfo == null)
|
||||
{
|
||||
LogHelper.Error("GetUserinfoByWebAccessToken",$"access_token={access_token},openid={openid}");
|
||||
LogHelper.Error("GetUserinfoByWebAccessToken", $"access_token={access_token},openid={openid}");
|
||||
return;
|
||||
}
|
||||
if (userInfo.errcode > 0)
|
||||
@@ -955,7 +988,7 @@ namespace Home.Controllers
|
||||
}
|
||||
var wxUserInfo = await m_WxAppUserService.GetWxUser(appid, userInfo.openid);
|
||||
if (wxUserInfo != null)
|
||||
{
|
||||
{
|
||||
var userEntity = await m_UserService.GetById(wxUserInfo.UserId);
|
||||
var loginRet = m_UserService.LoginInternal(userEntity, wxUserInfo);
|
||||
this.HttpContext.Response.Cookies.Append("token", loginRet.Token);
|
||||
@@ -968,7 +1001,7 @@ namespace Home.Controllers
|
||||
var loginUrl = $"{baseUrl}User/WebLogin?redirect={returnUrl}";
|
||||
// returnUrl = UrlHelper.SetUrlParam(returnUrl, "act", "login");
|
||||
this.Response.Redirect(loginUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -979,7 +1012,7 @@ namespace Home.Controllers
|
||||
/// <returns></returns>
|
||||
|
||||
[HttpPost, UserAuth]
|
||||
public async Task<ApiResult> CreateOrder([FromBody]CreateOrderRequest request)
|
||||
public async Task<ApiResult> CreateOrder([FromBody] CreateOrderRequest request)
|
||||
{
|
||||
var userId = this.Request.GetUserInfo().UserId;
|
||||
var ret = await m_ChargeService.CreateOrder(request, userId);
|
||||
@@ -993,7 +1026,7 @@ namespace Home.Controllers
|
||||
{
|
||||
OrderInfo = ret.Data,
|
||||
};
|
||||
if (ret.Data.PayChannel == UPayChannel.WxH5|| ret.Data.PayChannel == UPayChannel.WxPc||ret.Data.PayChannel == UPayChannel.WxMp)
|
||||
if (ret.Data.PayChannel == UPayChannel.WxH5 || ret.Data.PayChannel == UPayChannel.WxPc || ret.Data.PayChannel == UPayChannel.WxMp)
|
||||
{
|
||||
var url = await CreateWxPayOrder(ret.Data);
|
||||
data.PayData = url;
|
||||
@@ -1006,7 +1039,7 @@ namespace Home.Controllers
|
||||
}
|
||||
return new ApiResult(data);
|
||||
}
|
||||
[HttpGet,AllowAnonymous]
|
||||
[HttpGet, AllowAnonymous]
|
||||
public async Task<ApiResult> IsPay(string orderNo)
|
||||
{
|
||||
var orderInfo = await m_ChargeService.GetOrderByNo(orderNo);
|
||||
@@ -1168,12 +1201,12 @@ namespace Home.Controllers
|
||||
|
||||
#region 阿里支付
|
||||
private async Task<string> CreateAliPayOrder(UserChargeOrderEntity request)
|
||||
{
|
||||
{
|
||||
if (request.PayChannel == UPayChannel.AliPc)
|
||||
{
|
||||
var Ali_APP_ID = m_Configuration["Aliyun:Pay:AppId"];
|
||||
var Ali_APP_PRIVATE_KEY = m_Configuration["Aliyun:Pay:PrivateKey"];
|
||||
var ALIPAY_PUBLIC_KEY = m_Configuration["Aliyun:Pay:PublicKey"];//支付宝的公钥,而不是应用的公钥
|
||||
var Ali_APP_ID = m_Configuration["Aliyun:Pay:AppId"];
|
||||
var Ali_APP_PRIVATE_KEY = m_Configuration["Aliyun:Pay:PrivateKey"];
|
||||
var ALIPAY_PUBLIC_KEY = m_Configuration["Aliyun:Pay:PublicKey"];//支付宝的公钥,而不是应用的公钥
|
||||
string callBackUrl = m_Configuration["Aliyun:Pay:UNotifyUrl"];
|
||||
string ReturnUrl = m_Configuration["Aliyun:Pay:UReturnUrl"];
|
||||
|
||||
@@ -1206,11 +1239,11 @@ namespace Home.Controllers
|
||||
}
|
||||
else if (request.PayChannel == UPayChannel.AliH5)
|
||||
{
|
||||
var Ali_APP_ID = m_Configuration["Aliyun:PayH5:AppId"];
|
||||
var Ali_APP_PRIVATE_KEY = m_Configuration["Aliyun:PayH5:PrivateKey"];
|
||||
var ALIPAY_PUBLIC_KEY = m_Configuration["Aliyun:PayH5:PublicKey"];
|
||||
var callBackUrl = m_Configuration["Aliyun:PayH5:UNotifyUrl"];
|
||||
var ReturnUrl = m_Configuration["Aliyun:PayH5:UReturnUrl"];
|
||||
var Ali_APP_ID = m_Configuration["Aliyun:PayH5:AppId"];
|
||||
var Ali_APP_PRIVATE_KEY = m_Configuration["Aliyun:PayH5:PrivateKey"];
|
||||
var ALIPAY_PUBLIC_KEY = m_Configuration["Aliyun:PayH5:PublicKey"];
|
||||
var callBackUrl = m_Configuration["Aliyun:PayH5:UNotifyUrl"];
|
||||
var ReturnUrl = m_Configuration["Aliyun:PayH5:UReturnUrl"];
|
||||
|
||||
// 组装业务参数model
|
||||
AlipayTradeWapPayModel model = new AlipayTradeWapPayModel
|
||||
@@ -1306,7 +1339,8 @@ namespace Home.Controllers
|
||||
{
|
||||
var ordereNo = sArray["out_trade_no"];
|
||||
var trade_status = sArray["trade_status"];
|
||||
if (trade_status == "TRADE_SUCCESS") {
|
||||
if (trade_status == "TRADE_SUCCESS")
|
||||
{
|
||||
var order = await m_ChargeService.GetOrderByNo(ordereNo);
|
||||
if (order.OrderState == UOrderStatus.Complete || order.OrderState == UOrderStatus.PayOk)
|
||||
{
|
||||
@@ -1353,7 +1387,7 @@ namespace Home.Controllers
|
||||
3、校验通知中的seller_id(或者seller_email) 是否为out_trade_no这笔单据的对应的操作方(有的时候,一个商户可能有多个seller_id/seller_email)
|
||||
4、验证app_id是否为该商户本身。
|
||||
*/
|
||||
var ALIPAY_PUBLIC_KEY = m_Configuration["Aliyun:PayH5:PublicKey"];
|
||||
var ALIPAY_PUBLIC_KEY = m_Configuration["Aliyun:PayH5:PublicKey"];
|
||||
|
||||
|
||||
Dictionary<string, string> sArray = GetRequestGet();
|
||||
@@ -1385,7 +1419,7 @@ namespace Home.Controllers
|
||||
3、校验通知中的seller_id(或者seller_email) 是否为out_trade_no这笔单据的对应的操作方(有的时候,一个商户可能有多个seller_id/seller_email)
|
||||
4、验证app_id是否为该商户本身。
|
||||
*/
|
||||
var ALIPAY_PUBLIC_KEY = m_Configuration["Aliyun:PayH5:PublicKey"];
|
||||
var ALIPAY_PUBLIC_KEY = m_Configuration["Aliyun:PayH5:PublicKey"];
|
||||
Dictionary<string, string> sArray = GetRequestPost();
|
||||
LogHelper.Info("AliNotify", AlipaySignature.GetSignContent(sArray));
|
||||
if (sArray.Count != 0)
|
||||
@@ -1406,7 +1440,8 @@ namespace Home.Controllers
|
||||
{
|
||||
var ordereNo = sArray["out_trade_no"];
|
||||
var trade_status = sArray["trade_status"];
|
||||
if (trade_status == "TRADE_SUCCESS") {
|
||||
if (trade_status == "TRADE_SUCCESS")
|
||||
{
|
||||
var order = await m_ChargeService.GetOrderByNo(ordereNo);
|
||||
if (order.OrderState == UOrderStatus.Complete || order.OrderState == UOrderStatus.PayOk)
|
||||
{
|
||||
@@ -1478,9 +1513,9 @@ namespace Home.Controllers
|
||||
|
||||
|
||||
[HttpGet, UserAuth]
|
||||
public async Task<IActionResult> OnLine(int productId,string account)
|
||||
public async Task<IActionResult> OnLine(int productId, string account)
|
||||
{
|
||||
var data= await m_agentService.OnLine(productId, account);
|
||||
var data = await m_agentService.OnLine(productId, account);
|
||||
return View(data.Data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "http://localhost:5000"
|
||||
"applicationUrl": "http://0.0.0.0:5000"
|
||||
},
|
||||
"Docker": {
|
||||
"commandName": "Docker",
|
||||
|
||||
@@ -221,6 +221,26 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 ">
|
||||
<div class="boxes boxes-border-top text-left margin-top-30 clearfix">
|
||||
<div class="col-sm-12">
|
||||
<h5 class="margin-top-0">白名单数量:</h5>
|
||||
<div class="d-flex align-items-center" style="gap: 15px;">
|
||||
<div class="btn-group" role="group">
|
||||
<button type="button" v-on:click="dxwxl_whitelist_reduce()" :disabled="dxwxl_data.maxWhitelist <= 1" class="btn btn-new">-</button>
|
||||
<button type="button" class="btn btn-default">{{ dxwxl_data.maxWhitelist }}</button>
|
||||
<button type="button" v-on:click="dxwxl_whitelist_add()" :disabled="dxwxl_data.maxWhitelist >= 20" class="btn btn-new">+</button>
|
||||
</div>
|
||||
<span style="margin-left: 20px;">
|
||||
您的白名单上限{{ dxwxl_data.maxWhitelist }}个,
|
||||
<span v-if="dxwxl_data.maxWhitelist === 1">价格<span class="text-danger">无折扣</span></span>
|
||||
<span v-else-if="dxwxl_data.maxWhitelist <= 5" class="text-danger">{{11 - dxwxl_data.maxWhitelist}}折</span>
|
||||
<span v-else class="text-danger">6折</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 ">
|
||||
<div class="boxes boxes-border-top text-left margin-top-30 clearfix">
|
||||
<div class="col-sm-12">
|
||||
@@ -700,7 +720,7 @@
|
||||
<script src="~/js/vue.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var baseUrl = '@ViewData["BaseUrl"]';
|
||||
var select_ip_num = 0;
|
||||
|
||||
$(document).on("ready", function(e) {
|
||||
@@ -806,6 +826,7 @@ $(document).on("ready", function(e) {
|
||||
durationType:5,
|
||||
periodType:1060,//必填,周期类型,1060-小时,1-按天,7-按周,30-按月,90-按季度
|
||||
periodAmount:1,//必填,购买周期,根据periodType来,例如按天,就是N天,按周就是N周
|
||||
maxWhitelist:1,//选填,变更无限量白名单数量,不填写会默认使用当前白名单数量
|
||||
},
|
||||
dxbt_data:{//短效包天
|
||||
durationType:5,//必填,有效时长,5-1至5分钟,25-5至25分钟,180-25至180分钟,360-3至6小时
|
||||
@@ -927,7 +948,7 @@ $(document).on("ready", function(e) {
|
||||
var that = this
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'https://php-api.juip.com/http/product/city',
|
||||
url: `${baseUrl}/http/product/city`,
|
||||
dataType: "json",
|
||||
async:false,
|
||||
data:this.game,
|
||||
@@ -941,7 +962,7 @@ $(document).on("ready", function(e) {
|
||||
var that = this
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'https://php-api.juip.com/http/product/game',
|
||||
url: `${baseUrl}/http/product/game`,
|
||||
dataType: "json",
|
||||
async:false,
|
||||
data:this.game,
|
||||
@@ -976,7 +997,7 @@ $(document).on("ready", function(e) {
|
||||
var that = this
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'https://php-api.juip.com/http/product/linecount',
|
||||
url: `${baseUrl}/http/product/linecount`,
|
||||
dataType: "json",
|
||||
async:false,
|
||||
data:this.game,
|
||||
@@ -1026,6 +1047,18 @@ $(document).on("ready", function(e) {
|
||||
this.dxwxl_data.periodAmount++;
|
||||
this.calc_price();
|
||||
},
|
||||
//短效无限量购买白名单修改
|
||||
dxwxl_whitelist_reduce(){
|
||||
if (this.dxwxl_data.maxWhitelist > 1) {
|
||||
this.dxwxl_data.maxWhitelist--;
|
||||
this.calc_price();
|
||||
}
|
||||
},
|
||||
//短效无限量购买白名单修改
|
||||
dxwxl_whitelist_add(){
|
||||
this.dxwxl_data.maxWhitelist++;
|
||||
this.calc_price();
|
||||
},
|
||||
//短效包天购买时长修改
|
||||
dxbt_gmsc_reduce(){
|
||||
if (this.dxbt_data.periodAmount > 1) {
|
||||
@@ -1115,7 +1148,7 @@ $(document).on("ready", function(e) {
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'https://php-api.juip.com/http/order/create_order',
|
||||
url: `${baseUrl}/http/order/create_order`,
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
@@ -1159,7 +1192,7 @@ $(document).on("ready", function(e) {
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'https://php-api.juip.com/http/user/get_balance',
|
||||
url: `${baseUrl}/http/user/get_balance`,
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
@@ -1199,7 +1232,7 @@ $(document).on("ready", function(e) {
|
||||
};
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'https://php-api.juip.com/http/product/calc_price',
|
||||
url: `${baseUrl}/http/product/calc_price`,
|
||||
dataType: "json",
|
||||
async:false,
|
||||
data: this.order_info,
|
||||
@@ -1209,7 +1242,9 @@ $(document).on("ready", function(e) {
|
||||
});
|
||||
switch(this.order_info.order_type) {
|
||||
case 2:
|
||||
this.order_info.money = this.order_info.data.periodAmount * price_info.price;
|
||||
const whitelist = this.order_info.data.maxWhitelist
|
||||
const discount = Math.max(.6, 1 - .1 * (whitelist - 1))
|
||||
this.order_info.money = this.order_info.data.periodAmount * whitelist * discount * price_info.price;
|
||||
break;
|
||||
case 3:
|
||||
this.order_info.money = this.order_info.data.periodAmount * price_info.price * this.order_info.data.ipAmount;
|
||||
|
||||
@@ -234,6 +234,11 @@
|
||||
白名单设置
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/user/httpwhiteipsu">
|
||||
白名单设置(短效无限量)
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
@{
|
||||
Layout = "_UserLayout";
|
||||
}
|
||||
@@ -447,9 +446,17 @@
|
||||
<div class="col-sm-12 ">
|
||||
<div class="boxes boxes-border-top text-left margin-top-30 clearfix">
|
||||
<div class="col-sm-12">
|
||||
<h5 class=" text-left">价格:¥{{order_info.money}} <span style="float:right;">
|
||||
<button class="btn btn-new" v-on:click="pay()" data-backdrop="static" >实付¥{{order_info.money}}</button>
|
||||
</span></h5>
|
||||
<h5 class=" text-left">
|
||||
<span style="margin-right:4px">价格:¥{{order_info.money}}</span>
|
||||
<span style="font-size: 13px;font-weight: 400;color: #666666;">
|
||||
无限量白名单上限:{{whitelist}}
|
||||
</span>
|
||||
<span style="float:right;">
|
||||
<button class="btn btn-new" v-on:click="pay()"
|
||||
data-backdrop="static">实付¥{{order_info.money}}
|
||||
</button>
|
||||
</span>
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -462,50 +469,53 @@
|
||||
</div><!-- /.modal -->
|
||||
</div>
|
||||
<script>
|
||||
var vm = new Vue({
|
||||
el:'#app',
|
||||
data:{
|
||||
pakage_list:[],
|
||||
order_list:[],
|
||||
rebuy_data:{
|
||||
title:'',
|
||||
packId:'',
|
||||
packType:'',
|
||||
periodType:1,
|
||||
periodAmount:1,
|
||||
durationType:5,
|
||||
var baseUrl = '@ViewData["BaseUrl"]';
|
||||
var vm = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
pakage_list: [],
|
||||
order_list: [],
|
||||
rebuy_data: {
|
||||
title: '',
|
||||
packId: '',
|
||||
packType: '',
|
||||
periodType: 1,
|
||||
periodAmount: 1,
|
||||
durationType: 5,
|
||||
},
|
||||
order_time_type:'天',
|
||||
order_info:{
|
||||
order_type:2,//1:预储值、2:短效无限量、3:短效包天、4:短效包量、5:长效游戏
|
||||
money:1,
|
||||
data:{}
|
||||
order_time_type: '天',
|
||||
order_info: {
|
||||
order_type: 2,//1:预储值、2:短效无限量、3:短效包天、4:短效包量、5:长效游戏
|
||||
money: 1,
|
||||
data: {}
|
||||
},
|
||||
|
||||
api_link:'',
|
||||
api_link_item:{
|
||||
num:1
|
||||
api_link: '',
|
||||
api_link_item: {
|
||||
num: 1
|
||||
},
|
||||
regions:[],
|
||||
user_detail:{},
|
||||
},
|
||||
created:function(){
|
||||
this.get_package_list();
|
||||
regions: [],
|
||||
user_detail: {},
|
||||
whitelist: 1,
|
||||
},
|
||||
methods:{
|
||||
get_package_list(){
|
||||
created: function () {
|
||||
this.get_package_list();
|
||||
this.get_whitelist_max();
|
||||
},
|
||||
methods: {
|
||||
get_package_list() {
|
||||
let data = {
|
||||
cookie:document.cookie,
|
||||
cookie: document.cookie,
|
||||
}
|
||||
var that = this;
|
||||
|
||||
var that = this;
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'https://php-api.juip.com/http/user/dx_package',
|
||||
url: `${baseUrl}/http/user/dx_package`,
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
beforeSend: function(xhr) {
|
||||
beforeSend: function (xhr) {
|
||||
xhr.withCredentials = true;
|
||||
},
|
||||
crossDomain: true,
|
||||
@@ -516,17 +526,17 @@
|
||||
},
|
||||
get_ip() {
|
||||
let data = {
|
||||
cookie:document.cookie,
|
||||
cookie: document.cookie,
|
||||
}
|
||||
var that = this;
|
||||
|
||||
var that = this;
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'https://php-api.juip.com/http/user/get_user_token',
|
||||
url: `${baseUrl}/http/user/get_user_token`,
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
beforeSend: function(xhr) {
|
||||
beforeSend: function (xhr) {
|
||||
xhr.withCredentials = true;
|
||||
},
|
||||
crossDomain: true,
|
||||
@@ -536,23 +546,23 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
autowhiteip(){
|
||||
autowhiteip() {
|
||||
this.api_link_item.u = this.user_detail.u
|
||||
this.api_link_item.t = this.user_detail.t
|
||||
},
|
||||
get_order_list() {
|
||||
let data = {
|
||||
cookie:document.cookie,
|
||||
cookie: document.cookie,
|
||||
}
|
||||
var that = this;
|
||||
|
||||
var that = this;
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'https://php-api.juip.com/http/user/dx_order',
|
||||
url: `${baseUrl}/http/user/dx_order`,
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
beforeSend: function(xhr) {
|
||||
beforeSend: function (xhr) {
|
||||
xhr.withCredentials = true;
|
||||
},
|
||||
crossDomain: true,
|
||||
@@ -562,6 +572,8 @@
|
||||
});
|
||||
},
|
||||
rebuy(r) {
|
||||
console.log(r);
|
||||
|
||||
this.rebuy_data.title = r.name;
|
||||
this.rebuy_data.packId = r.id;
|
||||
this.rebuy_data.packType = r.planType;
|
||||
@@ -577,52 +589,53 @@
|
||||
this.calc_price();
|
||||
|
||||
},
|
||||
set_btn_checked(id_f,id,text){
|
||||
set_btn_checked(id_f, id, text) {
|
||||
var i = 0;
|
||||
if (text.length > 0) {
|
||||
this.order_time_type = text
|
||||
}
|
||||
for (i=0;i<100;i++) {
|
||||
$("#"+id_f+i).removeClass("btn-new");
|
||||
$("#"+id_f+i).addClass("btn-default");
|
||||
for (i = 0; i < 100; i++) {
|
||||
$("#" + id_f + i).removeClass("btn-new");
|
||||
$("#" + id_f + i).addClass("btn-default");
|
||||
}
|
||||
$("#"+id_f+id).removeClass("btn-default");
|
||||
$("#"+id_f+id).addClass("btn-new");
|
||||
|
||||
let _this=this
|
||||
setTimeout(function() {
|
||||
|
||||
$("#" + id_f + id).removeClass("btn-default");
|
||||
$("#" + id_f + id).addClass("btn-new");
|
||||
|
||||
let _this = this
|
||||
setTimeout(function () {
|
||||
|
||||
_this.calc_price()
|
||||
|
||||
|
||||
}, 500);
|
||||
},
|
||||
gmsc_add(){
|
||||
gmsc_add() {
|
||||
this.rebuy_data.periodAmount++;
|
||||
this.calc_price();
|
||||
},
|
||||
//短效包天购买时长修改
|
||||
gmsc_reduce(){
|
||||
gmsc_reduce() {
|
||||
if (this.rebuy_data.periodAmount > 1) {
|
||||
this.rebuy_data.periodAmount--;
|
||||
this.calc_price();
|
||||
}
|
||||
},
|
||||
pay(){
|
||||
pay() {
|
||||
let that = this;
|
||||
this.order_info.data = this.rebuy_data;
|
||||
|
||||
this.order_info.renew = 1;
|
||||
|
||||
let data = {
|
||||
cookie:document.cookie,
|
||||
cookie: document.cookie,
|
||||
order_info: this.order_info
|
||||
}
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'https://php-api.juip.com/http/order/rebuy_order',
|
||||
url: `${baseUrl}/http/order/rebuy_order`,
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
beforeSend: function(xhr) {
|
||||
beforeSend: function (xhr) {
|
||||
xhr.withCredentials = true;
|
||||
},
|
||||
crossDomain: true,
|
||||
@@ -631,19 +644,19 @@
|
||||
$('#myModal').modal('hide');
|
||||
alert(res.msg);
|
||||
that.get_package_list();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
chaneg_type(r){
|
||||
chaneg_type(r) {
|
||||
var that = this;
|
||||
this.pakage_list.forEach(function(item,index,arr){
|
||||
this.pakage_list.forEach(function (item, index, arr) {
|
||||
|
||||
if (that.api_link_item.pack == item.id) {
|
||||
that.api_link_item.pt = item.planType;
|
||||
that.api_link_item.time = item.durationType2;
|
||||
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
@@ -658,25 +671,25 @@
|
||||
$("#qc").show();
|
||||
$("#at").hide();
|
||||
that.api_link_item.distinct = 0;
|
||||
}
|
||||
}
|
||||
if (that.api_link_item.pt == 21) {
|
||||
$("#gt").show();
|
||||
}
|
||||
},
|
||||
qqms(i){
|
||||
qqms(i) {
|
||||
if (i == 1) {
|
||||
$("#sp").hide();
|
||||
} else {
|
||||
$("#sp").show();
|
||||
}
|
||||
},
|
||||
create_api_link(){
|
||||
create_api_link() {
|
||||
this.api_link = 'http://get.ip.juip.com/get/ip?';
|
||||
var regions_list = this.regions.join(",");
|
||||
|
||||
|
||||
for (let key in this.api_link_item) {
|
||||
if (this.api_link_item.hasOwnProperty(key)) {
|
||||
this.api_link += key + "=" + this.api_link_item[key]+'&';
|
||||
this.api_link += key + "=" + this.api_link_item[key] + '&';
|
||||
}
|
||||
}
|
||||
this.api_link += 'regions=' + regions_list;
|
||||
@@ -684,18 +697,18 @@
|
||||
// 全选按钮点击事件处理程序
|
||||
selectAll() {
|
||||
var checkboxes = document.querySelectorAll('input[name="regions"]'); // 获取所有复选框元素
|
||||
|
||||
|
||||
for (var i = 0; i < checkboxes.length; i++) {
|
||||
checkboxes[i].checked=true; // 将每个复选框的 checked 属性设置为 true
|
||||
checkboxes[i].checked = true; // 将每个复选框的 checked 属性设置为 true
|
||||
this.regions[i] = checkboxes[i].value;
|
||||
}
|
||||
},
|
||||
// 取消全选按钮点击事件处理程序
|
||||
deselectAll() {
|
||||
var checkboxes = document.querySelectorAll('input[name="regions"]'); // 获取所有复选框元素
|
||||
|
||||
|
||||
for (var i = 0; i < checkboxes.length; i++) {
|
||||
checkboxes[i].checked=false; // 移除每个复选框的 checked 属性
|
||||
checkboxes[i].checked = false; // 移除每个复选框的 checked 属性
|
||||
}
|
||||
this.regions = [];
|
||||
},
|
||||
@@ -716,30 +729,49 @@
|
||||
this.order_info.data = this.rebuy_data;
|
||||
|
||||
var price_info = {
|
||||
'ipAmount':0,
|
||||
'price':0,
|
||||
'ipAmount': 0,
|
||||
'price': 0,
|
||||
};
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'https://php-api.juip.com/http/product/calc_price',
|
||||
url: `${baseUrl}/http/product/calc_price`,
|
||||
dataType: "json",
|
||||
async:false,
|
||||
async: false,
|
||||
data: this.order_info,
|
||||
success: function (res) {
|
||||
price_info = res
|
||||
}
|
||||
});
|
||||
switch(this.order_info.order_type) {
|
||||
switch (this.order_info.order_type) {
|
||||
case 2:
|
||||
this.order_info.money = this.order_info.data.periodAmount * price_info.price;
|
||||
break;
|
||||
const whitelist = this.whitelist
|
||||
const discount = Math.max(.6, 1 - .1 * (whitelist - 1))
|
||||
this.order_info.money = this.order_info.data.periodAmount * whitelist * discount * price_info.price;
|
||||
break;
|
||||
case 3:
|
||||
this.order_info.money = this.order_info.data.periodAmount * price_info.price * this.order_info.data.ipAmount;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
this.order_info.money = this.order_info.money.toFixed(2);
|
||||
},
|
||||
|
||||
// 查询短效无限量白名单数量
|
||||
get_whitelist_max() {
|
||||
const data = {
|
||||
cookie: document.cookie,
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: `${baseUrl}/http/user/white_limit_get_su`,
|
||||
data: data,
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
this.whitelist = res.data;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
312
Host/Views/User/HttpWhiteIpSU.cshtml
Normal file
312
Host/Views/User/HttpWhiteIpSU.cshtml
Normal file
@@ -0,0 +1,312 @@
|
||||
@{
|
||||
Layout = "_UserLayout";
|
||||
}
|
||||
|
||||
<div id="app">
|
||||
<div class="boxes margin-top-5 clearfix">
|
||||
<div style="display: flex; align-items: center;">
|
||||
<input v-model="ip" type="text" style="width: 350px; margin-right: 20px;" placeholder="请输入ip地址并点击保存白名单" />
|
||||
<button v-on:click="set_ip()" type="button" class="btn btn-primary"
|
||||
style="outline: none; box-shadow: none;">保存</button>
|
||||
</div>
|
||||
<div class="margin-top-30">
|
||||
<h5>当前白名单列表
|
||||
<span class="text-warning">当前白名单数量:{{ whiteLimit }} 个</span>
|
||||
<button type="button" class="btn btn-new btn-xs" data-toggle="modal" data-target="#whitelistModal"
|
||||
style="outline: none; box-shadow: none; margin-left: 60px;" v-on:click="get_package_details()">
|
||||
调整白名单上限
|
||||
</button>
|
||||
</h5>
|
||||
|
||||
<div class="modal fade" id="whitelistModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">调整白名单上限</h5>
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="d-flex align-items-center" style="gap: 15px;">
|
||||
<div class="modal-body btn-group" role="group">
|
||||
<button type="button" class="btn btn-new btn-xs" v-on:click="decreaseLimit"
|
||||
style=" outline: none; box-shadow: none;" :disabled="tempWhiteLimit <= 1">-</button>
|
||||
<span class="btn btn-default btn-xs">{{ tempWhiteLimit }}</span>
|
||||
<button type="button" class="btn btn-new btn-xs" v-on:click="increaseLimit"
|
||||
style="outline: none; box-shadow: none;" :disabled="tempWhiteLimit >= 20">+</button>
|
||||
</div>
|
||||
<div style="margin-left: 2rem; margin-bottom: 1rem">
|
||||
<span v-if="tempDiscount === 10">价格<span class="text-danger">无折扣</span></span>
|
||||
<span v-else class="text-danger">
|
||||
当前已应用 {{ tempDiscount*10 }}% 折扣
|
||||
</span>
|
||||
</div>
|
||||
<div style="margin-left: 2rem; margin-bottom: 1rem">
|
||||
调整后到期时间:{{ new Date(newExpre).toLocaleString() }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" v-on:click="set_white_limit()">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<table class="products-table responsive tablesaw tablesaw-stack" data-tablesaw-mode="stack">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>IP地址</th>
|
||||
<th>设置时间</th>
|
||||
<th>锁定状态</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="item in ip_list">
|
||||
<td style="display:none;">{{item.id}}</td>
|
||||
<td>{{item.ip}}</td>
|
||||
<td>{{item.createTime}}</td>
|
||||
<td>{{item.isLocked}}</td>
|
||||
<td>
|
||||
<a v-if="item.isLocked=='未锁定'" v-on:click="lock_ip(item.id,1)"
|
||||
class="btn btn-new">锁定</a>
|
||||
<a v-if="item.isLocked=='已锁定'" v-on:click="lock_ip(item.id,0)"
|
||||
class="btn btn-new">解锁</a>
|
||||
<a class="btn btn-danger" v-on:click="delete_ip(item.id)">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var baseUrl = '@ViewData["BaseUrl"]';
|
||||
var vm = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
ip_list: [],
|
||||
ip: '',
|
||||
whiteLimit: 1, //获取当前白名单的数量
|
||||
tempWhiteLimit: 1, //模态框中白名单的数量
|
||||
tempDiscount: 10,
|
||||
detail: {},
|
||||
newExpre: 0,
|
||||
},
|
||||
created: function () {
|
||||
this.get_list()
|
||||
this.get_white_limit()
|
||||
this.get_package_details()
|
||||
},
|
||||
methods: {
|
||||
get_list() {
|
||||
let data = {
|
||||
cookie: document.cookie,
|
||||
}
|
||||
var that = this;
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: `${baseUrl}/http/user/white_list_su`,
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
beforeSend: function (xhr) {
|
||||
xhr.withCredentials = true;
|
||||
},
|
||||
crossDomain: true,
|
||||
success: function (res) {
|
||||
that.ip_list = res.data
|
||||
}
|
||||
});
|
||||
},
|
||||
set_ip() {
|
||||
let data = {
|
||||
cookie: document.cookie,
|
||||
data: { ip: this.ip }
|
||||
}
|
||||
var that = this;
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: `${baseUrl}/http/user/create_white_ip_su`,
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
beforeSend: function (xhr) {
|
||||
xhr.withCredentials = true;
|
||||
},
|
||||
crossDomain: true,
|
||||
success: function (res) {
|
||||
that.get_list()
|
||||
}
|
||||
});
|
||||
},
|
||||
lock_ip(id, status) {
|
||||
var lock_ip = {};
|
||||
lock_ip.id = id;
|
||||
lock_ip.lock = status;
|
||||
let dataa = {
|
||||
cookie: document.cookie,
|
||||
data: lock_ip
|
||||
}
|
||||
var that = this;
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: `${baseUrl}/http/user/lock_ip_su`,
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(dataa),
|
||||
beforeSend: function (xhr) {
|
||||
xhr.withCredentials = true;
|
||||
},
|
||||
crossDomain: true,
|
||||
success: function (res) {
|
||||
that.get_list()
|
||||
}
|
||||
});
|
||||
},
|
||||
delete_ip(id) {
|
||||
var dalete_ip = {};
|
||||
dalete_ip.id = id;
|
||||
let dataa = {
|
||||
cookie: document.cookie,
|
||||
data: dalete_ip
|
||||
}
|
||||
var that = this;
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: `${baseUrl}/http/user/delete_ip_su`,
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(dataa),
|
||||
beforeSend: function (xhr) {
|
||||
xhr.withCredentials = true;
|
||||
},
|
||||
crossDomain: true,
|
||||
success: function (res) {
|
||||
that.get_list()
|
||||
}
|
||||
});
|
||||
},
|
||||
// 添加白名单数量
|
||||
setTempWhiteLimit(value) {
|
||||
this.tempWhiteLimit = Math.min(20, value)
|
||||
this.tempWhiteLimit = Math.max(1, value)
|
||||
this.tempDiscount = Math.max(6, 11 - value)
|
||||
|
||||
this.newExpre = this.calc_remain(this.detail.expireTime, this.whiteLimit, this.tempWhiteLimit)
|
||||
},
|
||||
increaseLimit() {
|
||||
this.setTempWhiteLimit(this.tempWhiteLimit + 1)
|
||||
},
|
||||
// 减少白名单数量
|
||||
decreaseLimit() {
|
||||
this.setTempWhiteLimit(this.tempWhiteLimit - 1)
|
||||
},
|
||||
//确定后把最新白名单数量调接口给后端
|
||||
set_white_limit() {
|
||||
let data = {
|
||||
cookie: document.cookie,
|
||||
data: { maxAmount: this.tempWhiteLimit }
|
||||
}
|
||||
var that = this;
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: `${baseUrl}/http/user/white_limit_set_su`,
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
beforeSend: function (xhr) {
|
||||
xhr.withCredentials = true;
|
||||
},
|
||||
crossDomain: true,
|
||||
success: function (res) {
|
||||
if (res.code > 0) {
|
||||
$('#whitelistModal').modal('hide');
|
||||
alert('白名单上限设置成功!');
|
||||
} else {
|
||||
alert('设置失败:' + (res.message || '未知错误'));
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
alert('设置失败,请重试!');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 获取白名单当前的数量
|
||||
get_white_limit() {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: `${baseUrl}/http/user/white_limit_get_su`,
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify({
|
||||
cookie: document.cookie,
|
||||
}),
|
||||
beforeSend: function (xhr) {
|
||||
xhr.withCredentials = true;
|
||||
},
|
||||
crossDomain: true,
|
||||
success: (res) => {
|
||||
if (res.code > 0) {
|
||||
this.whiteLimit = res.data
|
||||
this.setTempWhiteLimit(res.data)
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 获取最新套餐详情
|
||||
get_package_details() {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: `${baseUrl}/http/user/get_unlimited_available`,
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify({
|
||||
cookie: document.cookie,
|
||||
}),
|
||||
beforeSend: function (xhr) {
|
||||
xhr.withCredentials = true;
|
||||
},
|
||||
crossDomain: true,
|
||||
success: (res) => {
|
||||
if (res.code < 0) alert('获取套餐信息失败')
|
||||
this.detail = res.data
|
||||
this.setTempWhiteLimit(this.tempWhiteLimit)
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 计算修改白名单上限后的剩余时间
|
||||
calc_remain(expire, maxWhitelist, newMaxWhitelist) {
|
||||
|
||||
// 套餐剩余秒数
|
||||
const now = Math.floor(Date.now() / 1000)
|
||||
const prev = expire ?? now
|
||||
const remain = prev - now
|
||||
|
||||
// 白名单比值,时间份数
|
||||
const multiple = maxWhitelist / newMaxWhitelist
|
||||
|
||||
// 折扣比值,新折扣作为基准
|
||||
const oldDiscount = Math.max(.6, 1 - .1 * (maxWhitelist - 1))
|
||||
const newDiscount = Math.max(.6, 1 - .1 * (newMaxWhitelist - 1))
|
||||
const offset = oldDiscount / newDiscount
|
||||
|
||||
// 手续费,固定 1%
|
||||
const fee = 99 / 100
|
||||
|
||||
// 返回新到期时间
|
||||
return Math.floor(remain * multiple * offset * fee + now) * 1000
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"TestCountLimit": 3,
|
||||
"Service_BaseUrl": "http://hapi.hncore.net/",
|
||||
"BaseInfoUrl": "http://www.ipkd.com/",
|
||||
"NotifyUrl": "http://hapi.hncore.net/product/WxOrderCallBack",
|
||||
"Service_BaseUrl": "http://192.168.3.42:9000/",
|
||||
"BaseInfoUrl": "http://192.168.3.42:9000/",
|
||||
"NotifyUrl": "http://192.168.3.42:9000/product/WxOrderCallBack",
|
||||
"MySql": "Server=127.0.0.1;Database=hualianyun;User=root;Password=123456789;Convert Zero Datetime=True;TreatTinyAsBoolean=false;port=3306",
|
||||
"Redis": "127.0.0.1:6379,password=123456,defaultDatabase=1,poolsize=1",
|
||||
"Aliyun": {
|
||||
@@ -12,26 +12,22 @@
|
||||
"AliAccessKey": "ZG3uAkwPR4UpfsTJzG9DW1WeKIskHz"
|
||||
},
|
||||
"Pay": {
|
||||
"NotifyUrl": "http://www.juip.com/product/AliNotify",
|
||||
"ReturnUrl": "http://www.juip.com/product/AliReturn",
|
||||
"UNotifyUrl": "http://www.juip.com/user/AliNotify",
|
||||
"UReturnUrl": "http://www.juip.com/user/AliReturn",
|
||||
|
||||
"NotifyUrl": "http://192.168.3.42:9000/product/AliNotify",
|
||||
"ReturnUrl": "http://192.168.3.42:9000/product/AliReturn",
|
||||
"UNotifyUrl": "http://192.168.3.42:9000/user/AliNotify",
|
||||
"UReturnUrl": "http://192.168.3.42:9000/user/AliReturn",
|
||||
"AppId": "2021005115644614",
|
||||
"PublicKey": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgu0+q0O98pTQev1dNQdYfrsIx/vt19HQMKHvyetTBaL3w3xr/pJywUdsSBXyVk7roDjOWbXXoQzOkMLf6e0XJzBOh8pl+ZIfXJMh4a4pdL1FGzumueNzjtV7Y8AefTvfxsxaQFfPWN+xRp2c7EBVcT8olka0A1HhrLb3C7c+iPZLw3YR+0LiKFrMbLEXsi6RdmehAGqt6Kt8ouHPwUaQ9tV600XliyySZNDEG2UifXCX7GE1zj7iAeO23Y2lCb+gtKCmadoETnB12YCFTbSckGW/xYhOM+BqcTYXBN/TYG8hSwvwf2GSYUcx97XaHHfh6TgoygD6EzE/U5sOfVisGwIDAQAB",
|
||||
"PrivateKey": "MIIEogIBAAKCAQEApD5xBCfOL2aiayoPbXSp6TS8D24O8UXHCN6bnm8jqGtFwRA7kKcu9szoolaRvyyJQUKfzksU1/TEytMThO7f3J7eWy0ePI/6Fh1YZGf3SmM89zK7twBW41eY1T9nzolPpAyiUC860PM8ZL8nMNmJZFdNNYGaEX4cVwHjXAmvfe2w0H8U9fBimH6vRUXrmkFTTughnAjUgv3Oi2U8YH4AFSBkGTaQVHzlSDbEbi2wOju/zN61Nze3MnVrsIJRszZ0uUsEOxQt3alO9YrlVfmRK+/RSePeerrG+XnoSatBV41htNtijNujPuZR52+cqGC20w+KLDTW1E83k9pR72ic7wIDAQABAoIBAGmkA/tBQxw37pXxGrUzSapHEgL2rkO/ttJcpEmWgJ/uR5JzR2y2K73wdF0eQ2ZsVegU20bMAh8ZP46Zjz98iZ6UzL5mWcFoddnNjDIgsO02wVraVeTSIhDeId5fhvxQU1pYCfp7NmB5YsoGLUX9VaKliHK25osDy2SnQT7MuATNVwzqpfGDkZEWKnnjsrR726rcWIzOjH+FlBqFsVU4POpIKxTQ89VOJkQOUlfLwHUGck+DYR5AhgFSmrToqhUwiiG9W7S6RM1KyzYDaB3OExB0rErS48q3s4/EJSbTFVfhMB6rAmH3oR3pec2gDuTU9jIk/Vv2eBwZzdF6rnfYh/ECgYEA8ZLmOX06m1xZBTKM69OOgjBCX+G7BhTFAldjxLoZHFN6+Hxy5gD3bl7FwUsEoF4vVo7XFbEHVH4mGIFfEQrJ6y2UpXRlkIURK1j2w8NvjinAWxtVb/bfF+CSjEOTOyhoA4t+qOTxbhluS1KxbN9tiWtwnDaK/BN13pSLec9ba6kCgYEArg1ZGLY6RNKu29FTiDB6Ag7/Or1dOvA/LT0fai+400uNz9yB7Q5a0Mx+UOciFqaRuFIRHh7YUVkqu/duzujLktFU41CzKQGOjwpGB7SrOfX/jWiT6wW6jCAdQ9KXp9zjc0KslhwwzprHlEQkMZCnLBL4/aJ2fmVgVEVMLz2m4tcCgYAJSBGcZ9lWmse40WZksS4qhlwmfu/Gngmru1vT9Sp90h9JaM6pU6QuE2oZsR4uYzACbV6KMNENSAOCsYXLi9SSOqAZc01rrhEozzQ79UhV9/iyB2zS7nNH4ZL/3KDNhxHoAPYO2y0Dg+qe7kBu5G669uvOtLHGWaEPujlZpsPmcQKBgAvp8f1VC+wGF94IGBWsa82URTg6GhWcuFZaZroYBijAdTaTO3mEkAbW2JalG5o9UKAzTeSn69q1pc00BKu5F6Y3Gf5tWbYm2yFDbMO+RDI1eoatb+KYg8pvsFEiKytcXV1YZQPpbhXWVm75sxiJdEf6DH0gD8hbHBrom2xoZfIFAoGAXPDKBpuEw2+cwZNi6SkZn7J3xJ0XQL6yEFRTWVXIbdk6R4iRL2AbdnoiwKaMmvYQd2HTN34raGW39DzCRzgWzrKUoOTXwj3F/aSfpcuGPeZrBh/f419GoDZtWhibAjxqrn9h6uEKclAWOGj82uC6oof9nCqQIp5WqPaixAa4ceE="
|
||||
|
||||
},
|
||||
"PayH5": {
|
||||
"NotifyUrl": "http://www.juip.com/product/AliNotifyH5",
|
||||
"ReturnUrl": "http://www.juip.com/product/AliReturnH5",
|
||||
"UNotifyUrl": "http://www.juip.com/user/AliNotifyH5",
|
||||
"UReturnUrl": "http://www.juip.com/user/AliReturnH5",
|
||||
|
||||
"NotifyUrl": "http://192.168.3.42:9000/product/AliNotifyH5",
|
||||
"ReturnUrl": "http://192.168.3.42:9000/product/AliReturnH5",
|
||||
"UNotifyUrl": "http://192.168.3.42:9000/user/AliNotifyH5",
|
||||
"UReturnUrl": "http://192.168.3.42:9000/user/AliReturnH5",
|
||||
"AppId": "2021005115644614",
|
||||
"PublicKey": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgu0+q0O98pTQev1dNQdYfrsIx/vt19HQMKHvyetTBaL3w3xr/pJywUdsSBXyVk7roDjOWbXXoQzOkMLf6e0XJzBOh8pl+ZIfXJMh4a4pdL1FGzumueNzjtV7Y8AefTvfxsxaQFfPWN+xRp2c7EBVcT8olka0A1HhrLb3C7c+iPZLw3YR+0LiKFrMbLEXsi6RdmehAGqt6Kt8ouHPwUaQ9tV600XliyySZNDEG2UifXCX7GE1zj7iAeO23Y2lCb+gtKCmadoETnB12YCFTbSckGW/xYhOM+BqcTYXBN/TYG8hSwvwf2GSYUcx97XaHHfh6TgoygD6EzE/U5sOfVisGwIDAQAB",
|
||||
"PrivateKey": "MIIEogIBAAKCAQEApD5xBCfOL2aiayoPbXSp6TS8D24O8UXHCN6bnm8jqGtFwRA7kKcu9szoolaRvyyJQUKfzksU1/TEytMThO7f3J7eWy0ePI/6Fh1YZGf3SmM89zK7twBW41eY1T9nzolPpAyiUC860PM8ZL8nMNmJZFdNNYGaEX4cVwHjXAmvfe2w0H8U9fBimH6vRUXrmkFTTughnAjUgv3Oi2U8YH4AFSBkGTaQVHzlSDbEbi2wOju/zN61Nze3MnVrsIJRszZ0uUsEOxQt3alO9YrlVfmRK+/RSePeerrG+XnoSatBV41htNtijNujPuZR52+cqGC20w+KLDTW1E83k9pR72ic7wIDAQABAoIBAGmkA/tBQxw37pXxGrUzSapHEgL2rkO/ttJcpEmWgJ/uR5JzR2y2K73wdF0eQ2ZsVegU20bMAh8ZP46Zjz98iZ6UzL5mWcFoddnNjDIgsO02wVraVeTSIhDeId5fhvxQU1pYCfp7NmB5YsoGLUX9VaKliHK25osDy2SnQT7MuATNVwzqpfGDkZEWKnnjsrR726rcWIzOjH+FlBqFsVU4POpIKxTQ89VOJkQOUlfLwHUGck+DYR5AhgFSmrToqhUwiiG9W7S6RM1KyzYDaB3OExB0rErS48q3s4/EJSbTFVfhMB6rAmH3oR3pec2gDuTU9jIk/Vv2eBwZzdF6rnfYh/ECgYEA8ZLmOX06m1xZBTKM69OOgjBCX+G7BhTFAldjxLoZHFN6+Hxy5gD3bl7FwUsEoF4vVo7XFbEHVH4mGIFfEQrJ6y2UpXRlkIURK1j2w8NvjinAWxtVb/bfF+CSjEOTOyhoA4t+qOTxbhluS1KxbN9tiWtwnDaK/BN13pSLec9ba6kCgYEArg1ZGLY6RNKu29FTiDB6Ag7/Or1dOvA/LT0fai+400uNz9yB7Q5a0Mx+UOciFqaRuFIRHh7YUVkqu/duzujLktFU41CzKQGOjwpGB7SrOfX/jWiT6wW6jCAdQ9KXp9zjc0KslhwwzprHlEQkMZCnLBL4/aJ2fmVgVEVMLz2m4tcCgYAJSBGcZ9lWmse40WZksS4qhlwmfu/Gngmru1vT9Sp90h9JaM6pU6QuE2oZsR4uYzACbV6KMNENSAOCsYXLi9SSOqAZc01rrhEozzQ79UhV9/iyB2zS7nNH4ZL/3KDNhxHoAPYO2y0Dg+qe7kBu5G669uvOtLHGWaEPujlZpsPmcQKBgAvp8f1VC+wGF94IGBWsa82URTg6GhWcuFZaZroYBijAdTaTO3mEkAbW2JalG5o9UKAzTeSn69q1pc00BKu5F6Y3Gf5tWbYm2yFDbMO+RDI1eoatb+KYg8pvsFEiKytcXV1YZQPpbhXWVm75sxiJdEf6DH0gD8hbHBrom2xoZfIFAoGAXPDKBpuEw2+cwZNi6SkZn7J3xJ0XQL6yEFRTWVXIbdk6R4iRL2AbdnoiwKaMmvYQd2HTN34raGW39DzCRzgWzrKUoOTXwj3F/aSfpcuGPeZrBh/f419GoDZtWhibAjxqrn9h6uEKclAWOGj82uC6oof9nCqQIp5WqPaixAa4ceE="
|
||||
|
||||
}
|
||||
},
|
||||
"RabbitMqConfig": {
|
||||
@@ -48,4 +44,4 @@
|
||||
"MchId": "1571608411",
|
||||
"MchKey": "846b9b0ea4aa4d5ca701e2c9f0aa6dae"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user