Authored by Tao

Merge branch 'develop' of http://git.yoho.cn/fe/xianyu-ufo-app-web into develop

import createAPI from 'utils/create-api';
export default function addCouponList(Vue, CouponList) {
createAPI(Vue, CouponList, ['closeAction', 'payAction', 'itemClickAction'], true);
createAPI(Vue, CouponList, ['closeAction', 'confirmAction', 'itemClickAction'], true);
}
... ...
... ... @@ -64,7 +64,7 @@ export default {
this.$emit('closeAction');
},
pay() {
this.$emit('payAction');
this.$emit('confirmAction');
},
onItemClick(item) {
this.$emit('itemClickAction', item);
... ...
import createAPI from 'utils/create-api';
export default function addPayType(Vue, PayType) {
createAPI(Vue, PayType, ['closeAction', 'payAction'], true);
createAPI(Vue, PayType, ['closeAction', 'confirmAction'], true);
}
... ...
... ... @@ -81,7 +81,8 @@ export default {
this.$emit('closeAction');
},
pay() {
this.$emit('payAction');
this.$emit('confirmAction');
this.$router.push({
name: 'OrderPay',
query: {
... ...
import createAPI from 'utils/create-api';
export default function addPromotionList(Vue, PromotionList) {
createAPI(Vue, PromotionList, ['closeAction', 'confirmAction', 'itemClickAction'], true);
}
... ...
import PromotionList from './promotion-list';
import addPromotionList from './api';
PromotionList.install = function(Vue) {
Vue.component(PromotionList.name, PromotionList);
addPromotionList(Vue, PromotionList);
};
export default PromotionList;
... ...
<template>
<YohoActionSheet ref="actionSheet" @cancel="close">
<div class="pay-type-wrapper">
<div class="header">
<div class="title">选择优惠活动</div>
<span><i class="iconfont iconweibiao45133 close" @click="close"></i></span>
</div>
<slot name="content">
<div class="pay-list-wrapper">
<div class="pay-list-item" v-for="item in data" :key="item.promotionId" @click="onItemClick(item)">
<div class="coupon-info">
<div class="coupon-name">{{item.promotionName}}</div>
<div class="coupon-time">{{item.startTime}}-{{item.endTime}}</div>
</div>
<Check class="check" :value="item.selected === 'Y'"></Check>
</div>
</div>
</slot>
<div name="footer">
<YohoButton txt="确定" class="footer" @click="pay"></YohoButton>
</div>
</div>
</YohoActionSheet>
</template>
<script>
import YohoActionSheet from '../action-sheet';
import Check from '../order-pay-type/check2';
import YohoButton from '../button';
export default {
name: 'OrderPromotionList',
props: {
data: {
type: Array,
default() {
return [];
}
},
},
components: {
YohoButton,
YohoActionSheet,
Check
},
data() {
return {};
},
methods: {
show() {
this.$refs.actionSheet.show();
},
hide() {
this.$refs.actionSheet.hide();
},
close() {
this.hide();
this.$emit('closeAction');
},
pay() {
this.$emit('confirmAction');
},
onItemClick(item) {
this.$emit('itemClickAction', item);
}
}
};
</script>
<style lang="scss" scoped>
.pay-type-wrapper {
height: 960px;
background: white;
position: relative;
display: flex;
flex-direction: column;
}
.header {
display: flex;
justify-content: space-between;
padding: 40px;
}
.title {
font-weight: bold;
font-size: 32px;
color: #222;
}
.close {
font-size: 32px;
}
.pay-list-wrapper {
flex: 1;
overflow-y: auto;
}
.pay-list-item {
height: 180px;
font-size: 28px;
margin: 20px 20px;
display: flex;
justify-content: space-between;
align-items: center;
background-color: white;
border-bottom: 1px solid #eee;
}
.check {
font-size: 48px;
margin-left: 40px;
margin-right: 40px;
}
.pay-info {
width: 210px;
}
.footer {
font-size: 32px;
}
.price-info {
margin-top: 40px;
margin-bottom: 60px;
}
.price {
font-size: 72px;
color: #002b47;
text-align: center;
font-weight: bolder;
}
.price-desc {
font-size: 24px;
color: #002b47;
text-align: center;
}
.coupon-info {
flex: 1;
height: 60px;
padding-left: 20px;
}
.coupon-name {
font-size: 24px;
color: #002b47;
margin-bottom: 10px;
}
.coupon-time {
font-size: 22px;
color: #999;
}
</style>
... ...
... ... @@ -11,6 +11,7 @@ import cookie from 'yoho-cookie';
import yoho from 'common/yoho';
import OrderPayType from 'components/order-pay-type';
import OrderCouponList from 'components/order-coupon-list';
import OrderPromotionList from 'components/order-promotion-list';
import Bind from 'components/bind';
import sdk from 'yoho-activity-sdk';
... ... @@ -41,6 +42,7 @@ Vue.prop('api', api);
Vue.use(Lazy, { error: '' });
Vue.use(OrderPayType);
Vue.use(OrderCouponList);
Vue.use(OrderPromotionList);
Vue.use(Bind);
... ...
... ... @@ -5,7 +5,7 @@
<AddressInfo :data="address" class="order-item" :show-tip="false"></AddressInfo>
<ProductInfo :data="orderDetail.good" class="product-info order-item"></ProductInfo>
<Coupon class="order-item" :data="orderDetail.recommendedCouponInfo" @click="onCouponClick"></Coupon>
<Promotion class="order-item" :data="orderDetail.promotionTips"></Promotion>
<Promotion class="order-item" :data="orderDetail.promotionTips" @click="onPromotionClick"></Promotion>
<BuyerFeeInfo :data="orderDetail.promotionFormulaList" class="order-item"></BuyerFeeInfo>
<div class="tip2 order-item">{{orderDetail.specialTips}}</div>
<div class="tip order-item" v-html="replaceBr(orderDetail.damagesDesc)"></div>
... ... @@ -78,16 +78,32 @@ export default {
onCouponClick() {
let vm = this;
this.$createOrderCouponList({
this.couponListActionSheet = this.$createOrderCouponList({
data: this.orderDetail.couponList,
onItemClickAction(item) {
vm.onCouponItemClick(item);
},
onConfirmAction() {
vm.couponListActionSheet.hide();
}
}).show();
},
onCouponItemClick(item) {
console.log(item);
},
onPromotionClick() {
let vm = this;
this.promotionListActionSheet = this.$createOrderPromotionList({
data: this.orderDetail.promotionList,
onItemClickAction(item) {
vm.onCouponItemClick(item);
},
onConfirmAction() {
vm.promotionListActionSheet.hide();
}
}).show();
},
}
};
</script>
... ...
<template>
<div class="coupon-wrapper" @click="onClick">
<div class="title">促销<span class="desc">{{data.desc}}</span></div>
<div><span class="red">{{data.coupon_amount_str}}</span><i class="iconfont iconright"></i></div>
<div class="title">促销<span class="desc">{{data.title}}</span></div>
<div><span class="red">{{data.amount}}</span><i class="iconfont iconright"></i></div>
</div>
</template>
... ...