Authored by yyq

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

... ... @@ -3,6 +3,7 @@ import config from 'config';
import {
sign
} from './utils';
import { Toast } from 'cube-ui';
axios.defaults.baseURL = config.axiosBaseUrl;
axios.defaults.responseType = config.axiosResponseType;
... ... @@ -10,10 +11,23 @@ axios.defaults.headers = {
'X-Requested-With': 'XMLHttpRequest'
};
axios.interceptors.response.use(function(response) {
if (response.data.code === 9999991 || response.data.code === 9999992) {
Toast.$create({
type: 'warn',
mask: true,
txt: response.data.message
});
}
return response;
}, function(error) {
return Promise.reject(error);
});
const errHandle = (error, store) => {
console.log(error);
if (error.response && error.response.status == 401) {
if (error.response && error.response.status === 401) {
store.dispatch('setNeedLogin', { needLogin: true });
}
... ... @@ -28,7 +42,7 @@ const request = (options, store) => {
return axios(options).then((res) => {
return res.data;
}, error => {
return errHandle(error, store)
return errHandle(error, store);
});
};
... ...
... ... @@ -87,11 +87,9 @@ export default {
<style lang="scss">
.layout {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
font-size: 24px;
display: flex;
... ... @@ -109,4 +107,6 @@ export default {
overflow: scroll;
}
}
</style>
... ...
... ... @@ -30,7 +30,7 @@
</a>
</li>
<li>
<img :src="pageData.bottom">
<div class="bottom-space"></div>
</li>
</ul>
</div>
... ... @@ -888,6 +888,12 @@ export default {
width: 100%;
float: left;
}
.bottom-space {
width: 100%;
height: 80px;
display: block;
}
}
.tab-container {
... ...
... ... @@ -14,11 +14,18 @@
</div>
<img :src="item.image" alt=""/>
</li>
<li>
<img :src="images.rule">
</li>
<li>
<a href="javascript:void(0)" class="button-more" @click="gotoProductPool">
<img :src="images.more">
</a>
</li>
</ul>
</LayoutApp>
</template>
<script>
import productData from './saleProduct.json';
... ... @@ -26,8 +33,9 @@ export default {
name: 'Strategy',
data() {
return {
productList: []
}
productList: [],
images: {}
};
},
methods: {
goBack() {
... ... @@ -42,10 +50,23 @@ export default {
productId: linkItem.linkId
}
});
},
gotoProductPool() {
this.$router.push({
name: 'List',
query: {
productPool: 445
}
});
}
},
mounted() {
activated() {
this.productList = productData.imageList;
this.images = {
rule: productData.imageList[0].rule,
more: productData.imageList[0].more
};
console.log(this.productList)
}
};
</script>
... ... @@ -56,6 +77,11 @@ ul {
list-style: none;
margin: 0;
padding: 0;
background-image: url("//ad.yoho.cn/html5/2019/10/activity/007/base/repeat_bg.jpg?imageslim");
background-repeat: repeat-y;
background-size: 100% auto;
overflow: hidden;
-webkit-overflow-scrolling: touch;
li {
position: relative;
... ... @@ -83,6 +109,13 @@ ul {
background-color: transparent;
}
}
.button-more {
display: block;
width: 530px;
height: 45px;
margin: 20px auto 60px auto;
}
}
}
</style>
... ...
{
"imageList": [
{
"image": "//cdn.yoho.cn/saleList/bg/1p_01.jpg?imageView2/2/w/750/format/jpg",
"image": "//cdn.yoho.cn/saleList/bg/1p_02.jpg?imageView2/2/w/750/format/jpg",
"rule": "//ad.yoho.cn/html5/2019/10/activity/007/base/list_rule.png",
"more": "//ad.yoho.cn/html5/2019/10/activity/007/base/btn_more.png",
"urls": [
{
"left": "2rem",
... ...
... ... @@ -127,7 +127,7 @@ export default {
this.$store.dispatch('reportYas', {
params: {
appop: 'XY_UFO_SHOW_EVENT',
param: reportParams
param: {DATA:reportParams}
}
});
... ...
... ... @@ -59,6 +59,7 @@ export default {
PAGE_URL: '',
listYasParams: {},
homeYasParams: [],
guessLikeId: 0,
listScrollY: 0,
options: {
pullUpLoad: true,
... ... @@ -80,7 +81,7 @@ export default {
isFetching: false,
error: null,
page: 0, // 当前页
page_size: 10, // 每页数量
page_size: 20, // 每页数量
page_total: 0, // 总共多少页
total: 0, // 总共多少条
endReached: false, // 到达底部
... ... @@ -162,6 +163,13 @@ export default {
appop: 'XY_UFO_MAIN_START'
}
});
// 初始化 选中类目
const [firstNav] = this.navList;
if(firstNav) {
const {url = ''} = firstNav;
this.selectedCategory = queryString.parse(url);
}
this.refreshProductList(this.active);
},
methods: {
... ... @@ -238,11 +246,26 @@ export default {
// console.log(this.homeYasParams)
this.$store.dispatch('reportYas', {
params: {
param: this.homeYasParams,
param: {DATA:this.homeYasParams},
appop: 'XY_UFO_SHOW_EVENT'
}
});
},
reportTabYas() {
let guessLikeTabParams = this.listYasParams;
delete guessLikeTabParams.I_INDEX;
// 防止重复上报
if(this.guessLikeId !== guessLikeTabParams.TAB_ID) {
this.guessLikeId = guessLikeTabParams.TAB_ID
console.log('guesslisttab',guessLikeTabParams)
this.$store.dispatch('reportYas', {
params: {
param: guessLikeTabParams,
appop: 'XY_UFO_MAIN_EVENT'
}
});
}
},
async guessLikeListParams(params) {
if (params && typeof params === 'object' && Object.keys(params).length) {
this.listYasParams = Object.assign({}, {
... ... @@ -259,8 +282,9 @@ export default {
this.selectedCategory = params;
this.active = Number(index);
this.isShow && this.$refs.scroll.scrollTo(this.navTop);
// this.setYasParam({index, ...params});
await this.guessLikeListParams({index, ...params});
// tab点击
this.reportTabYas()
// 商品列表曝光
this.productList.list.length > 0 && this.listScrollY > 0 && this.$refs.product && this.$refs.product.yasShowEvent(this.yasHeight);
},
... ... @@ -294,7 +318,6 @@ export default {
await this.fetchList(this.searchParams);
// 列表上报数据
// this.setYasParam({index: 0, ...this.searchParams});
this.guessLikeListParams({index: 0, ...this.searchParams});
},
... ...
... ... @@ -102,4 +102,14 @@ export default {
width: 100%;
background-color: white;
}
@supports (bottom: env(safe-area-inset-bottom)) {
.content {
height: calc(env(safe-area-inset-bottom) + 100% + 88px);
}
.footer {
height: calc(env(safe-area-inset-bottom) + 100px);
}
}
</style>
... ...
... ... @@ -10,7 +10,7 @@
import { createNamespacedHelpers } from 'vuex';
const {mapState, mapActions} = createNamespacedHelpers('home/bindAccount');
export default {
export default {
name: 'bind',
props: {
data: {
... ...
<template>
<LayoutApp title="闲鱼潮玩转攻略" :show-back="true" :back-action="goBack">
<ul>
<li v-for="(item, index) in dataList" :key="index">
<div v-if="item.urls && item.urls.length > 0" class="link-container">
<a href="javascript:;"
v-for="linkItem in item.urls"
:key="linkItem.link"
:style="{left: linkItem.left, top: linkItem.top, width: linkItem.width, height: linkItem.height}"
@click="jumpTo"
:data-item="JSON.stringify(linkItem)"
>
</a>
</div>
<img :src="item.image" alt=""/>
</li>
</ul>
<div class="body-warpper">
<ul>
<li v-for="(item, index) in dataList" :key="index">
<div v-if="item.urls && item.urls.length > 0" class="link-container">
<a href="javascript:;"
v-for="linkItem in item.urls"
:key="linkItem.link"
:style="{left: linkItem.left, top: linkItem.top, width: linkItem.width, height: linkItem.height}"
@click="jumpTo"
:data-item="JSON.stringify(linkItem)"
>
</a>
</div>
<img :src="item.image" alt=""/>
</li>
</ul>
</div>
</LayoutApp>
</template>
... ... @@ -57,6 +61,15 @@ export default {
</script>
<style lang="scss" scoped>
.body-warpper {
position: relative;
width: 100%;
height: 100%;
overflow-x: hidden;
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
}
ul {
width: 100%;
list-style: none;
... ...
<template>
<LayoutApp :title="currentTitle" :show-back="true" :back-action="goBack">
<ul>
<li v-for="(item, index) in currentList" :key="index">
<img :src="item.image" alt=""/>
</li>
</ul>
<div class="body-warpper">
<ul>
<li v-for="(item, index) in currentList" :key="index">
<img :src="item.image" alt=""/>
</li>
</ul>
</div>
</LayoutApp>
</template>
... ... @@ -54,6 +56,15 @@ export default {
</script>
<style lang="scss" scoped>
.body-warpper {
position: relative;
width: 100%;
height: 100%;
overflow-x: hidden;
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
}
ul {
width: 100%;
list-style: none;
... ...
... ... @@ -78,7 +78,7 @@ export default {
},
searchGoods: function() {
this.addLocalWord();
this.yasInput({type: 0, index: 0});
this.yasInput({type: 0, index: 0, query: this.query});
this.$router.push({
name: 'List',
query: {
... ... @@ -94,6 +94,7 @@ export default {
let query = parameters.query;
this.addLocalWord(query);
param.query = query;
this.yasInput(param);
this.$router.push({
name: 'List',
... ... @@ -136,10 +137,10 @@ export default {
params: {
param: {
SEARCH_POS: this.SEARCH_POS,
KEYWORD: this.query,
KEYWORD: param.query,
POS_ID: param.type,
TYPE_ID: 1,
FLR_INDEX: param.index + 1,
FLR_INDEX: param.type ? param.index + 1 : 0,
},
appop: 'XY_UFO_HOME_KEYWORD_SEARCH_C'
}
... ...
... ... @@ -21,8 +21,10 @@
class="actions"
:order="order"
@on-action="
action =>
onInSaleOrderAction({ action, order, isInSale: true })
action => {
onInSaleOrderAction({ action, order, isInSale: true });
onAction({ action, order, isInSale: true });
}
"
/>
</div>
... ... @@ -51,6 +53,7 @@ import OrderActions from "../components/order-actions";
import CountDown from "../components/count-down";
import orderInSaleActionMixin from "../mixin/order-in-sale-action";
import orderActionMixin from "../mixin/order-action";
const IN_SALE_STORE_PATH = "order/inSaleOrderList";
... ... @@ -65,7 +68,7 @@ const {
export default {
// 订单操作
mixins: [orderInSaleActionMixin],
mixins: [orderInSaleActionMixin, orderActionMixin],
data() {
return {
scrollY: 0
... ...
... ... @@ -526,6 +526,8 @@ textarea {
html,
body {
width: 100%;
height: 100%;
font-size: 24px;
font-family: "PingFang SC", "HiraginoSansGB-W3", "SanFranciscoText-Regular", Helvetica, Roboto, "Heiti SC", "黑体", Arial;
line-height: 1.4;
... ... @@ -537,6 +539,24 @@ body {
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
#app {
position: relative;
width: 100%;
height: 100%;
}
/* 支持iphoneX下方安全区域 */
@supports (bottom: env(safe-area-inset-bottom)) {
body {
margin-bottom: env(safe-area-inset-bottom);
}
#app {
height: calc(100% + env(safe-area-inset-bottom));
}
}
/* stylelint-disable */
... ...
... ... @@ -12,7 +12,7 @@ const isTest = process.env.NODE_ENV === 'test3';
const domains = {
// api: 'http://api.yoho.cn/',
// service: 'http://service.yoho.cn/',
// ufo: 'http://2.yobobuy.cn',
// ufo: 'http://2.yohobuy.com',
// liveApi: 'http://testapi.live.yohops.com:9999/',
// singleApi: 'http://api-test3.yohops.com:9999/',
... ...
... ... @@ -168,9 +168,25 @@ const login = {
},
taobaoCallback(req, res, next) {
passport.authenticate('taobao', (err, user) => {
let redirectUrl = loginPage;
let referUrl = {};
let refer;
if (req.cookies.ali_backurl) {
try {
referUrl = JSON.parse(req.cookies.ali_backurl);
} catch(e) {
log.debug(JSON.stringify(e));
}
refer = handleReferUrl(referUrl.b || '');
}
redirectUrl += '?nodownload=1&refer=' + encodeURIComponent(refer || homePage);
if (err || !user) {
log.error(`[authenticate error] source_type: taobao | err: ${JSON.stringify(err)}`);
return res.redirect(loginPage);
return res.redirect(redirectUrl);
}
const model = req.ctx(passportModel);
... ... @@ -180,19 +196,6 @@ const login = {
sourceType: 'taobao',
sourceTypeSecond: req.yoho.isAliApp ? 'xianyu' : ''
}).then(result => {
let redirectUrl = loginPage;
let referUrl = {};
if (req.cookies.ali_backurl) {
try {
referUrl = JSON.parse(req.cookies.ali_backurl);
} catch(e) {
log.debug(JSON.stringify(e));
}
redirectUrl += '?refer=' + encodeURIComponent(handleReferUrl(referUrl.b || ''));
}
if (result.code === 200) {
if (_.get(result, 'data.is_bind') === 'N') {
redirectUrl = referUrl.b ? referUrl.b : homePage;
... ...
... ... @@ -5,7 +5,7 @@
<title>{{title}}</title>
<meta name="keywords" content="">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, viewport-fit=cover">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="telephone=no" name="format-detection">
... ...
... ... @@ -5,7 +5,7 @@
<title>{{title}} {{#unless noYohoTitle}}{{yohoTitle}}{{/unless}}</title>
<meta name="keywords" content="{{keywords}}">
<meta name="description" content="{{description}}">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no,viewport-fit=cover">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta content="telephone=no" name="format-detection">
<meta content="email=no" name="format-detection">
... ...