[baozhangchao] 3 лет назад
Родитель
Сommit
35f15636c7
19 измененных файлов: 242 добавлений и 27 удалений
  1. 5
    1
      src/app.js
  2. 3
    0
      src/app.less
  3. Двоичные данные
      src/assets/addTime.png
  4. Двоичные данные
      src/assets/dogCared.png
  5. Двоичные данные
      src/assets/handle.png
  6. Двоичные данные
      src/assets/lost.png
  7. Двоичные данные
      src/assets/main.png
  8. Двоичные данные
      src/assets/speed.png
  9. Двоичные данные
      src/assets/tipsLogo.png
  10. 3
    3
      src/components/Banner/index.jsx
  11. 31
    6
      src/components/Banner/style.less
  12. 23
    0
      src/components/HomeCard/index.jsx
  13. 23
    0
      src/components/HomeCard/style.less
  14. 9
    6
      src/components/Notice/style.less
  15. 65
    5
      src/pages/index/index.jsx
  16. 62
    0
      src/pages/index/style.less
  17. 10
    5
      src/pages/setDogInfo/index.jsx
  18. 1
    1
      src/pages/setUser/index.jsx
  19. 7
    0
      src/services/dogAPI.js

+ 5
- 1
src/app.js Просмотреть файл

@@ -4,6 +4,7 @@ import Taro from '@tarojs/taro';
4 4
 import store, { StoreRoot, useModel } from './store'
5 5
 
6 6
 import './app.less'
7
+import { View } from '@tarojs/components';
7 8
 
