package tmpl

import (
	"git.wanbits.cc/sin/flytalk/g"
	"github.com/gin-gonic/gin"
	"net/http"
)

//咨询界面
func PageChat(c *gin.Context) {
	kefuId := c.Query("kefu_id")
	ilang, _ := c.Get("lang")
	lang := ilang.(string)
	refer := c.Query("refer")
	if refer == "" {
		refer = c.Request.Referer()
	}
	c.HTML(http.StatusOK, "chat_page.html", gin.H{
		"KEFU_ID": kefuId,
		"SendBtn": g.T("send", lang),
		"Lang":    lang,
		"Refer":   refer,
	})
}

func PageKfChat(c *gin.Context) {
	kefuId := c.Query("kefu_id")
	visitorId := c.Query("visitor_id")
	token := c.Query("token")
	c.HTML(http.StatusOK, "chat_kf_page.html", gin.H{
		"KefuId":    kefuId,
		"VisitorId": visitorId,
		"Token":     token,
	})
}
