吃个甘蔗嚼一年 3 лет назад
Родитель
Сommit
a1035ed2a9

+ 7
- 6
src/components/List/index.jsx Просмотреть файл

@@ -1,4 +1,4 @@
1
-import React, {  useEffect, useRef, useState, useImperativeHandle } from 'react';
1
+import React, { useEffect, useRef, useState, useImperativeHandle } from 'react';
2 2
 import { ScrollView } from '@tarojs/components';
3 3
 import Taro from '@tarojs/taro';
4 4
 
@@ -6,7 +6,7 @@ export default React.forwardRef((props, ref) => {
6 6
   const {
7 7
     render,
8 8
     request,
9
-    params={},
9
+    params = {},
10 10
     pageSize = 10,
11 11
     onError,
12 12
     onDataChange,
@@ -79,7 +79,7 @@ export default React.forwardRef((props, ref) => {
79 79
 
80 80
   useEffect(() => {
81 81
     Taro.nextTick(() => {
82
-      Taro.createSelectorQuery().select('.list-view').node(function(res){
82
+      Taro.createSelectorQuery().select('.list-view').node(function (res) {
83 83
         contextRef.current = res.node
84 84
       }).exec()
85 85
     })
@@ -87,6 +87,7 @@ export default React.forwardRef((props, ref) => {
87 87
 
88 88
   // https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/ScrollViewContext.html
89 89
   // ScrollViewContext 透传给父组件
90
+  //https://zh-hans.reactjs.org/docs/hooks-reference.html#useimperativehandle
90 91
   useImperativeHandle(ref, () => ({
91 92
     context: contextRef.current,
92 93
   }))
@@ -103,10 +104,10 @@ export default React.forwardRef((props, ref) => {
103 104
         ? props.children
104 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 111
     </ScrollView>
111 112
   )
112 113
 })

+ 0
- 1
src/pages/MineUserAll/RefundMoney/CheckRefund/index.jsx Просмотреть файл

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

+ 57
- 49
src/pages/PayOrder/index.jsx Просмотреть файл

@@ -1,7 +1,7 @@
1 1
 import withLayout from "@/layouts";
2 2
 import image from "@/assets/icons/ProCard/8kb.jpg";
3 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 5
 import AuthPage from '@/components/AuthPage'
6 6
 import food from "@/assets/icons/ProCard/food.png";
7 7
 import ProCard_hot from "@/assets/icons/ProCard/ProCard_hot.png";
@@ -158,6 +158,12 @@ export default withLayout((props) => {
158 158
     }
159 159
   }, [packageId, orderId]);
160 160
 
161
+  //用户协议
162
+  const goRules = () => {
163
+    Taro.navigateTo({ url: `/pages/MineUserAll/Rules/index` })
164
+
165
+  }
166
+
161 167
   useEffect(() => {
162 168
     if (BuyNumber < 2) {
163 169
       setDisabledBool(true);
@@ -181,125 +187,127 @@ export default withLayout((props) => {
181 187
   }, [list]);
182 188
 
183 189
   return (
184
-    !person.phone ? <AuthPage /> : <view class="container">
185
-      <CustomNav title="订单" />
190
+    !person.phone ? <AuthPage /> : <view class='container'>
191
+      <CustomNav title='订单' />
186 192
       <Popup show={showDialog} maskClosable={false}>
187 193
         <OrderMolded item={detail} />
188
-        <view className="item-center-Number">
194
+        <view className='item-center-Number'>
189 195
           <view
190
-            className="buy-num-minus"
196
+            className='buy-num-minus'
191 197
             disabled={DisabledBool}
192 198
             onClick={NumberCut}
193 199
           >
194 200
             -
195 201
           </view>
196 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 206
             onInput={onInput}
201 207
             value={BuyNumber}
202 208
           />
203
-          <view className="buy-num-add" onClick={NumberAdd}>
209
+          <view className='buy-num-add' onClick={NumberAdd}>
204 210
             +
205 211
           </view>
206 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 216
           </button>
211
-          <button className="button-OK" onClick={ButtonOK}>
217
+          <button className='button-OK' onClick={ButtonOK}>
212 218
             确定
213 219
           </button>
214 220
         </view>
215 221
       </Popup>
216
-      <view class="coupon-list">
222
+      <view class='coupon-list'>
217 223
         {(list || []).map((item) => {
218 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 229
                   返现¥{formatPrice(item.cashback)}
224 230
                 </view>
225
-                <view className="title-image">
231
+                <view className='title-image'>
226 232
                   <image
227
-                    className="image-1"
228
-                    mode="scaleToFill"
233
+                    className='image-1'
234
+                    mode='scaleToFill'
229 235
                     src={item.poster}
230 236
                   ></image>
231
-                  <image className="image-2" src={food}></image>
237
+                  <image className='image-2' src={food}></image>
232 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 242
                   </view>
237
-                  <text className="title-money">
243
+                  <text className='title-money'>
238 244
                     ¥{formatPrice(item.actualPrice || item.unitPrice)}元
239
-                    <text className="title-money-2">
245
+                    <text className='title-money-2'>
240 246
                       门市价{formatPrice(item.standardPrice)}元
241 247
                     </text>
242 248
                   </text>
243
-                  <view className="title-time">
249
+                  <view className='title-time'>
244 250
                     有效期:{formatTime(item.startTime, "yyyy/MM/dd")}-
245 251
                     {formatTime(item.endTime, "yyyy/MM/dd")}
246 252
                   </view>
247 253
                 </view>
248 254
               </view>
249 255
               <view
250
-                class="right-complete-two"
256
+                class='right-complete-two'
251 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 262
                 </view>
257 263
               </view>
258 264
             </view>
259 265
           );
260 266
         })}
261 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 273
             </text>
268
-            <text style="right:29px;position: absolute;padding-top:20px">
274
+            <text style='right:29px;position: absolute;padding-top:20px'>
269 275
               {person.phone}
270 276
             </text>
271 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 282
               checked={agreement}
277 283
               onClick={() => {
278 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 290
               </text>
285
-            </Checkbox>
291
+            </Radio>
292
+
293
+
286 294
           </view>
287 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 299
               返现¥{formatPrice(totalPrice?.cashback || 0)}
292 300
             </text>
293
-            <image className="button-image" src={ProCard_hot}>
301
+            <image className='button-image' src={ProCard_hot}>
294 302
               123123
295 303
             </image>
296
-            <view className="button-text-money">
304
+            <view className='button-text-money'>
297 305
               门店市面价:{formatPrice(totalPrice?.standardPrice || 0)}元
298 306
             </view>
299 307
           </view>
300
-          <Button className="button-box-one" onClick={() => onShowPay()}>
308
+          <Button className='button-box-one' onClick={() => onShowPay()}>
301 309
             ¥{formatPrice(totalPrice?.actualPrice || 0)}元
302
-            <text className="button-text-one">支付订单</text>
310
+            <text className='button-text-one'>支付订单</text>
303 311
           </Button>
304 312
         </view>
305 313
       </view>