xcx 4 лет назад
Родитель
Сommit
09cd2d2cd5

+ 42
- 0
src/components/PrizeChangeListItem/index.css Просмотреть файл

@@ -0,0 +1,42 @@
1
+.PrizeChangeListItem {
2
+  width: 100%;
3
+  position: relative;
4
+  overflow: hidden;
5
+  background: #fff;
6
+  border-radius: 12px;
7
+  padding: 30px 0;
8
+  align-items: center;
9
+}
10
+.PrizeChangeListItem > .Img {
11
+  width: 180px;
12
+  height: 180px;
13
+  position: relative;
14
+  overflow: hidden;
15
+  background: #eee;
16
+  margin-left: 30px;
17
+  margin-right: 30px;
18
+}
19
+.PrizeChangeListItem > .Img > image {
20
+  width: 100%;
21
+  height: 100%;
22
+}
23
+.PrizeChangeListItem > .flex-item {
24
+  margin-right: 30px;
25
+}
26
+.PrizeChangeListItem > .flex-item > text {
27
+  display: block;
28
+  font-size: 24px;
29
+  overflow: hidden;
30
+  line-height: 40px;
31
+  color: #999;
32
+}
33
+.PrizeChangeListItem > .flex-item > text:first-child {
34
+  font-size: 28px;
35
+  font-weight: bold;
36
+  overflow: hidden;
37
+  text-overflow: ellipsis;
38
+  display: -webkit-box;
39
+  -webkit-box-orient: vertical;
40
+  -webkit-line-clamp: 2;
41
+  color: #333;
42
+}

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

@@ -0,0 +1,24 @@
1
+import React, { } from 'react'
2
+import Taro from '@tarojs/taro'
3
+import toolclass from '@/utils/toolclass.js'
4
+import '@/assets/css/reset.less'
5
+import '@/assets/css/iconfont.less'
6
+import './index.less'
7
+
8
+export default function PrizeChangeListItem (props) {
9
+
10
+  const { Data } = props
11
+
12
+  return (
13
+    <view className='PrizeChangeListItem flex-h'>
14
+      <view className='Img'>
15
+        <image mode='aspectFill' src={Data.image}></image>
16
+      </view>
17
+      <view className='flex-item'>
18
+        <text>{Data.targetName}</text>
19
+        <text>{Data.points}积分</text>
20
+        <text>兑换时间:{toolclass.FormatDate(Data.createDate)}</text>
21
+      </view>
22
+    </view>
23
+  )
24
+}

+ 47
- 0
src/components/PrizeChangeListItem/index.less Просмотреть файл

@@ -0,0 +1,47 @@
1
+.PrizeChangeListItem {
2
+  width: 100%;
3
+  position: relative;
4
+  overflow: hidden;
5
+  background: #fff;
6
+  border-radius: 12px;
7
+  padding: 30px 0;
8
+  align-items: center;
9
+
10
+  >.Img {
11
+    width: 180px;
12
+    height: 180px;
13
+    position: relative;
14
+    overflow: hidden;
15
+    background: #eee;
16
+    margin-left: 30px;
17
+    margin-right: 30px;
18
+
19
+    >image {
20
+      width: 100%;
21
+      height: 100%;
22
+    }
23
+  }
24
+
25
+  >.flex-item {
26
+    margin-right: 30px;
27
+
28
+    >text {
29
+      display: block;
30
+      font-size: 24px;
31
+      overflow: hidden;
32
+      line-height: 40px;
33
+      color: #999;
34
+
35
+      &:first-child {
36
+        font-size: 28px;
37
+        font-weight: bold;
38
+        overflow: hidden;
39
+        text-overflow: ellipsis;
40
+        display: -webkit-box;
41
+        -webkit-box-orient: vertical;
42
+        -webkit-line-clamp: 2;
43
+        color: #333;
44
+      }
45
+    }
46
+  }
47
+}

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

@@ -1,5 +1,5 @@
1 1
 import React, { useState } from 'react'
2
-import ActivityListItem from '@/components/ActivityListItem'
2
+import PrizeChangeListItem from '@/components/PrizeChangeListItem'
3 3
 import ScrollPageRefresh from '@/components/ScrollPageRefresh'
4 4
 import Page from '@/layouts'
5 5
 import '@/assets/css/reset.less'
@@ -28,12 +28,12 @@ export default function WoDeDingDan () {
28 28
   return (
29 29
     <Page>
30 30
       <view className='WoDeDingDan'>
31
-        <ScrollPageRefresh IsEmpty={IsEmpty} ApiName={`getActivityList`} RequestParams={{ mine: 1 }} Refresh={Refresh} Push={Push}>
32
-          <view className='Content Activity'>
31
+        <ScrollPageRefresh IsEmpty={IsEmpty} ApiName={`getUserChangePrizeList`} Refresh={Refresh} Push={Push}>
32
+          <view className='Content'>
33 33
             {
34 34
               PageList.map((item, index) => (
35
-                <view className='ListItem' key={`ActivityItem-${index}`}>
36
-                  <ActivityListItem Data={item}></ActivityListItem>
35
+                <view className='ListItem' key={`PrizeItem-${index}`}>
36
+                  <PrizeChangeListItem Data={item}></PrizeChangeListItem>
37 37
                 </view>
38 38
               ))
39 39
             }

+ 4
- 0
src/utils/api.js Просмотреть файл

@@ -1,6 +1,10 @@
1 1
 const prefix = `${HOST}/api/wx`
2 2
 
3 3
 const $api = {
4
+  getUserChangePrizeList: { // 兑换商品记录
5
+    method: 'get',
6
+    url: `${prefix}/taPointsExchange`
7
+  },
4 8
   PostOwnerScore: { // 用户给生活管家评分
5 9
     method: 'post',
6 10
     url: `${prefix}/tpLifeConsultantEvaluate`