@echo off
chcp 65001 >nul
echo ========================================
echo uniapp小程序分包文件移动脚本
echo ========================================
echo.

echo [1/3] 创建分包目录结构...
if not exist "subPackages" mkdir "subPackages"
if not exist "subPackages\charging" mkdir "subPackages\charging"
if not exist "subPackages\order" mkdir "subPackages\order"
if not exist "subPackages\coupon" mkdir "subPackages\coupon"
if not exist "subPackages\other" mkdir "subPackages\other"
echo   √ 分包目录创建完成
echo.

echo [2/3] 移动页面文件到分包目录...

REM charging 分包
echo   移动 charging 分包...
move "pages\site" "subPackages\charging\site" >nul 2>&1
move "pages\site-more" "subPackages\charging\site-more" >nul 2>&1
move "pages\charging" "subPackages\charging\charging" >nul 2>&1
move "pages\terminal" "subPackages\charging\terminal" >nul 2>&1
move "pages\new-site" "subPackages\charging\new-site" >nul 2>&1
echo   √ charging 分包完成

REM order 分包
echo   移动 order 分包...
move "pages\order" "subPackages\order\order" >nul 2>&1
move "pages\order-detail" "subPackages\order\order-detail" >nul 2>&1
echo   √ order 分包完成

REM coupon 分包
echo   移动 coupon 分包...
move "pages\coupon-buy" "subPackages\coupon\coupon-buy" >nul 2>&1
move "pages\coupons" "subPackages\coupon\coupons" >nul 2>&1
move "pages\recharge-log" "subPackages\coupon\recharge-log" >nul 2>&1
echo   √ coupon 分包完成

REM other 分包
echo   移动 other 分包...
move "pages\feedback" "subPackages\other\feedback" >nul 2>&1
move "pages\feedback-reply" "subPackages\other\feedback-reply" >nul 2>&1
move "pages\search" "subPackages\other\search" >nul 2>&1
move "pages\web" "subPackages\other\web" >nul 2>&1
move "pages\banner-page" "subPackages\other\banner-page" >nul 2>&1
echo   √ other 分包完成
echo.

echo [3/3] 完成!
echo ========================================
echo 分包处理完成!
echo ========================================
echo.
echo 主包页面 (4个): index, map, my, login
echo charging分包 (5个): site, site-more, charging, terminal, new-site
echo order分包 (2个): order, order-detail  
echo coupon分包 (3个): coupon-buy, coupons, recharge-log
echo other分包 (5个): feedback, feedback-reply, search, web, banner-page
echo.
echo 请使用 HBuilderX 或微信开发者工具重新编译项目
echo.
pause
