[baozhangchao] 3 年 前
コミット
fca1ddf51a

バイナリ
src/assets/icons/comm/scoreOFF.png ファイルの表示


バイナリ
src/assets/icons/comm/scoreON.png ファイルの表示


+ 2
- 1
src/components/CarsListContent/index.jsx ファイルの表示

36
 
36
 
37
   }
37
   }
38
   const goMapInfo = (res) => {
38
   const goMapInfo = (res) => {
39
-    Taro.navigateTo({ url: `/pages/CheckMap/index?mapId=${res + 111}` })
39
+    Taro.navigateTo({ url: `/pages/CheckMap/index?id=${res}&location=${location}` })
40
+
40
 
41
 
41
   }
42
   }
42
 
43
 

+ 88
- 0
src/components/orderRater/index.js ファイルの表示

1
+import scoreOFF from '../../assets/icons/comm/scoreOFF.png'
2
+import scoreON from '../../assets/icons/comm/scoreON.png'
3
+
4
+Component({
5
+  /**
6
+   * 组件的属性列表
7
+   */
8
+  properties: {
9
+    initW: {
10
+      type: String,
11
+      value: '100%'
12
+    },
13
+    initH: {
14
+      type: String,
15
+      value: '100%'
16
+    },
17
+    score: {
18
+      type: Number,
19
+      value: 0
20
+    },
21
+    onlyShow: {
22
+      type: Boolean,
23
+      value: false
24
+    },
25
+    starW: {
26
+      type: String,
27
+      value: '58rpx'
28
+    },
29
+    starH: {
30
+      type: String,
31
+      value: '55rpx'
32
+    },
33
+    stars: {
34
+      type: Array,
35
+      value: [
36
+        {
37
+          light: scoreON,
38
+          gray: scoreOFF,
39
+          // tips: '极差'
40
+        },
41
+        {
42
+          light: scoreON,
43
+          gray: scoreOFF,
44
+          // tips: '差'
45
+        },
46
+        {
47
+          light: scoreON,
48
+          gray: scoreOFF,
49
+          // tips: '一般'
50
+        },
51
+        {
52
+          light: scoreON,
53
+          gray: scoreOFF,
54
+          // tips: '好'
55
+        },
56
+        {
57
+          light: scoreON,
58
+          gray: scoreOFF,
59
+          // tips: '极好'
60
+        },
61
+
62
+      ]
63
+    }
64
+  },
65
+
66
+  data: {
67
+    initScore: 0
68
+  },
69
+
70
+
71
+  methods: {
72
+    clickStar: function (e) {
73
+      if (this.properties.onlyShow) return
74
+      let index = e.currentTarget.dataset.index
75
+      this.setData({
76
+        initScore: index + 1
77
+      })
78
+      this.triggerEvent('raterChange', index + 1)
79
+
80
+    }
81
+  },
82
+  ready () {
83
+    this.setData({
84
+      initScore: this.properties.score
85
+    })
86
+    console.log('ready')
87
+  }
88
+})

+ 4
- 0
src/components/orderRater/index.json ファイルの表示

1
+{
2
+  "component": true,
3
+  "usingComponents": {}
4
+}

+ 10
- 0
src/components/orderRater/index.wxml ファイルの表示

1
+<view class="rater-box" style="width: {{initW}};height: {{initH}}">
2
+  <view class="rater-item" wx:for="{{stars}}" wx:key="{{index}}">
3
+    <view class="star-box" bindtap="clickStar" data-index="{{index}}" style="width: {{starW}};height: {{starH}}">
4
+      <image class="small-icon" src="{{initScore > index ? item.light : item.gray}}"></image>
5
+    </view>
6
+    <view class="tips {{initScore > index ? 'active' : ''}}" wx:if="{{item.tips}}">
7
+      {{item.tips}}
8
+    </view>
9
+  </view>
10
+</view>

+ 28
- 0
src/components/orderRater/index.wxss ファイルの表示

1
+.rater-box {
2
+  width: 100%;
3
+  display: flex;
4
+  justify-content: space-around;
5
+  align-items: center;
6
+  background-color: #fff;
7
+}
8
+.rater-item {
9
+  vertical-align: middle;
10
+  display: inline-block;
11
+}
12
+.star-box {
13
+  position: relative;
14
+}
15
+.small-icon {
16
+  width: 100%;
17
+  height: 100%;
18
+  vertical-align: top;
19
+}
20
+.tips {
21
+  color: #a6a6a6;
22
+  font-size: 24rpx;
23
+  text-align: center;
24
+  line-height: 36rpx;
25
+}
26
+.tips.active {
27
+  color: #816f68;
28
+}

+ 23
- 6
src/pages/CheckMap/index.jsx ファイルの表示

5
 import Taro from "@tarojs/taro"
