feat(h5): add pull-to-refresh on user partner and shop pages
CI / verify (pull_request) Has been cancelled

Share PullToRefresh for partner/shop H5; enable Taro pull-down on mini-user lists.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-22 11:19:42 +08:00
parent 270cebc79a
commit ae7c63c08d
29 changed files with 443 additions and 121 deletions
+16 -15
View File
@@ -1,6 +1,7 @@
import { useEffect, useState } from 'react';
import { useCallback, useEffect, useState } from 'react';
import { useNavigate, useSearchParams } from 'react-router-dom';
import { isWxAuthorizeEnabled } from '@dukang/shared-types';
import PullToRefresh from '@dukang/shared-ui/PullToRefresh';
import { stripOAuthParamsFromLocation } from '@dukang/weixin-sdk';
import { useStoreSession } from '../contexts/StoreSessionContext';
import { getStoreProfile, request } from '../lib/api';
@@ -24,21 +25,21 @@ export default function MinePage() {
const [binding, setBinding] = useState(false);
const [bindMsg, setBindMsg] = useState('');
useEffect(() => {
request('SHOP_H5', '/shop/store').then(setStore).catch(() => setStore(null));
const loadMine = useCallback(() => {
return Promise.all([
request('SHOP_H5', '/shop/store').then(setStore).catch(() => setStore(null)),
fetchClientConfig()
.then((config) => setWxAuthorize(isWxAuthorizeEnabled(config)))
.catch(() => setWxAuthorize(false)),
fetchShopAccount()
.then((me) => setHasWechat(!!(me.hasWechat || me.wxOpenId)))
.catch(() => setHasWechat(null)),
]);
}, []);
useEffect(() => {
fetchClientConfig()
.then((config) => setWxAuthorize(isWxAuthorizeEnabled(config)))
.catch(() => setWxAuthorize(false));
}, []);
useEffect(() => {
fetchShopAccount()
.then((me) => setHasWechat(!!(me.hasWechat || me.wxOpenId)))
.catch(() => setHasWechat(null));
}, []);
void loadMine();
}, [loadMine]);
useEffect(() => {
if (!isWechatEnv() || !wxAuthorize || !searchParams.get('code')) return;
@@ -92,7 +93,7 @@ export default function MinePage() {
}
return (
<div className="shop-mine-page">
<PullToRefresh onRefresh={loadMine} className="shop-mine-page">
<header className="shop-mine-header">
<h1 className="app-page-title"></h1>
</header>
@@ -174,6 +175,6 @@ export default function MinePage() {
退
</button>
</div>
</div>
</PullToRefresh>
);
}