Authored by 张孝茹

js

... ... @@ -128,7 +128,7 @@
<script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
{{/wechatShare}}
{{#if devEnv}}
<script>
<!-- <script>
var STATIC_RESOURCE_HASH = '{{startTime}}';
var STATIC_RESOURCE_PATH = '//{{devHost}}:{{port}}';
window.jsFiles = [
... ... @@ -141,9 +141,11 @@
,'{{src}}'
{{/loadJs}}
];
</script>
</script> -->
<script src="//{{devHost}}:{{port}}/libs.js?t={{startTime}}"></script>
<script src="//{{devHost}}:{{port}}/{{module}}.{{page}}.js?t={{startTime}}"></script>
{{^}}
<script>
<!-- <script>
var STATIC_RESOURCE_HASH = '{{startTime}}';
var STATIC_RESOURCE_PATH = '//cdn.yoho.cn/yohobuywap-node/{{version}}';
window.jsFiles = [
... ... @@ -156,9 +158,12 @@
,'{{src}}'
{{/loadJs}}
];
</script>
</script> -->
<script src="//cdn.yoho.cn/yohobuywap-node/{{version}}/libs.js?t={{startTime}}"></script>
<script src="//cdn.yoho.cn/yohobuywap-node/{{version}}/{{module}}.{{page}}.js?t={{startTime}}"></script>
{{/if}}
<script>
<!-- <script>
(function() {
function addOnload(node, callback) {
var supportOnload = 'onload' in node;
... ... @@ -213,7 +218,7 @@
loadJS();
}());
</script>
</script> -->
{{#unless devEnv}}
{{> analysis}}
{{/unless}}
... ...
... ... @@ -38,11 +38,21 @@ let shareData = {
imgUrl: productPic
};
if (yoho.isMarsApp || yoho.isNowApp) {
yoho.ready(function() {
let nowShareData = {
title: `推荐这本城市指南给你:${productName}`,
link: location.href.split('?')[0],
desc: '最近很多 KOL 在推!据说是探索城市必备神器',
desCircle: `最近被刷屏的这本城市指南终于可以买到了!${productName}`,
imgUrl: productPic
};
yoho.ready(function() {
if (yoho.isMarsApp) {
yoho.invokeMethod('set.shareInfo', shareData);
});
}
} else if (yoho.isNowApp) {
yoho.invokeMethod('set.shareInfo', nowShareData);
}
});
window.rePosFooter && window.rePosFooter();
... ... @@ -122,9 +132,6 @@ setTimeout(() => {
}
if (productId && (goodsId || productSkn)) {
let $promotionYohoCoin = $('#placeholder-promotion-yohocoin');
let promotionYohoCoinT = require('product/detail/promotion-yoho-coin.hbs');
setTimeout(() => {
$.ajax({
type: 'GET',
... ... @@ -143,23 +150,6 @@ setTimeout(() => {
let regPro = /\/product\/pro_([\d]+)_([\d]+)/;
let regSeckill = /\/product\/seckill/;
$promotionYohoCoin.replaceWith(promotionYohoCoinT({
promYohoCoinText: data.promYohoCoinText
}));
let $coinItem = $('#goodsDiscountYohoCoin');
let $coinIntroBox = $('.coin-intro-box');
// 返有货币促销模块点击事件
$coinItem.on('click', function() {
$coinIntroBox.removeClass('hide');
});
// 关闭有货币促销展示面板
$coinIntroBox.on('click', function() {
$coinIntroBox.addClass('hide');
});
// let regProSeckill = /\/product\/seckill\/pro_([\d]+)_([\d]+)/;
let thisHref = window.location.href;
let thisRefer = document.referrer;
... ... @@ -315,7 +305,7 @@ setTimeout(() => {
/*
* 获取商品 相关数据: 1. 促销 2. feedback 3. 店铺, 并初始化
*/
(function(skn, productId, brandId) { // eslint-disable-line
+ (function(skn, productId, brandId) { // eslint-disable-line
// 模版: 促销, feedback, 店铺
let promotionT = require('product/detail/promotion.hbs');
let feedbackT = require('product/detail/feedbacks.hbs');
... ... @@ -376,7 +366,7 @@ setTimeout(() => {
// goods-discount下拉按钮点击事件
if ($goodsDiscount.length && $discountFolder.children().length > 0) {
$discountFirstItem.on('click', function() {
$goodsDiscount.on('click', function() {
if ($discountFolder.is(':hidden')) {
$discountFirstItem.removeClass('short-text');
$discountArrow.removeClass('icon-down').addClass('icon-up').html('&#xe608;');
... ...