8 9
 class App extends Component {
9 10
 
@@ -35,7 +36,10 @@ class App extends Component {
35 36
   // this.props.children 是将要会渲染的页面
36 37
   render () {
37 38
     return <StoreRoot>
38
-      {this.props.children}
39
+      <View className='pages-index'>
40
+        {this.props.children}
41
+      </View>
42
+
39 43
     </StoreRoot>
40 44
     // return this.props.children
41 45
   }

+ 3
- 0
src/app.less Просмотреть файл

@@ -0,0 +1,3 @@
1
+page {
2
+  background-color: #f5f5f5;
3
+}

Двоичные данные
src/assets/addTime.png Просмотреть файл


Двоичные данные
src/assets/dogCared.png Просмотреть файл


Двоичные данные
src/assets/handle.png Просмотреть файл


Двоичные данные
src/assets/lost.png Просмотреть файл


Двоичные данные
src/assets/main.png Просмотреть файл


Двоичные данные
src/assets/speed.png Просмотреть файл


Двоичные данные
src/assets/tipsLogo.png Просмотреть файл


+ 3
- 3
src/components/Banner/index.jsx Просмотреть файл

@@ -5,19 +5,19 @@ import './style.less'
5 5
 export default (props) => {
6 6
   const { banner } = props;
7 7
   return (
8
-    <View>
8
+    <View className='banner-box'>
9 9
       <Swiper
10 10
         className='swiper-container'
11 11
         circular
12 12
         indicatorDots
13
-        indicatorColor='#fff'
13
+        indicatorColor='#B5B5B5'
14 14
         indicatorActiveColor='#FBD804'
15 15
         autoplay
16 16
       // vertical//纵向滑动  上下
17 17
       >
18 18
         {
19 19
           banner && banner.map((item, index) => (
20
-            <SwiperItem key={index} >
20
+            <SwiperItem key={index} className='SwiperItem-img' >
21 21
               <Image className='swiper-img' src={item.imgUrl} mode='widthFix'></Image>
22 22
             </SwiperItem>
23 23
           ))

+ 31
- 6
src/components/Banner/style.less Просмотреть файл

@@ -1,9 +1,34 @@
1
-.swiper-container {
2
-  width: 100vw;
3
-  height: 400px;
1
+.banner-box {
2
+  transform: translateY(0);
4 3
 
5
-  .swiper-img {
6
-    height: 100%;
7
-    width: 100%;
4
+  .swiper-container {
5
+    width: 92vw;
6
+    height: 300px;
7
+    overflow: hidden;
8
+    transform: translateY(0);
9
+    border-radius: 10px;
10
+    margin: 40px auto;
11
+
12
+    // swiper.wxss
13
+    /* 默认指示点的样式 */
14
+    .SwiperItem-img {
15
+      height: 260px !important;
16
+    }
17
+    .wx-swiper-dot {
18
+      width: 35px;
19
+      height: 5px;
20
+      border-radius: 0px;
21
+    }
22
+
23
+    /* 选中指示点的样式 */
24
+    .wx-swiper-dot.wx-swiper-dot-active {
25
+      width: 35px;
26
+      height: 5px;
27
+      border-radius: 0px;
28
+    }
29
+    .swiper-img {
30
+      width: 100%;
31
+      height: 200px;
32
+    }
8 33
   }
9 34
 }

+ 23
- 0
src/components/HomeCard/index.jsx Просмотреть файл

@@ -0,0 +1,23 @@
1
+import Taro from '@tarojs/taro';
2
+import { View, Text, Swiper, SwiperItem, Image } from '@tarojs/components';
3
+
4
+import './style.less'
5
+
6
+export default (props) => {
7
+  const { text, onChange } = props;
8
+
9
+  return (
10
+    <View className='HomeCard-box'>
11
+      {/* <View className='HomeCard-box-header'>
12
+        <View className='HomeCard-box-header-left'></View>
13
+        <View className='HomeCard-box-header-right'></View>
14
+      </View> */}
15
+      <View className='HomeCard-box-content'>
16
+        {props.children}
17
+      </View>
18
+    </View>
19
+  )
20
+}
21
+
22
+
23
+

+ 23
- 0
src/components/HomeCard/style.less Просмотреть файл

@@ -0,0 +1,23 @@
1
+.HomeCard-box {
2
+  // width: 95%;
3
+  background-color: #fff;
4
+  margin: 7vw auto;
5
+  padding: 0 25px;
6
+  border-bottom-left-radius: 30px;
7
+  border-bottom-right-radius: 30px;
8
+  &-header {
9
+    // padding: 15px 0 20px;
10
+    display: flex;
11
+    align-items: center;
12
+    &-left {
13
+      width: 10px;
14
+      height: 37px;
15
+      // background-color: #fbd804;
16
+      margin: 0 15px 0 0;
17
+    }
18
+    &-right {
19
+      font-size: 35px;
20
+      font-weight: 600;
21
+    }
22
+  }
23
+}

+ 9
- 6
src/components/Notice/style.less Просмотреть файл

@@ -1,19 +1,22 @@
1 1
 .Notice-box {
2
-  width: 100vw;
2
+  width: 80vw;
3 3
   // height: 50px;
4
-  background-color: #fff5f6;
4
+  height: 34px;
5
+  margin: 0 auto;
6
+  border-radius: 40px;
7
+  background-color: #f5f5f5;
5 8
   display: flex;
6 9
   align-items: center;
7
-  padding: 15px 10px;
10
+  padding: 15px 15px;
8 11
   > Image {
9
-    width: 55px;
10
-    height: 55px;
12
+    width: 60px;
13
+    height: 60px;
11 14
     margin-right: 15px;
12 15
     color: #fbd804;
13 16
   }
14 17
   .NoticeSwiper {
15 18
     width: 85%;
16
-    height: 40px;
19
+    height: 45px;
17 20
     .NoticeSwiper-Text {
18 21
       font-size: 26px;
19 22
       text-overflow: ellipsis;

+ 65
- 5
src/pages/index/index.jsx Просмотреть файл

@@ -1,7 +1,17 @@
1
-import { View, Text, Image } from '@tarojs/components'
1
+import { View, ScrollView, Image } from '@tarojs/components'
2 2
 import Taro from '@tarojs/taro'
3 3
 import Banner from '../../components/Banner'
4 4
 import Notice from '../../components/Notice'
5
+import HomeCard from '../../components/HomeCard'
6
+import dogCared from '../../assets/dogCared.png'
7
+import speed from '../../assets/speed.png'
8
+//四个小功能
9
+import handle from '../../assets/handle.png'//办证
10
+import lost from '../../assets/lost.png'//挂失
11
+import addTime from '../../assets/addTime.png'//续期
12
+import main from '../../assets/main.png'//我的
13
+
14
+
5 15
 import './style.less'
6 16
 
7 17
 export default (props) => {
@@ -25,10 +35,60 @@ export default (props) => {
25 35
   }
26 36
 
27 37
   return (
28
-    <View className='index-UserQRcode'>
29
-      <Banner banner={banner} />
30
-      <Notice Notice={NoticeList} onChange={onChangeGoNotice} />
31
-    </View>
38
+    <ScrollView scrollY style={{
39
+      height: '100vh'
40
+    }}
41
+    >
42
+      <View className='index-box'>
43
+        {/* 一部分 */}
44
+        <View className='haderBox'>
45
+          <Banner banner={banner} />
46
+          <Notice Notice={NoticeList} onChange={onChangeGoNotice} />
47
+        </View>
48
+        {/* 二部分 */}
49
+        <View>
50
+          <HomeCard text='快速入口'>
51
+            <View className='FastEntry-Box'>
52
+              <View className='FastEntry-Box-content'>
53
+                <View>进度查询</View>
54
+                <Image src={speed} />
55
+              </View>
56
+              <View className='FastEntry-Box-content'>
57
+                <View>狗狗证件</View>
58
+                <Image src={dogCared} />
59
+
60
+              </View>
61
+            </View>
62
+          </HomeCard>
63
+
64
+        </View>
65
+        {/* 三部分 */}
66
+        <HomeCard text='便捷服务'>
67
+          <View className='Operation-box'>
68
+            <View className='Operation-box-header'>
69
+              <View className='Operation-box-header-centent'>
70
+                <Image src={handle} style={{ width: '50px', height: '30px' }} />
71
+                <View>办证</View>
72
+              </View>
73
+              <View className='Operation-box-header-centent'>
74
+                <Image src={addTime} style={{ width: '28px', height: '24px', padding: '0 10px' }} />
75
+                <View>续期</View>
76
+              </View>
77
+            </View>
78
+            <View className='Operation-box-header'>
79
+              <View className='Operation-box-header-centent'>
80
+                <Image src={lost} style={{ width: '35px', height: '30px', padding: '0 10px' }} />
81
+                <View>挂失</View>
82
+              </View>
83
+              <View className='Operation-box-header-centent'>
84
+                <Image src={main} style={{ width: '27px', height: '25px', padding: '0 10px' }} />
85
+                <View>我的</View>
86
+              </View>
87
+            </View>
88
+          </View>
89
+        </HomeCard>
90
+      </View>
91
+    </ScrollView>
32 92
   )
33 93
 }
34 94
 

+ 62
- 0
src/pages/index/style.less Просмотреть файл

@@ -0,0 +1,62 @@
1
+.haderBox {
2
+  width: 100vw;
3
+  height: 56vw;
4
+  margin: 0 auto;
5
+  background-color: #fff;
6
+  border-bottom-left-radius: 30px;
7
+  border-bottom-right-radius: 30px;
8
+}
9
+.FastEntry-Box {
10
+  width: 100%;
11
+  display: flex;
12
+  align-items: center;
13
+  justify-content: space-around;
14
+  padding: 3vh 0 3vh 0;
15
+  &-content {
16
+    width: 42%;
17
+    height: 150px;
18
+    // border: 2px dashed red;
19
+    background-image: linear-gradient(to right, #fbd804, #ffe96ade);
20
+    border-radius: 10px;
21
+    padding: 15px;
22
+    > View {
23
+      font-weight: 700;
24
+      color: #fff;
25
+    }
26
+    > Image {
27
+      width: 80px;
28
+      height: 80px;
29
+      position: relative;
30
+      top: -15px;
31
+      left: 200px;
32
+    }
33
+  }
34
+}
35
+.Operation-box {
36
+  width: 100vw;
37
+  height: 50vw;
38
+  margin: 0 auto;
39
+  background-color: #fff;
40
+  border-bottom-left-radius: 30px;
41
+  border-bottom-right-radius: 30px;
42
+  &-header {
43
+    width: 95%;
44
+    display: flex;
45
+    align-items: center;
46
+    justify-content: space-around;
47
+    padding: 2vh 0 2vh 0;
48
+    &-centent {
49
+      width: 38%;
50
+      height: 10vh;
51
+      // border: 1px solid #fbd804;
52
+      border: 1px solid #000;
53
+      display: flex;
54
+      align-items: center;
55
+      border-radius: 10px;
56
+      // > Image {
57
+      //   width: 60px;
58
+      //   height: 50px;
59
+      // }
60
+    }
61
+  }
62
+}

+ 10
- 5
src/pages/setDogInfo/index.jsx Просмотреть файл

@@ -1,6 +1,7 @@
1 1
 import { View, Button, Form, Text, RadioGroup, Picker, Image, Input, Radio, Label, ScrollView } from '@tarojs/components'
2 2
 import Taro from '@tarojs/taro';
3 3
 import { useState } from 'react';
4
+import { addDogInfo } from '../../services/dogAPI';
4 5
 
5 6
 import './style.less'
6 7
 
@@ -18,14 +19,14 @@ export default (props) => {
18 19
         setDogDate({ ...dogDate, petBirthday: value })
19 20
         break;
20 21
       case 'petType':
21
-        setDogDate({ ...dogDate, petType: dogType[value].text })
22
+        setDogDate({ ...dogDate, petType: dogType[value].text })//value 01  text 文字
22 23
         break;
23 24
       default:
24 25
         break;
25 26
     }
26 27
 
27 28
   }
28
-  const selector = ['公', '母']
29
+  const selector = ['雄', '雌']
29 30
   const dogType = [
30 31
     {
31 32
       value: 0,
@@ -40,11 +41,11 @@ export default (props) => {
40 41
 
41 42
   const modeList = [
42 43
     {
43
-      value: 0,
44
+      value: 1,
44 45
       text: '邮寄',
45 46
     },
46 47
     {
47
-      value: 1,
48
+      value: 2,
48 49
       text: '自取',
49 50
     },
50 51
 
@@ -98,6 +99,10 @@ export default (props) => {
98 99
   }
99 100
   const formSubmit = e => {
100 101
     console.log(e)
102
+    const value = e.detail.value
103
+    addDogInfo({ ...value, ...dogDate, ...imgUrl }).then((res) => {
104
+      console.log('dogInfo xinwe', res);
105
+    })
101 106
   }
102 107
 
103 108
   const formReset = e => {
@@ -192,7 +197,7 @@ export default (props) => {
192 197
 
193 198
             </mp-cells>
194 199
           </mp-form>
195
-          <View slot='button'>
200
+          <View slot='button' style={{ margin: '4em 0 2em 0' }}>
196 201
             <Button class='weui-btn' type='primary' loading={false} formType='submit'>确定</Button>
197 202
           </View>
198 203
         </Form>

+ 1
- 1
src/pages/setUser/index.jsx Просмотреть файл

@@ -79,7 +79,7 @@ export default (props) => {
79 79
 
80 80
             </mp-cells>
81 81
           </mp-form>
82
-          <View slot='button'>
82
+          <View slot='button' style={{ margin: '4em 0 2em 0' }}>
83 83
             <Button type='primary' loading={false} formType='submit'>确定 Loading</Button>
84 84
           </View>
85 85
         </Form>

+ 7
- 0
src/services/dogAPI.js Просмотреть файл

@@ -9,3 +9,10 @@ import request from '../utils/request'
9 9
  * @returns
10 10
  */
11 11
 export const login = (data) => request('/login', { data, method: 'POST' })
12
+
13
+/**
14
+ * 狗狗信息维护
15
+ * @param {*} data
16
+ * @returns
17
+ */
18
+export const addDogInfo = (data) => request('/application', { data, method: 'POST' })