Authored by Tao

modify channel

... ... @@ -104,4 +104,9 @@ export default {
z-index: 2;
}
.cube-safe-area-pb {
border-top-left-radius: 25px;
border-top-right-radius: 25px;
}
</style>
... ...
... ... @@ -41,17 +41,9 @@ export default {
setTimeout(() => {
if (this.title) {
setTitle(this.title);
if (this.isAliApp) {
if (window.WindVane) {
setTimeout(() => {
this.$xianyu.setXianyuTitle({ title: this.title });
}, 1000);
} else {
this.$xianyu.setXianyuTitle({ title: this.title });
}
}
let title = this.title;
setTitle(title);
this.$xianyu.setXianyuTitle({ title });
}
}, 100);
... ...
... ... @@ -15,7 +15,7 @@ export default {
},
watch: {
'report': function(newVal) {
console.log(newVal);
// console.log(newVal);
}
},
// activated() {
... ...
... ... @@ -115,6 +115,17 @@ export default {
toast.hide();
this.onError(result);
});
//数据埋点
this.$store.dispatch('reportYas', {
params: {
appop: 'XY_UFO_SC_PAY',
param: {
ORD_NUM: this.orderCode,
PAY_TYPE: 1
},
},
});
},
onError(result) {
this.$emit('payError');
... ... @@ -123,11 +134,39 @@ export default {
time: 1500,
type: 'txt'
}).show();
//数据埋点
this.$store.dispatch('reportYas', {
params: {
appop: 'XY_UFO_SC_PAY_RES',
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: 'XY_UFO_SC_PAY',
param: {
ORD_NUM: this.orderCode,
PAY_TYPE: 1,
PAY_RES: 1,
ORDER_AMOUNT: this.price
},
},
});
this.$router.replace({
name: 'OrderPay',
query: {
... ...
... ... @@ -207,11 +207,12 @@ export default {
.category-left-item-select {
font-size: 44px;
color: #000000;
font-weight: bold;
}
.category-left-item-select-flag:before {
content: "";
width: 6px;
width: 4px;
height: 48px;
position: absolute;
left: 0;
... ... @@ -269,6 +270,7 @@ export default {
.item-title {
display: none;
font-family: SFProText-Regular;
}
&:after {
... ...
... ... @@ -7,6 +7,7 @@
ref="scroll"
:scroll-events="scrollEvents"
@scroll="scrollHandler"
@scroll-end="scrollEndHandler"
:options="options"
@pulling-up="onPullingUp"
:data="productList.list">
... ... @@ -17,10 +18,10 @@
<input class="search-input" type="search" disabled="true" placeholder="搜索商品名称或货号"/>
</div>
<template v-for="(item, index) in channelList.list">
<Swiper :list="item.data" :index="index" :key="index" v-if="item.template_name == 'threePicture'"/>
<Hot :list="item.data" :index="index" :key="index" v-if="item.template_name == 'image_list'"/>
<Banner :list="item.data" :index="index" :key="index" v-if="item.template_name == 'single_image'"/>
<TwoBanner :list="item.data" :key="index" v-if="item.template_name == 'twoPicture'"/>
<Swiper :list="item.data" :ref="index" :PAGE_URL="PAGE_URL" :key="index" v-if="item.template_name == 'threePicture'"/>
<Hot :list="item.data" :ref="index" :PAGE_URL="PAGE_URL" :key="index" v-if="item.template_name == 'image_list'"/>
<Banner :list="item.data" :ref="index" :PAGE_URL="PAGE_URL" :key="index" v-if="item.template_name == 'single_image'"/>
<TwoBanner :list="item.data" :ref="index" :PAGE_URL="PAGE_URL" :key="index" v-if="item.template_name == 'twoPicture'"/>
</template>
</div>
<div ref="scrollNav" class="scroll-nav-wrap" v-if="navList.length">
... ... @@ -56,7 +57,7 @@ export default {
props: ['hideHeader'],
data() {
return {
reportParams: {},
PAGE_URL: '',
options: {
pullUpLoad: true,
// pullDownRefresh: true,
... ... @@ -64,8 +65,8 @@ export default {
// txt: '刷新成功',
// }
},
scrollEvents: ['scroll','scroll-end'],
title:'闲鱼潮',
scrollEvents: ['scroll'],
scrollY: 0,
navTop: 0,
navHeight: 0,
... ... @@ -116,6 +117,7 @@ export default {
}
},
activated() {
this.PAGE_URL = window.location.href;
if (!this.channelList.list || !this.channelList.list.length) {
this.fetchChannelList();
}
... ... @@ -133,12 +135,63 @@ export default {
this.navHeight = get(this.$refs, 'scrollNav.offsetHeight') || 0;
this.total = this.$refs.scroll.$el.offsetHeight - this.navHeight;
this.refreshProductList(this.active);
this.getReportEle()
});
},
// 曝光上报
getReportEle(scrollY) {
this.channelList.list.map((item, index) => {
let scrollHeight = this.$refs.scroll.$el.offsetHeight; // 滚动区高度
let eleHeight = 0;
let eleTop = 0;
if(item.template_name !== 'guessLike') {
eleHeight = this.$refs[index][0].$el.offsetHeight;
eleTop = this.$refs[index][0].$el.offsetTop;
} else {
eleHeight = this.$refs.scrollNav.offsetHeight;
eleTop = this.$refs.scrollNav.offsetTop;
}
if(scrollY) { // 滚动时
if(scrollHeight + scrollY > eleTop && item.template_name === 'guessLike') {
// console.log('guessLike report')
item.data.forEach((val, i) => {
this.reportYas(val.reportParams)
})
}
if(scrollY < (eleTop + eleHeight) && item.template_name !== 'guessLike') {
// console.log(item.template_name)
item.data.forEach((val, i) => {
this.reportYas(val.reportParams)
})
}
} else { // 默认进入时
if(eleTop < scrollHeight) { // 获取每个元素距顶部高度 小于可视区高度即曝光
// console.log(item.template_name)
item.data.forEach((val, i) => {
this.reportYas(val.reportParams)
})
}
}
})
},
reportYas(reportParams) {
this.$store.dispatch('reportYas', {
params: {
param: {...reportParams, PAGE_URL: this.PAGE_URL },
appop: 'XY_UFO_SHOW_EVENT'
}
});
},
getIndex(index) {
this.active = Number(index);
this.$refs.scroll.scrollTo(0, -this.navTop, 300);
},
scrollEndHandler({y}) {
let scrollHeight = Math.abs(y)
this.getReportEle(scrollHeight)
},
scrollHandler({ y }) {
if (this.navTop) {
... ...
... ... @@ -2,7 +2,7 @@
<div class="banner" v-if="list.length > 0">
<ul>
<li v-for="(item, index) in list" :key="index">
<LayoutLink :href="item.url">
<LayoutLink :href="item.url" :report="{PAGE_URL, ...item.reportParams}">
<ImageFormat :data-secc="item.src" :lazy="false" :src="item.src" :alt="item.alt" :width="item.width || 750" :height="item.height || 160" />
</LayoutLink>
</li>
... ... @@ -18,6 +18,9 @@ export default {
type: Array,
default: true,
},
PAGE_URL: {
type: String,
}
},
methods: {
... ...
... ... @@ -2,7 +2,7 @@
<div class="hot" v-if="list.length > 0">
<ul>
<li v-for="(item, index) in list" :key="index">
<LayoutLink :href="item.url" class="img-link">
<LayoutLink :href="item.url" class="img-link" :report="{PAGE_URL, ...item.reportParams}">
<div class="hot-image">
<ImageFormat :lazy="false" class="item-imge" :src="item.src" :alt="item.alt" :width="100" :height="100"></ImageFormat>
</div>
... ... @@ -27,7 +27,9 @@ export default {
type: Array,
default: true,
},
PAGE_URL: {
type: String,
}
},
components: {
ImgSize,
... ...
<template>
<div class="swiper" v-if="list && list.length > 0">
<div class="swiper-item swiper-item-left">
<LayoutLink :href="list[0].url" class="img-link">
<LayoutLink :href="list[0].url" class="img-link" :report="{PAGE_URL, ...list[0].reportParams}">
<ImageFormat :lazy="false" class="item-imge" :src="list[0].src" :width="310" :height="402"></ImageFormat>
</LayoutLink>
</div>
<div class="swiper-item swiper-item-right">
<LayoutLink :href="list[1].url" class="img-link">
<LayoutLink :href="list[1].url" class="img-link" :report="{PAGE_URL, ...list[1].reportParams}">
<ImageFormat :lazy="false" class="item-imge" :src="list[1].src" :width="380" :height="196"></ImageFormat>
</LayoutLink>
<LayoutLink :href="list[2].url" class="img-link">
<LayoutLink :href="list[2].url" class="img-link" :report="{PAGE_URL, ...list[2].reportParams}">
<ImageFormat :lazy="false" class="item-imge" :src="list[2].src" :width="380" :height="196"></ImageFormat>
</LayoutLink>
</div>
... ... @@ -23,6 +23,17 @@ export default {
list: {
type: Array,
},
PAGE_URL: {
type: String,
}
},
data() {
return {
params: {},
}
},
mounted() {
console.log(this.list)
},
methods: {
... ...
... ... @@ -2,7 +2,7 @@
<div class="twoBanner" v-if="list.length > 0">
<ul>
<li v-for="(item, index) in list" :key="index">
<LayoutLink :href="item.url">
<LayoutLink :href="item.url" :report="{PAGE_URL, ...item.reportParams}">
<ImageFormat :lazy="false" :src="item.src" :alt="item.alt" :width="344" :height="160" />
</LayoutLink>
</li>
... ... @@ -18,7 +18,9 @@ export default {
type: Array,
default: [],
},
PAGE_URL: {
type: String,
}
},
methods: {
// jump(item) {
... ...
... ... @@ -35,7 +35,7 @@ export default {
.news-list {
.news-list-title {
margin-top: 60px;
font-size: 40px;
font-size: 32px;
font-weight: bold;
color: #000000;
}
... ...
... ... @@ -40,7 +40,7 @@ export default {
overflow: hidden;
margin-top: 60px;
background: #F2F2F2;
border-radius: 16px;
border-radius: 32px;
padding: 40px 0;
.tab-item {
width: 33%;
... ...
... ... @@ -92,7 +92,6 @@
import {Input, Button, Scroll} from 'cube-ui';
import OrderAddress from './components/confirm/address';
import DayChoose from './components/askorder/day-choose';
import OrderAgree from './components/confirm/agree';
import { createNamespacedHelpers } from 'vuex';
import {debounce, get} from 'lodash';
... ... @@ -102,11 +101,11 @@ const {mapState, mapActions, mapMutations, mapGetters} = createNamespacedHelpers
export default {
name: 'BuyerAskOrder',
components: {Button, Input, DayChoose, OrderAddress, OrderAgree},
props: ['lazy', 'storageId'],
component: {
components: {
Input,
OrderAddress,
OrderAgree,
Button,
'cube-scroll': Scroll,
},
... ... @@ -114,7 +113,7 @@ export default {
return {
inputPrice: '',
isAgreeTerms: false,
url: 'https://activity.yoho.cn/feature/6775.html?share_id=9481&title=%E9%97%B2%E9%B1%BC%E4%B9%B0%E5%AE%B6%E5%8D%8F%E8%AE%AE',
url: 'https://activity.yoho.cn/feature/6775.html?nodownload=1',
agreeDesc: '有货买家协议',
submitText: '提交',
options: {pullDownRefresh: false}
... ... @@ -312,8 +311,11 @@ export default {
publishProduct() {
this.buyerPublish({price: this.inputPrice, storage_id: this.storageId, address_id: this.addressInfo.address_id, time_limit_id: this.chooseDayId}).then(() => {
this.payOrder();
this.buyerPublish({price: this.inputPrice, storage_id: this.storageId, address_id: this.addressInfo.address_id, time_limit_id: this.chooseDayId}).then((res) => {
if (res && res.code == 200) {
this.payOrder();
}
});
},
... ...
... ... @@ -246,6 +246,21 @@ export default {
vm.onClose(result.data.orderCode);
},
}).show();
//数据埋点
this.$store.dispatch('reportYas', {
params: {
appop: 'XY_UFO_SC_ORD',
param: {
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({
... ...
<template>
<div class="coupon-wrapper" @click="onClick">
<div class="title">优惠券<span class="desc">{{data.desc}}</span></div>
<div><span class="red">{{data.coupon_amount_str}}</span><i class="iconfont iconright"></i></div>
<div><span class="red">{{data.coupon_amount_str}}</span><i class="iconfont iconright icon-right"></i></div>
</div>
</template>
... ... @@ -49,4 +49,8 @@ export default {
margin-right: 10px;
}
.icon-right {
color: #999;
}
</style>
... ...
<template>
<div class="coupon-wrapper" @click="onClick">
<div class="title">促销<span class="desc">{{data.title}}</span></div>
<div><span class="red">{{data.amount}}</span><i class="iconfont iconright"></i></div>
<div><span class="red">{{data.amount}}</span><i class="iconfont iconright icon-right"></i></div>
</div>
</template>
... ... @@ -49,4 +49,8 @@ export default {
margin-right: 10px;
}
.icon-right {
color: #999;
}
</style>
... ...
... ... @@ -401,7 +401,7 @@ export default {
.scan-btn {
font-size: 40px;
color: #444;
color: #002B47;
font-weight: 500;
margin-left: 10px;
}
... ...
... ... @@ -64,7 +64,7 @@ export default {
isAgreeTerms: false,
hiddenIcon: true,
agreeDesc: '有货卖家协议',
url: 'http://m.yohobuy.com/activity/student/detail/renzhen?openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"url\":\"https://activity.yoho.cn/feature/3187.html?title=卖家协议\"}}',
url: 'https://activity.yoho.cn/feature/6773.html?nodownload=1',
isEntry: false,
submitText: '提交',
options: {pullDownRefresh: false},
... ...
... ... @@ -107,8 +107,8 @@ export default {
.cube-action-sheet-panel {
background: #fff;
border-top-left-radius: 20px 24px;
border-top-right-radius: 20px 24px;
border-top-left-radius: 20px 20px;
border-top-right-radius: 20px 20px;
&:after {
content: "";
... ...
... ... @@ -170,6 +170,7 @@ export default {
return;
}
this.$emit('select', {
size_name: this.selectedSize.size_name,
productId: this.product.product_id,
storageId: this.selectedSize.storage_id,
skup: this.selectedSize.skup,
... ...
... ... @@ -319,6 +319,18 @@ export default {
},
async onSelectTradeProduct(tradeProduct) {
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,
... ... @@ -543,6 +555,7 @@ export default {
h2 {
font-size: 36px;
font-weight: bold;
line-height: 50px;
padding: 20px 0 0;
margin: 0 40px;
... ...
import Vue from 'vue';
import * as Types from './types';
const contentCode = 'f788335b57b67c1711f255648c744dab'; // f788335b57b67c1711f255648c744dab
export default function() {
return {
... ... @@ -20,14 +21,32 @@ export default function() {
},
mutations: {
[Types.FETCH_CHANNEL](state, { list }) {
state.channelList.list = list;
state.channelList.list.map(res => {
list.map((res, index) => {
// 增加曝光参数
let F_ID = res.template_id;
let F_NAME = res.template_name;
let F_INDEX = index + 1;
res.data.map((item, i) => {
let reportParams = {};
reportParams.P_NAME = 'XY_UFOHome';
reportParams.P_PARAM = contentCode;
reportParams.F_ID = F_ID;
reportParams.F_NAME = F_NAME;
reportParams.F_INDEX = F_INDEX;
reportParams.I_INDEX = i + 1;
reportParams.ACTION_URL = item.url;
item.reportParams = reportParams;
});
if (res.template_name === 'hotSeries') {
for (let i = 0; i < res.data.length; i++) {
state.channelList.scrollnavList.push(res.data[i].series_name);
}
}
});
state.channelList.list = list;
},
[Types.FETCH_PRODUCT](state, { productlist }) {
console.log(state.channelList.productlist);
... ... @@ -56,11 +75,12 @@ export default function() {
},
async fetchChannelList({ commit }) {
const result = await this.$api.get('/api/ufo/channel/channelList', {
content_code: 'f788335b57b67c1711f255648c744dab', // cfcd8de156d3edc26c84091804c43e23
content_code: contentCode
});
if (result.code === 200) {
commit(Types.FETCH_CHANNEL, { list: result.data });
return result.data;
return result.data;
}
}
},
... ...
... ... @@ -48,7 +48,7 @@ export default function() {
},
actions: {
async fetchNewsList({ commit, state }, obj) {
console.log(obj);
// console.log(obj);
let { isResetPage, limit, page, totalPage, type } = obj;
const result = await this.$api.post('/api/ufo/home/newsList', {
page, type: type || '', limit
... ...
... ... @@ -402,9 +402,11 @@ export default function() {
} else {
commit(BUYER_ASK_PUBLISH_FAILURE, result.message);
}
return result;
}, error => {
console.log(error);
commit(BUYER_ASK_PUBLISH_FAILURE, TIP);
return null;
});
}
}
... ...
... ... @@ -162,6 +162,7 @@ const render = (route) => {
}
const result = template({
title: context.title || '',
html,
styles,
scripts,
... ...