Authored by baoss

Merge branch 'develop' of git.yoho.cn:fe/xianyu-ufo-app-web into develop

<template>
<LayoutApp class="yohoufo-channel-page" :show-back="true" :hide-header="hideHeader" :title="title">
<div class="fixed-nav scroll-nav-wrap" v-if="isShow && navList.length">
<div class="fixed-nav scroll-nav-wrap" :class="{'hidden': !isShow}" v-if="navList.length">
<ScrollNav :list="navList" :current="active" @transfer="getIndex" style="background: #f2f2f2;"></ScrollNav>
</div>
<Scroll
... ... @@ -63,10 +63,6 @@ export default {
homeYasParams: [],
options: {
pullUpLoad: true,
// pullDownRefresh: true,
// pullDownRefresh: {
// txt: '刷新成功',
// }
},
scrollEvents: ['scroll','scroll-end'],
title:'闲鱼潮',
... ... @@ -109,6 +105,7 @@ export default {
selectedCategory: {},
height: 0,
isA: false,
isHidden: true,
};
},
computed: {
... ... @@ -519,4 +516,8 @@ input::-webkit-input-placeholder {
.class-a {
padding-top: 104px;
}
.hidden {
visibility: hidden;
opacity: 0;
}
</style>
... ...
... ... @@ -19,7 +19,7 @@ export default {
return {
isUnionType: false,
shareUrl:
"https://activity.yoho.cn/feature/5475.html?share_id=8169&title=新人礼遇"
"https://activity.yoho.cn/feature/5475.html?share_id=8169&title=新人礼遇&nodownload=1"
};
},
mounted() {
... ...
... ... @@ -17,7 +17,7 @@ export default {
methods: {
onClick() {
this.$yoho.goNewPage({
url: 'https://activity.yoho.cn/feature/5729.html?title=活动规则&openby:yohobuy={"action":"go.h5","params":{"title":"活动规则","url":"https://activity.yoho.cn/feature/5729.html"}}'
url: 'https://activity.yoho.cn/feature/5729.html?nodownload=1&title=活动规则&openby:yohobuy={"action":"go.h5","params":{"title":"活动规则","url":"https://activity.yoho.cn/feature/5729.html"}}'
});
}
}
... ...
... ... @@ -18,7 +18,7 @@ export default {
data() {
return {
isUnionType: false,
shareUrl: 'https://activity.yoho.cn/feature/5475.html?share_id=8169&title=新人礼遇'
shareUrl: 'https://activity.yoho.cn/feature/5475.html?share_id=8169&title=新人礼遇&nodownload=1'
};
},
mounted() {
... ...
... ... @@ -146,7 +146,7 @@ export default {
return {
title: '调价',
agreementURL:
'https://activity.yoho.cn/feature/3187.html?share_id=5851&title=ufo-%E5%8D%96%E5%AE%B6%E5%8D%8F%E8%AE%AE',
'https://activity.yoho.cn/feature/3187.html?share_id=5851&title=ufo-%E5%8D%96%E5%AE%B6%E5%8D%8F%E8%AE%AE&nodownload=1',
platformFeeModalVisible: false,
platformFee: {
amount: '-¥0',
... ...
... ... @@ -73,7 +73,7 @@ export default {
error: false,
agreeDesc: '有货卖家协议',
url:
'https://activity.yoho.cn/feature/6773.html?share_id=9479&title=%E9%97%B2%E9%B1%BC%E6%BD%AE%E5%8D%96%E5%AE%B6%E5%8D%8F%E8%AE%AE',
'https://activity.yoho.cn/feature/6773.html?share_id=9479&title=%E9%97%B2%E9%B1%BC%E6%BD%AE%E5%8D%96%E5%AE%B6%E5%8D%8F%E8%AE%AE&nodownload=1',
superSell: false,
addNumError: false,
scrollOption: {
... ... @@ -81,7 +81,7 @@ export default {
click: true
},
tipUrl:
'https://activity.yoho.cn/feature/6773.html?share_id=9479&title=%E9%97%B2%E9%B1%BC%E6%BD%AE%E5%8D%96%E5%AE%B6%E5%8D%8F%E8%AE%AE'
'https://activity.yoho.cn/feature/6773.html?share_id=9479&title=%E9%97%B2%E9%B1%BC%E6%BD%AE%E5%8D%96%E5%AE%B6%E5%8D%8F%E8%AE%AE&nodownload=1'
};
},
activated() {
... ...
... ... @@ -215,7 +215,7 @@ export default {
align-items: baseline;
font-size: 40px;
letter-spacing: 0;
font-family: $num-font;
@include num;
span:nth-child(2) {
font-size: 0.8em;
... ...
... ... @@ -220,7 +220,7 @@ export default {
.size-info,
.size-price {
font-family: $num-font;
@include num;
}
&.selected {
background: $primary-color;
... ... @@ -259,7 +259,8 @@ export default {
.size-info {
color: #000;
font-family: $num-font;
@include num;
font-weight: bold;
font-size: 40px;
display: inline-block;
... ...
... ... @@ -342,7 +342,7 @@ export default {
}
.crash-info {
font-family: $num-font;
@include num;
}
.footer {
... ...
... ... @@ -106,7 +106,8 @@ export default {
}
.price {
font-family: $num-font;
@include num;
font-weight: bold;
font-size: 32px;
line-height: 38px;
... ...
$primary-color : #08304b;
$sub-color : #64ad88;
$num-font: "DINAlternate-Bold", "din alternate", "PingFang SC", "HiraginoSansGB-W3", "SanFranciscoText-Regular", Helvetica, Roboto, "Heiti SC", "黑体", Arial;
@mixin cube-ufo-btn {
[type="button"] {
... ...
... ... @@ -27,7 +27,7 @@
<div class="info-name"><div>{{productDetail.product_name}}</div></div>
</div>
<a class="banner" v-if="resource" @click.prevent="gotoNewPage(resource.url)">
<img-size :src="sizeImg(resource.src)"/>
<img-size ref="resourceImg" :src="sizeImg(resource.src)"/>
</a>
<div class="info">
<transition-group name="info-list" tag="div" class="info-list">
... ... @@ -50,7 +50,7 @@
<img class="ref-img" v-lazy="prdDetailImage" />
<div class="recommend" v-if="recommend"><h2>相关推荐</h2>
<product-list :list="recommend" priceKey="price"/>
<product-list ref="recommendList" :list="recommend" priceKey="price" :yas-params="recommendYasParams"/>
</div>
</div>
<div class="footer">
... ... @@ -97,7 +97,7 @@ import TopList from './components/top-list';
import SquareImg from './components/square-img';
import stateShortCutsMixins from './mixins';
const { mapActions } = createNamespacedHelpers('product');
const { mapActions, mapState } = createNamespacedHelpers('product');
export default {
name: 'ProductDetail',
... ... @@ -133,10 +133,23 @@ export default {
showSizeSelectSheet: false,
showSizeRequestSheet: false,
selectSizeConfig: {},
/**
* 商品详情页-推荐商品曝光时
* XY_UFO_SHOW_EVENT
* 1.P_NAME:页面名称,UFOProductDetail_LIST;
* 2.P_PARAM:页面参数;
* 3.I_INDEX:曝光顺序;
* 4.PRD_SKN:商品id;
*/
recommendYasParams: {
P_NAME: 'UFOProductDetail_LIST',
},
};
},
computed: {
...mapGetters(['isQiugouEnabled']),
...mapState(['resourceContentCode']),
productDec() {
const goods = get(this.productDetail, 'goods_list[0]', {});
... ... @@ -198,6 +211,31 @@ export default {
this.loadData(this.productId);
this.refresh();
if (this._resourceImgWatcher) {
this._resourceImgWatcher();
}
if (this.resource && this.resource.url) {
this.yasResourceVisible();
} else {
this._resourceImgWatcher = this.$watch(() => {
return this.resource && this.resource.url;
}, (url) => {
if (url) {
this._resourceImgWatcher && this._resourceImgWatcher();
this.yasResourceVisible();
}
}, {
immediate: true,
});
}
},
deactivated() {
if (this._resourceImgWatcher) {
this._resourceImgWatcher();
this._resourceImgWatcher = null;
}
},
beforeRouteUpdate(to, from ,next) {
if (this.historyBackGuard() === false) {
... ... @@ -228,6 +266,31 @@ export default {
refresh() {
this.$refs.slide && this.$refs.slide.refresh && this.$refs.slide.refresh();
},
yasResourceVisible() {
/**
* 商品详情页中的资源位曝光
* XY_UFO_SHOW_EVENT
* 1.P_NAME:当前页面名称,XY_UFOProductDetail;
* 2.P_PARAM:当前页面资源位code;
* 3.PRD_ID:商品ID;
* 4.ACTION_URL:资源位跳转URL;
*/
this.$store.dispatch('reportYas', {
params: {
appop: 'XY_UFO_SHOW_EVENT',
param: {
P_NAME: 'XY_UFOProductDetail',
P_PARAM: this.resourceContentCode,
PRD_ID: this.productId,
ACTION_URL: this.resource.url,
},
}
});
if (this._resourceImgWatcher) {
this._resourceImgWatcher();
this._resourceImgWatcher = null;
}
},
sizeImg(src, width = 360, height = 72) {
if (src) {
return getImgUrl(src, width, height);
... ... @@ -344,19 +407,23 @@ export default {
// 选择出售或购买
async onSelectTradeProduct(tradeProduct) {
/**
* 数据埋点
* 商品详情页点击出售/购买/求购按钮
* event: XY_UFO_PRD_DT_SALE_C
* params: 1.TAB_ID:1-出售,2-购买,3-求购;
* 2.PRD_ID:商品ID;
*/
this.$store.dispatch('reportYas', {
params: {
appop: 'XY_UFO_PRD_DT_BUY_SEL_C',
param: {
TAB_ID: this.selectSizeConfig.type === 'buy' ? 2 : 1,
PRD_ID: tradeProduct.productId
},
}
});
if (this.selectSizeConfig.type === 'buy') {
//数据埋点
this.$store.dispatch('reportYas', {
params: {
appop: 'XY_UFO_PRD_DT_BUY_SEL_C',
param: {
PRD_ID: tradeProduct.productId,
PRD_SKU: tradeProduct.skup,
PRD_SIZE: tradeProduct.size_name,
},
}
});
try {
const info = await this.payment({
skup: tradeProduct.skup,
... ... @@ -441,6 +508,21 @@ export default {
// 资源位
gotoNewPage(url) {
/**
* 商品详情页中的资源位点击
* XY_UFO_GDS_DT_BANNER_C
* 1.PRD_ID:商品ID
* 2.ACTION_URL:跳转的URL
*/
this.$store.dispatch('reportYas', {
params: {
appop: 'XY_UFO_GDS_DT_BANNER_C',
param: {
PRD_ID: this.productId,
ACTION_URL: url,
},
}
});
this.$xianyu.goXianyuNewPage({url});
},
},
... ... @@ -559,7 +641,8 @@ export default {
.info-price {
color: #d0021b;
font-size: 48px;
font-family: $num-font;
@include num;
font-weight: bold;
line-height: 56px;
height: 56px;
... ...
... ... @@ -6,13 +6,13 @@ export default {
ensureProduct({ commit }, { productId }) {
commit(Types.ENSURE_PRODUCT_DETAIL, { productId });
},
async fetchProductInfo({ commit }, { productId }) {
async fetchProductInfo({ commit, state }, { productId }) {
const queryTasks = ['', '/resource', '/activity', '/recommend'].map(path => {
let params = { product_id: productId };
if (path === '/resource') {
params = {
content_code: '05e4f5782dfc3a5e10d39b8f04a7dcb9',
content_code: state.resourceContentCode,
};
}
return this.$api.post(`/api/ufo/product${path}`, params).then(result => {
... ...
... ... @@ -50,7 +50,7 @@ export function defaultProduct() {
export function defaultState() {
return {
products: {},
resourceContentCode: '05e4f5782dfc3a5e10d39b8f04a7dcb9', // 资源位code,当前只有一个固定的code
/**
1: 当前商品对应品牌系统的推荐
2: 商品详情页面取前3
... ...
... ... @@ -60,7 +60,10 @@ const webpackConfig = merge(baseConfig, {
parallel: true,
sourceMap: true,
terserOptions: {
safari10: true
safari10: true,
compress: {
drop_console: true,
}
}
})]
},
... ...