@@ -61,6 +61,7 @@
onLoad(pam) {
this.pam = pam
this.getGoods()
+ this.getAddList()
uni.$on("chooseAddress", (data) => {
this.hasAddress = true
this.addressInfo = data
@@ -73,6 +74,19 @@
},
methods: {
+ getAddList() {
+ this.$api.get('/user/address/list', {
+ pageNum: 1,
+ pageSize: -1,
+ userId: this.$store.state.user.userId
+ }).then(res => {
+ var data = res.data.records.find(item => item.defaultAddr)
+ if (data) {
+ this.hasAddress = true
+ this.addressInfo = data
+ }
+ })
+ },
submitOrder() {
if (!this.btnBool) {
return
@@ -327,4 +341,4 @@
margin: 0;
}
-</style>
+</style>