Przeglądaj źródła

Merge branch 'master' of http://git.ycjcjy.com/dianyang/colmo-h5

张延森 3 lat temu
rodzic
commit
10aea51c25

+ 11
- 0
src/api/register.js Wyświetl plik

@@ -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 Wyświetl plik

@@ -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
-}

+ 1
- 2
src/main.js Wyświetl plik

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

+ 0
- 1
src/pages/AllPages.vue Wyświetl plik

@@ -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 Wyświetl plik

@@ -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 Wyświetl plik

@@ -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: -5vh;
92
-      left: 29vw;
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 Wyświetl plik

@@ -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 Wyświetl plik

@@ -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
 }

+ 22
- 18
src/pages/signup.vue Wyświetl plik

@@ -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"
@@ -57,18 +57,29 @@
57 57
       </div>
58 58
       <img @click="sumbit" class="submit" src="../../public/images/signup/submit.png" width="45%" />
59 59
     </div>
60
-    <area-picker :show.sync="showArea" @change="handleArea" @cancel="showArea=false"></area-picker>
60
+    <van-popup v-model="visible" position="bottom">
61
+      <van-picker
62
+        title="意向产品"
63
+        show-toolbar
64
+        :columns="productList"
65
+        @confirm="onConfirm"
66
+        @cancel="onCancel"
67
+      />
68
+    </van-popup>
69
+    <area-picker :show.sync="showArea" @change="handleArea" @cancel='showArea=false'></area-picker>
61 70
   </div>
62 71
 </template>
63 72
 <script>
64
-import { setRegister, getCity } from '../utils/api'
65 73
 
74
+import { register } from '../api/register'
75
+import { setRegister, getCity } from '../utils/api'
66 76
 export default {
67 77
   components: {
68 78
     AreaPicker: () => import('@/components/AreaPicker')
69 79
   },
70 80
   data() {
71 81
     return {
82
+      visible: false,
72 83
       showArea: false,
73 84
       checked: `./images/signup/checked.png`,
74 85
       Unchecked: `./images/signup/Unchecked.png`,
@@ -81,18 +92,7 @@ export default {
81 92
         intendedProduct: undefined,
82 93
         address: undefined
83 94
       },
84
-      columns: ['杭州', '宁波', '温州', '绍兴', '湖州', '嘉兴', '金华', '衢州'],
85
-      productList: [
86
-        'COLMO子母太空舱',
87
-
88
-        'COLMO星图干洗护理套装',
89
-
90
-        'COLMO星辰干洗护理套装',
91
-
92
-        'COLMO星际干洗护理套装',
93
-
94
-        'COLMO TURING套系智慧干洗护理空间站'
95
-      ],
95
+      productList: ['COLMO子母太空舱', 'COLMO星图干洗护理套装', 'COLMO星辰干洗护理套装', 'COLMO星际干洗护理套装', 'COLMO TURING套系智慧干洗护理空间站'],
96 96
       pickerVisibleProduct: false,
97 97
       address: undefined
98 98
     }
@@ -104,7 +104,7 @@ export default {
104 104
   methods: {
105 105
     onConfirm(value, index) {
106 106
       this.formData.intendedProduct = value
107
-      this.showPicker = false
107
+      this.onCancel()
108 108
     },
109 109
 
110 110
     onCancel() {
@@ -151,6 +151,9 @@ export default {
151 151
     },
152 152
     sumbit() {
153 153
       if (this.verification()) {
154
+        // register(this.formData).then(() => {
155
+        //   this.$router.push('/resultPage')
156
+        // })
154 157
         const { userName, phone, intendedProduct, address, role } =
155 158
           this.formData
156 159
         let arrNew = address.map((item) => {
@@ -186,7 +189,7 @@ export default {
186 189
   padding: 0;
187 190
 }
188 191
 .bgi {
189
-  z-index: -1;
192
+  z-index: 1;
190 193
   position: absolute;
191 194
 }
192 195
 .form {
@@ -194,6 +197,7 @@ export default {
194 197
   color: #a6b1ab;
195 198
   position: absolute;
196 199
   margin-top: 18%;
200
+  z-index: 2;
197 201
 }
198 202
 .formItem {
199 203
   position: absolute;

+ 0
- 2
src/utils/request.js Wyświetl plik

@@ -55,5 +55,3 @@ export default function (url, options) {
55 55
     })
56 56
   })
57 57
 }
58
-
59
-

+ 7
- 5
vue.config.js Wyświetl plik

@@ -1,5 +1,7 @@
1 1
 
2 2
 const path = require('path')
3
+const resolve = dir => path.join(__dirname, dir)
4
+
3 5
 
4 6
 module.exports = {
5 7
 
@@ -18,10 +20,10 @@ module.exports = {
18 20
 
19 21
 
20 22
   },
21
-  publicPath: './',
22
-  chainWebpack (config) {
23
-    config.resolve.alias
24
-      .set('@/components', path.resolve(__dirname, 'src/components/'))
25
-      .set('@/utils', path.resolve(__dirname, 'src/utils/'))
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"));
26 28
   }
27 29
 }