Quellcode durchsuchen

Merge branch 'm

[baozhangchao] vor 3 Jahren
Ursprung
Commit
03157c6c59

+ 20623
- 29
package-lock.json
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen


+ 7
- 5
package.json Datei anzeigen

@@ -42,19 +42,21 @@
42 42
     "@tarojs/taro": "3.3.6",
43 43
     "react": "^17.0.0",
44 44
     "react-dom": "^17.0.0",
45
+    "react-redux": "^7.2.6",
46
+    "redux": "^4.1.2",
45 47
     "weui-miniprogram": "^1.2.3"
46 48
   },
47 49
   "devDependencies": {
48
-    "@types/webpack-env": "^1.13.6",
49
-    "@types/react": "^17.0.2",
50
-    "@tarojs/mini-runner": "3.3.6",
51 50
     "@babel/core": "^7.8.0",
51
+    "@tarojs/mini-runner": "3.3.6",
52 52
     "@tarojs/webpack-runner": "3.3.6",
53
+    "@types/react": "^17.0.2",
54
+    "@types/webpack-env": "^1.13.6",
53 55
     "babel-preset-taro": "3.3.6",
54
-    "eslint-config-taro": "3.3.6",
55 56
     "eslint": "^6.8.0",
56
-    "eslint-plugin-react": "^7.8.2",
57
+    "eslint-config-taro": "3.3.6",
57 58
     "eslint-plugin-import": "^2.12.0",
59
+    "eslint-plugin-react": "^7.8.2",
58 60
     "eslint-plugin-react-hooks": "^4.2.0",
59 61
     "stylelint": "9.3.0"
60 62
   }

+ 1
- 1
project.config.json Datei anzeigen

@@ -2,7 +2,7 @@
2 2
     "miniprogramRoot": "dist/",
3 3
     "projectname": "nanyang",
4 4
     "description": "南阳农机",
