Authored by huzhiming

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

... ... @@ -211,6 +211,20 @@ export default {
type: 4
};
}
case 'second': {
return {
pay: 'XY_UFO_SALE_PAY',
result: 'XY_UFO_SALE_PAY_RES',
type: 5
};
}
case 'newSecond': {
return {
pay: 'XY_UFO_SALE_PAY',
result: 'XY_UFO_SALE_PAY_RES',
type: 6
};
}
default: {
// PASS
return {
... ...
... ... @@ -80,7 +80,8 @@ export default {
colorName: get(state.second.info, 'colorName', ''),
sizeName: get(state.second.info, 'sizeName', ''),
goodPrice: get(state.second.info, 'price', ''),
skup: this.skup
skup: this.skup,
type: get(state.second.info, 'sechondHandTypeName', '') === '二手' ? 5 : 6,
};
} else {
return {
... ... @@ -235,7 +236,7 @@ export default {
desc: '金额',
extra: JSON.stringify({
type: UserType.buy,
reportType: 'buy',
reportType: this.getType(this.productDetail.type),
back: {
name: 'buyOrderDetail',
params: {
... ... @@ -257,14 +258,24 @@ export default {
}).show();
//数据埋点
this.reportYas('XY_UFO_SC_ORD', {
ORD_NUM: result.data.orderCode,
PRD_ID: this.productId,
PRD_SKU: this.productDetail.skup,
PRD_SIZE: this.productDetail.sizeName,
ORD_AMOUNT: this.orderDetail.amount,
PRD_PRICE: this.productDetail.goodPrice,
});
if (this.productDetail.type) {
// 二手
this.reportYas('XY_UFO_RESALE_ORD', {
ORD_NUM: result.data.orderCode,
PRD_ID: this.productId,
PRD_SKU: this.productDetail.skup,
ORD_TYPE: this.productDetail.type
});
} else {
this.reportYas('XY_UFO_SC_ORD', {
ORD_NUM: result.data.orderCode,
PRD_ID: this.productId,
PRD_SKU: this.productDetail.skup,
PRD_SIZE: this.productDetail.sizeName,
ORD_AMOUNT: this.orderDetail.amount,
PRD_PRICE: this.productDetail.goodPrice,
});
}
},
onClose(orderCode) {
this.$router.replace({
... ... @@ -329,6 +340,16 @@ export default {
param: params
}
});
},
getType(type) {
switch (type) {
case 5:
return 'second';
case 6:
return 'newSecond';
default:
return 'buy';
}
}
}
};
... ...
... ... @@ -40,7 +40,7 @@ export default {
addressInfo,
userAddress,
} = order;
const { productId, storageId, skup } = goodsInfo;
const { productId, storageId, skup, typeTag } = goodsInfo;
if (isDetail) {
this.setIsRefresh(true);
... ... @@ -215,6 +215,12 @@ export default {
price = priceInfo.realPayPrice;
pageBackName = 'buyOrderDetail';
}
let reportType = 'buy';
if (typeTag) {
reportType = typeTag === '全新瑕疵' ? 'newSecond' : 'second';
}
this.$createOrderPayType({
orderCode,
price: parseFloat(price || '').toFixed(2),
... ... @@ -234,7 +240,7 @@ export default {
code: orderCode,
},
},
reportType: 'buy',
reportType,
}),
}).show();
break;
... ...
... ... @@ -29,11 +29,10 @@
<transition name="slide-up">
<div class="footer" v-if="isAvailable">
<cube-button v-if="isMarketable" @click="convertToCash" :class="{active: isMarketable}">变现<span> <i>¥</i>{{cashPrice}}</span></cube-button>
<cube-button v-if="isUsed" @click="convertToUsed">二手<span> <i>¥</i>{{usedPrice}}</span></cube-button>
<cube-button v-if="config.type === 'buy' && isTradable" @click="select"
class="active">{{config.btnTitle}}<span> <i>¥</i>{{latestPrice}}</span></cube-button>
<cube-button v-if="config.type === 'sell'" @click="select"
:class="{active: isTradable}">{{config.btnTitle}}</cube-button>
<cube-button v-if="config.type === 'sell'" @click="select" :class="{active: isTradable}">{{config.btnTitle}}</cube-button>
<cube-button v-if="config.type === 'buy' && isUsed" @click="convertToUsed">二手<span> <i>¥</i>{{usedPrice}}</span></cube-button>
<cube-button v-if="config.type === 'buy' && isTradable" @click="select" class="active">{{config.btnTitle}}<span> <i>¥</i>{{latestPrice}}</span></cube-button>
</div>
</transition>
</div>
... ... @@ -146,14 +145,14 @@ export default {
* 是二手鞋
*/
isUsed() {
return get(this.product, 'second_hand_least_price');
return get(this.selectedSize, 'second_hand_least_price');
},
/**
* 二手鞋的价格
*/
usedPrice() {
return get(this.product, 'second_hand_least_price');
return get(this.selectedSize, 'second_hand_least_price');
},
/**
... ... @@ -308,6 +307,18 @@ export default {
const { data: count } = await this.fetchStorageCount({ storageId });
this.$store.dispatch('reportYas', {
params: {
appop: 'XY_UFO_PRD_DT_BUY_SEL_C',
param: {
PRD_ID: this.product.product_id,
PRD_SKU: get(this.selectedSize, 'second_hand_skup', 0),
PRD_SIZE: get(this.selectedSize, 'size_id', 0),
ORD_TYPE: 5,
},
},
});
if (count === 1) {
// 跳转详情
this.$router.push({
... ...
... ... @@ -2,12 +2,19 @@
<div class="bg" v-if="list.length">
<div class="second-list-item" v-for="(product,index) in list" @click="goDetail(product, index)"
:key="index" :class="(index) % 2 === 0 && 'magrin-right'">
<ImgSize class="item-imge" :src="product.secondhand_image" :width="343" :height="343"/>
<div v-if="product.status === 100" class="dim-background">
<ImgSize class="dim-imge" :src="product.secondhand_image" :width="343" :height="343"/>
</div>
<div v-else class="item-background">
<ImgSize class="item-imge" :src="product.secondhand_image" :width="343" :height="343"/>
</div>
<div class="item-bottom">
<div class="item-price">
<span>{{product.skup_price && '¥'}}</span><span>{{product.skup_price || ' '}}</span>
<div v-if="product.pre_sale_flag" class="sale_flag">
<p>{{product.pre_sale_flag === 5 ? '全新瑕疵' : '二手'}}</p>
<div v-if="product.secondhandTypeName" class="sale_flag">
<p>{{product.secondhandTypeName}}</p>
</div>
</div>
<div class="size-flag">{{product.size_name}}码</div>
... ... @@ -21,21 +28,92 @@ import ImgSize from '../../../components/img-size';
export default {
props: {
list: Array
list: Array,
yasParams: Object,
yasEventName: {
type: String,
default: 'XY_UFO_PRD_LIST_C'
},
},
components: {
ImgSize,
},
data: function() {
return {
yasFirstId: 0,
itemHeight: 0
};
},
methods: {
goDetail(product, index) {
if (this.yasParams && Object.keys(this.yasParams).length) {
this.yasDetail(product.id, index);
}
this.$router.push({
name: 'SecondProductDetail',
params: {
skup: product.skup
skup: product.skup,
yasParams: this.yasParams,
}
});
},
yasShowEvent: function(height) {
if (!this.itemHeight) {
let item = document.querySelector('.second-list-item');
this.itemHeight = item && item.offsetHeight || 0;
}
if (!this.itemHeight) {
return;
}
// 获取列表单个元素高度
let index = 0;
if (Number(height) > 0) {
// 获取第一个曝光元素
let row = parseInt((height - 12) / this.itemHeight) + 1;
index = row * 2 - 2;
}
// 获取曝光列表
let list = [];
for (let i = 0; i < 6; i++) {
if (this.list[i + index]) {
list.push(this.list[i + index]);
}
}
// 判断是否是重复曝光
if (list.length && list[0].id !== this.yasFirstId) {
this.yasFirstId = list[0].id;
let DATA = [];
list.map((value, i) => {
const prdType = value.pre_sale_flag === 5 ? 2 : 1; //flag=5全新瑕疵,6二手
DATA.push({...this.yasParams, I_INDEX: i + index + 1, PRD_ID: value.product_id, PRD_TYPE: prdType});
});
this.$store.dispatch('reportYas', {
params: {
param: {DATA},
appop: 'XY_UFO_SHOW_EVENT'
}
});
}
},
yasDetail(id, index) {
this.$store.dispatch('reportYas', {
params: {
param: {...this.yasParams, I_INDEX: index + 1, PRD_ID: id },
appop: this.yasEventName
}
});
}
... ... @@ -55,6 +133,10 @@ export default {
margin-bottom: 16px;
}
.item-background {
background: transparent;
}
.item-imge {
width: 344px;
height: 344px;
... ... @@ -62,6 +144,21 @@ export default {
border-top-right-radius: 16px;
}
.dim-background {
background: url(~statics/image/list/Group@2x.png) no-repeat;
background-size: 50% 50%;
background-position: center;
}
.dim-imge {
width: 344px;
height: 344px;
border-top-left-radius: 16px;
border-top-right-radius: 16px;
opacity:0.6;
filter: alpha(opacity=60);
}
.item-bottom {
padding: 20px 14px 30px 20px;
display: flex;
... ... @@ -88,7 +185,8 @@ export default {
p {
color: #fff;
font-size: 9px;
line-height: 30px;
font-size: 18px;
}
}
... ...
... ... @@ -182,6 +182,18 @@ export default {
skup: this.skup
}
});
this.$store.dispatch('reportYas', {
params: {
appop: 'XY_UFO_SECOND_PRD_DT_BUY_C',
param: {
PRD_ID: this.info.productId,
PRD_SKU: this.skup,
PRD_SIZE: this.info.size_name,
ORD_TYPE: this.info.sechondHandTypeName === '二手' ? 5 : 6,
},
},
});
}
},
computed: {
... ...
... ... @@ -2,11 +2,13 @@
<LayoutApp :show-back="true" title="二手" class="list-wrapper">
<LayoutScroll
ref="scrolllist"
@scroll="scrollHandler"
@scroll-end="scrollEndHandler"
@pulling-up="fetchSkupList(isMore)"
v-if="skupList.list.length"
class="list-scroll-bg"
>
<SecondList :list="skupList.list"></SecondList>
<SecondList ref="second" :list="skupList.list" :yasParams="yasParams"></SecondList>
</LayoutScroll>
<UfoNoItem class="empty" :tip="`暂无数据`" v-else></UfoNoItem>
... ... @@ -28,6 +30,7 @@ export default {
},
data() {
return {
yasParams: {P_NAME: 'XY_UFOSecondList', TYPE_ID: 5, TAB_ID: '', TAB_NAME: '', P_PARAM: [].toString()},
}
},
computed: {
... ... @@ -40,10 +43,38 @@ export default {
if (this.isMore) {
await this.fetchSecondSkupList({ isReset: false });
}
}
},
scrollHandler({y}) {
this.scrollY = -y;
},
scrollEndHandler({y}) {
let height = -y;
this.$refs.second.yasShowEvent(height);
},
yasShowPage() {
let {total, list} = this.skupList;
let PRD_LIST = [];
for (let item of list) {
PRD_LIST.push(item.id);
}
PRD_LIST = PRD_LIST.toString();
this.$store.dispatch('reportYas', {
params: {
param: {...this.yasParams, TOTAL: total, PRD_LIST},
appop: 'XY_UFO_PRD_LIST_L'
}
});
},
},
activated() {
this.fetchSecondSkupList({ isReset: true });
activated: async function() {
await this.fetchSecondSkupList({ isReset: true });
this.$refs.second.yasShowEvent(0);
this.yasShowPage();
}
};
</script>
... ...
... ... @@ -70,6 +70,8 @@ module.exports = (req, res, next) => {
axios.post('https://analytics.m.yohobuy.com/yas_mobile', data, {
headers: {
origin: 'https://xianyu.yohobuy.com/',
referer: 'https://xianyu.yohobuy.com/',
'content-type': 'application/x-www-form-urlencoded'
}
});
... ...
{
"name": "xianyu-ufo-app-web",
"version": "1.1.0-beta-4",
"version": "1.1.0-beta-5",
"private": true,
"description": "Xianyu Project With Express",
"repository": {
... ... @@ -42,7 +42,7 @@
"connect-redis": "^3.4.0",
"cookie-parser": "^1.4.3",
"crypto-js": "^3.1.9-1",
"cube-ui": "^1.12.31",
"cube-ui": "^1.12.32",
"express": "^4.16.4",
"express-session": "^1.15.6",
"fastclick": "^1.0.6",
... ...
... ... @@ -3114,10 +3114,10 @@ cssstyle@^1.0.0:
dependencies:
cssom "0.3.x"
cube-ui@^1.12.31:
version "1.12.31"
resolved "http://npm.yohops.com/cube-ui/-/cube-ui-1.12.31.tgz#f3a6801e0be5c56b4928d01f3c7acfd6253459d3"
integrity sha1-86aAHgvlxWtJKNAfPHrP1iU0WdM=
cube-ui@^1.12.32:
version "1.12.32"
resolved "http://npm.yohops.com/cube-ui/-/cube-ui-1.12.32.tgz#105389c6a92fb6e06ed1c036498c3c6d78e8de94"
integrity sha1-EFOJxqkvtuBu0cA2SYw8bXjo3pQ=
dependencies:
better-scroll "~1.12.6"
vue-create-api "^0.2.0"
... ...