李志伟 3 年之前
父節點
當前提交
7dce141fe4
共有 11 個文件被更改,包括 87 次插入83 次删除
  1. 11
    0
      src/api/register.js
  2. 0
    11
      src/api/signup.js
  3. 2
    2
      src/main.js
  4. 0
    1
      src/pages/AllPages.vue
  5. 6
    9
      src/pages/IndexImage.vue
  6. 13
    16
      src/pages/Test.vue
  7. 2
    3
      src/pages/index.vue
  8. 3
    2
      src/pages/resultPage.vue
  9. 26
    30
      src/pages/signup.vue
  10. 1
    4
      src/utils/request.js
  11. 23
    5
      vue.config.js

+ 11
- 0
src/api/register.js 查看文件

@@ -0,0 +1,11 @@
1
+import request  from "../utils/request";
2
+import { baseURL } from "../utils/request";
3
+/**
4
+ * 报名
5
+ * @param {*} person 
6
+ * @returns 
7
+ */
8
+export function register(data) {
9
+  const url = `${baseURL}/register`
10
+  return request(url, { method: 'POST', body: JSON.stringify(data) })
11
+}

+ 0
- 11
src/api/signup.js 查看文件

@@ -1,11 +0,0 @@
1
-import request from "../utils/request";
2
-
3
-/**
4
- * 报名
5
- * @param {*} person 
6
- * @returns 
7
- */
8
- export function singup(data) {
9
-  const url = `${baseURL}/singup`
10
-  return request(url, { method: 'POST', body: JSON.stringify(data) })
11
-}

+ 2
- 2
src/main.js 查看文件

@@ -10,9 +10,9 @@ import router from './router'
10 10
 import Swiper from './components/Swiper'
11 11
 import SwiperSlide from './components/SwiperSlide'
12 12
 
13
-import { Popup } from 'vant';
14
-import { Area } from 'vant';
13
+import { Popup, Picker, Area } from 'vant';
15 14
 Vue.use(Popup);
15
+Vue.use(Picker);
16 16
 Vue.use(Area);
17 17
 
18 18
 Vue.config.productionTip = false

+ 0
- 1
src/pages/AllPages.vue 查看文件

