洪海涛 8 éve
szülő
commit
f25db76be3

+ 7 - 9
www/vue/src/components/address/addresList.vue

@@ -15,8 +15,8 @@
   </div>
 </template>
 <script>
-  import {mapActions} from 'vuex'
   import config from '../../config/config'
+  import axios from 'axios'
   export default {
     name: 'addressList',
     data () {
@@ -24,16 +24,14 @@
         shopAddress: []
       }
     },
-    beforeCreate () {},
+    beforeCreate () {
+    },
     created () {
-      this.USERINFO()
-      this.shopAddress = config.shopAddress
-      console.log(this.shopAddress)
+      axios.get('api/shop/addressList&request_from=weixin&user_id=' + config.userId).then(res => {
+        this.shopAddress = res.data.data
+      })
     },
     methods: {
-      ...mapActions([
-        'USERINFO'
-      ]),
       clear () {
         console.log(config)
         config.addressAdd = {
@@ -61,7 +59,7 @@
   }
 </script>
 <style scoped lang="less">
-  .address-body{
+  .address-body {
     background-color: white;
     h4 {
       margin-top: 15px;

+ 1 - 9
www/vue/src/components/address/addressDetail.vue

@@ -51,11 +51,8 @@
     },
     components: {XInput, Group, Cell, Alert},
     beforeCreate () {
-//      localStorage.setItem('positionName', '请定位您的小区或者街道')
       if (localStorage.getItem('positionName')) {
-//        console.log('true')
       } else {
-//        console.log('false')
         localStorage.setItem('positionName', '请定位您的小区或者街道')
       }
     },
@@ -130,15 +127,10 @@
             }
           }
         }
-
-        // 新增地址
+        // 编辑地址
         axios.get('api/shop/editAddress&request_from=weixin&name=' + this.userName + '&mobile=' + this.userMobile + '&user_id=' + config.userId + '&address_id=' + config.editAddress.address_id + '&address_position=' + JSON.stringify(config.addressPio.location) + '&address=' + JSON.stringify(config.addressDetail)).then(res => {
           if (res.data.success) {
-            console.log(res.data)
             this.$router.push({path: '/addressList'})
-
-//            console.log(res.data.data.address)
-//            console.log(config.shopAddress)
 //            this.alertTitle = '恭喜'
 //            this.alertContent = '修改成功!'
 //            this.showAlert = true

+ 1 - 4
www/vue/src/components/homeList.vue

@@ -16,7 +16,6 @@
 
 <script>
   import config from '../config/config'
-  import selectTime from '../config/selectTime'
   import product from '../config/product'
   export default {
     name: 'home',
@@ -25,9 +24,7 @@
         productIcon: product.productIcon
       }
     },
-    created () {
-      console.log(selectTime)
-    },
+    created () {},
     methods: {
       btn: function () {
         console.log(this.$store.state.product)

+ 1 - 3
www/vue/src/components/placeOrder.vue

@@ -90,7 +90,6 @@
       if (this.$store.state.order.time !== undefined) {
         selectTime.serviceHours = this.$store.state.order.time
       }
-      console.log(config.order.time)
     },
     computed: {
       ...mapState({
@@ -99,6 +98,7 @@
       })
     },
     methods: {
+      // 监听时间插件值得变化
       clearConfig () {
         console.log(config)
       },
@@ -112,7 +112,6 @@
       change (val) {
         this.$store.state.order.time = val
         config.order.time = val
-        console.log(this.$store.state.order.time)
       },
       btnOrder: function (cb) {
         if (localStorage.getItem('extra') === null && config.productInfo.extra.length !== 0) {
@@ -174,7 +173,6 @@
         config.order.extra = JSON.stringify(config.productInfo.extra[index])
         this.isActive = index
         config.isActive = index
-        console.log(config.isActive)
       }
     }
   }

+ 1 - 5
www/vue/src/config/config.js

@@ -19,10 +19,7 @@ let addressAdd = {
 }
 let addressDetail = {}
 let addressPio = [] //
-addressPio.location = {}
 let showPosition = '' // 显示隐藏搜索框
-// 这里是地址列表
-let shopAddress = []
 // 这里是编辑地址状态
 let editAddress = []
 // 这里是删除地址状态
@@ -66,6 +63,5 @@ export default {
   addressDetail: addressDetail,
   showPosition: showPosition,
   editAddress: editAddress,
-  orderAddress: orderAddress,
-  shopAddress: shopAddress
+  orderAddress: orderAddress
 }