Jelajahi Sumber

微信检索

张金坤 9 tahun lalu
induk
melakukan
5d676e7b3d

+ 1 - 2
core/src/qfw/search/wxsearchservice.go

@@ -24,8 +24,7 @@ import (
 //微信企业查询首页
 func (s *Wxsearch) WxEnterprise() error {
 	s.T["signature"] = mobile.GetSignature(s.Url())
-	log.Println("signature", s.T["signature"])
-	return s.Render("/search/wxent.html", &s.T)
+	return s.Render("/member/incombile/index.html", &s.T)
 }
 
 //获取名片名称

+ 1 - 1
core/src/seo.json

@@ -1,4 +1,4 @@
-{	"cdn":"//test.qmx.top:9010",
+{	"cdn":"//cdn.qmx.top:9000",
     "qfw": {
         "enterprise": {
             "description": "提供企业信息查询,企业产品服务查询,企业关系网展示",

+ 85 - 0
core/src/web/templates/member/incmobile/index.html

@@ -2,11 +2,13 @@
 <html>
 	<head>
 		<title> 企业社区-列表</title>
+		{{include "/common/inc.html"}}
 		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
 		<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
 		<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0" user-scalable="yes" />
 		<link href="/css/bootstrap.min.css" rel="stylesheet">
 		<link href="/css/mobile/incmobile.css" rel="stylesheet">
+		<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
 		<style>
 			.index-bodybg{
 				color:#FFF;
@@ -71,6 +73,51 @@
 				font-size:10px;
 			}
 		</style>
+<script>
+var signature = {{.T.signature}};
+var shareTitle = "企业社区";
+var shareLink = "http://www.qimingxing.info/wx/search/enterprise/index.html";
+var shareIcon = "";
+if(typeof(signature) != "undefined" && signature != null && signature.length == 4){
+	wx.config({
+	    debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+	    appId: signature[0], // 必填,公众号的唯一标识
+	    timestamp:signature[1], // 必填,生成签名的时间戳
+	    nonceStr: signature[2], // 必填,生成签名的随机串
+	    signature: signature[3],// 必填,签名,见附录1
+	    jsApiList: ['onMenuShareTimeline','onMenuShareAppMessage',
+					'chooseImage','uploadImage','downloadImage']
+	});
+	wx.ready(function () {
+        wx.onMenuShareTimeline({
+		    title: shareTitle, // 分享标题
+		    link: shareLink, // 分享链接
+		    imgUrl: shareIcon, // 分享图标
+		    success: function () { 
+		       //alert('分享成功');
+		    },
+		    cancel: function () { 
+		       //alert('分享失败,或用户取消了');
+		    }
+		});
+
+		wx.onMenuShareAppMessage({
+		    title: shareTitle, // 分享标题
+		    desc: '企明星企业', // 分享描述
+		    link:  shareLink,// 分享链接
+		    imgUrl: shareIcon, // 分享图标
+		    type: 'link', // 分享类型,music、video或link,不填默认为link'
+		    dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
+		    success: function () { 
+		        //alert('分享成功');
+		    },
+		    cancel: function () { 
+				//alert('分享失败,或用户取消了');
+		    }
+		});
+    });
+}	
+</script>
 	</head>
 <body class="index-bodybg">
 		<div class="main">
@@ -99,5 +146,43 @@
 						</div>
 	      </div>
 		</footer>
+
+<script>
+$(".input-group-addon").click(function(){
+alert();
+	wx.chooseImage({
+	    count: 1, // 默认9
+	    sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
+	    sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
+	    success: function (res) {
+	        var localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
+			uploadImage(localIds[0]);
+	 	}
+	});
+})
+
+function uploadImage(localId){
+	wx.uploadImage({
+	    localId: localId, // 需要上传的图片的本地ID,由chooseImage接口获得
+	    isShowProgressTips: 1, // 默认为1,显示进度提示
+	    success: function (res) {
+	        getmpname(res.serverId); // 返回图片的服务器端ID
+	 	}
+	});
+} 
+//获取企业名称
+function getmpname(serverId){
+	$.ajax({ 
+        type: 'post', 
+        url: '/wx/search/enterprise/mingpian', 
+		data:{serverId:serverId},
+        cache: false, 
+        error: function(){return false;}, 
+        success:function(obj){
+			alert(obj["name"]);
+        } 
+    }); 
+}
+</script>
 </body>
 </html>