xcx vor 4 Jahren
Ursprung
Commit
a4fe40aca5

+ 1
- 1
src/components/ActivityListItem/index.jsx Datei anzeigen

@@ -1,4 +1,4 @@
1
-import React, { useState } from 'react'
1
+import React, { } from 'react'
2 2
 import Taro from '@tarojs/taro'
3 3
 import toolclass from '@/utils/toolclass.js'
4 4
 import '@/assets/css/reset.less'

+ 6
- 4
src/components/PrizeListItem/index.css Datei anzeigen

@@ -36,18 +36,20 @@
36 36
 }
37 37
 .PrizeListItem > .Info > .flex-h {
38 38
   align-items: center;
39
+  position: relative;
40
+  overflow: hidden;
39 41
 }
40
-.PrizeListItem > .Info > .flex-h > text {
42
+.PrizeListItem > .Info > .flex-h > view text {
41 43
   font-size: 24px;
42 44
   color: #333;
43 45
   line-height: 40px;
44 46
 }
45
-.PrizeListItem > .Info > .flex-h > text.Count {
47
+.PrizeListItem > .Info > .flex-h > view.Count text {
46 48
   color: #971C21;
47 49
 }
48
-.PrizeListItem > .Info > .flex-h > text.Num {
50
+.PrizeListItem > .Info > .flex-h > view.Num text {
49 51
   color: #FF2C28;
50 52
 }
51
-.PrizeListItem > .Info > .flex-h > text:last-child {
53
+.PrizeListItem > .Info > .flex-h > view:last-child text {
52 54
   color: #999;
53 55
 }

+ 8
- 8
src/components/PrizeListItem/index.jsx Datei anzeigen

@@ -6,20 +6,20 @@ import './index.less'
6 6
 
7 7
 export default function PrizeListItem (props) {
8 8
 
9
-  const [TestImg] = useState('https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1606120989360&di=8610f1678b51e26de6d4c6af39d1cf63&imgtype=0&src=http%3A%2F%2Fattachments.gfan.com%2Fforum%2F201503%2F19%2F211608ztcq7higicydxhsy.jpg')
9
+  const { Data } = props
10 10
 
11 11
   return (
12
-    <view className='PrizeListItem' onClick={() => { Taro.navigateTo({ url: `/pages/FuLi/ShangPinXiangQing/index?id=` }) }}>
12
+    <view className='PrizeListItem' onClick={() => { Taro.navigateTo({ url: `/pages/FuLi/ShangPinXiangQing/index?id=${Data.goodsId}` }) }}>
13 13
       <view className='Img'>
14
-        <image mode='aspectFill' src={TestImg} className='centerLabel'></image>
14
+        <image mode='aspectFill' src={Data.imgUrl} className='centerLabel'></image>
15 15
       </view>
16 16
       <view className='Info'>
17
-        <text>沙发垫欧式轻奢</text>
17
+        <text>{Data.goodsName}</text>
18 18
         <view className='flex-h'>
19
-          <text className='Count'>70</text>
20
-          <text className='flex-item'>人已兑换</text>
21
-          <text className='Num'>30000</text>
22
-          <text>积分</text>
19
+          <view className='Count'><text>{Data.totalNum}</text></view>
20
+          <view className='flex-item'><text>人已兑换</text></view>
21
+          <view className='Num'><text>{Data.pointPrice}</text></view>
22
+          <view><text>积分</text></view>
23 23
         </view>
24 24
       </view>
25 25
     </view >

+ 20
- 7
src/components/PrizeListItem/index.less Datei anzeigen

@@ -39,23 +39,36 @@
39 39
 
40 40
     >.flex-h {
41 41
       align-items: center;
42
+      position: relative;
43
+      overflow: hidden;
44
+
45
+      >view {
46
+
47
+        text {
48
+          font-size: 24px;
49
+          color: #333;
50
+          line-height: 40px;
51
+        }
42 52
 
43
-      >text {
44
-        font-size: 24px;
45
-        color: #333;
46
-        line-height: 40px;
47 53
 
48 54
         &.Count {
49
-          color: #971C21;
55
+          text {
56
+            color: #971C21;
57
+          }
50 58
         }
51 59
 
52 60
         &.Num {
53
-          color: #FF2C28;
61
+          text {
62
+            color: #FF2C28;
63
+          }
54 64
         }
55 65
 
56 66
         &:last-child {
57
-          color: #999;
67
+          text {
68
+            color: #999;
69
+          }
58 70
         }
71
+
59 72
       }
60 73
     }
61 74
   }

+ 5
- 1
src/components/ScrollPageRefresh/index.jsx Datei anzeigen

@@ -37,7 +37,11 @@ export default function ScrollPageRefresh (props) {
37 37
       } else {
38 38
         Push([...res[ListName]])
39 39
       }
40
-      setHasNextPage(res.current - 0 < res.pages - 0)
40
+      if (res[ListName].length) {
41
+        setHasNextPage(res.current - 0 < res.pages - 0)
42
+      } else if (res.total === 0) {
43
+        setHasNextPage(false)
44
+      }
41 45
       done()
42 46
     }).catch(() => {
43 47
       done()

+ 19
- 32
src/components/TabPageCutNav/index.jsx Datei anzeigen

@@ -1,37 +1,24 @@
1
-import React, { Component } from 'react'
2
-// import { View, Text } from '@tarojs/components'
3
-import '../../assets/css/reset.less'
4
-import '../../assets/css/iconfont.less'
1
+import React, { } from 'react'
2
+import '@/assets/css/reset.less'
3
+import '@/assets/css/iconfont.less'
5 4
 import './index.less'
6 5
 
7
-export default class TabPageCutNav extends Component {
6
+export default function (props) {
8 7
 
9
-  componentWillMount () { }
10
-
11
-  componentDidMount () { }
12
-
13
-  componentWillUnmount () { }
14
-
15
-  componentDidShow () { }
16
-
17
-  componentDidHide () { }
18
-
19
-  render () {
20
-    const { List = [], CurrentNavId = null, NavChange = () => { } } = this.props
21
-    return (
22
-      <view className='TabPageCutNav'>
23
-        <view>
24
-          <view className='flex-h'>
25
-            {
26
-              List.map((item, index) => (
27
-                <view className='flex-item' key={`TabPageNav-${index}`}>
28
-                  <text class={item.id - 0 === CurrentNavId - 0 ? 'active' : ''} onClick={NavChange(item)}>{item.name}</text>
29
-                </view>
30
-              ))
31
-            }
32
-          </view>
8
+  const { List = [], CurrentNavId = null, NavChange = () => { } } = props
9
+  return (
10
+    <view className='TabPageCutNav'>
11
+      <view>
12
+        <view className='flex-h'>
13
+          {
14
+            List.map((item, index) => (
15
+              <view className='flex-item' key={`TabPageNav-${index}`}>
16
+                <text class={item.id - 0 === CurrentNavId - 0 ? 'active' : ''} onClick={NavChange(item)}>{item.name}</text>
17
+              </view>
18
+            ))
19
+          }
33 20
         </view>
34
-      </view >
35
-    )
36
-  }
21
+      </view>
22
+    </view >
23
+  )
37 24
 }

+ 1
- 0
src/components/WuYeBaoXiu/index.css Datei anzeigen

@@ -1,5 +1,6 @@
1 1
 .WuYeBaoXiu {
2 2
   width: 100%;
3
+  height: 100%;
3 4
   position: relative;
4 5
   overflow: hidden;
5 6
 }

+ 9
- 46
src/components/WuYeBaoXiu/index.jsx Datei anzeigen

@@ -1,65 +1,28 @@
1
-import React, { useState, useEffect } from 'react'
2
-import request, { apis } from '@/utils/request'
1
+import React, { useState } from 'react'
3 2
 import { useModel } from '@/store'
4 3
 import Taro from '@tarojs/taro'
5 4
 import WuYeBaoXiuItem from '@/components/WuYeBaoXiuItem/index'
6
-import ScrollPage from '@/components/ScrollPage/index'
5
+import ScrollPageRefresh from '@/components/ScrollPageRefresh/index'
7 6
 import '@/assets/css/reset.less'
8 7
 import '@/assets/css/iconfont.less'
9 8
 import './index.less'
10 9
 
11
-export default function WuYeBaoXiu (props) {
10
+export default function WuYeBaoXiu () {
12 11
 
13 12
   const { user } = useModel('user')
14
-  const [IsPullUp, setIsPullUp] = useState(false)
15
-  const [IsPullDown, setIsPullDown] = useState(false)
16
-  const [HasNextPage, setHasNextPage] = useState(true)
17
-  const [PageNum, setPageNum] = useState(1)
18 13
   const [PageList, setPageList] = useState([])
19 14
 
20
-  useEffect(() => {
21
-    GetPageList(() => {
22
-      setIsPullUp(false)
23
-    })
24
-  }, [PageNum])
25
-
26
-  const GetPageList = (done = () => { }) => { // 获取列表
27
-    request({ ...apis.getGongDanList, args: { orgId: user.orgId }, params: { pageNum: PageNum, pageSize: 10, type: 2 } }).then((res) => {
28
-      if (PageNum === 1) {
29
-        setPageList([...res.records])
30
-      } else {
31
-        setPageList(PageList.concat([...res.records]))
32
-      }
33
-      setHasNextPage(res.current - 0 < res.pages - 0)
34
-      done()
35
-    }).catch(() => {
36
-      done()
37
-    })
38
-  }
39
-
40
-  const OnRefresh = () => { // 页面下拉刷新
41
-    setIsPullDown(true)
42
-    setHasNextPage(true)
43
-    setPageNum(1)
44
-    if (PageNum === 1) {
45
-      GetPageList(() => {
46
-        setIsPullDown(false)
47
-      })
48
-    } else {
49
-      setPageNum(1)
50
-    }
15
+  const Refresh = (e) => { // 下拉刷新
16
+    setPageList(e)
51 17
   }
52 18
 
53
-  const OnPullUp = () => {
54
-    if (HasNextPage) {
55
-      setIsPullUp(true)
56
-      setPageNum(PageNum + 1)
57
-    }
19
+  const Push = (e) => { // 上拉加载
20
+    setPageList(PageList.concat(e))
58 21
   }
59 22
 
60 23
   return (
61 24
     <view className='WuYeBaoXiu'>
62
-      <ScrollPage IsPullDown={IsPullDown} IsPullUp={IsPullUp} HasMore={HasNextPage} OnRefresh={OnRefresh} OnPullUp={OnPullUp}>
25
+      <ScrollPageRefresh ApiName={`getGongDanList`} ListName={`pagelist`} RequestUrlData={{ orgId: user.orgId }} RequestParams={{ type: 2 }} Refresh={Refresh} Push={Push}>
63 26
 
64 27
         {/* 大图 */}
65 28
         <view className='BigImg'>
@@ -85,7 +48,7 @@ export default function WuYeBaoXiu (props) {
85 48
           }
86 49
         </view>
87 50
 
88
-      </ScrollPage>
51
+      </ScrollPageRefresh>
89 52
     </view>
90 53
   )
91 54
 }

+ 1
- 0
src/components/WuYeBaoXiu/index.less Datei anzeigen

@@ -1,5 +1,6 @@
1 1
 .WuYeBaoXiu {
2 2
   width: 100%;
3
+  height: 100%;
3 4
   position: relative;
4 5
   overflow: hidden;
5 6
 

+ 60
- 0
src/components/WuYeGongGaoItem/index.css Datei anzeigen

@@ -0,0 +1,60 @@
1
+.WuYeGongGaoItem {
2
+  position: relative;
3
+  background: #fff;
4
+  padding: 40px 30px;
5
+}
6
+.WuYeGongGaoItem > .Title {
7
+  align-items: center;
8
+}
9
+.WuYeGongGaoItem > .Title > text {
10
+  font-size: 24px;
11
+  color: #999;
12
+  line-height: 40px;
13
+  white-space: nowrap;
14
+}
15
+.WuYeGongGaoItem > .Title > text:first-child {
16
+  font-size: 30px;
17
+  color: #333;
18
+  font-weight: bold;
19
+  margin-right: 20px;
20
+  overflow: hidden;
21
+  text-overflow: ellipsis;
22
+}
23
+.WuYeGongGaoItem > .GaoItemContent {
24
+  position: relative;
25
+  overflow: hidden;
26
+  background: rgba(243, 88, 68, 0.08);
27
+  padding: 20px;
28
+  margin-top: 40px;
29
+}
30
+.WuYeGongGaoItem > .GaoItemContent > text {
31
+  font-size: 24px;
32
+  line-height: 38px;
33
+  color: #333;
34
+  display: block;
35
+}
36
+.WuYeGongGaoItem > .GaoItemContent > .flex-h {
37
+  align-items: center;
38
+  margin-top: 20px;
39
+  position: relative;
40
+  overflow: hidden;
41
+}
42
+.WuYeGongGaoItem > .GaoItemContent > .flex-h > view {
43
+  margin-left: 10px;
44
+  font-size: 0;
45
+  white-space: nowrap;
46
+}
47
+.WuYeGongGaoItem > .GaoItemContent > .flex-h > view:first-child {
48
+  margin-left: 0;
49
+}
50
+.WuYeGongGaoItem > .GaoItemContent > .flex-h > view text {
51
+  font-size: 24px;
52
+  line-height: 40px;
53
+  color: #999;
54
+  display: inline-block;
55
+  vertical-align: middle;
56
+}
57
+.WuYeGongGaoItem > .GaoItemContent > .flex-h > view text.iconfont {
58
+  color: #F35844;
59
+  font-size: 40px;
60
+}

+ 5
- 5
src/components/WuYeGongGaoItem/index.jsx Datei anzeigen

@@ -1,4 +1,4 @@
1
-import React, { useState } from 'react'
1
+import React, { } from 'react'
2 2
 import Taro from '@tarojs/taro'
3 3
 import toolclass from '@/utils/toolclass.js'
4 4
 import { RichText } from '@tarojs/components'
@@ -19,11 +19,11 @@ export default function WuYeGongGaoItem (props) {
19 19
       <view className='GaoItemContent'>
20 20
         <RichText nodes={Data.announcementContent}></RichText>
21 21
         <view className='flex-h'>
22
-          <text>{Data.createUser}</text>
23
-          <text>物业</text>
22
+          <view><text>{Data.createUser}</text></view>
23
+          <view><text>物业</text></view>
24 24
           <view className='flex-item'></view>
25
-          <text className='iconfont iconguankan'></text>
26
-          <text>{Data.viewCount}人观看</text>
25
+          <view><text className='iconfont iconguankan'></text></view>
26
+          <view><text>{Data.viewCount}人观看</text></view>
27 27
         </view>
28 28
       </view>
29 29
     </view>

+ 14
- 7
src/components/WuYeGongGaoItem/index.less Datei anzeigen

@@ -43,19 +43,26 @@
43 43
       position: relative;
44 44
       overflow: hidden;
45 45
 
46
-      >text {
47
-        font-size: 24px;
48
-        line-height: 40px;
49
-        color: #999;
46
+      >view {
50 47
         margin-left: 10px;
48
+        font-size: 0;
49
+        white-space: nowrap;
51 50
 
52 51
         &:first-child {
53 52
           margin-left: 0;
54 53
         }
55 54
 
56
-        &.iconfont {
57
-          color: #F35844;
58
-          font-size: 40px;
55
+        text {
56
+          font-size: 24px;
57
+          line-height: 40px;
58
+          color: #999;
59
+          display: inline-block;
60
+          vertical-align: middle;
61
+
62
+          &.iconfont {
63
+            color: #F35844;
64
+            font-size: 40px;
65
+          }
59 66
         }
60 67
       }
61 68
     }

+ 6
- 5
src/components/WuYeJiaoFei/index.css Datei anzeigen

@@ -1,29 +1,30 @@
1 1
 .WuYeJiaoFei {
2 2
   width: 100%;
3
+  height: 100%;
3 4
   position: relative;
4 5
   overflow: hidden;
5 6
 }
6
-.WuYeJiaoFei > .BigImg {
7
+.WuYeJiaoFei .BigImg {
7 8
   width: 100%;
8 9
   padding-bottom: 50%;
9 10
   position: relative;
10 11
   overflow: hidden;
11 12
   background: #ccc;
12 13
 }
13
-.WuYeJiaoFei > .BigImg > image {
14
+.WuYeJiaoFei .BigImg > image {
14 15
   width: 100%;
15 16
   height: 100%;
16 17
 }
17
-.WuYeJiaoFei > .List {
18
+.WuYeJiaoFei .List {
18 19
   position: relative;
19 20
   overflow: hidden;
20 21
 }
21
-.WuYeJiaoFei > .List > view {
22
+.WuYeJiaoFei .List > view {
22 23
   width: 100%;
23 24
   position: relative;
24 25
   overflow: hidden;
25 26
   margin-bottom: 30px;
26 27
 }
27
-.WuYeJiaoFei > .List > view:first-child {
28
+.WuYeJiaoFei .List > view:first-child {
28 29
   margin-top: 30px;
29 30
 }

+ 9
- 48
src/components/WuYeJiaoFei/index.jsx Datei anzeigen

@@ -1,64 +1,25 @@
1
-import React, { useState, useEffect } from 'react'
2
-import request, { apis } from '@/utils/request'
3
-import { useModel } from '@/store'
1
+import React, { useState } from 'react'
4 2
 import WuYeJiaoFeiItem from '@/components/WuYeJiaoFeiItem/index'
5
-import ScrollPage from '@/components/ScrollPage/index'
3
+import ScrollPageRefresh from '@/components/ScrollPageRefresh/index'
6 4
 import '@/assets/css/reset.less'
7 5
 import '@/assets/css/iconfont.less'
8 6
 import './index.less'
9 7
 
10 8
 export default function WuYeJiaoFei () {
11
-
12
-  const { user } = useModel('user')
13
-  const [IsPullUp, setIsPullUp] = useState(false)
14
-  const [IsPullDown, setIsPullDown] = useState(false)
15
-  const [HasNextPage, setHasNextPage] = useState(true)
16
-  const [PageNum, setPageNum] = useState(1)
9
+  
17 10
   const [PageList, setPageList] = useState([])
18 11
 
19
-  useEffect(() => {
20
-    GetPageList(() => {
21
-      setIsPullUp(false)
22
-    })
23
-  }, [PageNum])
24
-
25
-  const GetPageList = (done = () => { }) => { // 获取列表
26
-    request({ ...apis.getJiaoFeiList, args: { type: 0 }, params: { pageNum: PageNum, pageSize: 10 } }).then((res) => {
27
-      if (PageNum === 1) {
28
-        setPageList([...res.records])
29
-      } else {
30
-        setPageList(PageList.concat([...res.records]))
31
-      }
32
-      setHasNextPage(res.current - 0 < res.pages - 0)
33
-      done()
34
-    }).catch(() => {
35
-      done()
36
-    })
37
-  }
38
-
39
-  const OnRefresh = () => { // 页面下拉刷新
40
-    setIsPullDown(true)
41
-    setHasNextPage(true)
42
-    setPageNum(1)
43
-    if (PageNum === 1) {
44
-      GetPageList(() => {
45
-        setIsPullDown(false)
46
-      })
47
-    } else {
48
-      setPageNum(1)
49
-    }
12
+  const Refresh = (e) => { // 下拉刷新
13
+    setPageList(e)
50 14
   }
51 15
 
52
-  const OnPullUp = () => {
53
-    if (HasNextPage) {
54
-      setIsPullUp(true)
55
-      setPageNum(PageNum + 1)
56
-    }
16
+  const Push = (e) => { // 上拉加载
17
+    setPageList(PageList.concat(e))
57 18
   }
58 19
 
59 20
   return (
60 21
     <view className='WuYeJiaoFei'>
61
-      <ScrollPage IsPullDown={IsPullDown} IsPullUp={IsPullUp} HasMore={HasNextPage} OnRefresh={OnRefresh} OnPullUp={OnPullUp}>
22
+      <ScrollPageRefresh ApiName={`getJiaoFeiList`} ListName={`list`} RequestUrlData={{ type: 0 }} Refresh={Refresh} Push={Push}>
62 23
 
63 24
         {/* 大图 */}
64 25
         <view className='BigImg'>
@@ -76,7 +37,7 @@ export default function WuYeJiaoFei () {
76 37
           }
77 38
         </view>
78 39
 
79
-      </ScrollPage>
40
+      </ScrollPageRefresh>
80 41
     </view>
81 42
   )
82 43
 }

+ 3
- 2
src/components/WuYeJiaoFei/index.less Datei anzeigen

@@ -1,9 +1,10 @@
1 1
 .WuYeJiaoFei {
2 2
   width: 100%;
3
+  height: 100%;
3 4
   position: relative;
4 5
   overflow: hidden;
5 6
 
6
-  >.BigImg {
7
+  .BigImg {
7 8
     width: 100%;
8 9
     padding-bottom: 50%;
9 10
     position: relative;
@@ -16,7 +17,7 @@
16 17
     }
17 18
   }
18 19
 
19
-  >.List {
20
+  .List {
20 21
     position: relative;
21 22
     overflow: hidden;
22 23
 

+ 24
- 0
src/pages/FuLi/JiFenGuiZe/index.css Datei anzeigen

@@ -52,3 +52,27 @@
52 52
   text-align: center;
53 53
   margin-top: 30px;
54 54
 }
55
+.JiFenGuiZe > .JiFenContent > view > .RuleList {
56
+  position: relative;
57
+  overflow: hidden;
58
+}
59
+.JiFenGuiZe > .JiFenContent > view > .RuleList > view {
60
+  align-items: flex-start;
61
+}
62
+.JiFenGuiZe > .JiFenContent > view > .RuleList > view > .flex-item {
63
+  position: relative;
64
+  overflow: hidden;
65
+}
66
+.JiFenGuiZe > .JiFenContent > view > .RuleList > view > .flex-item > text {
67
+  font-size: 28px;
68
+  color: #fff;
69
+  line-height: 40px;
70
+  display: block;
71
+}
72
+.JiFenGuiZe > .JiFenContent > view > .RuleList > view > view:last-child {
73
+  font-size: 28px;
74
+  color: #fff;
75
+  line-height: 40px;
76
+  text-align: right;
77
+  width: 100px;
78
+}

+ 37
- 3
src/pages/FuLi/JiFenGuiZe/index.jsx Datei anzeigen

@@ -1,16 +1,29 @@
1
-import React, { useState } from 'react'
1
+import React, { useState, useEffect } from 'react'
2 2
 import CustomHeader from '@/components/CustomHeader/index'
3
+import request, { apis } from '@/utils/request'
3 4
 import '@/assets/css/reset.less'
4 5
 import '@/assets/css/iconfont.less'
5 6
 import './index.less'
6 7
 
7
-export default function JiFenGuiZe (props) {
8
+export default function JiFenGuiZe () {
9
+
10
+  const [RuleList, setRuleList] = useState([])
11
+
12
+  useEffect(() => {
13
+    Init()
14
+  }, [])
15
+
16
+  const Init = () => {
17
+    request({ ...apis.getJiFenRule, params: { pageNum: 1, pageSize: 1000 } }).then((res) => {
18
+      setRuleList(res.records || [])
19
+    })
20
+  }
8 21
 
9 22
   return (
10 23
     <view className='JiFenGuiZe'>
11 24
       <CustomHeader IsFixed={true} BgColor='none' Title='积分规则'></CustomHeader>
12 25
 
13
-      <view className='centerLabel JiFenContent'>
26
+      <view className='JiFenContent'>
14 27
         <view>
15 28
           <view className='Img'>
16 29
             <image mode='widthFix' src={null}></image>
@@ -25,6 +38,27 @@ export default function JiFenGuiZe (props) {
25 38
           <text>1)积分仅兑换积分商城中的商品,不能折算现金;</text>
26 39
           <text>2)兑换商品中所要求的积分需达到要求方可兑换;</text>
27 40
           <text>3)兑换商品图片仅供参考,商品以实际领取为准。</text>
41
+          {
42
+            RuleList.length > 0 &&
43
+            <view className='RuleList'>
44
+              <view className='flex-h'>
45
+                <view className='flex-item'>
46
+                  <text>途径</text>
47
+                </view>
48
+                <view>分数</view>
49
+              </view>
50
+              {
51
+                RuleList.map((item, index) => (
52
+                  <view className='flex-h' key={`RuleList-${index}`}>
53
+                    <view className='flex-item'>
54
+                      <text>{item.remark}</text>
55
+                    </view>
56
+                    <view>{item.pointsAmount}</view>
57
+                  </view>
58
+                ))
59
+              }
60
+            </view>
61
+          }
28 62
         </view>
29 63
       </view>
30 64
     </view>

+ 29
- 0
src/pages/FuLi/JiFenGuiZe/index.less Datei anzeigen

@@ -57,6 +57,35 @@
57 57
         text-align: center;
58 58
         margin-top: 30px;
59 59
       }
60
+
61
+      >.RuleList {
62
+        position: relative;
63
+        overflow: hidden;
64
+
65
+        >view {
66
+          align-items: flex-start;
67
+
68
+          >.flex-item {
69
+            position: relative;
70
+            overflow: hidden;
71
+
72
+            >text {
73
+              font-size: 28px;
74
+              color: #fff;
75
+              line-height: 40px;
76
+              display: block;
77
+            }
78
+          }
79
+
80
+          >view:last-child {
81
+            font-size: 28px;
82
+            color: #fff;
83
+            line-height: 40px;
84
+            text-align: right;
85
+            width: 100px;
86
+          }
87
+        }
88
+      }
60 89
     }
61 90
   }
62 91
 }

+ 21
- 16
src/pages/FuLi/index.jsx Datei anzeigen

@@ -2,21 +2,23 @@ import React, { useState } from 'react'
2 2
 import Taro from '@tarojs/taro'
3 3
 import NavHeader from '@/components/NavHeader/index'
4 4
 import PrizeListItem from '@/components/PrizeListItem/index'
5
+import ScrollPageRefresh from '@/components/ScrollPageRefresh/index'
6
+import { useModel } from '@/store'
5 7
 import '@/assets/css/reset.less'
6 8
 import '@/assets/css/iconfont.less'
7 9
 import './index.less'
8 10
 
9
-export default function FuLi (props) {
11
+export default function FuLi () {
10 12
 
11
-  const [PirzeList, setPirzeList] = useState(['', '', '', '', '', '', '', '', ''])
12
-  const [IsPull, setIsPull] = useState(false)
13
-  const [TestImg, setTestImg] = useState('https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1606120989360&di=8610f1678b51e26de6d4c6af39d1cf63&imgtype=0&src=http%3A%2F%2Fattachments.gfan.com%2Fforum%2F201503%2F19%2F211608ztcq7higicydxhsy.jpg')
13
+  const { user } = useModel('user')
14
+  const [PageList, setPageList] = useState([])
14 15
 
15
-  const OnRefresh = () => {
16
-    setIsPull(true)
17
-    window.setTimeout(() => {
18
-      setIsPull(false)
19
-    }, 1000)
16
+  const Refresh = (e) => { // 下拉刷新
17
+    setPageList(e)
18
+  }
19
+
20
+  const Push = (e) => { // 上拉加载
21
+    setPageList(PageList.concat(e))
20 22
   }
21 23
 
22 24
   return (
@@ -31,7 +33,7 @@ export default function FuLi (props) {
31 33
       {/* 正文 */}
32 34
       <view className='flex-item'>
33 35
         <view>
34
-          <scroll-view scroll-y='true' style='height: 100%;' refresher-enabled={true} onrefresherrefresh={OnRefresh} refresher-triggered={IsPull} refresher-background='none'>
36
+          <ScrollPageRefresh ApiName={`getGoodsList`} Refresh={Refresh} Push={Push}>
35 37
             <view className='FuLiContent'>
36 38
 
37 39
               {/* 用户面板 */}
@@ -39,11 +41,14 @@ export default function FuLi (props) {
39 41
                 <view>
40 42
                   <view className='Info flex-h'>
41 43
                     <view className='Icon'>
42
-                      <image mode='aspectFill' src={TestImg} class='centerLabel'></image>
44
+                      {
45
+                        user !== null &&
46
+                        <image mode='aspectFill' src={user.avatarurl} class='centerLabel'></image>
47
+                      }
43 48
                     </view>
44 49
                     <view className='flex-item'>
45
-                      <text>三十而已</text>
46
-                      <text>积分10</text>
50
+                      <text>{user === null ? '未登录' : user.nickname || '未授权用户信息'}</text>
51
+                      <text>积分{user === null ? '-' : user.points || 0}</text>
47 52
                     </view>
48 53
                     <text className='active'>签到</text>
49 54
                   </view>
@@ -71,10 +76,10 @@ export default function FuLi (props) {
71 76
               {/* 积分礼品列表 */}
72 77
               <view className='PirzeList'>
73 78
                 {
74
-                  PirzeList.map((item, index) => (
79
+                  PageList.map((item, index) => (
75 80
                     <view key={`PirzeListItem-${index}`}>
76 81
                       <view>
77
-                        <PrizeListItem></PrizeListItem>
82
+                        <PrizeListItem Data={item}></PrizeListItem>
78 83
                       </view>
79 84
                     </view>
80 85
                   ))
@@ -82,7 +87,7 @@ export default function FuLi (props) {
82 87
               </view>
83 88
 
84 89
             </view>
85
-          </scroll-view>
90
+          </ScrollPageRefresh>
86 91
         </view>
87 92
       </view>
88 93
 

+ 2
- 2
src/pages/HuoDong/HuoDongDetail/index.jsx Datei anzeigen

@@ -1,6 +1,6 @@
1 1
 import React, { useState, useEffect } from 'react'
2 2
 import Taro, { Current } from '@tarojs/taro'
3
-import { RichText, Button } from '@tarojs/components'
3
+import { RichText } from '@tarojs/components'
4 4
 import request, { apis } from '@/utils/request'
5 5
 import { useModel } from '@/store'
6 6
 import GetUserPhone from '@/components/GetUserPhone/index'
@@ -9,7 +9,7 @@ import '@/assets/css/reset.less'
9 9
 import '@/assets/css/iconfont.less'
10 10
 import './index.less'
11 11
 
12
-export default function HuoDongDetail (props) {
12
+export default function HuoDongDetail () {
13 13
 
14 14
   const { user } = useModel('user')
15 15
   const [DataLock, setDataLock] = useState(false)

+ 26
- 42
src/pages/WuYe/BaoXiuQuYu/index.jsx Datei anzeigen

@@ -1,48 +1,32 @@
1
-import React, { Component } from 'react'
1
+import React, { useState } from 'react'
2 2
 import Taro from '@tarojs/taro'
3
-import '../../../assets/css/reset.less'
4
-import '../../../assets/css/iconfont.less'
3
+import '@/assets/css/reset.less'
4
+import '@/assets/css/iconfont.less'
5 5
 import './index.less'
6 6
 
7
-export default class WuYeBaoXiuQuYu extends Component {
8
-
9
-  state = {
10
-    TypeList: [
11
-      { icon: 'icongonggongquyu', name: '公共区域问题', desc: '如绿植被破坏、楼道灯不亮等问题', id: 1 },
12
-      { icon: 'iconfangwuzhiliang', name: '房屋质量问题', desc: '如家中墙体开裂、墙皮脱落等问题', id: 2 },
13
-      { icon: 'iconhuneisheshi', name: '户内设施问题', desc: '如通浴室下水道、保洁等可能需要收费的项目', id: 3 }
14
-    ]
15
-  }
16
-
17
-  componentWillMount () {
18
-  }
19
-
20
-  componentDidMount () { }
21
-
22
-  componentWillUnmount () { }
23
-
24
-  componentDidShow () { }
25
-
26
-  componentDidHide () { }
27
-
28
-  render () {
29
-    const { TypeList } = this.state
30
-    return (
31
-      <view className='WuYeBaoXiuQuYu'>
32
-        {
33
-          TypeList.map((item, index) => (
34
-            <view key={`WuYeBaoXiuQuYu-${index}`}>
35
-              <view onClick={() => { Taro.navigateTo({ url: `/pages/WuYe/TianJiaBaoXiu/index?type=${item.id}` }) }}>
36
-                <view>
37
-                  <text className={`iconfont ${item.icon}`}></text>
38
-                  <text>{item.name}</text>
39
-                </view>
40
-                <text>{item.desc}</text>
7
+export default function WuYeBaoXiuQuYu () {
8
+
9
+  const [TypeList] = useState([
10
+    { icon: 'icongonggongquyu', name: '公共区域问题', desc: '如绿植被破坏、楼道灯不亮等问题', id: 1 },
11
+    { icon: 'iconfangwuzhiliang', name: '房屋质量问题', desc: '如家中墙体开裂、墙皮脱落等问题', id: 2 },
12
+    { icon: 'iconhuneisheshi', name: '户内设施问题', desc: '如通浴室下水道、保洁等可能需要收费的项目', id: 3 }
13
+  ])
14
+
15
+  return (
16
+    <view className='WuYeBaoXiuQuYu'>
17
+      {
18
+        TypeList.map((item, index) => (
19
+          <view key={`WuYeBaoXiuQuYu-${index}`}>
20
+            <view onClick={() => { Taro.navigateTo({ url: `/pages/WuYe/TianJiaBaoXiu/index?type=${item.id}` }) }}>
21
+              <view>
22
+                <text className={`iconfont ${item.icon}`}></text>
23
+                <text>{item.name}</text>
41 24
               </view>
25
+              <text>{item.desc}</text>
42 26
             </view>
43
-          ))
44
-        }
45
-      </view>
46
-    )
47
-  }
27
+          </view>
28
+        ))
29
+      }
30
+    </view>
31
+  )
48 32
 }

+ 34
- 3
src/pages/WuYe/TianJiaBaoXiu/index.jsx Datei anzeigen

@@ -1,19 +1,50 @@
1 1
 import React, { useState } from 'react'
2 2
 import Taro, { Current } from '@tarojs/taro'
3 3
 import { Input, Textarea } from '@tarojs/components'
4
+import request, { apis } from '@/utils/request'
4 5
 import '@/assets/css/reset.less'
5 6
 import '@/assets/css/iconfont.less'
6 7
 import './index.less'
7 8
 
8 9
 export default function WuYeTianJiaBaoXiu () {
9 10
 
11
+  const [Title, setTitle] = useState('')
12
+  const [Desc, setDesc] = useState('')
13
+  const [DataLock, setDataLock] = useState(false)
10 14
   const CurrnetBaoXiuType = Current.router.params.type
11 15
 
16
+  const TitleChange = (e) => {
17
+    setTitle(e.detail.value)
18
+  }
19
+
20
+  const DescChange = (e) => {
21
+    setDesc(e.detail.value)
22
+  }
23
+
24
+  const Send = () => {
25
+    if (DataLock) return
26
+    setDataLock(true)
27
+    request({
28
+      ...apis.AddGongDan,
29
+      data: {
30
+        ticketTitle: Title,
31
+        ticketContent: Desc,
32
+        type: 2,
33
+        repairType: CurrnetBaoXiuType - 0
34
+      }
35
+    }).then(() => {
36
+      setDataLock(false)
37
+    }).catch((res) => {
38
+      Taro.showToast({ title: res, icon: 'none' })
39
+      setDataLock(false)
40
+    })
41
+  }
42
+
12 43
   return (
13 44
     <view className='WuYeTianJiaBaoXiu'>
14 45
       <view className='Form'>
15
-        <Input placeholder='简述你的想法'></Input>
16
-        <Textarea placeholder='描述问题详情,以便我们更好的相处'></Textarea>
46
+        <Input placeholder='简述你的想法' onInput={TitleChange} value={Title}></Input>
47
+        <Textarea placeholder='描述问题详情,以便我们更好的相处' onInput={DescChange} value={Desc}></Textarea>
17 48
       </view>
18 49
       <view className='Photo'>
19 50
         <view className='Add'>
@@ -27,7 +58,7 @@ export default function WuYeTianJiaBaoXiu () {
27 58
         </view>
28 59
       </view>
29 60
       <view className='Btn'>
30
-        <text>确认发送</text>
61
+        <text onClick={Send}>确认发送</text>
31 62
       </view>
32 63
     </view>
33 64
   )

+ 12
- 0
src/utils/api.js Datei anzeigen

@@ -9,6 +9,10 @@ const $api = {
9 9
     method: 'get',
10 10
     url: `${prefix}/tickets/list/:orgId`
11 11
   },
12
+  AddGongDan: { // 添加工单
13
+    method: 'post',
14
+    url: `${prefix}/addtpTicket`
15
+  },
12 16
   getGongGaoList: { // 获取小区公告列表
13 17
     method: 'get',
14 18
     url: `${prefix}/announcements/:orgId`
@@ -33,6 +37,14 @@ const $api = {
33 37
     method: 'post',
34 38
     url: `${prefix}/activityDynamicEnlistAdd`
35 39
   },
40
+  getJiFenRule: { // 获取积分规则
41
+    method: 'get',
42
+    url: `${prefix}/tdPointsRules`
43
+  },
44
+  getGoodsList: { // 获取商品列表
45
+    method: 'get',
46
+    url: `${prefix}/goods`
47
+  },
36 48
   getNewsList: { // 获取资讯列表
37 49
     method: 'get',
38 50
     url: `${prefix}/taNews`