From 817929897a2e973b2edcd8e311e8dfefa78f1916 Mon Sep 17 00:00:00 2001 From: xuan Date: Mon, 20 Mar 2023 18:30:00 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(=E9=9D=A2=E6=96=99=E8=AF=A6?= =?UTF-8?q?=E6=83=85):=20=E4=BF=AE=E5=A4=8D=E9=A2=84=E8=A7=88=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E6=A8=A1=E7=B3=8A=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/activityIncome/index.config.ts | 1 + src/pages/activityIncome/index.tsx | 13 +++++++++++-- src/pages/details/components/orderCount/index.tsx | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/pages/activityIncome/index.config.ts b/src/pages/activityIncome/index.config.ts index 0a1b9c3..e4a3ba5 100644 --- a/src/pages/activityIncome/index.config.ts +++ b/src/pages/activityIncome/index.config.ts @@ -3,5 +3,6 @@ export default { navigationBarTextStyle: 'white', enableShareAppMessage: true, navigationBarBackgroundColor: '#4A7FFF', + enablePullDownRefresh: true, backgroundColorTop: '#4A7FFF', } diff --git a/src/pages/activityIncome/index.tsx b/src/pages/activityIncome/index.tsx index b1b1cc6..05a66cd 100644 --- a/src/pages/activityIncome/index.tsx +++ b/src/pages/activityIncome/index.tsx @@ -1,6 +1,6 @@ import { Icon, Text, View } from '@tarojs/components' -import Taro, { useReady } from '@tarojs/taro' +import Taro, { usePullDownRefresh, useReady } from '@tarojs/taro' import classNames from 'classnames' import { useState } from 'react' import styles from './index.module.scss' @@ -27,8 +27,17 @@ export default () => { const { fetchData, state } = GetRebateDetail() + const getData = async() => { + await fetchData() + Taro.stopPullDownRefresh() + } + + usePullDownRefresh(() => { + getData() + }) + useReady(() => { - fetchData() + getData() }) return ( diff --git a/src/pages/details/components/orderCount/index.tsx b/src/pages/details/components/orderCount/index.tsx index ce4fe01..a419c03 100644 --- a/src/pages/details/components/orderCount/index.tsx +++ b/src/pages/details/components/orderCount/index.tsx @@ -632,7 +632,7 @@ const OrderCount = ({ show = false, onClose, title = '', productId = 0, is_first showGuidePopup && showPopup && setshowGuidePopup(false)}> } - +