Authored by lea guo

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

... ... @@ -86,7 +86,7 @@ export default {
...mapOrderAction(['payAction']),
show() {
this.$refs.actionSheet.show();
this.pay()
this.pay();
},
hide() {
this.$refs.actionSheet.hide();
... ... @@ -127,7 +127,8 @@ export default {
appop: this.appOp().pay,
param: {
ORD_NUM: this.orderCode,
PAY_TYPE: 1
PAY_TYPE: 1,
ORD_TYPE: this.appOp().type
},
},
});
... ... @@ -139,44 +140,18 @@ export default {
time: 1500,
type: 'txt'
}).show();
//数据埋点
this.$store.dispatch('reportYas', {
params: {
appop: this.appOp().result,
param: {
ORD_NUM: this.orderCode,
PAY_TYPE: 1, //1支付宝支付,2微信支付
PAY_RES: 0, //0支付失败,1支付成功
ORDER_AMOUNT: this.price
},
},
});
},
onSuccess(result) {
this.hide();
this.$emit('paySuccess');
//数据埋点
this.$store.dispatch('reportYas', {
params: {
appop: this.appOp().result,
param: {
ORD_NUM: this.orderCode,
PAY_TYPE: 1,
PAY_RES: 1,
ORDER_AMOUNT: this.price
},
},
});
this.$router.replace({
name: 'OrderPay',
query: {
orderCode: this.orderCode,
payParams: result.data.payParams,
extra: this.extra
extra: this.extra,
price: this.price
}
});
... ... @@ -211,19 +186,29 @@ export default {
case 'sell': {
return {
pay: 'XY_UFO_SALE_PAY',
result: 'XY_UFO_SALE_PAY_RES'
result: 'XY_UFO_SALE_PAY_RES',
type: 1,
};
}
case 'buy': {
return {
pay: 'XY_UFO_SC_PAY',
result: 'XY_UFO_SC_PAY_RES'
pay: 'XY_UFO_SALE_PAY',
result: 'XY_UFO_SALE_PAY_RES',
type: 2,
};
}
case 'qiugou_buy': {
return {
pay: 'XY_UFO_WTBUY_PAY',
result: 'XY_UFO_WTBUY_PAY_RES'
pay: 'XY_UFO_SALE_PAY',
result: 'XY_UFO_SALE_PAY_RES',
type: 3
};
}
case 'bianxian': {
return {
pay: 'XY_UFO_SALE_PAY',
result: 'XY_UFO_SALE_PAY_RES',
type: 4
};
}
default: {
... ...
... ... @@ -77,7 +77,7 @@ Vue.use(ChangeBidPriceDialog);
initClient(store);
xianyu.$router = router;
yoho.auth = async (args) => {
yoho.auth = async(args) => {
let {
refer,
loginUrl,
... ... @@ -108,7 +108,7 @@ yoho.auth = async (args) => {
}
};
yoho.authRealName = async () => {
yoho.authRealName = async() => {
if (await yoho.auth()) {
let res = await api.get('/api/ufo/sellerOrder/entryStatus');
... ...
... ... @@ -169,8 +169,6 @@
});
}
})();
window.appBaseLogs = {events: [{}], device: {ak: '', udid: ''}, status: [{av: '', udid: '', sid: ''}]};
</script>
</body>
</html>
... ...
... ... @@ -22,7 +22,7 @@ const { mapActions: mapOrderAction } = createNamespacedHelpers('order/orderConfi
export default {
name: 'PayPage',
props: ['orderCode', 'payParams', 'extra'],
props: ['orderCode', 'payParams', 'extra', 'price'],
data() {
return {
count: 60,
... ... @@ -68,10 +68,14 @@ export default {
if (this.page.forward) {
this.$router.replace(this.page.forward);
}
this.paySuccess();
}, () => {
if (this.page.back) {
this.$router.replace(this.page.back);
}
this.payError();
});
} else {
const url = config.alipayUrl + '?' + this.payParams;
... ... @@ -175,6 +179,77 @@ export default {
break;
}
}
},
appOp() {
switch (this.page.reportType) {
case 'sell': {
return {
pay: 'XY_UFO_SALE_PAY',
result: 'XY_UFO_SALE_PAY_RES',
type: 1,
};
}
case 'buy': {
return {
pay: 'XY_UFO_SALE_PAY',
result: 'XY_UFO_SALE_PAY_RES',
type: 2,
};
}
case 'qiugou_buy': {
return {
pay: 'XY_UFO_SALE_PAY',
result: 'XY_UFO_SALE_PAY_RES',
type: 3
};
}
case 'bianxian': {
return {
pay: 'XY_UFO_SALE_PAY',
result: 'XY_UFO_SALE_PAY_RES',
type: 4
};
}
default: {
// PASS
return {
pay: 'XY_UFO_SALE_PAY',
result: 'XY_UFO_SALE_PAY_RES'
};
}
}
},
paySuccess() {
//数据埋点
this.$store.dispatch('reportYas', {
params: {
appop: this.appOp().result,
param: {
ORD_NUM: this.orderCode,
PAY_TYPE: 1,
PAY_RES: 1,
ORDER_AMOUNT: this.price,
ORD_TYPE: this.appOp().type
},
},
});
},
payError() {
//数据埋点
this.$store.dispatch('reportYas', {
params: {
appop: this.appOp().result,
param: {
ORD_NUM: this.orderCode,
PAY_TYPE: 1, //1支付宝支付,2微信支付
PAY_RES: 0, //0支付失败,1支付成功
ORDER_AMOUNT: this.price,
ORD_TYPE: this.appOp().type
},
},
});
}
}
};
... ...
... ... @@ -142,7 +142,7 @@ export default {
this.sellerPublish({price: this.price, skup: this.skup, address_id: this.addressInfo.address_id})
.then((res) => {
if (res && res.code && res.code == 200) {
if (res && res.code && res.code === 200) {
this.$createToast({
time: 1000,
type: 'txt',
... ... @@ -169,7 +169,7 @@ export default {
this.sellerPublish({price: this.price, skup: this.skup, address_id: this.addressInfo.address_id})
.then((res) => {
if (res && res.code && res.code == 200) {
if (res && res.code && res.code === 200) {
this.payOrder();
} else {
this.$createToast({
... ... @@ -177,21 +177,21 @@ export default {
type: 'txt',
txt: res.message
}).show();
}
});
}
},
payOrder() {
let vm = this;
this.$createOrderPayType({
price: get(this.computeTip, 'earnestMoney', 0),
desc: '保证金',
orderCode: get(this.publishinfo, 'orderCode', ''),
extra: JSON.stringify({
type: 'sell',
reportType: 'bianxian',
back: {
name: 'sellOrderDetail',
params: {
... ... @@ -210,6 +210,12 @@ export default {
vm.onClose(get(this.publishinfo, 'orderCode', ''));
}
}).show();
this.reportYas('XY_UFO_CASH_ORD', {
ORD_NUM: get(this.publishinfo, 'orderCode', ''),
PRD_ID: get(this.originProductData, 'productId', ''),
PRD_SKU: this.skup
});
},
showToast() {
... ...
... ... @@ -352,12 +352,6 @@ export default {
return;
}
this.reportYas('XY_UFO_SALE_ORD', {
ORD_NUM: orderResult.code.orderCode,
PRD_ID: this.productDetail.productId,
PRD_SKU: this.productDetail.skup
});
// 从定金中走了钱,不用支付宝
if (orderResult.data.orderCode === 0) {
this.$createToast({
... ... @@ -403,6 +397,12 @@ export default {
vm.onClose(orderResult.data.orderCode);
}
}).show();
this.reportYas('XY_UFO_SALE_ORD', {
ORD_NUM: orderResult.data.orderCode,
PRD_ID: this.productDetail.productId,
PRD_SKU: this.productDetail.skup
});
},
onClose(orderCode) {
this.$router.replace({
... ...
<template>
<layout-app title="商品列表" class="brand-product-list">
<div class="scroll-view" ref="scroll">
<LayoutScroll
class="scroll-view"
@scroll-end="scrollEndHandler">
<div class="list-wrapper" v-if="brandProductList != null">
<product-list :list="brandProductList" priceKey="price"/>
<product-list ref="productList" :list="brandProductList" priceKey="price" :yas-params="recommendYasParams"/>
</div>
</div>
</LayoutScroll>
</layout-app>
</template>
... ... @@ -14,7 +16,7 @@ import ScrollView from 'components/layout/scroll-view';
import ProductList from '../list/components/productList';
const STORE_PATH = 'product';
const { mapActions, mapState } = createNamespacedHelpers(STORE_PATH);
const { mapState } = createNamespacedHelpers(STORE_PATH);
export default {
name: 'BrandProductList',
... ... @@ -35,6 +37,18 @@ export default {
observeDOM: false,
pullUpLoad: false,
},
/**
* 商品详情页-推荐商品曝光时
* 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: {
... ... @@ -52,9 +66,10 @@ export default {
}
},
methods: {
...mapActions(['fetchBrandTop']),
onPullingDown() {
this.fetchBrandTop({productId: this.productId});
scrollEndHandler({y}) {
const scrollTop = Math.abs(y);
this.$refs.productList && this.$refs.productList.yasShowEvent(scrollTop);
},
},
};
... ...
... ... @@ -275,6 +275,7 @@ export default {
height: 0;
padding-bottom: 100%;
position: relative;
box-sizing: border-box;
}
.size {
... ...
... ... @@ -9,7 +9,7 @@
</div>
<div class="product">
<div>
<template v-if="product.least_price >= 0"> ¥{{product.least_price}}</template>
<template v-if="selectedPrice != null && selectedPrice >= 0"> ¥{{selectedPrice}}</template>
<template v-else>&nbsp;</template>
</div>
<div>
... ... @@ -89,6 +89,23 @@ export default {
return {};
},
selectedPrice() {
let price = this.product.least_price;
if (this.config.type === 'sell') {
return price;
}
if (this.selectedSize.size_id > 0) {
if (this.selectedSize.least_price > 0) {
price = this.selectedSize.least_price;
} else {
price = '-';
}
}
return price;
},
goods_name() {
return get(this.product, 'goods_list[0].goods_name', '');
},
... ... @@ -201,6 +218,23 @@ export default {
bid_moster_price: get(this.selectedSize, 'bid_moster_price', ''),
});
/**
* 数据埋点
* 商品详情页点击出售/购买/求购按钮
* event: XY_UFO_PRD_DT_SALE_C
* params: 1.TAB_ID:1-出售,2-购买,3-求购, 4-变现;
* 2.PRD_ID:商品ID;
*/
this.$store.dispatch('reportYas', {
params: {
appop: 'XY_UFO_PRD_DT_BUY_SEL_C',
param: {
TAB_ID: 4,
PRD_ID: this.product.product_id,
},
}
});
// 跳转变现
this.$router.push({
name: 'sellAskOrder',
... ...
... ... @@ -14,7 +14,7 @@ export default {
return this.productDetail.goods_list[0].image_list;
},
resource() {
return this.productDetail.resource;
return this.productDetail.resource || {};
},
activity() {
return this.productDetail.activity;
... ...
<template>
<div class="layout">
<LayoutHeader class="layout-header" :show-back="true" :title="'\u200E'"></LayoutHeader>
<LayoutHeader class="layout-header" :show-back="true" title="商品详情"></LayoutHeader>
<div class="layout-context fixscroll">
<LayoutScroll
ref="pageScroll"
... ... @@ -30,7 +30,7 @@
</div>
<div class="info-name"><div>{{productDetail.product_name}}</div></div>
</div>
<a class="banner" v-show="resource" @click.prevent="gotoNewPage">
<a class="banner" v-if="resource.src" @click.prevent="gotoNewPage">
<img-size ref="resourceImg" :src="sizeImg(resource.src)"/>
</a>
<div class="info">
... ... @@ -47,7 +47,8 @@
<div class="info-list-value">{{desc.value}}</div>
</div>
</transition-group>
<top-list v-if="topList && topList.length !== 0" :list="topList" @itemClick="gotoProduct" @allClick="gotoBrand" />
<!-- 相关商品 -->
<top-list ref="topList" v-if="topList && topList.length !== 0" :list="topList" @itemClick="gotoProduct" @allClick="gotoBrand" />
<img class="ref-img" v-lazy="prdDetailTip"/>
</div>
... ... @@ -304,7 +305,30 @@ export default {
},
scrollEndHandler({y}) {
const scrollTop = Math.abs(y);
const pageScrollHeight = this.$refs.pageScroll.$el.offsetHeight;
// 相关商品
if (!this._topListYas && this.$refs.topList) {
if (this._topListTop === undefined) {
this._topListTop = this.$refs.topList.$el.offsetTop;
}
if (scrollTop < this._topListTop && (scrollTop + pageScrollHeight) > this._topListTop) {
const DATA = this.topList.slice(0, 3).map((value, i) => {
return {...this.recommendYasParams, I_INDEX: i, PRD_ID: value.id, PRD_SKN: value.id};
});
this.$store.dispatch('reportYas', {
params: {
param: {DATA},
appop: 'XY_UFO_SHOW_EVENT'
}
});
this._topListYas = true;
}
}
// 推荐商品
if (this._productItemHeight === undefined) {
let item = document.querySelector('.product-list-item');
... ... @@ -313,12 +337,13 @@ export default {
}
}
const listTop = this.$refs.recommendList.$el.offsetTop;
if (this.$refs.recommendList) {
const listTop = this.$refs.recommendList.$el.offsetTop;
const productListScrollTop = scrollTop + pageScrollHeight - listTop - this._productItemHeight;
const productListScrollTop = scrollTop + this.$refs.pageScroll.$el.offsetHeight - listTop - this._productItemHeight;
if (productListScrollTop > 0) {
this.$refs.recommendList.yasShowEvent(productListScrollTop);
if (productListScrollTop > 0) {
this.$refs.recommendList.yasShowEvent(productListScrollTop);
}
}
},
yasResourceVisible() {
... ...
... ... @@ -27,7 +27,7 @@ export default {
let [detail, resource, activity, recommend] = await Promise.all(queryTasks);
resource = get(resource, '[0].data[0]', null);
resource = get(resource, '[0].data[0]', {});
commit(Types.UPDATE_PRODUCT_DETAIL, Object.assign(detail.product_info, {
resource,
... ...
import Vue from 'vue';
import cookie from 'yoho-cookie';
import xianyu from '../common/xianyu';
const setWindowSize = (store) => {
const { clientWidth, clientHeight } = document.body;
... ... @@ -36,6 +38,44 @@ const initClient = (store) => {
img.src = 'data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA';
};
function getUdid() {
return cookie.get('udid') || '';
}
window.appBaseLogs = {
status: [
{
ca: '',
lo: '',
cy: 'CN',
av: '',
udid: getUdid(),
ln: '',
ab: '',
sid: '',
net: '',
la: ''
}
],
device: {
res: '',
ifa: '',
mac: '',
osv: '',
ifv: '',
ps: '',
os: xianyu.isiOS ? 'iOS' : 'android',
ak: 'yoho-xianyu_' + (xianyu.isiOS ? 'iOS' : 'android'),
sv: '',
ch: '',
dm: '',
tdid: '',
afp: '',
udid: getUdid()
},
events: [{}]
};
export {
initClient
};
... ...
... ... @@ -121,8 +121,6 @@
s.parentNode.insertBefore(hm, s);
})();
}());
window.appBaseLogs = {events: [{}], device: {ak: '', udid: ''}, status: [{av: '', udid: '', sid: ''}]};
}, 500);
</script>
... ...