🍻 添加订单汇总

This commit is contained in:
sunxiaolong
2024-06-19 22:36:30 +08:00
parent 3628542a2b
commit 23d1af53c5
8 changed files with 55 additions and 11 deletions

View File

@@ -3,10 +3,10 @@ httpport = 12306
runmode = dev
HTTPAddr = localhost
sessionon = true
sessionprovider = redis
sessiongcmaxlifetime = 86400
sessioncookielifetime = 86400
sessionProviderConfig = 127.0.0.1:6379,100,astaxie
# sessionprovider = redis
# sessiongcmaxlifetime = 86400
# sessioncookielifetime = 86400
# sessionProviderConfig = 127.0.0.1:6379,100,astaxie
[mysql]
dbhost = localhost

View File

@@ -5,7 +5,6 @@ import (
"boss/config"
"boss/utils"
"encoding/base64"
"fmt"
"strconv"
"time"
@@ -92,20 +91,34 @@ func (c *PageAuthController) RechargeAppleAccountPage() {
currentTime := time.Now()
targetMinute := (currentTime.Minute() / 10) * 10
targetTime := time.Date(currentTime.Year(), currentTime.Month(), currentTime.Day(), currentTime.Hour(), targetMinute, 0, 0, currentTime.Location())
now := strconv.Itoa(int(targetTime.Unix()))
secretCfg := config.GetSecret()
tokenB, err := utils.AesCBCEncrypt([]byte(now), []byte(secretCfg.Key), []byte(secretCfg.IV))
if err == nil {
//base64编码
token = base64.URLEncoding.EncodeToString(tokenB)
}
c.Data["token"] = token
fmt.Println("token", token)
c.TplName = "apple-card/account.html"
}
func (c *PageAuthController) OrderSummary() {
token := ""
// 获取当前时间的时间戳
currentTime := time.Now()
targetMinute := (currentTime.Minute() / 10) * 10
targetTime := time.Date(currentTime.Year(), currentTime.Month(), currentTime.Day(), currentTime.Hour(), targetMinute, 0, 0, currentTime.Location())
now := strconv.Itoa(int(targetTime.Unix()))
secretCfg := config.GetSecret()
tokenB, err := utils.AesCBCEncrypt([]byte(now), []byte(secretCfg.Key), []byte(secretCfg.IV))
if err == nil {
//base64编码
token = base64.URLEncoding.EncodeToString(tokenB)
}
c.Data["token"] = token
c.TplName = "order_summary.html"
}
func (c *PageAuthController) RechargeAppleOrderPage() {
token := ""
// 获取当前时间的时间戳

View File

@@ -3,6 +3,14 @@ services:
build:
context: .
container_name: kami_boss
deploy:
resources:
limits:
cpus: '0.8'
memory: 3096M
reservations:
cpus: '0.2'
memory: 512M
image: kami_boss:0.11
restart: always
ports:

View File

@@ -52,6 +52,7 @@ type OrderInfo struct {
ExValue string
CardData string
CardReturnData string
Ip string `json:"IP"`
UpdateTime time.Time
CreateTime time.Time // 订单创建时间
PayTime time.Time // 用户支付时间

View File

@@ -21,6 +21,7 @@ func init() {
beego.Router("/merchant.html", &controllers.PageAuthController{}, "*:MerchantPage")
beego.Router("/merchant_v2.html", &controllers.PageAuthController{}, "*:MerchantV2Page")
beego.Router("/order-summary-info.html", &controllers.PageAuthController{}, "*:OrderSummary")
beego.Router("/recharge-apple-card-account.html", &controllers.PageAuthController{}, "*:RechargeAppleAccountPage")
beego.Router("/recharge-apple-card-order.html", &controllers.PageAuthController{}, "*:RechargeAppleOrderPage")

View File

@@ -354,6 +354,7 @@
<div class="second-menu">
<a href="#" onclick='loadMainContent("/order_info.html")'><span>实时订单</span></a>
<a href="#" onclick='loadMainContent("/order_profit.html")'><span>订单收益</span></a>
<a href="#" onclick='loadMainContent("/order-summary-info.html")'><span>订单汇总</span></a>
</div>
</div>

View File

@@ -240,8 +240,9 @@
<th>退款状态</th>
<th>下单时间</th>
<th>支付时间</th>
<th>上游供应商</th>
<!-- <th>上游供应商</th>-->
<th>上游返回数据</th>
<th>用户IP</th>
<th>操作</th>
</tr>
</thead>
@@ -513,7 +514,7 @@
tmp += "<th>" + "未被退款" + "</th>"
}
tmp = tmp +
`<th>${new Date(v.CreateTime).toLocaleString()}</th><th>${new Date(v.PayTime).getFullYear() !== 1 ? new Date(v.PayTime).toLocaleString() : ''}</th><th>${v.PayProductName}</th><th>${v.CardReturnData}</th>`;
`<th>${new Date(v.CreateTime).toLocaleString()}</th><th>${new Date(v.PayTime).getFullYear() !== 1 ? new Date(v.PayTime).toLocaleString() : ''}</th><th>${v.CardReturnData}</th><th>${v.IP}</th>`;
tmp = tmp.replace("wait", "等待支付").replace("success", "支付成功").replace("fail", "支付失败").replace("cancel", "放弃支付").replace("created", "创建");
tmp = tmp +
"<th>" + '<div class="btn-group" role="group" aria-label="...">' +
@@ -743,7 +744,7 @@
$("#road-uid").html(order.RoadUid);
$("#road-name").html(order.RoadName);
$("#pay-product-code").html(order.PayProductCode);
$("#pay-product-name").html(order.PayProductName);
// $("#pay-product-name").html(order.PayProductName);
$("#pay-type-code").html(order.PayTypeCode);
$("#pay-type-name").html(order.PayTypeName);
$("#notify").html(res.NotifyUrl);

19
views/order_summary.html Normal file
View File

@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="zh">
<body>
<iframe src="">
</iframe>
</body>
<style>
iframe {
width: 100%;
height: 90vh;
}
</style>
<script>
// 构建链接
const url = "http://" + window.location.hostname + ":12400" + "/iframe/orderSummary?token={{.token}}";
// 链接添加至到iframe中
document.getElementsByTagName("iframe")[0].src = url;
</script>
</html>