李志伟 3 vuotta sitten
vanhempi
commit
3830ca6c54

+ 1
- 3
src/components/CompoentsOrder/OrderCard/index.jsx Näytä tiedosto

@@ -2,8 +2,6 @@ import Taro from "@tarojs/taro";
2 2
 import { View, Text } from '@tarojs/components'
3 3
 import formatTime from "@/utils/formatTime";
4 4
 import SlideViewOrder from '@/components/SlideViewOrder';
5
-import { getOrderSub, deleteOrder } from "@/services/payOrder";
6
-
7 5
 import CouponCard from '@/components/CouponCard'
8 6
 import QRcode from "@/assets/icons/UserCenter/QRcode.png";
9 7
 import refund from "@/assets/icons/GuideCheck/refund.png";
@@ -92,7 +90,7 @@ export default (props) => {
92 90
               <View className='orderCard'>
93 91
                 <View className='cpn-card-text'>
94 92
                   <View style={{ flex: '1' }}>{(item.packageDescription).toString().length > 25 ? (item.packageDescription).substring(0, 25) + '...' : (item.packageDescription)}</View>
95
-                  <text className={kkp == '1' ? 'shanchu' : 'title-money-2'}>
93
+                  <text className='title-money-2'>
96 94
                     数量:{item.amount}张
97 95
                   </text>
98 96
                 </View>

+ 0
- 5
src/components/CompoentsOrder/OrderCard/style.less Näytä tiedosto

@@ -9,11 +9,6 @@
9 9
     .title-money-2 {
10 10
       font-size: 20px;
11 11
       color: #333333;
12
-      text-decoration: line-through;
13
-    }
14
-    .shanchu{
15
-      font-size: 20px;
16
-      color: #333333;
17 12
     }
18 13
     & > text {
19 14
       display: inline-block;

+ 46
- 0
src/pages/TobeShop/Card/index.jsx Näytä tiedosto

@@ -0,0 +1,46 @@
1
+import Taro from "@tarojs/taro";
2
+import { View, Text } from '@tarojs/components'
3
+import formatTime from "@/utils/formatTime";
4
+import CouponCard from '@/components/CouponCard'
5
+import Check_OK from "@/assets/icons/UserCenter/Check_OK.png";
6
+import Check_NO from "@/assets/icons/UserCenter/Check_NO.png";
7
+import './style.less'
8
+
9
+const CouponMedia = CouponCard.Media
10
+const Action = CouponCard.Action
11
+export default (props) => {
12
+  const { item, checked, handleCheck } = props
13
+
14
+  const PayAction = <Action.Icon icon={checked?.indexOf(item.verifyNo) > -1 ? Check_OK : Check_NO} onClick={handleCheck} />
15
+  return (
16
+    <CouponCard action={PayAction} onClick={() => handleCheck(item.verifyNo)}>
17
+      <CouponMedia>
18
+        <CouponMedia.Header
19
+          cashback={item.cashback}
20
+          image={item.poster}
21
+          badge='food'
22
+        />
23
+        <CouponMedia.Body star='ss'>
24
+          <View className='orderCard'>
25
+            <View className='cpn-card-text'>
26
+              <View style={{ flex: '1' }}>{(item.description).toString().length > 25 ? (item.description).substring(0, 25) + '...' : (item.description)}</View>
27
+              <text className={'title-money-2'}>
28
+                数量:1张
29
+              </text>
30
+            </View>
31
+            <View className='cpn-card-text' style={{ marginTop: '10rpx' }}>
32
+              <Text className='cpn-card-text_mn'>¥{`${(item.actualPrice / 100)?.toFixed(2)}元`}</Text>
33
+            </View>
34
+            <View className='cpn-md-act'>
35
+              {
36
+                '有效期:' + formatTime(item?.createDate, "yyyy/MM/dd") + '-' +
37
+                formatTime(item.expireDate, "yyyy/MM/dd")
38
+              }
39
+            </View>
40
+          </View>
41
+        </CouponMedia.Body>
42
+      </CouponMedia>
43
+    </CouponCard>
44
+
45
+  )
46
+}

+ 46
- 0
src/pages/TobeShop/Card/style.less Näytä tiedosto

@@ -0,0 +1,46 @@
1
+.orderCard{
2
+  .cpn-card-text {
3
+    font-size: 24px;
4
+    font-weight: 400;
5
+    color: #333333;
6
+    line-height: 40px;
7
+    vertical-align: baseline;
8
+    display: flex;
9
+    .title-money-2 {
10
+      font-size: 20px;
11
+      color: #333333;
12
+    }
13
+    & > text {
14
+      display: inline-block;
15
+
16
+      & + text {
17
+        margin-left: 8px;
18
+      }
19
+    }
20
+    &_mn {
21
+      font-size: 24px;
22
+      font-weight: bold;
23
+      color: #333333;
24
+    }
25
+
26
+    &_rm {
27
+      font-size: 18px;
28
+      font-weight: 400;
29
+      text-decoration: line-through;
30
+      color: #666666;
31
+    }
32
+  }
33
+  .cpn-md-act {
34
+    display: flex;
35
+    margin-top: 10px;
36
+    position: relative;
37
+    font-size: 22px;
38
+    color: #c0c8d3;
39
+  }
40
+}
41
+
42
+.OrderNumber {
43
+  font-size: 20px;
44
+  color: #666666;
45
+  padding: 20px 0;
46
+}

+ 93
- 57
src/pages/TobeShop/index.jsx Näytä tiedosto

@@ -17,6 +17,7 @@ import Check_NO from "@/assets/icons/UserCenter/Check_NO.png";
17 17
 import BlackSpot from "@/assets/icons/GuideCheck/BlackSpot.png";
18 18
 import food from "@/assets/icons/ProCard/food.png";
19 19
 import ProCard_hot from "@/assets/icons/ProCard/ProCard_hot.png";
20
+import TBCard from './Card'
20 21
 
21 22
 import "./style.less";
22 23
 
@@ -110,23 +111,23 @@ export default withLayout((props) => {
110 111
 
111 112
       setSubmiting(true);
112 113
       Promise.all(checked.map(verifyNo => putVerifyTarget(verifyNo)))
113
-      .then(res => {
114
-        Taro.hideLoading()
115
-        setSubmiting(false);
116
-        setShowDialog(false);
117
-        setConsumption(true);
118
-      })
119
-      .catch(e => {
120
-        Taro.hideLoading()
121
-        setShowDialog(false);
122
-        setSubmiting(false);
123
-        getList();  // 刷新数据
124
-        Taro.showToast({
125
-          title: '核销失败',
126
-          icon: 'none',
127
-          duration: 2000
114
+        .then(res => {
115
+          Taro.hideLoading()
116
+          setSubmiting(false);
117
+          setShowDialog(false);
118
+          setConsumption(true);
119
+        })
120
+        .catch(e => {
121
+          Taro.hideLoading()
122
+          setShowDialog(false);
123
+          setSubmiting(false);
124
+          getList();  // 刷新数据
125
+          Taro.showToast({
126
+            title: '核销失败',
127
+            icon: 'none',
128
+            duration: 2000
129
+          })
128 130
         })
129
-      })
130 131
     }
131 132
   };
132 133
 
@@ -139,10 +140,9 @@ export default withLayout((props) => {
139 140
     }
140 141
   };
141 142
 
142
-  const btnText = ['确认核销', checked && checked.length > 0  ? `(${checked.length})` : undefined].filter(Boolean).join(' ')
143
-
143
+  const btnText = ['确认核销', checked && checked.length > 0 ? `(${checked.length})` : undefined].filter(Boolean).join(' ')
144 144
   return (
145
-    <view className='shop-Eat'>      
145
+    <view className='shop-Eat'>
146 146
       <view className='index-navbar'>
147 147
         <CustomNav title='到店核销' />
148 148
       </view>
@@ -190,44 +190,80 @@ export default withLayout((props) => {
190 190
         <SpinBox loading={loading}>
191 191
           {(list || []).map((item) => {
192 192
             return (
193
-              <view class='wrapper' key={item.verifyNo} onClick={() => handleCheck(item.verifyNo)}>
194
-                <view class='left-complete-one'>
195
-                  <image className='left-image-1' src={ProCard_hot}></image>
196
-                  <view className='left-viewText'>返现¥{(item.cashback / 100).toFixed(2)}</view>
197
-                  <view className='title-image'>
198
-                    <image
199
-                      className='image-1'
200
-                      mode='scaleToFill'
201
-                      src={item.poster}
202
-                    ></image>
203
-                    <image className='image-2' src={food}></image>
204
-                  </view>
205
-                  <view className='title-content'>
206
-                    <View className='cpn-card-text'>
207
-                      <View style={{ flex: '1' }}>{(item.description).toString().length > 25 ? (item.description).substring(0, 25) + '...' : (item.description)}</View>
208
-                      <text className='title-money-2'>
209
-                        数量:1张
210
-                      </text>
211
-                    </View>
212
-                    <text className='title-money'>
213
-                      ¥{formatPrice(item.actualPrice)}元<text className='title-money-2'>门市价{formatPrice(item.standPrice)}元</text>
214
-                    </text>
215
-                    <view className='title-time'>
216
-                      有效期:{formatTime(item?.createDate, "yyyy/MM/dd")}-
217
-                      {formatTime(item?.expireDate, "yyyy/MM/dd")}
218
-                    </view>
219
-                  </view>
220
-                </view>
221
-
222
-                <view class='right-complete-two'>
223
-                  <view className='right-content'>
224
-                    <view className='Check_OK-box'>
225
-                      <image className='Check_OK-image' src={checked.indexOf(item.verifyNo) > -1 ? Check_OK : Check_NO} />
226
-                    </view>
227
-                  </view>
228
-                </view>
229
-              </view>
230
-            );
193
+              <TBCard item={item} key={item.verifyNo} checked={checked} handleCheck={handleCheck} />
194
+              // <CouponCard action={PayAction} onClick={() => handleCheck(item.verifyNo)}>
195
+              //   <CouponMedia>
196
+              //     <CouponMedia.Header
197
+              //       cashback={item.cashback}
198
+              //       image={item.poster}
199
+              //       badge='food'
200
+              //     />
201
+              //     <CouponMedia.Body star={null}>
202
+              //       <View className='orderCard'>
203
+              //         <View className='cpn-card-text'>
204
+              //           <View style={{ flex: '1' }}>{(item.description).toString().length > 25 ? (item.description).substring(0, 25) + '...' : (item.description)}</View>
205
+              //           <text className={ 'title-money-2'}>
206
+              //             数量:{item.amount}张
207
+              //           </text>
208
+              //         </View>
209
+              //         <View className='cpn-card-text' style={{ marginTop: '10rpx' }}>
210
+              //           <Text className='cpn-card-text_mn'>¥{`${(item.actualPrice / 100)?.toFixed(2)}元`}</Text>
211
+              //         </View>
212
+              //         <View className='cpn-md-act'>
213
+              //           <view className='title-time'>
214
+              //             {
215
+              //               '有效期:' + formatTime(item?.createDate, "yyyy/MM/dd") + '-' +
216
+              //               formatTime(item.expireDate, "yyyy/MM/dd")
217
+              //             }
218
+              //           </view>
219
+              //         </View>
220
+              //       </View>
221
+              //     </CouponMedia.Body>
222
+              //   </CouponMedia>
223
+              // </CouponCard>
224
+
225
+
226
+
227
+
228
+            )
229
+            // <view class='wrapper' key={item.verifyNo} onClick={() => handleCheck(item.verifyNo)}>
230
+            //   <view class='left-complete-one'>
231
+            //     <image className='left-image-1' src={ProCard_hot}></image>
232
+            //     <view className='left-viewText'>返现¥{(item.cashback / 100).toFixed(2)}</view>
233
+            //     <view className='title-image'>
234
+            //       <image
235
+            //         className='image-1'
236
+            //         mode='scaleToFill'
237
+            //         src={item.poster}
238
+            //       ></image>
239
+            //       <image className='image-2' src={food}></image>
240
+            //     </view>
241
+            //     <view className='title-content'>
242
+            //       <View className='cpn-card-text'>
243
+            //         <View style={{ flex: '1' }}>{(item.description).toString().length > 25 ? (item.description).substring(0, 25) + '...' : (item.description)}</View>
244
+            //         <text className='title-money-2'>
245
+            //           数量:1张
246
+            //         </text>
247
+            //       </View>
248
+            //       <text className='title-money'>
249
+            //         ¥{formatPrice(item.actualPrice)}元<text className='title-money-2'>门市价{formatPrice(item.standPrice)}元</text>
250
+            //       </text>
251
+            //       <view className='title-time'>
252
+            //         有效期:{formatTime(item?.createDate, "yyyy/MM/dd")}-
253
+            //         {formatTime(item?.expireDate, "yyyy/MM/dd")}
254
+            //       </view>
255
+            //     </view>
256
+            //   </view>
257
+
258
+            //   <view class='right-complete-two'>
259
+            //     <view className='right-content'>
260
+            //       <view className='Check_OK-box'>
261
+            //         <image className='Check_OK-image' src={checked.indexOf(item.verifyNo) > -1 ? Check_OK : Check_NO} />
262
+            //       </view>
263
+            //     </view>
264
+            //   </view>
265
+            // </view>
266
+
231 267
           })}
232 268
         </SpinBox>
233 269