Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohoblk-wap
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
沈志敏
9 years ago
Commit
731da517e98261536aa761e8dd9c3c5cae6a71a5
2 parents
c7ab669c
ce85ac10
Merge branch 'master' into feature/product-detail
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
55 additions
and
32 deletions
config/common.js
public/js/product/detail.page.js
public/vue/editorial/content-block.vue
public/vue/editorial/detail.vue
public/vue/editorial/index-box.vue
public/vue/editorial/top-nav.vue
public/vue/me/home.vue
public/vue/me/mydetails.vue
public/vue/product/detail/index.vue
public/vue/product/detail/top-nav.vue
public/vue/product/list/index.vue
public/vue/product/new/index.vue
public/vue/product/shop/top-bar.vue
config/common.js
View file @
731da51
...
...
@@ -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
:
{
...
...
public/js/product/detail.page.js
View file @
731da51
...
...
@@ -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
...
...
public/vue/editorial/content-block.vue
View file @
731da51
...
...
@@ -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>
...
...
public/vue/editorial/detail.vue
View file @
731da51
...
...
@@ -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>
...
...
public/vue/editorial/index-box.vue
View file @
731da51
...
...
@@ -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,
...
...
public/vue/editorial/top-nav.vue
View file @
731da51
...
...
@@ -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}`
});
}
...
...
public/vue/me/home.vue
View file @
731da51
...
...
@@ -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);
...
...
public/vue/me/mydetails.vue
View file @
731da51
...
...
@@ -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();
},
...
...
public/vue/product/detail/index.vue
View file @
731da51
...
...
@@ -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();
});
...
...
public/vue/product/detail/top-nav.vue
View file @
731da51
...
...
@@ -38,7 +38,7 @@
yoho.goShare({
title: this.title || '',
des: '我在BLK发现了一个不错的商品,快来看看吧!',
img: this.img,
img:
location.protocol +
this.img,
url: location.href
});
},
...
...
public/vue/product/list/index.vue
View file @
731da51
<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,
...
...
public/vue/product/new/index.vue
View file @
731da51
<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
...
...
public/vue/product/shop/top-bar.vue
View file @
731da51
...
...
@@ -5,7 +5,8 @@
<span v-if="shareData.isBlkShop" v-show="shareData.isFav" class="icon" @click="collectShop()"></span>
<span v-if="shareData.isBlkShop" v-show="!shareData.isFav" class="icon" @click="collectShop()"></span>
<span v-if="shareData.isBlkShop" class="icon" @click="goShare()"></span>
<span class="icon" @touchstart="showFilter()"></span>
<span v-if="isiOS" class="icon" @touchstart="showFilter()"></span>
<span v-else class="icon" @click="showFilter()"></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);
},
...
...
Please
register
or
login
to post a comment