From 54e9367f71e2ecbe253cbbd805410f29131e730f Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 29 Jul 2016 10:52:35 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=88=86=E4=BA=AB=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wechat/controllers/invite_code.js | 85 +++++++++++++++---- 1 file changed, 70 insertions(+), 15 deletions(-) diff --git a/public/javascripts/wechat/controllers/invite_code.js b/public/javascripts/wechat/controllers/invite_code.js index 0c8bbe09e..14bdbba35 100644 --- a/public/javascripts/wechat/controllers/invite_code.js +++ b/public/javascripts/wechat/controllers/invite_code.js @@ -12,23 +12,78 @@ app.controller('InviteCodeController', ['$scope','$http', '$routeParams','config function(response){ console.log(response.data); vm.course = response.data.data; + wxinit(); } ); - vm.share = function(){ - window.WeixinJSBridge.invoke('sendAppMessage',{ - 'appid': 'wxf694495398c7d470', // 公众号appID - 'type': 'link', // 非必填,music,vido或link,默认为link。 - 'data_url': '', // 非必填,连接地址,如音乐的mp3数据地址,供内置播放器使用 - 'img_url': 'http://pnewsapp.tc.qq.com/newsapp_bt/0/9963967/640', // 缩略图地址 - 'img_height':370, // 缩略图高度 - 'img_width':550, // 缩略图宽度 - 'link':'http://view.inews.qq.com/a/WXN2013101101385701', // 链接地址 - 'desc':'desc', // 描述 - 'title':'title' // 标题 - },function(res){ - //alert(res.err_msg); - }); - } +// vm.share = function(){ +// window.WeixinJSBridge.invoke('sendAppMessage',{ +// 'appid': 'wxf694495398c7d470', // 公众号appID +// 'type': 'link', // 非必填,music,vido或link,默认为link。 +// 'data_url': '', // 非必填,连接地址,如音乐的mp3数据地址,供内置播放器使用 +// 'img_url': 'http://pnewsapp.tc.qq.com/newsapp_bt/0/9963967/640', // 缩略图地址 +// 'img_height':370, // 缩略图高度 +// 'img_width':550, // 缩略图宽度 +// 'link':'http://view.inews.qq.com/a/WXN2013101101385701', // 链接地址 +// 'desc':'desc', // 描述 +// 'title':'title' // 标题 +// },function(res){ +// //alert(res.err_msg); +// }); +// } + + wxinit = function(){ + var descContent = '班级邀请:'+vm.course.name+'班级'; //分享给朋友或朋友圈时的文字简介 + var shareTitle = 'Trustie创新实践平台'; //分享title + var appid = 'wxc09454f171153c2d'; //apiID,可留空 + var linelink = 'https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket='+vm.course.qrcode; + + function shareFriend() { + WeixinJSBridge.invoke('sendAppMessage',{ + "appid": appid, + "img_width": "200", + "img_height": "200", + "link": linelink, + "desc": descContent, + "title": shareTitle + }, function(res) { + //_report('send_msg', res.err_msg); + }) + } + function shareTimeline() { + WeixinJSBridge.invoke('shareTimeline',{ + "img_width": "200", + "img_height": "200", + "link": linelink, + "desc": descContent, + "title": shareTitle + }, function(res) { + //_report('timeline', res.err_msg); + }); + } + function shareWeibo() { + WeixinJSBridge.invoke('shareWeibo',{ + "content": descContent, + "url": linelink + }, function(res) { + //_report('weibo', res.err_msg); + }); + } + // 当微信内置浏览器完成内部初始化后会触发WeixinJSBridgeReady事件。 + document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() { + // 发送给好友 + WeixinJSBridge.on('menu:share:appmessage', function(argv){ + shareFriend(); + }); + // 分享到朋友圈 + WeixinJSBridge.on('menu:share:timeline', function(argv){ + shareTimeline(); + }); + // 分享到微博 + WeixinJSBridge.on('menu:share:weibo', function(argv){ + shareWeibo(); + }); + }, false); + }; }]); From 071ad889568a50b60616ba34b1f67b1983975780 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 29 Jul 2016 15:40:47 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A1=B9=E7=9B=AE=E8=AF=B4=E6=98=8E=EF=BC=9B?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E5=A4=9A=E5=87=BA=E6=96=87=E5=AD=97=E4=BB=A5?= =?UTF-8?q?=E7=9C=81=E7=95=A5=E5=8F=B7=E6=98=BE=E7=A4=BA=EF=BC=9B=20?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E5=86=85=E5=AE=B9=E5=8D=95=E8=AF=8D=E4=B8=8D?= =?UTF-8?q?=E8=A2=AB=E5=BC=BA=E5=88=B6=E6=8B=86=E5=88=86=E6=8A=98=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/activities.html | 24 +++++++++---------- public/assets/wechat/app.html | 1 + public/assets/wechat/new_project.html | 17 +++++++++++++ .../javascripts/wechat/directives/ellipsis.js | 17 +++++++++---- public/stylesheets/weui/weixin.css | 9 +++++-- 5 files changed, 49 insertions(+), 19 deletions(-) diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html index c2df0c8e7..fbdfb1152 100644 --- a/public/assets/wechat/activities.html +++ b/public/assets/wechat/activities.html @@ -35,7 +35,7 @@
-
+
迟交扣分:{{act.homework_common_detail.late_penalty}}分 匿评开启时间:{{act.homework_common_detail.evaluation_start}}
缺评扣分:{{act.homework_common_detail.absence_penalty}}分/作品 匿评关闭时间:{{act.homework_common_detail.evaluation_end}}
@@ -73,7 +73,7 @@
-
+
@@ -109,7 +109,7 @@
-
+
@@ -162,7 +162,7 @@
-
+
状态:{{act.issue_detail.issue_status}} 优先级:{{act.issue_detail.issue_priority}}
指派给:{{act.issue_detail.issue_assigned_to}} 完成度:{{act.issue_detail.done_ratio}}%
@@ -201,7 +201,7 @@
-
+
@@ -251,7 +251,7 @@
{{act.latest_update}}
-
+
@@ -289,7 +289,7 @@
-
+
@@ -335,7 +335,7 @@
-
+
迟交扣分:{{act.homework_common_detail.late_penalty}}分 匿评开启时间:{{act.homework_common_detail.evaluation_start}}
缺评扣分:{{act.homework_common_detail.absence_penalty}}分/作品 匿评关闭时间:{{act.homework_common_detail.evaluation_end}}
@@ -373,7 +373,7 @@
-
+
@@ -409,7 +409,7 @@
-
+
@@ -469,7 +469,7 @@
-
+
状态:{{act.issue_detail.issue_status}} 优先级:{{act.issue_detail.issue_priority}}
指派给:{{act.issue_detail.issue_assigned_to}} 完成度:{{act.issue_detail.done_ratio}}%
@@ -508,7 +508,7 @@
-
+
diff --git a/public/assets/wechat/app.html b/public/assets/wechat/app.html index 726755c3d..606164efe 100644 --- a/public/assets/wechat/app.html +++ b/public/assets/wechat/app.html @@ -36,6 +36,7 @@ + diff --git a/public/assets/wechat/new_project.html b/public/assets/wechat/new_project.html index c52d0ccdc..a59904e14 100644 --- a/public/assets/wechat/new_project.html +++ b/public/assets/wechat/new_project.html @@ -5,6 +5,23 @@
项目名称
完成 +
+ 项目功能特性(微信版) +
    +
  • 创建项目、加入项目
  • +
  • 邀请成员、修改角色
  • +
  • 浏览、回复项目动态
  • +
  • 点赞、分享项目动态
  • +
+
+
+ 更多项目特性(浏览器版) +
    +
  • 发布任务、问题跟踪
  • +
  • 代码托管、质量分析
  • +
  • 资源分享、交流研讨
  • +
+
diff --git a/public/javascripts/wechat/directives/ellipsis.js b/public/javascripts/wechat/directives/ellipsis.js index 4107ef68b..a5d5d9845 100644 --- a/public/javascripts/wechat/directives/ellipsis.js +++ b/public/javascripts/wechat/directives/ellipsis.js @@ -7,11 +7,18 @@ app.directive('ellipsisShow',["$timeout",function(timer){ scope: {}, link: function(scope, element){ timer(function() { - var textContent = element.text(); - console.log(textContent); - //while (textHeight > 100) { - // element.text(element.text().replace(/(\s)*([a-zA-Z0-9]+|\W)(\.\.\.)?$/, "...")); - //} + var textSplit = element.text().split(" "); + var newContent = []; + element.text(""); + for (var i = 0; i < textSplit.length; i++) { + newContent = newContent + " " + textSplit[i]; + element.text(newContent); + if(element[0].scrollHeight >= 100){ + newContent = newContent + " " + textSplit[i+1] + " " + textSplit[i+2] + " " + textSplit[i+3] + " " + textSplit[i+4] + "..."; + element.text(newContent); + break; + } + } }); } } diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index 447d8b956..58b4a244e 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -111,7 +111,7 @@ a.underline {text-decoration:underline;} .fl {float:left;} .fr {float:right;} .cl {clear:both; overflow:hidden;} -.post-content {width:100%; font-size:14px; line-height:20px; height:100px; overflow:hidden; word-break:break-all; word-wrap:break-word;} +.post-content {width:100%; font-size:14px; line-height:20px; height:100px; overflow:hidden; word-break:normal; word-wrap:break-word; text-align:justify;} .post-all-content a {color:#136ec2;} .post-interactive {width:100%; height:35px; line-height:35px; vertical-align:middle; border-top:1px solid #e6e6e6; background-color:#f8f9fb;} .post-interactive-column, @@ -237,4 +237,9 @@ a.underline {text-decoration:underline;} .mult-reply-container{ border:solid 1px #f3ddb3; background:#fffef4; padding:4px;color:#999;} .mult-reply-content{ color:#555; font-size:13px;} .mult-reply-hide{ text-align:center; display:block; font-size:14px; color:#aaa; border-bottom:1px solid #F3DDB3; padding:8px 0;} -.mult-reply-arrow{ color:#aaa; margin-right:10px; font-size:14px; font-weight:bold;} \ No newline at end of file +.mult-reply-arrow{ color:#aaa; margin-right:10px; font-size:14px; font-weight:bold;} + + +/*20160729项目说明*/ +.project-intro {line-height:2;} +.project-intro li {list-style:disc; margin-left:20px;} \ No newline at end of file From ce8f915d7e5f76a57555150cce6c2eb702499c97 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 29 Jul 2016 15:47:34 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=88=86=E4=BA=AB=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=88=90=E5=8E=9F=E6=9D=A5=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wechat/controllers/invite_code.js | 71 ------------------- 1 file changed, 71 deletions(-) diff --git a/public/javascripts/wechat/controllers/invite_code.js b/public/javascripts/wechat/controllers/invite_code.js index 14bdbba35..3908d1b40 100644 --- a/public/javascripts/wechat/controllers/invite_code.js +++ b/public/javascripts/wechat/controllers/invite_code.js @@ -12,78 +12,7 @@ app.controller('InviteCodeController', ['$scope','$http', '$routeParams','config function(response){ console.log(response.data); vm.course = response.data.data; - wxinit(); } ); -// vm.share = function(){ -// window.WeixinJSBridge.invoke('sendAppMessage',{ -// 'appid': 'wxf694495398c7d470', // 公众号appID -// 'type': 'link', // 非必填,music,vido或link,默认为link。 -// 'data_url': '', // 非必填,连接地址,如音乐的mp3数据地址,供内置播放器使用 -// 'img_url': 'http://pnewsapp.tc.qq.com/newsapp_bt/0/9963967/640', // 缩略图地址 -// 'img_height':370, // 缩略图高度 -// 'img_width':550, // 缩略图宽度 -// 'link':'http://view.inews.qq.com/a/WXN2013101101385701', // 链接地址 -// 'desc':'desc', // 描述 -// 'title':'title' // 标题 -// },function(res){ -// //alert(res.err_msg); -// }); -// } - - wxinit = function(){ - var descContent = '班级邀请:'+vm.course.name+'班级'; //分享给朋友或朋友圈时的文字简介 - var shareTitle = 'Trustie创新实践平台'; //分享title - var appid = 'wxc09454f171153c2d'; //apiID,可留空 - var linelink = 'https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket='+vm.course.qrcode; - - function shareFriend() { - WeixinJSBridge.invoke('sendAppMessage',{ - "appid": appid, - "img_width": "200", - "img_height": "200", - "link": linelink, - "desc": descContent, - "title": shareTitle - }, function(res) { - //_report('send_msg', res.err_msg); - }) - } - function shareTimeline() { - WeixinJSBridge.invoke('shareTimeline',{ - "img_width": "200", - "img_height": "200", - "link": linelink, - "desc": descContent, - "title": shareTitle - }, function(res) { - //_report('timeline', res.err_msg); - }); - } - function shareWeibo() { - WeixinJSBridge.invoke('shareWeibo',{ - "content": descContent, - "url": linelink - }, function(res) { - //_report('weibo', res.err_msg); - }); - } - // 当微信内置浏览器完成内部初始化后会触发WeixinJSBridgeReady事件。 - document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() { - // 发送给好友 - WeixinJSBridge.on('menu:share:appmessage', function(argv){ - shareFriend(); - }); - // 分享到朋友圈 - WeixinJSBridge.on('menu:share:timeline', function(argv){ - shareTimeline(); - }); - // 分享到微博 - WeixinJSBridge.on('menu:share:weibo', function(argv){ - shareWeibo(); - }); - }, false); - }; - }]);