feat(address): 新增收货地址与售后申请功能

- 新增地址编辑页面,支持地址智能识别、地图选点、地区选择和默认地址设置
- 实现地址列表页面,支持地址查看、删除、设为默认及选择返回结算页
- 新增售后申请页面,支持退款类型选择、商品选择、原因填写、图片上传和提交审核
- 修复 passport 分包配置,移除不存在分包并补充缺失声明,避免 Taro 编译报错
- 新增地址类型定义,增强前端地址数据结构类型安全
- 优化页面交互体验,完善表单校验及错误提示逻辑
- 统一代码格式与命名规范,保持代码风格一致性
This commit is contained in:
2026-07-16 01:18:42 +08:00
commit 9df90c1176
658 changed files with 85984 additions and 0 deletions

7
config/app.ts Normal file
View File

@@ -0,0 +1,7 @@
import { API_BASE_URL, SERVER_API_URL } from './env'
export const TenantId = '5'
export const TenantName = '威硕开发助手'
export const BaseUrl = API_BASE_URL
export const ServerBaseUrl = SERVER_API_URL
export const Version = 'v3.0.0'

17
config/dev.ts Normal file
View File

@@ -0,0 +1,17 @@
export default {
env: {
NODE_ENV: '"development"'
},
defineConstants: {
__DEV__: JSON.stringify(true)
},
mini: {},
h5: {
devServer: {
host: 'localhost',
port: 10086,
hot: true,
open: false
}
}
}

28
config/env.js Normal file
View File

@@ -0,0 +1,28 @@
const CURRENT_ENV = process.env.NODE_ENV === 'production' ? 'production' : 'development'
export const ENV_CONFIG = {
development: {
API_BASE_URL: 'https://shop-api.websoft.top/api',
SERVER_API_URL: 'https://server.websoft.top/api',
APP_NAME: '威硕谱软件',
DEBUG: 'true',
},
test: {
API_BASE_URL: 'https://shop-api.websoft.top/api',
SERVER_API_URL: 'https://server.websoft.top/api',
APP_NAME: '威硕谱软件',
DEBUG: 'true',
},
production: {
API_BASE_URL: 'https://shop-api.websoft.top/api',
SERVER_API_URL: 'https://server.websoft.top/api',
APP_NAME: '威硕谱软件',
DEBUG: 'false',
},
}
export function getEnvConfig() {
return ENV_CONFIG[CURRENT_ENV] || ENV_CONFIG.development
}
export const { API_BASE_URL, SERVER_API_URL, APP_NAME, DEBUG } = getEnvConfig()

120
config/index.ts Normal file
View File

@@ -0,0 +1,120 @@
import { defineConfig, type UserConfigExport } from '@tarojs/cli'
import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin'
import { UnifiedWebpackPluginV5 } from 'weapp-tailwindcss/webpack'
import devConfig from './dev'
import prodConfig from './prod'
import path from 'path'
import { getEnvConfig } from './env.js'
// https://taro-docs.jd.com/docs/next/config
export default defineConfig<'webpack5'>(async (merge, { mode }) => {
const baseConfig: UserConfigExport<'webpack5'> = {
// 项目配置
projectName: 'shop-taro',
date: '2026-5-10',
designWidth: 750,
deviceRatio: {
640: 2.34 / 2,
750: 1,
828: 1.81 / 2
},
sourceRoot: 'src',
outputRoot: 'dist',
plugins: [
'@tarojs/plugin-platform-weapp',
'@tarojs/plugin-platform-h5'
],
// 编译配置
defineConstants: {
API_BASE_URL: JSON.stringify(getEnvConfig().API_BASE_URL),
SERVER_API_URL: JSON.stringify(getEnvConfig().SERVER_API_URL),
APP_NAME: JSON.stringify(getEnvConfig().APP_NAME),
DEBUG: JSON.stringify(getEnvConfig().DEBUG),
},
copy: {
patterns: [],
options: {}
},
framework: 'react',
compiler: {
type: 'webpack5',
prebundle: {
enable: false
}
},
// 开启持久化缓存 - 有效提升二次编译速度
cache: {
enable: false,
type: 'filesystem',
cacheDirectory: path.resolve(__dirname, '../.webpack-cache'),
buildDependencies: {
config: [__filename]
}
},
// 小程序配置
mini: {
postcss: {
pxtransform: {
enable: true,
config: {}
},
url: {
enable: true,
config: {
limit: 1024
}
},
cssModules: {
enable: false,
config: {
namingPattern: 'module',
generateScopedName: '[name]__[local]___[hash:base64:5]'
}
}
},
webpackChain(chain) {
chain.resolve.plugin('tsconfig-paths').use(TsconfigPathsPlugin)
// weapp-tailwindcss: 自动处理 TailwindCSS 与 WXSS 的兼容性
chain.merge({
plugin: {
'weapp-tailwindcss': {
plugin: UnifiedWebpackPluginV5,
args: [{
appType: 'taro',
rem2rpx: true,
}]
}
}
})
}
},
// H5 配置
h5: {
publicPath: '/',
staticDirectory: 'static',
postcss: {
autoprefixer: {
enable: true
},
cssModules: {
enable: false,
config: {
namingPattern: 'module',
generateScopedName: '[name]__[local]___[hash:base64:5]'
}
}
},
webpackChain(chain) {
chain.resolve.plugin('tsconfig-paths').use(TsconfigPathsPlugin)
}
},
}
if (mode === 'development') {
return merge({}, baseConfig, devConfig)
}
return merge({}, baseConfig, prodConfig)
})

12
config/prod.ts Normal file
View File

@@ -0,0 +1,12 @@
export default {
env: {
NODE_ENV: '"production"'
},
defineConstants: {
__DEV__: JSON.stringify(false)
},
mini: {
compressTemplate: true
},
h5: {}
}