فهرست منبع

💄 style(search-result): adjust goods list container padding and margin

- reduce padding from 20rpx 24rpx to 15rpx 11rpx
- decrease margin from 0 32rpx to 0 10rpx

✨ feat(search-result): add URI decoding for search keywords

- decode URI component for searchKeyword when initializing keyword state
- decode URI component for searchKeyword when initializing searchValue state
yourname 1 ماه پیش
والد
کامیت
bf05ca86a2
2فایلهای تغییر یافته به همراه5 افزوده شده و 4 حذف شده
  1. 3 2
      mini/src/pages/search-result/index.css
  2. 2 2
      mini/src/pages/search-result/index.tsx

+ 3 - 2
mini/src/pages/search-result/index.css

@@ -83,12 +83,13 @@
 .goods-list-container {
   background-color: #f2f2f2;
   border-radius: 16rpx;
-  padding: 20rpx 24rpx;
+  padding: 15rpx 11rpx;
   overflow-y: scroll;
   -webkit-overflow-scrolling: touch;
-  margin: 0 32rpx;
+  margin: 0 10rpx;
 }
 
+
 /* 加载状态 */
 .loading-container {
   display: flex;

+ 2 - 2
mini/src/pages/search-result/index.tsx

@@ -22,8 +22,8 @@ const SearchResultPage: React.FC = () => {
   const searchKeyword = params?.keyword || ''
 
   // 直接使用路由参数,无需useEffect
-  const [keyword, setKeyword] = useState(searchKeyword)
-  const [searchValue, setSearchValue] = useState(searchKeyword)
+  const [keyword, setKeyword] = useState(decodeURIComponent(searchKeyword))
+  const [searchValue, setSearchValue] = useState(decodeURIComponent(searchKeyword))
 
   const {
     data,