Browse Source

Merge branch 'release' into dev2.6.5.5

lianbingjie 5 năm trước cách đây
mục cha
commit
1dc3779f1c

+ 0 - 3
README.md

@@ -13,8 +13,5 @@ pkg目录,已经在版本控制中排除,不会被提交。
 业务代码放在bsw目录中,按前后台\模块划分
 系统配置文件统一放在config.json中。
 
-/**dev2.3**/
-新增消息管理功能,对剑鱼app用户进行推送消息,监控消息利用率。
-
 
 

+ 3 - 3
common/src/qfw/util/jy/jy.go

@@ -163,7 +163,7 @@ func SendSMS(tplcode /*模板代码*/, mobile /*手机号码*/ string, param map
 
 //发送验证码
 func SendPhoneIdentCode(phone string, session *httpsession.Session) bool {
-	lastSentTime, _ := session.Get("identCodeTime").(int64)
+	lastSentTime := util.Int64All(session.Get("identCodeTime"))
 	//60秒之内不允许重复发
 	if lastSentTime > 0 && time.Now().Unix()-lastSentTime <= 60 {
 		return false
@@ -182,8 +182,8 @@ func SendPhoneIdentCode(phone string, session *httpsession.Session) bool {
 
 //短信验证码校验
 func CheckPhoneIdent(session *httpsession.Session, code string) string {
-	identCodeKey, _ := session.Get("identCodeValue").(string)
-	if identCodeKey != "" && identCodeKey == code {
+	identCodeValue, _ := session.Get("identCodeValue").(string)
+	if identCodeValue != "" && identCodeValue == code {
 		identCodeKey, _ := session.Get("identCodeKey").(string)
 		ClearPhoneIdentSession(session)
 		return identCodeKey

+ 1 - 1
common/src/qfw/util/jy/user_merge.go

@@ -5,8 +5,8 @@ import (
 	"errors"
 	"fmt"
 	"log"
+	"qfw/mongodb"
 	qutil "qfw/util"
-	"qfw/util/mongodb"
 	"qfw/util/redis"
 	"regexp"
 	"strings"

+ 1 - 1
core/src/config.json

@@ -1,5 +1,5 @@
 {
-    "webServerPort": "8089",
+    "webServerPort": "501",
     "redisServers": "enterprise=192.168.3.128:1712,service=192.168.3.128:1712,other=192.168.3.128:1712,sso=192.168.3.128:1712,credit=192.168.3.128:1712,session=192.168.3.128:1712",
     "useRedis": false,
     "mongodbServers": "192.168.3.128:27080",	

BIN
core/src/core2020


+ 7 - 0
core/src/message.json

@@ -13,6 +13,13 @@
 	"account":"/market/m/search.html?id=010301",
 	"audit":"/market/m/search.html?id=010302",
 	
+	"govserviceFD":"/ent-gov/gov/?to=funds",
+	"govservice":"/ent-gov/gov/",
+	"govserviceRT":"/ent-gov/gov/?to=reports",
+	"bindphone":"/ent-gov/phone/",
+	"my":"/ent-gov/ent/",
+	
+	"lawsearchaction":"/law/qfw/index",
 	"msiteaction":"/ent/wsite/edit",
 	"wxpushlist":"/wxpush/bidinfo/%s",
 	"turncards":"/active/flop/in/in",

+ 112 - 0
core/src/qfw/manage/auth_ent.go

@@ -0,0 +1,112 @@
+package manage
+
+import (
+	"errors"
+	"fmt"
+	"log"
+	cutil "qfw/coreutil"
+	"time"
+
+	"gopkg.in/mgo.v2/bson"
+
+	"qfw/util"
+	"qfw/util/mongodb"
+
+	"github.com/go-xweb/xweb"
+)
+
+//企业审核
+type EntAuth struct {
+	*xweb.Action
+	list    xweb.Mapper `xweb:"/manage/entauth/list"`        //列表页面请求
+	listReq xweb.Mapper `xweb:"/manage/entauth/listReq"`     //列表页面
+	detail  xweb.Mapper `xweb:"/manage/entauth/detail/(.*)"` //三级页展示
+	change  xweb.Mapper `xweb:"/manage/entauth/change"`      //审核修改
+}
+
+func init() {
+	xweb.AddAction(&EntAuth{})
+}
+func (this *EntAuth) List() {
+	this.Render("/manage/auth/list_ent.html")
+}
+func (this *EntAuth) ListReq() {
+	r := func() *FuncResult {
+		cPage, _ := this.GetInt("currentPage")
+		pageSize, _ := this.GetInt("perPage")
+		queryStr := this.GetString("query")
+		status := this.GetString("status")
+		if pageSize == 0 {
+			return &FuncResult{false, errors.New("请求参数有误"), nil}
+		}
+		var sql = ``
+		if queryStr != "" {
+			sql += ` and ( name like '%` + queryStr + `%' or phone ='` + queryStr + `')`
+		}
+		if status != "" {
+			sql += fmt.Sprintf(` and auth_status = %s `, status)
+		}
+		count := cutil.Mysql.CountBySql("SELECT count(*) FROM entniche_info  WHERE legal_name != '' " + sql)
+		list := cutil.Mysql.SelectBySql("SELECT id,auth_time,audit_time,auth_status,name,phone FROM entniche_info  WHERE legal_name != '' " + sql + "order by createtime desc " + fmt.Sprintf("limit %d,%d", (cPage-1)*pageSize, pageSize))
+
+		return &FuncResult{true, nil, map[string]interface{}{
+			"currentPage": cPage,
+			"data":        list,
+			"totalRows":   count,
+		}}
+	}()
+	if r.Err != nil {
+		log.Printf("anth ListReq err:%v\n", r.Err.Error())
+	}
+	this.ServeJson(r.Data)
+}
+
+func (this *EntAuth) Detail(id string) error {
+	rData := cutil.Mysql.FindOne("entniche_info", map[string]interface{}{"id": id}, "", "")
+	if rData == nil || len(*rData) == 0 {
+		return errors.New("not find data")
+	}
+	//认证企业人员信息
+	phone := util.ObjToString((*rData)["phone"])
+	if phone != "" {
+		res := mongodb.FindOneByField("user", bson.M{"i_appid": bson.M{"$exists": 0},
+			"$or": []interface{}{bson.M{"s_phone": phone}, bson.M{"s_m_phone": phone}}}, `{"_id":1}`)
+		if res != nil && len(*res) > 0 {
+			_id := util.BsonIdToSId((*res)["_id"])
+			if final := mongodb.FindOneByField("user_auth", bson.M{"s_userid": _id}, `{"s_realName":1,"i_status":1}`); final != nil && len(*final) > 0 {
+				(*rData)["persion"] = (*final)["s_realName"]
+				(*rData)["persionAuthStatus"] = (*final)["i_status"]
+				(*rData)["persionId"] = util.BsonIdToSId((*final)["_id"])
+			}
+		}
+	}
+	this.T["data"] = rData
+	return this.Render("/manage/auth/detail_ent.html", &this.T)
+}
+
+func (this *EntAuth) Change() {
+	r := func() *FuncResult {
+		id := this.GetString("id")
+		status := this.GetString("status")
+		reason := this.GetString("reason")
+		if id == "" {
+			return &FuncResult{false, errors.New("未找到此条记录"), nil}
+		}
+		if status == "-1" && reason == "" || !(status == "1" || status == "-1") {
+			return &FuncResult{false, errors.New("缺少参数"), nil}
+		}
+		if status == "1" {
+			reason = ""
+		}
+		ok := cutil.Mysql.Update("entniche_info", map[string]interface{}{"id": id},
+			map[string]interface{}{"auth_reason": reason, "auth_status": status, "audit_time": time.Now().Format(util.Date_Full_Layout)})
+		if !ok {
+			return &FuncResult{false, errors.New("数据库操作失败"), nil}
+		}
+		return &FuncResult{true, nil, nil}
+	}()
+	if r.Err != nil {
+		log.Printf("anth ListReq err:%v\n", r.Err.Error())
+	}
+	this.ServeJson(r.Format())
+}

+ 114 - 0
core/src/qfw/manage/auth_user.go

@@ -0,0 +1,114 @@
+package manage
+
+import (
+	"errors"
+	"log"
+	"time"
+
+	cutil "qfw/coreutil"
+	"qfw/util"
+	"qfw/util/mongodb"
+
+	"gopkg.in/mgo.v2/bson"
+
+	"github.com/go-xweb/xweb"
+)
+
+//企业审核
+type UserAuth struct {
+	*xweb.Action
+	list    xweb.Mapper `xweb:"/manage/userauth/list"`        //列表页面请求
+	listReq xweb.Mapper `xweb:"/manage/userauth/listReq"`     //列表页面
+	detail  xweb.Mapper `xweb:"/manage/userauth/detail/(.*)"` //三级页展示
+	change  xweb.Mapper `xweb:"/manage/userauth/change"`      //审核修改
+}
+
+func init() {
+	xweb.AddAction(&UserAuth{})
+}
+func (this *UserAuth) List() {
+	this.Render("/manage/auth/list_user.html")
+}
+func (this *UserAuth) ListReq() {
+	r := func() *FuncResult {
+		cPage, _ := this.GetInteger("currentPage")
+		pageSize, _ := this.GetInteger("perPage")
+		queryStr := this.GetString("query")
+		status := this.GetString("status")
+		if pageSize == 0 {
+			return &FuncResult{false, errors.New("请求参数有误"), nil}
+		}
+		query := map[string]interface{}{}
+		if queryStr != "" {
+			query["$or"] = []interface{}{map[string]interface{}{"s_realName": queryStr}, map[string]interface{}{"s_idNum": queryStr}}
+		}
+		if status != "" {
+			query["i_status"] = util.IntAll(status)
+		}
+		count := mongodb.Count("user_auth", query)
+		list := mongodb.Find("user_auth", query, `{"l_auditDate":-1}`, `{"s_realName":1,"s_idNum":1,"l_authDate":1,"l_auditDate":1,"i_status":1}`, false, (cPage-1)*pageSize, pageSize)
+		return &FuncResult{true, nil, map[string]interface{}{
+			"currentPage": cPage,
+			"data":        list,
+			"totalRows":   count,
+		}}
+	}()
+	if r.Err != nil {
+		log.Printf("user anth ListReq err:%v\n", r.Err.Error())
+	}
+	this.ServeJson(r.Data)
+}
+
+func (this *UserAuth) Detail(id string) error {
+	rData := mongodb.FindById("user_auth", id, "")
+	if rData == nil || len(*rData) == 0 {
+		return errors.New("not find data")
+	}
+	//查询用户信息
+	userid := util.ObjToString((*rData)["s_userid"])
+	phone := ""
+	res := mongodb.FindById("user", userid, `{"s_m_phone":1,"s_phone":1}`)
+	if res != nil && len(*res) > 0 {
+		if (*res)["s_m_phone"] != nil {
+			phone = util.ObjToString((*res)["s_m_phone"])
+		} else if (*res)["s_phone"] != nil {
+			phone = util.ObjToString((*res)["s_phone"])
+		}
+	}
+	if phone != "" {
+		(*rData)["phone"] = phone
+		entRes := cutil.Mysql.Find("entniche_info", map[string]interface{}{"phone": phone}, "id,name,auth_status", "", -1, -1)
+		if len(*entRes) > 0 {
+			(*rData)["entList"] = entRes
+		}
+	}
+	//认证企业人员信息
+	this.T["data"] = rData
+	return this.Render("/manage/auth/detail_user.html", &this.T)
+}
+
+func (this *UserAuth) Change() {
+	r := func() *FuncResult {
+		id := this.GetString("id")
+		status, err := this.GetInteger("status")
+		reason := this.GetString("reason")
+		if err != nil || id == "" {
+			return &FuncResult{false, errors.New("请求参数异常"), nil}
+		}
+		if status == -1 && reason == "" || !(status == 1 || status == -1) {
+			return &FuncResult{false, errors.New("缺少参数"), nil}
+		}
+		if status == 1 {
+			reason = ""
+		}
+		if !mongodb.Update("user_auth", bson.M{"_id": util.StringTOBsonId(id)}, bson.M{"$set": bson.M{"i_status": status, "s_reason": reason, "l_auditDate": time.Now().Unix()}}, true, false) {
+			return &FuncResult{false, errors.New("数据库操作失败"), nil}
+		}
+
+		return &FuncResult{true, nil, nil}
+	}()
+	if r.Err != nil {
+		log.Printf("user anth ListReq err:%v\n", r.Err.Error())
+	}
+	this.ServeJson(r.Format())
+}

+ 2 - 0
core/src/qfw/member/membermanager.go

@@ -1101,6 +1101,8 @@ func UpdateCookieSession(action *xweb.Action, loginType string, flag bool, r map
 		action.Session().Set("userType", IntAllDef(r["i_type"], 2))
 		return
 	}
+	action.Session().Set("openid", r["s_m_openid"])
+	action.Session().Set("s_m_openid", r["s_m_openid"])
 	action.Session().Set("id", BsonIdToSId(r["_id"]))
 	action.Session().Set("identWay", IntAll(r["i_identificationway"]))
 	action.SetSession("loginName", r[loginType])

+ 1 - 1
core/src/timetask.json

@@ -1 +1 @@
-{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2020-03-26 17:21:14"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2020-03-26 17:21:14"}},"marketisstart":true,"marketrate":300}
+{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2020-03-28 15:56:01"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2020-03-28 15:56:06"}},"marketisstart":true,"marketrate":300}

+ 340 - 0
core/src/web/templates/manage/auth/detail_ent.html

@@ -0,0 +1,340 @@
+<html>
+<head>
+    <title>企业审核</title>
+    {{include "/common/inc.html"}}
+    <link href="{{Msg "seo" "cdn"}}/css/message.css" rel="stylesheet">
+    <script src="/js/validform-min.js"></script>
+    <script type="text/javascript" src="/js/zDrag.js"></script>
+    <script type="text/javascript" src="/js/zDialog.js"></script>
+    <script src="{{Msg "seo" "cdn"}}/js/jquery.cityselect.js"></script>
+    <script type="text/javascript" src="{{Msg "seo" "cdn"}}/js/My97DatePicker/WdatePicker.js"></script>
+    <style type="text/css">
+        .widget-content {
+            table-layout: fixed;
+            font-size: 14px;
+        }
+
+        #course {
+            background-color: #f5f5f5;
+        }
+
+        #tr1 td img {
+            border: 1px solid #999999;
+            width: 78px;
+            height: 78px;
+            margin: 0;
+            padding: 0;
+            margin-bottom: 20px;
+        }
+
+        .delbtn {
+            position: absolute;
+            margin: 0 0 0 -10px;
+            padding: 0 0 0 0;
+            background-color: #00ffff;
+            cursor: pointer;
+        }
+
+        .delbtn img {
+            height: 15px !important;
+            width: 15px !important;
+            margin-right: -20px !important;
+            margin-top: -8px !important;
+        }
+
+        /*修改弹框样式*/
+        .modal {
+            top: 10%;
+        }
+
+        .modal-dialog {
+            width: 400px;
+            text-align: center;
+        }
+
+        .modal-dialog .bootbox-close-button.close {
+            display: none;
+        }
+
+        .modal-dialog .modal-header .modal-title {
+            color: #4E5051;
+            font-size: 18px;
+        }
+
+        .modal-dialog .bootbox-body {
+            color: #4E5051;
+            font-size: 14px;
+        }
+
+        .modal-dialog .modal-header,
+        .modal-dialog .modal-footer {
+            border: none;
+
+        }
+
+        .modal-dialog .modal-footer {
+            display: flex;
+            justify-content: space-between;
+        }
+
+        .modal-dialog .modal-footer .bootbox-cancel {
+            width: 110px;
+            height: 38px;
+            left: 24px;
+            top: 112px;
+
+            background: #C2C2C2;
+            border-radius: 4px;
+            border-color: #C2C2C2;
+            color: #ffff;
+        }
+
+        .modal-dialog .modal-footer .bootbox-accept {
+            width: 110px;
+            height: 38px;
+            left: 226px;
+            top: 112px;
+
+            background: #4DB443;
+            border-radius: 4px;
+            border-color: #4DB443;
+            color: #ffff;
+        }
+        .entImg{
+            height:120px;
+            margin-right:10px;
+        }
+        .entImg-group{
+          display: flex;
+        }
+        #save{
+          margin:0px 25px;
+          color: #fff;
+          border-color: #4DB443;
+          background-color: #4DB443;
+        }
+        #cancel{
+          margin:0px 25px;
+          color: #4DB443;
+          border-color: #4DB443;
+          background-color: #fff
+        }
+        .mimg{
+        		width:950px;
+        }
+        .entline-group{
+           display: flex;
+        }
+        .entline-group span{
+          white-space: nowrap;
+          color: #fff;
+          padding: 3px 5px;
+          margin-left: 10px;
+          border-radius: 2px;
+          cursor: pointer;
+        }
+        span.pass{
+          background:#4caf50;
+        }
+        span.unpass{
+          background:#ffc107;
+        }
+    </style>
+</head>
+<body>
+
+{{include "/manage/audithead.html"}}
+<!-- 中间 -->
+<div class="row" style="width:96%; margin:0 auto; margin-top:10px;">
+    <div>
+        {{include "/manage/slider.html"}}
+
+        <div id="content" class="send">
+            <div class="widget-box">
+                <div class="widget-content nopadding">
+                    <div class="head">
+                        <div class="title">企业资料</div>
+                        <div style="clear:both;"></div>
+                    </div>
+                    <div class="sendform">
+                        <form class="registerform form-horizontal" role="form" method="post">                
+                            <div class="form-group">
+                                <label class="col-sm-3 control-label" for="name">企业名称:</label>
+                                <div class="col-sm-8">
+                                    <input class="form-control" readonly="readonly" value="{{.T.data.name}}"/>
+                                </div>
+                            </div>
+                            <div class="form-group">
+                                <label class="col-sm-3 control-label" for="name">统一社会信用代码:</label>
+                                <div class="col-sm-5" >
+                                    <input class="form-control" readonly="readonly" value="{{.T.data.code}}"/>
+                                </div>
+                            </div>
+                            <div class="form-group">
+                                <label class="col-sm-3 control-label" for="name">法人:</label>
+                                <div class="col-sm-3" >
+                                    <input class="form-control" readonly="readonly" value="{{.T.data.legal_name}}"/>
+                                </div>
+                            </div>
+
+                            <div class="form-group">
+                                <label class="col-sm-3 control-label" for="name">法人身份证号码:</label>
+                                <div class="col-sm-5">
+                                    <input class="form-control" readonly="readonly" value="{{.T.data.legal_idcard}}"/>
+                                </div>
+                            </div>
+                            
+                            <div class="form-group">
+                                <label class="col-sm-3 control-label" for="name">绑定手机号</label>
+                                <div class="col-sm-3">
+                                    <input class="form-control" readonly="readonly" value="{{.T.data.phone}}"/>
+                                </div>
+                            </div>
+                            
+                            <div class="form-group">
+                                <label class="col-sm-3 control-label" for="name">营业执照:</label>
+                                <div class="col-sm-5">
+                                    <img class="entImg" src="{{.T.data.license}}">
+                                </div>
+                            </div>
+                            
+                            <div class="form-group">
+                                <label class="col-sm-3 control-label" for="name">法人身份证:</label>
+                                <div class="col-sm-5 entImg-group">
+                                    <img class="entImg" src="{{.T.data.legal_idcard_front}}">
+                                    <img class="entImg" src="{{.T.data.legal_idcard_after}}">
+                                </div>
+                            </div>
+                            
+                            <div class="form-group">
+                                <label class="col-sm-3 control-label" for="name">认证企业人员:</label>
+                                <div class="col-sm-3 entline-group" style="padding-top: 9px;">
+                                    <div>{{.T.data.persion}}</div>
+                                    {{if .T.data.persionAuthStatus}}
+                                      {{if eq .T.data.persionAuthStatus 1}}
+                                      <span class="pass" onclick="window.location.href='/manage/userauth/detail/{{.T.data.persionId}}'">已认证</span>
+                                      {{else}}
+                                      <span class="unpass"  onclick="window.location.href='/manage/userauth/detail/{{.T.data.persionId}}'">未认证</span>
+                                      {{end}}
+                                    {{end}}
+                                </div>
+                            </div>
+                            
+                            <div class="form-group">
+                                <label class="col-sm-3 control-label" for="name">企业创建时间:</label>
+                                <div class="col-sm-3">
+                                    <input class="form-control" readonly="readonly"  value="{{.T.data.createtime}}"/>
+                                </div>
+                            </div>
+
+                        </form>
+                    </div>
+
+                    <div class="head">
+                        <div style="clear:both;"></div>
+                    </div>
+                    <div class="sendform form-horizontal"> 
+                          <div class="form-group">
+                              <label class="col-sm-3 control-label" for="name">审核:</label>
+                              <div class="col-sm-5" style="margin-top: 7px;">
+                                  <input type="radio" name="pass" value="1" style="margin:0px 10px 0px 0px;cursor: pointer;"/>通过
+                                  <input type="radio" name="pass" value="-1" style="margin:0px 10px 0px 30px;cursor: pointer;"/>不通过
+                              </div>
+                          </div> 
+                         <div class="form-group">
+                              <label class="col-sm-3 control-label" for="name">未通过原因:</label>
+                              <div class="col-sm-5">
+                                  <input id="reason" class="form-control" value="{{.T.data.auth_reason}}"/>
+                              </div>
+                          </div>
+                          <div class="col-sm-10" style="margin-left:20%">
+                            <button class="btn" type="button" id="save">保存</button>
+                            <button class="btn" type="button" id="cancel">重置</button>
+                          </div>
+                    </div>
+            </div>
+        </div>
+
+    </div>
+</div>
+
+<!--显示图片-->
+<div class="modal fade" id="myModal" tabindex="-1" role="dialog" 
+   aria-labelledby="myModalLabel" aria-hidden="true">
+   <div class="modal-dialog mimg">
+      <div class="modal-content">
+         <div class="modal-header">
+            <button type="button" class="close" data-dismiss="modal" 
+               aria-hidden="true">×
+            </button>
+         </div>
+         <div class="modal-body" id="imgshow" style="cursor:pointer;width:100%;" >
+
+         </div>
+         <div class="modal-footer">
+            <button type="button" class="btn btn-default" 
+               data-dismiss="modal">关闭
+            </button>
+         </div>
+      </div><!-- /.modal-content -->
+   </div><!-- /.modal-dialog -->
+</div><!-- /.modal -->
+{{include "/common/bottom.html"}}
+<script type="text/javascript" src="/js/bootbox.js"></script>
+<script>
+  $(function(){
+    var status={{.T.data.auth_status}}
+    $("input[name='pass']").on("click",function(){
+      if($(this).val()==1){
+        $("#reason").val("");
+        $("#reason").attr("readonly","readonly")
+      }else{
+        $("#reason").removeAttr("readonly")
+      }
+    })
+    if(status===1){
+      $("input[name='pass']:eq(0)").trigger("click");
+    }else if(status===-1){
+      $("input[name='pass']:eq(1)").trigger("click");
+    }
+    
+    $(".entImg").on("click",function(){
+      showdiv(this)
+    })
+    
+    $("#cancel").on("click",function(){window.location.reload()})
+    $("#save").on("click",function(){
+      var status=$('input[name="pass"]:checked').val();
+      var reason=$('#reason').val();
+      if(status==="-1"){
+        if(reason==""){
+          alert("请输入未通过原因")
+          return
+        }
+      }else if(status==="1"){
+        reason="";
+      }else{
+         alert("未知输入")
+      }
+      $.post("/manage/entauth/change",{"id":{{.T.data.id}},"status":status,"reason":reason},function(r){
+        if(r.success){
+          window.history.back();
+        }else{
+          alert(r.errMsg)
+        }
+      },"json")
+    })
+  })
+   function showdiv(t) { 
+  	var ht=$(t).attr("src");
+    if(ht==""||ht==undefined){
+      return
+    }
+    $('#myModal').modal({
+   		keyboard: true
+	  });	
+  	$("#imgshow").html("<img style='width:100%' src='"+ht+"'/>")
+   }
+</script>
+</body>
+</html>

+ 322 - 0
core/src/web/templates/manage/auth/detail_user.html

@@ -0,0 +1,322 @@
+<html>
+<head>
+    <title>用户实名认证审核</title>
+    {{include "/common/inc.html"}}
+    <link href="{{Msg "seo" "cdn"}}/css/message.css" rel="stylesheet">
+    <script src="/js/validform-min.js"></script>
+    <script type="text/javascript" src="/js/zDrag.js"></script>
+    <script type="text/javascript" src="/js/zDialog.js"></script>
+    <script src="{{Msg "seo" "cdn"}}/js/jquery.cityselect.js"></script>
+    <script type="text/javascript" src="{{Msg "seo" "cdn"}}/js/My97DatePicker/WdatePicker.js"></script>
+    <style type="text/css">
+        .widget-content {
+            table-layout: fixed;
+            font-size: 14px;
+        }
+
+        #course {
+            background-color: #f5f5f5;
+        }
+
+        #tr1 td img {
+            border: 1px solid #999999;
+            width: 78px;
+            height: 78px;
+            margin: 0;
+            padding: 0;
+            margin-bottom: 20px;
+        }
+
+        .delbtn {
+            position: absolute;
+            margin: 0 0 0 -10px;
+            padding: 0 0 0 0;
+            background-color: #00ffff;
+            cursor: pointer;
+        }
+
+        .delbtn img {
+            height: 15px !important;
+            width: 15px !important;
+            margin-right: -20px !important;
+            margin-top: -8px !important;
+        }
+
+        /*修改弹框样式*/
+        .modal {
+            top: 10%;
+        }
+
+        .modal-dialog {
+            width: 400px;
+            text-align: center;
+        }
+
+        .modal-dialog .bootbox-close-button.close {
+            display: none;
+        }
+
+        .modal-dialog .modal-header .modal-title {
+            color: #4E5051;
+            font-size: 18px;
+        }
+
+        .modal-dialog .bootbox-body {
+            color: #4E5051;
+            font-size: 14px;
+        }
+
+        .modal-dialog .modal-header,
+        .modal-dialog .modal-footer {
+            border: none;
+
+        }
+
+        .modal-dialog .modal-footer {
+            display: flex;
+            justify-content: space-between;
+        }
+
+        .modal-dialog .modal-footer .bootbox-cancel {
+            width: 110px;
+            height: 38px;
+            left: 24px;
+            top: 112px;
+
+            background: #C2C2C2;
+            border-radius: 4px;
+            border-color: #C2C2C2;
+            color: #ffff;
+        }
+
+        .modal-dialog .modal-footer .bootbox-accept {
+            width: 110px;
+            height: 38px;
+            left: 226px;
+            top: 112px;
+
+            background: #4DB443;
+            border-radius: 4px;
+            border-color: #4DB443;
+            color: #ffff;
+        }
+        .entImg{
+            height:120px;
+            margin-right:10px;
+        }
+        .entImg-group{
+          display: flex;
+        }
+        #save{
+          margin:0px 25px;
+          color: #fff;
+          border-color: #4DB443;
+          background-color: #4DB443;
+        }
+        #cancel{
+          margin:0px 25px;
+          color: #4DB443;
+          border-color: #4DB443;
+          background-color: #fff
+        }
+        .mimg{
+        		width:950px;
+        }
+        .entline-group{
+          display: flex;
+          margin:10px 0;
+        }
+        .entline-group span{
+          white-space: nowrap;
+          color: #fff;
+          padding: 3px 5px;
+          margin-left: 10px;
+          border-radius: 2px;
+          cursor: pointer;
+        }
+        span.pass{
+          background:#4caf50;
+        }
+        span.unpass{
+          background:#ffc107;
+        }
+        .sendform{
+        	padding: 30px 0px;
+        }
+    </style>
+</head>
+<body>
+
+{{include "/manage/audithead.html"}}
+<!-- 中间 -->
+<div class="row" style="width:96%; margin:0 auto; margin-top:10px;">
+    <div>
+        {{include "/manage/slider.html"}}
+
+        <div id="content" class="send">
+            <div class="widget-box">
+                <div class="widget-content nopadding">
+                    <div class="head">
+                        <div class="title">企业资料</div>
+                        <div style="clear:both;"></div>
+                    </div>
+                    <div class="sendform">
+                        <form class="registerform form-horizontal" role="form" method="post">                
+                            <div class="form-group">
+                                <label class="col-sm-3 control-label" for="name">姓名:</label>
+                                <div class="col-sm-3">
+                                    <input class="form-control" readonly="readonly" value="{{.T.data.s_realName}}"/>
+                                </div>
+                            </div>
+                            <div class="form-group">
+                                <label class="col-sm-3 control-label" for="name">绑定手机号:</label>
+                                <div class="col-sm-5" >
+                                    <input class="form-control" readonly="readonly" value="{{.T.data.phone}}"/>
+                                </div>
+                            </div>
+                            <div class="form-group">
+                                <label class="col-sm-3 control-label" for="name">身份证号码:</label>
+                                <div class="col-sm-5" >
+                                    <input class="form-control" readonly="readonly" value="{{.T.data.s_idNum}}"/>
+                                </div>
+                            </div>
+                            
+                            <div class="form-group">
+                                <label class="col-sm-3 control-label" for="name">身份证照片:</label>
+                                <div class="col-sm-5 entImg-group">
+                                    <img class="entImg" src="{{.T.data.s_idPicPathZ}}">
+                                    <img class="entImg" src="{{.T.data.s_idPicPathF}}">
+                                </div>
+                            </div>
+
+                            <div class="form-group">
+                                <label class="col-sm-3 control-label" for="name">创建企业列表</label>
+                                <div>
+                                <div class="col-sm-8">
+                                  {{range $i, $v := .T.data.entList}}
+                                    {{if $v.auth_status}}
+                                    <div class="entline-group">
+                                        <div>{{$v.name}}</div>
+                                        {{if eq $v.auth_status 1}}
+                                         <div><span class="pass" onclick="window.location.href='/manage/entauth/detail/{{$v.id}}'">已认证</span></div>
+                                        {{else}}
+                                         <div><span class="unpass" onclick="window.location.href='/manage/entauth/detail/{{$v.id}}'">未认证</span></div>
+                                        {{end}}
+                                    </div>
+                                    {{end}}
+                                  {{end}}
+                                </div>
+                                </ul>
+                            </div>
+
+                        </form>
+                    </div>
+
+                   <div class="head">
+                        <div style="clear:both;"></div>
+                    </div>
+                    <div class="sendform form-horizontal"> 
+                          <div class="form-group">
+                              <label class="col-sm-3 control-label" for="name">审核:</label>
+                              <div class="col-sm-5" style="margin-top: 7px;">
+                                  <input type="radio" name="pass" value="1" style="margin:0px 10px 0px 0px;cursor: pointer;"/>通过
+                                  <input type="radio" name="pass" value="-1" style="margin:0px 10px 0px 30px;cursor: pointer;"/>不通过
+                              </div>
+                          </div> 
+                         <div class="form-group">
+                              <label class="col-sm-3 control-label" for="name">未通过原因:</label>
+                              <div class="col-sm-5">
+                                  <input id="reason" class="form-control" value="{{.T.data.s_reason}}"/>
+                              </div>
+                          </div>
+                          <div class="col-sm-10" style="margin-left:20%">
+                            <button class="btn" type="button" id="save">保存</button>
+                            <button class="btn" type="button" id="cancel">重置</button>
+                          </div>
+                    </div>
+            </div>
+        </div>
+
+    </div>
+</div>
+
+<!--显示图片-->
+<div class="modal fade" id="myModal" tabindex="-1" role="dialog" 
+   aria-labelledby="myModalLabel" aria-hidden="true">
+   <div class="modal-dialog mimg">
+      <div class="modal-content">
+         <div class="modal-header">
+            <button type="button" class="close" data-dismiss="modal" 
+               aria-hidden="true">×
+            </button>
+         </div>
+         <div class="modal-body" id="imgshow" style="cursor:pointer;width:100%;" >
+
+         </div>
+         <div class="modal-footer">
+            <button type="button" class="btn btn-default" 
+               data-dismiss="modal">关闭
+            </button>
+         </div>
+      </div><!-- /.modal-content -->
+   </div><!-- /.modal-dialog -->
+</div><!-- /.modal -->
+{{include "/common/bottom.html"}}
+<script type="text/javascript" src="/js/bootbox.js"></script>
+<script>
+  $(function(){
+    var status={{.T.data.i_status}}
+    $("input[name='pass']").on("click",function(){
+      if($(this).val()==1){
+        $("#reason").val("");
+        $("#reason").attr("readonly","readonly")
+      }else{
+        $("#reason").removeAttr("readonly")
+      }
+    })
+    if(status===1){
+      $("input[name='pass']:eq(0)").trigger("click");
+    }else if(status===-1){
+      $("input[name='pass']:eq(1)").trigger("click");
+    }
+    
+    $(".entImg").on("click",function(){
+      showdiv(this)
+    })
+    
+    $("#cancel").on("click",function(){window.location.reload()})
+    $("#save").on("click",function(){
+      var status=$('input[name="pass"]:checked').val();
+      var reason=$('#reason').val();
+      if(status==="-1"){
+        if(reason==""){
+          alert("请输入未通过原因")
+          return
+        }
+      }else if(status==="1"){
+        reason="";
+      }else{
+         alert("未知输入")
+      }
+      $.post("/manage/userauth/change",{"id":{{.T.data._id}},"status":status,"reason":reason},function(r){
+        if(r.success){
+          window.history.back();
+        }else{
+          alert(r.errMsg)
+        }
+      },"json")
+    })
+  })
+   function showdiv(t) { 
+  	var ht=$(t).attr("src");
+    if(ht==""||ht==undefined){
+      return
+    }
+    $('#myModal').modal({
+   		keyboard: true
+	  });	
+  	$("#imgshow").html("<img style='width:100%' src='"+ht+"'/>")
+   }
+</script>
+</body>
+</html>