5
 import Taro from "@tarojs/taro"
6
 import locationImage from "@/assets/icons/comm/locationImage.png"
6
 import locationImage from "@/assets/icons/comm/locationImage.png"
7
 import addresss from '@/assets/mineImgaes/addresss.png'//地址
7
 import addresss from '@/assets/mineImgaes/addresss.png'//地址
8
+import { getMachineryInfo } from "@/services/homes"
9
+
8
 import './style.less'
10
 import './style.less'
9
 
11
 
10
 
12
 
11
 export default (props) => {
13
 export default (props) => {
12
 
14
 
15
+
13
   const $instance = Taro.getCurrentInstance()
16
   const $instance = Taro.getCurrentInstance()
17
+  const { id, location } = $instance.router.params
18
+
14
   const [mapLoca, setMapLoca] = useState('')
19
   const [mapLoca, setMapLoca] = useState('')
15
   Taro.getStorage({
20
   Taro.getStorage({
16
     key: 'location',
21
     key: 'location',
24
   console.log("🚀 ~ file: index.jsx ~ line 25 ~ LocationMap", LocationMap)
29
   console.log("🚀 ~ file: index.jsx ~ line 25 ~ LocationMap", LocationMap)
25
 
30
 
26
 
31
 
32
+  const [carsInfo, setCarsInfo] = useState({})
33
+  const [imagesList, setImagesList] = useState([])
34
+  const [contentList, setContentList] = useState([])
35
+
27
 
36
 
28
   useEffect(() => {
37
   useEffect(() => {
29
-    console.log($instance.router.params)
30
 
38
 
31
-  }, [])
39
+    getMachineryInfo(id, { location: location, attached: true }).then((e) => {
40
+      setImagesList(e.imagesList)
41
+      setContentList(e.contentList)
42
+      setCarsInfo(e)
43
+
44
+      console.log('e', e);
45
+    })
46
+
47
+  }, [$instance.router.params, id, location])
48
+
32
 
49
 
33
   const startReserve = () => {
50
   const startReserve = () => {
34
     Taro.navigateTo({ url: `/pages/OrderInfo/index?id${1}` })
51
     Taro.navigateTo({ url: `/pages/OrderInfo/index?id${1}` })
67
           >
84
           >
68
           </Map>
85
           </Map>
69
           <View className='MapBox-centent-BodyArticle'>
86
           <View className='MapBox-centent-BodyArticle'>
70
-            <Image style={{ width: '100%', borderRadius: '20px 20px 0px 0px' }} src='http://img3.jc001.cn/img/001/1/1512/15566fd0311736f.jpg' />
87
+            <Image style={{ width: '100%', borderRadius: '20px 20px 0px 0px' }} src={carsInfo.thumb} />
71
             <View className='CarsContent-TextBox'>
88
             <View className='CarsContent-TextBox'>
72
               <View className='CheckDetails-bottom-box-flaxBox-liftText'>
89
               <View className='CheckDetails-bottom-box-flaxBox-liftText'>
73
-                <View className='CheckDetails-bottom-box-flaxBox-liftText-Titles'>不知家收割机</View>
74
-                <View className='CheckDetails-bottom-box-flaxBox-liftText-price'>2188/<Text>公顷</Text></View>
90
+                <View className='CheckDetails-bottom-box-flaxBox-liftText-Titles'>{carsInfo.name}</View>
91
+                <View className='CheckDetails-bottom-box-flaxBox-liftText-price'>{carsInfo.price}/<Text>公顷</Text></View>
75
               </View>
92
               </View>
76
               <View className='content-header-box-map-Info'>
93
               <View className='content-header-box-map-Info'>
77
                 <View className='content-header-box-map-Info-liftCentent'>
94
                 <View className='content-header-box-map-Info-liftCentent'>
79
                   <View>距离当前位置8.8公里&gt;&gt;</View>
96
                   <View>距离当前位置8.8公里&gt;&gt;</View>
80
                 </View>
97
                 </View>
81
               </View>
98
               </View>
82
-              <View className='content-header-box-map-Info-carsName'>农机手小李的收割机</View>
99
+              <View className='content-header-box-map-Info-carsName'>{carsInfo.orgName}</View>
83
               <View className='startReserve-centent'>
100
               <View className='startReserve-centent'>
84
                 {/* <View className='articleTitle-box-Details'>
101
                 {/* <View className='articleTitle-box-Details'>
85
                   <Image src={decorate} />
102
                   <Image src={decorate} />

+ 0
- 2
src/pages/FeedbackText/index.jsx ファイルの表示

32
           icon: 'success',
32
           icon: 'success',
33
           duration: 2000
33
           duration: 2000
34
         }).then(() => {
34
         }).then(() => {
35
-
36
           setTimeout(() => {
35
           setTimeout(() => {
37
             setLoading(true)
36
             setLoading(true)
38
-
39
             Taro.navigateBack({
37
             Taro.navigateBack({
40
               delta: 1
38
               delta: 1
41
             }
39
             }

+ 17
- 13
src/pages/MyAddressList/AddressInfos/index.jsx ファイルの表示

63
   }
63
   }
64
 
64
 
65
   return (
65
   return (
66
-
67
-    <View className='form-content'>
68
-      <Form onSubmit={formSubmit} onReset={formReset} >
69
-        <View className='example-body'>
70
-          <View>详细地址:</View>
71
-          <Textarea name='address' value={address} className='aTextareaCentent' placeholder='请输入地址信息' />
72
-        </View>
73
-        {/* <View className='example-body'>
66
+    <View className='page-index'>
67
+      {/* <View className='index-navbar'>
68
+        <CustomNav title='地址管理' />
69
+      </View> */}
70
+
71
+      <View className='form-content'>
72
+        <Form onSubmit={formSubmit} onReset={formReset} >
73
+          <View className='example-body'>
74
+            <View>详细地址:</View>
75
+            <Textarea name='address' value={address} className='aTextareaCentent' placeholder='请输入地址信息' />
76
+          </View>
77
+          {/* <View className='example-body'>
74
           <View>是否设为默认地址:</View>
78
           <View>是否设为默认地址:</View>
75
 
79
 
76
           <Switch name='isDefault' onChange={handelSwitch} type='checkbox' />
80
           <Switch name='isDefault' onChange={handelSwitch} type='checkbox' />
77
         </View> */}
81
         </View> */}
78
-        <View className='buton-bottom'>
79
-          <ButtontWX onClick={formSubmit} formType='submit' butText='保存' butWidth={315} butHeight={49} butFontSize={16} butBorderRadius={49} />
80
-        </View>
81
-      </Form>
82
+          <View className='buton-bottom'>
83
+            <ButtontWX onClick={formSubmit} formType='submit' butText='保存' butWidth={315} butHeight={49} butFontSize={16} butBorderRadius={49} />
84
+          </View>
85
+        </Form>
82
 
86
 
87
+      </View>
83
     </View>
88
     </View>
84
-
85
   )
89
   )
86
 }
90
 }

+ 2
- 4
src/pages/MyAddressList/AddressInfos/style.less ファイルの表示

1
 .form-content {
1
 .form-content {
2
-  width: 100%;
3
   height: 100%;
2
   height: 100%;
4
-  margin: 40px 30px;
3
+  margin: 40px auto;
5
   .example-body {
4
   .example-body {
6
-    margin-top: 40px;
7
     > View {
5
     > View {
8
       width: 90%;
6
       width: 90%;
9
 
7
 
31
   }
29
   }
32
   .buton-bottom {
30
   .buton-bottom {
33
     width: 100%;
31
     width: 100%;
34
-    margin: 85px -40px;
32
+    margin: 85px auto;
35
   }
33
   }
36
 }
34
 }

+ 1
- 0
src/pages/MyAddressList/index.config.js ファイルの表示

4
   navigationStyle: 'custom',
4
   navigationStyle: 'custom',
5
   disableScroll: true,
5
   disableScroll: true,
6
   usingComponents: {
6
   usingComponents: {
7
+    "mp-orderRater": '../../components/orderRater/index'
7
   }
8
   }
8
 
9
 
9
 
10
 

+ 7
- 1
src/pages/MyAddressList/index.jsx ファイルの表示

88
 
88
 
89
   }, [])
89
   }, [])
90
 
90
 
91
+  const srcor = (e) => {
92
+    console.log('评分', e.detail);
91
 
93
 
94
+  }
92
 
95
 
93
   return (
96
   return (
94
     <View className='page-index'>
97
     <View className='page-index'>
97
       </View>
100
       </View>
98
       <scroll-view scrollY style='height: 100%;' >
101
       <scroll-view scrollY style='height: 100%;' >
99
         <View>
102
         <View>
103
+
104
+          {/* <mp-orderRater raterChange={srcor} initW='50%' /> */}
105
+
106
+
100
           {
107
           {
101
             addresList.map((item, index) => {
108
             addresList.map((item, index) => {
102
               return (
109
               return (
140
 
147
 
141
           <View className='bottomButtom' >
148
           <View className='bottomButtom' >
142
             <ButtontWX onClick={addAddress} formType='submit' butText='+新增收货地址' butWidth={315} butHeight={49} butFontSize={16} butBorderRadius={49} />
149
             <ButtontWX onClick={addAddress} formType='submit' butText='+新增收货地址' butWidth={315} butHeight={49} butFontSize={16} butBorderRadius={49} />
143
-
144
           </View>
150
           </View>
145
 
151
 
146
         </View>
152
         </View>