李志伟 3 years ago
parent
commit
7dce141fe4

+ 11
- 0
src/api/register.js View File

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 View File

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 View File

10
 import Swiper from './components/Swiper'
10
 import Swiper from './components/Swiper'
11
 import SwiperSlide from './components/SwiperSlide'
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
 Vue.use(Popup);
14
 Vue.use(Popup);
15
+Vue.use(Picker);
16
 Vue.use(Area);
16
 Vue.use(Area);
17
 
17
 
18
 Vue.config.productionTip = false
18
 Vue.config.productionTip = false

+ 0
- 1
src/pages/AllPages.vue View File

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

+ 6
- 9
src/pages/IndexImage.vue View File

1
 <template>
1
 <template>
2
   <div class="index-image">
2
   <div class="index-image">
3
-    <!-- <img :src="require('@/assets/images/index.png')" class="bg-image" @load="loadBg" /> -->
4
     <div class="index-inner-swiper">
3
     <div class="index-inner-swiper">
5
       <swiper :options="swiperOptions">
4
       <swiper :options="swiperOptions">
6
         <swiper-slide class="index-inner-slide">
5
         <swiper-slide class="index-inner-slide">
27
   name: 'IndexImage',
26
   name: 'IndexImage',
28
   props: {
27
   props: {
29
     typeImage: {
28
     typeImage: {
30
-      type: Object
31
-      // default: () => ({})
29
+      type: Object,
30
+      default: () => ({})
32
     }
31
     }
33
   },
32
   },