+ 298 - 0
core/src/web/templates/manage/auth/list_ent.html

@@ -0,0 +1,298 @@
+<html>
+<head>
+    <title>企业审核</title>
+    {{include "/common/inc.html"}}
+    <script src="{{Msg "seo" "cdn"}}/js/jquery.cookie.js"></script>
+    <script src="/js/qfwtable.js"></script>
+    <style type="text/css">
+        #course {
+            background-color: #f5f5f5;
+        }
+
+        #content table {
+            table-layout: fixed;
+            border: 0px;
+            font-size: 14px;
+        }
+
+        #sidebar {
+            margin-left: 0px;
+        }
+
+        .table > thead > tr > th:nth-child(1) {
+            width: 30%;
+        }
+
+        .table > thead > tr > th:nth-child(2) {
+            width: 10%;
+        }
+
+        .table > thead > tr > th:nth-child(3) {
+            width: 15%;
+        }
+
+        .table > thead > tr > th:nth-child(4) {
+            width: 15%;
+        }
+
+        .table > thead > tr > th:nth-child(5) {
+            width: 10%;
+        }
+
+        .table > thead > tr > th:nth-child(6), .table > tbody > tr > td:nth-child(6) {
+            width: 20%;
+            /*text-align: center;*/
+        }
+
+
+        .table > thead > tr > th {
+            border: 0px;
+            font-size: 14px;
+        }
+
+        .table > tbody > tr > td {
+            white-space: nowrap;
+            text-overflow: ellipsis;
+            overflow: hidden;
+            border: 0px;
+            border-bottom: 1px dashed #999999;
+        }
+
+        .table > tbody > tr {
+            cursor: pointer;
+        }
+
+        .addCourse {
+            float: right;
+            margin-right: 20px;
+            color: #fff;
+            background-color: #38b44a;
+            border-color: #38b44a;
+            border-radius: 4px;
+            padding: 8px 12px;
+            margin: 5px;
+        }
+
+        .pagination > .active > a:hover, .pagination > .active > a:focus {
+            background-color: #18CC7D;
+        }
+
+        .editBtn {
+            display: flex;
+        }
+
+        .editBtn span {
+            padding: 3px 7px;
+            border: 1px solid;
+            border-radius: 4px;
+            margin: 0 3px;
+        }
+
+        .yellowStyle {
+            color: #EAB62F;
+            border-color: #EAB62F;
+        }
+
+        .greenStyle {
+            color: #4DB443;
+            border-color: #4DB443;
+        }
+
+        .redStyle {
+            color: #F5585C;
+            border-color: #F5585C;
+        }
+
+        /*修改弹框样式*/
+        .modal {
+            top: 33%;
+        }
+
+        .modal-dialog {
+            width: 400px;
+            text-align: center;
+        }
+
+        .modal-dialog .bootbox-close-button.close {
+            display: none;
+        }
+
+        .modal-dialog .modal-header .modal-title {
+            color: #4E5051;
+            font-size: 18px;
+        }
+
+        .modal-dialog .bootbox-body {
+            color: #4E5051;
+            font-size: 14px;
+        }
+
+        .modal-dialog .modal-header,
+        .modal-dialog .modal-footer {
+            border: none;
+
+        }
+
+        .modal-dialog .modal-footer{
+            display: flex;
+            justify-content: space-between;
+        }
+
+        .modal-dialog .modal-footer .bootbox-cancel{
+            width: 110px;
+            height: 38px;
+            left: 24px;
+            top: 112px;
+
+            background: #C2C2C2;
+            border-radius: 4px;
+            border-color: #C2C2C2;
+            color: #ffff;
+        }
+
+        .modal-dialog .modal-footer .bootbox-accept{
+            width: 110px;
+            height: 38px;
+            left: 226px;
+            top: 112px;
+
+            background: #4DB443;
+            border-radius: 4px;
+            border-color: #4DB443;
+            color: #ffff;
+        }
+
+
+    </style>
+</head>
+<body>
+{{include "/manage/audithead.html"}}
+<div class="row" style="width:96%; margin:0 auto;">
+    {{include "/manage/slider.html"}}
+    <div id="content">
+        <div id="audit"></div>
+    </div>
+</div>
+{{include "/common/bottom.html"}}
+</body>
+<script type="text/javascript" src="/js/bootbox.js"></script>
+<script>
+    $(function () {
+        $("#audit").datatable({
+            perPage: 10
+            ,
+            showPagination: true
+            ,
+            checkbox: "" //check radio
+            ,
+            checkboxHeader: false
+            ,
+            idField: "_id"
+            ,
+            classname: "table-hover"
+            ,
+            css: {"height": "550px"}
+            ,
+            buttons: ['<div style="width:50%;margin:5px" class="input-group pull-right" id="search"><input type="text" id="searchtext" value=""  data-original-title="Search" class="form-control" placeholder="请输入检索条件"><span class="input-group-btn"><button class="btn btn-success" onclick="SearchContent()" data-original-title="Search" id="searchtip" type="button" style="height:38px;">检索</button></span></div><div style="margin:5px;" class="controls pull-right"><select class="form-control" id="status"><option value="">  认证状态  </option><option value="1">  通过 </option><option value="-1">  未通过 </option><option value="0">  未认证 </option></select></div>']
+            ,
+            url: '/manage/entauth/listReq'
+            ,
+            columns: [
+                {
+                    title: "企业名称", field: "name"
+                },
+                {
+                    title: "绑定手机号", field: "phone"
+                },
+                {
+                    title: "提交时间", field: "auth_time"
+                },
+                {
+                    title: "处理时间", field: "audit_time"
+                },
+                {
+                    title: "状态", field: "auth_status", callback: function (data) {
+                        if (data.auth_status === -1) {
+                            return "未通过"
+                        } else if (data.auth_status === 1) {
+                            return "通过"
+                        } else {
+                            return "未审核"
+                        }
+                    }
+                },
+                {
+                    title: "操作", field: "applybill_company", callback: function (data) {
+                      return  "<div class='editBtn'><span class='greenStyle' onclick='window.location.href=\"" + "/manage/entauth/detail/" + data.id + "\"'>管理</span></div>"
+                    }
+                }
+            ]
+        });
+
+        $("select").change(function () {
+            var find = $("#audit").data("datatable");
+            if (!find.options.opost) find.options.opost = find.options.post || {};
+            find.options.post = $.extend(find.options.opost, {
+                status: $("#status").val(),
+            });
+            find.options.currentPage = 1;
+            find.render();
+        });
+
+        $(".addCourse").on("click", function () {
+            window.location.href = "/manage/course/page/add/new"
+        })
+    });
+
+    //点击跳转新页面
+    function redirect(code) {
+        //sessionStorage.setItem("contentHtml",$("#content").prop("outerHTML"));
+        window.open("/manage/dataExport/dataDetail/" + code);
+    }
+
+    //
+    function SearchContent() {
+        var find = $("#audit").data("datatable");
+        if (!find.options.opost) find.options.opost = find.options.post || {};
+        find.options.post = $.extend(find.options.opost, {query: $("#searchtext").val()});
+        find.options.currentPage = 1;
+        find.render();
+    }
+
+    function doCheck(flag, id) {
+        var tipMsg = "";
+        if (flag === "on") {
+            tipMsg = "确定发布课程?";
+        } else if (flag === "off") {
+            tipMsg = "课程下线后将无法购买,确定是否下线?";
+        } else {
+            return
+        }
+
+        bootbox.confirm({
+            title: "提示",
+            message: tipMsg,
+            buttons: {
+                cancel: {
+                    label: '取消'
+                },
+                confirm: {
+                    label: '确定'
+                }
+            },
+            callback: function (result) {
+                if (!result) {
+                    return
+                }
+                $.post("/manage/course/changeStatus", {id: id, flag: flag}, function (r) {
+                    if (r.success) {
+                        $("#audit").data("datatable").render();
+                    } else {
+                        bootbox.alert(r.errMsg)
+                    }
+                })
+            }
+        });
+    }
+</script>
+</html>

