Authored by 张孝茹

js

@@ -128,7 +128,7 @@ @@ -128,7 +128,7 @@
128 <script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.3.2.js"></script> 128 <script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
129 {{/wechatShare}} 129 {{/wechatShare}}
130 {{#if devEnv}} 130 {{#if devEnv}}
131 - <script> 131 + <!-- <script>
132 var STATIC_RESOURCE_HASH = '{{startTime}}'; 132 var STATIC_RESOURCE_HASH = '{{startTime}}';
133 var STATIC_RESOURCE_PATH = '//{{devHost}}:{{port}}'; 133 var STATIC_RESOURCE_PATH = '//{{devHost}}:{{port}}';
134 window.jsFiles = [ 134 window.jsFiles = [
@@ -141,9 +141,11 @@ @@ -141,9 +141,11 @@
141 ,'{{src}}' 141 ,'{{src}}'
142 {{/loadJs}} 142 {{/loadJs}}
143 ]; 143 ];
144 - </script> 144 + </script> -->
  145 + <script src="//{{devHost}}:{{port}}/libs.js?t={{startTime}}"></script>
  146 + <script src="//{{devHost}}:{{port}}/{{module}}.{{page}}.js?t={{startTime}}"></script>
145 {{^}} 147 {{^}}
146 - <script> 148 + <!-- <script>
147 var STATIC_RESOURCE_HASH = '{{startTime}}'; 149 var STATIC_RESOURCE_HASH = '{{startTime}}';
148 var STATIC_RESOURCE_PATH = '//cdn.yoho.cn/yohobuywap-node/{{version}}'; 150 var STATIC_RESOURCE_PATH = '//cdn.yoho.cn/yohobuywap-node/{{version}}';
149 window.jsFiles = [ 151 window.jsFiles = [
@@ -156,9 +158,12 @@ @@ -156,9 +158,12 @@
156 ,'{{src}}' 158 ,'{{src}}'
157 {{/loadJs}} 159 {{/loadJs}}
158 ]; 160 ];
159 - </script> 161 + </script> -->
  162 +
  163 + <script src="//cdn.yoho.cn/yohobuywap-node/{{version}}/libs.js?t={{startTime}}"></script>
  164 + <script src="//cdn.yoho.cn/yohobuywap-node/{{version}}/{{module}}.{{page}}.js?t={{startTime}}"></script>
160 {{/if}} 165 {{/if}}
161 - <script> 166 + <!-- <script>
162 (function() { 167 (function() {
163 function addOnload(node, callback) { 168 function addOnload(node, callback) {
164 var supportOnload = 'onload' in node; 169 var supportOnload = 'onload' in node;
@@ -213,7 +218,7 @@ @@ -213,7 +218,7 @@
213 218
214 loadJS(); 219 loadJS();
215 }()); 220 }());
216 - </script> 221 + </script> -->
217 {{#unless devEnv}} 222 {{#unless devEnv}}
218 {{> analysis}} 223 {{> analysis}}
219 {{/unless}} 224 {{/unless}}
@@ -38,11 +38,21 @@ let shareData = { @@ -38,11 +38,21 @@ let shareData = {
38 imgUrl: productPic 38 imgUrl: productPic
39 }; 39 };
40 40
41 -if (yoho.isMarsApp || yoho.isNowApp) {  
42 - yoho.ready(function() { 41 +let nowShareData = {
  42 + title: `推荐这本城市指南给你:${productName}`,
  43 + link: location.href.split('?')[0],
  44 + desc: '最近很多 KOL 在推!据说是探索城市必备神器',
  45 + desCircle: `最近被刷屏的这本城市指南终于可以买到了!${productName}`,
  46 + imgUrl: productPic
  47 +};
  48 +
  49 +yoho.ready(function() {
  50 + if (yoho.isMarsApp) {
43 yoho.invokeMethod('set.shareInfo', shareData); 51 yoho.invokeMethod('set.shareInfo', shareData);
44 - });  
45 -} 52 + } else if (yoho.isNowApp) {
  53 + yoho.invokeMethod('set.shareInfo', nowShareData);
  54 + }
  55 +});
46 56
47 window.rePosFooter && window.rePosFooter(); 57 window.rePosFooter && window.rePosFooter();
48 58
@@ -122,9 +132,6 @@ setTimeout(() => { @@ -122,9 +132,6 @@ setTimeout(() => {
122 } 132 }
123 133
124 if (productId && (goodsId || productSkn)) { 134 if (productId && (goodsId || productSkn)) {
125 - let $promotionYohoCoin = $('#placeholder-promotion-yohocoin');  
126 - let promotionYohoCoinT = require('product/detail/promotion-yoho-coin.hbs');  
127 -  
128 setTimeout(() => { 135 setTimeout(() => {
129 $.ajax({ 136 $.ajax({
130 type: 'GET', 137 type: 'GET',
@@ -143,23 +150,6 @@ setTimeout(() => { @@ -143,23 +150,6 @@ setTimeout(() => {
143 let regPro = /\/product\/pro_([\d]+)_([\d]+)/; 150 let regPro = /\/product\/pro_([\d]+)_([\d]+)/;
144 let regSeckill = /\/product\/seckill/; 151 let regSeckill = /\/product\/seckill/;
145 152
146 - $promotionYohoCoin.replaceWith(promotionYohoCoinT({  
147 - promYohoCoinText: data.promYohoCoinText  
148 - }));  
149 -  
150 - let $coinItem = $('#goodsDiscountYohoCoin');  
151 - let $coinIntroBox = $('.coin-intro-box');  
152 -  
153 - // 返有货币促销模块点击事件  
154 - $coinItem.on('click', function() {  
155 - $coinIntroBox.removeClass('hide');  
156 - });  
157 -  
158 - // 关闭有货币促销展示面板  
159 - $coinIntroBox.on('click', function() {  
160 - $coinIntroBox.addClass('hide');  
161 - });  
162 -  
163 // let regProSeckill = /\/product\/seckill\/pro_([\d]+)_([\d]+)/; 153 // let regProSeckill = /\/product\/seckill\/pro_([\d]+)_([\d]+)/;
164 let thisHref = window.location.href; 154 let thisHref = window.location.href;
165 let thisRefer = document.referrer; 155 let thisRefer = document.referrer;
@@ -315,7 +305,7 @@ setTimeout(() => { @@ -315,7 +305,7 @@ setTimeout(() => {
315 /* 305 /*
316 * 获取商品 相关数据: 1. 促销 2. feedback 3. 店铺, 并初始化 306 * 获取商品 相关数据: 1. 促销 2. feedback 3. 店铺, 并初始化
317 */ 307 */
318 -(function(skn, productId, brandId) { // eslint-disable-line 308 ++ (function(skn, productId, brandId) { // eslint-disable-line
319 // 模版: 促销, feedback, 店铺 309 // 模版: 促销, feedback, 店铺
320 let promotionT = require('product/detail/promotion.hbs'); 310 let promotionT = require('product/detail/promotion.hbs');
321 let feedbackT = require('product/detail/feedbacks.hbs'); 311 let feedbackT = require('product/detail/feedbacks.hbs');
@@ -376,7 +366,7 @@ setTimeout(() => { @@ -376,7 +366,7 @@ setTimeout(() => {
376 366
377 // goods-discount下拉按钮点击事件 367 // goods-discount下拉按钮点击事件
378 if ($goodsDiscount.length && $discountFolder.children().length > 0) { 368 if ($goodsDiscount.length && $discountFolder.children().length > 0) {
379 - $discountFirstItem.on('click', function() { 369 + $goodsDiscount.on('click', function() {
380 if ($discountFolder.is(':hidden')) { 370 if ($discountFolder.is(':hidden')) {
381 $discountFirstItem.removeClass('short-text'); 371 $discountFirstItem.removeClass('short-text');
382 $discountArrow.removeClass('icon-down').addClass('icon-up').html('&#xe608;'); 372 $discountArrow.removeClass('icon-down').addClass('icon-up').html('&#xe608;');