@@ -77,7 +77,6 @@ export default {
77 77
 
78 78
       switch (e) {
79 79
         case 'yushi':
80
-          console.log('yushi')
81 80
           var arr = JSON.stringify(this.typeYushi)
82 81
           this.$router.push({
83 82
             name: 'Test',

+ 6
- 9
src/pages/IndexImage.vue 查看文件

@@ -1,6 +1,5 @@
1 1
 <template>
2 2
   <div class="index-image">
3
-    <!-- <img :src="require('@/assets/images/index.png')" class="bg-image" @load="loadBg" /> -->
4 3
     <div class="index-inner-swiper">
5 4
       <swiper :options="swiperOptions">
6 5
         <swiper-slide class="index-inner-slide">
@@ -27,8 +26,8 @@ export default {
27 26
   name: 'IndexImage',
28 27
   props: {
29 28
     typeImage: {
30
-      type: Object
31
-      // default: () => ({})
29
+      type: Object,
30
+      default: () => ({})
32 31
     }
33 32
   },
34 33
   data() {
@@ -46,15 +45,13 @@ export default {
46 45
 <style lang="scss" scoped>
47 46
 .index-image {
48 47
   .index-inner-swiper {
49
-    width: 100vw;
50 48
     .index-inner-slide {
51 49
       position: relative;
52
-      left: -11vw;
53
-    }
54 50
 
55
-    img {
56
-      width: 100%;
57
-      height: 100%;
51
+      & > img {
52
+        width: 100%;
53
+        height: 37vh;
54
+      }
58 55
     }
59 56
   }
60 57
 }

+ 13
- 16
src/pages/Test.vue 查看文件

@@ -24,6 +24,7 @@
24 24
         <img style="width:100%;" src="../assets/buttonImage/1即刻尊享.png" />
25 25
       </div>
26 26
     </div>
27
+    
27 28
   </div>
28 29
 </template>
29 30
 
@@ -37,8 +38,8 @@ export default {
37 38
   },
38 39
   props: {
39 40
     typePages: {
40
-      type: Object
41
-      // default: () => ({})
41
+      type: Object,
42
+      default: () => ({})
42 43
     }
43 44
   },
44 45
   components: {
@@ -60,16 +61,15 @@ export default {
60 61
   width: 100vw;
61 62
   height: 100vh;
62 63
   display: flex;
63
-  // justify-content: center;
64 64
   .bg-image {
65 65
     width: 100%;
66
+    height: 100vh;
66 67
     position: absolute;
67 68
   }
68 69
   .body-swiper {
69 70
     position: absolute;
70
-    width: 100%;
71
-    top: 335px;
72
-    height: 50vh;
71
+    width: 100vw;
72
+    top: 47.5vh;
73 73
     display: flex;
74 74
     &-left,
75 75
     &-right {
@@ -80,17 +80,14 @@ export default {
80 80
       z-index: 2;
81 81
     }
82 82
     &-middle {
83
-      width: 84%;
84
-      overflow: hidden;
85
-      position: relative;
86
-      top: 20px;
87
-    }
88
-    .button-img {
89
-      width: 40%;
90
-      position: absolute;
91
-      bottom: 0px;
92
-      left: 115px;
83
+      width: 84vw;
93 84
     }
94 85
   }
86
+  .button-img {
87
+    position: absolute;
88
+    width: 45vw;
89
+    left: 27.5vw;
90
+    top: 37vh;
91
+  }
95 92
 }
96 93
 </style>

+ 2
- 3
src/pages/index.vue 查看文件

@@ -34,14 +34,13 @@ export default {
34 34
   }
35 35
   .bth-div {
36 36
     position: absolute;
37
-    width: 184px;
38
-    height: 49px;
37
+    width: 45vw;
39 38
     bottom: 18vh;
40 39
     /* margin: 0 auto; */
41 40
     /* justify-content: center; */
42 41
     /* margin: 0 auto; */
43 42
     display: flex;
44
-    left: 28vw;
43
+    left: 27.5vw;
45 44
     align-items: center;
46 45
     .bth-image {
47 46
       width: 100%;

+ 3
- 2
src/pages/resultPage.vue 查看文件

@@ -39,14 +39,15 @@ export default {
39 39
 </script>
40 40
 <style scoped>
41 41
 .bgi {
42
-  z-index: -1;
42
+  z-index: 1;
43 43
   position: absolute;
44 44
 }
45 45
 .sharebgi {
46
-  z-index: 1;
46
+  z-index: 2;
47 47
   position: absolute;
48 48
 }
49 49
 .share {
50
+  z-index: 3;
50 51
   position: absolute;
51 52
   margin: 78vh 0 0 27.5vw;
52 53
 }

+ 26
- 30
src/pages/signup.vue 查看文件

@@ -25,8 +25,8 @@
25 25
         <label>手&nbsp;机&nbsp;号</label>
26 26
         <input class="phone" type="text" placeholder="请输入手机号" v-model="formData.phone" />
27 27
       </div>
28
-      <div class="formItem intendedProductdiv">
29
-        <label>意向产品</label>
28
+      <div class="formItem intendedProductdiv" @click="visible = true">
29
+        <label>意向产品</label>        
30 30
         <input
31 31
           class="intendedProduct"
32 32
           type="text"
@@ -40,18 +40,28 @@
40 40
       </div>
41 41
       <img @click="sumbit" class="submit" src="../../public/images/signup/submit.png" width="45%" />
42 42
     </div>
43
+    <van-popup v-model="visible" position="bottom">
44
+      <van-picker
45
+        title="意向产品"
46
+        show-toolbar
47
+        :columns="productList"
48
+        @confirm="onConfirm"
49
+        @cancel="onCancel"
50
+      />
51
+    </van-popup>
43 52
     <area-picker :show.sync="showArea" @change="handleArea" @cancel='showArea=false'></area-picker>
44 53
   </div>
45 54
 </template>
46 55
 <script>
47 56
 
48
-
57
+import { register } from '../api/register'
49 58
 export default {
50 59
   components: {
51 60
     AreaPicker: () => import('@/components/AreaPicker')
52 61
   },
53 62
   data() {
54 63
     return {
64
+      visible: false,
55 65
       showArea: false,
56 66
       checked: `./images/signup/checked.png`,
57 67
       Unchecked: `./images/signup/Unchecked.png`,
@@ -63,35 +73,19 @@ export default {
63 73
         intendedProduct: undefined,
64 74
         address: undefined
65 75
       },
66
-      productList: [
67
-        [
68
-          {
69
-            label: 'COLMO子母太空舱',
70
-            value: 'COLMO子母太空舱'
71
-          },
72
-          {
73
-            label: 'COLMO星图干洗护理套装',
74
-            value: 'COLMO星图干洗护理套装'
75
-          },
76
-          {
77
-            label: 'COLMO星辰干洗护理套装',
78
-            value: 'COLMO星辰干洗护理套装'
79
-          },
80
-          {
81
-            label: 'COLMO星际干洗护理套装',
82
-            value: 'COLMO星际干洗护理套装'
83
-          },
84
-          {
85
-            label: 'COLMO TURING套系智慧干洗护理空间站',
86
-            value: 'COLMO TURING套系智慧干洗护理空间站'
87
-          }
88
-        ]
89
-      ],
76
+      productList: ['COLMO子母太空舱', 'COLMO星图干洗护理套装', 'COLMO星辰干洗护理套装', 'COLMO星际干洗护理套装', 'COLMO TURING套系智慧干洗护理空间站'],
90 77
       pickerVisibleProduct: false,
91 78
       address: undefined
92 79
     }
93 80
   },
94 81
   methods: {
82
+    onConfirm(value, index) {
83
+      this.formData.intendedProduct=value
84
+      this.onCancel()
85
+    },
86
+    onCancel() {
87
+      this.visible = false
88
+    },
95 89
     handleUser() {
96 90
       this.ischecked = true
97 91
       this.formData.role = 'user'
@@ -125,8 +119,9 @@ export default {
125 119
     },
126 120
     sumbit() {
127 121
       if (this.verification()) {
128
-        console.log(this.formData)
129
-        this.$router.push('/resultPage')
122
+        register(this.formData).then(() => {
123
+          this.$router.push('/resultPage')
124
+        })
130 125
       }
131 126
     }
132 127
   }
@@ -138,7 +133,7 @@ export default {
138 133
   padding: 0;
139 134
 }
140 135
 .bgi {
141
-  z-index: -1;
136
+  z-index: 1;
142 137
   position: absolute;
143 138
 }
144 139
 .form {
@@ -146,6 +141,7 @@ export default {
146 141
   color: #a6b1ab;
147 142
   position: absolute;
148 143
   margin-top: 18%;
144
+  z-index: 2;
149 145
 }
150 146
 .formItem {
151 147
   position: absolute;

+ 1
- 4
src/utils/request.js 查看文件

@@ -1,10 +1,7 @@
1 1
 
2
-// import { getToken } from './token'
3
-
4 2
 export default function request (url, options = {}) {
5 3
   const headers = new Headers();
6 4
   headers.append('Content-Type', 'application/json;charset=utf8');
7
-  // headers.append('X-Authorization-JWT', getToken());
8 5
 
9 6
   Object.keys(options.headers || {}).forEach(key => headers.append(key, options.headers[key]))
10 7
 
@@ -16,6 +13,6 @@ export default function request (url, options = {}) {
16 13
     })
17 14
 }
18 15
 
19
-export const domain = process.env.NODE_ENV === 'development' ? '' : 'https://hhdlots.njyunzhi.com'
16
+export const domain = process.env.NODE_ENV === 'development' ? '' : 'http://colmo-service.dianyang.njyunzhi.com'
20 17
 
21 18
 export const baseURL = `${domain}/api/wx`

+ 23
- 5
vue.config.js 查看文件

@@ -1,11 +1,29 @@
1 1
 
2 2
 const path = require('path')
3
+const resolve = dir => path.join(__dirname, dir)
4
+
3 5
 
4 6
 module.exports = {
5
-  publicPath: './',
6
-  chainWebpack(config) {
7
-    config.resolve.alias
8
-      .set('@/components', path.resolve(__dirname, 'src/components/'))
9
-      .set('@/utils', path.resolve(__dirname, 'src/utils/'))
7
+
8
+  devServer: {
9
+    proxy: {
10
+      '/api': {
11
+        target: "http://192.168.89.147:8081",
12
+        // ws: true,
13
+        changeOrigin: true,
14
+        // pathRewrite: {
15
+        //   // 路径重写
16
+        //   "/api": "" // 这个意思就是以api开头的,定向到哪里, 如果你的后边还有路径的话, 会自动拼接上
17
+        // }
18
+      },
19
+    },
20
+
21
+
22
+  },
23
+  lintOnSave: false,
24
+  publicPath: "./",//在vue-cli.3.3版本后 baseUrl被废除了,因此这边要写成 publicPath。 https://cli.vuejs.org/zh/config/#vue-config-js
25
+  runtimeCompiler: true,
26
+  chainWebpack: config => {
27
+    config.resolve.alias.set("@", resolve("src"));
10 28
   }
11 29
 }