Authored by Tao

add news tip

... ... @@ -10,8 +10,13 @@ axios.defaults.headers = {
'X-Requested-With': 'XMLHttpRequest'
};
const errHandle = (error) => {
const errHandle = (error, store) => {
console.log(error);
if (error.response && error.response.status == 401) {
store.dispatch('setNeedLogin', { needLogin: true });
}
return Promise.reject({
code: 500,
message: '服务器开小差了~'
... ... @@ -22,7 +27,9 @@ const request = (options, store) => {
return axios(options).then((res) => {
return res.data;
}, errHandle);
}, error => {
return errHandle(error, store)
});
};
export const createApi = (context, store) => {
... ... @@ -32,7 +39,7 @@ export const createApi = (context, store) => {
url,
params,
method: 'get',
}), options, store);
}, options), store);
},
post(url, data, options) {
return request(Object.assign({
... ...
... ... @@ -4,7 +4,7 @@
* 与原生 APP 交互的代码
*
*/
import queryString from 'query-string';
import queryString from 'querystring';
const xianyu = {
/**
... ...
... ... @@ -92,7 +92,8 @@ export default {
}
.close {
font-size: 32px;
font-size: 28px;
color: #999;
}
.pay-list-wrapper {
... ... @@ -165,7 +166,7 @@ export default {
.coupon-name {
font-size: 28px;
font-weight: bold;
color: #002b47;
color: #000;
margin-bottom: 10px;
}
... ...
... ... @@ -170,7 +170,7 @@
}
})();
window.appBaseLogs = {events: [{}]};
window.appBaseLogs = {events: [{}], device: {ak: '', udid: ''}, status: [{av: '', udid: '', sid: ''}]};
</script>
</body>
</html>
... ...
<template>
<div class="father-img" v-if="isEmptyList && showGuide">
<div class="guide-image" @click="guideDismiss"></div>
</div>
<div v-else>
<LayoutApp title="选择地址" :show-back="true" :back-action="goBack">
<CubeScroll class="main-container" ref="scroll" :options="scrollOpts">
<div class="user-list">
... ... @@ -39,6 +43,7 @@
<div class="add-btn" :data-add="1" @click="toEditorPage">新增地址</div>
</CubeScroll>
</LayoutApp>
</div>
</template>
<script>
... ... @@ -67,11 +72,24 @@ export default {
},
pageName: '',
selectedAddressId: '',
query: {}
query: {},
isEmptyList: false,
showGuide: false
};
},
watch: {
addressList() {
if (this.addressList.length === 0) {
this.isEmptyList = true;
this.showGuide = true;
} else {
this.isEmptyList = false;
this.showGuide = false;
}
}
},
computed: {
...mapState(['addressList'])
...mapState(['addressList']),
},
methods: {
...mapMutations(['SET_USER_ADDRESS_INFO', 'STORE_UPDATE_ADDRESS_INFO']),
... ... @@ -83,7 +101,9 @@ export default {
goBack() {
this.$router.go(-1);
},
guideDismiss() {
this.showGuide = false;
},
toEditorPage(event) {
event.stopPropagation();
let isAdd = !!parseInt(event.currentTarget.dataset.add);
... ... @@ -150,6 +170,21 @@ export default {
}
}
.father-img {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
.guide-image {
width: 100%;
height: 100%;
background: url(~statics/image/address/guide_x@3x.png) no-repeat;
background-size: 100% 100%;
}
.user-list {
background-color: white;
... ...
<template>
<LayoutApp :title="title" :show-back="true">
<Scroll ref="scroll" :options="scrollOpts">
<div class="pane-body">
<FormItem>
<CInput
... ... @@ -47,9 +46,10 @@
</FormItem>
<!-- 订单修改地址隐藏 -->
<div v-if="!orderCode" class="wrapper-tag">
<p class="tag-text">设置标签:</p>
<p v-if="addressTags.length" class="tag-text">设置标签:</p>
<div class="radio-container">
<RadioGroup class="wrapper-radio">
<div v-for="(tag, index) in addressTags" :key="index">
<div class="radio-scroll" v-for="(tag, index) in addressTags" :key="index">
<Radio
class="tag-radio"
:label="{ text: `${tag.name}`, value: `${tag.code}` }"
... ... @@ -59,6 +59,7 @@
</div>
</RadioGroup>
</div>
</div>
<!-- 订单修改地址隐藏 -->
<div v-if="!orderCode" class="wrapper-del">
<Radio
... ... @@ -71,7 +72,7 @@
</div>
</div>
<div :class="submitClass" @touchend="onSubmit">确 认</div>
</Scroll>
<AddressAct
class="address-act"
ref="addressAct"
... ... @@ -110,9 +111,6 @@ export default {
},
data() {
return {
scrollOpts: {
bounce: false
},
isShowProvince: false,
isUpdate: false,
updateMobileNum: '',
... ... @@ -343,23 +341,6 @@ export default {
</script>
<style lang="scss" scoped>
/deep/ {
.cube-scroll-content {
min-height: 100%;
}
.cube-scroll-list-wrapper {
overflow: auto;
}
.cube-loading-spinners {
margin: auto;
}
}
.address-act {
z-index: 99;
}
.pane-body {
height: 100%;
... ... @@ -425,18 +406,34 @@ export default {
.wrapper-tag {
margin: 30px 0;
.wrapper-radio {
margin: 30px 0 20px;
}
.tag-text {
font-size: 36px;
display: inline-block;
font-weight: bold;
}
}
.radio-container {
width: 100%;
margin-top: 30px;
overflow-y: hidden;
overflow-x: scroll;
}
.wrapper-radio {
display: inline-block;
white-space: nowrap;
.radio-scroll {
display: inline-block;
overflow-y: hidden;
overflow-x: scroll;
flex-shrink: 0;
.tag-radio {
margin-right: 30px;
height: 100%;
}
}
}
... ...
... ... @@ -7,8 +7,8 @@
v-for="(item, index) in categoryParent"
:key="index"
:class="{'category-left-item-select-flag' : item.isSelect }"
:data-id="item"
@click="onClick(item)">
:data-id="item.id"
@click="onClick(item, index)">
<p
class="category-left-item-title"
:class="{'category-left-item-select' : item.isSelect }">
... ... @@ -50,6 +50,7 @@
</LayoutApp>
</template>
<script>
import { Scroll } from 'cube-ui';
import { createNamespacedHelpers } from 'vuex';
import Vue from 'vue';
... ... @@ -61,6 +62,7 @@ export default {
name: 'category',
props: ['hideHeader'],
components: {
Scroll,
ImgSize,
CategoryTitle
},
... ... @@ -69,7 +71,7 @@ export default {
scrollEvents: ['scroll-end'],
sortItem:{
id:'-1',
name:'brand',
name:'品牌',
index: 0
}
};
... ... @@ -92,8 +94,6 @@ export default {
let reportParams = [];
this.categorySubList.forEach((item) => {
let subItemList = item.sub;
// console.log('item'+scrollY)
// console.log(item)
subItemList.forEach((val, index) => {
let eleTop = this.$refs.index[index].offsetTop;
let eleHeight = this.$refs.index[index].offsetHeight;
... ... @@ -106,13 +106,14 @@ export default {
// console.log("firstHeight:"+firstHeight+'==scrollHeight='+scrollHeight+"==eleTop=="+eleTop+"==lastViewHeight="+lastViewHeight);
if(firstHeight < eleTop && scrollHeight + scrollY > eleTop){
let reportItem = {
P_NAME: 'XY_UFOCategory',
CATE_ID: this.sortItem.id,
CATE_NM: this.sortItem.name,
CATE_INDEX: this.sortItem.index,
CATE_INDEX: this.sortItem.index + 1,
F_ID: item.id,
F_NAME: item.name,
F_INDEX: item.index,
I_INDEX: index,
F_INDEX: item.index + 1,
I_INDEX: index + 1,
TO_TYPE: val.linkType,
TO_ID: val.link,
};
... ... @@ -130,16 +131,16 @@ export default {
});
},
onClick(item) {
async onClick(item,index) {
if (!item.isSelect) {
this.sortItem = item;
let id = item.id;
let name = item.name;
let subList ;
if (id === '-1') {
subList = this.fetchBrandList({ id });
subList = await this.fetchBrandList({ id });
} else {
subList = this.fetchCategorySubList({ id, name });
subList = await this.fetchCategorySubList({ id, name });
}
this.$store.dispatch('reportYas', {
... ... @@ -147,7 +148,8 @@ export default {
appop: 'XY_UFO_CATEGORY_TAB_LIST',
param: {
CATE_ID: id,
CATE_NM: item.name
CATE_NM: item.name,
CATE_INDEX: index + 1
}
}
});
... ... @@ -161,11 +163,11 @@ export default {
param: {
CATE_ID: this.sortItem.id,
CATE_NM: this.sortItem.name,
CATE_INDEX: this.sortItem.index,
CATE_INDEX: this.sortItem.index + 1,
F_ID: itemSub.id,
F_NAME: itemSub.name,
F_INDEX: itemSub.index,
I_INDEX: index,
F_INDEX: itemSub.index + 1,
I_INDEX: index + 1,
TO_TYPE: item.linkType,
TO_ID: item.link,
}
... ...
... ... @@ -38,7 +38,7 @@
import { get, find } from 'lodash';
import { Style, Scroll, Sticky } from 'cube-ui';
import { createNamespacedHelpers } from 'vuex';
import queryString from 'query-string';
import queryString from 'querystring';
import Swiper from './components/swiper';
import Banner from './components/banner';
import TwoBanner from './components/twoBanner';
... ... @@ -61,8 +61,8 @@ export default {
options: {
pullUpLoad: true,
},
scrollEvents: ['scroll','scroll-end'],
title:'闲鱼潮',
scrollEvents: ['scroll', 'scroll-end'],
title: '闲鱼潮',
scrollY: 0,
navTop: 0,
navHeight: 0,
... ... @@ -113,7 +113,7 @@ export default {
noItemStyle() {
return {
height: this.total + 'px'
}
};
}
},
watch: {
... ... @@ -136,6 +136,7 @@ export default {
this.getAllInboxCatInfo();
this.PAGE_URL = window.location.href;
// 首页进入上报
this.$store.dispatch('reportYas', {
params: {
... ... @@ -158,9 +159,10 @@ export default {
this.navTop = this.$refs.topSource.offsetHeight;
this.navHeight = get(this.$refs, 'scrollNav.offsetHeight') || 0;
this.total = this.$refs.scroll.$el.offsetHeight - this.navHeight;
this.reportYas()
this.reportYas();
});
},
// 曝光上报
getReportEle(scrollY) {
this.homeYasParams = [];
... ... @@ -169,42 +171,57 @@ export default {
let eleHeight = 0;
let eleTop = 0;
let reportParams = {};
if(item.template_name !== 'guessLike') {
if (item.template_name !== 'guessLike') {
eleHeight = this.$refs[index][0].$el.offsetHeight;
eleTop = this.$refs[index][0].$el.offsetTop;
} else {
eleHeight = this.navHeight;
eleTop = this.navTop;
}
if(scrollY) { // 滚动时
if(scrollHeight + scrollY > eleTop && item.template_name === 'guessLike') {
if (scrollY) { // 滚动时
if (scrollHeight + scrollY > eleTop && item.template_name === 'guessLike') {
// console.log('guessLike report')
item.data.forEach((val, i) => {
reportParams = {...val.reportParams,PAGE_URL: this.PAGE_URL}
this.homeYasParams.push(reportParams)
})
reportParams = {...val.reportParams, PAGE_URL: this.PAGE_URL};
this.homeYasParams.push(reportParams);
});
}
if(scrollY < (eleTop + eleHeight) && item.template_name !== 'guessLike') {
if (scrollY < (eleTop + eleHeight) && item.template_name !== 'guessLike') {
// console.log(item.template_name)
let reportMoreParams = {};
item.data.forEach((val, i) => {
reportParams = {...val.reportParams,PAGE_URL: this.PAGE_URL}
this.homeYasParams.push(reportParams)
})
reportParams = {...val.reportParams, PAGE_URL: this.PAGE_URL};
this.homeYasParams.push(reportParams);
if (item.template_name === 'image_list') {
reportMoreParams = Object.assign({}, reportParams, {I_INDEX: 0});
}
});
Object.keys(reportMoreParams).length && this.homeYasParams.push(reportMoreParams);
}
} else { // 默认进入时
if(eleTop < scrollHeight) { // 获取每个元素距顶部高度 小于可视区高度即曝光
if (eleTop < scrollHeight) { // 获取每个元素距顶部高度 小于可视区高度即曝光
// console.log(item.template_name)
let reportMoreParams = {};
item.data.forEach((val, i) => {
reportParams = {...val.reportParams,PAGE_URL: this.PAGE_URL}
this.homeYasParams.push(reportParams)
})
reportParams = {...val.reportParams, PAGE_URL: this.PAGE_URL};
this.homeYasParams.push(reportParams);
if (item.template_name === 'image_list') {
reportMoreParams = Object.assign({}, reportParams, {I_INDEX: 0});
}
});
Object.keys(reportMoreParams).length && this.homeYasParams.push(reportMoreParams);
}
}
})
});
},
reportYas(scrollY) {
this.getReportEle(scrollY)
this.getReportEle(scrollY);
// console.log(this.homeYasParams)
this.$store.dispatch('reportYas', {
params: {
... ... @@ -214,11 +231,12 @@ export default {
});
},
setYasParam: function(params) {
console.log('setYas')
console.log('setYas');
let {total, list} = this.productList;
if (params && typeof params === 'object' && Object.keys(params).length) {
let P_NAME = 'XY_UFOSearchList', TYPE_ID = 1, P_PARAM = '', PRD_LIST = [];
for (let item of list) {
PRD_LIST.push(item.id);
}
... ... @@ -226,44 +244,46 @@ export default {
if (key === 'brand') {
P_NAME = 'XY_UFOBrandList';
TYPE_ID = 3;
P_PARAM = params[key]
P_PARAM = params[key];
}
if (key === 'series') {
P_NAME = 'XY_UFOSeriesList';
TYPE_ID = 2;
P_PARAM = params[key]
P_PARAM = params[key];
}
if (key === 'productPool') {
P_NAME = 'XY_UFOProductPoolList';
TYPE_ID = 4;
P_PARAM = params[key]
P_PARAM = params[key];
}
}
this.listYasParams = Object.assign({},{
this.listYasParams = Object.assign({}, {
P_NAME,
P_PARAM,
TYPE_ID,
TAB_ID: Number(params.index) + 1,
TAB_NAME: params.title,
PRD_LIST: PRD_LIST.toString(),
TOTAL: total})
TOTAL: total});
// console.log(this.listYasParams)
}
},
getIndex({index,params}) {
getIndex({index, params}) {
this.selectedCategory = params;
this.active = Number(index);
this.isShow && this.$refs.scroll.scrollTo(this.navTop);
this.setYasParam({index,...params});
this.setYasParam({index, ...params});
},
scrollEndHandler({y}) {
let scrollHeight = Math.abs(y)
this.$refs.product && this.$refs.product.yasShowEvent(scrollHeight+this.navTop);
if(scrollHeight === this.navTop) {
return
let scrollHeight = Math.abs(y);
this.$refs.product && this.$refs.product.yasShowEvent(scrollHeight + this.navTop);
if (scrollHeight >= this.navTop) {
return;
}
this.reportYas(scrollHeight)
this.reportYas(scrollHeight);
},
scrollHandler({ y }) {
this.scrollY = -y;
... ... @@ -271,9 +291,11 @@ export default {
if (this.navTop) {
if (this.scrollY >= this.navTop) {
this.isShow = true;
// this.isA = false;
} else {
this.isShow = false;
// this.isA = true;
}
}
... ... @@ -283,8 +305,9 @@ export default {
this.searchParams = Object.assign({}, queryString.parse(str), this.listBaseParams);
await this.fetchList(this.searchParams);
// 列表上报数据
this.setYasParam({index: 0, ...this.searchParams})
this.setYasParam({index: 0, ...this.searchParams});
},
async onPullingUp() {
... ... @@ -324,7 +347,7 @@ export default {
delete searchParams[key];
}
}
try{
try {
let result = await this.fetchProductList({
...searchParams,
page,
... ... @@ -347,15 +370,14 @@ export default {
list[key] = data[key];
}
}
if(!Object.keys(data).includes('product_list')) {
list.list = []
}
this.productList = list;
}
}catch(e) {
} catch (e) {
// console.log(e);
if (this.productList.page <= 1) {
this.productList.list = [];
}
}
},
goSearch() {
... ...
... ... @@ -46,6 +46,15 @@ export default {
goMore() {
this.$router.push({ path: 'category' });
let reportMoreParams = {...this.list[0].reportParams, PAGE_URL: this.PAGE_URL}
reportMoreParams.I_INDEX = 0
console.log(reportMoreParams)
this.$store.dispatch('reportYas', {
params: {
appop: 'XY_UFO_MAIN_EVENT',
param:reportMoreParams
}
});
}
}
};
... ...
... ... @@ -11,7 +11,7 @@
<script>
import { Style, ScrollNavBar } from 'cube-ui';
import queryString from 'query-string';
import queryString from 'querystring';
export default {
name: 'slide',
... ...
<template>
<LayoutApp :show-back="true" :title="title" class="favorite-wrapper">
<Scroll
<LayoutScroll
ref="scrolllist"
:scroll-events="['scroll-end', 'scroll']"
@scroll-end="fetchList(isMore)"
@pulling-up="fetchList(isMore)"
v-if="favoriteProductList.list.length"
class="fav-scroll-bg"
>
<ProductList :list="favoriteProductList.list"></ProductList>
</Scroll>
</LayoutScroll>
<!-- <empty-list v-show="!isShowEmpty" /> -->
<UfoNoItem class="empty" :tip="`暂无数据`" v-else></UfoNoItem>
</LayoutApp>
... ... @@ -124,6 +124,7 @@ export default {
.fav-scroll-bg {
background-color: #f5f5f5;
flex: 1;
}
</style>
... ...
... ... @@ -23,6 +23,12 @@ export default {
},
methods: {
onClick(index) {
this.$store.dispatch('reportYas', {
params: {
param: {TAB_ID: index + 1 },
appop: 'XY_UFO_MAIN_TAB'
}
});
switch (index) {
case 0: {
this.go('ChannelPage');
... ...
... ... @@ -2,7 +2,7 @@
<div class="tab-item" :class="itemClass" @click="goPage(data)">
<i v-if="icon" class="tab-icon" :class=icon></i>
<div v-if="data.title" class="title" :class="titleClass">{{ data.title }}</div>
<slot><div class="text">{{ data.num }}</div></slot>
<slot><div class="text" :style="numStyle">{{ data.num }}</div></slot>
<i class="cubeic-arrow"></i>
</div>
</template>
... ... @@ -42,6 +42,10 @@ export default {
icon: {
type: String,
default: ''
},
numStyle: {
type: String,
default: ''
}
},
data() {
... ...
... ... @@ -14,7 +14,7 @@
<order></order>
</div>
<div v-else-if="key === 'sale'" class="bg-top">
<tab-item :data="value" noLine titleBold titleSmall></tab-item>
<tab-item :data="value" noLine titleBold titleSmall numStyle='color: #999; fontSize: 12px'></tab-item>
</div>
<bind v-else-if="key === 'bindAccount'" :data="value"></bind>
<tab-item v-else :data="value"></tab-item>
... ...
... ... @@ -6,7 +6,7 @@
:loading="loadingOptions"
@pulling-up="onPullingUp">
<div class="news-content">
<Title :title="title"></Title>
<!-- <Title :title="title"></Title> -->
<List v-if="newsList.list && newsList.list.length > 0" :list="newsList.list || []"></List>
<UfoNoItem v-else :tip="`暂无数据`" style="margin-top: 60px"></UfoNoItem>
</div>
... ...
... ... @@ -71,6 +71,7 @@ export default {
.income-num {
color: #000;
margin-left: 20px;
@include num
}
}
</style>
... ...
... ... @@ -42,7 +42,7 @@
.assets-record-middle-view {
display: flex;
flex-direction: column;
margin-left: 20px;
// margin-left: 20px;
}
.assets-record-right-view {
display: flex;
... ... @@ -73,6 +73,7 @@
}
.assets-record-income-txt {
font-weight: bold;
@include num;
font-size: 28px;
color: #000;
}
... ...
... ... @@ -78,6 +78,7 @@ export default {
}
.account-name {
color: #000;
font-weight: bold;
}
}
... ...
... ... @@ -88,7 +88,7 @@ export default {
let DATA = [];
list.map((value, i) => {
DATA.push({...this.yasParams, I_INDEX: i + index, PRD_ID: value.id});
DATA.push({...this.yasParams, I_INDEX: i + index + 1, PRD_ID: value.id});
});
this.$store.dispatch('reportYas', {
params: {
... ...
<template>
<div class="container" v-show="showType">
<div class="title">筛选
<!-- <div class="title">筛选
<div class="cancel" @click="back()">取消</div>
</div>
</div> -->
<div class="content-search">
<div class="item" v-if="filterData && filterData.length" v-for="(filter,row) in filterData">
<div class="item-title">{{filter.filterName}}</div>
... ... @@ -263,6 +263,7 @@ export default {
}
.content-search {
margin-top: 80px;
.item {
margin-bottom: 60px;
... ...
... ... @@ -238,6 +238,7 @@ export default {
this.yasTab();
},
goSearch() {
this.yasGoSearch();
this.$router.push({
name: 'Search',
});
... ... @@ -247,6 +248,7 @@ export default {
this.priceDesc ? 'desc-arrow' : 'asc-arrow';
},
goFilter() {
this.yasTab(true);
this.$refs.filtrate.show();
},
setYasParam: function({param, tab}) {
... ... @@ -285,6 +287,14 @@ export default {
this.yasParams.TAB_NAME = tab.name;
}
},
yasGoSearch() {
this.$store.dispatch('reportYas', {
params: {
param: {SEARCH_POS: 3},
appop: 'XY_UFO_SEARCH_CLICK'
}
});
},
yasShowPage() {
let {total, list} = this.productList;
let PRD_LIST = [];
... ... @@ -300,10 +310,16 @@ export default {
}
});
},
yasTab() {
yasTab(isFilter = false) {
let param = {...this.yasParams};
if (isFilter) {
param.TAB_ID = 4;
param.TAB_NAME = '筛选';
}
this.$store.dispatch('reportYas', {
params: {
param: {...this.yasParams},
param,
appop: 'XY_UFO_PRD_LIST_TAB_C'
}
});
... ...
... ... @@ -3,7 +3,7 @@
<form action="javascript:void(0)">
<div class="search-header middle">
<div class="search-img"></div>
<input class="search-input" type="search" v-model="query" placeholder="Search" @input="suggest" @focus="yasFocus"
<input class="search-input" type="search" v-model="query" placeholder="Search" @input="suggest"
@keyup.13="searchGoods"/>
<div class="search-clear" :class="query && 'search-clear-img'" @click="clear()"></div>
</div>
... ... @@ -11,7 +11,7 @@
<Scroll v-show="!query.length" :options="scrollOptions">
<div class="recent title middle" v-if="searchWord && searchWord.length">热门推荐</div>
<div class="content middle">
<div class="item" v-if="searchWord && searchWord.length" v-for="item of searchWord" @click="goSearch({query : item.search_word} ,2)">
<div class="item" v-if="searchWord && searchWord.length" v-for="(item, index) of searchWord" @click="goSearch({query : item.search_word} ,{type: 2, index})">
{{item.search_word}}
</div>
</div>
... ... @@ -20,12 +20,12 @@
<div class="search-clear search-clear-img" @click="clearLocalHistory()"></div>
</div>
<div class="content middle">
<div class="item" v-if="localHistory && localHistory.length" v-for="item of localHistory" @click="goSearch({query : item} ,1)">{{item}}
<div class="item" v-if="localHistory && localHistory.length" v-for="(item, index) of localHistory" @click="goSearch({query : item} ,{type: 1, index})">{{item}}
</div>
</div>
</Scroll>
<Scroll v-show="query.length" :options="scrollOptions" :data="searchSuggestList">
<div class="item-line middle" v-if="searchSuggestList.length" v-for="item of searchSuggestList" @click="goSearch({query : item.item} ,0)">
<div class="item-line middle" v-if="searchSuggestList.length" v-for="(item, index) of searchSuggestList" @click="goSearch({query : item.item} ,{type: 3, index})">
{{item.item}}
</div>
</Scroll>
... ... @@ -50,7 +50,8 @@ export default {
}
},
query: '',
localHistory: []
localHistory: [],
SEARCH_POS: 1
};
},
activated() {
... ... @@ -70,7 +71,7 @@ export default {
},
searchGoods: function() {
this.addLocalWord();
this.yasInput(0);
this.yasInput({type: 0, index: 0});
this.$router.push({
name: 'List',
query: {
... ... @@ -82,10 +83,10 @@ export default {
suggest: function() {
this.fetchSearchSuggest(this.query);
},
goSearch: function(parameters, type) {
goSearch: function(parameters, param) {
let query = parameters.query;
this.yasInput(type);
this.yasInput(param);
this.$router.push({
name: 'List',
query: {
... ... @@ -106,6 +107,11 @@ export default {
}
this.localHistory = localHistory;
},
beforeRouteEnter: function(to, from, next) {
if (from.name !== 'List') {
this.SEARCH_POS = 3;
}
},
addLocalWord: function() {
if (this.query) {
let localHistory = localStorage.getItem('@YohoUFOStore:searchHistory');
... ... @@ -121,23 +127,15 @@ export default {
}
}
},
yasFocus() {
this.$store.dispatch('reportYas', {
params: {
param: {SEARCH_POS: 3},
appop: 'XY_UFO_SEARCH_CLICK'
}
});
},
yasInput: function(type) {
yasInput: function(param) {
this.$store.dispatch('reportYas', {
params: {
param: {
SEARCH_POS: 3,
SEARCH_POS: this.SEARCH_POS,
KEYWORD: this.query,
POS_ID: type,
TYPE_ID: type,
FLR_INDEX: type,
POS_ID: param.type,
TYPE_ID: 1,
FLR_INDEX: param.index + 1,
},
appop: 'XY_UFO_HOME_KEYWORD_SEARCH_C'
}
... ...
... ... @@ -60,7 +60,7 @@
<div class="space"></div>
<order-address :data="addressInfo"></order-address>
<div class="space"></div>
<div class="line"></div>
<div class="space"></div>
<!--<day-choose :chooseDay="chooseDay" :options="dayOptions" :choose="BUYER_ASK_SET_CHOOSEDAY"></day-choose>-->
... ... @@ -160,6 +160,9 @@ export default {
activated() {
this.isActive = true;
if (this.inputPrice) {
this.computePrice();
}
},
deactivated() {
this.isActive = false;
... ... @@ -316,10 +319,18 @@ export default {
this.showBuyDialog();
return;
}
if (!this.addressInfo) {
this.$createToast({
time: 1000,
type: 'txt',
txt: '请选择地址',
}).show();
return;
}
this.buyerPrePublish({
price: this.inputPrice,
storage_id: this.storageId,
address_id: this.addressInfo.address_id
address_id: this.addressInfo ? this.addressInfo.address_id : ''
})
.then((res) => {
if (res && res.code == 200) {
... ... @@ -333,7 +344,7 @@ export default {
this.buyerPublish({
price: this.inputPrice,
storage_id: this.storageId,
address_id: this.addressInfo.address_id,
address_id: this.addressInfo ? this.addressInfo.address_id : '',
time_limit_id: this.chooseDayId
}).then((res) => {
if (res && res.code == 200) {
... ... @@ -351,7 +362,7 @@ export default {
this.buyerCompute({
price: this.inputPrice,
storage_id: this.storageId,
address_id: this.addressInfo.address_id || ''
address_id: this.addressInfo ? this.addressInfo.address_id || '' : ''
});
},
... ... @@ -442,6 +453,7 @@ export default {
display: flex;
justify-content: space-between;
flex-direction: row;
align-items: center;
}
.body {
... ... @@ -569,7 +581,7 @@ export default {
.wordText {
margin-left: 10*2px;
font-family: "DIN Alternate";
font-size: 20*2px;
font-size: 40px;
height: 100%;
line-height: 100%;
color: #000;
... ... @@ -577,6 +589,8 @@ export default {
background-color: transparent;
}
.sales {
display: flex;
flex-direction: row;
... ... @@ -702,4 +716,8 @@ export default {
.cube-input_active::after {
border-color: transparent !important;;
}
.cube-input-field::placeholder {
font-size: 14px;
}
</style>
... ...
... ... @@ -54,7 +54,7 @@ export default {
};
</script>
<style lang="scss">
<style lang="scss" scoped>
.modal-box {
font-size: 24px;
}
... ...
<template>
<div>
<layout-app :title="'\u200E'" class="buyer-order-detail-wrapper">
<scroll>
<div class="order-detail-wrapper">
<div class="content">
<!-- 状态信息 -->
... ... @@ -102,7 +102,7 @@
</div>
</div>
</div>
</scroll>
</layout-app>
<div v-if="actionList.length > 0" class="footer-wrapper">
<div v-if="statusDetail.status === 0">
<p class="real-pay-price">¥{{ priceInfo.realPayPrice }}</p>
... ... @@ -116,7 +116,7 @@
"
/>
</div>
</layout-app>
</div>
</template>
<script>
... ... @@ -133,7 +133,6 @@ import OrderActions from "../components/order-actions";
import VideoPlayer from "../order-list/components/video-player";
import orderActionMixin from "../mixin/order-action";
import { Scroll } from "cube-ui";
const STORE_PATH = "order/orderDetail";
... ... @@ -150,8 +149,7 @@ export default {
OrderActions,
DetailHeader,
DetailFooter,
VideoPlayer,
Scroll
VideoPlayer
},
activated() {
this.copyBtn = new Clipboard(this.$refs.copy, {
... ... @@ -225,7 +223,7 @@ export default {
// footer高度120px
padding: 0 40px 120px 40px;
flex: 1 0 0;
overflow: hidden;
// overflow: hidden;
font-size: 24px;
.video-img {
... ... @@ -306,7 +304,7 @@ export default {
.pay-price {
color: #d0021b;
@include num
@include num;
}
}
... ...
<template>
<div>
<layout-app :title="'\u200E'" class="seller-order-detail-wrapper">
<scroll>
<div class="order-detail-wrapper">
<div class="content">
<!-- 状态信息 -->
... ... @@ -73,8 +73,7 @@
</div>
</div>
</div>
</scroll>
</layout-app>
<div v-if="actionList.length > 0" class="footer-wrapper">
<div v-if="statusDetail.status === 0">
<p class="earnest-price">{{ orderDetail.earnestMoneyStr }}</p>
... ... @@ -95,7 +94,7 @@
"
/>
</div>
</layout-app>
</div>
</template>
<script>
... ... @@ -114,7 +113,6 @@ import orderActionMixin from "../mixin/order-action";
import orderInSaleActionMixin from "../mixin/order-in-sale-action";
import PlatformFeeInfo from "../components/platform-fee-info";
import { Scroll } from "cube-ui";
const STORE_PATH = "order/orderDetail";
... ... @@ -130,8 +128,7 @@ export default {
Button,
DetailHeader,
DetailFooter,
OrderActions,
Scroll
OrderActions
},
asyncData({ store, router }) {
return store.dispatch(`${STORE_PATH}/fetchOrderDetail`, router.params);
... ... @@ -230,7 +227,7 @@ export default {
// footer高度120px
padding: 0 40px 120px 40px;
flex: 1 0 0;
overflow: hidden;
// overflow: hidden;
font-size: 24px;
.item-wrapper {
... ...
... ... @@ -3,7 +3,12 @@
:title="$route.params.owner === 'sell' ? '我的出售' : '我的购买订单'"
class="list-page"
>
<status-nav class="order-status-nav" :status="status" :owner="owner" @select="onStatusChange"/>
<status-nav
class="order-status-nav"
:status="status"
:owner="owner"
@select="onStatusChange"
/>
<div class="content-wrapper">
<LayoutScroll
@scroll="scrollHandler"
... ... @@ -15,11 +20,11 @@
>
<ul class="list-wrapper">
<li v-for="order in viewOrderList" :key="order.orderCode">
<order-item-header :order="order"/>
<order-item :order="order"/>
<order-item-header :order="order" />
<order-item :order="order" />
<!-- 订单操作 -->
<div class="footer-wrapper">
<count-down :leftTime="order.leftTime"/>
<count-down :leftTime="order.leftTime" />
<order-actions
class="actions"
pageName="list"
... ... @@ -54,23 +59,23 @@
</template>
<script>
import { createNamespacedHelpers } from 'vuex';
import { createNamespacedHelpers } from "vuex";
import OrderItem from './components/order-item';
import StatusNav from './components/status-nav';
import OrderItemHeader from './components/order-item-header';
import VideoPlayer from './components/video-player';
import OrderItem from "./components/order-item";
import StatusNav from "./components/status-nav";
import OrderItemHeader from "./components/order-item-header";
import VideoPlayer from "./components/video-player";
import EmptyList from 'components//ufo-no-item';
import EmptyList from "components//ufo-no-item";
import OrderActions from '../components/order-actions';
import CountDown from '../components/count-down';
import OrderActions from "../components/order-actions";
import CountDown from "../components/count-down";
import orderActionMixin from '../mixin/order-action';
import orderInSaleActionMixin from '../mixin/order-in-sale-action';
import { orderStatusKey, getOrderStatus } from 'constants/order-constants';
import orderActionMixin from "../mixin/order-action";
import orderInSaleActionMixin from "../mixin/order-in-sale-action";
import { orderStatusKey, getOrderStatus } from "constants/order-constants";
const STORE_PATH = 'order/orderList';
const STORE_PATH = "order/orderList";
const { mapActions, mapState, mapMutations } = createNamespacedHelpers(
STORE_PATH
... ... @@ -91,14 +96,14 @@ export default {
data() {
return {
scrollY: 0
}
};
},
props: {
owner: String,
status: Number
},
computed: {
...mapState(['orderListByType']),
...mapState(["orderListByType"]),
orderStatus() {
return this.orderListByType[orderStatusKey(this.owner, this.status)];
},
... ... @@ -113,7 +118,7 @@ export default {
}
},
activated() {
if (this.yoho.direction === 'back') {
if (this.$yoho.direction === "back") {
this.scrollY && this.$refs.scroll.scrollTo(this.scrollY);
}
},
... ... @@ -128,9 +133,9 @@ export default {
return store.dispatch(`${STORE_PATH}/fetchOrderList`, { owner, status });
},
methods: {
...mapActions(['fetchOrderList', 'confirmReceipt']),
...mapMutations(['resetData']),
scrollHandler({y}) {
...mapActions(["fetchOrderList", "confirmReceipt"]),
...mapMutations(["resetData"]),
scrollHandler({ y }) {
this.scrollY = -y;
},
fetchData() {
... ...
... ... @@ -9,7 +9,20 @@ export default {
[Types.FETCH_ADDRESS_TAGS](state, {
list
}) {
state.addressTags = list;
const tagList = list;
// 对重复标签去重
var result = [];
var obj = {};
for (var i = 0; i < tagList.length; i++) {
if (!obj[tagList[i].code]) {
result.push(tagList[i]);
obj[tagList[i].code] = true;
}
}
state.addressTags = result;
},
[Types.FETCH_ADDRESS_PROVINCES](state, {
list
... ...
import {get} from 'lodash';
import Vue from 'vue';
import queryString from 'querystring';
function getJumpUrl(qs = {}) {
return `//m.yohobuy.com/?${queryString.stringify(qs)}`;
}
export default function() {
return {
... ... @@ -39,17 +44,13 @@ export default function() {
if(item.linkType === 'h5'){
item.isShow = true;
item.url = item.link;
}else {
let hostUrl ='http://m.yohobuy.com/';
let params = new URLSearchParams();
params.append('pagename', 'productList');
params.append('title', item.name);
params.append(`${item.linkType}`, item.link);
} else {
item.isShow = false;
let url = `${hostUrl}?${params}`
item.url = url
item.url = getJumpUrl({
pagename: 'productList',
title: item.name,
[item.linkType]: item.link
});
}
})
... ... @@ -58,16 +59,6 @@ export default function() {
state.categorySubList = data.category;
}
},
getUrl(item){
let hostUrl ='http://m.yohobuy.com/';
let params = new URLSearchParams();
params.append('pagename', 'productList');
params.append('title', item.name);
params.append(`${item.linkType}`, item.link);
return `${hostUrl}?${params}`
},
addBrandList(state, {data}){
if(data && data.brand_list){
let sub = [];
... ... @@ -75,15 +66,8 @@ export default function() {
data.brand_list.forEach((val, index) => {
val.isSelect = false;
let hostUrl ='http://m.yohobuy.com/';
let params = new URLSearchParams();
params.append('pagename', 'productList');
params.append('title', val.brand_name);
params.append('brand', val.id);
let isShowBottomBordor = (size - index) > 3;
let url = `${hostUrl}?${params}`
let right = index % 3 !== 2 ? '-right' : '';
let bottom = isShowBottomBordor ? '-bottom' : '';
let subItem = {
... ... @@ -92,7 +76,11 @@ export default function() {
image: val.brand_logo,
linkType: 'brand',
link: val.id,
url: url,
url: getJumpUrl({
pagename: 'productList',
title: val.brand_name,
brand: val.id,
}),
isShow: false,
}
... ...
... ... @@ -223,6 +223,9 @@ export default function(mergeState = {}) {
// pass
}
},
setNeedLogin({ commit }, { needLogin }) {
commit(Types.SET_NEED_LOGIN, { needLogin });
},
async getSysConfigQiugou({ commit, state }) {
// /ufo-gateway/?method=ufo.resource.getConfigTypeContent&code=bid_switch_h5
// {"alg":"SALT_MD5","code":200,"data":"1","md5":"c13a1ace2c5883be18643551bd17ebcd","message":"操作成功"}
... ...
... ... @@ -122,31 +122,7 @@
})();
}());
function isWeiXinAndIos() {
// window.navigator.userAgent属性包含了浏览器类型、版本、操作系统类型、浏览器引擎类型等信息,这个属性可以用来判断浏览器类型
var ua = '' + window.navigator.userAgent.toLowerCase()
// 通过正则表达式匹配ua中是否含有MicroMessenger字符串且是IOS系统
var isIos = /\(i[^;]+;( U;)? CPU.+Mac OS X/i.test(ua) // 是IOS系统
return isIos
}
(function() {
var myFunction
var isWXAndIos = isWeiXinAndIos()
if (isWXAndIos) { // 既是微信浏览器 又是ios============(因为查到只有在微信环境下,ios手机上才会出现input失去焦点的时候页面被顶起)
document.body.addEventListener('focusin', function() { // 软键盘弹起事件
clearTimeout(myFunction);
});
document.body.addEventListener('focusout', function() { // 软键盘关闭事件
clearTimeout(myFunction)
myFunction = setTimeout(function() {
window.scrollTo({top: 0, left: 0, behavior: 'smooth'})// 重点 =======当键盘收起的时候让页面回到原始位置
}, 200);
});
}
})();
window.appBaseLogs = {events: [{}]};
window.appBaseLogs = {events: [{}], device: {ak: '', udid: ''}, status: [{av: '', udid: '', sid: ''}]};
}, 500);
</script>
... ...
... ... @@ -57,7 +57,6 @@
"passport": "^0.4.0",
"passport-oauth": "^1.0.0",
"qiniu": "^7.2.1",
"query-string": "^6.8.3",
"request": "^2.88.0",
"request-promise": "^4.2.2",
"serve-favicon": "^2.5.0",
... ...