Remove ExpressWay

This commit is contained in:
陈嘉涵
2017-09-08 10:34:21 +08:00
parent 3a8a745f6a
commit 1391fbfabf
7 changed files with 0 additions and 515 deletions
-32
View File
@@ -1,32 +0,0 @@
<template>
<van-cell class="van-express-way-option" @click="$emit('change')">
<van-radio :name="data.express_type" :value="currentExpressWay" />
<div class="van-express-way-option__content">
<h3 class="van-express-way-option__title">
<span>{{ data.postage_title }}</span>
<span>{{ data.postage }}</span>
</h3>
<p>{{ data.postage_desc }}</p>
<div class="van-express-way-option__warn" v-if="data.postage_warn_desc">{{ data.postage_warn_desc }}</div>
</div>
</van-cell>
</template>
<script>
import Cell from '../cell';
import Radio from '../radio';
export default {
name: 'van-express-way-option',
components: {
[Cell.name]: Cell,
[Radio.name]: Radio
},
props: {
data: Object,
currentExpressWay: Number
}
};
</script>
-100
View File
@@ -1,100 +0,0 @@
<template>
<van-cell class="van-express-way">
<van-actionsheet v-if="computedEditable" v-model="showActionsheet" :title="actionsheetTitle" >
<van-cell-group>
<van-express-way-option
v-for="(item, index) in computedList"
:key="item.express_type"
:data="item"
:currentExpressWay="value"
@change="onSelectExpressWay(item, index)"
/>
</van-cell-group>
</van-actionsheet>
<van-cell :title="cellTitle" :isLink="computedEditable" @click="showActionsheet = computedEditable">
<p class="van-express-way__fee">{{ currentOption.postage }}</p>
<p class="van-express-way__type">{{ currentOption.postage_title }}</p>
</van-cell>
</van-cell>
</template>
<script>
import Option from './Option';
import Cell from '../cell';
import CellGroup from '../cell-group';
import Actionsheet from '../actionsheet';
export default {
name: 'van-express-way',
components: {
[Option.name]: Option,
[Cell.name]: Cell,
[CellGroup.name]: CellGroup,
[Actionsheet.name]: Actionsheet
},
props: {
value: {
type: Number,
required: true
},
expressList: {
type: Array,
required: true
},
cellTitle: {
type: String,
default: '配送方式'
},
actionsheetTitle: {
type: String,
default: '配送方式'
},
editable: {
type: Boolean,
default: true
}
},
data() {
return {
showActionsheet: false
};
},
computed: {
computedList() {
return this.expressList.map(item => ({
...item,
postage: this.calcPostage(item.postage)
}));
},
computedEditable() {
return this.expressList && this.expressList.length >= 2 && this.editable;
},
currentOption() {
for (let i = 0; i < this.computedList.length; i++) {
if (this.computedList[i].express_type === this.value) {
return this.computedList[i];
}
}
return {};
}
},
methods: {
onSelectExpressWay(item, index) {
this.showActionsheet = false;
this.$emit('input', item.express_type);
this.$emit('change', item, index);
},
calcPostage(postage) {
return postage === 0 ? '免运费' : '¥' + (postage / 100).toFixed(2);
}
}
};
</script>
-3
View File
@@ -15,7 +15,6 @@ import CouponList from './coupon-list';
import DatetimePicker from './datetime-picker';
import DeepSelect from './deep-select';
import Dialog from './dialog';
import ExpressWay from './express-way';
import Field from './field';
import GoodsAction from './goods-action';
import GoodsActionBigBtn from './goods-action-big-btn';
@@ -69,7 +68,6 @@ const components = [
CouponList,
DatetimePicker,
DeepSelect,
ExpressWay,
Field,
GoodsAction,
GoodsActionBigBtn,
@@ -135,7 +133,6 @@ export {
DatetimePicker,
DeepSelect,
Dialog,
ExpressWay,
Field,
GoodsAction,
GoodsActionBigBtn,
-60
View File
@@ -1,60 +0,0 @@
@import './common/var.css';
.van-express-way {
padding: 0;
&__fee,
&__type {
color: $gray-darker;
line-height: 1.5;
}
&__fee {
font-size: 14px;
}
&__type {
font-size: 12px;
}
.van-actionsheet__content {
max-height: 290px;
overflow-y: auto;
}
&-option {
position: relative;
padding: 14px 15px 14px 0;
.van-radio {
top: 50%;
left: 0;
margin-top: -11px;
position: absolute;
}
&__content {
padding-left: 30px;
p {
color: $gray-dark;
font-size: 12px;
line-height: 16px;
}
}
&__title {
span {
vertical-align: middle;
&:first-child {
margin-right: 5px;
}
}
}
&__warn {
color: $yellow;
}
}
}
-1
View File
@@ -46,7 +46,6 @@
/* business components */
@import './deep-select.css';
@import './express-way.css';
@import './goods-action.css';
@import './invalid-goods.css';
@import './notice-bar.css';