...
|
...
|
@@ -39,6 +39,29 @@ |
|
|
<span class="iconfont iconwarn"></span>
|
|
|
<p>{{ stateCenterAddress.deliverDesc }}</p>
|
|
|
</div>
|
|
|
|
|
|
<!-- 新增价格信息 -->
|
|
|
<div class="coupon-wrapper" v-if="orderFeeInfo.couponInfo" @click="onCouponClick">
|
|
|
<div class="title">优惠券<span class="desc">{{orderFeeInfo.couponInfo.desc || ''}}</span></div>
|
|
|
<div><span class="price">{{orderFeeInfo.couponInfo.coupon_amount_str || '¥0'}}</span><i class="iconfont iconright icon-right"></i></div>
|
|
|
</div>
|
|
|
|
|
|
<div class="price-info item-wrapper" v-if="orderFeeInfo.platformFee">
|
|
|
<p class="platform-fee">
|
|
|
<span class="label"
|
|
|
>平台费用:</span>
|
|
|
<span>{{orderFeeInfo.platformFee.amount || '¥0'}}</span>
|
|
|
</p>
|
|
|
<p class="delivery-fee">
|
|
|
<span class="label">银行转账费(1%):</span>
|
|
|
<span>{{orderFeeInfo.bankTransferFee || '¥0'}}</span>
|
|
|
</p>
|
|
|
<p>
|
|
|
<span class="label">实收入:</span>
|
|
|
<span class="pay-price">{{orderFeeInfo.income || '¥0'}}</span>
|
|
|
</p>
|
|
|
</div>
|
|
|
|
|
|
<div class="submit-warp">
|
|
|
<div class="contract-check">
|
|
|
<i
|
...
|
...
|
@@ -69,36 +92,42 @@ |
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { get } from "lodash";
|
|
|
import { Button, Input } from "cube-ui";
|
|
|
import { createNamespacedHelpers } from "vuex";
|
|
|
import { get } from 'lodash';
|
|
|
import { Button, Input } from 'cube-ui';
|
|
|
import { createNamespacedHelpers } from 'vuex';
|
|
|
|
|
|
const { mapState, mapActions } = createNamespacedHelpers("order/orderDeliver");
|
|
|
const { mapState, mapActions } = createNamespacedHelpers('order/orderDeliver');
|
|
|
|
|
|
export default {
|
|
|
name: "OrderDeliver",
|
|
|
name: 'OrderDeliver',
|
|
|
data() {
|
|
|
return {
|
|
|
canCopy: false,
|
|
|
canScan: false,
|
|
|
centerAddress: {},
|
|
|
expressCode: "",
|
|
|
readContract: false
|
|
|
expressCode: '',
|
|
|
readContract: false,
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
let { skup, code } = this.$route.params || {};
|
|
|
|
|
|
this.orderCode = code;
|
|
|
if (process.env.VUE_ENV !== "server") {
|
|
|
if (process.env.VUE_ENV !== 'server') {
|
|
|
this.fetchAppraiseAddress({
|
|
|
skup,
|
|
|
orderCode: code
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 第一次进入发货页面,获取费用
|
|
|
this.computeWithCoupon({
|
|
|
orderCode: code,
|
|
|
couponCode: ''
|
|
|
});
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(["appraiseAddress"]),
|
|
|
...mapState(['appraiseAddress', 'orderFeeInfo', 'selectCouponCode']),
|
|
|
stateCenterAddress() {
|
|
|
if (!this.centerAddress.address) {
|
|
|
this.centerAddress = get(this.appraiseAddress, this.orderCode) || {};
|
...
|
...
|
@@ -120,24 +149,24 @@ export default { |
|
|
|
|
|
this.fetchAppraiseAddressChangeNotice({ orderCode: this.orderCode }).then(
|
|
|
res => {
|
|
|
let isChanged = get(res, "data.isChanged");
|
|
|
let isForceShow = get(res, "data.isForceShow");
|
|
|
let isChanged = get(res, 'data.isChanged');
|
|
|
let isForceShow = get(res, 'data.isForceShow');
|
|
|
|
|
|
if (!isChanged && !isForceShow) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
let {
|
|
|
title = "",
|
|
|
title = '',
|
|
|
tips,
|
|
|
alert_address_name,
|
|
|
alert_address,
|
|
|
alert_mobile
|
|
|
} = res.data || {};
|
|
|
let info = [
|
|
|
alert_address_name || "",
|
|
|
alert_address || "",
|
|
|
alert_mobile || ""
|
|
|
alert_address_name || '',
|
|
|
alert_address || '',
|
|
|
alert_mobile || ''
|
|
|
];
|
|
|
|
|
|
if (isChanged && tips) {
|
...
|
...
|
@@ -146,41 +175,40 @@ export default { |
|
|
|
|
|
this.$createDialog(
|
|
|
{
|
|
|
type: "alert",
|
|
|
type: 'alert',
|
|
|
confirmBtn: {
|
|
|
text: "我知道了"
|
|
|
text: '我知道了'
|
|
|
},
|
|
|
onConfirm() {
|
|
|
// Todo report()
|
|
|
console.log("Todo Report", res.data);
|
|
|
console.log('Todo Report', res.data);
|
|
|
}
|
|
|
},
|
|
|
createElement => {
|
|
|
return [
|
|
|
createElement(
|
|
|
"div",
|
|
|
'div',
|
|
|
{
|
|
|
class: {
|
|
|
"dg-notice-content": true
|
|
|
'dg-notice-content': true
|
|
|
},
|
|
|
slot: "content"
|
|
|
slot: 'content'
|
|
|
},
|
|
|
[
|
|
|
createElement(
|
|
|
"div",
|
|
|
'div',
|
|
|
{
|
|
|
class: {
|
|
|
"dg-notice-content-title": true
|
|
|
'dg-notice-content-title': true
|
|
|
}
|
|
|
},
|
|
|
isChanged ? "仓库调整公告" : title
|
|
|
isChanged ? '仓库调整公告' : title
|
|
|
),
|
|
|
...info.map(val => {
|
|
|
return createElement(
|
|
|
"p",
|
|
|
'p',
|
|
|
{
|
|
|
class: {
|
|
|
"dg-notice-content-info": true
|
|
|
'dg-notice-content-info': true
|
|
|
}
|
|
|
},
|
|
|
val
|
...
|
...
|
@@ -196,15 +224,53 @@ export default { |
|
|
},
|
|
|
methods: {
|
|
|
...mapActions([
|
|
|
"fetchAppraiseAddress",
|
|
|
"fetchAppraiseAddressChangeNotice",
|
|
|
"deliverOrderToDepot"
|
|
|
'fetchAppraiseAddress',
|
|
|
'fetchAppraiseAddressChangeNotice',
|
|
|
'deliverOrderToDepot',
|
|
|
'computeWithCoupon',
|
|
|
'changeSelectCouponList'
|
|
|
]),
|
|
|
onCouponClick() {
|
|
|
let vm = this;
|
|
|
|
|
|
this.couponListActionSheet = this.$createOrderCouponList({
|
|
|
$props: {
|
|
|
data: this.orderFeeInfo.couponList,
|
|
|
},
|
|
|
onItemClickAction(item) {
|
|
|
vm.onCouponItemClick(item);
|
|
|
},
|
|
|
onConfirmAction() {
|
|
|
vm.couponListActionSheet.hide();
|
|
|
vm.compute();
|
|
|
},
|
|
|
onCloseAction() {
|
|
|
vm.compute();
|
|
|
}
|
|
|
}).show();
|
|
|
},
|
|
|
onCouponItemClick(item) {
|
|
|
this.changeSelectCouponList(item);
|
|
|
},
|
|
|
compute() {
|
|
|
return this.computeWithCoupon({
|
|
|
orderCode: this.orderCode,
|
|
|
couponCode: this.selectCouponCode
|
|
|
}).then(result => {
|
|
|
if (result.code !== 200) {
|
|
|
this.$createToast({
|
|
|
time: 1500,
|
|
|
txt: result.message,
|
|
|
type: 'txt'
|
|
|
}).show();
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
toast(msg, time = 1500) {
|
|
|
this.$createToast &&
|
|
|
this.$createToast({
|
|
|
txt: msg,
|
|
|
type: "txt",
|
|
|
type: 'txt',
|
|
|
time
|
|
|
}).show();
|
|
|
},
|
...
|
...
|
@@ -221,7 +287,7 @@ export default { |
|
|
},
|
|
|
scanCode() {
|
|
|
if (window && window.WindVane) {
|
|
|
window.WindVane.call("Scancode", "scan", {}, e => {
|
|
|
window.WindVane.call('Scancode', 'scan', {}, e => {
|
|
|
if (e && e.code) {
|
|
|
this.expressCode = e.code;
|
|
|
}
|
...
|
...
|
@@ -246,17 +312,17 @@ export default { |
|
|
this.deliverOrderToDepot({
|
|
|
orderCode: this.orderCode,
|
|
|
wayBillCode: this.expressCode,
|
|
|
depotNum: this.stateCenterAddress.id
|
|
|
depotNum: this.stateCenterAddress.id,
|
|
|
couponCode: this.selectCouponCode,
|
|
|
}).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.$router.go(-1);
|
|
|
// Todo report()
|
|
|
} else {
|
|
|
this.toast(res.message || "网络异常,请稍后重试");
|
|
|
this.toast(res.message || '网络异常,请稍后重试');
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
this.toast("请输入正确的快递单号");
|
|
|
this.toast('请输入正确的快递单号');
|
|
|
}
|
|
|
}
|
|
|
},
|
...
|
...
|
@@ -412,6 +478,7 @@ export default { |
|
|
display: flex;
|
|
|
align-items: flex-start;
|
|
|
padding-top: 16px;
|
|
|
padding-bottom: 40px;
|
|
|
|
|
|
.iconfont {
|
|
|
font-size: 32px;
|
...
|
...
|
@@ -429,6 +496,70 @@ export default { |
|
|
}
|
|
|
}
|
|
|
|
|
|
.coupon-wrapper {
|
|
|
display: flex;
|
|
|
padding: 40px 0;
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
border-top: 1px solid #eee;
|
|
|
|
|
|
.title {
|
|
|
font-size: 32px;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
}
|
|
|
|
|
|
.desc {
|
|
|
font-size: 24px;
|
|
|
color: #9B9B9B;
|
|
|
margin-left: 12px;
|
|
|
}
|
|
|
|
|
|
.price {
|
|
|
color: #B0B0B0;
|
|
|
font-size: 32px;
|
|
|
margin-right: 10px;
|
|
|
}
|
|
|
|
|
|
.icon-right {
|
|
|
font-size: 24px;
|
|
|
color: #999;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.item-wrapper {
|
|
|
border-top: 1px solid #eee;
|
|
|
padding: 40px 0;
|
|
|
}
|
|
|
|
|
|
.price-info {
|
|
|
font-size: 28px;
|
|
|
|
|
|
& > p {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
}
|
|
|
|
|
|
.platform-fee {
|
|
|
line-height: 1;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
}
|
|
|
|
|
|
.delivery-fee {
|
|
|
margin: 20px 0;
|
|
|
}
|
|
|
|
|
|
.pay-price {
|
|
|
color: #d0021b;
|
|
|
}
|
|
|
|
|
|
.label {
|
|
|
font-size: 28px;
|
|
|
margin-right: 12px;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.submit-warp {
|
|
|
width: 100%;
|
|
|
position: absolute;
|
...
|
...
|
|