+ 312 - 0
core/src/web/templates/manage/auth/list_user.html

@@ -0,0 +1,312 @@
+<html>
+<head>
+    <title>用户实名认证审核</title>
+    {{include "/common/inc.html"}}
+    <script src="{{Msg "seo" "cdn"}}/js/jquery.cookie.js"></script>
+    <script src="/js/qfwtable.js"></script>
+    <style type="text/css">
+        #course {
+            background-color: #f5f5f5;
+        }
+
+        #content table {
+            table-layout: fixed;
+            border: 0px;
+            font-size: 14px;
+        }
+
+        #sidebar {
+            margin-left: 0px;
+        }
+
+        .table > thead > tr > th:nth-child(1) {
+            width: 15%;
+        }
+
+        .table > thead > tr > th:nth-child(2) {
+            width: 25%;
+        }
+
+        .table > thead > tr > th:nth-child(3) {
+            width: 15%;
+        }
+
+        .table > thead > tr > th:nth-child(4) {
+            width: 15%;
+        }
+
+        .table > thead > tr > th:nth-child(5) {
+            width: 10%;
+        }
+
+        .table > thead > tr > th:nth-child(6), .table > tbody > tr > td:nth-child(6) {
+            width: 20%;
+            /*text-align: center;*/
+        }
+
+
+        .table > thead > tr > th {
+            border: 0px;
+            font-size: 14px;
+        }
+
+        .table > tbody > tr > td {
+            white-space: nowrap;
+            text-overflow: ellipsis;
+            overflow: hidden;
+            border: 0px;
+            border-bottom: 1px dashed #999999;
+        }
+
+        .table > tbody > tr {
+            cursor: pointer;
+        }
+
+        .addCourse {
+            float: right;
+            margin-right: 20px;
+            color: #fff;
+            background-color: #38b44a;
+            border-color: #38b44a;
+            border-radius: 4px;
+            padding: 8px 12px;
+            margin: 5px;
+        }
+
+        .pagination > .active > a:hover, .pagination > .active > a:focus {
+            background-color: #18CC7D;
+        }
+
+        .editBtn {
+            display: flex;
+        }
+
+        .editBtn span {
+            padding: 3px 7px;
+            border: 1px solid;
+            border-radius: 4px;
+            margin: 0 3px;
+        }
+
+        .yellowStyle {
+            color: #EAB62F;
+            border-color: #EAB62F;
+        }
+
+        .greenStyle {
+            color: #4DB443;
+            border-color: #4DB443;
+        }
+
+        .redStyle {
+            color: #F5585C;
+            border-color: #F5585C;
+        }
+
+        /*修改弹框样式*/
+        .modal {
+            top: 33%;
+        }
+
+        .modal-dialog {
+            width: 400px;
+            text-align: center;
+        }
+
+        .modal-dialog .bootbox-close-button.close {
+            display: none;
+        }
+
+        .modal-dialog .modal-header .modal-title {
+            color: #4E5051;
+            font-size: 18px;
+        }
+
+        .modal-dialog .bootbox-body {
+            color: #4E5051;
+            font-size: 14px;
+        }
+
+        .modal-dialog .modal-header,
+        .modal-dialog .modal-footer {
+            border: none;
+
+        }
+
+        .modal-dialog .modal-footer{
+            display: flex;
+            justify-content: space-between;
+        }
+
+        .modal-dialog .modal-footer .bootbox-cancel{
+            width: 110px;
+            height: 38px;
+            left: 24px;
+            top: 112px;
+
+            background: #C2C2C2;
+            border-radius: 4px;
+            border-color: #C2C2C2;
+            color: #ffff;
+        }
+
+        .modal-dialog .modal-footer .bootbox-accept{
+            width: 110px;
+            height: 38px;
+            left: 226px;
+            top: 112px;
+
+            background: #4DB443;
+            border-radius: 4px;
+            border-color: #4DB443;
+            color: #ffff;
+        }
+
+
+    </style>
+</head>
+<body>
+{{include "/manage/audithead.html"}}
+<div class="row" style="width:96%; margin:0 auto;">
+    {{include "/manage/slider.html"}}
+    <div id="content">
+        <div id="audit"></div>
+    </div>
+</div>
+{{include "/common/bottom.html"}}
+</body>
+<script type="text/javascript" src="/js/bootbox.js"></script>
+<script>
+    $(function () {
+        $("#audit").datatable({
+            perPage: 10
+            ,
+            showPagination: true
+            ,
+            checkbox: "" //check radio
+            ,
+            checkboxHeader: false
+            ,
+            idField: "_id"
+            ,
+            classname: "table-hover"
+            ,
+            css: {"height": "550px"}
+            ,
+            buttons: ['<div style="width:50%;margin:5px" class="input-group pull-right" id="search"><input type="text" id="searchtext" value=""  data-original-title="Search" class="form-control" placeholder="请输入检索条件"><span class="input-group-btn"><button class="btn btn-success" onclick="SearchContent()" data-original-title="Search" id="searchtip" type="button" style="height:38px;">检索</button></span></div><div style="margin:5px;" class="controls pull-right"><select class="form-control" id="status"><option value="">  认证状态  </option><option value="1">  通过 </option><option value="-1">  未通过 </option><option value="0">  未认证 </option></select></div>']
+            ,
+            url: '/manage/userauth/listReq'
+            ,
+            columns: [
+                {
+                    title: "用户名", field: "s_realName"
+                },
+                {
+                    title: "身份证号", field: "s_idNum"
+                },
+                {
+                    title: "提交时间", field: "l_authDate", callback: function (data) {
+                       return formatDate(data.l_authDate*1000)
+                    }
+                },
+                {
+                    title: "处理时间", field: "l_auditDate", callback: function (data) {
+                       return formatDate(data.l_auditDate*1000)
+                    }
+                },
+                {
+                    title: "状态", field: "i_status", callback: function (data) {
+                        if (data.i_status === -1) {
+                            return "未通过"
+                        } else if (data.i_status === 1) {
+                            return "通过"
+                        } else {
+                            return "未审核"
+                        }
+                    }
+                },
+                {
+                    title: "操作", field: "applybill_company", callback: function (data) {
+                      return  "<div class='editBtn'><span class='greenStyle' onclick='window.location.href=\"" + "/manage/userauth/detail/" + data._id + "\"'>管理</span></div>"
+                    }
+                }
+            ]
+        });
+
+        $("select").change(function () {
+            var find = $("#audit").data("datatable");
+            if (!find.options.opost) find.options.opost = find.options.post || {};
+            find.options.post = $.extend(find.options.opost, {
+                status: $("#status").val(),
+            });
+            find.options.currentPage = 1;
+            find.render();
+        });
+
+        $(".addCourse").on("click", function () {
+            window.location.href = "/manage/course/page/add/new"
+        })
+    });
+
+    //点击跳转新页面
+    function redirect(code) {
+        //sessionStorage.setItem("contentHtml",$("#content").prop("outerHTML"));
+        window.open("/manage/dataExport/dataDetail/" + code);
+    }
+
+    //
+    function SearchContent() {
+        var find = $("#audit").data("datatable");
+        if (!find.options.opost) find.options.opost = find.options.post || {};
+        find.options.post = $.extend(find.options.opost, {query: $("#searchtext").val()});
+        find.options.currentPage = 1;
+        find.render();
+    }
+
+    function doCheck(flag, id) {
+        var tipMsg = "";
+        if (flag === "on") {
+            tipMsg = "确定发布课程?";
+        } else if (flag === "off") {
+            tipMsg = "课程下线后将无法购买,确定是否下线?";
+        } else {
+            return
+        }
+
+        bootbox.confirm({
+            title: "提示",
+            message: tipMsg,
+            buttons: {
+                cancel: {
+                    label: '取消'
+                },
+                confirm: {
+                    label: '确定'
+                }
+            },
+            callback: function (result) {
+                if (!result) {
+                    return
+                }
+                $.post("/manage/course/changeStatus", {id: id, flag: flag}, function (r) {
+                    if (r.success) {
+                        $("#audit").data("datatable").render();
+                    } else {
+                        bootbox.alert(r.errMsg)
+                    }
+                })
+            }
+        });
+    }
+    function formatDate(date) {
+      var date = new Date(date);
+      var YY = date.getFullYear() + '-';
+      var MM = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
+      var DD = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate());
+      var hh = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
+      var mm = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
+      var ss = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
+      return YY + MM + DD +" "+hh + mm + ss;
+    }
+</script>
+</html>

