吃个甘蔗嚼一年 3 年之前
父節點
當前提交
a1035ed2a9
共有 3 個文件被更改,包括 64 次插入56 次删除
  1. 7
    6
      src/components/List/index.jsx
  2. 0
    1
      src/pages/MineUserAll/RefundMoney/CheckRefund/index.jsx
  3. 57
    49
      src/pages/PayOrder/index.jsx

+ 7
- 6
src/components/List/index.jsx 查看文件

1
-import React, {  useEffect, useRef, useState, useImperativeHandle } from 'react';
1
+import React, { useEffect, useRef, useState, useImperativeHandle } from 'react';
2
 import { ScrollView } from '@tarojs/components';
2
 import { ScrollView } from '@tarojs/components';
3
 import Taro from '@tarojs/taro';
3
 import Taro from '@tarojs/taro';
4
 
4
 
6
   const {
6
   const {
7
     render,
7
     render,
8
     request,
8
     request,
9
-    params={},
9
+    params = {},
10
     pageSize = 10,
10
     pageSize = 10,
11
     onError,
11
     onError,
12
     onDataChange,
12
     onDataChange,
79
 
79
 
80
   useEffect(() => {
80
   useEffect(() => {
81
     Taro.nextTick(() => {
81
     Taro.nextTick(() => {
82
-      Taro.createSelectorQuery().select('.list-view').node(function(res){
82
+      Taro.createSelectorQuery().select('.list-view').node(function (res) {
83
         contextRef.current = res.node
83
         contextRef.current = res.node
84
       }).exec()
84
       }).exec()
85
     })
85
     })
87
 
87
 
88
   // https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/ScrollViewContext.html
88
   // https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/ScrollViewContext.html
89
   // ScrollViewContext 透传给父组件
89
   // ScrollViewContext 透传给父组件
90
+  //https://zh-hans.reactjs.org/docs/hooks-reference.html#useimperativehandle
90
   useImperativeHandle(ref, () => ({
91
   useImperativeHandle(ref, () => ({
91
     context: contextRef.current,
92
     context: contextRef.current,
92
   }))
93
   }))
103
         ? props.children
104
         ? props.children
104
         : list.map((item, index) => render({ item, index }))
105
         : list.map((item, index) => render({ item, index }))
105
       }
106
       }
106
-      { !list || !list.length && noData }
107
+      {!list || !list.length && noData}
108
+
109
+      {list && list.length > 0 && !hasMore && <view className='botton'>已经到底了~</view>}
107
 
110
 
108
-      { list && list.length > 0 && !hasMore && <view className='botton'>已经到底了~</view> }
109
-      
110
     </ScrollView>
111
     </ScrollView>
111
   )
112
   )
112
 })
113
 })

+ 0
- 1
src/pages/MineUserAll/RefundMoney/CheckRefund/index.jsx 查看文件

92
       Taro.navigateBack({ delta: 1 })
92
       Taro.navigateBack({ delta: 1 })
93
     });
93
     });
94
   };
94
   };
95
-
96
   useEffect(() => {
95
   useEffect(() => {
97
     let total = {
96
     let total = {
98
       cashback: 0, //已获返现
97
       cashback: 0, //已获返现

+ 57
- 49
src/pages/PayOrder/index.jsx 查看文件

1
 import withLayout from "@/layouts";
1
 import withLayout from "@/layouts";
2
 import image from "@/assets/icons/ProCard/8kb.jpg";
2
 import image from "@/assets/icons/ProCard/8kb.jpg";
3
 import { useState, useEffect } from "react";
3
 import { useState, useEffect } from "react";
4
-import { Button, Checkbox, Input } from "@tarojs/components";
4
+import { Button, Checkbox, Input, RadioGroup, Radio } from "@tarojs/components";
5
 import AuthPage from '@/components/AuthPage'
5
 import AuthPage from '@/components/AuthPage'
6
 import food from "@/assets/icons/ProCard/food.png";
6
 import food from "@/assets/icons/ProCard/food.png";
7
 import ProCard_hot from "@/assets/icons/ProCard/ProCard_hot.png";
7
 import ProCard_hot from "@/assets/icons/ProCard/ProCard_hot.png";
158
     }
158
     }
159
   }, [packageId, orderId]);
159
   }, [packageId, orderId]);
160
 
160
 
