|
@@ -1,12 +1,12 @@
|
|
|
package search
|
|
|
|
|
|
import (
|
|
|
- "encoding/base64"
|
|
|
"encoding/json"
|
|
|
"fmt"
|
|
|
"github.com/go-xweb/xweb"
|
|
|
"github.com/p/mahonia"
|
|
|
"html/template"
|
|
|
+ "log"
|
|
|
"qfw/coreutil"
|
|
|
"qfw/mobile"
|
|
|
. "qfw/util"
|
|
@@ -31,9 +31,11 @@ func (n *Wxsearch) WxIndex() error {
|
|
|
func (n *Wxsearch) WxgetEnterpriseList(reqType, param /*参数*/ string) error {
|
|
|
n.T["signature"] = mobile.GetSignature(n.Url())
|
|
|
i_mingpian := n.GetString("i_mingpian") //是否走名片查询
|
|
|
- if len(param) == 0 {
|
|
|
+ log.Println(n.Method())
|
|
|
+ if n.Method() == "POST" {
|
|
|
//请求是表单提交,走的查询
|
|
|
//拼装查询对象
|
|
|
+ log.Println("进入POST查找")
|
|
|
querymap := map[string]string{ //"words": n.GetString("s_value"),
|
|
|
"perPage": "20",
|
|
|
"currentPage": n.GetString("currentPage"),
|
|
@@ -45,7 +47,7 @@ func (n *Wxsearch) WxgetEnterpriseList(reqType, param /*参数*/ string) error {
|
|
|
"c_author": n.GetString("c_author"),
|
|
|
"cityNo": n.GetString("cityNo"), //是否是第一次查询并且没有选择地市,自动根据IP来设
|
|
|
}
|
|
|
-
|
|
|
+ log.Println(querymap, "---------------------------", n, reqType)
|
|
|
//查询生成列表数据
|
|
|
var data *[]map[string]interface{}
|
|
|
if i_mingpian != "" {
|
|
@@ -53,7 +55,9 @@ func (n *Wxsearch) WxgetEnterpriseList(reqType, param /*参数*/ string) error {
|
|
|
} else {
|
|
|
data = wxsearhWebContentent(querymap, n, reqType)
|
|
|
}
|
|
|
+ log.Println(data)
|
|
|
rs := FormatData(data)
|
|
|
+ log.Println(rs)
|
|
|
querymap["entcard"] = n.GetString("mingpian")
|
|
|
if n.GetString("currentPage") != "" {
|
|
|
return n.Write(rs)
|
|
@@ -61,10 +65,7 @@ func (n *Wxsearch) WxgetEnterpriseList(reqType, param /*参数*/ string) error {
|
|
|
n.Render("/member/incmobile/list.html", &xweb.T{"data": rs, "querymap": querymap})
|
|
|
} else {
|
|
|
//反转生成map
|
|
|
- paramstr := param[1:]
|
|
|
- bs, _ := base64.StdEncoding.DecodeString(paramstr)
|
|
|
querymap := map[string]string{}
|
|
|
- json.Unmarshal(bs, &querymap)
|
|
|
data := wxsearhWebContentent(querymap, n, reqType)
|
|
|
rs := FormatData(data)
|
|
|
n.Render("/member/incmobile/list.html", &xweb.T{"data": rs, "querymap": querymap})
|