+ 7 - 7
oauthproxy/src/config.json

@@ -1,11 +1,11 @@
 {
-	"port":"91",
-	"appid":"wx5b6a2fc88f63dbee",
-	"appsecret":"4f8cba756d9092df1d32e2f4fdd664a7",
-	"proxysess":"http://webwh.qmx.top/mobile/sess/%s",
+	"port":"507",
+	"appid":"wx5b1c6e7cc4dac0e4",
+	"appsecret":"b026103ffebd2291b3edb7a269612112",
+	"proxysess":"http://web-jydev-ws.jianyu360.cn/mobile/sess/%s",
 	"proxy":{
-		"wsiteaction":"http://webwh.qmx.top/wsite/%s",
-		"swordfishaction":"http://webwh.qmx.top/swordfish/%s",
-		"viewtest":"http://webwh.qmx.top/%s"
+		"wsiteaction":"http://web-jydev-ws.jianyu360.cn/wsite/%s",
+		"swordfishaction":"http://web-jydev-ws.jianyu360.cn/swordfish/%s",
+		"viewtest":"http://web-jydev-ws.jianyu360.cn/%s"
 	}
 }

+ 7 - 5
oauthproxy/src/main.go

@@ -4,8 +4,10 @@ import (
 	"encoding/json"
 	"fmt"
 	"io/ioutil"
+	"log"
 	"net/http"
 	"qfw/util"
+	"reflect"
 	"strconv"
 	"strings"
 	"time"
@@ -66,14 +68,14 @@ func weixinOauth(w http.ResponseWriter, r *http.Request) {
 	}
 	start, end := strings.LastIndex(uri, "/"), strings.Index(uri, "?")
 	action := uri[start+1 : end]
-	//log.Println("action", action)
+	log.Println("action", action)
 	//
 	r.ParseForm()
 	code, _ := r.Form["code"][0], r.Form["state"][0]
 
 	//取得openid
 	url := fmt.Sprintf(OPENAUTH_URLTPL, AppId, AppSecret, code)
-	//log.Println("request url:", url)
+	log.Println("request url:", url)
 	resp, err := http.Get(url)
 	defer resp.Body.Close()
 	if err == nil {
@@ -86,12 +88,12 @@ func weixinOauth(w http.ResponseWriter, r *http.Request) {
 			fmt.Fprintln(w, ERROR_TEMPLATE)
 			return
 		}
-		//fmt.Println(tmp)
-		//fmt.Println(reflect.TypeOf(tmp))
+		fmt.Println(tmp)
+		fmt.Println(reflect.TypeOf(tmp))
 		openid, _ := tmp["openid"].(string)
 		unionid, _ := tmp["unionid"].(string)
 		tmpstr := openid + "," + unionid + "," + strconv.Itoa(int(time.Now().Unix())) + "," + action
-		//fmt.Println("param:", tmpstr)
+		fmt.Println("param:", tmpstr)
 		url := fmt.Sprintf(proxysess, se.EncodeString(tmpstr))
 		fmt.Println("redirect::", url)
 		//跳转

+ 17 - 11
weixin/src/config.json

@@ -1,19 +1,19 @@
 {
-    "port": "88",
-    "domain": "webwh.qmx.top",
+    "port": "506",
+    "domain": "web-jydev-ws.jianyu360.cn",
     "imgpath": "E:/go_workspace/qfw/core/src/web/staticres",
-    "mongodbServers": "192.168.3.18:27080",
-    "elasticsearch": "http://192.168.3.18:9800",
+    "mongodbServers": "192.168.3.128:27080",
+    "elasticsearch": "http://192.168.3.128:9800",
     "elasticPoolSize": 30,
     "mongodbPoolSize": 5,
     "mongodbName": "qfw",
-    "redisServers": "enterprise=192.168.3.18:3379,service=192.168.3.18:3379,other=192.168.3.18:3379,sso=192.168.3.18:3379,credit=192.168.3.18:3379,gsjhyw=192.168.3.18:3379",
-    "rpcport": "83",
+    "redisServers": "enterprise=192.168.3.128:1712,service=192.168.3.128:1712,other=192.168.3.128:1712,sso=192.168.3.128:1712,credit=192.168.3.128:1712,gsjhyw=192.168.3.128:1712",
+    "rpcport": "8083",
     "serviceTip": "服务指南",
     "appcontext": "weixin",
-    "appid": "wx5b6a2fc88f63dbee",
-    "token": "top2016top2016",
-    "appsecret": "4f8cba756d9092df1d32e2f4fdd664a7",
+    "appid": "wx5b1c6e7cc4dac0e4",
+    "token": "top2015top2015",
+    "appsecret": "b026103ffebd2291b3edb7a269612112",
     "aboutmeurl": "http://www.qimingxing.info/article/aboutme",
     "conactusurl": "http://www.qimingxing.info/article/contactus",
     "wsqurl": "http://s.p.qq.com/pub/jump?d=AAAXeGLZ",
@@ -29,7 +29,8 @@
         "offLinemsgtplid": "ExIeyFfoDNVJXhRDq09JbsjH_zbEJCB6gw6rxcV7atw",
         "msgnotifytplid": "fcke7PqteAtclzHV3ScdiePH48vxaH6M5aJF0O_7by8",
         "managernotifytplid": "Iky7z3veZ6hy-ISchmQSgBvRd-34KzSyuYr0_fUbesE",
-        "feedbacknotifytplid": "GySy3qxaLG6G2JTpE_tz_xS85NtUg8YffdpC7DBGQkA"
+        "feedbacknotifytplid": "GySy3qxaLG6G2JTpE_tz_xS85NtUg8YffdpC7DBGQkA",
+        "entservicenotifytplid": "euAy8tu2RhgFm-xdA3MTKge5gxQsr0aVQgkYt48ny9E"
     },
     "activity": {
         "activitycode": "topcj",
@@ -77,5 +78,10 @@
         "tplid": "Q9AUylwZlZJsDjsrwUfwjI401NUBVc7OhY8RO96Eti4",
         "tpltitle": "工商业务办理状态",
         "autorpl": "抱歉当前无在线客服,请稍后咨询。"
-    }
+    },
+	"entServiceReplay":{
+		"title":"河南省郑州市金水区科技局政务服务已上线。<a href='%s'>点击查看</a>",
+		"href":"govservice",
+		"code":"10001"
+	}
 }

