<script>
|
import {
|
mapState
|
} from 'vuex'
|
|
export default {
|
name: "订单详情",
|
computed: {
|
...mapState({
|
address: state => {
|
return state.defaultaddress || {}
|
},
|
}),
|
},
|
watch: {
|
// address(nv, ov) {
|
// if (nv && nv.id) {
|
// //尝试更新一下
|
//
|
// }
|
// }
|
},
|
async onShow() {
|
setTimeout(async () => {
|
if (this.address && this.address.id && this.cacheAddressId !== this.address.id) {
|
this.$message.showLoading()
|
const {code, data} = await this.$http.request('get', '/api/flower/customer/order/confirm/transports', {
|
data: {
|
addressId: this.address.id,
|
weight: this.dto.totalWeight || 0
|
}
|
})
|
this.$message.hideLoading()
|
this.transportList = []
|
if (code === 0) {
|
this.transportList = data || []
|
}
|
}
|
}, 200)
|
},
|
onLoad(options) {
|
let item = JSON.parse(decodeURIComponent(options.query.dto));
|
this.dto = {
|
...this.dto,
|
...item
|
}
|
//先获取直接的全部地址
|
// @ApiModelProperty(value = "订单商品")
|
// private List<FlowerCartListDTO> flowers;
|
// @ApiModelProperty(value = "打包费")
|
// private BigDecimal packing;
|
//todo 显示打包费等,然后再确认
|
// https://lanhuapp.com/web/#/item/project/detailDetach?pid=05830e81-7c59-4655-8253-4deb7c913b51&project_id=05830e81-7c59-4655-8253-4deb7c913b51&image_id=f7cc3e57-5367-4b99-a84e-99c38249aa66&fromEditor=true
|
|
},
|
data() {
|
return {
|
dto: {},
|
cacheAddressId: '',
|
transportList: [],
|
// private Long id;
|
// @ApiModelProperty(value = "名称")
|
// private String name;
|
// @ApiModelProperty(value = "英文名")
|
// private String enName;
|
// @ApiModelProperty(value = "运费")
|
// private BigDecimal fee;
|
}
|
}
|
}
|
</script>
|
|
<template>
|
<view class="page-confirm">
|
<view>
|
<common-address-select ref="addressselect"></common-address-select>
|
</view>
|
<view>
|
<!-- todo 查看商品列表,和选择运费 -->
|
</view>
|
<view class="bottom-price flex">
|
<view>
|
合计:¥ {{ dto.totalAmount||0 }} 元
|
</view>
|
<view class="button-green-1">
|
提交订单
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<style scoped lang="scss">
|
.page-confirm{
|
|
.bottom-price {
|
position: fixed;
|
left: 0rpx;
|
padding: 20rpx;
|
right: 0rpx;
|
bottom: 160rpx;
|
}
|
}
|
</style>
|