Authored by 杨延青

Merge branch 'feature/yohood2018' into 'release/0718'

Feature/yohood2018



See merge request !1475
... ... @@ -21,12 +21,14 @@
<div id="order-detail" data-id="{{orderCode}}">
{{#unless deliveryOffline}}
{{#if isVirtual}}
<section class="block">
<div class="tickets-mobile">
<span class="pull-left">手机号码:</span>
<span class="pull-right">{{mobile}}</span>
</div>
</section>
{{#if mobile}}
<section class="block">
<div class="tickets-mobile">
<span class="pull-left">手机号码:</span>
<span class="pull-right">{{mobile}}</span>
</div>
</section>
{{/if}}
{{else}}
<section class="owner-info block">
<span class="iconfont">&#xe637;</span>
... ... @@ -120,7 +122,15 @@
<div class="info-table">
{{#orderBasicInfo}}
<div class="table-item">{{key}}{{value}}</div>
<div class="table-item">
{{key}}{{value}}
{{# ext}}
{{#if needShowInvoice}}
<a href="{{needShowInvoice}}" class="ext-options invoice-see">查看发票</a>
{{/if}}
{{/ ext}}
</div>
{{/orderBasicInfo}}
<a href="{{serviceUrl}}" target="_blank" class="iconfont">&#xe63c;</a>
</div>
... ...
... ... @@ -472,6 +472,8 @@ module.exports = class extends global.yoho.BaseModel {
dest.feedbacks = {};
return dest;
}
dest.productSkn = origin.product_skn;
dest.goodsName = origin.product_name;
// 线下店商品展示限制
... ...
... ... @@ -23,7 +23,11 @@
<a id="addtoCart" href="javascript:;" class="addto-cart add-to-cart-url">加入购物车</a>
{{/if}}
{{#if tickets}}
<a id="ticketsToCart" href="javascript:;" class="addto-cart add-to-cart-url">立即购买</a>
{{#if ticketsUrl}}
<a href="{{ticketsUrl}}" class="addto-cart add-to-cart-url">APP购买</a>
{{^}}
<a id="ticketsToCart" href="javascript:;" class="addto-cart add-to-cart-url">立即购买</a>
{{/if}}
{{/if}}
{{#if isDepositAdvance}}
<a id="isDepositAdvance" href="javascript:;" class="addto-cart add-to-cart-url">立即购买</a>
... ...
... ... @@ -48,6 +48,10 @@ const getMktcBySeo = function() {
return mktc;
};
const getMktc = () => {
return qs.mkt_code || qs.union_type || getMktcBySeo() || '100000000000349';
};
const canOpenApp = () => {
if (isWechatDevtool || isApp || isFromYOHO || nodownload || qs.nodownload || qs.no_openapp || blackCheck) {
return false;
... ... @@ -57,7 +61,7 @@ const canOpenApp = () => {
const getAppPath = () => {
let appPath = document.getElementById('main-wrap').dataset.apppath || 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.home","params":{"gender":"1","channel":"2"}}';
let ct = qs.mkt_code || qs.union_type || getMktcBySeo() || '100000000000349';
let ct = getMktc();
let clientId = cookie.get('_yasvd');
if (ct) {
... ... @@ -103,3 +107,5 @@ if (canOpenApp()) {
}
}, 2000);
}
window._getMktCode = getMktc;
... ...
... ... @@ -46,6 +46,8 @@ let nowShareData = {
imgUrl: productPic
};
const DOWNLOAD_URL = '//union.yoho.cn/union/app-downloads.html';
yoho.ready(function() {
if (yoho.isMarsApp) {
yoho.invokeMethod('set.shareInfo', shareData);
... ... @@ -115,8 +117,24 @@ setTimeout(() => {
data.studentPrice = Math.round(data.studentPrice.toString().replace('¥', ''));
}
$('#placeholder-pricedata').replaceWith(priceDataHbs(data));
if (data.tickets && data.cartInfo) {
let $downloadBtn = $('#download-go');
let ticketsUrl;
if ($downloadBtn.length) {
ticketsUrl = $downloadBtn.attr('href');
}
if (!ticketsUrl) {
let mktCode = window._getMktCode ? window._getMktCode() : '';
ticketsUrl = `${DOWNLOAD_URL}?union_type=${mktCode}&openby:yohobuy={"action":"go.productDetail","params":{"product_skn":${data.productSkn}}}`; // eslint-disable-line
}
data.cartInfo.ticketsUrl = ticketsUrl;
}
$('#placeholder-pricedata').replaceWith(priceDataHbs(data));
$('#placeholder-infodata').replaceWith(infoDataHbs(data));
setTimeout(function() {
... ...
... ... @@ -56,6 +56,18 @@
color: #444;
}
.ext-options {
font-size: 26px;
line-height: 38px;
display: inline-block;
padding: 0 4px;
border: 1px solid #ddd;
vertical-align: middle;
position: relative;
top: -1px;
margin-left: 20px;
}
.iconfont {
position: absolute;
top: 30px;
... ...