更新配置文件,调整前端展示数据,优化 JS 代码结构,提升代码可读性和维护性。

This commit is contained in:
danial
2025-06-09 01:50:38 +08:00
parent e853888c9d
commit 4f35a2148c
6 changed files with 838 additions and 757 deletions

View File

@@ -1,2 +1,2 @@
python 3.13.3
golang 1.24.3
python 3.13.3
golang 1.24.3

View File

@@ -1,34 +1,34 @@
appname = jhmerchant
httpport = 12307
#runmode = pro
runmode = prod
HTTPAddr =0.0.0.0
#日志配置
[logs]
# 0 ~ 7, 日志级别
#level =7
level = 7
#日志保存路径
filepath= ./logs/jhmerchant.log
#需要显示的日志信息
separate="["emergency","alert","critical","error","warning","notice","info","debug"]"
#日志保存最大天数
maxdays=10
[mysql]
dbhost = 127.0.0.1
dbport = 3306
dbuser = root
dbpasswd = Woaizixkie!123
dbbase = kami
debug = true
[redis]
host = localhost
port = 6379
password = 123
[secret]
key = thisis32bitlongpassphraseimusing
iv = 1234567890123456
appname = jhmerchant
httpport = 12307
#runmode = pro
runmode = prod
HTTPAddr =0.0.0.0
#日志配置
[logs]
# 0 ~ 7, 日志级别
#level =7
level = 7
#日志保存路径
filepath= ./logs/jhmerchant.log
#需要显示的日志信息
separate="["emergency","alert","critical","error","warning","notice","info","debug"]"
#日志保存最大天数
maxdays=10
[mysql]
dbhost = 127.0.0.1
dbport = 3306
dbuser = root
dbpasswd = Woaizixkie!123
dbbase = kami
debug = true
[redis]
host = localhost
port = 6379
password = 123
[secret]
key = thisis32bitlongpassphraseimusing
iv = 1234567890123456

View File

@@ -1,48 +1,48 @@
package config
import (
"github.com/beego/beego/v2/core/config/env"
"github.com/beego/beego/v2/server/web"
)
func GetGatewayAddr() string {
return "http://kami_gateway:12309"
}
func GetShopAddr() string {
shopAddr := env.Get("shopAddr", "")
if shopAddr != "" {
return shopAddr
}
return web.AppConfig.DefaultString("shopAddr", web.AppConfig.DefaultString("shopHost", "https://127.0.0.1:12305"))
}
func GetPortalAddr() string {
portalAddr := env.Get("portalAddr", "")
if portalAddr != "" {
return portalAddr
}
return web.AppConfig.DefaultString("portalAddr", web.AppConfig.DefaultString("frontendHost", "https://127.0.0.1:22400"))
}
func GetRedisCfg() (RedisCfg, error) {
host, err := web.AppConfig.String("redis::host")
if err != nil {
return RedisCfg{}, err // 返回错误
}
port, err := web.AppConfig.Int("redis::port")
if err != nil {
return RedisCfg{}, err // 返回错误
}
password, err := web.AppConfig.String("redis::password")
if err != nil {
return RedisCfg{}, err // 返回错误
}
return RedisCfg{
Host: host,
Port: port,
Password: password,
}, nil
}
package config
import (
"github.com/beego/beego/v2/core/config/env"
"github.com/beego/beego/v2/server/web"
)
func GetGatewayAddr() string {
return "http://kami_gateway:12309"
}
func GetShopAddr() string {
shopAddr := env.Get("shopAddr", "")
if shopAddr != "" {
return shopAddr
}
return web.AppConfig.DefaultString("shopAddr", web.AppConfig.DefaultString("shopHost", "https://127.0.0.1:12305"))
}
func GetPortalAddr() string {
portalAddr := env.Get("portalAddr", "")
if portalAddr != "" {
return portalAddr
}
return web.AppConfig.DefaultString("portalAddr", web.AppConfig.DefaultString("frontendHost", "https://127.0.0.1:22400"))
}
func GetRedisCfg() (RedisCfg, error) {
host, err := web.AppConfig.String("redis::host")
if err != nil {
return RedisCfg{}, err // 返回错误
}
port, err := web.AppConfig.Int("redis::port")
if err != nil {
return RedisCfg{}, err // 返回错误
}
password, err := web.AppConfig.String("redis::password")
if err != nil {
return RedisCfg{}, err // 返回错误
}
return RedisCfg{
Host: host,
Port: port,
Password: password,
}, nil
}

View File

