|
@@ -8,8 +8,10 @@ import (
|
|
|
"gopkg.in/mgo.v2/bson"
|
|
|
"html/template"
|
|
|
"log"
|
|
|
+ "qfw/coreutil"
|
|
|
"qfw/front"
|
|
|
. "qfw/member"
|
|
|
+ "qfw/mobile"
|
|
|
. "qfw/util"
|
|
|
"qfw/util/consts"
|
|
|
"qfw/util/credit"
|
|
@@ -35,7 +37,8 @@ type EntInfo struct {
|
|
|
func (search *Search) EntCommunity() error {
|
|
|
ismobile := strings.Index(search.Header("User-Agent"), "Mobile")
|
|
|
if ismobile > -1 {
|
|
|
- search.Render("/member/incmobile/index.html")
|
|
|
+ search.T["signature"] = mobile.GetSignature(search.Url())
|
|
|
+ search.Render("/member/incmobile/index.html", &search.T)
|
|
|
return nil
|
|
|
}
|
|
|
//新认证企业
|
|
@@ -763,3 +766,31 @@ func searhWebContententMp(querymap map[string]string, n *Search, reqType string,
|
|
|
pagination := front.MakePagination(1, 1, 1, querymap, "/wx/search/enterprise/"+reqType+"ent_%s.html")
|
|
|
return &res, &pagination, has
|
|
|
}
|
|
|
+
|
|
|
+//获取名片名称
|
|
|
+func (s *Search) WxMingpian() error {
|
|
|
+ res := make(map[string]string)
|
|
|
+ res["name"] = ""
|
|
|
+ res["on"] = "y"
|
|
|
+ if s.GetSession("s_m_openid") != nil {
|
|
|
+ serverId := s.GetString("serverId")
|
|
|
+ ret := coreutil.WxDownloadImg(serverId)
|
|
|
+ if len(ret) > 1 {
|
|
|
+ log.Println("picpath", ret[1])
|
|
|
+ res["on"] = ret[0]
|
|
|
+ names := coreutil.CardRecognition(ret[1])
|
|
|
+ for k, v := range names {
|
|
|
+ name := fmt.Sprint(v)
|
|
|
+ if mpian_reg.MatchString(name) {
|
|
|
+ res["name"] = name
|
|
|
+ break
|
|
|
+ }
|
|
|
+ if k == len(names)-1 {
|
|
|
+ res["name"] = name
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ s.ServeJson(&res)
|
|
|
+ return nil
|
|
|
+}
|