洪海涛 8 년 전
부모
커밋
a13e721b76

+ 2 - 2
.gitignore

@@ -35,7 +35,7 @@ phpunit.phar
 #otherfiles
 env.txt
 /www/index.php
-/www/webapp/react
 *.log
 *.bin
-node_modules/*
+/www/vue/node_modules
+*/node_modules

+ 0 - 3
mine.vue

@@ -1,3 +0,0 @@
-[swiper c2ec34e] swiper.vue==
- 5 files changed, 6 insertions(+), 5 deletions(-)
- rename www/vue/src/components/{swiper.vue => mine.vue} (92%)

+ 4 - 0
www/vue/config/index.js

@@ -32,6 +32,10 @@ module.exports = {
         target: apiPath+'/index.php?r=', //你的目标域名
         changeOrigin: true
       },
+      '/api': {
+        target: apiPath+'/index.php?r=', //你的目标域名
+        changeOrigin: true
+      },
     },
     // CSS Sourcemaps off by default because relative paths are "buggy"
     // with this option, according to the CSS-Loader README

+ 1 - 1
www/vue/dist/index.html

@@ -1,4 +1,4 @@
-<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,minimum-scale=1,maximum-scale=1,user-scalable=no"><title>vue</title><style>html, body {
+<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,minimum-scale=1,maximum-scale=1,user-scalable=no"><script type=text/javascript src=https://code.jquery.com/jquery-2.2.0.min.js></script><script type=text/javascript src="http://webapi.amap.com/maps?v=1.3&key=ea4228b685c663ac62af7da3a0702c97"></script><title>vue</title><style>html, body {
       height: 100%;
       width: 100%;
       overflow-x: hidden;

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
www/vue/dist/static/css/app.css


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
www/vue/dist/static/js/app.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
www/vue/dist/static/js/vendor.js


+ 66 - 17
www/vue/src/components/address/addressAdd.vue

@@ -1,11 +1,19 @@
 <template>
   <div>
     <div class="get-addres-box">
-      <input type="value" v-model="value">
+      <input type="value" v-model="value" placeholder="请搜索您的位置" @input="onItemAmountInput($event, value)">
       <div class="get-addres" @click="getAddres">搜索</div>
     </div>
-    <div v-for="item in results">
-      <h4>{{item.name}}</h4>
+    <!--地区列表-->
+    <div class="results-list-box" v-show="isShow">
+      <div class="results-list" v-for="item in results">
+        <div>{{item.name}}</div>
+        <span>{{item.city}}</span>
+        <span>{{item.district}}</span>
+      </div>
+    </div>
+    <div v-if="!value">
+      <h3>请输入地址查询用户信息</h3>
     </div>
   </div>
 </template>
@@ -16,43 +24,84 @@
   export default {
     data () {
       return {
-        results: [],
+        results: config.addressPio,
+        isShow: false,
         value: ''
       }
     },
+    watch: {
+      a: function () {
+
+      }
+    },
     components: {},
     methods: {
-      getAddres () {
-        console.log('请输入地址')
-        if (this.value) {
-          axios.get('/api').then(function (res) {
-            config.addressPio = res.data.result
-          })
-          this.results = config.addressPio
+      onItemAmountInput (event, value) {
+        console.log(event)
+        const amount = parseFloat(event.target.value)
+        // 一樣就不繼續了
+        if(item.amount === amount) return
+        // 檢測輸入的是否為數字
+        if(this.isNumeric(event.target.value)) {
+          item.amount = amount
+          // 計算金額
+          this.calculateMoney(item)
         } else {
-          console.log('请输入地址')
+          item.amount = 0
+        }
+        console.log(event)
+        axios.get('https://bird.ioliu.cn/v1?url=http://api.map.baidu.com/place/v2/suggestion&ak=B349f0b32ef6e78b2e678f45cb9fddaf&output=json&query=' + event + '&region=%E4%B8%8A%E6%B5%B7%E5%B8%82').then(function (res) {
+            cosnole.log(res)
+            config.addressPio = res.data.result
+          },
+          getAddres(evl)
+        {
+          console.log(evl)
+          if (evl) {
+//          axios.get('api/shop/getDetailAddressByQuery&query=' + evl).then(function (res) {
+//            console.log(res)
+//            config.addressPio = res.data.result
+//          })
+            axios.get('https://bird.ioliu.cn/v1?url=http://api.map.baidu.com/place/v2/suggestion&ak=B349f0b32ef6e78b2e678f45cb9fddaf&output=json&query=' + evl + '&region=%E4%B8%8A%E6%B5%B7%E5%B8%82').then(function (res) {
+              cosnole.log(res)
+              config.addressPio = res.data.result
+              this.isShow = true
+            })
+            this.results = config.addressPio
+          } else {
+            this.results = []
+            console.log('请输入地址')
+          }
         }
       }
     }
-  }
 </script>
 
 <style lang="less" scoped>
-  .get-addres-box{
+  .results-list-box {
+    .results-list {
+      background-color: #fff;
+      width: 95%;
+      margin: 0 auto;
+      border-bottom: 1px solid rgba(0, 0, 0, 0.3);
+    }
+  }
+
+  .get-addres-box {
     width: 80%;
     margin: 0 auto;
     display: flex;
     padding: 15px;
-    input{
+    input {
       width: 80%;
       border: 1px solid rgba(0, 0, 0, 0.5);
     }
-    .get-addres{
+    .get-addres {
       width: 20%;
       padding: 2%;
       color: #fff;
       background-color: #a78b03;
-      &:active{
+      &:active {
         background-color: #bd9f03;
       }
     }

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

@@ -6,7 +6,7 @@
         <img slot="icon-active" :src='iconHomeActive'>
         <span slot="label">首页</span>
       </tabbar-item>
-      <tabbar-item link="/addressList">
+      <tabbar-item link="/addressAdd">
         <img slot="icon" :src='iconOrder'>
         <img slot="icon-active" :src='iconOrderActive'>
         <span slot="label">订单</span>

+ 1 - 1
www/vue/src/main.js

@@ -25,7 +25,7 @@ Vue.use(VueRouter)
 Vue.use(VueAwesomeSwiper)
 Vue.use(VueScroller)
 const router = new VueRouter({
-  mode: 'history',
+  // mode: 'history',
   routes
 })
 

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.