Authored by 陈轩

reason upload

... ... @@ -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);
}
... ...
... ... @@ -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']
}
];
};
... ...
... ... @@ -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>
... ...
<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;
});
},
... ...
... ... @@ -69,5 +69,5 @@
</script>
<style>
@import "../../scss/home/_logistics.css";
@import "../../../scss/home/_logistics.css";
</style>
... ...
... ... @@ -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 => {
... ...