5
-    "appid": "wx835627a9b9b3932a",
5
+    "appid": "wx94f23e5b285c046d",
6 6
     "setting": {
7 7
         "urlCheck": true,
8 8
         "es6": false,

+ 11
- 0
src/app.js Datei anzeigen

@@ -1,8 +1,12 @@
1 1
 import { Component } from 'react'
2 2
 import Taro from '@tarojs/taro'
3 3
 import { login } from '@/services/login'
4
+
5
+import store from './store'
6
+
4 7
 import './app.less'
5 8
 
9
+
6 10
 class App extends Component {
7 11
 
8 12
   componentDidMount () { }
@@ -14,6 +18,13 @@ class App extends Component {
14 18
       success: (res) => {
15 19
         const { code } = res;
16 20
         login({ code })
21
+
22
+
23
+        const action = { type: "SET_VISIBILITY_FILTER", state: { cookis: 'a1sd54a5wd654s' } }
24
+        store.dispatch(action)
25
+
26
+
27
+        console.log(store.getState());
17 28
       }
18 29
     })
19 30
 

+ 53
- 5
src/pages/CheckDetails/index.jsx Datei anzeigen

@@ -1,25 +1,73 @@
1 1
 import { useState } from "react"
2
-import { Textarea, View } from "@tarojs/components"
2
+import { Image, View, Text } from "@tarojs/components"
3
+import Taro from "@tarojs/taro"
3 4
 import CustomNav from "@/components/CustomNav"
5
+
4 6
 import ButtontWX from "@/components/ButtontWX"
7
+import decorate from "@/assets/icons/comm/decorate.png"
8
+import addresss from '@/assets/mineImgaes/addresss.png'//地址
5 9
 import './style.less'
6 10
 
7 11
 
8 12
 
9 13
 export default (props) => {
10 14
 
11
-  const [textAreaValue, setTextAreaValue] = useState('')
12 15
 
16
+  const startReserve = () => {
17
+    Taro.navigateTo({ url: `/pages/OrderInfo/index?id${1}` })
18
+
19
+  }
20
+
21
+  const goMapInfo = (res) => {
22
+    Taro.navigateTo({ url: `/pages/CheckMap/index?mapId=${res + 111}` })
13 23
 
24
+  }
14 25
 
15 26
   return (
16 27
     <View className='page-index'>
28
+
17 29
       <View className='index-navbar'>
18 30
         <CustomNav title='查看详情' />
19 31
       </View>
20
-      <View>
32
+      <scroll-view scrollY style='height: 100%;' >
21 33
 
22
-      </View>
23
-    </View>
34
+        <View >
35
+
36
+          <Image style={{ width: '100%' }} src='http://img3.jc001.cn/img/001/1/1512/15566fd0311736f.jpg' />
37
+
38
+          <View className='CarsContent-TextBox'>
39
+            <View className='CheckDetails-bottom-box-flaxBox-liftText'>
40
+              <View className='CheckDetails-bottom-box-flaxBox-liftText-Titles'>不知家收割机</View>
41
+              <View className='CheckDetails-bottom-box-flaxBox-liftText-price'>2188/<Text>公顷</Text></View>
42
+            </View>
43
+            <View className='content-header-box-map-Info' onClick={() => goMapInfo('222888')}>
44
+              <View className='content-header-box-map-Info-liftCentent'>
45
+                <Image src={addresss} />
46
+                <View>距离当前位置8.8公里&gt;&gt;</View>
47
+              </View>
48
+            </View>
49
+            <View className='content-header-box-map-Info-carsName'>农机手小李的收割机</View>
50
+            <View className='startReserve-centent'>
51
+              <View className='articleTitle-box-Details'>
52
+                <Image src={decorate} />
53
+                <View>作业详情</View>
54
+                <Image src={decorate} />
55
+              </View>
56
+              <Image style={{ width: '100%' }} src='http://img3.jc001.cn/img/001/1/1512/15566fd0311736f.jpg' />
57
+              <Image style={{ width: '100%' }} src='http://img3.jc001.cn/img/001/1/1512/15566fd0311736f.jpg' />
58
+              <Image style={{ width: '100%' }} src='http://img3.jc001.cn/img/001/1/1512/15566fd0311736f.jpg' />
59
+
60
+              <View className='startReserve-Bottom'>
61
+                <ButtontWX butText='预约' onClick={startReserve} butWidth={300} butHeight={49} butFontSize={16} butBorderRadius={49} />
62
+
63
+              </View>
64
+            </View>
65
+
66
+
67
+          </View>
68
+        </View>
69
+      </scroll-view>
70
+
71
+    </View >
24 72
   )
25 73
 }

+ 83
- 15
src/pages/CheckDetails/style.less Datei anzeigen

@@ -1,18 +1,86 @@
1
-.components-page {
2
-  &-TextareaCentent {
3
-    width: 85%;
4
-    background: #fefefe;
5
-    border: 2px solid rgba(0, 0, 0, 0.2);
6
-    border-radius: 20px;
7
-    min-height: 25vh;
8
-    margin: 1em auto;
9
-    padding: 10px 37px;
1
+.CarsContent-TextBox {
2
+  padding: 40px 30px;
3
+  position: relative;
4
+  top: -9vh;
5
+  background-color: #fff;
6
+  border-radius: 40px 40px 0px 0px;
7
+  .CheckDetails-bottom-box-flaxBox-liftText {
8
+    width: 95%;
9
+
10
+    display: flex;
11
+    justify-content: space-between;
12
+
13
+    &-Titles {
14
+      text-overflow: ellipsis; //显示...
15
+      white-space: nowrap; //不换行
16
+      overflow: hidden;
17
+      font-size: 36px;
18
+      font-weight: bold;
19
+      color: #222222;
20
+    }
21
+    &-price {
22
+      font-size: 44px;
23
+      font-weight: 800;
24
+      color: #666666;
25
+      background: linear-gradient(180deg, #fa7878 0%, #b61515 100%);
26
+      -webkit-background-clip: text;
27
+      -webkit-text-fill-color: transparent;
28
+      > Text {
29
+        font-size: 25px;
30
+      }
31
+    }
32
+  }
33
+
34
+  .content-header-box-map-Info {
35
+    margin: 0 auto;
36
+    display: flex;
37
+    align-items: center;
38
+    // justify-content: space-between;
39
+    padding: 30px 0 30px 0;
40
+    &-liftCentent {
41
+      display: flex;
42
+      align-items: center;
43
+      > Image {
44
+        width: 22px;
45
+        height: 27px;
46
+      }
47
+      > View {
48
+        padding-left: 15px;
49
+        font-size: 30px;
50
+        font-weight: 800;
51
+        color: #222222;
52
+      }
53
+    }
54
+    &-rightCententInfo {
55
+      font-size: 30px;
56
+      font-weight: 500;
57
+      color: #666666;
58
+    }
59
+    &-carsName {
60
+      font-size: 30px;
61
+      font-weight: bold;
62
+      color: #222222;
63
+    }
64
+  }
65
+
66
+  .articleTitle-box-Details {
67
+    display: flex;
68
+    font-size: 30px;
69
+    font-weight: bold;
70
+    color: #222222;
71
+    align-items: center;
72
+    justify-content: center;
73
+    margin-top: 32px;
74
+    > Image {
75
+      width: 33px;
76
+      height: 33px;
77
+      margin: auto 31px;
78
+    }
10 79
   }
11
-}
12 80
 
13
-.buton-bottom-Feedback {
14
-  width: 100%;
15
-  margin: 0 auto;
16
-  position: fixed;
17
-  bottom: 6vh;
81
+  .startReserve-Bottom {
82
+    position: absolute;
83
+    bottom: -3vh;
84
+    width: 92vw;
85
+  }
18 86
 }

+ 70
- 5
src/pages/CheckMap/index.jsx Datei anzeigen

@@ -1,22 +1,87 @@
1
-import { useState } from "react"
2
-import { Textarea, View } from "@tarojs/components"
1
+import { useEffect } from "react"
2
+import { Map, View, Image, Text } from "@tarojs/components"
3 3
 import CustomNav from "@/components/CustomNav"
4 4
 import ButtontWX from "@/components/ButtontWX"
5
+import Taro from "@tarojs/taro"
6
+import decorate from "@/assets/icons/comm/decorate.png"
7
+import addresss from '@/assets/mineImgaes/addresss.png'//地址
5 8
 import './style.less'
6 9
 
7 10
 
8
-
9 11
 export default (props) => {
10 12
 
13
+  const $instance = Taro.getCurrentInstance()
14
+
15
+
16
+  useEffect(() => {
17
+    console.log($instance.router.params)
18
+
19
+  }, [])
20
+
21
+  const startReserve = () => {
22
+    Taro.navigateTo({ url: `/pages/OrderInfo/index?id${1}` })
23
+
24
+  }
25
+
26
+  const markers = [{ // 绘制浮标,传入JSON支持多个
27
+    // iconPath: "/images/location.png", 
28
+    id: 0,
29
+    latitude: 112.092169,// 经度
30
+    longitude: 32.694883,//纬度
31
+    width: 50, // 浮标宽度
32
+    height: 50 // 浮标高度
33
+  }]
11 34
 
12 35
   return (
13 36
     <View className='page-index'>
14 37
       <View className='index-navbar'>
15 38
         <CustomNav title='查看地图' />
16 39
       </View>
17
-      <View>
40
+      <scroll-view scrollY style='height: 100%;' >
18 41
 
19
-      </View>
42
+        <View className='MapBox-centent'>
43
+          <Map
44
+            id='map'
45
+            longitude='112.092169'
46
+            latitude='32.694883'
47
+            scale='12'
48
+            markers={markers}
49
+            bindmarkertap='markertap'
50
+            style='width:100%;height:35vh;'
51
+          >
52
+          </Map>
53
+          <View className='MapBox-centent-BodyArticle'>
54
+            <Image style={{ width: '100%', borderRadius: '20px 20px 0px 0px' }} src='http://img3.jc001.cn/img/001/1/1512/15566fd0311736f.jpg' />
55
+            <View className='CarsContent-TextBox'>
56
+              <View className='CheckDetails-bottom-box-flaxBox-liftText'>
57
+                <View className='CheckDetails-bottom-box-flaxBox-liftText-Titles'>不知家收割机</View>
58
+                <View className='CheckDetails-bottom-box-flaxBox-liftText-price'>2188/<Text>公顷</Text></View>
59
+              </View>
60
+              <View className='content-header-box-map-Info'>
61
+                <View className='content-header-box-map-Info-liftCentent'>
62
+                  <Image src={addresss} />
63
+                  <View>距离当前位置8.8公里&gt;&gt;</View>
64
+                </View>
65
+              </View>
66
+              <View className='content-header-box-map-Info-carsName'>农机手小李的收割机</View>
67
+              <View className='startReserve-centent'>
68
+                {/* <View className='articleTitle-box-Details'>
69
+                  <Image src={decorate} />
70
+                  <View>作业详情</View>
71
+                  <Image src={decorate} />
72
+                </View> */}
73
+
74
+                <View className='startReserve-Bottom'>
75
+                  <ButtontWX butText='预约' onClick={startReserve} butWidth={300} butHeight={49} butFontSize={16} butBorderRadius={49} />
76
+
77
+                </View>
78
+              </View>
79
+
80
+
81
+            </View>
82
+          </View>
83
+        </View>
84
+      </scroll-view>
20 85
     </View>
21 86
   )
22 87
 }

+ 92
- 16
src/pages/CheckMap/style.less Datei anzeigen

@@ -1,18 +1,94 @@
1
-.components-page {
2
-  &-TextareaCentent {
3
-    width: 85%;
4
-    background: #fefefe;
5
-    border: 2px solid rgba(0, 0, 0, 0.2);
6
-    border-radius: 20px;
7
-    min-height: 25vh;
8
-    margin: 1em auto;
9
-    padding: 10px 37px;
10
-  }
11
-}
1
+.MapBox-centent {
2
+  width: 100vw;
3
+  &-BodyArticle {
4
+    background: #fff;
5
+    position: relative;
6
+    top: -7vh;
7
+    .CarsContent-TextBox {
8
+      padding: 40px 30px;
9
+      position: relative;
10
+      top: -8vh;
11
+      background-color: #fff;
12
+      border-radius: 40px 40px 0px 0px;
13
+      .CheckDetails-bottom-box-flaxBox-liftText {
14
+        width: 95%;
15
+
16
+        display: flex;
17
+        justify-content: space-between;
18
+
19
+        &-Titles {
20
+          text-overflow: ellipsis; //显示...
21
+          white-space: nowrap; //不换行
22
+          overflow: hidden;
23
+          font-size: 36px;
24
+          font-weight: bold;
25
+          color: #222222;
26
+        }
27
+        &-price {
28
+          font-size: 44px;
29
+          font-weight: 800;
30
+          color: #666666;
31
+          background: linear-gradient(180deg, #fa7878 0%, #b61515 100%);
32
+          -webkit-background-clip: text;
33
+          -webkit-text-fill-color: transparent;
34
+          > Text {
35
+            font-size: 25px;
36
+          }
37
+        }
38
+      }
12 39
 
13
-.buton-bottom-Feedback {
14
-  width: 100%;
15
-  margin: 0 auto;
16
-  position: fixed;
17
-  bottom: 6vh;
40
+      .content-header-box-map-Info {
41
+        margin: 0 auto;
42
+        display: flex;
43
+        align-items: center;
44
+        // justify-content: space-between;
45
+        padding: 30px 0 30px 0;
46
+        &-liftCentent {
47
+          display: flex;
48
+          align-items: center;
49
+          > Image {
50
+            width: 22px;
51
+            height: 27px;
52
+          }
53
+          > View {
54
+            padding-left: 15px;
55
+            font-size: 30px;
56
+            font-weight: 800;
57
+            color: #222222;
58
+          }
59
+        }
60
+        &-rightCententInfo {
61
+          font-size: 30px;
62
+          font-weight: 500;
63
+          color: #666666;
64
+        }
65
+        &-carsName {
66
+          font-size: 30px;
67
+          font-weight: bold;
68
+          color: #222222;
69
+        }
70
+      }
71
+
72
+      .articleTitle-box-Details {
73
+        display: flex;
74
+        font-size: 30px;
75
+        font-weight: bold;
76
+        color: #222222;
77
+        align-items: center;
78
+        justify-content: center;
79
+        margin-top: 32px;
80
+        > Image {
81
+          width: 33px;
82
+          height: 33px;
83
+          margin: auto 31px;
84
+        }
85
+      }
86
+
87
+      .startReserve-Bottom {
88
+        position: relative;
89
+        bottom: -3vh;
90
+        width: 92vw;
91
+      }
92
+    }
93
+  }
18 94
 }

+ 6
- 1
src/pages/OrderInfo/index.jsx Datei anzeigen

@@ -2,6 +2,7 @@ import { View, Text } from "@tarojs/components"
2 2
 import { useState } from "react"
3 3
 import CustomNav from '@/components/CustomNav'
4 4
 import ButtontWX from '@/components/ButtontWX'
5
+import store from "@/store"
5 6
 // import BottomMoadl from '@/components/BottomMoadl/index'
6 7
 
7 8
 
@@ -18,6 +19,10 @@ export default (props) => {
18 19
   //   setShowFrame(!showFrame)
19 20
   // }
20 21
 
22
+  const pay = () => {
23
+
24
+  }
25
+
21 26
 
22 27
   return (
23 28
     <View className='page-index'>
@@ -37,7 +42,7 @@ export default (props) => {
37 42
         </View>
38 43
       </View>
39 44
       <View className='BottomtBut' >
40
-        <ButtontWX butText='支付' butWidth={345} butHeight={49} butFontSize={16} butBorderRadius={49} />
45
+        <ButtontWX butText='支付' onClick={pay} butWidth={345} butHeight={49} butFontSize={16} butBorderRadius={49} />
41 46
       </View>
42 47
     </View>
43 48
   )

+ 33
- 4
src/pages/index/tabs/Homes.jsx Datei anzeigen

@@ -7,6 +7,8 @@ import searchs from '@/assets/homesImgaes/searchs.png'//搜索图片
7 7
 import carsListImga from '@/assets/homesImgaes/carsListImga.png'//农机列表图片
8 8
 
9 9
 
10
+import store from '@/store'
11
+
10 12
 import './HomesCss/style.less'
11 13
 
12 14
 export default (props) => {
@@ -34,9 +36,36 @@ export default (props) => {
34 36
     console.log(e.detail.value)
35 37
   }
36 38
 
37
-  const goToCarsList = () => {
39
+  const goToCarsList = () => {//更多
38 40
     Taro.navigateTo({ url: '/pages/MoreCars/index' })
41
+
42
+    // let value = store.getState()
43
+    // console.log('value-Home里面取值', store.getState());
44
+    // if (value.appid == '') {
45
+    //   Taro.showToast({
46
+    //     title: '成功',
47
+    //     icon: 'success',
48
+    //     duration: 2000
49
+    //   })
50
+    // } else {
51
+
52
+    // }
53
+
54
+  }
55
+
56
+  const startReserve = () => {
57
+    Taro.navigateTo({ url: `/pages/OrderInfo/index?id${1}` })
58
+
59
+  }
60
+  const goCarsInfo = (res) => {
61
+    Taro.navigateTo({ url: `/pages/CheckDetails/index?id=${res}` })
62
+
39 63
   }
64
+  const goMapInfo = (res) => {
65
+    Taro.navigateTo({ url: `/pages/CheckMap/index?mapId=${res + 111}` })
66
+
67
+  }
68
+
40 69
 
41 70
   return (
42 71
 
@@ -76,17 +105,17 @@ export default (props) => {
76 105
         carsList.map((item, index) => {
77 106
           return (
78 107
             <View key={index} className='carsListImga-bottom-box'>
79
-              <Image src={item.carsUrl} />
108
+              <Image src={item.carsUrl} onClick={() => goCarsInfo(item.id)} />
80 109
               <View className='carsListImga-bottom-box-flaxBox'>
81 110
                 <View className='carsListImga-bottom-box-flaxBox-liftText'>
82 111
                   <View className='carsListImga-bottom-box-flaxBox-liftText-Titles'>{item.carsName}</View>
83 112
                   <View className='carsListImga-bottom-box-flaxBox-liftText-price'>{item.jiage}/<Text>公顷</Text></View>
84 113
                 </View>
85 114
                 <View className='carsListImga-bottom-box-flaxBox-rightBut'>
86
-                  <ButtontWX butText='预约' butWidth={80} butHeight={34} butFontSize={19} butBorderRadius={0} />
115
+                  <ButtontWX onClick={startReserve} butText='预约' butWidth={80} butHeight={34} butFontSize={19} butBorderRadius={0} />
87 116
                 </View>
88 117
               </View>
89
-              <View className='content-header-box-map'>
118
+              <View className='content-header-box-map' onClick={() => goMapInfo(item.mapId)}>
90 119
                 <View className='content-header-box-map-liftCentent'>
91 120
                   <Image src={addresss} />
92 121
                   <View>距离当前位置{item.carsLocation}公里</View>

+ 50
- 9
src/pages/index/tabs/Mine.jsx Datei anzeigen

@@ -1,6 +1,6 @@
1 1
 
2 2
 import { View, Image } from "@tarojs/components"
3
-import { useDidShow } from "@tarojs/taro"
3
+import Taro from "@tarojs/taro"
4 4
 import { useState } from "react"
5 5
 import UserCellBox from '@/components/UserCellBox'
6 6
 import addresss from '@/assets/mineImgaes/addresss.png'//地址
@@ -9,18 +9,59 @@ import feedbacks from '@/assets/mineImgaes/feedbacks.png'//意见反馈
9 9
 import helpCenter from '@/assets/mineImgaes/helpCenter.png'//帮助中心
10 10
 import versionUpdate from '@/assets/mineImgaes/versionUpdate.png'//版本更新
11 11
 import userRight from '@/assets/mineImgaes/userRight.png'//版本更新
12
+import store from "@/store"
12 13
 import './MineCss/style.less'
13 14
 
14 15
 
15 16
 export default (props) => {
16 17
   const [isLoginBox, setIsLoginBox] = useState(false)
17 18
   const userList = [
18
-    { userTitle: '关于我们', userImg: aboutUs },
19
-    { userTitle: '版本更新', userImg: versionUpdate },
20
-    { userTitle: '帮助中心', userImg: helpCenter },
21
-    { userTitle: '意见反馈', userImg: feedbacks },
19
+    { userTitle: '关于我们', userImg: aboutUs, pageType: 0 },
20
+    { userTitle: '版本更新', userImg: versionUpdate, pageType: 1 },
21
+    { userTitle: '帮助中心', userImg: helpCenter, pageType: 2 },
22
+    { userTitle: '意见反馈', userImg: feedbacks, pageType: 3 },
22 23
   ]
23 24
 
25
+
26
+  const setAddress = (dd) => {
27
+    Taro.navigateTo({ url: `/pages/MyAddressInfo/index?id${dd}` })
28
+
29
+  }
30
+
31
+  const userLoginnow = () => {
32
+    const action = { type: "SET_VISIBILITY_FILTER", state: { appid: '55555555555' } }
33
+    store.dispatch(action)
34
+    console.log(store.getState());
35
+
36
+
37
+    // Taro.navigateTo({ url: `/pages/UserLogin/index?id` })
38
+    // setIsLoginBox(true)
39
+  }
40
+  const goToPages = (res) => {
41
+    switch (res) {
42
+      case 0:
43
+        Taro.navigateTo({ url: '/pages/AboutUsPage/index' })
44
+
45
+        break;
46
+      case 1:
47
+        Taro.navigateTo({ url: '/pages/NewVersionUpdatePage/index' })
48
+
49
+        break;
50
+      case 2:
51
+        Taro.navigateTo({ url: '/pages/HelpCenterInfo/index' })
52
+
53
+        break;
54
+      case 3:
55
+        Taro.navigateTo({ url: '/pages/FeedbackText/index' })
56
+
57
+        break;
58
+
59
+      default:
60
+        break;
61
+    }
62
+  }
63
+
64
+
24 65
   return (
25 66
 
26 67
     <scroll-view scrollY style='height: 100%;' >
@@ -30,7 +71,7 @@ export default (props) => {
30 71
           !isLoginBox ?
31 72
             <View style={{ backgroundImage: "url(" + require("@/assets/mineImgaes/mineBack.png") + ")" }} className='User-Avatar-background-falseBox'>
32 73
               <Image className='User-Avatar-background-falseBox-userImg userImg' src='https://profile.csdnimg.cn/3/1/5/0_qq_42551866' />
33
-              <View className='User-Avatar-background-falseBox-userLogin' onClick={() => setIsLoginBox(true)}>点击登陆</View>
74
+              <View onClick={userLoginnow} className='User-Avatar-background-falseBox-userLogin' >点击登陆</View>
34 75
             </View>
35 76
             :
36 77
             <>
@@ -43,8 +84,8 @@ export default (props) => {
43 84
                 </View>
44 85
 
45 86
               </View>
46
-              <UserCellBox title='地址信息' >
47
-                <View className='addresss-box'>
87
+              <UserCellBox title='地址信息'>
88
+                <View className='addresss-box' onClick={setAddress} >
48 89
                   <Image className='addresss-box-images' src={addresss} />
49 90
                   <View className='addresss-box-contents'>
50 91
                     <View className='addresss-box-contents-texts' >河南省南阳市邓州市九龙镇5556666665</View>
@@ -61,7 +102,7 @@ export default (props) => {
61 102
           {
62 103
             userList.map((item, index) => {
63 104
               return (
64
-                <View key={index} className='User-Setup-background-wxInfo-InfoCell'>
105
+                <View key={index} className='User-Setup-background-wxInfo-InfoCell' onClick={() => goToPages(item.pageType)}>
65 106
                   <Image className='User-Setup-background-wxInfo-InfoCell-imgae' src={item.userImg} />
66 107
                   <View className='box-flex'>
67 108
                     <View className='User-Setup-background-wxInfo-InfoCell-text'>{item.userTitle}</View>

+ 8
- 0
src/store/index.js Datei anzeigen

@@ -0,0 +1,8 @@
1
+import { createStore } from 'redux'
2
+import reducer from './reducers'
3
+
4
+
5
+const store = createStore(reducer) // 创建数据存储仓库
6
+
7
+
8
+export default store   

+ 43
- 0
src/store/reducers.js Datei anzeigen

@@ -0,0 +1,43 @@
1
+const defaultState = {
2
+  appid: '',
3
+  cookis: ''
4
+}
5
+console.log(defaultState, 'defaultState');
6
+
7
+
8
+function todoApp (state = defaultState, action) {
9
+  state = JSON.parse(JSON.stringify(state)) //深度
10
+  switch (action.type) {
11
+    case 'SET_VISIBILITY_FILTER':
12
+      state = {
13
+        ...defaultState,
14
+        ...action.state
15
+      }
16
+      return state;
17
+    default:
18
+      return state;
19
+
20
+
21
+
22
+  }
23
+}
24
+
25
+
26
+// function fn (state = defaultState, action) {
27
+//   state = JSON.parse(JSON.stringify(state)) //深度
28
+
29
+//   switch (action.type) {
30
+//     case "setVisibilityFilter":
31
+//       state = {
32
+//         ...defaultState,
33
+//         ...action.state
34
+//       }
35
+//       return state;
36
+//     default:
37
+//       return state;
38
+//   }
39
+
40
+// }
41
+
42
+const state = todoApp
43
+export default state

+ 1521
- 1532
yarn.lock
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen