xuxueyang
2024-07-23 89de2bbaf2e81ab3fa7a8c2aad3b76bc81033d3d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<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>