[baozhangchao] 3 年之前
父節點
當前提交
fca1ddf51a

二進制
src/assets/icons/comm/scoreOFF.png 查看文件


二進制
src/assets/icons/comm/scoreON.png 查看文件


+ 2
- 1
src/components/CarsListContent/index.jsx 查看文件

@@ -36,7 +36,8 @@ export default (props) => {
36 36
 
37 37
   }
38 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 查看文件

@@ -0,0 +1,88 @@
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 查看文件

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

+ 10
- 0
src/components/orderRater/index.wxml 查看文件

@@ -0,0 +1,10 @@
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 查看文件

@@ -0,0 +1,28 @@
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,12 +5,17 @@ import ButtontWX from "@/components/ButtontWX"
5 5
 import Taro from "@tarojs/taro"
6 6
 import locationImage from "@/assets/icons/comm/locationImage.png"
7 7
 import addresss from '@/assets/mineImgaes/addresss.png'//地址
8
+import { getMachineryInfo } from "@/services/homes"
9
+
8 10
 import './style.less'
9 11
 
10 12
 
11 13
 export default (props) => {
12 14
 
15
+
13 16
   const $instance = Taro.getCurrentInstance()
17
+  const { id, location } = $instance.router.params
18
+
14 19
   const [mapLoca, setMapLoca] = useState('')
15 20
   Taro.getStorage({
16 21
     key: 'location',
@@ -24,11 +29,23 @@ export default (props) => {
24 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 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 50
   const startReserve = () => {
34 51
     Taro.navigateTo({ url: `/pages/OrderInfo/index?id${1}` })
@@ -67,11 +84,11 @@ export default (props) => {
67 84
           >
68 85
           </Map>
69 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 88
             <View className='CarsContent-TextBox'>
72 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 92
               </View>
76 93
               <View className='content-header-box-map-Info'>
77 94
                 <View className='content-header-box-map-Info-liftCentent'>
@@ -79,7 +96,7 @@ export default (props) => {
79 96
                   <View>距离当前位置8.8公里&gt;&gt;</View>
80 97
                 </View>
81 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 100
               <View className='startReserve-centent'>
84 101
                 {/* <View className='articleTitle-box-Details'>
85 102
                   <Image src={decorate} />

+ 0
- 2
src/pages/FeedbackText/index.jsx 查看文件

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

+ 17
- 13
src/pages/MyAddressList/AddressInfos/index.jsx 查看文件

@@ -63,24 +63,28 @@ export default (props) => {
63 63
   }
64 64
 
65 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 78
           <View>是否设为默认地址:</View>
75 79
 
76 80
           <Switch name='isDefault' onChange={handelSwitch} type='checkbox' />
77 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 88
     </View>
84
-
85 89
   )
86 90
 }

+ 2
- 4
src/pages/MyAddressList/AddressInfos/style.less 查看文件

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

+ 1
- 0
src/pages/MyAddressList/index.config.js 查看文件

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

+ 7
- 1
src/pages/MyAddressList/index.jsx 查看文件

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