Authored by 沈志敏

fix bug

1 <div class="feature-page yoho-page"> 1 <div class="feature-page yoho-page">
  2 + {{#unless content.visiable}}
  3 + <div class="over">
  4 + <p>此活动已结束</p>
  5 + <p>稍后自动跳转更多其他精彩活动...</p>
  6 + </div>
  7 + {{else}}
2 {{#content.webShare}} 8 {{#content.webShare}}
3 <input id="shareLink" type="hidden" value="{{url}}"> 9 <input id="shareLink" type="hidden" value="{{url}}">
4 <input id="shareDesc" type="hidden" value="{{content}}"> 10 <input id="shareDesc" type="hidden" value="{{content}}">
@@ -166,4 +172,5 @@ @@ -166,4 +172,5 @@
166 </div> 172 </div>
167 {{/isEqualOr}} 173 {{/isEqualOr}}
168 {{/content.floors}} 174 {{/content.floors}}
  175 + {{/unless}}
169 </div> 176 </div>
1 var $ = require('yoho-jquery'); 1 var $ = require('yoho-jquery');
2 var lazyLoad = require('yoho-jquery-lazyload'); 2 var lazyLoad = require('yoho-jquery-lazyload');
3 var Swiper = require('yoho-swiper'); 3 var Swiper = require('yoho-swiper');
  4 +var yoho = require('../yoho-app');
4 5
5 global.jQuery = $; 6 global.jQuery = $;
6 7
@@ -152,7 +153,17 @@ function modalInit() { @@ -152,7 +153,17 @@ function modalInit() {
152 }); 153 });
153 } 154 }
154 155
  156 +
  157 +
155 $(function() { 158 $(function() {
  159 + if ($('.over').length) {
  160 + // 过期/删除 状态的 活动
  161 + setTimeout(function(){
  162 + yoho.goHome('//m.yohobuy.com/');
  163 + }, 3000);
  164 + return false;
  165 + }
  166 +
156 // tab 167 // tab
157 tabInit(); 168 tabInit();
158 169
@@ -102,12 +102,11 @@ yoho = { @@ -102,12 +102,11 @@ yoho = {
102 i; 102 i;
103 103
104 url = (url || '').split('?'); 104 url = (url || '').split('?');
105 - hashs = url[1].split('&'); 105 + hashs = (url[1] || '').split('&');
106 106
107 if (hashs && hashs.length) { 107 if (hashs && hashs.length) {
108 for (i = 0; i < hashs.length; i++) { 108 for (i = 0; i < hashs.length; i++) {
109 hash = hashs[i].split('='); 109 hash = hashs[i].split('=');
110 - console.log(hashs[i]);  
111 query[hash[0]] = hash[1]; 110 query[hash[0]] = hash[1];
112 } 111 }
113 } 112 }
@@ -174,6 +173,24 @@ yoho = { @@ -174,6 +173,24 @@ yoho = {
174 $appLink.attr('href', url); 173 $appLink.attr('href', url);
175 $appLink[0].click(); 174 $appLink[0].click();
176 return false; 175 return false;
  176 + },
  177 +
  178 + goHome: function(link, data) {
  179 + var url = link;
  180 +
  181 + if (!link) {
  182 + return;
  183 + }
  184 + link = yoho.parseUrl(link || location.href);
  185 +
  186 + if (yoho.isApp) {
  187 + url = url + '?openby:yohobuy=' + (data || JSON.stringify({
  188 + action: 'go.home'
  189 + }));
  190 + }
  191 + $appLink.attr('href', url);
  192 + $appLink[0].click();
  193 + return false;
177 } 194 }
178 }; 195 };
179 196
@@ -290,3 +290,18 @@ body { @@ -290,3 +290,18 @@ body {
290 margin-top: -75px; 290 margin-top: -75px;
291 z-index: 999; 291 z-index: 999;
292 } 292 }
  293 +
  294 +.feature-page .over {
  295 + position: fixed;
  296 + top: 50%;
  297 + left: 50%;
  298 + width: 100%;
  299 + transform: translate(-50%, -50%);
  300 + text-align: center;
  301 + font-size: 28px;
  302 + color: #000;
  303 +
  304 + p {
  305 + margin-bottom: 20px;
  306 + }
  307 +}