Authored by 沈志敏

Merge branch 'master' into feature/product-detail

... ... @@ -11,7 +11,7 @@ const isTest = process.env.NODE_ENV === 'test';
module.exports = {
app: 'h5',
appVersion: '4.6.0', // 调用api的版本
appVersion: '4.9.0', // 调用api的版本
port: 6004,
siteUrl: '//m.yohoblk.com',
signExtend: {
... ...
... ... @@ -2,14 +2,19 @@ const Vue = require('vue');
const lazyload = require('vue-lazyload');
const directive = require('common/vue-directive');
const app = require('product/detail/index.vue');
const yoho = require('yoho');
require('common/vue-filter')(Vue);
Vue.use(lazyload, { preLoad: 3 });
Vue.use(lazyload, {
preLoad: 3
});
Vue.use(directive);
new Vue({
el: '#app',
components: {
app: app
}
});
yoho.ready(() => {
new Vue({
el: '#app',
components: {
app: app
}
});
});
\ No newline at end of file
... ...
... ... @@ -4,11 +4,9 @@
<div v-if="block.singleImage">
<div v-for="(index, item) in block.singleImage.data">
<a :href="item.url">
<img :title="item.title"
:alt="item.alt"
v-bind:src="item.src | resize 750 469" width="375"/>
</a>
<img :title="item.title"
:alt="item.alt"
v-bind:src="item.src | resize 750 469" width="375"/>
</div>
</div>
</template>
... ...
... ... @@ -39,11 +39,11 @@
<div class="other-box" v-for="item in other">
<div>
<div class="image-box">
<a :href="`/editorial/${item.id}.html`">
<a :href="'/editorial/' + item.id + '.html'">
<img :src="item.thumb | resize 213 134"/>
</a>
</div>
<h3><a class="line-clamp-2" :href="`/editorial/${item.id}.html`">{{item.title}}</a></h3>
<h3><a class="line-clamp-2" :href="'/editorial/' + item.id + '.html'">{{item.title}}</a></h3>
<div class="sub-time">
<span class="icon icon-timeshare"></span><span class="label">{{article.publishTime | formatUnixTime 'MM.DD HH:mm'}}</span>
</div>
... ...
... ... @@ -148,7 +148,7 @@
/* 分享资讯 */
share(title, des, img, id) {
title = title.length > 15 ? title.substr(0, 15) + '...' : title;
img = util.getImgUrl(img, 300, 300, 2);
img = location.protocol + util.getImgUrl(img, 300, 300, 2);
yoho.goShare({
title: title,
des: des,
... ...
... ... @@ -104,7 +104,7 @@
yoho.goShare({
title,
des: '优质精选,BLK潮流资讯为你呈现',
img: util.getImgUrl(this.article.coverImage, 300, 300, 2),
img: location.protocol + util.getImgUrl(this.article.coverImage, 300, 300, 2),
url: `${location.origin}/editorial/${this.article.id}.html?shareTitle=${title}`
});
}
... ...
... ... @@ -4,7 +4,7 @@
</cheader>
<div class="my-header">
<a class="user-info auth" id="user-info" href='/me/mydetails'>
<span class="user-avatar" :style="data.headIco ? 'background-image: url(' + data.headIco + ')' : ''"></span>
<img class="user-avatar" :src="headIco" @error="imgerror">
</a>
<span class="username">{{ data.nickName }}</span>
</div>
... ... @@ -81,13 +81,18 @@
module.exports = {
data() {
return {
data: {}
data: {},
headIco: ''
};
},
components: {
cheader
},
methods: {
imgerror() {
// 图片报错时,给个默认透明图片
this.headIco = 'data:image/png;base64,R0lGODlhFAAUAIAAAP///wAAACH5BAEAAAAALAAAAAAUABQAAAIRhI+py+0Po5y02ouz3rz7rxUAOw==';
},
reload() {
$('#address').off('click', this.addressClick);
$('.auth').off('click', this.authClick);
... ... @@ -98,6 +103,9 @@
url: '/me/userdata'
}).then(result => {
this.data = result || {};
if (this.data.headIco) {
this.headIco = this.data.headIco;
}
});
$('#address').on('click', this.addressClick);
... ...
... ... @@ -3,7 +3,7 @@
<li>
<label @click="setAvatar">头像
<span class="details-icon">
<span class="head-portrait user-avatar" :style='icoStyle'></span>
<img class="head-portrait user-avatar" :src="head_ico" @error="imgerror">
<span class="icon icon-right"></span>
</span>
</label>
... ... @@ -46,8 +46,7 @@
props: ['head_ico', 'nickname', 'gender', 'birthday'],
data() {
return {
currentval: this.nickname,
icoStyle: this.head_ico ? 'background-image:url(' + this.head_ico + ');' : ''
currentval: this.nickname
};
},
computed: {
... ... @@ -58,6 +57,10 @@
}
},
methods: {
imgerror: function() {
// 图片报错时,给个默认透明图片
this.head_ico = 'data:image/png;base64,R0lGODlhFAAUAIAAAP///wAAACH5BAEAAAAALAAAAAAUABQAAAIRhI+py+0Po5y02ouz3rz7rxUAOw==';
},
setAvatar: function() {
yoho.goSetAvatar();
},
... ...
... ... @@ -483,8 +483,7 @@
tip(this.entity.isCollect === 'Y' ? '取消收藏成功' : '收藏成功');
this.entity.isCollect = this.entity.isCollect === 'Y' ? 'N' : 'Y';
yoho.store.set('productReload', true);
} else if (result.code === 403) {
// 未登录
} else if (result.code === 401) {
yoho.goLogin('', () => {
this.toggleFavorite();
});
... ...
... ... @@ -38,7 +38,7 @@
yoho.goShare({
title: this.title || '',
des: '我在BLK发现了一个不错的商品,快来看看吧!',
img: this.img,
img: location.protocol + this.img,
url: location.href
});
},
... ...
<template>
<div>
<cheader :title="sortName" class="list-header">
<i class="icon icon-filter" slot="right" @touchstart="openFilter"></i>
<i v-if="isiOS" class="icon icon-filter" slot="right" @touchstart="openFilter"></i>
<i v-else class="icon icon-filter" slot="right" @click="openFilter"></i>
</cheader>
<order :config="orderConfig" :val="order" v-if="enableOrder"></order>
<List :data="productList" :state="listState"></List>
... ... @@ -10,6 +11,7 @@
</template>
<script>
const $ = require('jquery');
const yoho = require('yoho');
const Vue = require('vue');
const lazyload = require('vue-lazyload');
const infinitScroll = require('vue-infinite-scroll');
... ... @@ -31,6 +33,7 @@
el: '#product-list',
data: function() {
return {
isiOS: yoho.isiOS,
sortName: locationQuery.title || locationQuery.sort_name, // 优先使用 title
orderConfig: [],
filterConfig: null,
... ...
<template>
<div>
<cheader title="新品抢先看">
<i class="icon icon-filter" slot="right" @touchstart="openFilter"></i>
<i v-if="isiOS" class="icon icon-filter" slot="right" @touchstart="openFilter"></i>
<i v-else class="icon icon-filter" slot="right" @click="openFilter"></i>
</cheader>
<List :data="productList" :state="listState"></List>
<Filter :config="filterConfig" action="/product/list.json" v-ref:filter></Filter>
... ... @@ -9,6 +10,7 @@
</template>
<script>
const $ = require('jquery');
const yoho = require('yoho');
const Vue = require('vue');
const lazyload = require('vue-lazyload');
const infinitScroll = require('vue-infinite-scroll');
... ... @@ -29,6 +31,7 @@
el: '#product-new',
data: function() {
return {
isiOS: yoho.isiOS,
sortName: locationQuery.sort_name,
filterConfig: null,
... ... @@ -151,6 +154,4 @@
}
};
</script>
<style>
</style>
</script>
\ No newline at end of file
... ...
... ... @@ -5,7 +5,8 @@
<span v-if="shareData.isBlkShop" v-show="shareData.isFav" class="icon" @click="collectShop()">&#xe60d;</span>
<span v-if="shareData.isBlkShop" v-show="!shareData.isFav" class="icon" @click="collectShop()">&#xe60c;</span>
<span v-if="shareData.isBlkShop" class="icon" @click="goShare()">&#xe60e;</span>
<span class="icon" @touchstart="showFilter()">&#xe60b;</span>
<span v-if="isiOS" class="icon" @touchstart="showFilter()">&#xe60b;</span>
<span v-else class="icon" @click="showFilter()">&#xe60b;</span>
</template>
</cheader>
</div>
... ... @@ -29,7 +30,9 @@
module.exports = {
data() {
return {};
return {
isiOS: yoho.isiOS
};
},
props: {
shareData: {
... ... @@ -60,6 +63,9 @@
// 删除两个多余的参数,两个参数是收藏时使用的
delete this.shareData.shopId;
delete this.shareData.isFav;
if (this.shareData.img) {
this.shareData.img = location.protocol + this.shareData.img.replace('http:', '');
}
yoho.goShare(this.shareData);
},
... ...