@@ -1,288 +1,330 @@
package controllers
import (
"fmt"
"math"
"merchant/internal/models/account"
merchant2 "merchant/internal/models/merchant"
order2 "merchant/internal/models/order"
"merchant/internal/models/road"
"merchant/internal/sys/enum"
"strconv"
"github.com/duke-git/lancet/v2/mathutil"
"github.com/duke-git/lancet/v2/slice"
)
type Index struct {
KeepSession
}
// ShowUI 首页
func (c *Index) ShowUI() {
us := c.GetSession(enum.UserSession)
u := us.(merchant2.MerchantInfo)
c.Data["userName"] = u.MerchantName
c.TplName = "index.html"
}
// LoadUserAccountInfo 加载用户账户金额信息
func (c *Index) LoadUserAccountInfo() {
us := c.GetSession(enum.UserSession)
u := us.(merchant2.MerchantInfo)
ac := account.GetAccountByUid(u.MerchantUid)
info := make(map[string]any)
// 账户余额
info["balanceAmt"] = pubMethod.FormatFloat64ToString(ac.Balance)
// // 可用余额
// info["settAmount"] = pubMethod.FormatFloat64ToString(ac.WaitAmount)
// // 冻结金额
// info["freezeAmt"] = pubMethod.FormatFloat64ToString(ac.FreezeAmount)
// // 押款金额
// info["amountFrozen"] = pubMethod.FormatFloat64ToString(ac.LoanAmount)
c.Data["json"] = info
c.ServeJSON(true)
}
// LoadCountOrder 加载总订单信息
func (c *Index) LoadCountOrder() {
ctx := c.Ctx.Request.Context()
us := c.GetSession(enum.UserSession)
u := us.(merchant2.MerchantInfo)
md := merchant2.GetMerchantDeployByUid(ctx, u.MerchantUid)
type orderInPayWay struct {
PayWayName string // 支付方式名
OrderCount int // 订单数
SucOrderCount int // 成功订单数
SucRate string // 成功率
}
ways := make([]orderInPayWay, len(md))
for k, v := range md {
in := make(map[string]string)
in["merchant_uid"] = u.MerchantUid
ways[k].PayWayName = road.GetRoadInfoByRoadUid(ctx, v.SingleRoadUid).ProductName
in["road_uid"] = v.SingleRoadUid
ways[k].OrderCount = order2.GetOrderLenByMap(in)
in["status"] = enum.SUCCESS
ways[k].SucOrderCount = order2.GetOrderLenByMap(in)
if ways[k].OrderCount == 0 {
ways[k].SucRate = "0"
continue
}
ways[k].SucRate = fmt.Sprintf("%0.4f", float64(ways[k].SucOrderCount)/float64(ways[k].OrderCount))
}
c.Data["json"] = ways
c.ServeJSON()
c.StopRun()
}
// LoadOrderCount 加载总订单数
func (c *Index) LoadOrderCount() {
ctx := c.Ctx.Request.Context()
us := c.GetSession(enum.UserSession)
u := us.(merchant2.MerchantInfo)
in := make(map[string]string)
out := make(map[string]any)
in["merchant_uid"] = u.MerchantUid
out["orders"] = order2.GetOrderLenByMap(in)
in["status"] = enum.SUCCESS
out["suc_orders"] = order2.GetOrderLenByMap(in)
{
supplierAll := 0.0
platformAll := 0.0
agentAll := 0.0
allAmount := 0.0
TadaySuccessNum := 0
datainfo := order2.GetOrderProfitByMap(ctx, in, -1, 0)
for _, v := range datainfo {
if v.Status != "success" {
continue
}
allAmount += v.FactAmount
supplierAll += v.SupplierProfit
platformAll += v.PlatformProfit
agentAll += v.AgentProfit
TadaySuccessNum += 1
}
out["TadaySupplierProfit"], _ = strconv.ParseFloat(fmt.Sprintf("%.3f", supplierAll), 64)
out["TadayPlatformProfit"], _ = strconv.ParseFloat(fmt.Sprintf("%.3f", platformAll), 64)
out["TadayAgentProfit"], _ = strconv.ParseFloat(fmt.Sprintf("%.3f", agentAll), 64)
out["TadayAllAmount"], _ = strconv.ParseFloat(fmt.Sprintf("%.3f", allAmount), 64)
out["TadaySuccessNum"] = TadaySuccessNum
out["TadayAllNum"] = len(datainfo)
}
if out["orders"].(int) == 0 {
out["suc_rate"] = 0
} else {
out["suc_rate"] = fmt.Sprintf("%0.4f", math.Round(float64(out["suc_orders"].(int))/float64(out["orders"].(int))*10000)/10000)
}
c.Data["json"] = out
c.ServeJSON()
}
// LoadUserPayWayUI 加载用户支付配置
func (c *Index) LoadUserPayWayUI() {
us := c.GetSession(enum.UserSession)
u := us.(merchant2.MerchantInfo)
c.Data["userName"] = u.MerchantName
c.TplName = "pay_way.html"
}
func (c *Index) LoadUserPayWay() {
ctx := c.Ctx.Request.Context()
us := c.GetSession(enum.UserSession)
u := us.(merchant2.MerchantInfo)
md := merchant2.GetMerchantDeployByUid(ctx, u.MerchantUid)
type payConfig struct {
No string `json:"no"` // 通道编号
Name string `json:"name"` // 产品名
Rate float64 `json:"rate"` // 通道费率
Status string `json:"status"` // 通道状态
TodayAmount float64 `json:"todayAmount"` // 今日订单金额
TodayNum int `json:"todayNum"` // 今日订单数
TodaySucNum int `json:"todaySucNum"` // 今日成功订单数
TodaySucAmount float64 `json:"todaySucAmount"` // 今日成功订单金额
YesterdayAmount float64 `json:"yesterdayAmount"` // 昨日订单金额
YesterdayNum int `json:"yesterdayNum"` // 昨日订单数
YesterdaySucNum int `json:"yesterdaySucNum"` // 昨日成功订单数
YesterdaySucAmount float64 `json:"yesterdaySucAmount"` // 昨日成功订单金额
TodaySucRate float64 `json:"todaySucRate"` // 今日成功率
YesterdaySucRate float64 `json:"yesterdaySucRate"` // 昨日成功率
TotalAmount float64 `json:"totalAmount"` // 总订单金额
TotalNum int `json:"totalNum"` // 总订单数
TotalSucNum int `json:"totalSucNum"` // 总成功订单数
TotalSucRate float64 `json:"totalSucRate"` // 总成功率
TotalSucAmount float64 `json:"totalSucAmount"` // 总成功订单金额
}
type TotalSummary struct {
TodayAmount float64 `json:"todayAmount"` // 今日订单金额
TodayNum int `json:"todayNum"` // 今日订单数
TodaySucNum int `json:"todaySucNum"` // 今日成功订单数
TodaySucAmount float64 `json:"todaySucAmount"` // 今日成功订单金额
YesterdayAmount float64 `json:"yesterdayAmount"` // 昨日订单金额
YesterdayNum int `json:"yesterdayNum"` // 昨日订单数
YesterdaySucNum int `json:"yesterdaySucNum"` // 昨日成功订单数
YesterdaySucAmount float64 `json:"yesterdaySucAmount"` // 昨日成功订单金额
TodaySucRate float64 `json:"todaySucRate"` // 今日成功率
YesterdaySucRate float64 `json:"yesterdaySucRate"` // 昨日成功率
TotalAmount float64 `json:"totalAmount"` // 总订单金额
TotalNum int `json:"totalNum"` // 总订单数
TotalSucNum int `json:"totalSucNum"` // 总成功订单数
TotalSucRate float64 `json:"totalSucRate"` // 总成功率
TotalSucAmount float64 `json:"totalSucAmount"` // 总成功订单金额
}
totalSummary := TotalSummary{}
ways := slice.Map(md, func(index int, item merchant2.MerchantDeployInfo) payConfig {
road_ := road.GetRoadInfoByRoadUid(ctx, item.SingleRoadUid)
config := payConfig{
No: item.SingleRoadUid,
Name: road_.RoadName,
Rate: item.RollRoadPlatformRate,
}
rates := slice.Map(item.PlatformRate(ctx), func(index int, item merchant2.ProfitMargin) float64 {
return item.Value
})
if len(rates) > 0 {
config.Rate = mathutil.Average(rates...)
}
summary := order2.GetSummaryByRoadAndMerchant(ctx, item.SingleRoadUid, u.MerchantUid)
if len(summary) == 0 {
return config
}
config.TodayAmount = summary[0].TotalAmount
config.TodayNum = summary[0].TotalNum
config.TodaySucNum = summary[0].SuccessNum
config.TodaySucAmount = summary[0].SuccessAmount
config.TodaySucRate = summary[0].Rate
if len(summary) > 1 {
config.YesterdayAmount = summary[1].TotalAmount
config.YesterdayNum = summary[1].TotalNum
config.YesterdaySucNum = summary[1].SuccessNum
config.YesterdaySucAmount = summary[1].SuccessAmount
config.YesterdaySucRate = summary[1].Rate
}
config.TotalAmount = mathutil.Sum(slice.Map(summary, func(index int, item order2.Summary) float64 {
return item.TotalAmount
})...)
config.TotalNum = mathutil.Sum(slice.Map(summary, func(index int, item order2.Summary) int {
return item.TotalNum
})...)
config.TotalSucNum = mathutil.Sum(slice.Map(summary, func(index int, item order2.Summary) int {
return item.SuccessNum
})...)
config.TotalSucAmount = mathutil.Sum(slice.Map(summary, func(index int, item order2.Summary) float64 {
return item.SuccessAmount
})...)
if config.TotalNum != 0 {
config.TotalSucRate = mathutil.RoundToFloat(float64(config.TotalSucNum)/float64(config.TotalNum)*100, 2)
}
return config
})
totalSummaryList := order2.GetSummaryByMerchant(ctx, u.MerchantUid)
if len(totalSummaryList) > 0 {
totalSummary.TodayAmount = totalSummaryList[0].TotalAmount
totalSummary.TodayNum = totalSummaryList[0].TotalNum
totalSummary.TodaySucNum = totalSummaryList[0].SuccessNum
totalSummary.TodaySucAmount = totalSummaryList[0].SuccessAmount
totalSummary.TodaySucRate = totalSummaryList[0].Rate
}
if len(totalSummaryList) > 1 {
totalSummary.YesterdayAmount = totalSummaryList[1].TotalAmount
totalSummary.YesterdayNum = totalSummaryList[1].TotalNum
totalSummary.YesterdaySucNum = totalSummaryList[1].SuccessNum
totalSummary.YesterdaySucAmount = totalSummaryList[1].SuccessAmount
totalSummary.YesterdaySucRate = totalSummaryList[1].Rate
}
for _, v := range totalSummaryList {
totalSummary.TotalAmount += v.TotalAmount
totalSummary.TotalNum += v.TotalNum
totalSummary.TotalSucNum += v.SuccessNum
totalSummary.TotalSucAmount += v.SuccessAmount
}
if totalSummary.TotalNum != 0 {
totalSummary.TotalSucRate = mathutil.RoundToFloat(float64(totalSummary.TotalSucNum)/float64(totalSummary.TotalNum)*100, 2)
}
response := struct {
Ways []payConfig `json:"ways"`
TotalSummary TotalSummary `json:"totalSummary"`
}{
Ways: ways,
TotalSummary: totalSummary,
}
c.Data["json"] = response
c.ServeJSON()
}
package controllers
import (
"fmt"
"math"
"merchant/internal/models/account"
merchant2 "merchant/internal/models/merchant"
order2 "merchant/internal/models/order"
"merchant/internal/models/road"
"merchant/internal/sys/enum"
"strconv"
"github.com/duke-git/lancet/v2/mathutil"
"github.com/duke-git/lancet/v2/slice"
)
type Index struct {
KeepSession
}
// ShowUI 首页
func (c *Index) ShowUI() {
us := c.GetSession(enum.UserSession)
u := us.(merchant2.MerchantInfo)
c.Data["userName"] = u.MerchantName
c.TplName = "index.html"
}
// LoadUserAccountInfo 加载用户账户金额信息
func (c *Index) LoadUserAccountInfo() {
us := c.GetSession(enum.UserSession)
ctx := c.Ctx.Request.Context()
u := us.(merchant2.MerchantInfo)
ac := account.GetAccountByUid(u.MerchantUid)
info := make(map[string]any)
// 账户余额
info["balanceAmt"] = pubMethod.FormatFloat64ToString(ac.Balance)
type TotalSummary struct {
TodayAmount float64 `json:"todayAmount"` // 今日订单金额
TodayNum int `json:"todayNum"` // 今日订单数
TodaySucNum int `json:"todaySucNum"` // 今日成功订单数
TodaySucAmount float64 `json:"todaySucAmount"` // 今日成功订单金额
YesterdayAmount float64 `json:"yesterdayAmount"` // 昨日订单金额
YesterdayNum int `json:"yesterdayNum"` // 昨日订单数
YesterdaySucNum int `json:"yesterdaySucNum"` // 昨日成功订单数
YesterdaySucAmount float64 `json:"yesterdaySucAmount"` // 昨日成功订单金额
TodaySucRate float64 `json:"todaySucRate"` // 今日成功率
YesterdaySucRate float64 `json:"yesterdaySucRate"` // 昨日成功率
TotalAmount float64 `json:"totalAmount"` // 总订单金额
TotalNum int `json:"totalNum"` // 总订单数
TotalSucNum int `json:"totalSucNum"` // 总成功订单数
TotalSucRate float64 `json:"totalSucRate"` // 总成功率
TotalSucAmount float64 `json:"totalSucAmount"` // 总成功订单金额
}
totalSummary := TotalSummary{}
totalSummaryList := order2.GetSummaryByMerchant(ctx, u.MerchantUid)
if len(totalSummaryList) > 0 {
totalSummary.TodayAmount = totalSummaryList[0].TotalAmount
totalSummary.TodayNum = totalSummaryList[0].TotalNum
totalSummary.TodaySucNum = totalSummaryList[0].SuccessNum
totalSummary.TodaySucAmount = totalSummaryList[0].SuccessAmount
totalSummary.TodaySucRate = totalSummaryList[0].Rate
}
for _, v := range totalSummaryList {
totalSummary.TotalAmount += v.TotalAmount
totalSummary.TotalNum += v.TotalNum
totalSummary.TotalSucNum += v.SuccessNum
totalSummary.TotalSucAmount += v.SuccessAmount
}
if totalSummary.TotalNum != 0 {
totalSummary.TotalSucRate = mathutil.RoundToFloat(float64(totalSummary.TotalSucNum)/float64(totalSummary.TotalNum)*100, 2)
}
// 可用余额
info["settAmount"] = pubMethod.FormatFloat64ToString(totalSummary.TotalSucAmount)
// 冻结金额
info["freezeAmt"] = pubMethod.FormatFloat64ToString(totalSummary.TotalSucAmount)
// 押款金额
info["amountFrozen"] = pubMethod.FormatFloat64ToString(totalSummary.TotalSucRate)
c.Data["json"] = info
c.ServeJSON(true)
}
// LoadCountOrder 加载总订单信息
func (c *Index) LoadCountOrder() {
ctx := c.Ctx.Request.Context()
us := c.GetSession(enum.UserSession)
u := us.(merchant2.MerchantInfo)
md := merchant2.GetMerchantDeployByUid(ctx, u.MerchantUid)
type orderInPayWay struct {
PayWayName string // 支付方式名
OrderCount int // 订单数
SucOrderCount int // 成功订单数
SucRate string // 成功率
}
ways := make([]orderInPayWay, len(md))
for k, v := range md {
in := make(map[string]string)
in["merchant_uid"] = u.MerchantUid
ways[k].PayWayName = road.GetRoadInfoByRoadUid(ctx, v.SingleRoadUid).ProductName
in["road_uid"] = v.SingleRoadUid
ways[k].OrderCount = order2.GetOrderLenByMap(in)
in["status"] = enum.SUCCESS
ways[k].SucOrderCount = order2.GetOrderLenByMap(in)
if ways[k].OrderCount == 0 {
ways[k].SucRate = "0"
continue
}
ways[k].SucRate = fmt.Sprintf("%0.4f", float64(ways[k].SucOrderCount)/float64(ways[k].OrderCount))
}
c.Data["json"] = ways
c.ServeJSON()
c.StopRun()
}
// LoadOrderCount 加载总订单数
func (c *Index) LoadOrderCount() {
ctx := c.Ctx.Request.Context()
us := c.GetSession(enum.UserSession)
u := us.(merchant2.MerchantInfo)
in := make(map[string]string)
out := make(map[string]any)
in["merchant_uid"] = u.MerchantUid
out["orders"] = order2.GetOrderLenByMap(in)
in["status"] = enum.SUCCESS
out["suc_orders"] = order2.GetOrderLenByMap(in)
{
supplierAll := 0.0
platformAll := 0.0
agentAll := 0.0
allAmount := 0.0
TadaySuccessNum := 0
datainfo := order2.GetOrderProfitByMap(ctx, in, -1, 0)
for _, v := range datainfo {
if v.Status != "success" {
continue
}
allAmount += v.FactAmount
supplierAll += v.SupplierProfit
platformAll += v.PlatformProfit
agentAll += v.AgentProfit
TadaySuccessNum += 1
}
out["TadaySupplierProfit"], _ = strconv.ParseFloat(fmt.Sprintf("%.3f", supplierAll), 64)
out["TadayPlatformProfit"], _ = strconv.ParseFloat(fmt.Sprintf("%.3f", platformAll), 64)
out["TadayAgentProfit"], _ = strconv.ParseFloat(fmt.Sprintf("%.3f", agentAll), 64)
out["TadayAllAmount"], _ = strconv.ParseFloat(fmt.Sprintf("%.3f", allAmount), 64)
out["TadaySuccessNum"] = TadaySuccessNum
out["TadayAllNum"] = len(datainfo)
}
if out["orders"].(int) == 0 {
out["suc_rate"] = 0
} else {
out["suc_rate"] = fmt.Sprintf("%0.4f", math.Round(float64(out["suc_orders"].(int))/float64(out["orders"].(int))*10000)/10000)
}
c.Data["json"] = out
c.ServeJSON()
}
// LoadUserPayWayUI 加载用户支付配置
func (c *Index) LoadUserPayWayUI() {
us := c.GetSession(enum.UserSession)
u := us.(merchant2.MerchantInfo)
c.Data["userName"] = u.MerchantName
c.TplName = "pay_way.html"
}
func (c *Index) LoadUserPayWay() {
ctx := c.Ctx.Request.Context()
us := c.GetSession(enum.UserSession)
u := us.(merchant2.MerchantInfo)
md := merchant2.GetMerchantDeployByUid(ctx, u.MerchantUid)
type payConfig struct {
No string `json:"no"` // 通道编号
Name string `json:"name"` // 产品名
Rate float64 `json:"rate"` // 通道费率
Status string `json:"status"` // 通道状态
TodayAmount float64 `json:"todayAmount"` // 今日订单金额
TodayNum int `json:"todayNum"` // 今日订单数
TodaySucNum int `json:"todaySucNum"` // 今日成功订单数
TodaySucAmount float64 `json:"todaySucAmount"` // 今日成功订单金额
YesterdayAmount float64 `json:"yesterdayAmount"` // 昨日订单金额
YesterdayNum int `json:"yesterdayNum"` // 昨日订单数
YesterdaySucNum int `json:"yesterdaySucNum"` // 昨日成功订单数
YesterdaySucAmount float64 `json:"yesterdaySucAmount"` // 昨日成功订单金额
TodaySucRate float64 `json:"todaySucRate"` // 今日成功率
YesterdaySucRate float64 `json:"yesterdaySucRate"` // 昨日成功率
TotalAmount float64 `json:"totalAmount"` // 总订单金额
TotalNum int `json:"totalNum"` // 总订单数
TotalSucNum int `json:"totalSucNum"` // 总成功订单数
TotalSucRate float64 `json:"totalSucRate"` // 总成功率
TotalSucAmount float64 `json:"totalSucAmount"` // 总成功订单金额
}
type TotalSummary struct {
TodayAmount float64 `json:"todayAmount"` // 今日订单金额
TodayNum int `json:"todayNum"` // 今日订单数
TodaySucNum int `json:"todaySucNum"` // 今日成功订单数
TodaySucAmount float64 `json:"todaySucAmount"` // 今日成功订单金额
YesterdayAmount float64 `json:"yesterdayAmount"` // 昨日订单金额
YesterdayNum int `json:"yesterdayNum"` // 昨日订单数
YesterdaySucNum int `json:"yesterdaySucNum"` // 昨日成功订单数
YesterdaySucAmount float64 `json:"yesterdaySucAmount"` // 昨日成功订单金额
TodaySucRate float64 `json:"todaySucRate"` // 今日成功率
YesterdaySucRate float64 `json:"yesterdaySucRate"` // 昨日成功率
TotalAmount float64 `json:"totalAmount"` // 总订单金额
TotalNum int `json:"totalNum"` // 总订单数
TotalSucNum int `json:"totalSucNum"` // 总成功订单数
TotalSucRate float64 `json:"totalSucRate"` // 总成功率
TotalSucAmount float64 `json:"totalSucAmount"` // 总成功订单金额
}
totalSummary := TotalSummary{}
ways := slice.Map(md, func(index int, item merchant2.MerchantDeployInfo) payConfig {
road_ := road.GetRoadInfoByRoadUid(ctx, item.SingleRoadUid)
config := payConfig{
No: item.SingleRoadUid,
Name: road_.RoadName,
Rate: item.RollRoadPlatformRate,
}
rates := slice.Map(item.PlatformRate(ctx), func(index int, item merchant2.ProfitMargin) float64 {
return item.Value
})
if len(rates) > 0 {
config.Rate = mathutil.Average(rates...)
}
summary := order2.GetSummaryByRoadAndMerchant(ctx, item.SingleRoadUid, u.MerchantUid)
if len(summary) == 0 {
return config
}
config.TodayAmount = summary[0].TotalAmount
config.TodayNum = summary[0].TotalNum
config.TodaySucNum = summary[0].SuccessNum
config.TodaySucAmount = summary[0].SuccessAmount
config.TodaySucRate = summary[0].Rate
if len(summary) > 1 {
config.YesterdayAmount = summary[1].TotalAmount
config.YesterdayNum = summary[1].TotalNum
config.YesterdaySucNum = summary[1].SuccessNum
config.YesterdaySucAmount = summary[1].SuccessAmount
config.YesterdaySucRate = summary[1].Rate
}
config.TotalAmount = mathutil.Sum(slice.Map(summary, func(index int, item order2.Summary) float64 {
return item.TotalAmount
})...)
config.TotalNum = mathutil.Sum(slice.Map(summary, func(index int, item order2.Summary) int {
return item.TotalNum
})...)
config.TotalSucNum = mathutil.Sum(slice.Map(summary, func(index int, item order2.Summary) int {
return item.SuccessNum
})...)
config.TotalSucAmount = mathutil.Sum(slice.Map(summary, func(index int, item order2.Summary) float64 {
return item.SuccessAmount
})...)
if config.TotalNum != 0 {
config.TotalSucRate = mathutil.RoundToFloat(float64(config.TotalSucNum)/float64(config.TotalNum)*100, 2)
}
return config
})
totalSummaryList := order2.GetSummaryByMerchant(ctx, u.MerchantUid)
if len(totalSummaryList) > 0 {
totalSummary.TodayAmount = totalSummaryList[0].TotalAmount
totalSummary.TodayNum = totalSummaryList[0].TotalNum
totalSummary.TodaySucNum = totalSummaryList[0].SuccessNum
totalSummary.TodaySucAmount = totalSummaryList[0].SuccessAmount
totalSummary.TodaySucRate = totalSummaryList[0].Rate
}
if len(totalSummaryList) > 1 {
totalSummary.YesterdayAmount = totalSummaryList[1].TotalAmount
totalSummary.YesterdayNum = totalSummaryList[1].TotalNum
totalSummary.YesterdaySucNum = totalSummaryList[1].SuccessNum
totalSummary.YesterdaySucAmount = totalSummaryList[1].SuccessAmount
totalSummary.YesterdaySucRate = totalSummaryList[1].Rate
}
for _, v := range totalSummaryList {
totalSummary.TotalAmount += v.TotalAmount
totalSummary.TotalNum += v.TotalNum
totalSummary.TotalSucNum += v.SuccessNum
totalSummary.TotalSucAmount += v.SuccessAmount
}
if totalSummary.TotalNum != 0 {
totalSummary.TotalSucRate = mathutil.RoundToFloat(float64(totalSummary.TotalSucNum)/float64(totalSummary.TotalNum)*100, 2)
}
response := struct {
Ways []payConfig `json:"ways"`
TotalSummary TotalSummary `json:"totalSummary"`
}{
Ways: ways,
TotalSummary: totalSummary,
}
c.Data["json"] = response
c.ServeJSON()
}

