作者 景龙
1 个管道 的构建 通过 耗费 5 秒

调试视频定位

@@ -104,7 +104,7 @@ @@ -104,7 +104,7 @@
104 <div class="idnex_seventh_swiper_contant_img"> 104 <div class="idnex_seventh_swiper_contant_img">
105 <img class="li_img" src="{:cmf_get_image_url($vo.thumbnail)}" alt="" /> 105 <img class="li_img" src="{:cmf_get_image_url($vo.thumbnail)}" alt="" />
106 </div> 106 </div>
107 - <div class="idnex_seventh_swiper_contant_title txt-cut video_title" style="-webkit-line-clamp: 2;"> 107 + <div class="idnex_seventh_swiper_contant_title txt-cut" style="-webkit-line-clamp: 2;">
108 {$vo.post_title} 108 {$vo.post_title}
109 </div> 109 </div>
110 </div> 110 </div>
@@ -157,14 +157,76 @@ @@ -157,14 +157,76 @@
157 <input type="hidden" class="like" value=""> 157 <input type="hidden" class="like" value="">
158 </div> 158 </div>
159 </div> 159 </div>
160 - <!--微信分享-->  
161 - <include file="public@share" />  
162 <include file="public@footer" /> 160 <include file="public@footer" />
163 </body> 161 </body>
164 <script src="__TMPL__/public/assets/js/base.js"></script> 162 <script src="__TMPL__/public/assets/js/base.js"></script>
165 <script src="__TMPL__/public/assets/js/jquery-2.1.0.js"></script> 163 <script src="__TMPL__/public/assets/js/jquery-2.1.0.js"></script>
166 <script src="__TMPL__/public/assets/js/swiper.min.js"></script> 164 <script src="__TMPL__/public/assets/js/swiper.min.js"></script>
167 <script src="__TMPL__/public/assets/js/public.js"></script> 165 <script src="__TMPL__/public/assets/js/public.js"></script>
  166 +
  167 +<script src="http://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
  168 +<script>
  169 + $(function () {
  170 + // 分享标题
  171 + var title_title = $(document).attr('title');
  172 + // 分享简介
  173 + wx.config({
  174 + debug: false,
  175 + appId: '{$data.appId}',
  176 + timestamp: '{$data.timestamp}',
  177 + nonceStr: '{$data.nonceStr}',
  178 + signature: '{$data.signature}',
  179 + jsApiList: [
  180 + 'onMenuShareAppMessage',
  181 + 'onMenuShareTimeline',
  182 + ]
  183 + });
  184 + wx.ready(function () { //需在用户可能点击分享按钮前就先调用
  185 + wx.onMenuShareAppMessage({
  186 + title: '独角星球-'+title_title, // 分享标题朋友
  187 + desc: $('.post_title').text(), // 分享描述
  188 + link: $('.video_index_url').val(), // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
  189 + imgUrl: 'http://www.starplanet.cn/themes/simpleboot3_mobile/public/assets/images/cicon_01@2x.png', // 分享图标
  190 + type: '', // 分享类型,music、video或link,不填默认为link
  191 + dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
  192 + success: function () {
  193 + wx_Share();
  194 + },
  195 + });
  196 + wx.onMenuShareTimeline({
  197 + title: '独角星球-'+title_title, // 分享标题朋友圈
  198 + desc: $('.post_title').text(),
  199 + link: $('.video_index_url').val(), // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
  200 + imgUrl: 'http://www.starplanet.cn/themes/simpleboot3_mobile/public/assets/images/cicon_01@2x.png', // 分享图标
  201 + success: function () {
  202 + // 用户点击了分享后执行的回调函数
  203 + wx_Share();
  204 + },
  205 + });
  206 + });
  207 + wx.error(function (res) {
  208 + // config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
  209 + });
  210 + });
  211 +
  212 + function wx_Share(){
  213 + var article_id = getUrlParam('id');
  214 + $.ajax({
  215 + type: 'POST',
  216 + url: '/portal/login/wx_share',
  217 + data: {
  218 + 'id': article_id,
  219 + },
  220 + dataType: 'json',
  221 + async: false,
  222 + success: function(data) {
  223 +
  224 + }
  225 + });
  226 + window.location.reload();
  227 + }
  228 +
  229 +</script>
168 <script> 230 <script>
169 $('.navImg1 img').click(function() { 231 $('.navImg1 img').click(function() {
170 if ($(this).attr('src') == "__TMPL__/public/assets/images/xx.png") { 232 if ($(this).attr('src') == "__TMPL__/public/assets/images/xx.png") {
@@ -239,13 +301,17 @@ @@ -239,13 +301,17 @@
239 } 301 }
240 }); 302 });
241 var video_index = getUrlParam('video_index'); 303 var video_index = getUrlParam('video_index');
242 - console.log(1111);  
243 - console.log(video_index);  
244 //默认第一个视频 304 //默认第一个视频
  305 + if(video_index == ''){
  306 + switch_video(0);
  307 + //更换视频路径index
  308 + video_index_url(0);
  309 + }else{
  310 + switch_video(video_index);
  311 + //更换视频路径index
  312 + video_index_url(video_index);
  313 + }
245 314
246 - switch_video(video_index);  
247 - //更换视频路径index  
248 - video_index_url(video_index);  
249 //点击切换 315 //点击切换
250 $('.curren li').click(function() { 316 $('.curren li').click(function() {
251 var index = $(this).index(); 317 var index = $(this).index();
@@ -2,25 +2,8 @@ @@ -2,25 +2,8 @@
2 <script src="http://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script> 2 <script src="http://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
3 <script> 3 <script>
4 $(function () { 4 $(function () {
5 - var pathname = window.location.pathname;  
6 - var city_id = getUrlParam('city_id');  
7 - // 分享链接  
8 - var url;  
9 - var title_title;  
10 - if(pathname == '/portal/region/getMoreVideo'){  
11 - title_title = $('.video_title').text();  
12 - if(city_id == ''){  
13 - url = $('.video_index_url').val();  
14 - }else{  
15 - url = $('.video_index_url').val();  
16 - }  
17 - }else{  
18 - // 分享标题  
19 - title_title = $(document).attr('title');  
20 - url = window.location.href;  
21 - }  
22 - console.log(444);  
23 - console.log(url); 5 + var url = window.location.href;
  6 + var title_title = $(document).attr('title');
24 // 分享简介 7 // 分享简介
25 var description = $('.share_content').text().replace(/\s*/g,'').substring(0,50); 8 var description = $('.share_content').text().replace(/\s*/g,'').substring(0,50);
26 wx.config({ 9 wx.config({