洪海涛 8 years ago
parent
commit
6a5a2b0366

File diff suppressed because it is too large
+ 0 - 0
www/vue/dist/static/js/app.js


File diff suppressed because it is too large
+ 0 - 0
www/vue/dist/static/js/vendor.js


+ 0 - 2
www/vue/src/App.vue

@@ -1,6 +1,5 @@
 <template>
   <div id="app">
-    <!-- <navTitle></navTitle> -->
     <div class="router-view">
       <router-view></router-view>
     </div>
@@ -32,7 +31,6 @@
     left: 0;
     right: 0;
     bottom:0;
-    /*background-color: #d3d3d3;*/
     background-color: rgba(211, 211, 211, 0.3);
   }
 </style>

+ 1 - 1
www/vue/src/components/home.vue

@@ -32,7 +32,7 @@
     created () {
       this.PRODUCTLIST()
       this.USERINFO()
-      console.log(this.$store.state.user.userId)
+      console.log(this.$store.state.product.products)
     },
     methods: {
       ...mapActions([

+ 11 - 54
www/vue/src/components/homeList.vue

@@ -14,74 +14,31 @@
 </template>
 
 <script>
+  import config from '../config/config'
   export default {
     name: 'home',
     data () {
       return {
-        productIcon: [
-          {
-            name: '母婴清洁',
-            id: '57e3a5a49f5160c9048b457c',
-            url: 'http://oduj3utzz.bkt.clouddn.com/home-mother-child.png',
-            color: '#a6dc48'
-          },
-          {
-            name: '日常清洁',
-            id: '57e0dffc9f5160dd048b4568',
-            url: 'http://oduj3utzz.bkt.clouddn.com/home-daily.png',
-            color: '#76a6f6'
-          },
-          {
-            name: '深度清洁',
-            id: '57e0e0189f5160dc048b4568',
-            url: 'http://oduj3utzz.bkt.clouddn.com/home-depth.png',
-            color: '#5ecdec'
-          },
-          {
-            name: '专业除螨',
-            id: '57e0e0369f5160b1048b456b',
-            url: 'http://oduj3utzz.bkt.clouddn.com/home-mites.png',
-            color: '#b17ff6'
-          },
-          {
-            name: '家电清洗',
-            url: 'http://oduj3utzz.bkt.clouddn.com/home-appliances.png',
-            id: '57e0e04e9f5160af048b456b',
-            color: '#fabf4c'
-          },
-          {
-            name: '新居开荒',
-            id: '57e0e0879f5160b8048b4571',
-            url: 'http://oduj3utzz.bkt.clouddn.com/home-new-home.png',
-            color: '#5adde9'
-          },
-          {
-            name: '擦玻璃',
-            id: '57fb4a909f5160b2048b4a0e',
-            url: 'http://oduj3utzz.bkt.clouddn.com/home-ca-bo-li.png',
-            color: '#70df68'
-          },
-          {
-            name: '租房大扫除',
-            id: '57e0e0709f5160aa048b456c',
-            url: 'http://oduj3utzz.bkt.clouddn.com/home-renting.png',
-            color: '#fcac71'
-          }
-        ]
+        productIcon: config.productIcon
+      }
+    },
+    created () {
+      for (let i in config.productIcon) {
+        console.log(config.productIcon[i])
+        console.log(this.$store.state.product.products)
       }
     },
     methods: {
       pro: function (id) {
+        config.productInfo = {}
         let products = this.$store.state.product.products
-        let productBox = {}
         for (let i in products) {
           if (products[i].id === id) {
-            productBox = products[i]
+            config.productInfo = products[i]
           }
         }
-
         // 带查询参数,变成 /register?plan=private
-        this.$router.push({path: 'product', query: {productBox: productBox}})
+        this.$router.push({path: 'product'})
       }
     }
   }

+ 8 - 20
www/vue/src/components/product.vue

@@ -27,33 +27,25 @@
     name: 'product',
     data () {
       return {
-        productBox: this.$route.query.productBox,
-        extraB: this.$route.query.productBox.extra,
+        productBox: config.productInfo,
+        extraB: config.productInfo.extra,
         isActive: -1
       }
     },
-
-    created () {
-      if (typeof(this.$route.query.productBox) ) {
-        config.productInfo = this.$route.query.productBox
-        console.log(config.productInfo)
-      }
+    beforeCreate () {},
+    computed: {
+      ...mapState({
+        order: state => state.order,
+        orderChange: state => state.orderChange
+      })
     },
-    computed: mapState({
-      order: state => state.order,
-      orderChange: state => state.orderChange
-    }),
     methods: {
       ...mapActions([
         'PAYCHANGE'
       ]),
-      getId: function () {
-        console.log(this.$route.query.productBox)
-      },
       btnOrder: function (cb) {
         config.formData = new FormData()
         const balance = 0
-        console.log(balance)
         let productParamJson = ''
         productParamJson = JSON.stringify([{
           product_id: '57e3a5a49f5160c9048b457c', // 产品ID
@@ -61,15 +53,11 @@
         }])
         //  let coupons = qs.stringify({0: '5836a1979f5160a7048b5a51'})
         //  let coupons = JSON.stringify({0: ''})
-        console.log(productParamJson)
         let extraJson = ''
         extraJson = JSON.stringify([{type: '整间日常清洁', price: '388'}])
-        console.log(extraJson)
         const channel = 'wx_pub'
         const addressId = this.$store.state.user.userInfo.shop_address[0].address_id
         const time = '2017-06-21 11:00'
-        console.log(channel)
-        console.log(config)
         config.orderInfo = ''
 //        config.formData.append('balance', balance)
 //        config.formData.append('products', productParamJson)

+ 0 - 8
www/vue/src/config/api.js

@@ -57,10 +57,6 @@ export default ({
         let payInfo = {user_id: config.userId, order_id: orderID, pay_channel: payChannel}
         payInfo = qs.stringify(payInfo)
         axios.post('o2o/order/pay', payInfo).then(function (res) {
-          //  let tmp = {orderData: data, changeData: res.data}
-          console.log(61)
-          console.log(res.data)
-          // let WxPay = res.data
           if (!config.test) {
             pingpp.createPayment(res.data.data, function (result, err) {
               if (result === 'success') {
@@ -78,7 +74,6 @@ export default ({
               }
             })
           } else {
-            // window.location.href='http://commontest.yiguanjia.me/index.php?r=o2o/web/index';
             // 支付凭据
             console.log(82)
             let wxPay = res.data.data
@@ -95,13 +90,10 @@ export default ({
                 '&created=' + wxPay.created + '&body=' +
                 wxPay.body + '&bookingTime=' + bookingTime
           }
-
-          //  cb(tmp)
         }).catch(function (e) {
           console.log(e)
         })
       }
-      // console.log(data)
     }).catch(function (error) {
       console.log(error)
     })

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

@@ -2,10 +2,11 @@ import axios from 'axios'
 let apiPath = ''
 let uri = location.href
 let test = true
-var userId = ''
-var formData = ''
-var orderInfo = []
-var productInfo = {}
+let userId = ''
+let formData = ''
+let orderInfo = []
+let productInfo = {}
+let productIcon = []
 if (uri.indexOf('common.yiguanjia.me') > -1) {
   test = false
 }
@@ -26,6 +27,57 @@ if (uri.indexOf('http://localhost:8080/') > -1) {
   userId = '57e38f1b9f5160ac048b457d'
 }
 
+productIcon = [
+  {
+    name: '母婴清洁',
+    id: '57e3a5a49f5160c9048b457c',
+    url: 'http://oduj3utzz.bkt.clouddn.com/home-mother-child.png',
+    color: '#a6dc48'
+  },
+  {
+    name: '日常清洁',
+    id: '57e0dffc9f5160dd048b4568',
+    url: 'http://oduj3utzz.bkt.clouddn.com/home-daily.png',
+    color: '#76a6f6'
+  },
+  {
+    name: '深度清洁',
+    id: '57e0e0189f5160dc048b4568',
+    url: 'http://oduj3utzz.bkt.clouddn.com/home-depth.png',
+    color: '#5ecdec'
+  },
+  {
+    name: '专业除螨',
+    id: '57e0e0369f5160b1048b456b',
+    url: 'http://oduj3utzz.bkt.clouddn.com/home-mites.png',
+    color: '#b17ff6'
+  },
+  {
+    name: '家电清洗',
+    url: 'http://oduj3utzz.bkt.clouddn.com/home-appliances.png',
+    id: '57e0e04e9f5160af048b456b',
+    color: '#fabf4c'
+  },
+  {
+    name: '新居开荒',
+    id: '57e0e0879f5160b8048b4571',
+    url: 'http://oduj3utzz.bkt.clouddn.com/home-new-home.png',
+    color: '#5adde9'
+  },
+  {
+    name: '擦玻璃',
+    id: '57fb4a909f5160b2048b4a0e',
+    url: 'http://oduj3utzz.bkt.clouddn.com/home-ca-bo-li.png',
+    color: '#70df68'
+  },
+  {
+    name: '租房大扫除',
+    id: '5851fb3b9f5160c5048b6412',
+    url: 'http://oduj3utzz.bkt.clouddn.com/home-renting.png',
+    color: '#fcac71'
+  }
+]
+
 axios.defaults.baseURL = apiPath
 axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'
 export default {
@@ -33,5 +85,6 @@ export default {
   formData: formData,
   orderInfo: orderInfo,
   test: test,
-  productInfo: productInfo
+  productInfo: productInfo,
+  productIcon: productIcon
 }

+ 0 - 1
www/vue/src/store/PayCharge.js

@@ -7,7 +7,6 @@ export default {
   mutations: {
     PARAMSCHARGE (state, PayCharge) {
       state.PayCharge = PayCharge
-      console.log(state.PayCharge)
     }
   },
   actions: {

+ 0 - 2
www/vue/src/store/order.js

@@ -13,8 +13,6 @@ export default {
       let orderData = res.orderData
       state.order = orderData
       state.orderChange = changeData
-      console.log(state.orderChange)
-      console.log(state.order)
     }
   },
   actions: {

+ 0 - 2
www/vue/src/store/orderChange.js

@@ -13,9 +13,7 @@ export default {
   },
   actions: {
     PAYCHANGE ({commit}, orderID, payChannel) {
-      console.log(orderID)
       api.getPayOrderChange(orderID, payChannel, function (res) {
-        console.log(res.data)
         commit('PAYCHANGE', res.data)
       })
     }

+ 0 - 1
www/vue/src/store/product.js

@@ -10,7 +10,6 @@ export default {
   mutations: {
     PRODUCTLIST (state, products) {
       state.products = products
-      console.log(state.products)
     }
   },
   actions: {

+ 0 - 1
www/vue/src/store/user.js

@@ -11,7 +11,6 @@ export default {
     // 注意,这里可以设置 state 属性,但是不能异步调用,异步操作写到 actions 中
     USERINFO (state, userInfo) {
       state.userInfo = userInfo
-      console.log(state.userInfo)
     }
   },
   actions: {

Some files were not shown because too many files changed in this diff