Authored by ccbikai

Merge branch 'develop' of git.yoho.cn:fe/yohoblk-wap into develop

... ... @@ -29,11 +29,14 @@ const component = {
const result = {
module: 'home',
page: 'index',
noLocalJS: true,
noLocalCSS: true,
head_ico: proData && proData.head_ico ? helpers.image(proData.head_ico, 200, 200) : '',
profile_name: proData ? proData.profile_name : '登录/注册',
userinfourl: proData ? '/home/mydetails' : helpers.urlFormat('/signin.html', {
refer: req.originalUrl
}),
serviceUrl: 'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409&'
};
res.render('index', _.merge(result, data[1]));
... ... @@ -60,6 +63,8 @@ const component = {
res.render('help', {
module: 'home',
page: 'help',
noLocalJS: true,
noLocalCSS: true,
helpList: helpList
});
}).catch(next);
... ... @@ -74,16 +79,19 @@ const component = {
res.render('help-detail', {
module: 'home',
page: 'help',
noLocalJS: true,
noLocalCSS: true,
helpDetail: helpDetail
});
}).catch(next);
},
feedback: (req, res, next) => {
feedback: (req, res) => {
res.render('feedback', {
module: 'home',
page: 'feedback',
suggestSub: true,
}).catch(next);
noLocalCSS: true
})
},
saveFeedback: (req, res, next) => {
let saveFeedbackPara = {
... ... @@ -123,7 +131,9 @@ const component = {
about: (req, res) => {
res.render('about', {
module: 'home',
page: 'index'
page: 'index',
noLocalJS: true,
noLocalCSS: true
});
}
};
... ...
... ... @@ -70,9 +70,9 @@
帮助中心
<span class="num"><span class="icon icon-right"></span></span>
</a>
<a class="list-item" href="/home/online-service">
<a class="list-item" href="{{serviceUrl}}">
在线客服
<span class="num"><span class="icon icon-right"></span></span>
</a>
</div>
</div>
\ No newline at end of file
</div>
... ...
... ... @@ -25,7 +25,7 @@ const component = {
const id = req.params[0];
let params = {
// uid: req.user.uid || 8050378 // TODO: fix this hard coded uid
uid: req.user.uid || 0,
article_id: id,
client_type: 'h5'
};
... ...
... ... @@ -31,7 +31,7 @@ const component = {
let params = {
productId: _.toString(pid),
uid: req.user.uid || 8050378 // TODO: fix this hard coded uid
uid: req.user.uid || 0
};
model.product(params).then(result => {
... ... @@ -61,7 +61,7 @@ const component = {
edit_product_sku: req.body.isEdit || 0, // 是否是编辑商品SKU,0表示不是编辑
selected: 'Y',
promotion_id: req.body.promotionId || null, // 促销id,默认null(加价购有关)
uid: req.user.uid || null, // TODO: fix uid
uid: req.user.uid || 0,
shopping_key: global.yoho.cookie.getShoppingKey(req)
};
... ... @@ -83,7 +83,7 @@ const component = {
*/
favorite(req, res, next) {
let params = {
uid: req.user.uid || 8050378, // TODO: fix this hard coded uid
uid: req.user.uid || 0,
type: 'product'
};
... ... @@ -111,7 +111,7 @@ const component = {
let params = {
method: 'app.Shopping.count',
shopping_key: global.yoho.cookie.getShoppingKey(req),
uid: req.user.uid || 0 // TODO fix uid
uid: req.user.uid || 0
};
api.get('', params).then(result => {
... ...
... ... @@ -88,6 +88,7 @@ exports.fetchProducts = (req, res, next) => {
result.code = 200;
}
if (result.code === 200) {
prettyFilter(result.data.filter);
result.data.productList = processProductList(result.data.productList);
result = camelCase(result);
}
... ...
No preview for this file type
... ... @@ -37,4 +37,7 @@
<glyph unicode="&#xe907;" glyph-name="sort-asc" horiz-adv-x="585" d="M585.143 475.428q0-14.857-10.857-25.714t-25.714-10.857h-512q-14.857 0-25.714 10.857t-10.857 25.714 10.857 25.714l256 256q10.857 10.857 25.714 10.857t25.714-10.857l256-256q10.857-10.857 10.857-25.714z" />
<glyph unicode="&#xe908;" glyph-name="sort-desc" horiz-adv-x="585" d="M585.143 256q0-14.857-10.857-25.714l-256-256q-10.857-10.857-25.714-10.857t-25.714 10.857l-256 256q-10.857 10.857-10.857 25.714t10.857 25.714 25.714 10.857h512q14.857 0 25.714-10.857t10.857-25.714z" />
<glyph unicode="&#xe909;" glyph-name="x" horiz-adv-x="1001" d="M281 543q-27-1-53-1h-83q-18 0-36.5-6t-32.5-18.5-23-32-9-45.5v-76h912v41q0 16-0.5 30t-0.5 18q0 13-5 29t-17 29.5-31.5 22.5-49.5 9h-133v-97h-438v97zM955 310v-52q0-23 0.5-52t0.5-58-10.5-47.5-26-30-33-16-31.5-4.5q-14-1-29.5-0.5t-29.5 0.5h-32l-45 128h-439l-44-128h-63q-20 0-45 1-25 0-41 9.5t-25.5 23-13.5 29.5-4 30v167h911zM163 247q-12 0-21-8.5t-9-21.5 9-21.5 21-8.5q13 0 22 8.5t9 21.5-9 21.5-22 8.5zM316 123q-8-26-14-48-5-19-10.5-37t-7.5-25-3-15 1-14.5 9.5-10.5 21.5-4h365q23 0 34 12t2 38q-5 13-9.5 30.5t-9.5 34.5q-5 19-11 39h-368zM336 498v228q0 11 2.5 23t10 21.5 20.5 15.5 34 6h188q31 0 51.5-14.5t20.5-52.5v-227h-327z" />
<glyph unicode="&#xe90a;" glyph-name="edit-del" d="M874.044 746.014c-96.708 96.708-225.28 149.986-362.044 149.986s-265.336-53.278-362.014-149.956c-96.708-96.708-149.986-225.28-149.986-362.014 0-136.794 53.278-265.367 149.956-362.044 96.708-96.678 225.28-149.956 362.044-149.956s265.336 53.278 362.044 149.956c96.678 96.678 149.956 225.25 149.956 362.044 0 136.734-53.278 265.306-149.956 361.984v0zM210.824 444.235h602.353v-120.471h-602.353v120.471z" />
<glyph unicode="&#xe90b;" glyph-name="close-round" d="M512 896c-282.77 0-512-229.23-512-512 0-282.746 229.23-511.976 512-511.976s511.976 229.23 511.976 511.976c0 282.77-229.205 512-511.976 512v0zM683.447 252.123c10.923-10.923 10.923-28.623 0-39.57-5.461-5.461-12.629-8.192-19.797-8.192-7.144 0-14.312 2.731-19.773 8.192l-131.877 131.901-131.901-131.901c-5.461-5.461-12.629-8.192-19.773-8.192-7.168 0-14.312 2.731-19.797 8.192-10.923 10.947-10.923 28.648 0 39.57l131.901 131.877-131.901 131.901c-10.923 10.923-10.923 28.623 0 39.546 10.947 10.947 28.648 10.947 39.57 0l131.901-131.877 131.877 131.877c10.923 10.947 28.648 10.947 39.57 0 10.923-10.923 10.923-28.623 0-39.546l-131.901-131.901 131.901-131.877z" />
<glyph unicode="&#xe90c;" glyph-name="help" d="M851.264 733.92c-94.176 94.208-219.392 146.080-352.608 146.080-133.184 0-258.432-51.872-352.576-146.080-94.208-94.176-146.080-219.392-146.080-352.576s51.872-258.4 146.080-352.608c94.144-94.208 219.392-146.080 352.576-146.080 133.216 0 258.432 51.872 352.608 146.080s146.048 219.424 146.048 352.608c0 133.184-51.872 258.4-146.048 352.576v0zM783.392 96.64c-76.064-76.064-177.184-117.984-284.736-117.984s-208.64 41.92-284.704 117.984c-76.064 76.032-117.952 177.184-117.952 284.704s41.888 208.608 117.984 284.704c76.032 76.032 177.12 117.952 284.672 117.952s208.672-41.92 284.736-117.952c76.032-76.032 117.92-177.184 117.92-284.704 0-107.552-41.888-208.672-117.92-284.704v0zM521.216 658.048c-77.824 0-141.152-63.296-141.152-141.12h96c0 24.896 20.256 45.12 45.152 45.12 24.864 0 45.12-20.224 45.12-45.12v-5.248c0-20.256-33.44-32.384-33.408-32.384l-7.136-2.88c-26.432-13.248-71.2-56.032-71.2-132.384v-11.168h96v11.168c0 29.76 13.248 42.528 17.12 45.728 37.792 13.824 94.624 52.736 94.624 121.92v5.248c0 77.824-63.296 141.12-141.12 141.12zM450.656 234.88h96v-112.672h-96v112.672z" />
</font></defs></svg>
\ No newline at end of file
... ...
No preview for this file type
No preview for this file type
let Vue = require('yoho-vue');
const moment = require('moment');
/**
* 替换参数
... ... @@ -125,6 +124,23 @@ Vue.filter('convertTime', (value) => {
/**
* 格式化时间
*/
Vue.filter('formatUnixTime', (value, format) => {
return moment.unix(value).format(format || 'YYYY-MM-DD HH:mm:ss');
Vue.filter('formatUnixTime', (value) => {
// return moment.unix(value).format(format || 'YYYY-MM-DD HH:mm:ss');
if (typeof value === 'undefined') {
return;
}
let date = new Date(parseFloat(value) * 1000);
// let Y = date.getFullYear() + '-';
let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
let D = (date.getDate() + 1 < 10 ? '0' + (date.getDate() + 1) : date.getDate() + 1);
let h = date.getHours();
let m = date.getMinutes();
// let s = date.getSeconds();
// return M + '.' + D + ' ' + h + ' ' + ' ' + m + ' ' + s;
return `${M}.${D} ${h}:${m}`;
});
... ...
... ... @@ -7,19 +7,19 @@ $(function() {
return [
{
txt: '默认',
val: 1
val: ''
}, {
txt: '最新',
val: 2
val: 's_t_desc'
}, {
type: 'updown',
txt: '价格',
val: [3, 4] // [up, down]
val: ['s_p_asc', 's_p_desc'] // [up, down]
},
{
type: 'updown',
txt: '折扣',
val: [5, 6]
val: ['p_d_asc', 'p_d_desc']
}
];
};
... ...
... ... @@ -139,3 +139,15 @@
.icon-x:before {
content: "\e909";
}
.icon-edit-del:before {
content: "\e90a";
}
.icon-close-round:before {
content: "\e90b";
}
.icon-help:before {
content: "\e90c";
}
... ...
... ... @@ -4,7 +4,7 @@
background: #fff;
.description {
position: absolute;
position: fixed;
top: 30%;
width: 411px;
height: 75px;
... ... @@ -17,7 +17,7 @@
}
.icon-container {
position: absolute;
position: fixed;
top: 43%;
left: 0;
right: 0;
... ...
... ... @@ -3,33 +3,60 @@
<div class="drawer-main" v-el:main>
<slot></slot>
</div>
<div class="drawer-mask" @click="close"></div>
</div>
</template>
<script>
module.exports = {
props: {
on: Boolean
}
};
module.exports = {
props: {
on: Boolean
},
methods: {
close() {
this.on = false;
}
},
watch: {
on(newVal) {
if(newVal) {
document.body.style.overflow = 'hidden';
} else {
document.body.style.overflow = '';
}
}
}
};
</script>
<style>
.drawer {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.6);
}
.drawer {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.drawer-mask {
position: absolute;
z-index: 199;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.6);
}
.drawer-main {
position: absolute;
z-index: 200;
top: 0;
right: 0%;
bottom: 0;
min-width: 80%;
max-width: 100%;
background-color: #fff;
transition: all 0.3s 0.2s;
}
.drawer-main {
position: absolute;
top: 0;
right: 0%;
bottom: 0;
min-width: 80%;
max-width: 100%;
background-color: #fff;
transition: all 0.3s 0.2s;
}
</style>
... ...
... ... @@ -47,6 +47,7 @@
max-height: 60px;
font-weight: 300;
}
h4 {
color: #b0b0b0;
font-weight: 200;
... ... @@ -54,16 +55,19 @@
margin-top: 32px;
margin-bottom: 0;
}
.image-box {
width: 90px;
height: 120px;
display: inline-block;
}
.text-box {
display: inline-block;
margin-left: 24px;
max-width: 512px;
}
}
hr {
... ... @@ -88,12 +92,14 @@
}
section {
h4 {
margin: 0;
font-size: 25px;
line-height: 80px;
display: inline-block;
}
}
.add-to-cart {
... ... @@ -105,6 +111,7 @@
&.slide-in {
transform: translate3d(0, 0, 0);
}
}
</style>
<script>
... ... @@ -190,7 +197,8 @@
return {
text: size.sizeName,
value: size.goodsSizeSkuId,
disabled: size.goodsSizeStorageNum === 0
disabled: size.goodsSizeStorageNum === 0,
goodsId: size.goodsId
};
});
... ... @@ -300,9 +308,28 @@
this.onAddToCart(this.selection, this.entity.pid);
},
getSelection() {
return {
getFullSelection() {
let size;
this.sizes.forEach((item)=> {
if (item.value === this.selection.size) {
size = item;
}
});
let color;
this.colors.indexOf((item)=> {
if (item.value === this.selection.color) {
color = item;
}
});
return {
size: size,
color: color,
productId: this.entity.id
};
}
}
... ...
<template>
<div class="upload">
<form v-el:form v-on:change="upload">
<label class="label-input icon" for="{{inputId}}">
<input id="{{inputId}}" type="file" name="filename">
</label>
</form>
</div>
</template>
... ... @@ -45,4 +43,36 @@
<style>
/* 每个地方上传按钮可能不一样,使用的时候自己写样式 */
.upload {
position: relative;
border: 1px solid #b0b0b0;
&:after, &:before {
content: "";
position: absolute;
top: 50%;
left: 50%;
width: 100px;
height: 2px;
margin-left: -50px;
margin-top: -1px;
background-color: #b0b0b0;
}
&:before {
transform: rotate(90deg);
}
input {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
}
}
</style>
... ...
... ... @@ -11,7 +11,7 @@
<div class="list exchange-info">
<!--address-->
<div class="list-item exchange-address" @click="changeAddress">
<div class="consignee">
<div class="co
<span class="mr50">{{address.consignee}}</span>
<span>{{address.mobile}}</span>
</div>
... ... @@ -39,7 +39,9 @@
<script>
const $ = require('yoho-jquery');
const qs = require('yoho-qs');
const tip = require('common/tip');
const bus = require('common/vue-bus');
const yoho = require('yoho');
const productList = require('home/return/list.vue');
const exchangeItem = require('home/exchange/item.vue');
... ... @@ -127,7 +129,13 @@
},
methods: {
changeAddress() {
alert('TODO:更换地址');
yoho.goAddress({
type:'1'
}, (address)=>{
}, () => {
tip('更换地址失败~');
});
},
// 商品 feature改变
... ... @@ -144,7 +152,6 @@
queryProductFeature(pid) {
$.get(`/product/product_${pid}.json`).then(result => {
this.entity = result;
this.entity.id = pid;
return result;
});
},
... ...
... ... @@ -3,7 +3,7 @@
<ul class="fav-brand-list">
<li v-for="item in brandData" track-by="$index" id="li-{{$index}}">
<div class="fav-del-left {{editmodel ? 'delshow': ''}}" @click="showDelBtn($index)">
<span class="fav-del-span"></span>
<span class="fav-del-span"><span class="icon icon-edit-del"></span></span>
</div>
<a :href="item.link">
<div class="fav-img-box">
... ... @@ -150,8 +150,11 @@
height: 35px;
margin-right: 15px;
margin-top: 50px;
background: resolve("home/fav/fav-del.png");
background-size: 100%;
}
.icon-edit-del {
color: red;
font-size: 35px;
}
}
... ...
... ... @@ -3,7 +3,7 @@
<ul class="fav-product-list">
<li v-for="item in productData" track-by="$index" id="li-{{$index}}">
<div class="fav-del-left {{editmodel ? 'delshow': ''}}" @click="showDelBtn($index)">
<span class="fav-del-span"></span>
<span class="fav-del-span"><span class="icon icon-edit-del"></span></span>
</div>
<a :href="item.link">
<div class="fav-img-box">
... ... @@ -156,8 +156,11 @@
height: 35px;
margin-right: 15px;
margin-top: 80px;
background: resolve("home/fav/fav-del.png");
background-size: 100%;
}
.icon-edit-del {
color: red;
font-size: 35px;
}
}
... ...
... ... @@ -3,7 +3,7 @@
<swipe :continuous="false" :auto="0" :show-indicators="goods && goods.length > 1">
<swipe-item v-for="item in goods">
<a href="#" title="{{item.title}}">
<img :src="item.colorImage | resize 750 1000" width="375" height="500" alt="">
<img :src="item.colorImage | resize 750 1000" width="100%" alt="">
</a>
</swipe-item>
</swipe>
... ...
... ... @@ -388,6 +388,7 @@
const $ = require('yoho-jquery');
const app = $('#app');
const tip = require('common/tip');
const yoho = require('yoho');
require('yoho-vue-swipe/dist/vue-swipe.css');
... ... @@ -406,6 +407,7 @@
},
showFeatureSelector: false,
cartCount: 0,
yoho: yoho,
/**
* 加入购物车回调
... ... @@ -417,6 +419,10 @@
productSku: selection.size,
buyNumber: 1
}).then((result)=> {
if (yoho.goShopingKey && result.data.shopping_key) {
yoho.goShopingKey(result.data.shopping_key);
}
// TODO: 库存不足 后台暂未实现
// TODO: 商品已下架 后台暂未实现
if (result.code === 200) {
... ...
<template>
<div class="top-nav">
<a class="left" href="javascript:alert('TODO');">
<a class="left" href="javascript:void(0);" @click="yoho.goBack()">
<span class="icon icon-left"></span>
</a>
<a class="right" href="javascript:alert('TODO');">
<a class="right" href="javascript:void(0);" @click="yoho.goShare()">
<span class="icon icon-right"></span>
</a>
</div>
... ... @@ -26,4 +26,12 @@
}
}
</style>
<script></script>
<script>
module.exports = {
data() {
return {
yoho: require('yoho')
};
}
};
</script>
... ...
... ... @@ -28,12 +28,12 @@
el: '#product-list',
data: function() {
return {
sortConfig: global.sortConfig,
filterConfig: global.filterConfig,
sortConfig: [],
filterConfig: null,
// query
url: '/product/list.json',
sort: null,
sort: '',
filter: {},
page: 0, // 未搜索 page=0; 全部加载完 page = totalPage; 无数据: page !=0 && productList.length=0
totalPage: null,
... ... @@ -77,6 +77,10 @@
self.page = res.data.page;
self.totalPage = res.data.pageTotal;
self.$set('productList', self.productList.concat(res.data.productList));
if (!self.filterConfig) {
self.$set('filterConfig', res.data.filter);
}
}
})
.fail(error => {
... ...