161
+  //用户协议
162
+  const goRules = () => {
163
+    Taro.navigateTo({ url: `/pages/MineUserAll/Rules/index` })
164
+
165
+  }
166
+
161
   useEffect(() => {
167
   useEffect(() => {
162
     if (BuyNumber < 2) {
168
     if (BuyNumber < 2) {
163
       setDisabledBool(true);
169
       setDisabledBool(true);
181
   }, [list]);
187
   }, [list]);
182
 
188
 
183
   return (
189
   return (
184
-    !person.phone ? <AuthPage /> : <view class="container">
185
-      <CustomNav title="订单" />
190
+    !person.phone ? <AuthPage /> : <view class='container'>
191
+      <CustomNav title='订单' />
186
       <Popup show={showDialog} maskClosable={false}>
192
       <Popup show={showDialog} maskClosable={false}>
187
         <OrderMolded item={detail} />
193
         <OrderMolded item={detail} />
188
-        <view className="item-center-Number">
194
+        <view className='item-center-Number'>
189
           <view
195
           <view
190
-            className="buy-num-minus"
196
+            className='buy-num-minus'
191
             disabled={DisabledBool}
197
             disabled={DisabledBool}
192
             onClick={NumberCut}
198
             onClick={NumberCut}
193
           >
199
           >
194
             -
200
             -
195
           </view>
201
           </view>
196
           <Input
202
           <Input
197
-            className="buy-num-input"
198
-            type="number"
199
-            min="1"
203
+            className='buy-num-input'
204
+            type='number'
205
+            min='1'
200
             onInput={onInput}
206
             onInput={onInput}
201
             value={BuyNumber}
207
             value={BuyNumber}
202
           />
208
           />
203
-          <view className="buy-num-add" onClick={NumberAdd}>
209
+          <view className='buy-num-add' onClick={NumberAdd}>
204
             +
210
             +
205
           </view>
211
           </view>
206
         </view>
212
         </view>
207
-        <view className="buy-button-box">
208
-          <button className="button-Cancel" onClick={ButtonCancel}>
213
+        <view className='buy-button-box'>
214
+          <button className='button-Cancel' onClick={ButtonCancel}>
209
             取消
215
             取消
210
           </button>
216
           </button>
211
-          <button className="button-OK" onClick={ButtonOK}>
217
+          <button className='button-OK' onClick={ButtonOK}>
212
             确定
218
             确定
213
           </button>
219
           </button>
214
         </view>
220
         </view>
215
       </Popup>
221
       </Popup>
216
-      <view class="coupon-list">
222
+      <view class='coupon-list'>
217
         {(list || []).map((item) => {
223
         {(list || []).map((item) => {
218
           return (
224
           return (
219
-            <view class="wrapper" key={item.orderId}>
220
-              <view class="left-complete-one">
221
-                <image className="left-image-1" src={ProCard_hot}></image>
222
-                <view className="left-viewText">
225
+            <view class='wrapper' key={item.orderId}>
226
+              <view class='left-complete-one'>
227
+                <image className='left-image-1' src={ProCard_hot}></image>
228
+                <view className='left-viewText'>
223
                   返现¥{formatPrice(item.cashback)}
229
                   返现¥{formatPrice(item.cashback)}
224
                 </view>
230
                 </view>
225
-                <view className="title-image">
231
+                <view className='title-image'>
226
                   <image
232
                   <image
227
-                    className="image-1"
228
-                    mode="scaleToFill"
233
+                    className='image-1'
234
+                    mode='scaleToFill'
229
                     src={item.poster}
235
                     src={item.poster}
230
                   ></image>
236
                   ></image>
231
-                  <image className="image-2" src={food}></image>
237
+                  <image className='image-2' src={food}></image>
232
                 </view>
238
                 </view>
233
-                <view className="title-content">
234
-                  <view className="Pro-title">
235
-                    <view className="title-text">{item.description}</view>
239
+                <view className='title-content'>
240
+                  <view className='Pro-title'>
241
+                    <view className='title-text'>{item.description}</view>
236
                   </view>
242
                   </view>
237
-                  <text className="title-money">
243
+                  <text className='title-money'>
238
                     ¥{formatPrice(item.actualPrice || item.unitPrice)}元
244
                     ¥{formatPrice(item.actualPrice || item.unitPrice)}元
239
-                    <text className="title-money-2">
245
+                    <text className='title-money-2'>
240
                       门市价{formatPrice(item.standardPrice)}元
246
                       门市价{formatPrice(item.standardPrice)}元
241
                     </text>
247
                     </text>
242
                   </text>
248
                   </text>
243
-                  <view className="title-time">
249
+                  <view className='title-time'>
244
                     有效期:{formatTime(item.startTime, "yyyy/MM/dd")}-
250
                     有效期:{formatTime(item.startTime, "yyyy/MM/dd")}-
245
                     {formatTime(item.endTime, "yyyy/MM/dd")}
251
                     {formatTime(item.endTime, "yyyy/MM/dd")}
246
                   </view>
252
                   </view>
247
                 </view>
253
                 </view>
248
               </view>
254
               </view>
249
               <view
255
               <view
250
-                class="right-complete-two"
256
+                class='right-complete-two'
251
                 onClick={() => ShowMoldeOn(item)}
257
                 onClick={() => ShowMoldeOn(item)}
252
               >
258
               >
253
-                <view className="right-content">
254
-                  <view className="right-number">×{item.amount || 1}</view>
255
-                  <view className="right-title">数量</view>
259
+                <view className='right-content'>
260
+                  <view className='right-number'>×{item.amount || 1}</view>
261
+                  <view className='right-title'>数量</view>
256
                 </view>
262
                 </view>
257
               </view>
263
               </view>
258
             </view>
264
             </view>
259
           );
265
           );
260
         })}
266
         })}
261
       </view>
267
       </view>
262
-      <view className="view-button">
263
-        <view className="Card-number-box">
264
-          <view className="Card-number">
265
-            <text style="left:29px;position: absolute; padding-top:20px">
268
+      <view className='view-button'>
269
+        <view className='Card-number-box'>
270
+          <view className='Card-number'>
271
+            <text style='left:29px;position: absolute; padding-top:20px'>
266
               手机号码:
272
               手机号码:
267
             </text>
273
             </text>
268
-            <text style="right:29px;position: absolute;padding-top:20px">
274
+            <text style='right:29px;position: absolute;padding-top:20px'>
269
               {person.phone}
275
               {person.phone}
270
             </text>
276
             </text>
271
           </view>
277
           </view>
272
-          <view className="Card-user">
273
-            <Checkbox
274
-              style="padding-left:20px; position: relative; top:24px;"
275
-              value="agreement"
278
+          <view className='Card-user'>
279
+            <Radio
280
+              style='padding-left:20px; position: relative; top:24px;color:#666666;font-size:14px;'
281
+              value='agreement'
276
               checked={agreement}
282
               checked={agreement}
277
               onClick={() => {
283
               onClick={() => {
278
                 setAgreement(!agreement);
284
                 setAgreement(!agreement);
279
               }}
285
               }}
280
             >
286
             >
281
               我已阅读知晓并同意
287
               我已阅读知晓并同意
282
-              <text style="color:#274190;text-decoration:underline;font-weight:400">
288
+              <text style='color:#274190;text-decoration:underline;font-weight:400;display: inline-block;' onClick={goRules}>
283
                 《平台用户服务协议》
289
                 《平台用户服务协议》
284
               </text>
290
               </text>
285
-            </Checkbox>
291
+            </Radio>
292
+
293
+
286
           </view>
294
           </view>
287
         </view>
295
         </view>
288
-        <view className="button-box-button-box">
289
-          <view className="button-text-image">
290
-            <text className="button-text-money-hot">
296
+        <view className='button-box-button-box'>
297
+          <view className='button-text-image'>
298
+            <text className='button-text-money-hot'>
291
               返现¥{formatPrice(totalPrice?.cashback || 0)}
299
               返现¥{formatPrice(totalPrice?.cashback || 0)}
292
             </text>
300
             </text>
293
-            <image className="button-image" src={ProCard_hot}>
301
+            <image className='button-image' src={ProCard_hot}>
294
               123123
302
               123123
295
             </image>
303
             </image>
296
-            <view className="button-text-money">
304
+            <view className='button-text-money'>
297
               门店市面价:{formatPrice(totalPrice?.standardPrice || 0)}元
305
               门店市面价:{formatPrice(totalPrice?.standardPrice || 0)}元
298
             </view>
306
             </view>
299
           </view>
307
           </view>
300
-          <Button className="button-box-one" onClick={() => onShowPay()}>
308
+          <Button className='button-box-one' onClick={() => onShowPay()}>
301
             ¥{formatPrice(totalPrice?.actualPrice || 0)}元
309
             ¥{formatPrice(totalPrice?.actualPrice || 0)}元
302
-            <text className="button-text-one">支付订单</text>
310
+            <text className='button-text-one'>支付订单</text>
303
           </Button>
311
           </Button>
304
         </view>
312
         </view>
305
       </view>
313
       </view>