<template>
<div ref="layout" class="layout" @touchstart="webviewScrollStart" @touchmove="webviewScrollMove"
@touchend="webviewScrollEnd">
<div ref="layout" class="layout" @touchstart="webviewScrollStart" @touchmove="webviewScrollMove" @touchend="webviewScrollEnd">
<slot name="header">
<LayoutHeader v-if="!hideHeader"
class="layout-header"
:title="title"
:opacity="opacity"
:show-back="showBack"
:back-action="backAction"
<LayoutHeader
v-if="!hideHeader"
class="layout-header"
:title="title"
:opacity="opacity"
:show-back="showBack"
:back-action="backAction"
></LayoutHeader>
</slot>
... ... @@ -19,7 +19,7 @@
<script>
export default {
name: 'LayoutApp',
name: "LayoutApp",
props: {
title: String,
opacity: {
... ... @@ -41,6 +41,10 @@ export default {
backAction: {
type: Function,
default: null
},
isStop: {
type: Boolean,
default: false
}
},
data() {
... ... @@ -56,17 +60,14 @@ export default {
this.touchStartY = e.changedTouches[0].pageY;
},
webviewScrollMove(e) {
if (this.isTouchStart) {
if (this.isTouchStart && !this.isStop) {
let scrollTop = this.$refs.layout.scrollTop;
this.touchMoveY = e.changedTouches[0].pageY;
if (scrollTop <= 0 && this.touchMoveY > scrollTop) {
if (scrollTop <= 0 && this.touchMoveY > this.touchStartY) {
e.preventDefault();
}
this.message = 'scrollTop:' + scrollTop + 'touchmove:' + this.touchMoveY;
}
},
webviewScrollEnd() {
this.isTouchStart = false;
... ...
... ... @@ -42,7 +42,16 @@ export default {
setTimeout(() => {
if (this.title) {
setTitle(this.title);
this.$xianyu.setXianyuTitle({ title: this.title });
if (this.isAliApp) {
if (window.WindVane) {
setTimeout(() => {
this.$xianyu.setXianyuTitle({ title: this.title });
}, 1000);
} else {
this.$xianyu.setXianyuTitle({ title: this.title });
}
}
}
}, 100);
... ...
... ... @@ -18,6 +18,10 @@ export default {
console.log(newVal);
}
},
// activated() {
// console.log(this.report);
// console.log("this.report");
// },
methods: {
jumpTo() {
if (!this.href) {
... ...
... ... @@ -3,7 +3,7 @@
<div class="pay-type-wrapper">
<div class="header">
<div class="title">选择支付方式</div>
<span><i class="iconfont iconweibiao45133 close" @click="close"></i></span>
<div class="x-close" @click="close"></div>
</div>
<slot name="price">
<div class="price-info">
... ... @@ -187,6 +187,13 @@ export default {
color: #222;
}
.x-close {
width: 40px;
height: 40px;
background: url(~statics/image/order/x@3x.png) no-repeat;
background-size: cover;
}
.close {
font-size: 32px;
}
... ...
... ... @@ -101,9 +101,9 @@ export default {
}
.pay-list-item {
height: 180px;
height: 160px;
font-size: 28px;
margin: 20px 20px;
margin: 0 20px;
display: flex;
justify-content: space-between;
align-items: center;
... ... @@ -114,7 +114,7 @@ export default {
.check {
font-size: 48px;
margin-left: 40px;
margin-right: 40px;
margin-right: 20px;
}
.pay-info {
... ... @@ -159,19 +159,18 @@ export default {
.coupon-info {
flex: 1;
height: 60px;
padding-left: 20px;
}
.coupon-name {
font-size: 24px;
font-size: 28px;
font-weight: bold;
color: #002b47;
margin-bottom: 10px;
}
.coupon-time {
font-size: 22px;
font-size: 24px;
color: #999;
}
</style>
... ...
... ... @@ -21,22 +21,22 @@
<Scroll>
<div v-for="(itemSub, index) in categorySubList" :key="index">
<CategoryTitle>{{itemSub.name}}</CategoryTitle>
<div class="category-sub-root">
<div class="category-sub-root" :class="'sub-type-' + itemSub.type">
<div class="item-div"
v-for="(item, index) in itemSub.sub"
:key="index"
:data-id="item.id"
>
<div class="item-imge-div" @click="goProductList(item)">
<ImgSize
class="item-imge"
:src="item.image"
:width="60"
:height="60"
/>
</div>
<p class="item-title">{{item.name}}</p>
<LayoutLink v-if="item.isShow" class="item-a-div" :href="item.link"></LayoutLink>
:data-id="item.id">
<LayoutLink :href="item.url">
<div class="item-imge-div" @click="goProductList(item,index, itemSub)">
<ImgSize
class="item-imge"
:src="item.image"
:width="144"
:height="144"
/>
</div>
<p class="item-title">{{item.name}}</p>
</LayoutLink>
</div>
</div>
</div>
... ... @@ -64,38 +64,92 @@ export default {
CategoryTitle
},
data() {
return {};
return {
sortItem:{
id:'-1',
name:'brand',
}
};
},
mounted() {
this.fetchCategoryParentList();
this.fetchBrandList({});
let categorySubResult = this.fetchBrandList({});
// this.reportPaser(categorySubResult);
// console.log('categorySubList')
// console.log(...categorySubResult)
},
methods: {
...mapActions(['fetchCategoryParentList', 'selectCategoryParent', 'fetchBrandList', 'fetchCategorySubList']),
onClick(item) {
if (!item.isSelect) {
this.sortItem = item;
let id = item.id;
let name = item.name;
// console.log('onClick==item')
// console.log(item)
this.$store.dispatch('reportYas', {
params: {
appop: 'XY_UFO_CATEGORY_TAB_LIST',
param: {
CATE_ID: id,
CATE_NM: item.name
}
}
});
let subList ;
if (id === '-1') {
this.fetchBrandList({ id });
subList = this.fetchBrandList({ id });
} else {
this.fetchCategorySubList({ id });
subList = this.fetchCategorySubList({ id, name });
}
// this.reportPaser(subList);
}
},
goProductList(item) {
let query = {};
let key = item.linkType;
if(key){
query[key] = item.link;
goProductList(item, index, itemSub) {
this.$store.dispatch('reportYas', {
params: {
appop: 'XY_UFO_SORT_FLR_C',
param: {
CATE_ID: this.sortItem.id,
CATE_NM: this.sortItem.name,
CATE_INDEX: this.sortItem.index,
F_ID: itemSub.id,
F_NAME: itemSub.name,
F_INDEX: itemSub.index,
I_INDEX: index,
TO_TYPE: item.linkType,
TO_ID: item.link,
}
}
});
},
reportPaser(subList) {
console.log('reportPaser')
console.log(...subList);
if(subList && subList.length > 0){
let reportSub = [];
subList.forEach((val, index) => {
val.su
let reportItem = {
CATE_ID: this.sortItem.id || '',
CATE_NM: this.sortItem.name || '',
CATE_INDEX: this.sortItem.index || '',
F_ID: index,
F_NAME: val.name,
F_INDEX: index,
I_INDEX: index,
TO_TYPE: 'brand',
TO_ID: val.id,
}
reportSub.push(subItem);
});
}
query.title = item.name;
// console.log('===category=='+key);
this.$router.push({
name: 'List',
query,
});
}
},
computed: {
... ... @@ -194,8 +248,44 @@ export default {
position: relative;
}
.sub-type-brand {
padding-top: 40px;
.item-div {
padding: 15px;
border-bottom: 1px solid #eee;
border-right: 1px solid #eee;
box-sizing: border-box;
}
.item-div:nth-child(3n) {
border-right: 0;
}
.item-imge-div {
height: 110px;
overflow: hidden;
}
.item-title {
display: none;
}
&:after {
content: "";
width: 100%;
height: 2PX;
background-color: #fff;
position: relative;
top: -1PX;
}
}
.item-imge {
object-fit: contain;
max-width: 100%;
max-height: 100%;
}
.item-title {
... ...
... ... @@ -24,7 +24,7 @@ export default {
.center {
font-size: 28px;
line-height: 40px;
color: #aaa;
color: #999999;
position: relative;
&:before,
... ...
<template>
<LayoutApp class="yohoufo-channel-page" :show-back="true" :hide-header="hideHeader">
<LayoutApp class="yohoufo-channel-page" :show-back="true" :hide-header="hideHeader" :title="title">
<div class="fixed-nav scroll-nav-wrap" v-if="isShow && navList.length">
<ScrollNav :list="navList" :current="active" @transfer="getIndex"></ScrollNav>
</div>
... ... @@ -17,9 +17,9 @@
<input class="search-input" type="search" disabled="true" placeholder="搜索商品名称或货号"/>
</div>
<template v-for="(item, index) in channelList.list">
<Swiper :list="item" :index="index" :key="index" v-if="item.template_name == 'threePicture'"/>
<Hot :list="item.data" :key="index" v-if="item.template_name == 'image_list'"/>
<Banner :list="item.data" :key="index" v-if="item.template_name == 'single_image'"/>
<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'"/>
</template>
</div>
... ... @@ -64,6 +64,7 @@ export default {
// txt: '刷新成功',
// }
},
title:'闲鱼潮',
scrollEvents: ['scroll'],
scrollY: 0,
navTop: 0,
... ... @@ -139,6 +140,7 @@ export default {
this.$refs.scroll.scrollTo(0, -this.navTop, 300);
},
scrollHandler({ y }) {
if (this.navTop) {
let scrollY = -y;
... ...
... ... @@ -73,7 +73,8 @@ export default {
}
.cube-scroll-content {
display: block;
// https://blog.csdn.net/qq_24331363/article/details/88026777
// display: block;
}
.cube-scroll-nav-bar-item {
... ...
<template>
<div class="swiper" v-if="list.data && list.data.length > 0">
<div class="swiper" v-if="list && list.length > 0">
<div class="swiper-item swiper-item-left">
<LayoutLink :href="list.data[0].url" class="img-link" :report="{...params, I_INDEX: 1, F_URL: list.data[0].url}">
<ImageFormat :lazy="false" class="item-imge" :src="list.data[0].src" :width="310" :height="402"></ImageFormat>
<LayoutLink :href="list[0].url" class="img-link">
<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.data[1].url" class="img-link" :report="{...params, I_INDEX: 2, F_URL: list.data[1].url}">
<ImageFormat :lazy="false" class="item-imge" :src="list.data[1].src" :width="380" :height="196"></ImageFormat>
<LayoutLink :href="list[1].url" class="img-link">
<ImageFormat :lazy="false" class="item-imge" :src="list[1].src" :width="380" :height="196"></ImageFormat>
</LayoutLink>
<LayoutLink :href="list.data[2].url" class="img-link" :report="{...params, I_INDEX: 3, F_URL: list.data[2].url}">
<ImageFormat :lazy="false" class="item-imge" :src="list.data[2].src" :width="380" :height="196"></ImageFormat>
<LayoutLink :href="list[2].url" class="img-link">
<ImageFormat :lazy="false" class="item-imge" :src="list[2].src" :width="380" :height="196"></ImageFormat>
</LayoutLink>
</div>
</div>
... ... @@ -21,33 +21,8 @@ export default {
name: 'swiper',
props: {
list: {
type: Object,
type: Array,
},
index: {
type: Number,
}
},
data() {
return {
params: {},
}
},
mounted() {
console.log(this.list)
},
activated() {
let { template_id, template_name } = this.list;
let PAGE_URL = window.location.href;
let F_INDEX = this.index + 1;
let params = {
P_NAME: 'XY_UFOHome',
P_PARAM: 'cfcd8de156d3edc26c84091804c43e23',
F_ID: template_id,
PAGE_URL,
F_INDEX,
F_NAME: template_name,
}
this.params = params;
},
methods: {
... ...
... ... @@ -29,7 +29,7 @@ export default {
},
data() {
return {
};
},
components: {
... ... @@ -48,6 +48,7 @@ export default {
.total-income {
color: #000;
font-size: 40px;
font-weight: bold;
margin-bottom: 44px;
}
.income {
... ...
... ... @@ -4,7 +4,7 @@
:key="index" :class="(index) % 2 === 0 && 'magrin-right'">
<div class="item-top">
<div class="item-price">
<span class="price-flag">{{product.available_now_price && '¥'}}</span><span>{{product.available_now_price || ' '}}</span>
<span class="price-flag">{{product[priceKey] && '¥'}}</span><span>{{product[priceKey] || ' '}}</span>
</div>
<div class="item-sales">{{product.sales && product.sales + '人付款'}}</div>
</div>
... ... @@ -21,7 +21,11 @@ import ImgSize from '../../../components/img-size';
export default {
props: {
list: Array,
param: Object,
yasParams: Object,
priceKey: {
type: String,
default: 'available_now_price',
},
},
data: function() {
return {
... ... @@ -30,7 +34,9 @@ export default {
},
methods: {
goDetail(product, index) {
this.yasDetail(product.id,index);
if (this.yasParams && Object.keys(this.yasParams).length) {
this.yasDetail(product.id, index);
}
this.$router.push({
name: 'ProductDetail',
params: {
... ... @@ -74,9 +80,8 @@ export default {
let DATA = [];
list.map((value, i) => {
DATA.push({...this.param, I_INDEX: i + index, PRD_ID: value.id});
DATA.push({...this.yasParams, I_INDEX: i + index, PRD_ID: value.id});
});
console.log(DATA)
this.$store.dispatch('reportYas', {
params: {
param: {DATA},
... ... @@ -95,11 +100,10 @@ export default {
// 5.TAB_NAME:tab切名称,人气,价格,新品;
// 6.I_INDEX:商品顺序号,从1开始递增;
// 7.PRD_ID:商品id
console.log({...this.param, I_INDEX: index, PRD_ID: id })
this.$store.dispatch('reportYas', {
params: {
param: {...this.param, I_INDEX: index, PRD_ID: id },
appop: 'XY_UFO_SHOW_EVENT'
param: {...this.yasParams, I_INDEX: index, PRD_ID: id },
appop: 'XY_UFO_PRD_LIST_C'
}
});
}
... ... @@ -119,8 +123,8 @@ export default {
.product-list-item {
border-radius: 16px;
width: 344px;
padding: 24px;
height: 498px;
padding: 24px 24px 32px;
// height: 498px;
background: #fff;
margin-bottom: 16px;
}
... ... @@ -129,7 +133,7 @@ export default {
height: 40px;
display: flex;
justify-content: space-between;
margin-bottom: 38px;
margin-bottom: 32px;
align-items: center;
}
... ... @@ -151,7 +155,6 @@ export default {
letter-spacing: 0;
line-height: 40px;
margin-top: 14px;
margin-bottom: 8px;
word-break: break-all;
display: -webkit-box;
-webkit-line-clamp: 2;
... ...
... ... @@ -45,6 +45,9 @@ import {Scroll} from 'cube-ui';
export default {
name: 'Filtrate',
components: {ImgSize, Scroll},
props: {
yasParams: Object,
},
data() {
return {
showType: false,
... ... @@ -130,9 +133,39 @@ export default {
params[row.filterId] = row.itemList[0].itemId;
}
});
let ENT_PARAMS = {}, ENT_ID = [], ENT_NAME = [];
for (let key in params) {
if (key === 'sort' && params[key]) {
ENT_PARAMS.category = params[key];
ENT_ID.push(params[key]);
ENT_NAME.push('品类');
}
if (key === 'brand' && params[key]) {
ENT_PARAMS.brand = params[key];
ENT_ID.push(params[key]);
ENT_NAME.push('品牌');
}
if (key === 'size' && params[key]) {
ENT_PARAMS.size = params[key];
ENT_ID.push(params[key]);
ENT_NAME.push('尺寸');
}
if (key === 'gender' && params[key]) {
ENT_PARAMS.sex = params[key];
ENT_ID.push(params[key]);
ENT_NAME.push('性别');
}
}
this.yasParams.ENT_PARAMS = JSON.stringify(ENT_PARAMS);
this.yasParams.ENT_ID = ENT_ID.toString();
this.yasParams.ENT_NAME = ENT_NAME.toString();
params.isReset = true;
this.yas(this.yasParams)
this.$parent.fetchList(params);
this.$parent.$refs.scroll.scrollTo(0, 0, 300)
this.$parent.$refs.scroll.scrollTo(0, 0, 300);
this.hide();
},
... ... @@ -178,6 +211,14 @@ export default {
},
hide() {
this.showType = false;
},
yas(param) {
this.$store.dispatch('reportYas', {
params: {
param,
appop: 'XY_UFO_PRD_LIST_SCREEN_C'
}
});
}
}
};
... ...
... ... @@ -24,12 +24,12 @@
:data="productList.list"
@scroll-end="scrollHandler"
@pulling-up="onPullingUp">
<ProductList ref="product" :list="productList.list" :param="yasParams"></ProductList>
<ProductList ref="product" :list="productList.list" :yasParams="yasParams"></ProductList>
</Scroll>
<EmptyList class="empty-wrapper product-list" :tip="`暂无数据`" v-show="productList.isEmpty">
</EmptyList>
</LayoutApp>
<Filtrate ref="filtrate"></Filtrate>
<Filtrate ref="filtrate" :yasParams="yasParams"></Filtrate>
</div>
</template>
<script>
... ... @@ -50,7 +50,7 @@ export default {
Filtrate,
EmptyList
},
data: function () {
data: function() {
return {
scrollOptions: {
bounce: {
... ... @@ -94,7 +94,7 @@ export default {
},
};
},
activated: function() {
activated: async function() {
if (this.yoho.direction === 'forword') {
this.$refs.filtrate.hide();
Object.assign(this.$data, this.$options.data());
... ... @@ -102,15 +102,16 @@ export default {
this.changeArrow();
let params = {...this.$route.query};
this.setYasParam({param: params, tab: {index: 1, name: '人气'}});
if (params.title) {
this.title = params.title;
delete params.title;
} else {
this.title = '商品列表';
}
this.setYasParam({param: params, tab: {index: 1, name: '人气'}});
!params.order && (params.order = 'sale_desc');
this.fetchList({...params, isReset: true});
await this.fetchList({...params, isReset: true});
this.yasShowPage();
},
computed: {
... ... @@ -186,7 +187,7 @@ export default {
},
// 点击tab flag, 0: 推荐, 1: 价格, 2: 人气, 3: 新品
pressType(flag) {
async pressType(flag) {
if (flag === this.selectedType && flag !== 1) {
return;
}
... ... @@ -214,9 +215,11 @@ export default {
params.order = 'st_desc';
}
params.isReset = true;
this.fetchList(params);
await this.fetchList(params);
this.$refs.scroll.scrollTo(0, 0, 300);
this.changeArrow();
this.yasShowPage();
this.yasTab();
},
goSearch() {
this.$router.push({
... ... @@ -232,7 +235,7 @@ export default {
},
setYasParam: function({param, tab}) {
if (param && typeof param === 'object' && Object.keys(param).length) {
let P_NAME = 'XY_UFOSearchList', TYPE_ID = 1;
let P_NAME = 'XY_UFOSearchList', TYPE_ID = 1, P_PARAM = [];
for (let key in param) {
if (key === 'brand' && param[key] && param.type !== 6) {
... ... @@ -250,22 +253,45 @@ export default {
if (!param[key]) {
delete param[key];
}
P_PARAM.push(param[key]);
}
Object.assign(this.yasParams, {
P_NAME,
P_PARAM: JSON.stringify(param),
P_PARAM: P_PARAM.toString(),
TYPE_ID,
TAB_ID: this.tabIndex || '',
TAB_NAME: this.tabName || ''
});
}
if(tab && typeof tab === 'object' && Object.keys(tab).length) {
if (tab && typeof tab === 'object' && Object.keys(tab).length) {
this.yasParams.TAB_ID = tab.index;
this.yasParams.TAB_NAME = tab.name;
}
},
yasShowPage() {
let {total, list} = this.productList;
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'
}
});
},
yasTab() {
this.$store.dispatch('reportYas', {
params: {
param: {...this.yasParams},
appop: 'XY_UFO_PRD_LIST_TAB_C'
}
});
}
}
};
</script>
... ...
... ... @@ -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"
<input class="search-input" type="search" v-model="query" placeholder="Search" @input="suggest" @focus="yasFocus"
@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})">
<div class="item" v-if="searchWord && searchWord.length" v-for="item of searchWord" @click="goSearch({query : item.search_word} ,2)">
{{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})">{{item}}
<div class="item" v-if="localHistory && localHistory.length" v-for="item of localHistory" @click="goSearch({query : item} ,1)">{{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})">
<div class="item-line middle" v-if="searchSuggestList.length" v-for="item of searchSuggestList" @click="goSearch({query : item.item} ,0)">
{{item.item}}
</div>
</Scroll>
... ... @@ -70,6 +70,7 @@ export default {
},
searchGoods: function() {
this.addLocalWord();
this.yasInput(0);
this.$router.push({
name: 'List',
query: {
... ... @@ -81,9 +82,10 @@ export default {
suggest: function() {
this.fetchSearchSuggest(this.query);
},
goSearch: function(parameters) {
goSearch: function(parameters, type) {
let query = parameters.query;
this.yasInput(type);
this.$router.push({
name: 'List',
query: {
... ... @@ -118,6 +120,28 @@ export default {
localStorage.setItem('@YohoUFOStore:searchHistory', this.query);
}
}
},
yasFocus() {
this.$store.dispatch('reportYas', {
params: {
param: {SEARCH_POS: 3},
appop: 'XY_UFO_SEARCH_CLICK'
}
});
},
yasInput: function(type) {
this.$store.dispatch('reportYas', {
params: {
param: {
SEARCH_POS: 3,
KEYWORD: this.query,
POS_ID: type,
TYPE_ID: type,
FLR_INDEX: type,
},
appop: 'XY_UFO_HOME_KEYWORD_SEARCH_C'
}
});
}
}
};
... ...
<!--买家求购确认页-->
<template>
<LayoutApp :show-back="true" title="出价求购">
<Scroll :options="options">
<cube-scroll :options="options">
<div class="body" ref="body">
<div class="topContainer">
... ... @@ -77,13 +77,14 @@
</div>
</div>
</cube-scroll>
<div class="bottomContainer">
<OrderAgree :value="isAgreeTerms" @input="isAgreeTerms = !isAgreeTerms" class="agree-wrapper" :desc="agreeDesc" :url="url"></OrderAgree>
<div class="btn-wrapper">
<YohoButton class="submit-btn" :txt="submitText" :disable="!isAgreeTerms" @click="submitClick"></YohoButton>
</div>
</div>
</Scroll>
</LayoutApp>
</template>
... ... @@ -107,7 +108,7 @@ export default {
Input,
OrderAddress,
Button,
Scroll,
'cube-scroll': Scroll,
},
data() {
return {
... ... @@ -300,7 +301,7 @@ export default {
},
submitClick: debounce(function() {
submitClick: debounce(function() {
this.buyerPrePublish({price: this.inputPrice, storage_id: this.storageId, address_id: this.addressInfo.address_id})
.then((res) => {
if (res && res.code == 200) {
... ... @@ -310,6 +311,7 @@ export default {
}, 500, {leading: false, trailing: true}),
publishProduct() {
this.buyerPublish({price: this.inputPrice, storage_id: this.storageId, address_id: this.addressInfo.address_id, time_limit_id: this.chooseDayId}).then(() => {
this.payOrder();
});
... ... @@ -326,11 +328,25 @@ export default {
payOrder() {
let vm = this;
this.$store.dispatch('reportYas', {
params: {
appop: 'UFO_WTBUY_ORD',
param: {
ORDER_NUM: get(this.publishresult, 'orderCode', ''),
PRD_STORAGEID: this.storageId,
PRD_SIZE: get(this.originProductData, 'sizeName', ''),
PRICE: this.inputPrice,
FORNT_AMOUNT: get(this.publishresult, 'depositAmount', '')
}
}
});
this.$createOrderPayType({
price: get(this.publishresult, 'depositAmount', ''),
desc: '定金',
orderCode: get(this.publishresult, 'orderCode', ''),
extra: JSON.stringify({
reportType: 'qiugou_buy',
type: 'buy',
back: {
name: 'ProductDetail',
... ... @@ -639,7 +655,9 @@ export default {
padding: 0 40px 40px;
background-color: white;
}
</style>
<style lang="scss">
.cube-picker-panel {
height: 273px;
text-align: center;
... ...
<template>
<LayoutApp :title="title">
<div class="order-page">
<LayoutApp ref="layout" :title="title" :isStop="isStopScrollPrevent">
<div class="order-page" @scroll="checkScroll">
<div class="product">
<ImgSize
class="pro-img"
... ... @@ -119,20 +119,20 @@
</template>
<script>
import LayoutApp from '../../../components/layout/layout-app';
import ScrollView from '../../../components/layout/scroll-view';
import ImgSize from '../../../components/img-size';
import { createNamespacedHelpers } from 'vuex';
import InputUfo from './components/input-ufo';
import { Checkbox } from 'cube-ui';
import { get } from 'lodash';
import Modal from './components/modal';
import OrderCheck from '../components/confirm/agree';
const { mapState, mapActions } = createNamespacedHelpers('order/priceChange');
import LayoutApp from "../../../components/layout/layout-app";
import ScrollView from "../../../components/layout/scroll-view";
import ImgSize from "../../../components/img-size";
import { createNamespacedHelpers } from "vuex";
import InputUfo from "./components/input-ufo";
import { Checkbox } from "cube-ui";
import { get } from "lodash";
import Modal from "./components/modal";
import OrderCheck from "../components/confirm/agree";
const { mapState, mapActions } = createNamespacedHelpers("order/priceChange");
// orderCode = 1233499619151
export default {
name: 'noEntryDetail',
name: "noEntryDetail",
components: {
OrderCheck,
Modal,
... ... @@ -144,35 +144,36 @@ export default {
},
data() {
return {
title: '调价',
title: "调价",
agreementURL:
'https://activity.yoho.cn/feature/3187.html?share_id=5851&title=ufo-%E5%8D%96%E5%AE%B6%E5%8D%8F%E8%AE%AE',
"https://activity.yoho.cn/feature/3187.html?share_id=5851&title=ufo-%E5%8D%96%E5%AE%B6%E5%8D%8F%E8%AE%AE",
platformFeeModalVisible: false,
platformFee: {
amount: '-¥0',
appraiseFee: '¥0.00',
packageFee: '¥0.00',
serviceFee: '¥0.00',
goodsPaymentRatePercent: '0.00%',
payChannelPercentage: '0.00%'
amount: "-¥0",
appraiseFee: "¥0.00",
packageFee: "¥0.00",
serviceFee: "¥0.00",
goodsPaymentRatePercent: "0.00%",
payChannelPercentage: "0.00%"
},
bankTransferFee: '-¥0',
income: '¥0',
errorTip: '',
chgPrice: '',
bankTransferFee: "-¥0",
income: "¥0",
errorTip: "",
chgPrice: "",
calced: false,
earnestMoney: '¥0',
earnestMoney: "¥0",
// 保证金
earnestPrice: 0,
isAgree: false,
labelOption: {
label: '我已阅读并同意'
label: "我已阅读并同意"
},
time: 15000
time: 15000,
isStopScrollPrevent: false // 是否停止layout阻止滚动事件
};
},
asyncData({ store, router }) {
return store.dispatch('order/priceChange/fetchOrder', {
return store.dispatch("order/priceChange/fetchOrder", {
orderCode: router.params.orderCode
});
},
... ... @@ -181,7 +182,7 @@ export default {
// this.inputChange = debounce(this.onChange.bind(this), 500);
},
computed: {
...mapState(['noEntryOrderInfo']),
...mapState(["noEntryOrderInfo"]),
goodsInfo() {
return this.noEntryOrderInfo.goodsInfo || {};
},
... ... @@ -193,37 +194,37 @@ export default {
chgPrice() {
this.calced = false;
this.platformFee = {
amount: '-¥0',
appraiseFee: '¥0.00',
packageFee: '¥0.00',
serviceFee: '¥0.00',
goodsPaymentRatePercent: '0.00%',
payChannelPercentage: '0.00%'
amount: "-¥0",
appraiseFee: "¥0.00",
packageFee: "¥0.00",
serviceFee: "¥0.00",
goodsPaymentRatePercent: "0.00%",
payChannelPercentage: "0.00%"
};
this.bankTransferFee = '-¥0';
this.income = '¥0';
this.earnestMoney = '¥0';
this.bankTransferFee = "-¥0";
this.income = "¥0";
this.earnestMoney = "¥0";
this.earnestPrice = 0;
}
},
methods: {
...mapActions([
'fetchOrder',
'postNoEntryCalcPrice',
'postNoEntryChangePrice'
"fetchOrder",
"postNoEntryCalcPrice",
"postNoEntryChangePrice"
]),
checkPrice(price) {
let valid = false;
if (!price) {
this.errorTip = '没有价格';
this.errorTip = "没有价格";
return false;
} else if (!/^\d+$/.test(price)) {
this.errorTip = '价格只能为正整数';
this.errorTip = "价格只能为正整数";
} else if (!/9$/.test(price)) {
this.errorTip = '出售价格必须以9结尾';
this.errorTip = "出售价格必须以9结尾";
} else {
this.errorTip = '';
this.errorTip = "";
valid = true;
}
console.log(this.errorTip, valid);
... ... @@ -233,15 +234,15 @@ export default {
// 点击提交按钮
if (this.isAgree && this.calced) {
this.$createDialog({
type: 'confirm',
content: '重新出售后本次出售保证金原路返回',
type: "confirm",
content: "重新出售后本次出售保证金原路返回",
confirmBtn: {
text: '我再想想',
text: "我再想想",
active: true,
disabled: false
},
cancelBtn: {
text: '重新出售',
text: "重新出售",
active: false,
disabled: false
},
... ... @@ -264,11 +265,11 @@ export default {
console.log(result);
if (result && result.code === 200) {
this.platformFee = get(result, 'data.platformFee', '');
this.bankTransferFee = get(result, 'data.bankTransferFee', '');
this.income = '¥' + get(result, 'data.income', '');
this.earnestMoney = '¥' + get(result, 'data.earnestMoney', '');
this.earnestPrice = get(result, 'data.earnestMoney', 0);
this.platformFee = get(result, "data.platformFee", "");
this.bankTransferFee = get(result, "data.bankTransferFee", "");
this.income = "¥" + get(result, "data.income", "");
this.earnestMoney = "¥" + get(result, "data.earnestMoney", "");
this.earnestPrice = get(result, "data.earnestMoney", 0);
this.calced = true;
} else {
if (result.message) {
... ... @@ -278,7 +279,7 @@ export default {
this.$createToast({
txt: this.errorTip,
type: 'txt'
type: "txt"
}).show();
}
},
... ... @@ -289,7 +290,7 @@ export default {
} else {
this.$createToast({
txt: this.errorTip,
type: 'txt'
type: "txt"
}).show();
}
},
... ... @@ -300,7 +301,7 @@ export default {
showEarnestQuestion() {
// 跳转保证金说明页
console.log('showEarnest');
console.log("showEarnest");
this.$xianyu.goXianyuNewPage({ url: this.agreementURL });
},
... ... @@ -322,14 +323,14 @@ export default {
this.$createOrderPayType({
orderCode: result.data.orderCode,
price: parseFloat(`${earnestPrice}`).toFixed(2),
desc: '保证金',
desc: "保证金",
extra: JSON.stringify({
type: 'sell',
type: "sell",
back: {
name: 'InSaleOrderList'
name: "InSaleOrderList"
},
forward: {
name: 'SellPayOk',
name: "SellPayOk",
query: {
orderCode: result.data.orderCode
}
... ... @@ -338,9 +339,9 @@ export default {
onCloseAction() {
that.clearData();
that.$router.replace({
name: 'sellOrderDetail',
name: "sellOrderDetail",
params: {
owner: 'sell',
owner: "sell",
code: result.data.orderCode
}
});
... ... @@ -348,8 +349,8 @@ export default {
}).show();
} else {
this.$createToast({
txt: result.message || '调价失败',
type: 'txt'
txt: result.message || "调价失败",
type: "txt"
}).show();
}
... ... @@ -360,20 +361,27 @@ export default {
// console.log(this.$router);
this.platformFeeModalVisible = false;
this.platformFee = {
amount: '-¥0',
appraiseFee: '¥0.00',
packageFee: '¥0.00',
serviceFee: '¥0.00',
goodsPaymentRatePercent: '0.00%',
payChannelPercentage: '0.00%'
amount: "-¥0",
appraiseFee: "¥0.00",
packageFee: "¥0.00",
serviceFee: "¥0.00",
goodsPaymentRatePercent: "0.00%",
payChannelPercentage: "0.00%"
};
this.bankTransferFee = '-¥0';
this.income = '¥0';
this.errorTip = '';
this.chgPrice = '';
this.bankTransferFee = "-¥0";
this.income = "¥0";
this.errorTip = "";
this.chgPrice = "";
this.calced = false;
this.earnestMoney = '¥0';
this.earnestMoney = "¥0";
this.isAgree = false;
},
checkScroll(e) {
if (e.currentTarget.scrollTop > 0) {
this.isStopScrollPrevent = true;
} else {
this.isStopScrollPrevent = false;
}
}
}
};
... ...
<!--卖家求购变现-->
<template>
<LayoutApp :show-back="true" title="变现">
<Scroll :options="options">
<cube-scroll :options="options">
<div class="body">
<!--<TitleComp txt="变现"></TitleComp>-->
... ... @@ -17,7 +17,7 @@
<AddressInfo :data="addressInfo" class="order-item"></AddressInfo>
</div>
</Scroll>
</cube-scroll>
<div class="footer">
<OrderAgree :value="isAgreeTerms" @input="isAgreeTerms = !isAgreeTerms" class="agree-wrapper" :desc="agreeDesc" :url="url"></OrderAgree>
<div class="btn-wrapper">
... ... @@ -29,7 +29,7 @@
</template>
<script>
import {Button} from 'cube-ui';
import {Button, Scroll} from 'cube-ui';
import ProductInfo from './components/confirm/product';
import InputPrice from './components/confirm/input-price';
import AddressInfo from './components/confirm/address';
... ... @@ -46,10 +46,7 @@ const { mapState, mapActions, mapMutations, mapGetters} = createNamespacedHelper
export default {
name: 'seller-ask-order',
props: {
skup: Number,
price: Number,
},
props: ['skup', 'price'],
components: {
Button,
ProductInfo,
... ... @@ -58,7 +55,8 @@ export default {
TitleComp,
OrderMargin,
OrderFee,
OrderAgree
OrderAgree,
'cube-scroll': Scroll,
},
data() {
... ...
<template>
<layout-app title="商品列表" class="brand-product-list">
<scroll-view
ref="scroll"
:data="brandProductList"
:options="scrollOption"
@pulling-down="onPullingDown">
<div class="list-wrapper" v-if="brandProductList != null">
<product-list :list="brandProductList" priceKey="price"/>
</div>
</scroll-view>
</layout-app>
</template>
<script>
import { createNamespacedHelpers } from 'vuex';
import ScrollView from 'components/layout/scroll-view';
import ProductList from '../list/components/productList';
const STORE_PATH = 'product';
const { mapActions, mapState } = createNamespacedHelpers(STORE_PATH);
export default {
name: 'BrandProductList',
props: ['productId'],
components: {
ProductList,
ScrollView,
},
data() {
return {
inLoading: false,
scrollOption: {
pullDownRefresh: {
threshold: 70,
stop: 90
},
observeDOM: false,
pullUpLoad: false,
},
};
},
computed: {
...mapState(['topLists']),
brandProductList() {
return this.topLists[this.$route.params.productId];
},
},
asyncData({store, router}) {
return store.dispatch(`${STORE_PATH}/fetchBrandTop`, {productId: router.params.productId});
},
methods: {
...mapActions(['fetchBrandTop']),
onPullingDown() {
this.fetchBrandTop({productId: this.productId});
},
},
};
</script>
<style lang="scss" scoped>
.brand-product-list /deep/ .scroll-view {
background: #f5f5f5;
}
</style>
... ...
... ... @@ -6,7 +6,7 @@
<cube-scroll ref="activityListScroll" :data="list">
<ul>
<li v-for="(item, idx) in list" :key="idx">
<div><span>{{item.promotionTypeStr}}</span> {{item.activityName}}</div>
<div class="activityName"><span>{{item.promotionTypeStr}}</span> {{item.activityName}}</div>
<div class="sub">{{item.startTimeStr}}-{{item.endTimeStr}}</div>
</li>
</ul>
... ... @@ -66,12 +66,12 @@ export default {
}
span {
font-size: 0.7em;
line-height: 1.4;
border: 1px solid #f00;;
color: #f00;
font-size: 22px;
line-height: 1.8;
border: 1px solid #feabac;
color: #D0021B;
text-align: center;
padding: 0 0.9em;
padding: 0 1.2em;
margin-right: 0.8em;
display: inline-block;
position: relative;
... ... @@ -89,9 +89,14 @@ export default {
border-bottom: 1px solid #ccc;
}
.activityName {
font-size: 28px;
font-weight: bold;
}
.sub {
color: #999;
font-size: 22px;
font-size: 24px;
}
}
</style>
... ...
... ... @@ -206,6 +206,7 @@ export default {
align-items: baseline;
font-size: 40px;
letter-spacing: 0;
font-family: $num-font;
span:nth-child(2) {
font-size: 0.8em;
... ...
... ... @@ -200,7 +200,7 @@ export default {
li {
box-sizing: border-box;
width: 25%;
width: 25%; // 当前固定为4列
float: left;
border: 1px solid #ddd;
margin-right: -1px;
... ... @@ -245,6 +245,7 @@ export default {
.size-info {
color: #000;
font-family: $num-font;
font-weight: bold;
font-size: 40px;
display: inline-block;
... ...
... ... @@ -225,6 +225,7 @@ export default {
i {
float: right;
color: #999;
}
}
... ... @@ -232,7 +233,8 @@ export default {
padding: 0 40px 16px;
}
.select-size, .select-type {
.select-size,
.select-type {
display: flex;
flex-direction: column;
height: 60vh;
... ... @@ -254,7 +256,6 @@ export default {
padding-top: 30px;
font-size: 32px;
color: #000;
font-family: "Alte DIN 1451 Mittelschrift";
}
}
}
... ... @@ -335,6 +336,10 @@ export default {
overflow: scroll;
}
.crash-info {
font-family: $num-font;
}
.footer {
padding: 16px 0;
display: flex;
... ... @@ -344,9 +349,9 @@ export default {
span {
font-size: 28px;
margin-left: 8px;
i {
font-family: "Alte DIN 1451 Mittelschrift";
font-size: 20px;
font-style: normal;
}
... ...
... ... @@ -5,12 +5,12 @@
<div @click="onAllClick">全部 <i class="cubeic-arrow"></i></div>
</div>
<div class="row">
<div class="col" v-for="(product, idx) in list" :key="idx">
<div class="product-item" @click="onItemClick(product)">
<div class="col" v-for="(product, idx) in viewList" :key="idx" @click="onItemClick(product)">
<div class="product-item">
<square-img :src="product.default_images" :width="300" :height="300" />
<div class="name"><span>{{product.product_name}}</span></div>
<div class="price"><i>¥</i>{{product.price}}</div>
</div>
<div class="name"><span>{{product.product_name}}</span></div>
<div class="price"><i>¥</i>{{product.price}}</div>
</div>
</div>
</div>
... ... @@ -30,6 +30,11 @@ export default {
default: [],
},
},
computed: {
viewList() {
return this.list && this.list.slice(0, 3) || [];
},
},
methods: {
onItemClick(item) {
this.$emit('itemClick', item);
... ... @@ -61,26 +66,30 @@ export default {
font-size: 36px;
font-weight: bold;
color: #000;
font-weight: bold;
}
.row {
overflow: hidden;
margin: 0 -8px;
margin: 0 -6px;
.col {
width: 33.3333%;
width: 222px;
padding: 0 8px;
float: left;
}
}
.product-item {
margin-top: 10px;
margin: 10px auto 0;
width: 180px;
text-align: center;
overflow: hidden;
}
.name {
width: 200px;
margin: 0 auto 8px;
height: 64px;
display: flex;
flex-direction: column;
... ... @@ -98,13 +107,15 @@ export default {
}
.price {
font-family: $num-font;
font-weight: bold;
font-size: 24px;
font-size: 32px;
color: #d0021b;
text-align: center;
i {
font-style: normal;
font-size: 0.9em;
font-size: 24px;
vertical-align: baseline;
}
}
... ...
... ... @@ -7,4 +7,9 @@ export default [{
productId: parseInt(params.productId, 10),
};
},
}, {
name: 'BrandProductList',
path: '/xianyu/brand-product/:productId.html',
component: () => import(/* webpackChunkName: "product" */ './brand-product-list'),
props: true,
}];
... ...
$primary-color : #08304b;
$sub-color : #64ad88;
$num-font: "DINAlternate-Bold", "din alternate", "PingFang SC", "HiraginoSansGB-W3", "SanFranciscoText-Regular", Helvetica, Roboto, "Heiti SC", "黑体", Arial;
@mixin cube-ufo-btn {
[type="button"] {
... ...
... ... @@ -19,8 +19,8 @@
<div class="info">
<div class="info-price">
<template v-if="productDetail.least_price >= 0"> ¥{{productDetail.least_price}}</template>
<template v-else>&nbsp;</template>
<template v-if="productDetail.least_price == null">{{'\u200E'}}</template>
<template v-else><i>¥</i>{{productDetail.least_price}}</template>
</div>
<div class="info-name">{{productDetail.product_name}}</div>
</div>
... ... @@ -48,22 +48,30 @@
<img class="ref-img" v-lazy="prdDetailImage" />
<div class="recommend" v-if="recommend"><h2>相关推荐</h2>
<product-list :list="recommend" />
<product-list :list="recommend" priceKey="price"/>
</div>
</cube-scroll>
</div>
<div class="footer">
<div class="heart">
<div class="icon-fav" v-if="isFav" @click="_toggleFav(false)">
<svg id="icon-heart" style="width: 1rem; height: 1rem;" viewBox="0 0 28 28">
<title>heart</title>
<path d="M14 26c-0.25 0-0.5-0.094-0.688-0.281l-9.75-9.406c-0.125-0.109-3.563-3.25-3.563-7 0-4.578 2.797-7.313 7.469-7.313 2.734 0 5.297 2.156 6.531 3.375 1.234-1.219 3.797-3.375 6.531-3.375 4.672 0 7.469 2.734 7.469 7.313 0 3.75-3.437 6.891-3.578 7.031l-9.734 9.375c-0.187 0.187-0.438 0.281-0.688 0.281z"></path>
<svg style="width: 1rem; height: 1rem;" viewBox="0 0 24 24">
<title>已收藏</title>
<g id="icon/已收藏" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g fill="#002B47">
<path d="M11.9998882,18.7717254 L6.90760779,20.9153484 C6.3574449,21.1469424 5.72370571,20.8886913 5.49211167,20.3385284 C5.42388696,20.1764573 5.39623656,20.0001874 5.41155922,19.8250107 L5.88943154,14.3617254 L5.88943154,14.3617254 L2.2755824,10.2271262 C1.88274872,9.77768578 1.92863753,9.09488771 2.37807795,8.70205402 C2.51228845,8.58474724 2.67342863,8.50245519 2.84714548,8.46250776 L8.22341829,7.22619542 L8.22341829,7.22619542 L11.0754231,2.5175655 C11.3846728,2.00699755 12.0492663,1.84379684 12.5598342,2.15304652 C12.708963,2.24337339 12.8340264,2.36843679 12.9243532,2.5175655 L15.7763581,7.22619542 L15.7763581,7.22619542 L21.1526309,8.46250776 C21.734369,8.59628261 22.097515,9.1763205 21.9637402,9.75805866 C21.9237928,9.93177551 21.8415007,10.0929157 21.7241939,10.2271262 L18.1103448,14.3617254 L18.1103448,14.3617254 L18.5882171,19.8250107 C18.6402311,20.4196615 18.200337,20.9438868 17.6056863,20.9959008 C17.4305096,21.0112235 17.2542397,20.9835731 17.0921686,20.9153484 L11.9998882,18.7717254 L11.9998882,18.7717254 Z"></path>
</g>
</g>
</svg>
</div>
<div class="icon-fav" v-else @click="_toggleFav(true)">
<svg id="icon-heart-o" style="width: 1rem; height: 1rem;" viewBox="0 0 28 28">
<title>heart-o</title>
<path d="M26 9.312c0-4.391-2.969-5.313-5.469-5.313-2.328 0-4.953 2.516-5.766 3.484-0.375 0.453-1.156 0.453-1.531 0-0.812-0.969-3.437-3.484-5.766-3.484-2.5 0-5.469 0.922-5.469 5.313 0 2.859 2.891 5.516 2.922 5.547l9.078 8.75 9.063-8.734c0.047-0.047 2.938-2.703 2.938-5.563zM28 9.312c0 3.75-3.437 6.891-3.578 7.031l-9.734 9.375c-0.187 0.187-0.438 0.281-0.688 0.281s-0.5-0.094-0.688-0.281l-9.75-9.406c-0.125-0.109-3.563-3.25-3.563-7 0-4.578 2.797-7.313 7.469-7.313 2.734 0 5.297 2.156 6.531 3.375 1.234-1.219 3.797-3.375 6.531-3.375 4.672 0 7.469 2.734 7.469 7.313z"></path>
<svg id="icon-heart-o" style="width: 1rem; height: 1rem;" viewBox="0 0 24 24">
<title>未收藏</title>
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g stroke="#B2B2B2" stroke-width="1.62123234">
<path d="M6.59310422,20.1682298 L11.9998882,17.892215 L17.4066721,20.1682298 C17.4471899,20.185286 17.4912574,20.1921986 17.5350516,20.188368 C17.6837143,20.1753645 17.7936878,20.0443081 17.7806843,19.8956454 L17.2727172,14.088301 L21.113856,9.69365996 C21.1431827,9.66010733 21.1637558,9.61982229 21.1737426,9.57639307 C21.2071863,9.43095853 21.1163998,9.28594906 20.9709653,9.25250535 L15.2606075,7.93936778 L12.2310044,2.93752506 C12.2084227,2.90024288 12.1771569,2.86897703 12.1398747,2.84639531 C12.0122327,2.76908289 11.8460843,2.80988307 11.7687719,2.93752506 L8.73916885,7.93936778 L3.02881107,9.25250535 C2.98538186,9.26249221 2.94509681,9.28306522 2.91154419,9.31239191 C2.79918408,9.41060033 2.78771188,9.58129985 2.8859203,9.69365996 L6.72705916,14.088301 L6.21909207,19.8956454 C6.21526141,19.9394396 6.22217401,19.9835071 6.23923019,20.0240249 C6.2971287,20.1615656 6.4555635,20.2261284 6.59310422,20.1682298 Z"></path>
</g>
</g>
</svg>
</div>
收藏
... ... @@ -193,7 +201,7 @@ export default {
next();
},
methods: {
...mapActions(['fetchProductInfo', 'fetchTop3', 'fetchFav', 'toggleFav', 'updateTradeInfo', 'getSelectedTradeProduct', 'payment', 'resetSelectedSize']),
...mapActions(['fetchProductInfo', 'fetchBrandTop', 'fetchFav', 'toggleFav', 'updateTradeInfo', 'getSelectedTradeProduct', 'payment', 'resetSelectedSize']),
refresh() {
this.$refs.slide.refresh();
},
... ... @@ -210,7 +218,7 @@ export default {
loadData(productId = this.productId, loading) {
loading && loading.show();
this.fetchTop3({productId});
this.fetchBrandTop({productId});
this.fetchFav({productId});
return this.fetchProductInfo({productId}).then(() => {
... ... @@ -265,23 +273,11 @@ export default {
});
},
gotoBrand() {
// type: 4,品牌;5,系列
const query = {
type: 5,
};
if (this.productDetail.seriesId && this.productDetail.series_name) {
query.series = this.productDetail.seriesId;
query.title = this.productDetail.series_name;
} else {
query.type = 4;
query.brand = this.productDetail.brandId;
query.title = this.productDetail.brand_name;
}
this.$router.push({
name: 'List',
query,
name: 'BrandProductList',
params: {
productId: this.productId,
},
});
},
showActivity() {
... ... @@ -407,6 +403,8 @@ export default {
}
.slide {
height: 520px;
.square-img-container {
display: block;
width: 520px;
... ... @@ -467,8 +465,8 @@ export default {
span {
display: inline-block;
border: 1px solid #f00;
color: #f00;
border: 1px solid #feabac;
color: #D0021B;
line-height: 1.8;
margin-right: 15px;
font-size: 0.8em;
... ... @@ -486,8 +484,10 @@ export default {
&-price {
color: #d0021b;
font-size: 48px;
font-family: $num-font;
font-weight: bold;
text-align: center;
letter-spacing: 0;
i {
font-style: normal;
... ... @@ -553,6 +553,7 @@ export default {
display: flex;
text-align: center;
padding: 16px 30px;
box-shadow: 0 0 4px rgba(0, 0, 0, 0.08);
@include cube-ufo-btn;
... ...
... ... @@ -15,12 +15,14 @@ export default function() {
name: '品牌',
image: '',
linkType: '',
index: 0,
isSelect: true,
}
state.categoryParent.push(brand);
if (data && data.length) {
data.forEach(val => {
data.forEach((val, index) => {
val.isSelect = false;
val.index = index + 1;
state.categoryParent.push(val);
});
}
... ... @@ -29,44 +31,78 @@ export default function() {
addCategorySubList(state, {data}) {
if(data && data.category){
let subList = [];
data.category.forEach(val => {
data.category.forEach((val, index) => {
if(val && val.sub){
val.index = index;
val.sub.forEach(item => {
if(item.linkType === 'h5'){
item.isShow = true;
item.url = item.link;
}else {
item.isShow = false;
let hostUrl ='http://m.yohobuy.com/';
let params = new URLSearchParams();
params.append('pagename', 'productList');
params.append('title', item.linkType);
params.append(`${item.linkType}`, item.link);
item.isShow = false;
let url = `${hostUrl}?${params}`
item.url = url
}
})
}
// console.log(val)
// subList.push(val);
});
state.categorySubList = data.category;
}
},
getUrl(item){
let hostUrl ='http://m.yohobuy.com/';
let params = new URLSearchParams();
params.append('pagename', 'productList');
params.append('title', item.linkType);
params.append(`${item.linkType}`, item.link);
return `${hostUrl}?${params}`
},
addBrandList(state, {data}){
if(data && data.brand_list){
let sub = [];
data.brand_list.forEach(val => {
let size = data.brand_list.length;
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 = {
id: val.id,
name: val.brand_name,
image: val.brand_logo,
type: 1,//表示 品牌
linkType: 'brand',
link: val.id,
url: url,
isShow: false,
}
sub.push(subItem);
});
let category = [{
id:'',
id: '0',
image:'',
type: 'brand',
linkType:'brand',
name:'全部品牌',
sub: sub,
... ... @@ -86,7 +122,7 @@ export default function() {
Vue.set(state.categoryParent, index, val);
});
}
}
}
},
actions: {
async fetchCategoryParentList({commit, state}) {
... ... @@ -102,9 +138,9 @@ export default function() {
if(id){
commit('updateCategoryParentList', {id: id});
}
const result = await this.$api.get('/api/ufo/category/search/brandList');
console.log(result);
if (result.code === 200) {
commit('addBrandList', {data: result.data});
... ... @@ -112,11 +148,12 @@ export default function() {
return result.data ? result.data.length : 0;
},
async fetchCategorySubList({commit, state},{id}) {
async fetchCategorySubList({commit, state},{id, name}) {
console.log(id+"===="+name)
commit('updateCategoryParentList', {id: id});
const result = await this.$api.get('/api/ufo/category/saleCategoryDetail',{ id });
console.log(result);
if (result.code === 200) {
commit('addCategorySubList', {data: result.data});
... ...
... ... @@ -34,6 +34,11 @@ export default function() {
Vue.set(state.channelList, 'productlist', state.channelList.productlist.concat(productlist.product_list));
Vue.set(state.channelList, 'page', productlist.page);
},
addReport(state, {report}) {
console.log(state);
console.log(report);
console.log("++++++++");
},
},
actions: {
async fetchProductList({ commit, state }, obj) {
... ...
... ... @@ -62,13 +62,13 @@ export default {
commit(Types.UPDATE_PRODUCT_FAV, { productId, isFav });
},
async fetchTop3({ commit }, { productId }) {
async fetchBrandTop({ commit }, { productId }) {
const result = await this.$api.post('/api/ufo/product/top', { product_id: productId });
if (result.code === 200) {
const productList = result.data.product_list || [];
commit(Types.UPDATE_PRODUCT_TOP3, { productId, topList: productList.slice(0, 3) });
commit(Types.UPDATE_BRAND_PRODUCT_TOP_LIST, { productId, topList: productList});
}
},
async toggleFav({ commit }, { productId, isFav }) {
... ...
... ... @@ -30,7 +30,7 @@ export default {
state.products = {...state.products, [payload.product_id]: payload};
ensureSelectedProduct(state, payload.product_id);
},
[Types.UPDATE_PRODUCT_TOP3](state, { productId, topList }) {
[Types.UPDATE_BRAND_PRODUCT_TOP_LIST](state, { productId, topList }) {
state.topLists = {...state.topLists, [productId]: topList};
},
[Types.UPDATE_PRODUCT_FAV](state, { productId, isFav }) {
... ...
... ... @@ -3,4 +3,4 @@ export const ENSURE_PRODUCT_DETAIL = 'ENSURE_PRODUCT_DETAIL';
export const UPDATE_PRODUCT_FAV = 'UPDATE_PRODUCT_FAV';
export const UPDATE_SELECTED_PRODUCT_SIZE = 'UPDATE_SELECTED_PRODUCT_SIZE';
export const RESET_SELECTED_PRODUCT_SIZE = 'RESET_SELECTED_PRODUCT_SIZE';
export const UPDATE_PRODUCT_TOP3 = 'UPDATE_PRODUCT_TOP3';
export const UPDATE_BRAND_PRODUCT_TOP_LIST = 'UPDATE_BRAND_PRODUCT_TOP_LIST';
... ...
... ... @@ -124,9 +124,7 @@ const render = (route) => {
res.setHeader('X-YOHO-Version', pkg.version);
const isDegrade = _.get(req.app.locals.wap, 'webapp.degrade', false);
if (route.accessLog) {
logger.info(`${req.yoho.clientIp} | ${req.url} | uid:${req.user.uid} | ${new Date()}`);
}
logger.info(`${req.yoho.clientIp} | ${req.url} | uid:${req.user.uid} | ua:${req.get('user-agent')} | ${new Date()}`);
if (isDegrade) {
return res.send(degradeHtml);
... ...
{
"name": "xianyu-ufo-app-web",
"version": "0.0.2-beta-35",
"version": "0.0.2-beta-38",
"private": true,
"description": "Xianyu Project With Express",
"repository": {
... ...