dongfeng-pay/shop/controllers/page_controller.go

41 lines
974 B
Go
Raw Normal View History

2019-12-19 14:47:58 +08:00
/***************************************************
** @Desc : This file for ...收银台对接快一
** @Time : 2018-8-27 13:50
** @Author : Joker
** @File : home_action
** @Last Modified by : Joker
** @Last Modified time: 2018-08-29 17:59:48
** @Software: GoLand
****************************************************/
package controllers
import (
2021-11-18 13:52:30 +08:00
"github.com/beego/beego/v2/server/web"
"github.com/rs/xid"
2019-12-19 14:47:58 +08:00
)
type HomeAction struct {
2021-11-18 13:52:30 +08:00
web.Controller
2019-12-19 14:47:58 +08:00
}
/*加载首页及数据*/
func (c *HomeAction) ShowHome() {
//取值
2021-11-18 13:52:30 +08:00
siteName, _ := web.AppConfig.String("siteName")
orderNo := xid.New().String()
2019-12-19 14:47:58 +08:00
productName := "测试应用-支付功能体验(非商品消费)"
//数据回显
c.Data["siteName"] = siteName
c.Data["pname"] = productName
c.Data["orderNo"] = orderNo
c.TplName = "index.html"
}
func (c *HomeAction) ErrorPage() {
2021-11-18 13:52:30 +08:00
flash := web.ReadFromRequest(&c.Controller)
e := flash.Data["error"]
c.Data["error"] = e
2019-12-19 14:47:58 +08:00
c.TplName = "error.html"
}