View File

@@ -1,266 +1,266 @@
let trade = {
get_last_month_date: function () {
let date = new Date();
let daysInMonth = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
let strYear = date.getFullYear();
let strDay = date.getDate();
let strMonth = date.getMonth() + 1;
let hh = date.getHours();
let mm = date.getMinutes();
let ss = date.getSeconds();
if (((strYear % 4) === 0) && ((strYear % 100) !== 0) || ((strYear % 400) === 0)) {
daysInMonth[2] = 29
}
if (strMonth - 1 === 0) {
strYear -= 1;
strMonth = 12
} else {
strMonth -= 1
}
strDay = Math.min(strDay, daysInMonth[strMonth]);
if (strMonth < 10) {
strMonth = "0" + strMonth
}
if (strDay < 10) {
strDay = "0" + strDay
}
if (hh < 10) {
hh = "0" + hh
}
if (mm < 10) {
mm = "0" + mm
}
if (ss < 10) {
ss = "0" + ss
}
return strYear + "-" + strMonth + "-" + strDay + " " + hh + ":" + mm + ":" + ss
}, get_time: function (d) {
let date = new Date(d);
let strYear = date.getFullYear();
let strDay = date.getDate();
let strMonth = date.getMonth() + 1;
let hh = date.getHours();
let mm = date.getMinutes();
let ss = date.getSeconds();
if (strMonth < 10) {
strMonth = "0" + strMonth
}
if (strDay < 10) {
strDay = "0" + strDay
}
if (hh < 10) {
hh = "0" + hh
}
if (mm < 10) {
mm = "0" + mm
}
if (ss < 10) {
ss = "0" + ss
}
return strYear + "-" + strMonth + "-" + strDay + " " + hh + ":" + mm + ":" + ss
},
trade_do_paging: function () {
let merchantNo = $("#merchant_No").val();
let startTime = $("#startTime").val();
let endTime = $("#endTime").val();
let payType = $("#payType").val();
let uStatus = $("#uStatus").val();
let cardNo = $("#cardNo").val();
$.ajax({
type: "GET",
url: "/trade/list/",
data: {
page: '1',
limit: "15",
MerchantNo: merchantNo,
start: startTime,
end: endTime,
pay_type: payType,
status: uStatus,
cardNo: cardNo,
},
success: function (data) {
// trade.show_data_summary(data.profitSummary);
trade.show_trade_data(data.root);
let options = {
bootstrapMajorVersion: 3,
currentPage: data.page,
totalPages: data.totalPage,
numberOfPages: data.limit,
itemTexts: function (type, page) {
switch (type) {
case "first":
return "首页";
case "prev":
return "上一页";
case "next":
return "下一页";
case "last":
return "末页";
case "page":
return page
}
},
onPageClicked: function (event, originalEvent, type, page) {
$.ajax({
url: "/trade/list/",
type: "GET",
data: {
page: page,
MerchantNo: merchantNo,
start: startTime,
end: endTime,
pay_type: payType,
status: uStatus,
},
success: function (data) {
trade.show_trade_data(data.root)
}
})
}
};
$('#do_paging').bootstrapPaginator(options)
},
error: function (XMLHttpRequest) {
toastr.info('something is wrong, code: ' + XMLHttpRequest.status)
}
})
}, show_trade_data: function (list) {
let con = "";
$.each(list, function (index, item) {
let bg_red = "", st = "", t = "";
switch (item.Status) {
case "failed":
case "fail":
st = "交易失败";
bg_red = ` style="color: red"`;
break;
case "created":
st = "创建订单";
break;
case "wait":
st = "等待支付";
break;
case "success":
bg_red = ` style="color: green"`;
st = "交易成功";
t = item.UpdateTime;
break
}
const exValue = item.ExValue ? JSON.parse(item.ExValue) : {};
con += `<tr><th scope="row">` +
(index + 1) + `</th><td>` +
item.BankOrderId + `</td><td>` +
item.MerchantOrderId + `</td><td>` +
item.OrderAmount.toFixed(2) + `</td><td>` +
item.UserInAmount.toFixed(2) + `</td><td>` +
item.AllProfit.toFixed(2) + `</td><td` +
bg_red + `>` + st + `</td><td>${item.CreateTime}</td><td>${t}</td><td>` +
`卡号:${exValue.cardNo !== undefined ? exValue.cardNo : ""}<br />卡密:${exValue.data !== undefined ? exValue.data : ""}` +
`</td></tr>`
});
if (con === "") {
con += `<tr><td colspan="9">没有检索到数据</td></tr>`
}
$("#your_show_time").html(con)
},
show_data_summary: function (profitSummary) {
// $("#orderTotalNum").html(profitSummary.totalProfit.totalNum)
// $("#AllAmount").html(profitSummary.totalProfit.totalAmount)
// $("#succeedTotalNum").html(profitSummary.totalProfit.paidNum)
// $("#SucceedPaidAmount").html(profitSummary.totalProfit.paidAmount)
// $("#platformProfit").html(profitSummary.totalProfit.platformIncome)
// $("#totalSucceedRate").html(profitSummary.totalProfit.succeedRate)
// $("#TodaySuccessNum").html(profitSummary.todayProfit.paidNum);
// $("#TodayPaidAmount").html(profitSummary.todayProfit.paidAmount);
// $("#TodayAllAmount").html(profitSummary.todayProfit.totalAmount);
// $("#TodaySupplierProfit").html(profitSummary.todayProfit.TadaySupplierProfit);
// $("#TodayPlatformProfit").html(profitSummary.todayProfit.platformIncome);
// $("#TodayAgentProfit").html(profitSummary.todayProfit.agencyIncome);
// $("#TodayAllNum").html(profitSummary.todayProfit.totalNum);
// $("#todaySucceedRate").html(profitSummary.todayProfit.succeedRate)
},
complaint_do_paging: function () {
let merchantNo = $("#merchant_No").val();
let startTime = $("#startTime").val();
let endTime = $("#endTime").val();
let payType = $("#payType").val();
let uStatus = $("#uStatus").val();
$.ajax({
type: "GET",
url: "/trade/complaint/",
data: {
page: '1',
limit: "15",
MerchantNo: merchantNo,
start: startTime,
end: endTime,
pay_type: payType,
status: uStatus,
},
success: function (data) {
trade.show_complaint_data(data.root);
let options = {
bootstrapMajorVersion: 3,
currentPage: data.page,
totalPages: data.totalPage,
numberOfPages: data.limit,
itemTexts: function (type, page) {
switch (type) {
case "first":
return "首页";
case "prev":
return "上一页";
case "next":
return "下一页";
case "last":
return "末页";
case "page":
return page
}
},
onPageClicked: function (event, originalEvent, type, page) {
$.ajax({
url: "/trade/complaint/",
type: "GET",
data: {
page: page,
MerchantNo: merchantNo,
start: startTime,
end: endTime,
pay_type: payType,
status: uStatus,
},
success: function (data) {
trade.show_complaint_data(data.root)
}
})
}
};
$('#do_paging').bootstrapPaginator(options)
},
error: function (XMLHttpRequest) {
toastr.info('something is wrong, code: ' + XMLHttpRequest.status)
}
})
}, show_complaint_data: function (list) {
let con = "";
$.each(list, function (index, item) {
let st = "";
switch (item.FreezeOrder) {
case "yes":
st = "已冻结";
break;
case "no":
st = "已退款";
break
}
con += `<tr><th scope="row">` + (index + 1) + `</th><td>` + item.BankOrderId + `</td><td>` + item.MerchantOrderId + + `</td><td>` + item.OrderAmount.toFixed(2) + `</td><td>` + st + `</td><td>` + item.UpdateTime + `</td><td>` + item.ExValue + `</td></tr>`
});
if (con === "") {
con += `<tr><td colspan="9">没有检索到数据</td></tr>`
}
$("#your_show_time").html(con)
},
let trade = {
get_last_month_date: function () {
let date = new Date();
let daysInMonth = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
let strYear = date.getFullYear();
let strDay = date.getDate();
let strMonth = date.getMonth() + 1;
let hh = date.getHours();
let mm = date.getMinutes();
let ss = date.getSeconds();
if (((strYear % 4) === 0) && ((strYear % 100) !== 0) || ((strYear % 400) === 0)) {
daysInMonth[2] = 29
}
if (strMonth - 1 === 0) {
strYear -= 1;
strMonth = 12
} else {
strMonth -= 1
}
strDay = Math.min(strDay, daysInMonth[strMonth]);
if (strMonth < 10) {
strMonth = "0" + strMonth
}
if (strDay < 10) {
strDay = "0" + strDay
}
if (hh < 10) {
hh = "0" + hh
}
if (mm < 10) {
mm = "0" + mm
}
if (ss < 10) {
ss = "0" + ss
}
return strYear + "-" + strMonth + "-" + strDay + " " + hh + ":" + mm + ":" + ss
}, get_time: function (d) {
let date = new Date(d);
let strYear = date.getFullYear();
let strDay = date.getDate();
let strMonth = date.getMonth() + 1;
let hh = date.getHours();
let mm = date.getMinutes();
let ss = date.getSeconds();
if (strMonth < 10) {
strMonth = "0" + strMonth
}
if (strDay < 10) {
strDay = "0" + strDay
}
if (hh < 10) {
hh = "0" + hh
}
if (mm < 10) {
mm = "0" + mm
}
if (ss < 10) {
ss = "0" + ss
}
return strYear + "-" + strMonth + "-" + strDay + " " + hh + ":" + mm + ":" + ss
},
trade_do_paging: function () {
let merchantNo = $("#merchant_No").val();
let startTime = $("#startTime").val();
let endTime = $("#endTime").val();
let payType = $("#payType").val();
let uStatus = $("#uStatus").val();
let cardNo = $("#cardNo").val();
$.ajax({
type: "GET",
url: "/trade/list/",
data: {
page: '1',
limit: "15",
MerchantNo: merchantNo,
start: startTime,
end: endTime,
pay_type: payType,
status: uStatus,
cardNo: cardNo,
},
success: function (data) {
// trade.show_data_summary(data.profitSummary);
trade.show_trade_data(data.root);
let options = {
bootstrapMajorVersion: 3,
currentPage: data.page,
totalPages: data.totalPage,
numberOfPages: data.limit,
itemTexts: function (type, page) {
switch (type) {
case "first":
return "首页";
case "prev":
return "上一页";
case "next":
return "下一页";
case "last":
return "末页";
case "page":
return page
}
},
onPageClicked: function (event, originalEvent, type, page) {
$.ajax({
url: "/trade/list/",
type: "GET",
data: {
page: page,
MerchantNo: merchantNo,
start: startTime,
end: endTime,
pay_type: payType,
status: uStatus,
},
success: function (data) {
trade.show_trade_data(data.root)
}
})
}
};
$('#do_paging').bootstrapPaginator(options)
},
error: function (XMLHttpRequest) {
toastr.info('something is wrong, code: ' + XMLHttpRequest.status)
}
})
}, show_trade_data: function (list) {
let con = "";
$.each(list, function (index, item) {
let bg_red = "", st = "", t = "";
switch (item.Status) {
case "failed":
case "fail":
st = "交易失败";
bg_red = ` style="color: red"`;
break;
case "created":
st = "创建订单";
break;
case "wait":
st = "等待支付";
break;
case "success":
bg_red = ` style="color: green"`;
st = "交易成功";
t = item.UpdateTime;
break
}
const exValue = item.ExValue ? JSON.parse(item.ExValue) : {};
con += `<tr><th scope="row">` +
(index + 1) + `</th><td>` +
item.BankOrderId + `</td><td>` +
item.MerchantOrderId + `</td><td>` +
item.OrderAmount.toFixed(2) + `</td><td>` +
item.UserInAmount.toFixed(2) + `</td><td>` +
item.AllProfit.toFixed(2) + `</td><td` +
bg_red + `>` + st + `</td><td>${item.CreateTime}</td><td>${t}</td><td>` +
`卡号:${exValue.cardNo !== undefined ? exValue.cardNo : ""}<br />卡密:${exValue.data !== undefined ? exValue.data : ""}` +
`</td></tr>`
});
if (con === "") {
con += `<tr><td colspan="9">没有检索到数据</td></tr>`
}
$("#your_show_time").html(con)
},
show_data_summary: function (profitSummary) {
// $("#orderTotalNum").html(profitSummary.totalProfit.totalNum)
// $("#AllAmount").html(profitSummary.totalProfit.totalAmount)
// $("#succeedTotalNum").html(profitSummary.totalProfit.paidNum)
// $("#SucceedPaidAmount").html(profitSummary.totalProfit.paidAmount)
// $("#platformProfit").html(profitSummary.totalProfit.platformIncome)
// $("#totalSucceedRate").html(profitSummary.totalProfit.succeedRate)
// $("#TodaySuccessNum").html(profitSummary.todayProfit.paidNum);
// $("#TodayPaidAmount").html(profitSummary.todayProfit.paidAmount);
// $("#TodayAllAmount").html(profitSummary.todayProfit.totalAmount);
// $("#TodaySupplierProfit").html(profitSummary.todayProfit.TadaySupplierProfit);
// $("#TodayPlatformProfit").html(profitSummary.todayProfit.platformIncome);
// $("#TodayAgentProfit").html(profitSummary.todayProfit.agencyIncome);
// $("#TodayAllNum").html(profitSummary.todayProfit.totalNum);
// $("#todaySucceedRate").html(profitSummary.todayProfit.succeedRate)
},
complaint_do_paging: function () {
let merchantNo = $("#merchant_No").val();
let startTime = $("#startTime").val();
let endTime = $("#endTime").val();
let payType = $("#payType").val();
let uStatus = $("#uStatus").val();
$.ajax({
type: "GET",
url: "/trade/complaint/",
data: {
page: '1',
limit: "15",
MerchantNo: merchantNo,
start: startTime,
end: endTime,
pay_type: payType,
status: uStatus,
},
success: function (data) {
trade.show_complaint_data(data.root);
let options = {
bootstrapMajorVersion: 3,
currentPage: data.page,
totalPages: data.totalPage,
numberOfPages: data.limit,
itemTexts: function (type, page) {
switch (type) {
case "first":
return "首页";
case "prev":
return "上一页";
case "next":
return "下一页";
case "last":
return "末页";
case "page":
return page
}
},
onPageClicked: function (event, originalEvent, type, page) {
$.ajax({
url: "/trade/complaint/",
type: "GET",
data: {
page: page,
MerchantNo: merchantNo,
start: startTime,
end: endTime,
pay_type: payType,
status: uStatus,
},
success: function (data) {
trade.show_complaint_data(data.root)
}
})
}
};
$('#do_paging').bootstrapPaginator(options)
},
error: function (XMLHttpRequest) {
toastr.info('something is wrong, code: ' + XMLHttpRequest.status)
}
})
}, show_complaint_data: function (list) {
let con = "";
$.each(list, function (index, item) {
let st = "";
switch (item.FreezeOrder) {
case "yes":
st = "已冻结";
break;
case "no":
st = "已退款";
break
}
con += `<tr><th scope="row">` + (index + 1) + `</th><td>` + item.BankOrderId + `</td><td>` + item.MerchantOrderId + + `</td><td>` + item.OrderAmount.toFixed(2) + `</td><td>` + st + `</td><td>` + item.UpdateTime + `</td><td>` + item.ExValue + `</td></tr>`
});
if (con === "") {
con += `<tr><td colspan="9">没有检索到数据</td></tr>`
}
$("#your_show_time").html(con)
},
};

View File

@@ -1,121 +1,160 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
{{template "template/css.html"}}
</head>
<body>
<div class="page">
<!-- Main Navbar-->
{{template "template/header.html"}}
<div class="page-content d-flex align-items-stretch">
<!-- Side Navbar -->
<nav class="side-navbar">
<!-- Sidebar Header-->
<div class="sidebar-header d-flex align-items-center">
<a href="/index/ui/">
<div class="avatar">
<img src="../../static/img/avatar-1.jpg" alt="..." class="img-fluid rounded-circle">
</div>
</a>
<a href="/index/ui/">
<div class="title">
<h1 class="h4">{{.userName}}</h1>
<p>欢迎您!</p>
</div>
</a>
</div>
<!-- Sidebar Navidation Menus--><span class="heading">主菜单</span>
<ul class="list-unstyled">
<li class="active"><a href="/index/ui/" style="color: black;"> <i class="icon-home"></i>首页 </a></li>
<li><a href="#exampledropdownDropdown" aria-expanded="false" data-toggle="collapse"
style="color: black;"> <i class="icon icon-user"></i>账户管理 </a>
<ul id="exampledropdownDropdown" class="collapse list-unstyled ">
<li><a href="/user_info/show_modify_ui">修改密码</a></li>
<li><a href="/user_info/show_totp_ui">二步验证</a></li>
<li><a href="/user_info/show_ui">账户资料</a></li>
<li><a href="/index/show_pay_way_ui">通道配置</a></li>
</ul>
</li>
<li><a href="#exampledropdownDropdown1" aria-expanded="false" data-toggle="collapse"> <i
class="icon icon-presentation" style="color: black;"></i>订单管理 </a>
<ul id="exampledropdownDropdown1" class="collapse list-unstyled ">
<li><a href="/trade/show_ui">订单记录</a></li>
<!-- <li><a href="/trade/show_complaint_ui">投诉列表</a></li> -->
</ul>
</li>
<li><a href="#exampledropdownDropdown2" aria-expanded="false" data-toggle="collapse"> <i
class="icon icon-bill" style="color: black;"></i>财务管理 </a>
<ul id="exampledropdownDropdown2" class="collapse list-unstyled ">
<li><a href="/history/show_history_list_ui">资产变动明细</a></li>
</ul>
</li>
<li>
<li><a href="/gen_link/gen_link">测试链接</a></li>
<li><a href="/order/query">订单查询</a></li>
</ul>
</nav>
<div class="content-inner">
<!-- Page Header-->
<header class="page-header">
<div class="container-fluid">
<h2 class="no-margin-bottom">账户信息</h2>
</div>
</header>
<!-- Dashboard Counts Section-->
<section class="dashboard-counts ">
<div class="container-fluid">
<div class="row bg-white has-shadow">
<!-- Item -->
<div class="col-xl-3 col-sm-4">
<div class="item d-flex align-items-center">
<div class="icon bg-green"><i class="icon icon-presentation"></i></div>
<div class="title"><span>账户余额<br><small>&nbsp;</small></span>
<div class="progress">
<div role="progressbar" style="width: 80%; height: 4px;" aria-valuenow="55"
aria-valuemin="0" aria-valuemax="100" class="progress-bar bg-green">
</div>
</div>
</div>
<div class="number"><strong id="balanceAmt">0.00</strong></div>
</div>
</div>
</div>
</div>
</section>
<!-- Page Header-->
<header class="page-header">
<div class="container-fluid">
<h2 class="no-margin-bottom">通道配置
<small style="font-size: 0.7em;">&nbsp;&nbsp;&nbsp;
<a href="/index/show_pay_way_ui">>>>> 查看详情</a></small>
<small style="font-size: 0.7em;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;总订单数:
<label id="orders">0</label></small>
<small style="font-size: 0.7em;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;总成功订单数:
<label id="suc_orders">0</label></small>
<small style="font-size: 0.7em;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;成功率:
<label id="suc_rate">0%</label> &nbsp;&nbsp;(含已删除通道配置的订单)</small>
</h2>
</div>
</header>
</div>
</div>
</div>
{{template "template/js.html"}}
<script type="application/javascript">
$(function () {
index.getAccountInfo();
index.getOrdersInfo();
setTimeout(function () {
// index.loadTradeRecord();
}, 1000);
});
</script>
</body>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
{{template "template/css.html"}}
</head>
<body>
<div class="page">
<!-- Main Navbar-->
{{template "template/header.html"}}
<div class="page-content d-flex align-items-stretch">
<!-- Side Navbar -->
<nav class="side-navbar">
<!-- Sidebar Header-->
<div class="sidebar-header d-flex align-items-center">
<a href="/index/ui/">
<div class="avatar">
<img src="../../static/img/avatar-1.jpg" alt="..." class="img-fluid rounded-circle">
</div>
</a>
<a href="/index/ui/">
<div class="title">
<h1 class="h4">{{.userName}}</h1>
<p>欢迎您!</p>
</div>
</a>
</div>
<!-- Sidebar Navidation Menus--><span class="heading">主菜单</span>
<ul class="list-unstyled">
<li class="active"><a href="/index/ui/" style="color: black;"> <i class="icon-home"></i>首页 </a></li>
<li><a href="#exampledropdownDropdown" aria-expanded="false" data-toggle="collapse"
style="color: black;"> <i class="icon icon-user"></i>账户管理 </a>
<ul id="exampledropdownDropdown" class="collapse list-unstyled ">
<li><a href="/user_info/show_modify_ui">修改密码</a></li>
<li><a href="/user_info/show_totp_ui">二步验证</a></li>
<li><a href="/user_info/show_ui">账户资料</a></li>
<li><a href="/index/show_pay_way_ui">通道配置</a></li>
</ul>
</li>
<li><a href="#exampledropdownDropdown1" aria-expanded="false" data-toggle="collapse"> <i
class="icon icon-presentation" style="color: black;"></i>订单管理 </a>
<ul id="exampledropdownDropdown1" class="collapse list-unstyled ">
<li><a href="/trade/show_ui">订单记录</a></li>
<!-- <li><a href="/trade/show_complaint_ui">投诉列表</a></li> -->
</ul>
</li>
<li><a href="#exampledropdownDropdown2" aria-expanded="false" data-toggle="collapse"> <i
class="icon icon-bill" style="color: black;"></i>财务管理 </a>
<ul id="exampledropdownDropdown2" class="collapse list-unstyled ">
<li><a href="/history/show_history_list_ui">资产变动明细</a></li>
</ul>
</li>
<li>
<li><a href="/gen_link/gen_link">测试链接</a></li>
<li><a href="/order/query">订单查询</a></li>
</ul>
</nav>
<div class="content-inner">
<!-- Page Header-->
<header class="page-header">
<div class="container-fluid">
<h2 class="no-margin-bottom">账户信息</h2>
</div>
</header>
<!-- Dashboard Counts Section-->
<section class="dashboard-counts ">
<div class="container-fluid">
<div class="row bg-white has-shadow">
<!-- Item -->
<div class="col-xl-3 col-sm-4">
<div class="item d-flex align-items-center">
<div class="icon bg-green"><i class="icon icon-presentation"></i></div>
<div class="title"><span>账户余额<br><small>&nbsp;</small></span>
<div class="progress">
<div role="progressbar" style="width: 80%; height: 4px;" aria-valuenow="55"
aria-valuemin="0" aria-valuemax="100" class="progress-bar bg-green">
</div>
</div>
</div>
<div class="number"><strong id="balanceAmt">0.00</strong></div>
</div>
</div>
<div class="col-xl-3 col-sm-4">
<div class="item d-flex align-items-center">
<div class="icon bg-green"><i class="icon icon-presentation"></i></div>
<div class="title"><span>今日跑量<br><small>&nbsp;</small></span>
<div class="progress">
<div role="progressbar" style="width: 80%; height: 4px;" aria-valuenow="55"
aria-valuemin="0" aria-valuemax="100" class="progress-bar bg-green">
</div>
</div>
</div>
<div class="number"><strong id="settAmount">0.00</strong></div>
</div>
</div>
<div class="col-xl-3 col-sm-4">
<div class="item d-flex align-items-center">
<div class="icon bg-green"><i class="icon icon-presentation"></i></div>
<div class="title"><span>总跑量<br><small>&nbsp;</small></span>
<div class="progress">
<div role="progressbar" style="width: 80%; height: 4px;" aria-valuenow="55"
aria-valuemin="0" aria-valuemax="100" class="progress-bar bg-green">
</div>
</div>
</div>
<div class="number"><strong id="freezeAmt">0.00</strong></div>
</div>
</div>
<div class="col-xl-3 col-sm-4">
<div class="item d-flex align-items-center">
<div class="icon bg-green"><i class="icon icon-presentation"></i></div>
<div class="title"><span>成功率<br><small>&nbsp;</small></span>
<div class="progress">
<div role="progressbar" style="width: 80%; height: 4px;" aria-valuenow="55"
aria-valuemin="0" aria-valuemax="100" class="progress-bar bg-green">
</div>
</div>
</div>
<div class="number"><strong id="amountFrozen">0.00</strong></div>
</div>
</div>
</div>
</div>
</section>
<!-- Page Header-->
<header class="page-header">
<div class="container-fluid">
<h2 class="no-margin-bottom">通道配置
<small style="font-size: 0.7em;">&nbsp;&nbsp;&nbsp;
<a href="/index/show_pay_way_ui"> 查看通道配置</a></small>
<small style="font-size: 0.7em;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;总订单数:
<label id="orders">0</label></small>
<small style="font-size: 0.7em;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;总成功订单数:
<label id="suc_orders">0</label></small>
<small style="font-size: 0.7em;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;成功率:
<label id="suc_rate">0%</label> &nbsp;&nbsp;(含已删除通道配置的订单)</small>
</h2>
</div>
</header>
</div>
</div>
</div>
{{template "template/js.html"}}
<script type="application/javascript">
$(function () {
index.getAccountInfo();
index.getOrdersInfo();
setTimeout(function () {
// index.loadTradeRecord();
}, 1000);
});
</script>
</body>
</html>