diff --git a/app/portal/controller/FriendsController.php b/app/portal/controller/FriendsController.php index c323d04..03c6e4b 100644 --- a/app/portal/controller/FriendsController.php +++ b/app/portal/controller/FriendsController.php @@ -41,6 +41,17 @@ class FriendsController extends WeChatBaseController * @throws \think\exception\DbException */ public function friendList(){ + + $config=config('wechat_config'); + $Wechat=new Application($config); + $js = $Wechat->js; + $api[]='chooseImage'; + $api[]='previewImage'; + $api[]='uploadImage'; + $api[]='downloadImage'; + $sdk=$js->config($api, true); + + $group_id=input('id'); /*检查权限*/ $user_id=cmf_get_current_user_id(); @@ -58,6 +69,7 @@ class FriendsController extends WeChatBaseController foreach ($article as $k=>$v){ $article[$k]['pic']=cmf_get_image_url(json_decode($v['amore'],true)['thumbnail']); } + $this->assign('sdk',$sdk); $this->assign('silence',$silence); $this->assign('info',$info); $this->assign('userinfo',$user['0']); diff --git a/public/themes/simpleboot3/portal/friends/friendlist.html b/public/themes/simpleboot3/portal/friends/friendlist.html index 558c546..a99be51 100644 --- a/public/themes/simpleboot3/portal/friends/friendlist.html +++ b/public/themes/simpleboot3/portal/friends/friendlist.html @@ -10,6 +10,7 @@ <link rel="stylesheet" href="__TMPL__/public/assets/css/diseaseColumn.css"> <link rel="stylesheet" href="__TMPL__/public/assets/css/ChatCircle.css"> <link rel="stylesheet" href="__TMPL__/public/assets/css/chat.css"> + <script src="http://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script> </head> <body> <div> @@ -250,5 +251,15 @@ }) </script> +<script type="application/javascript"> + wx.config({$sdk}); + $('.list_img_box').onclick(function (res) { + alert('1111'); + }) + wx.previewImage({ + current: '', // 当前显示图片的http链接 + urls: [] // 需要预览的图片http链接列表 + }); + </script> </body> </html> \ No newline at end of file