PayOrder: rename to SubmitBar

This commit is contained in:
陈嘉涵 2017-09-08 14:26:39 +08:00
parent 025133b172
commit 2a2c95024a
9 changed files with 41 additions and 41 deletions

View File

@ -8,12 +8,12 @@
**非兼容更新和新特性:**
- PayOrder component add tip slot [\#105](https://github.com/youzan/vant/pull/105) ([Raistlin916](https://github.com/Raistlin916))
- SubmitBar component add tip slot [\#105](https://github.com/youzan/vant/pull/105) ([Raistlin916](https://github.com/Raistlin916))
- Checkbox: support listen to change event [\#104](https://github.com/youzan/vant/pull/104) ([chenjiahan](https://github.com/chenjiahan))
- add GoodsAction component [\#102](https://github.com/youzan/vant/pull/102) ([chenjiahan](https://github.com/chenjiahan))
- add InvalidGoods component [\#100](https://github.com/youzan/vant/pull/100) ([chenjiahan](https://github.com/chenjiahan))
- add OrderGoods component [\#99](https://github.com/youzan/vant/pull/99) ([chenjiahan](https://github.com/chenjiahan))
- add PayOrder component [\#98](https://github.com/youzan/vant/pull/98) ([chenjiahan](https://github.com/chenjiahan))
- add SubmitBar component [\#98](https://github.com/youzan/vant/pull/98) ([chenjiahan](https://github.com/chenjiahan))
**修复:**

View File

@ -1,4 +1,4 @@
## PayOrder 提交订单栏
## SubmitBar 提交订单栏
<script>
import { Toast } from 'packages';
@ -16,8 +16,8 @@ export default {
</script>
<style>
.demo-pay-order {
.van-pay-order {
.demo-submit-bar {
.van-submit-bar {
position: relative;
}
.van-edit-address {
@ -28,9 +28,9 @@ export default {
### 使用指南
``` javascript
import { PayOrder } from 'vant';
import { SubmitBar } from 'vant';
Vue.component(PayOrder.name, PayOrder);
Vue.component(SubmitBar.name, SubmitBar);
```
### 代码演示
@ -39,7 +39,7 @@ Vue.component(PayOrder.name, PayOrder);
:::demo 基础用法
```html
<van-pay-order
<van-submit-bar
:price="3050"
button-text="提交订单"
@submit="onClickButton"
@ -52,7 +52,7 @@ Vue.component(PayOrder.name, PayOrder);
:::demo 禁用状态
```html
<van-pay-order
<van-submit-bar
disabled
:price="3050"
button-text="提交订单"
@ -66,7 +66,7 @@ Vue.component(PayOrder.name, PayOrder);
加载状态下不会触发`submit`事件
:::demo 加载状态
```html
<van-pay-order
<van-submit-bar
loading
:price="3050"
button-text="提交订单"
@ -79,7 +79,7 @@ Vue.component(PayOrder.name, PayOrder);
提示文案中的额外操作和说明
:::demo 提示文案中添加操作
```html
<van-pay-order
<van-submit-bar
:price="3050"
button-text="提交订单"
@submit="onClickButton"
@ -87,7 +87,7 @@ Vue.component(PayOrder.name, PayOrder);
<span slot="tip">
您的收货地址不支持同城送, <span class="van-edit-address" @click="onClickEditAddress">修改地址 ></span>
</span>
</van-pay-order>
</van-submit-bar>
```
:::

View File

@ -215,8 +215,8 @@ module.exports = {
"title": "GoodsAction 商品页行动点"
},
{
"path": "/pay-order",
"title": "PayOrder 提交订单栏"
"path": "/submit-bar",
"title": "SubmitBar 提交订单栏"
}
]
}

View File

@ -24,7 +24,6 @@ import Lazyload from './lazyload';
import Loading from './loading';
import NoticeBar from './notice-bar';
import Panel from './panel';
import PayOrder from './pay-order';
import Picker from './picker';
import Popup from './popup';
import Progress from './progress';
@ -36,6 +35,7 @@ import Search from './search';
import Step from './step';
import Stepper from './stepper';
import Steps from './steps';
import SubmitBar from './submit-bar';
import Swipe from './swipe';
import SwipeItem from './swipe-item';
import Switch from './switch';
@ -73,7 +73,6 @@ const components = [
Loading,
NoticeBar,
Panel,
PayOrder,
Picker,
Popup,
Progress,
@ -85,6 +84,7 @@ const components = [
Step,
Stepper,
Steps,
SubmitBar,
Swipe,
SwipeItem,
Switch,
@ -138,7 +138,6 @@ export {
Loading,
NoticeBar,
Panel,
PayOrder,
Picker,
Popup,
Progress,
@ -150,6 +149,7 @@ export {
Step,
Stepper,
Steps,
SubmitBar,
Swipe,
SwipeItem,
Switch,

View File

@ -1,14 +1,14 @@
<template>
<div class="van-pay-order">
<div class="van-pay-order__tip" v-show="tip || $slots.tip">
<div class="van-submit-bar">
<div class="van-submit-bar__tip" v-show="tip || $slots.tip">
{{ tip }}<slot name="tip"></slot>
</div>
<div class="van-pay-order__bar">
<div class="van-pay-order__price">
<div class="van-submit-bar__bar">
<div class="van-submit-bar__price">
<template v-if="hasPrice">
<span class="van-pay-order__price-text">合计</span>
<span class="van-pay-order__price-interger">¥{{ priceInterger }}.</span>
<span class="van-pay-order__price-decimal">{{ priceDecimal }}</span>
<span class="van-submit-bar__price-text">合计</span>
<span class="van-submit-bar__price-interger">¥{{ priceInterger }}.</span>
<span class="van-submit-bar__price-decimal">{{ priceDecimal }}</span>
</template>
</div>
<van-button :type="buttonType" :disabled="disabled" :loading="loading" @click="onSubmit">
@ -22,7 +22,7 @@
import Button from '../button';
export default {
name: 'van-pay-order',
name: 'van-submit-bar',
components: {
[Button.name]: Button

View File

@ -46,7 +46,7 @@
@import './tree-select.css';
/* business components */
@import './coupon-list.css';
@import './goods-action.css';
@import './notice-bar.css';
@import './coupon.css';
@import './pay-order.css';
@import './submit-bar.css';

View File

@ -1,6 +1,6 @@
@import './common/var.css';
.van-pay-order {
.van-submit-bar {
left: 0;
bottom: 0;
width: 100%;

View File

@ -1,8 +1,8 @@
import PayOrder from 'packages/pay-order';
import SubmitBar from 'packages/submit-bar';
import { mount } from 'avoriaz';
import { DOMChecker } from '../utils';
describe('PayOrder', () => {
describe('SubmitBar', () => {
let wrapper;
afterEach(() => {
wrapper && wrapper.destroy();
@ -15,22 +15,22 @@ describe('PayOrder', () => {
tip: '您的收货地址不支持同城送, 我们已为您推荐快递'
};
wrapper = mount(PayOrder, {
wrapper = mount(SubmitBar, {
propsData: props
});
DOMChecker(wrapper, {
text: {
'.van-button__text': props.buttonText,
'.van-pay-order__price-interger': '¥30.',
'.van-pay-order__price-decimal': '50',
'.van-pay-order__tip': props.tip
'.van-submit-bar__price-interger': '¥30.',
'.van-submit-bar__price-decimal': '50',
'.van-submit-bar__tip': props.tip
}
});
});
it('no tip', () => {
wrapper = mount(PayOrder, {
wrapper = mount(SubmitBar, {
propsData: {
price: 3005,
buttonText: '提交订单',
@ -41,15 +41,15 @@ describe('PayOrder', () => {
DOMChecker(wrapper, {
text: {
'.van-button__text': '提交订单',
'.van-pay-order__price-interger': '¥30.',
'.van-pay-order__price-decimal': '05',
'.van-pay-order__tip': ''
'.van-submit-bar__price-interger': '¥30.',
'.van-submit-bar__price-decimal': '05',
'.van-submit-bar__tip': ''
}
});
});
it('handle submit', () => {
wrapper = mount(PayOrder, {
wrapper = mount(SubmitBar, {
propsData: {
price: 3005,
buttonText: '提交订单'
@ -65,7 +65,7 @@ describe('PayOrder', () => {
});
it('can not submit when disabled', () => {
wrapper = mount(PayOrder, {
wrapper = mount(SubmitBar, {
propsData: {
disabled: true,
buttonText: '提交订单'
@ -81,7 +81,7 @@ describe('PayOrder', () => {
});
it('can not submit when loading', () => {
wrapper = mount(PayOrder, {
wrapper = mount(SubmitBar, {
propsData: {
loading: true,
buttonText: '提交订单'