dongfeng-pay/legend/controllers/showPageController.go

165 lines
3.2 KiB
Go
Raw Normal View History

2021-04-27 15:33:49 +08:00
package controllers
import (
"fmt"
"github.com/beego/beego/v2/core/logs"
2021-04-27 15:33:49 +08:00
"legend/controllers/base"
"legend/service"
"legend/utils"
)
type ShowPageController struct {
base.BasicController
}
func (c *ShowPageController) FaviconPage() {
c.TplName = "favicon.png"
}
/**
** 展示后台第一个页面
*/
func (c *ShowPageController) WelcomePage() {
userName := c.GetSession("userName").(string)
fmt.Println(userName)
2021-04-27 15:33:49 +08:00
accountService := new(service.AccountService)
accountInfo := accountService.GetAccountInfo(userName)
logs.Debug("account信息", accountInfo)
2021-04-27 15:33:49 +08:00
c.Data["balance"] = accountInfo.Balance
c.Data["unBalance"] = accountInfo.FreezeAmount
c.Data["settleAmount"] = accountInfo.SettleAmount
// 获取今天充值金额
2021-05-04 16:16:14 +08:00
todayIncome := accountService.GetTodayIncome()
logs.Debug("获取到当天充值金额:", todayIncome)
c.Data["todayAmount"] = todayIncome
2021-04-27 15:33:49 +08:00
c.TplName = "welcome.html"
}
/**
** 展示商户密钥
*/
func (c *ShowPageController) MerchantKeyPage() {
userName := c.GetSession("userName").(string)
merchantService := new(service.MerchantService)
2021-05-16 15:21:52 +08:00
userInfo, bankInfo := merchantService.GetMerchantBankInfo(userName)
2021-04-27 15:33:49 +08:00
c.Data["currentTime"] = utils.GetNowTime()
c.Data["userName"] = userName
c.Data["userInfo"] = userInfo
c.Data["bankInfo"] = bankInfo
c.TplName = "merchant-key.html"
}
/**
** 比例模板
*/
2021-05-16 15:21:52 +08:00
func (c *ShowPageController) ScaleTemplatePage() {
c.TplName = "scale-template.html"
2021-04-27 15:33:49 +08:00
}
/**
** 增加模板
*/
2021-05-16 15:21:52 +08:00
func (c *ShowPageController) TemplateAdd() {
c.TplName = "template-add.html"
}
func (c *ShowPageController) TemplateEdit() {
templateName := c.GetString("templateName")
fmt.Println(templateName)
c.Data["scaleTemplateName"] = templateName
c.TplName = "template-edit.html"
2021-04-27 15:33:49 +08:00
}
/**
** 分组列表
*/
func (c *ShowPageController) GroupListPage() {
c.TplName = "group-list.html"
}
/**
** 分区列表
*/
func (c *ShowPageController) AreaListPage() {
c.TplName = "area-list.html"
}
2021-05-19 13:46:49 +08:00
func (c *ShowPageController) AreaEdit() {
uid := c.GetString("uid")
c.Data["uid"] = uid
c.TplName = "area-edit.html"
}
2021-04-27 15:33:49 +08:00
/**
** 充值订单
*/
func (c *ShowPageController) OrderListPage() {
c.TplName = "order-list.html"
}
/**
** 模拟充值
*/
func (c *ShowPageController) ImitateChargePage() {
c.TplName = "imitate-order.html"
}
/**
** 结算管理
*/
func (c *ShowPageController) SettleListPage() {
c.TplName = "settle-list.html"
}
/**
**每日充值统计
*/
func (c *ShowPageController) EverydayChargeCountPage() {
c.TplName = "everyday-charge-count.html"
}
/**
** 分组充值统计
*/
func (c *ShowPageController) GroupChargeCountPage() {
c.TplName = "group-charge-count.html"
}
/**
** 分区充值统计
*/
func (c *ShowPageController) AreaChargePage() {
c.TplName = "area-charge-count.html"
}
/**
** 创建分区和编辑分区
*/
func (c *ShowPageController) AreaAddOrEdit() {
c.TplName = "area-add.html"
}
/**
** 个人页面
*/
func (c *ShowPageController) PersonPage() {
userName, ok := c.GetSession("userName").(string)
if !ok {
c.Abort("404")
} else {
merchantService := new(service.MerchantService)
userInfo := merchantService.MerchantInfo(userName)
c.Data["userName"] = userInfo.MerchantName
2021-04-27 15:33:49 +08:00
}
c.TplName = "person.html"
}