Browse Source

feat: 修改数据

linwenxin 1 year ago
parent
commit
0e9ae833de
1 changed files with 15 additions and 1 deletions
  1. 15 1
      src/pages/goods/order.vue

+ 15 - 1
src/pages/goods/order.vue

@@ -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>