|
@@ -0,0 +1,44 @@
|
|
|
+package front
|
|
|
+
|
|
|
+import (
|
|
|
+ "app.yhyue.com/moapp/jybase/go-xweb/xweb"
|
|
|
+ "app.yhyue.com/moapp/jypkg/public"
|
|
|
+)
|
|
|
+
|
|
|
+type Datasmt struct {
|
|
|
+ *xweb.Action
|
|
|
+ index xweb.Mapper `xweb:"/datasmt"` //落地页
|
|
|
+ list xweb.Mapper `xweb:"/datasmt/([^/]+$)"` //列表
|
|
|
+ detail xweb.Mapper `xweb:"/datasmt/(.+?)/(.+)"` //详情页面
|
|
|
+}
|
|
|
+
|
|
|
+func init() {
|
|
|
+ xweb.AddAction(&Datasmt{})
|
|
|
+}
|
|
|
+
|
|
|
+func (this *Datasmt) Index() error {
|
|
|
+ if mobileReg.MatchString(this.UserAgent()) || public.CheckWxBrowser(this.Request) {
|
|
|
+ return this.Render("/weixin/dataSmt/index.html")
|
|
|
+ } else {
|
|
|
+ return this.Render("/pc/dataSmt/index.html")
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+func (this *Datasmt) List(dataType string) error {
|
|
|
+ this.T["dataType"] = dataType
|
|
|
+ if mobileReg.MatchString(this.UserAgent()) || public.CheckWxBrowser(this.Request) {
|
|
|
+ return this.Render("/weixin/dataSmt/list.html")
|
|
|
+ } else {
|
|
|
+ return this.Render("/pc/dataSmt/list.html")
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+func (this *Datasmt) Detail(dataType, id string) error {
|
|
|
+ this.T["dataType"] = dataType
|
|
|
+ this.T["id"] = id
|
|
|
+ if mobileReg.MatchString(this.UserAgent()) || public.CheckWxBrowser(this.Request) {
|
|
|
+ return this.Render("/weixin/dataSmt/detail.html")
|
|
|
+ } else {
|
|
|
+ return this.Render("/pc/dataSmt/detail.html")
|
|
|
+ }
|
|
|
+}
|