34
   data() {
33
   data() {
46
 <style lang="scss" scoped>
45
 <style lang="scss" scoped>
47
 .index-image {
46
 .index-image {
48
   .index-inner-swiper {
47
   .index-inner-swiper {
49
-    width: 100vw;
50
     .index-inner-slide {
48
     .index-inner-slide {
51
       position: relative;
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 View File

24
         <img style="width:100%;" src="../assets/buttonImage/1即刻尊享.png" />
24
         <img style="width:100%;" src="../assets/buttonImage/1即刻尊享.png" />
25
       </div>
25
       </div>
26
     </div>
26
     </div>
27
+    
27
   </div>
28
   </div>
28
 </template>
29
 </template>
29
 
30
 
37
   },
38
   },
38
   props: {
39
   props: {
39
     typePages: {
40
     typePages: {
40
-      type: Object
41
-      // default: () => ({})
41
+      type: Object,
42
+      default: () => ({})
42
     }
43
     }
43
   },
44
   },
44
   components: {
45
   components: {
60
   width: 100vw;
61
   width: 100vw;
61
   height: 100vh;
62
   height: 100vh;
62
   display: flex;
63
   display: flex;
63
-  // justify-content: center;
64
   .bg-image {
64
   .bg-image {
65
     width: 100%;
65
     width: 100%;
66
+    height: 100vh;
66
     position: absolute;
67
     position: absolute;
67
   }
68
   }
68
   .body-swiper {
69
   .body-swiper {
69
     position: absolute;
70
     position: absolute;
70
-    width: 100%;
71
-    top: 335px;
72
-    height: 50vh;
71
+    width: 100vw;
72
+    top: 47.5vh;
73
     display: flex;
73
     display: flex;
74
     &-left,
74
     &-left,
75
     &-right {
75
     &-right {
80
       z-index: 2;
80
       z-index: 2;
81
     }
81
     }
82
     &-middle {
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
 </style>
93
 </style>

+ 2
- 3
src/pages/index.vue View File

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

+ 3
- 2
src/pages/resultPage.vue View File

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

+ 26
- 30
src/pages/signup.vue View File

25
         <label>手&nbsp;机&nbsp;号</label>
25
         <label>手&nbsp;机&nbsp;号</label>
26
         <input class="phone" type="text" placeholder="请输入手机号" v-model="formData.phone" />
26
         <input class="phone" type="text" placeholder="请输入手机号" v-model="formData.phone" />
27
       </div>
27
       </div>
28
-      <div class="formItem intendedProductdiv">
29
-        <label>意向产品</label>
28
+      <div class="formItem intendedProductdiv" @click="visible = true">
29
+        <label>意向产品</label>        
30
         <input
30
         <input
31
           class="intendedProduct"
31
           class="intendedProduct"
32
           type="text"
32
           type="text"
40
       </div>
40
       </div>
41
       <img @click="sumbit" class="submit" src="../../public/images/signup/submit.png" width="45%" />
41
       <img @click="sumbit" class="submit" src="../../public/images/signup/submit.png" width="45%" />
42
     </div>
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
     <area-picker :show.sync="showArea" @change="handleArea" @cancel='showArea=false'></area-picker>
52
     <area-picker :show.sync="showArea" @change="handleArea" @cancel='showArea=false'></area-picker>
44
   </div>
53
   </div>
45
 </template>
54
 </template>
46
 <script>
55
 <script>
47
 
56
 
48
-
57
+import { register } from '../api/register'
49
 export default {
58
 export default {
50
   components: {
59
   components: {
51
     AreaPicker: () => import('@/components/AreaPicker')
60
     AreaPicker: () => import('@/components/AreaPicker')
52
   },
61
   },
53
   data() {
62
   data() {
54
     return {
63
     return {
64
+      visible: false,
55
       showArea: false,
65
       showArea: false,
56
       checked: `./images/signup/checked.png`,
66
       checked: `./images/signup/checked.png`,
57
       Unchecked: `./images/signup/Unchecked.png`,
67
       Unchecked: `./images/signup/Unchecked.png`,
63
         intendedProduct: undefined,
73
         intendedProduct: undefined,
64
         address: undefined
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
       pickerVisibleProduct: false,
77
       pickerVisibleProduct: false,
91
       address: undefined
78
       address: undefined
92
     }
79
     }
93
   },
80
   },
94
   methods: {
81
   methods: {
82
+    onConfirm(value, index) {
83
+      this.formData.intendedProduct=value
84
+      this.onCancel()
85
+    },
86
+    onCancel() {
87
+      this.visible = false
88
+    },
95
     handleUser() {
89
     handleUser() {
96
       this.ischecked = true
90
       this.ischecked = true
97
       this.formData.role = 'user'
91
       this.formData.role = 'user'
125
     },
119
     },
126
     sumbit() {
120
     sumbit() {
127
       if (this.verification()) {
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
   padding: 0;
133
   padding: 0;
139
 }
134
 }
140
 .bgi {
135
 .bgi {
141
-  z-index: -1;
136
+  z-index: 1;
142
   position: absolute;
137
   position: absolute;
143
 }
138
 }
144
 .form {
139
 .form {
146
   color: #a6b1ab;
141
   color: #a6b1ab;
147
   position: absolute;
142
   position: absolute;
148
   margin-top: 18%;
143
   margin-top: 18%;
144
+  z-index: 2;
149
 }
145
 }
150
 .formItem {
146
 .formItem {
151
   position: absolute;
147
   position: absolute;

+ 1
- 4
src/utils/request.js View File

1
 
1
 
2
-// import { getToken } from './token'
3
-
4
 export default function request (url, options = {}) {
2
 export default function request (url, options = {}) {
5
   const headers = new Headers();
3
   const headers = new Headers();
6
   headers.append('Content-Type', 'application/json;charset=utf8');
4
   headers.append('Content-Type', 'application/json;charset=utf8');
7
-  // headers.append('X-Authorization-JWT', getToken());
8
 
5
 
9
   Object.keys(options.headers || {}).forEach(key => headers.append(key, options.headers[key]))
6
   Object.keys(options.headers || {}).forEach(key => headers.append(key, options.headers[key]))
10
 
7
 
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
 export const baseURL = `${domain}/api/wx`
18
 export const baseURL = `${domain}/api/wx`

+ 23
- 5
vue.config.js View File

1
 
1
 
2
 const path = require('path')
2
 const path = require('path')
3
+const resolve = dir => path.join(__dirname, dir)
4
+
3
 
5
 
4
 module.exports = {
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
 }