|
@@ -0,0 +1,105 @@
|
|
|
+package front
|
|
|
+
|
|
|
+import (
|
|
|
+ util "app.yhyue.com/moapp/jybase/common"
|
|
|
+ "app.yhyue.com/moapp/jybase/redis"
|
|
|
+ "app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
|
|
|
+ "fmt"
|
|
|
+ "jy/src/jfw/config"
|
|
|
+ "jy/src/jfw/site/jySchool"
|
|
|
+ "jy/src/jfw/wx"
|
|
|
+ "regexp"
|
|
|
+)
|
|
|
+
|
|
|
+// NewSordfishIndex 剑鱼标讯pc首页
|
|
|
+func (m *PcIndex) NewSordFishIndex(flag string) error {
|
|
|
+ ispc, _ := m.GetInteger("ispc")
|
|
|
+ pageSize, _ := m.GetInteger("pageSize")
|
|
|
+ if pageSize == 0 {
|
|
|
+ pageSize = 50
|
|
|
+ }
|
|
|
+ var shareid = m.GetString("id")
|
|
|
+ //userId, _ := m.GetSession("userId").(string)
|
|
|
+ sessVal := m.Session().GetMultiple()
|
|
|
+ userId := util.ObjToString(sessVal["userId"])
|
|
|
+ pcindexKey := "jypcindex"
|
|
|
+ if cacheKey, _ := config.Sysconfig["pcindexCacheKey"].(string); cacheKey != "" {
|
|
|
+ pcindexKey = cacheKey
|
|
|
+ }
|
|
|
+ if len(shareid) == 0 {
|
|
|
+ shareid = "10" //fmt.Sprintf("%s%d", config.Seoconfig["jysy"].(string)+fmt.Sprintf("%d", time.Now().UnixNano())[8:14], rand.Intn(9))
|
|
|
+ } else {
|
|
|
+ redis.Del("other", pcindexKey)
|
|
|
+ }
|
|
|
+ m.T["logid"] = config.Seoconfig["jysy"].(string)
|
|
|
+ m.T["shareid"] = se.EncodeString(shareid)
|
|
|
+ m.T["activestart"] = config.ActiveConfig.DoubleEleven.Active_Start
|
|
|
+ m.T["activeend"] = config.ActiveConfig.DoubleEleven.Active_End
|
|
|
+ m.T["userCard"] = "f"
|
|
|
+ regex, _ := regexp.Compile("(Android|Mobile)")
|
|
|
+ var isLogin bool
|
|
|
+ if userId != "" {
|
|
|
+ isLogin = true
|
|
|
+ userPower := jy.GetBigVipUserBaseMsg(m.Session(), *config.Middleground)
|
|
|
+ switch {
|
|
|
+ case userPower.Status > 0:
|
|
|
+ m.T["userCard"] = "m"
|
|
|
+ case userPower.VipStatus > 0:
|
|
|
+ m.T["userCard"] = "v"
|
|
|
+ case userPower.EntnicheStatus > 0:
|
|
|
+ m.T["userCard"] = "e"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ispc == 0 && len(regex.FindAllString(m.Header("User-Agent"), -1)) > 0 {
|
|
|
+ m.T["s_m_openid"] = util.ObjToString(sessVal["s_m_openid"])
|
|
|
+ m.T["nickname"] = util.ObjToString(sessVal["s_nickname"])
|
|
|
+ m.T["avatar"] = util.ObjToString(sessVal["s_avatar"])
|
|
|
+ m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
|
|
|
+ return m.Render("/pc/mobileindex.html", &m.T)
|
|
|
+ } else {
|
|
|
+ //招标公告
|
|
|
+ m.T["newbids"] = map[string]interface{}{
|
|
|
+ "biddingList": NewIndexbids(m.Session(), m.Request),
|
|
|
+ "more": "/list/stype/ZBGG.html",
|
|
|
+ }
|
|
|
+ //最新公告信息
|
|
|
+ rangeInfoType := []int{1, 2, 3, 4}
|
|
|
+ for _, v := range rangeInfoType { //1拟建 2招标预告 3招标公告 4招标结果
|
|
|
+ m.T[fmt.Sprintf("newArticle_%d", v)] = GetNewArticle(v, pageSize)
|
|
|
+ }
|
|
|
+ //热门行业
|
|
|
+ m.T["hotIndustry"] = GetHotIndustry()
|
|
|
+ //实用内容推荐
|
|
|
+ m.T["recommend"] = ContentRecommendation()
|
|
|
+ m.T["jycmsLink"] = GetJycmsAreaLink()
|
|
|
+ //推荐标讯专区
|
|
|
+ m.T["recommendBeacon"] = RecommendationBeacon()
|
|
|
+ //招投标攻略
|
|
|
+ m.T["strategyList"] = GetStrategyList()
|
|
|
+ m.T["hasLogin"] = isLogin
|
|
|
+ //热门采购单位
|
|
|
+ m.T["hotBuyers"] = HotBuyerList()
|
|
|
+ //热门中标单位
|
|
|
+ m.T["hotWinner"] = GetWinnerInfo()
|
|
|
+ //m.T["newbids"] = NewIndexbids(m.Session(), m.Request)
|
|
|
+ m.T["hotkey"] = hotKeyArrLoginEd
|
|
|
+ m.T["hotKeyArrUnLogin"] = hotKeyArrUnLogin
|
|
|
+ m.T["simpleTemplateData"] = map[string]interface{}{"XwebVer": m.T["XwebVer"]} //清除前端js获取模版标签变量
|
|
|
+ return m.Render("/pc/newPcIndex.html", &m.T)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// GetStrategyList 招投标攻略
|
|
|
+func GetStrategyList() []map[string]interface{} {
|
|
|
+ var strategyList []map[string]interface{}
|
|
|
+ for _, item := range jySchool.GuidelineColumn().SeedData {
|
|
|
+ if res := jySchool.Guideline(item.Code, 5); res != nil && len(*res) > 0 {
|
|
|
+ strategyList = append(strategyList, map[string]interface{}{
|
|
|
+ "name": item.Name,
|
|
|
+ "code": item.Code,
|
|
|
+ "list": res,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return strategyList
|
|
|
+}
|