+ 3 - 3
weixin/src/main.go

@@ -33,12 +33,12 @@ func init() {
 	//微信sdk配置
 	weixin.InitWeixinSdk()
 	//连接消息总线
-	go weixin.InitDgWork()
+	//	go weixin.InitDgWork()
 	//go kf()
 	//weixin.GetKfMsg(1)
 
-	go weixin.GetKfMsgJob()
-	go weixin.GetOnlineKfJob()
+	//	go weixin.GetKfMsgJob()
+	//	go weixin.GetOnlineKfJob()
 	go weixin.GsYwxxBgPush()
 	go weixin.GetGsYwxxBg()
 }

+ 29 - 33
weixin/src/qfw/weixin/menu.go

@@ -15,33 +15,33 @@ func CreateMenu(rw http.ResponseWriter, r *http.Request) {
 	//log.Println("menu", urlstr)
 	menu := &Menu{make([]MenuButton, 3)}
 
-	menu.Buttons[0].Name = "服务搜索"                              //"剑鱼"
-	menu.Buttons[0].Type = MenuButtonTypeUrl                   ///search/enterprise/m_ent.html
-	menu.Buttons[0].Url = fmt.Sprintf(urlstr, "searchservice") //fmt.Sprintf(urlstr, "swordfishaction")
+	menu.Buttons[0].Name = "政务服务"                           //"剑鱼"
+	menu.Buttons[0].Type = MenuButtonTypeUrl                ///search/enterprise/m_ent.html
+	menu.Buttons[0].Url = fmt.Sprintf(urlstr, "govservice") //fmt.Sprintf(urlstr, "swordfishaction")
 
-	menu.Buttons[1].Name = "企业服务" //"企业查询"
-	menu.Buttons[1].SubButtons = make([]MenuButton, 5)
-	//menu.Buttons[1].Type = MenuButtonTypeUrl ///search/enterprise/m_ent.html
-	//menu.Buttons[1].Url = fmt.Sprintf(urlstr, "entsearchaction")
-	menu.Buttons[1].SubButtons[0].Name = "我预约的服务"
-	menu.Buttons[1].SubButtons[0].Type = MenuButtonTypeUrl
-	menu.Buttons[1].SubButtons[0].Url = fmt.Sprintf(urlstr, "myapp")
+	menu.Buttons[1].Name = "法规查询" //"企业查询"
+	//	menu.Buttons[1].SubButtons = make([]MenuButton, 5)
+	menu.Buttons[1].Type = MenuButtonTypeUrl ///search/enterprise/m_ent.html
+	menu.Buttons[1].Url = fmt.Sprintf(urlstr, "lawsearchaction")
+	//	menu.Buttons[1].SubButtons[0].Name = "我预约的服务"
+	//	menu.Buttons[1].SubButtons[0].Type = MenuButtonTypeUrl
+	//	menu.Buttons[1].SubButtons[0].Url = fmt.Sprintf(urlstr, "myapp")
 
-	menu.Buttons[1].SubButtons[1].Name = "我收藏的服务"
-	menu.Buttons[1].SubButtons[1].Type = MenuButtonTypeUrl
-	menu.Buttons[1].SubButtons[1].Url = fmt.Sprintf(urlstr, "mycal")
+	//	menu.Buttons[1].SubButtons[1].Name = "我收藏的服务"
+	//	menu.Buttons[1].SubButtons[1].Type = MenuButtonTypeUrl
+	//	menu.Buttons[1].SubButtons[1].Url = fmt.Sprintf(urlstr, "mycal")
 
-	menu.Buttons[1].SubButtons[2].Name = "工商注册"
-	menu.Buttons[1].SubButtons[2].Type = MenuButtonTypeUrl
-	menu.Buttons[1].SubButtons[2].Url = fmt.Sprintf(urlstr, "busness")
+	//	menu.Buttons[1].SubButtons[2].Name = "工商注册"
+	//	menu.Buttons[1].SubButtons[2].Type = MenuButtonTypeUrl
+	//	menu.Buttons[1].SubButtons[2].Url = fmt.Sprintf(urlstr, "busness")
 
-	menu.Buttons[1].SubButtons[3].Name = "代理记账"
-	menu.Buttons[1].SubButtons[3].Type = MenuButtonTypeUrl
-	menu.Buttons[1].SubButtons[3].Url = fmt.Sprintf(urlstr, "account")
+	//	menu.Buttons[1].SubButtons[3].Name = "代理记账"
+	//	menu.Buttons[1].SubButtons[3].Type = MenuButtonTypeUrl
+	//	menu.Buttons[1].SubButtons[3].Url = fmt.Sprintf(urlstr, "account")
 
-	menu.Buttons[1].SubButtons[4].Name = "财务审计"
-	menu.Buttons[1].SubButtons[4].Type = MenuButtonTypeUrl
-	menu.Buttons[1].SubButtons[4].Url = fmt.Sprintf(urlstr, "audit")
+	//	menu.Buttons[1].SubButtons[4].Name = "财务审计"
+	//	menu.Buttons[1].SubButtons[4].Type = MenuButtonTypeUrl
+	//	menu.Buttons[1].SubButtons[4].Url = fmt.Sprintf(urlstr, "audit")
 
 	/*
 		menu.Buttons[1].SubButtons = make([]MenuButton, 3)
@@ -56,22 +56,18 @@ func CreateMenu(rw http.ResponseWriter, r *http.Request) {
 		menu.Buttons[1].SubButtons[2].Key = "oidentification"
 	*/
 	menu.Buttons[2].Name = "工具箱" //"会员服务"
-	menu.Buttons[2].SubButtons = make([]MenuButton, 4)
-	menu.Buttons[2].SubButtons[0].Name = "剑鱼招标订阅" //"微官网"
+	menu.Buttons[2].SubButtons = make([]MenuButton, 2)
+	menu.Buttons[2].SubButtons[0].Name = "剑鱼标讯" //"微官网"
 	menu.Buttons[2].SubButtons[0].Type = MenuButtonTypeUrl
 	menu.Buttons[2].SubButtons[0].Url = fmt.Sprintf(urlstr, "swordfishaction")
 
-	menu.Buttons[2].SubButtons[1].Name = "企业查询" //"我的积分/签到"
+	menu.Buttons[2].SubButtons[1].Name = "我的"
 	menu.Buttons[2].SubButtons[1].Type = MenuButtonTypeUrl
-	menu.Buttons[2].SubButtons[1].Url = fmt.Sprintf(urlstr, "entsearchaction") //fmt.Sprintf(urlstr, "signature")
+	menu.Buttons[2].SubButtons[1].Url = fmt.Sprintf(urlstr, "my")
 
-	menu.Buttons[2].SubButtons[2].Name = "法规查询"
-	menu.Buttons[2].SubButtons[2].Type = MenuButtonTypeUrl
-	menu.Buttons[2].SubButtons[2].Url = fmt.Sprintf(urlstr, "lawsearchaction")
-
-	menu.Buttons[2].SubButtons[3].Name = "企业认证"
-	menu.Buttons[2].SubButtons[3].Type = MenuButtonTypeKey ///search/enterprise/m_ent.html
-	menu.Buttons[2].SubButtons[3].Key = "midentification"
+	//	menu.Buttons[2].SubButtons[3].Name = "企业认证"
+	//	menu.Buttons[2].SubButtons[3].Type = MenuButtonTypeKey ///search/enterprise/m_ent.html
+	//	menu.Buttons[2].SubButtons[3].Key = "midentification"
 	//menu.Buttons[2].SubButtons[1].Type = MenuButtonTypeKey
 	//menu.Buttons[2].SubButtons[1].Key = "entsearch"
 

+ 43 - 1
weixin/src/qfw/weixin/rpc/rpc.go

@@ -26,7 +26,7 @@ const (
 	//msgnotify_tplid = "b7iuAMiTCIolnPhTdueKBVYThEMf2D-Bh2M_9v3J-68" //消息提醒
 )
 
-var identify_tplid, offLineMsg_tplid, msgnotify_tplid, managernotify_tplid, feedbacknotify_tplid string
+var identify_tplid, offLineMsg_tplid, msgnotify_tplid, managernotify_tplid, feedbacknotify_tplid, entservicenotify_tplid string
 
 //读取配置
 func InitTpl() {
@@ -35,6 +35,48 @@ func InitTpl() {
 	msgnotify_tplid = wf.SysConfig.MessageTpl["msgnotifytplid"]
 	managernotify_tplid = wf.SysConfig.MessageTpl["managernotifytplid"]
 	feedbacknotify_tplid = wf.SysConfig.MessageTpl["feedbacknotifytplid"]
+	entservicenotify_tplid = wf.SysConfig.MessageTpl["entservicenotifytplid"]
+}
+
+//企业服务通知消息
+func (wxrpc *WeiXinRpc) SendEntServiceMsg(param *qrpc.NotifyMsg, ret *qrpc.RpcResult) (err error) {
+	log.Println("tpl::", entservicenotify_tplid)
+	//构造自定义消息文本
+	var msg struct {
+		ToUser   string `json:"touser"`
+		TplId    string `json:"template_id"`
+		Url      string `json:"url"`
+		Topcolor string `json:"topcolor"`
+		Data     struct {
+			Title struct {
+				Value string `json:"value"`
+			} `json:"first"`
+			Detail struct {
+				Value string `json:"value"`
+			} `json:"keyword1"`
+			Result struct {
+				Value string `json:"value"`
+			} `json:"keyword2"`
+			Remark struct {
+				Value string `json:"value"`
+			} `json:"remark"`
+		} `json:"data"`
+	}
+	msg.ToUser = param.Openid
+	msg.TplId = entservicenotify_tplid
+	msg.Url = param.Url
+	msg.Data.Title.Value = param.Title
+	msg.Data.Detail.Value = param.Detail
+	msg.Data.Result.Value = param.Result
+	msg.Data.Remark.Value = param.Remark
+	log.Println(msg)
+	err = wxrpc.wx.PostTextCustom(tplapi_url, &msg)
+	if err != nil {
+		log.Println(err.Error())
+	} else {
+		log.Println("send tplmsg success!")
+	}
+	return
 }
 
 func (wxrpc *WeiXinRpc) SendPushTplMsg(param *qrpc.NotifyMsg, ret *qrpc.RpcResult) (err error) {

+ 41 - 1
weixin/src/qfw/weixin/ssohandler.go

@@ -4,13 +4,53 @@ package weixin
 import (
 	"encoding/json"
 	"fmt"
-	"github.com/SKatiyar/qr"
 	"log"
 	"net/http"
 	"qfw/util"
 	"strconv"
+
+	"github.com/SKatiyar/qr"
 )
 
+//生成永久二维码
+func YjHandle_Img(w http.ResponseWriter, r *http.Request) {
+	param := r.RequestURI[12:]
+	if !digitreg.MatchString(param) {
+		return
+	}
+	log.Println("param:", param)
+	//TODO 参数存redis
+	iparam, _ := strconv.Atoi(param)
+	//构造自定义消息文本
+	var msg struct {
+		Name string `json:"action_name"`
+		Info struct {
+			Scene struct {
+				Id int `json:"scene_id"`
+			} `json:"scene"`
+		} `json:"action_info"`
+	}
+	msg.Name = "QR_LIMIT_SCENE"
+	msg.Info.Scene.Id = iparam
+	ret, err := Mux.PostCustomMsg("https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=", &msg)
+	if err != nil {
+		log.Println(err.Error())
+	} else {
+		tmp := map[string]interface{}{}
+		json.Unmarshal(ret, &tmp)
+		log.Println(tmp)
+		url := tmp["url"].(string)
+		w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
+		w.Header().Set("Pragma", "no-cache")
+		w.Header().Set("Expires", "0")
+		w.Header().Set("Content-Type", "image/png")
+		r, _ := qr.Encode(url, qr.L)
+		pngdat := r.PNG()
+		w.Write(pngdat)
+	}
+
+}
+
 //生成永久二维码
 func YjHandle(w http.ResponseWriter, r *http.Request) {
 	param := r.RequestURI[12:]

+ 11 - 3
weixin/src/qfw/weixin/subscribehandler.go

@@ -12,6 +12,7 @@ import (
 	"qfw/weixin/dao"
 	wxutil "qfw/weixin/util"
 	"qfw/weixinconfig"
+	"strconv"
 	"strings"
 	"time"
 )
@@ -67,6 +68,11 @@ func SubscribeHandler(w ResponseWriter, r *Request) {
 				go dao.SaveInviteLink(source, r.FromUserName, false)
 				//go dao.UpdateInviteUserCoupon(source)
 			}
+			if source == weixinconfig.SysConfig.EntServiceReplay["code"].(string) {
+				href := "http://" + weixinconfig.SysConfig.Domain + "/mobile/sess/" + EntSe.EncodeString(openid+",uid,"+strconv.Itoa(int(time.Now().Unix()))+","+weixinconfig.SysConfig.EntServiceReplay["href"].(string))
+				log.Println("href:", href)
+				w.PostText(fmt.Sprintf(weixinconfig.SysConfig.EntServiceReplay["title"].(string), href))
+			}
 		} else {
 			w.ReplyText(OWELCOME_MSG) // 有旧人关注,返回欢迎消息
 			if strings.HasPrefix(source, "32") {
@@ -220,15 +226,17 @@ func downloadUserFace(url string) string {
 	var filename string
 
 	tn := time.Now()
-	filename = fmt.Sprintf("/upload/%s/%s/%s/%s%d.jpg", tn.Format("2006"), tn.Format("01"), tn.Format("02"), tn.Format("20060102150405"), rand.Intn(9999)+1000)
+	dirname := fmt.Sprintf("/upload/%s/%s/%s/", tn.Format("2006"), tn.Format("01"), tn.Format("02"))
+	filename = dirname + fmt.Sprintf("%s%d.jpg", tn.Format("20060102150405"), rand.Intn(9999)+1000)
 	go func() {
 		util.Try(func() {
-			fi, _ := os.OpenFile(weixinconfig.SysConfig.Imgpath+filename, os.O_CREATE|os.O_TRUNC|os.O_SYNC|os.O_RDWR, 0x666)
+			os.MkdirAll(weixinconfig.SysConfig.Imgpath+dirname, 0777)
+			fi, err := os.OpenFile(weixinconfig.SysConfig.Imgpath+filename, os.O_CREATE|os.O_TRUNC|os.O_SYNC|os.O_RDWR, 0x666)
 			defer fi.Close()
 			resp, err := http.Get(url)
 			defer resp.Body.Close()
 			if err == nil {
-				io.Copy(fi, resp.Body)
+				log.Println(io.Copy(fi, resp.Body))
 			} else {
 				log.Println("download userface err:", err.Error())
 			}

+ 5 - 0
weixin/src/qfw/weixin/weixin.go

@@ -10,6 +10,9 @@ import (
 var Mux *Weixin
 var se util.SimpleEncrypt = util.SimpleEncrypt{Key: "topnet2015topnet2015"}
 
+//资金扶持推送加密
+var EntSe util.SimpleEncrypt = util.SimpleEncrypt{Key: "topnet"}
+
 //语音用到的正则
 //var clear_voice_reg, keyword_voice_reg, notify_xiaoxing, chat_bye *regexp.Regexp
 var WELCOME_MSG string
@@ -69,6 +72,8 @@ func InitWeixinSdk() {
 	//http.HandleFunc("/"+wf.SysConfig.Appcontext+"/paycallback", PayCallback)
 
 	//http.HandleFunc("/"+wf.SysConfig.Appcontext+"/sendmsg", SendMsgAct)
+	//生成永久二维码
+	http.HandleFunc("/"+wf.SysConfig.Appcontext+"/YJH/", YjHandle_Img)
 	//生成推广二维码
 	http.HandleFunc("/"+wf.SysConfig.Appcontext+"/adv/", AdvHandle)
 	//人工识别二维码监控

+ 1 - 1
weixin/src/qfw/weixin/weixinsdk.go

@@ -1210,7 +1210,7 @@ func (wx *Weixin) PostTextCustom(url string, obj interface{}) error {
 	if err != nil {
 		return err
 	}
-	//log.Println("custom msg:", string(data))
+	log.Println("custom msg:", string(data))
 	_, err = postRequest(url, wx.tokenChan, data)
 	return err
 }

+ 1 - 0
weixin/src/qfw/weixinconfig/weixinconfig.go

@@ -43,6 +43,7 @@ type wxconfig struct {
 	Kfport                string                            `json:"kfport"`
 	Gs_yw                 map[string]map[string]interface{} `json:"gs_yw"`
 	Gs_push               map[string]interface{}            `json:"gs_push"`
+	EntServiceReplay      map[string]interface{}            `json:"entServiceReplay"`
 }
 
 //系统配置