Authored by 陈峰

merge

... ... @@ -63,8 +63,7 @@ const component = {
product.formatPrice = product.format_sales_price !== '0' ? product.format_sales_price : product.format_market_price;//eslint-disable-line
product.isDiscount = product.market_price > product.sales_price;
product.coverImage = product.goods_list[0].color_image;
product.coverImage = _.get(product, 'goods_list[0].images_list[0].image_url');
res.render('pdetail', {
module: 'product',
... ...
... ... @@ -11,16 +11,16 @@ const isTest = process.env.NODE_ENV === 'test';
module.exports = {
app: 'h5',
appVersion: '5.5.2', // 调用api的版本
appVersion: '5.6.0', // 调用api的版本
port: 6004,
siteUrl: '//m.yohoblk.com',
signExtend: {
app_type: 1
},
domains: {
// api: 'http://api-test3.yohops.com:9999/',
// service: 'http://service-test3.yohops.com:9999/',
// singleApi: 'http://api-test3.yohops.com:9999/'
api: 'http://api-test3.yohops.com:9999/',
service: 'http://service-test3.yohops.com:9999/',
singleApi: 'http://api-test3.yohops.com:9999/'
// api: 'http://api-test2.yohops.com:9999/',
// service: 'http://service-test2.yohops.com:9999/',
... ... @@ -29,9 +29,9 @@ module.exports = {
// service: 'http://dev-service.yohops.com:9999/',
// singleApi: 'http://192.168.102.27:8092/'
// //
api: 'http://api.yoho.cn/',
service: 'http://service.yoho.cn/',
singleApi: 'http://single.yoho.cn/'
// api: 'http://api.yoho.cn/',
// service: 'http://service.yoho.cn/',
// singleApi: 'http://single.yoho.cn/'
},
subDomains: {
host: '.m.yohoblk.com',
... ... @@ -100,9 +100,9 @@ if (isProduction) {
singleApi: 'http://single.yoho.cn/'
},
memcache: {
master: ['127.0.0.1:11211'],
slave: ['127.0.0.1:11211'],
session: ['127.0.0.1:11211'],
master: ['memcache1.yohoops.org:12111', 'memcache2.yohoops.org:12111', 'memcache3.yohoops.org:12111'],
slave: [],
session: ['memcache1.yohoops.org:12111', 'memcache2.yohoops.org:12111', 'memcache3.yohoops.org:12111'],
timeout: 100,
retries: 0
},
... ...
{
"name": "yohoblk-wap",
"version": "92.0.20",
"version": "92.0.21",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -25,6 +25,7 @@ const hbsLoader = {
const getEntries = () => {
const entries = {
libs: [
'babel-polyfill',
'jquery',
'yoho-qs',
'yoho-cookie',
... ... @@ -137,7 +138,7 @@ module.exports = {
],
resolve: {
alias: {
vue: 'vue/dist/vue.js'
vue$: 'vue/dist/vue.esm.js',
},
extensions: ['.js', '.json', '.css', '.scss', 'vue'],
modules: [
... ...
... ... @@ -19,7 +19,7 @@ const origin = location.origin;
*/
const defaultTitleMap = {
1: {
headerid: '1',
headerid: '-1',
left: {
action: ''
},
... ...
... ... @@ -66,6 +66,9 @@ $(() => {
// 拦截页面内所有 a 标签的跳转
$body.on('click', 'a[href]', function() {
if ($(this).hasClass('no-link')) {
return false;
}
if (!$(this).hasClass('no-intercept')) {
let href = $(this).attr('href');
... ...
... ... @@ -58,7 +58,7 @@ export default {
return {};
},
buttonText() {
if (this.value.storage_sum <= 0) {
if (this.value.storage_sum <= 0 || this.value.is_deposit_advance === 'Y') {
return '已售罄';
}
return '加入购物车';
... ... @@ -156,7 +156,7 @@ export default {
return yoho.goLogin();
}
if (this.value.storage_sum <= 0) {
if (this.value.storage_sum <= 0 || this.value.is_deposit_advance === 'Y') {
return;
}
if (!this.colorId) {
... ...
... ... @@ -3,16 +3,16 @@
<ul class="cardlist card-large clearfix">
<li class="card" v-for="(item, index) in data" :key="item.product_skn" @click="clickProduct(item, index)">
<div class="card-pic">
<a v-good-href="item">
<a v-good-href="item" :class="hrefClass">
<img v-img-src="{src: item.default_images, width: 330, height: 440}" :alt="item.product_name">
</a>
</div>
<div class="card-bd">
<h2 class="card-label">
<a v-good-href="item" class="line-clamp-1">{{item.product_name}}</a>
<a v-good-href="item" class="line-clamp-1" :class="hrefClass">{{item.product_name}}</a>
</h2>
<h2 class="card-label-desc" v-if="item.product_name1">
<a v-good-href="item" class="line-clamp-1">{{item.product_name}}</a>
<a v-good-href="item" class="line-clamp-1" :class="hrefClass">{{item.product_name}}</a>
</h2>
<span class="good-price" :class="{'sale-price': item.market_price}">¥{{item.sales_price | toFixed}}</span>
<span class="good-price" :class="{'old-price': item.market_price}" v-if="item.market_price">¥{{item.market_price | toFixed}}</span>
... ... @@ -30,147 +30,189 @@
</div>
</template>
<script>
import Vue from 'vue';
import lazyload from 'vue-lazyload';
import infinitScroll from 'vue-infinite-scroll';
import bus from 'common/vue-bus';
Vue.use(lazyload, { preLoad: 3 });
Vue.use(infinitScroll);
import Vue from 'vue';
import lazyload from 'vue-lazyload';
import infinitScroll from 'vue-infinite-scroll';
import bus from 'common/vue-bus';
Vue.use(lazyload, { preLoad: 3 });
Vue.use(infinitScroll);
export default {
data() {
return {
hrefClass: {}
};
},
props: {
/* 开启滚动加载 */
disableFetch: Boolean,
// 数据
data: Array,
state: [Number, Object] // -1: 无数据 0: 全部加载完 1: 正在加载
},
computed: {
// 空列表: data.length === 0
whenEmpty() {
return !this.data.length;
}
},
mounted() {
const $scrollEl = this.getScrollEventTarget(this.$el);
$scrollEl.addEventListener('scroll', this.throttle(this.scrollEnd, 200));
},
methods: {
fetch: function() {
bus.$emit('list.paging');
},
clickProduct(item, index) {
this.$emit('click-product', item, index);
},
scrollEnd() {
this.hrefClass = {};
},
getScrollEventTarget(element) {
let getComputedStyle = document.defaultView.getComputedStyle;
let currentNode = element;
export default {
props: {
/* 开启滚动加载 */
disableFetch: Boolean,
while (currentNode && currentNode.tagName !== 'HTML' && currentNode.tagName !== 'BODY' && currentNode.nodeType === 1) {
let overflowY = getComputedStyle(currentNode).overflowY;
// 数据
data: Array,
state: [Number, Object] // -1: 无数据 0: 全部加载完 1: 正在加载
},
computed: {
// 空列表: data.length === 0
whenEmpty() {
return !this.data.length;
if (overflowY === 'scroll' || overflowY === 'auto') {
return currentNode;
}
currentNode = currentNode.parentNode;
}
return window;
},
methods: {
fetch: function() {
bus.$emit('list.paging');
},
clickProduct(item, index) {
this.$emit('click-product', item, index);
}
throttle(fn, delay) {
let timer;
return () => {
if (timer) {
clearTimeout(timer);
timer = null;
}
this.hrefClass = {
'no-link': true
};
timer = setTimeout(() => {
fn();
}, delay);
};
}
};
}
};
</script>
<style>
@import "../../../scss/common/_color.css";
.cardlist {
list-style: none;
margin: 0;
padding: 0;
}
.cardlist--loading {
font-size: 32px;
text-align: center;
padding: 16px 0;
}
.card-large {
background-color: #fff;
.card {
float: left;
width: 330px;
margin: 0 30px;
&:nth-child(2n) {
margin: 0;
}
}
.card-pic {
width: 330px;
height: 440px;
a,
img {
display: block;
width: 100%;
height: 100%;
}
@import "../../../scss/common/_color.css";
.cardlist {
list-style: none;
margin: 0;
padding: 0;
}
.cardlist--loading {
font-size: 32px;
text-align: center;
padding: 16px 0;
}
.card-large {
background-color: #fff;
.card {
float: left;
width: 330px;
margin: 0 30px;
&:nth-child(2n) {
margin: 0;
}
}
.card-bd {
min-height: 180px;
padding-top: 40px;
font-size: 0;
font-family: "BrownStd", "PingFang SC", Helvetica, Roboto, "Heiti SC", "\9ED1\4F53", Arial;
}
.card-pic {
width: 330px;
height: 440px;
.card-label {
margin: 0 0 30px;
font-size: 24px;
line-height: 1.4;
font-weight: normal;
a,
img {
display: block;
width: 100%;
height: 100%;
}
}
.card-label-desc {
margin: 0 0 14px;
font-size: 20px;
line-height: 1.4;
height: 67.1999999999px;
font-weight: normal;
a {
color: #888;
}
}
.card-bd {
min-height: 180px;
padding-top: 40px;
font-size: 0;
font-family: "BrownStd", "PingFang SC", Helvetica, Roboto, "Heiti SC", "\9ED1\4F53", Arial;
}
.good-price {
color: #b0b0b0;
margin-right: 14px;
.card-label {
margin: 0 0 30px;
font-size: 24px;
line-height: 1.4;
font-weight: normal;
}
&:last-of-type {
margin-right: 0;
}
.card-label-desc {
margin: 0 0 14px;
font-size: 20px;
line-height: 1.4;
height: 67.1999999999px;
font-weight: normal;
&.old-price {
font-size: 18px;
color: #b0b0b0;
text-decoration: line-through;
a {
color: #888;
}
}
}
&.sale-price {
color: #000;
}
.good-price {
color: #b0b0b0;
margin-right: 14px;
font-size: 24px;
&:last-of-type {
margin-right: 0;
}
.empty-tip {
margin-top: 200px;
&.old-price {
font-size: 18px;
color: #b0b0b0;
text-align: center;
.icon-search {
display: inline-block;
font-size: 200px;
margin-bottom: 56px;
}
text-decoration: line-through;
}
.empty-tip-cn {
font-size: 34px;
margin-bottom: 30px;
&.sale-price {
color: #000;
}
}
.empty-tip-en {
font-size: 20px;
.empty-tip {
margin-top: 200px;
color: #b0b0b0;
text-align: center;
.icon-search {
display: inline-block;
font-size: 200px;
margin-bottom: 56px;
}
}
.empty-tip-cn {
font-size: 34px;
margin-bottom: 30px;
}
.empty-tip-en {
font-size: 20px;
}
</style>
... ...
... ... @@ -4,7 +4,7 @@
<swiper :options="swiperOption" ref="swiper">
<swiper-slide v-for="item in goodsList" :key="item.title">
<img :title="item.title"
v-img-src="{src: item.color_image, width: 580, height: 770}"
v-img-src="{src: item.image_url, width: 580, height: 770}"
width="100%">
</swiper-slide>
</swiper>
... ... @@ -19,6 +19,7 @@
</template>
<script>
require('swiper/dist/css/swiper.css');
import _ from 'lodash';
import yoho from 'yoho';
import util from 'common/util';
import vas from 'vue-awesome-swiper';
... ... @@ -55,8 +56,16 @@
}
},
watch: {
goods(val) {
let temp = val.slice();
goods(list) {
let temp = [];
_.each(list, item => {
_.each(item.images_list, img => {
temp.push({
image_url: img.image_url
});
});
});
const len = temp.length;
if (len > 1) {
... ... @@ -64,7 +73,7 @@
}
this.goodsList = temp;
this.slideCount = this.goodsList.length;
this.slideCount = len;
}
},
methods: {
... ...
... ... @@ -282,6 +282,8 @@
import shoppingBag from 'component/product/shopping-bag.vue';
import operationBar from './operation-bar.vue';
import 'common/back-top';
import cookie from 'yoho-cookie';
import qs from 'yoho-qs';
const app = $('#app');
... ... @@ -412,9 +414,14 @@
}
});
const origin = location.origin;
const pathname = location.pathname;
const channel = cookie.get('_Channel') || 'men';
const queryStr = $.param(Object.assign(qs, {channel}));
share({
title: this.entity.product_name,
link: location.href,
link: `${origin}${pathname}?${queryStr}`,
desc: '我在BLK发现了一个不错的商品,快来看看吧!',
imgUrl: this.firstImage.replace(/(\{width}|\{height}|\{mode})/g, function($0) {
const dict = {
... ... @@ -654,7 +661,7 @@
&.highlight {
line-height: 1;
color: #b0021b;
color: #000;
}
}
... ...
... ... @@ -56,8 +56,11 @@
}
</style>
<script>
import $ from 'yoho-jquery';
import yoho from 'yoho';
import tip from 'common/tip';
import cookie from 'yoho-cookie';
import qs from 'yoho-qs';
export default {
name: 'operation-bar',
... ... @@ -82,11 +85,16 @@
},
methods: {
share() {
const origin = location.origin;
const pathname = location.pathname;
const channel = cookie.get('_Channel') || 'men';
const queryStr = $.param(Object.assign(qs, {channel}));
yoho.goShare({
title: this.shareTitle || '',
des: '我在BLK发现了一个不错的商品,快来看看吧!',
img: location.protocol + this.shareImg,
url: location.href
url: `${origin}${pathname}?${queryStr}`
});
},
toggleFavorite: function() {
... ...
... ... @@ -52,6 +52,10 @@ module.exports = (list, options) => {
yhChannel: ''
}, options);
if (Array.isArray(options.gender)) {
options.gender = options.gender[0];
}
let genderVal = options.gender.split(',');
if (genderVal.indexOf(genderMap.men) && genderVal.indexOf(genderMap.women)) { // 男女 通吃
... ...
This diff could not be displayed because it is too large.