feat(sqszx202): configure integral mall deployment
This commit is contained in:
@@ -13,8 +13,8 @@ ENV = 'development'
|
||||
# shjjy153 项目
|
||||
# VUE_APP_BASE_API = 'http://jjy-jfadmin.fwxgpt.com'
|
||||
|
||||
# byhlc112 项目
|
||||
VUE_APP_BASE_API = 'https://jf.lehoo6.com'
|
||||
# sqszx202 项目
|
||||
VUE_APP_BASE_API = 'https://jf.j3s4s5.com'
|
||||
|
||||
# hapr191 项目(淮安鹏然商贸)
|
||||
# VUE_APP_BASE_API = 'http://jfadmin.hapengran.com'
|
||||
|
||||
@@ -13,8 +13,8 @@ ENV = 'production'
|
||||
# shjjy153 项目
|
||||
# VUE_APP_BASE_API = 'http://jjy-jfadmin.fwxgpt.com'
|
||||
|
||||
# byhlc112 项目
|
||||
VUE_APP_BASE_API = 'https://jf.lehoo6.com'
|
||||
# sqszx202 项目
|
||||
VUE_APP_BASE_API = 'https://jf.j3s4s5.com'
|
||||
|
||||
# hapr191 项目(淮安鹏然商贸)
|
||||
# VUE_APP_BASE_API = 'http://jfadmin.hapengran.com'
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
# CRMEB 相关配置
|
||||
crmeb:
|
||||
captchaOn: false # 是否开启行为验证码
|
||||
asyncConfig: true #是否同步config表数据到redis
|
||||
|
||||
server:
|
||||
port: 30032
|
||||
|
||||
# 订单同步配置(每个单商户实例需要配置不同的source-id和target-mer-id)
|
||||
sync:
|
||||
source-id: shop_17
|
||||
target-mer-id: 17
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
name: sqszx202
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
url: jdbc:mysql://rm-bp1a178eq62lxba9xbo.mysql.rds.aliyuncs.com:3306/${spring.datasource.name}?useUnicode=true&serverTimezone=GMT%2B8&characterEncoding=utf8
|
||||
username: yangtangyoupin
|
||||
password: 5Fn8eWrbYFtAhCZw
|
||||
redis:
|
||||
host: 59.110.91.202 #地址
|
||||
port: 6379 #端口
|
||||
password: '123456'
|
||||
timeout: 10000 # 连接超时时间(毫秒)
|
||||
database: 2 #默认数据库
|
||||
jedis:
|
||||
pool:
|
||||
max-active: 200 # 连接池最大连接数(使用负值表示没有限制)
|
||||
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-idle: 10 # 连接池中的最大空闲连接
|
||||
min-idle: 0 # 连接池中的最小空闲连接
|
||||
time-between-eviction-runs: -1 #逐出扫描的时间间隔(毫秒) 如果为负数,则不运行逐出线程, 默认-1
|
||||
second:
|
||||
database: 2 # 微信accessToken存储库
|
||||
|
||||
debug: true
|
||||
logging:
|
||||
level:
|
||||
io.swagger.*: error
|
||||
com.zbjk.crmeb: debug
|
||||
org.springframework.boot.autoconfigure: ERROR
|
||||
config: classpath:logback-spring.xml
|
||||
file:
|
||||
path: ./crmeb_log
|
||||
|
||||
# mybatis 配置
|
||||
mybatis-plus:
|
||||
# 配置sql打印日志
|
||||
configuration:
|
||||
log-impl:
|
||||
|
||||
#swagger 配置
|
||||
swagger:
|
||||
basic:
|
||||
enable: true #是否开启界面
|
||||
check: false #是否打开验证
|
||||
username: crmeb #访问swagger的账号
|
||||
password: crmeb.com #访问swagger的密码
|
||||
@@ -38,7 +38,7 @@ server:
|
||||
|
||||
spring:
|
||||
profiles:
|
||||
active: byhlc112
|
||||
active: sqszx202
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 50MB #设置单个文件大小
|
||||
|
||||
@@ -70,7 +70,7 @@ public class WaUserController {
|
||||
private CrmebConfig crmebConfig;
|
||||
|
||||
private String buildPublicFileUrl(String relativeUrl) {
|
||||
String domain = StringUtils.defaultString(crmebConfig.getDomain(), "https://h5y2c.com").trim();
|
||||
String domain = StringUtils.defaultString(crmebConfig.getDomain(), "https://j3s4s5.com").trim();
|
||||
if (!StringUtils.startsWithAny(domain, "http://", "https://")) {
|
||||
domain = "https://" + domain;
|
||||
}
|
||||
@@ -88,7 +88,7 @@ public class WaUserController {
|
||||
FileInputStream fileInputStream = null;
|
||||
try {
|
||||
// 读取模板PDF文件
|
||||
Resource resource = new ClassPathResource("pdf/sign_contract_byhlc112.pdf");
|
||||
Resource resource = new ClassPathResource("pdf/sign_contract_sqszx202.pdf");
|
||||
InputStream pdfInputStream = resource.getInputStream();
|
||||
document = PDDocument.load(pdfInputStream);
|
||||
pdfInputStream.close();
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
crmeb:
|
||||
imagePath: /www/wwwroot/j3s4s5.com/ # 服务器图片路径配置 斜杠结尾
|
||||
domain: https://j3s4s5.com/ # 当前项目域名,合同/PDF 等公开地址拼接使用
|
||||
asyncConfig: true #是否同步config表数据到redis
|
||||
|
||||
server:
|
||||
port: 30031
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
name: sqszx202
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
url: jdbc:mysql://rm-bp1a178eq62lxba9xbo.mysql.rds.aliyuncs.com:3306/${spring.datasource.name}?useUnicode=true&serverTimezone=GMT%2B8&characterEncoding=utf8
|
||||
username: yangtangyoupin
|
||||
password: 5Fn8eWrbYFtAhCZw
|
||||
redis:
|
||||
host: 59.110.91.202 #地址
|
||||
port: 6379 #端口
|
||||
password: '123456'
|
||||
timeout: 10000 # 连接超时时间(毫秒)
|
||||
database: 2 #默认数据库
|
||||
jedis:
|
||||
pool:
|
||||
max-active: 200 # 连接池最大连接数(使用负值表示没有限制)
|
||||
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-idle: 10 # 连接池中的最大空闲连接
|
||||
min-idle: 0 # 连接池中的最小空闲连接
|
||||
time-between-eviction-runs: -1 #逐出扫描的时间间隔(毫秒) 如果为负数,则不运行逐出线程, 默认-1
|
||||
second:
|
||||
database: 2 # 微信accessToken存储库
|
||||
|
||||
debug: true
|
||||
logging:
|
||||
level:
|
||||
io.swagger.*: error
|
||||
com.zbjk.crmeb: debug
|
||||
org.springframework.boot.autoconfigure: ERROR
|
||||
config: classpath:logback-spring.xml
|
||||
file:
|
||||
path: ./logs
|
||||
|
||||
# mybatis 配置
|
||||
mybatis-plus:
|
||||
# 配置sql打印日志
|
||||
configuration:
|
||||
log-impl:
|
||||
|
||||
#swagger 配置
|
||||
swagger:
|
||||
basic:
|
||||
enable: true #是否开启界面
|
||||
check: false #是否打开验证
|
||||
username: crmeb #访问swagger的账号
|
||||
password: crmeb.com #访问swagger的密码
|
||||
@@ -32,7 +32,7 @@ server:
|
||||
|
||||
spring:
|
||||
profiles:
|
||||
active: byhlc112
|
||||
active: sqszx202
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 50MB #设置单个文件大小
|
||||
|
||||
Binary file not shown.
@@ -9,7 +9,7 @@ server:
|
||||
|
||||
crmeb:
|
||||
imagePath: /usr/local/crmeb/
|
||||
domain: https://h5y2c.com
|
||||
domain: ${CRMEB_DOMAIN:https://h5y2c.com}
|
||||
captchaOn: false
|
||||
asyncConfig: true
|
||||
demoSite: false
|
||||
|
||||
42
deploy/docker/step2-single-shop-sqszx202/.env.example
Normal file
42
deploy/docker/step2-single-shop-sqszx202/.env.example
Normal file
@@ -0,0 +1,42 @@
|
||||
# =============================================================
|
||||
# 步骤二:积分商城环境变量 — 宿迁盛泽鑫商贸 sqszx202
|
||||
# 使用方法:cp .env.example .env 然后填入真实密码
|
||||
# .env 不入库(已加入 .gitignore)
|
||||
# =============================================================
|
||||
|
||||
TZ=Asia/Shanghai
|
||||
|
||||
# ---------- Redis(容器内,与步骤一独立) ----------
|
||||
REDIS_PASSWORD=change-me-redis
|
||||
|
||||
# ---------- 阿里云 RDS ----------
|
||||
RDS_HOST=rm-bp1a178eq62lxba9xbo.mysql.rds.aliyuncs.com
|
||||
RDS_DB=sqszx202
|
||||
RDS_USER=yangtangyoupin
|
||||
RDS_PASSWORD=change-me
|
||||
|
||||
# ---------- 订单同步(多商户 source / target) ----------
|
||||
SYNC_SOURCE_ID=shop_17
|
||||
SYNC_TARGET_MER_ID=17
|
||||
|
||||
# ---------- Java JAR 宿主机路径(FTP 更新后 restart 容器即可) ----------
|
||||
SINGLE_FRONT_JAR=/www/wwwroot/javaapi/miao-front-2.2.jar
|
||||
SINGLE_ADMIN_JAR=/www/wwwroot/javaapi/miao-admin-2.2.jar
|
||||
|
||||
# ---------- Java 日志目录(bind-mount 到宿主机,直接 tail -f 查看) ----------
|
||||
SINGLE_FRONT_LOG_DIR=/www/wwwroot/javaapi/logs/front
|
||||
SINGLE_ADMIN_LOG_DIR=/www/wwwroot/javaapi/logs/admin
|
||||
|
||||
# ---------- 图片/PDF 目录(与步骤一 H5 Nginx 共享宿主机路径) ----------
|
||||
CRMEB_IMAGE_DIR=/www/wwwroot/j3s4s5.com
|
||||
CRMEB_DOMAIN=https://j3s4s5.com/
|
||||
|
||||
# ---------- 前端静态目录(bind-mount,rsync 更新后立即生效) ----------
|
||||
# 积分商城 H5(uni-app SPA),对应域名 jf.j3s4s5.com
|
||||
SINGLE_H5_DIR=/www/wwwroot/jf.j3s4s5.com
|
||||
# 积分商城管理后台(Vue SPA),对应域名 jfadmin.j3s4s5.com
|
||||
SINGLE_ADMIN_WEB_DIR=/www/wwwroot/jfadmin.j3s4s5.com
|
||||
|
||||
# ---------- 宿主机暴露端口(供宝塔 Nginx 反代) ----------
|
||||
SINGLE_ADMIN_PORT=18081
|
||||
SINGLE_H5_PORT=18082
|
||||
1
deploy/docker/step2-single-shop-sqszx202/.gitignore
vendored
Normal file
1
deploy/docker/step2-single-shop-sqszx202/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.env
|
||||
124
deploy/docker/step2-single-shop-sqszx202/README.md
Normal file
124
deploy/docker/step2-single-shop-sqszx202/README.md
Normal file
@@ -0,0 +1,124 @@
|
||||
# 步骤二:积分商城 Docker 部署(宿迁盛泽鑫商贸 sqszx202)
|
||||
|
||||
项目:`single-shop-22`(积分商城)
|
||||
服务:`redis` · `single-front-api`(Spring Boot)· `single-admin-api`(Spring Boot)
|
||||
`single-admin-web`(Vue 管理后台)· `single-h5`(uni-app H5)
|
||||
|
||||
步骤一(寄卖商城)与本步骤完全独立,可以单独部署、单独重启。
|
||||
|
||||
> 这套方案参考 `deploy/docker/step2-single-shop`,按 `czleilei240` 已验证结构复制。
|
||||
> 当前默认域名假设为:
|
||||
> - 积分商城 H5:`jf.j3s4s5.com`
|
||||
> - 积分商城管理后台:`jfadmin.j3s4s5.com`
|
||||
|
||||
---
|
||||
|
||||
## 部署前提:宿主机文件准备
|
||||
|
||||
### 1. Java JAR(Spring Boot API)
|
||||
|
||||
```bash
|
||||
mkdir -p /www/wwwroot/javaapi/logs/front
|
||||
mkdir -p /www/wwwroot/javaapi/logs/admin
|
||||
|
||||
scp single-shop-22/backend/crmeb-front/target/miao-front-2.2.jar root@59.110.91.202:/www/wwwroot/javaapi/
|
||||
scp single-shop-22/backend/crmeb-admin/target/miao-admin-2.2.jar root@59.110.91.202:/www/wwwroot/javaapi/
|
||||
```
|
||||
|
||||
### 2. 前端静态文件
|
||||
|
||||
```bash
|
||||
mkdir -p /www/wwwroot/jf.j3s4s5.com
|
||||
rsync -a --delete single-shop-22/single_uniapp22miao/unpackage/dist/build/web/ \
|
||||
root@59.110.91.202:/www/wwwroot/jf.j3s4s5.com/
|
||||
chmod -R 755 /www/wwwroot/jf.j3s4s5.com/
|
||||
|
||||
mkdir -p /www/wwwroot/jfadmin.j3s4s5.com
|
||||
rsync -a --delete single-shop-22/backend-adminend/dist/ \
|
||||
root@59.110.91.202:/www/wwwroot/jfadmin.j3s4s5.com/
|
||||
chmod -R 755 /www/wwwroot/jfadmin.j3s4s5.com/
|
||||
```
|
||||
|
||||
### 3. 图片/PDF 目录
|
||||
|
||||
```bash
|
||||
mkdir -p /www/wwwroot/j3s4s5.com
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 快速部署
|
||||
|
||||
```bash
|
||||
cd deploy/docker/step2-single-shop-sqszx202
|
||||
|
||||
cp .env.example .env
|
||||
vim .env
|
||||
|
||||
docker compose --env-file .env build
|
||||
docker compose --env-file .env up -d
|
||||
|
||||
docker compose --env-file .env ps
|
||||
docker compose --env-file .env logs -f single-front-api
|
||||
docker compose --env-file .env logs -f single-admin-api
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 域名与端口
|
||||
|
||||
| 域名 | 用途 | 宿主机端口 |
|
||||
|---|---|---|
|
||||
| `jf.j3s4s5.com` | 积分商城 H5(uni-app) | **18082** |
|
||||
| `jfadmin.j3s4s5.com` | 积分商城管理后台(Vue) | **18081** |
|
||||
|
||||
> Spring Boot API 端口(30032 / 30033)仅容器内监听,不对外暴露。
|
||||
> 宝塔 Nginx 通过域名反代到 `127.0.0.1:18081 / 18082`,再由容器内 Nginx 转发到 API。
|
||||
> 图片/PDF 实际落盘路径为宿主机 `/www/wwwroot/j3s4s5.com/crmebimage/public/...`。
|
||||
|
||||
---
|
||||
|
||||
## 验证
|
||||
|
||||
| 地址 | 预期 |
|
||||
|------|------|
|
||||
| `https://jf.j3s4s5.com/` | 积分商城 H5 |
|
||||
| `https://jfadmin.j3s4s5.com/` | 积分商城管理后台 |
|
||||
| `http://59.110.91.202:18082/` | H5 直连测试 |
|
||||
| `http://59.110.91.202:18081/` | 管理后台直连测试 |
|
||||
|
||||
---
|
||||
|
||||
## bind-mount 目录总览
|
||||
|
||||
| 宿主机路径 | 挂入容器路径 | 说明 |
|
||||
|---|---|---|
|
||||
| `/www/wwwroot/javaapi/miao-front-2.2.jar` | `/app/app.jar` | 用户端 API JAR |
|
||||
| `/www/wwwroot/javaapi/miao-admin-2.2.jar` | `/app/app.jar` | 管理端 API JAR |
|
||||
| `/www/wwwroot/javaapi/logs/front/` | `/app/log` | 用户端 API 日志 |
|
||||
| `/www/wwwroot/javaapi/logs/admin/` | `/app/log` | 管理端 API 日志 |
|
||||
| `/www/wwwroot/j3s4s5.com/` | `/usr/local/crmeb/` | 图片/PDF 写入目录 |
|
||||
| `/www/wwwroot/jf.j3s4s5.com/` | `/usr/share/nginx/html` | H5 静态文件 |
|
||||
| `/www/wwwroot/jfadmin.j3s4s5.com/` | `/usr/share/nginx/html` | 管理后台静态文件 |
|
||||
| `../single-shop/application-docker.yml` | `/config/application-docker.yml` | Spring Boot 配置 |
|
||||
|
||||
---
|
||||
|
||||
## sqszx202 关键配置对照
|
||||
|
||||
| 配置项 | 值 |
|
||||
|---|---|
|
||||
| RDS Host | `rm-bp1a178eq62lxba9xbo.mysql.rds.aliyuncs.com` |
|
||||
| DB / User | `sqszx202` / `yangtangyoupin` |
|
||||
| imagePath 宿主机目录 | `/www/wwwroot/j3s4s5.com/` |
|
||||
| CRMEB_DOMAIN | `https://j3s4s5.com/` |
|
||||
| SYNC_SOURCE_ID | `shop_17` |
|
||||
| SYNC_TARGET_MER_ID | `17` |
|
||||
| Spring profile | `docker`(通过 `application-docker.yml` 注入) |
|
||||
|
||||
---
|
||||
|
||||
## 待确认项
|
||||
|
||||
- 如果积分管理后台域名不是 `jfadmin.j3s4s5.com`,需要同步替换 `.env.example`、README 和宝塔 Nginx 配置
|
||||
- Redis 仍按 Docker 内置实例方案生成;若你想接外部 Redis,可以再帮你补一版外部 Redis 配置
|
||||
164
deploy/docker/step2-single-shop-sqszx202/docker-compose.yml
Normal file
164
deploy/docker/step2-single-shop-sqszx202/docker-compose.yml
Normal file
@@ -0,0 +1,164 @@
|
||||
# =============================================================
|
||||
# 步骤二:积分商城(single-shop-22)独立部署
|
||||
# 客户:宿迁盛泽鑫商贸 sqszx202
|
||||
# 包含服务:redis · single-admin-api · single-front-api
|
||||
# single-admin-web(Vue) · single-h5(uni-app)
|
||||
# =============================================================
|
||||
|
||||
name: jifenmall-sqszx202
|
||||
|
||||
x-common: &common
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
TZ: ${TZ:-Asia/Shanghai}
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "20m"
|
||||
max-file: "5"
|
||||
|
||||
x-spring-common: &spring-common
|
||||
<<: *common
|
||||
environment:
|
||||
TZ: ${TZ:-Asia/Shanghai}
|
||||
MYSQL_HOST: ${RDS_HOST}
|
||||
MYSQL_DATABASE: ${RDS_DB}
|
||||
MYSQL_USERNAME: ${RDS_USER}
|
||||
MYSQL_PASSWORD: ${RDS_PASSWORD}
|
||||
REDIS_HOST: redis
|
||||
REDIS_PORT: 6379
|
||||
REDIS_PASSWORD: ${REDIS_PASSWORD}
|
||||
CRMEB_DOMAIN: ${CRMEB_DOMAIN}
|
||||
SYNC_SOURCE_ID: ${SYNC_SOURCE_ID:-shop_17}
|
||||
SYNC_TARGET_MER_ID: ${SYNC_TARGET_MER_ID:-17}
|
||||
|
||||
networks:
|
||||
single-net:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
single-redis-data:
|
||||
|
||||
services:
|
||||
redis:
|
||||
<<: *common
|
||||
build:
|
||||
context: .
|
||||
dockerfile: redis.Dockerfile
|
||||
image: jifenmall-sqszx202/redis:local
|
||||
container_name: single-redis-sqszx202
|
||||
command: ["--requirepass", "${REDIS_PASSWORD}", "--appendonly", "yes"]
|
||||
volumes:
|
||||
- single-redis-data:/data
|
||||
networks: [single-net]
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD}", "ping"]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
retries: 5
|
||||
|
||||
single-front-api:
|
||||
<<: *spring-common
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ../single-shop/front-api.Dockerfile
|
||||
image: jifenmall-sqszx202/front-api:local
|
||||
container_name: single-front-api-sqszx202
|
||||
networks: [single-net]
|
||||
ports:
|
||||
- "127.0.0.1:30033:30033"
|
||||
volumes:
|
||||
- ${SINGLE_FRONT_JAR}:/app/app.jar:ro
|
||||
- ${CRMEB_IMAGE_DIR}:/usr/local/crmeb
|
||||
- ${SINGLE_FRONT_LOG_DIR}:/app/log
|
||||
- ../single-shop/application-docker.yml:/config/application-docker.yml:ro
|
||||
environment:
|
||||
TZ: ${TZ:-Asia/Shanghai}
|
||||
MYSQL_HOST: ${RDS_HOST}
|
||||
MYSQL_DATABASE: ${RDS_DB}
|
||||
MYSQL_USERNAME: ${RDS_USER}
|
||||
MYSQL_PASSWORD: ${RDS_PASSWORD}
|
||||
REDIS_HOST: redis
|
||||
REDIS_PORT: 6379
|
||||
REDIS_PASSWORD: ${REDIS_PASSWORD}
|
||||
CRMEB_DOMAIN: ${CRMEB_DOMAIN}
|
||||
SYNC_SOURCE_ID: ${SYNC_SOURCE_ID:-shop_17}
|
||||
SYNC_TARGET_MER_ID: ${SYNC_TARGET_MER_ID:-17}
|
||||
SERVER_PORT: 30033
|
||||
depends_on:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -sf http://localhost:30033/actuator/health || exit 1"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 90s
|
||||
|
||||
single-admin-api:
|
||||
<<: *spring-common
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ../single-shop/admin-api.Dockerfile
|
||||
image: jifenmall-sqszx202/admin-api:local
|
||||
container_name: single-admin-api-sqszx202
|
||||
networks: [single-net]
|
||||
ports:
|
||||
- "127.0.0.1:30032:30032"
|
||||
volumes:
|
||||
- ${SINGLE_ADMIN_JAR}:/app/app.jar:ro
|
||||
- ${CRMEB_IMAGE_DIR}:/usr/local/crmeb
|
||||
- ${SINGLE_ADMIN_LOG_DIR}:/app/log
|
||||
- ../single-shop/application-docker.yml:/config/application-docker.yml:ro
|
||||
environment:
|
||||
TZ: ${TZ:-Asia/Shanghai}
|
||||
MYSQL_HOST: ${RDS_HOST}
|
||||
MYSQL_DATABASE: ${RDS_DB}
|
||||
MYSQL_USERNAME: ${RDS_USER}
|
||||
MYSQL_PASSWORD: ${RDS_PASSWORD}
|
||||
REDIS_HOST: redis
|
||||
REDIS_PORT: 6379
|
||||
REDIS_PASSWORD: ${REDIS_PASSWORD}
|
||||
CRMEB_DOMAIN: ${CRMEB_DOMAIN}
|
||||
SYNC_SOURCE_ID: ${SYNC_SOURCE_ID:-shop_17}
|
||||
SYNC_TARGET_MER_ID: ${SYNC_TARGET_MER_ID:-17}
|
||||
SERVER_PORT: 30032
|
||||
depends_on:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -sf http://localhost:30032/actuator/health || exit 1"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 90s
|
||||
|
||||
single-admin-web:
|
||||
<<: *common
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ../single-shop/admin-web.Dockerfile
|
||||
image: jifenmall-sqszx202/admin-web:local
|
||||
container_name: single-admin-web-sqszx202
|
||||
networks: [single-net]
|
||||
ports:
|
||||
- "${SINGLE_ADMIN_PORT:-18081}:80"
|
||||
volumes:
|
||||
- ${SINGLE_ADMIN_WEB_DIR}:/usr/share/nginx/html
|
||||
depends_on:
|
||||
- single-admin-api
|
||||
|
||||
single-h5:
|
||||
<<: *common
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ../single-shop/h5.Dockerfile
|
||||
image: jifenmall-sqszx202/h5:local
|
||||
container_name: single-h5-sqszx202
|
||||
networks: [single-net]
|
||||
ports:
|
||||
- "${SINGLE_H5_PORT:-18082}:80"
|
||||
volumes:
|
||||
- ${SINGLE_H5_DIR}:/usr/share/nginx/html
|
||||
depends_on:
|
||||
- single-front-api
|
||||
18
deploy/docker/step2-single-shop-sqszx202/redis.Dockerfile
Normal file
18
deploy/docker/step2-single-shop-sqszx202/redis.Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
||||
# =============================================================
|
||||
# Redis(Alpine + apk 安装,绕过 Docker Hub 镜像拉取问题)
|
||||
# 与 step1 方案一致:不依赖 docker.io,只需 registry-1.docker.io 拉 alpine:3.19
|
||||
# =============================================================
|
||||
|
||||
FROM alpine:3.19
|
||||
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
|
||||
&& apk add --no-cache redis tzdata \
|
||||
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
||||
&& echo "Asia/Shanghai" > /etc/timezone \
|
||||
&& rm -f /etc/apk/cache/*.apk
|
||||
|
||||
VOLUME /data
|
||||
WORKDIR /data
|
||||
EXPOSE 6379
|
||||
|
||||
ENTRYPOINT ["redis-server"]
|
||||
64
docs/com-sqszx202.md
Normal file
64
docs/com-sqszx202.md
Normal file
@@ -0,0 +1,64 @@
|
||||
## 公司名称: 宿迁盛泽鑫商贸
|
||||
|
||||
- host ip: 59.110.91.202
|
||||
|
||||
### **修改任务**
|
||||
|
||||
- 新建分支:sqszx202 ,合并分支:byhlc112 的最新代码到该分支,并根据上述信息修改相关需要变更项,使符合该新公司项目环境
|
||||
- 在新建分支下修改
|
||||
|
||||
---
|
||||
|
||||
### 相关配置
|
||||
|
||||
- mysql数据库使用阿里云rds:rm-bp1a178eq62lxba9xbo.mysql.rds.aliyuncs.com
|
||||
- rds中项目数据库名:sqszx202
|
||||
|
||||
- 积分商城地址:https://jf.j3s4s5.com
|
||||
- **云服务器积分商城目录**:/www/wwwroot/jf.j3s4s5.com
|
||||
- **云服务器jar存放目录**:/www/wwwroot/javaapi
|
||||
|
||||
---
|
||||
|
||||
### backend/crmeb-front模块变更
|
||||
|
||||
- 1. profile: sqszx202
|
||||
- 2. profile file: application-sqszx202.yml, mysql连接信息修改,redis主机ip修改。
|
||||
- 3. **PDF合同模板文件路径**:pdf/sign_contract_sqszx202.pdf
|
||||
- 4. 用户PDF合同url地址前缀/落库域名:https://j3s4s5.com/
|
||||
- 5. imagePath: /www/wwwroot/j3s4s5.com/
|
||||
|
||||
### uniapp前端配置变更
|
||||
|
||||
- 1. 积分商城domain:https://jf.j3s4s5.com
|
||||
- 2. 抢购页面跳转地址:https://j3s4s5.com
|
||||
- 3. **PDF合同预览文件路径**: /static/sign_contract_sqszx202.pdf
|
||||
|
||||
|
||||
---
|
||||
|
||||
### backend/crmeb-admin模块变更
|
||||
|
||||
- 1. profile: sqszx202
|
||||
- 2. profile file: application-sqszx202.yml, mysql和redis主机ip修改,sync: source-id: shop_17, target-mer-id: 17
|
||||
|
||||
### 积分商城后台backend-adminend配置变更
|
||||
|
||||
- 1. backend-adminend/.env.development文件中VUE_APP_BASE_API改为https://jf.j3s4s5.com
|
||||
- 2. backend-adminend/.env.production文件中VUE_APP_BASE_API改为https://jf.j3s4s5.com
|
||||
|
||||
---
|
||||
|
||||
|
||||
|
||||
## 相关文件
|
||||
|
||||
、、、启动积分商城api服务
|
||||
cd /www/wwwroot/javaapi
|
||||
nohup java -Xms128m -Xmx256m -jar miao-front-2.2.jar > front.log & tail -f front.log
|
||||
、、、
|
||||
|
||||
、、、启动积分商城后台api服务
|
||||
cd /www/wwwroot/javaapi
|
||||
nohup java -Xms128m -Xmx256m -jar miao-admin-2.2.jar > admin.log & tail -f admin.log
|
||||
、、、
|
||||
BIN
docs/contract/sign_contract_sqszx202.docx
Normal file
BIN
docs/contract/sign_contract_sqszx202.docx
Normal file
Binary file not shown.
BIN
docs/contract/sign_contract_sqszx202.pdf
Normal file
BIN
docs/contract/sign_contract_sqszx202.pdf
Normal file
Binary file not shown.
@@ -274,10 +274,98 @@
|
||||
}
|
||||
|
||||
// #endif
|
||||
view {
|
||||
view,
|
||||
v-uni-view {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* H5 build emits v-uni-* tags; give them the same base layout as uni-* tags. */
|
||||
v-uni-view,
|
||||
v-uni-scroll-view,
|
||||
v-uni-swiper,
|
||||
v-uni-picker,
|
||||
v-uni-form,
|
||||
v-uni-label {
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
v-uni-view[hidden],
|
||||
v-uni-image[hidden],
|
||||
v-uni-scroll-view[hidden],
|
||||
v-uni-swiper[hidden],
|
||||
v-uni-swiper-item[hidden],
|
||||
v-uni-text[hidden],
|
||||
v-uni-button[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
v-uni-text {
|
||||
display: inline;
|
||||
box-sizing: border-box;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
v-uni-image {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
v-uni-image > div,
|
||||
v-uni-image > img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
v-uni-image > div {
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
v-uni-scroll-view {
|
||||
position: relative;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
v-uni-scroll-view[scroll-x],
|
||||
v-uni-scroll-view[scroll-y] {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
v-uni-swiper {
|
||||
position: relative;
|
||||
height: 150px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
v-uni-swiper-item {
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
v-uni-button {
|
||||
position: relative;
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding-left: 14px;
|
||||
padding-right: 14px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
line-height: 2.55555556;
|
||||
border-radius: 5px;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.bg-color-red {
|
||||
background-color: #E93323;
|
||||
}
|
||||
@@ -300,4 +388,4 @@
|
||||
height: 0;
|
||||
color: transparent;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
7
single_uniapp22miao/babel.config.js
Normal file
7
single_uniapp22miao/babel.config.js
Normal file
@@ -0,0 +1,7 @@
|
||||
module.exports = {
|
||||
presets: ['@vue/cli-plugin-babel/preset'],
|
||||
plugins: [
|
||||
'@babel/plugin-proposal-optional-chaining',
|
||||
'@babel/plugin-proposal-nullish-coalescing-operator'
|
||||
]
|
||||
}
|
||||
@@ -6,8 +6,8 @@
|
||||
// let domain = 'https://jfanyue.szxingming.com'
|
||||
// let domain = 'https://jf.wenjinhui.com'
|
||||
// let domain = 'https://jjy-jf.fwxgpt.com'
|
||||
// byhlc112 项目
|
||||
let domain = 'https://jf.h5y2c.com'
|
||||
// sqszx202 项目
|
||||
let domain = 'https://jf.j3s4s5.com'
|
||||
// let domain = 'https://jf.jinyawen.com'
|
||||
// let domain = 'https://jf.hapengran.com'
|
||||
// let domain = 'https://jjy-jf.uj345.com'
|
||||
@@ -19,7 +19,7 @@ module.exports = {
|
||||
// HTTP_REQUEST_URL:'',
|
||||
HTTP_REQUEST_URL: domain,
|
||||
// H5商城地址
|
||||
HTTP_H5_URL: 'https://jf.h5y2c.com',
|
||||
HTTP_H5_URL: 'https://jf.j3s4s5.com',
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
HTTP_REQUEST_URL:domain,
|
||||
|
||||
26958
single_uniapp22miao/package-lock.json
generated
26958
single_uniapp22miao/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -6,16 +6,30 @@
|
||||
"build": "vue-cli-service build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@dcloudio/uni-app": "^2.0.2-4080420251103001",
|
||||
"@dcloudio/uni-h5": "^2.0.2-4080420251103001",
|
||||
"@dcloudio/uni-stat": "^2.0.2-4080420251103001",
|
||||
"mp-html": "^2.5.0",
|
||||
"vue": "^3.5.24"
|
||||
"sass": "^1.69.5",
|
||||
"sass-loader": "^10.4.1",
|
||||
"vue": "^2.6.14",
|
||||
"vue-template-compiler": "^2.6.14",
|
||||
"vuex": "^3.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"cross-env": "^7.0.3",
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
|
||||
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
|
||||
"@dcloudio/uni-cli-i18n": "^2.0.2-4080420251103001",
|
||||
"@dcloudio/uni-cli-shared": "^2.0.2-4080420251103001",
|
||||
"@dcloudio/uni-i18n": "^2.0.2-4080420251103001",
|
||||
"@dcloudio/uni-migration": "^2.0.2-4080420251103001",
|
||||
"@dcloudio/uni-template-compiler": "^2.0.2-4080420251103001",
|
||||
"@dcloudio/vue-cli-plugin-uni": "^2.0.0",
|
||||
"@dcloudio/vue-cli-plugin-uni": "^2.0.2-4080420251103001",
|
||||
"@dcloudio/webpack-uni-pages-loader": "^2.0.2-4080420251103001",
|
||||
"@vue/cli-service": "^5.0.9"
|
||||
"@vue/cli-plugin-babel": "^4.5.19",
|
||||
"@vue/cli-service": "^4.5.19",
|
||||
"cross-env": "^7.0.3",
|
||||
"vue-loader": "^15.11.1",
|
||||
"webpack": "^4.46.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
pdfUrl: '/static/sign_contract_byhlc112.pdf',
|
||||
pdfUrl: '/static/sign_contract_sqszx202.pdf',
|
||||
userId: '',
|
||||
isMobile: false,
|
||||
usePdfJs: false,
|
||||
|
||||
@@ -634,12 +634,13 @@ export default {
|
||||
min-height: 100vh;
|
||||
background-color: #F8F8F8;
|
||||
padding-bottom: 20rpx;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
// 顶部橙色头部
|
||||
.header-section {
|
||||
background: linear-gradient(90deg, #FF6900 0%, #F54900 100%);
|
||||
padding: 60rpx 30rpx 60rpx 1px;
|
||||
padding: 60rpx 30rpx;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
margin-bottom: 1rpx;
|
||||
@@ -739,14 +740,34 @@ export default {
|
||||
font-weight: 600;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.banner-section {
|
||||
padding: 20rpx;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.banner-swiper {
|
||||
width: 100%;
|
||||
height: 260rpx;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.banner-image {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
// 分类导航
|
||||
.category-scroll {
|
||||
white-space: nowrap; font-size: 32rpx;
|
||||
white-space: nowrap;
|
||||
font-size: 32rpx;
|
||||
background-color: #FFFFFF;
|
||||
height: 108rpx; padding: 10rpx 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
border-bottom: 1px solid #EEEEEE;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.category-item {
|
||||
@@ -807,6 +828,7 @@ export default {
|
||||
}
|
||||
|
||||
.goods-image {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
@@ -910,6 +932,7 @@ export default {
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
background-color: #FFFFFF;
|
||||
display: flex;
|
||||
@@ -945,6 +968,7 @@ export default {
|
||||
}
|
||||
|
||||
.tab-icon {
|
||||
display: block;
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
// background-color: #CCCCCC; // Placeholder
|
||||
@@ -1039,6 +1063,7 @@ export default {
|
||||
}
|
||||
|
||||
.empty-image {
|
||||
display: block;
|
||||
width: 300rpx;
|
||||
height: 300rpx;
|
||||
}
|
||||
|
||||
@@ -343,12 +343,12 @@ export default {
|
||||
// window.location.href = 'https://shop.wenjinhui.com/?#/pages/personal/index'
|
||||
//window.location.href = 'https://anyue.szxingming.com/?#/pages/personal/index'
|
||||
// window.location.href = 'https://xiashengjun.com/?#/pages/personal/index'
|
||||
window.location.href = 'https://h5y2c.com/?#/pages/personal/index'
|
||||
window.location.href = 'https://j3s4s5.com/?#/pages/personal/index'
|
||||
// window.location.href = 'http://shop.bosenyuan.com/?#/pages/personal/index'
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
uni.navigateTo({
|
||||
url: '/pages/web-view/index?url=' + encodeURIComponent('https://h5y2c.com/?#/pages/personal/index')
|
||||
url: '/pages/web-view/index?url=' + encodeURIComponent('https://j3s4s5.com/?#/pages/personal/index')
|
||||
})
|
||||
// #endif
|
||||
},
|
||||
|
||||
@@ -16,7 +16,7 @@ export default {
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
const url = options && options.url ? decodeURIComponent(options.url) : '/static/sign_contract_byhlc112.pdf'
|
||||
const url = options && options.url ? decodeURIComponent(options.url) : '/static/sign_contract_sqszx202.pdf'
|
||||
this.pdfUrl = url
|
||||
},
|
||||
|
||||
|
||||
@@ -364,7 +364,7 @@ export default {
|
||||
// window.location.href = 'https://shop.wenjinhui.com/?#/pages/rushing/index' + (this.userId ? ('?user_id=' + this.userId) : '')
|
||||
// window.location.href = 'https://anyue.szxingming.com/?#/pages/rushing/index' + (this.userId ? ('?user_id=' + this.userId) : '')
|
||||
// window.location.href = 'https://xiashengjun.com/?#/pages/rushing/index' + (this.userId ? ('?user_id=' + this.userId) : '')
|
||||
window.location.href = 'https://h5y2c.com/?#/pages/rushing/index' + (this.userId ? ('?user_id=' + this.userId) : '')
|
||||
window.location.href = 'https://j3s4s5.com/?#/pages/rushing/index' + (this.userId ? ('?user_id=' + this.userId) : '')
|
||||
// window.location.href = 'https://shop.uj345.com/?#/pages/rushing/index' + (this.userId ? ('?user_id=' + this.userId) : '')
|
||||
}, 1000)
|
||||
// 返回签名信息给上一页面
|
||||
|
||||
36
single_uniapp22miao/postcss.config.js
Normal file
36
single_uniapp22miao/postcss.config.js
Normal file
@@ -0,0 +1,36 @@
|
||||
const postcss = require('postcss')
|
||||
const uniPostcss = require('@dcloudio/vue-cli-plugin-uni/packages/postcss')
|
||||
|
||||
function toVw(value) {
|
||||
return value.replace(/%\?([+-]?\d+(?:\.\d+)?)\?%/g, (match, number) => {
|
||||
const rpx = Number(number)
|
||||
if (!Number.isFinite(rpx)) {
|
||||
return match
|
||||
}
|
||||
const vw = Number((rpx / 7.5).toFixed(6)).toString()
|
||||
return vw === '0' ? '0' : `${vw}vw`
|
||||
})
|
||||
}
|
||||
|
||||
const rpxPlaceholderToVw = postcss.plugin('rpx-placeholder-to-vw', () => {
|
||||
return root => {
|
||||
root.walkDecls(decl => {
|
||||
if (decl.value && decl.value.includes('%?')) {
|
||||
decl.value = toVw(decl.value)
|
||||
}
|
||||
})
|
||||
|
||||
root.walkAtRules(atRule => {
|
||||
if (atRule.params && atRule.params.includes('%?')) {
|
||||
atRule.params = toVw(atRule.params)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
module.exports = {
|
||||
plugins: [
|
||||
uniPostcss(),
|
||||
rpxPlaceholderToVw()
|
||||
]
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
@font-face {
|
||||
font-family: 'dinProSemiBold';
|
||||
src: url('static/fonts/D-DIN-PRO-600-SemiBold.otf');
|
||||
src: url('./D-DIN-PRO-600-SemiBold.otf');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'dinProRegular';
|
||||
src: url('static/fonts/D-DIN-PRO-400-Regular.otf');
|
||||
src: url('./D-DIN-PRO-400-Regular.otf');
|
||||
}
|
||||
|
||||
.semiBold{
|
||||
@@ -16,4 +16,4 @@
|
||||
.pingFang{
|
||||
font-family: 'PingFang SC, PingFang SC';
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,56 @@
|
||||
(function() {
|
||||
var iframe = document.getElementById('iframe');
|
||||
|
||||
function safeDecode(value) {
|
||||
try {
|
||||
return decodeURIComponent((value || '').replace(/\+/g, ' '));
|
||||
} catch (e) {
|
||||
return value || '';
|
||||
}
|
||||
}
|
||||
|
||||
function buildQuery(params) {
|
||||
var pairs = [];
|
||||
for (var key in params) {
|
||||
if (!Object.prototype.hasOwnProperty.call(params, key)) {
|
||||
continue;
|
||||
}
|
||||
if (params[key] === undefined || params[key] === null || params[key] === '') {
|
||||
continue;
|
||||
}
|
||||
pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(params[key]));
|
||||
}
|
||||
return pairs.join('&');
|
||||
}
|
||||
|
||||
function parseQuery(query, ignoredKey) {
|
||||
var result = {
|
||||
params: {},
|
||||
ignoredValue: ''
|
||||
};
|
||||
if (!query) {
|
||||
return result;
|
||||
}
|
||||
var pairs = query.split('&');
|
||||
for (var i = 0; i < pairs.length; i++) {
|
||||
if (!pairs[i]) {
|
||||
continue;
|
||||
}
|
||||
var pair = pairs[i].split('=');
|
||||
var key = safeDecode(pair[0]);
|
||||
var value = pair.length > 1 ? safeDecode(pair.slice(1).join('=')) : '';
|
||||
if (!key) {
|
||||
continue;
|
||||
}
|
||||
if (key === ignoredKey) {
|
||||
result.ignoredValue = result.ignoredValue || value;
|
||||
continue;
|
||||
}
|
||||
result.params[key] = value;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// 获取URL参数
|
||||
function getUrlParams() {
|
||||
var params = {};
|
||||
@@ -51,35 +101,79 @@
|
||||
var pairs = search.split('&');
|
||||
for (var i = 0; i < pairs.length; i++) {
|
||||
var pair = pairs[i].split('=');
|
||||
params[decodeURIComponent(pair[0])] = pair[1] ? decodeURIComponent(pair[1]) : '';
|
||||
var key = safeDecode(pair[0]);
|
||||
if (!key) {
|
||||
continue;
|
||||
}
|
||||
params[key] = pair.length > 1 ? safeDecode(pair.slice(1).join('=')) : '';
|
||||
}
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
function normalizeHash(rawHash, username) {
|
||||
var hash = rawHash || '';
|
||||
if (hash.charAt(0) === '#') {
|
||||
hash = hash.substring(1);
|
||||
}
|
||||
if (!hash && !username) {
|
||||
return '';
|
||||
}
|
||||
|
||||
var questionIndex = hash.indexOf('?');
|
||||
var path = questionIndex >= 0 ? hash.substring(0, questionIndex) : hash;
|
||||
var query = questionIndex >= 0 ? hash.substring(questionIndex + 1) : '';
|
||||
var parsed = parseQuery(query, 'username');
|
||||
var finalUsername = username || parsed.ignoredValue;
|
||||
|
||||
if (!path) {
|
||||
path = '/pages/integral/index';
|
||||
}
|
||||
if (finalUsername) {
|
||||
parsed.params.username = finalUsername;
|
||||
}
|
||||
|
||||
var queryString = buildQuery(parsed.params);
|
||||
return '#' + path + (queryString ? '?' + queryString : '');
|
||||
}
|
||||
|
||||
function removeHashParam(rawHash, key) {
|
||||
var hash = rawHash || '';
|
||||
if (hash.charAt(0) === '#') {
|
||||
hash = hash.substring(1);
|
||||
}
|
||||
if (!hash) {
|
||||
return '';
|
||||
}
|
||||
|
||||
var questionIndex = hash.indexOf('?');
|
||||
var path = questionIndex >= 0 ? hash.substring(0, questionIndex) : hash;
|
||||
var query = questionIndex >= 0 ? hash.substring(questionIndex + 1) : '';
|
||||
var parsed = parseQuery(query, key);
|
||||
var queryString = buildQuery(parsed.params);
|
||||
return '#' + path + (queryString ? '?' + queryString : '');
|
||||
}
|
||||
|
||||
function getParentHashFromIframe(iframeHash) {
|
||||
var params = getUrlParams();
|
||||
if (params.username) {
|
||||
return removeHashParam(iframeHash, 'username');
|
||||
}
|
||||
return normalizeHash(iframeHash, '');
|
||||
}
|
||||
|
||||
function updateParentUrl(iframeHash) {
|
||||
var parentHash = getParentHashFromIframe(iframeHash);
|
||||
if (parentHash && window.location.hash !== parentHash) {
|
||||
history.replaceState(null, '', window.location.search + parentHash);
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化:根据父页面URL设置iframe的src
|
||||
function initIframeSrc() {
|
||||
var params = getUrlParams();
|
||||
var hash = window.location.hash;
|
||||
var iframeSrc = '/';
|
||||
|
||||
// 如果父页面有hash,传递给iframe
|
||||
if (hash) {
|
||||
iframeSrc = '/' + hash;
|
||||
}
|
||||
|
||||
// 如果有username参数,附加到iframe URL
|
||||
if (params.username) {
|
||||
var separator = iframeSrc.includes('?') ? '&' : (iframeSrc.includes('#') ? (iframeSrc.includes('?') ? '&' : '?') : '?');
|
||||
// 对于hash模式,参数需要放在hash后面
|
||||
if (hash) {
|
||||
iframeSrc = iframeSrc + (iframeSrc.includes('?') ? '&' : '?') + 'username=' + encodeURIComponent(params.username);
|
||||
} else {
|
||||
iframeSrc = '/#/pages/integral/index?username=' + encodeURIComponent(params.username);
|
||||
}
|
||||
}
|
||||
|
||||
iframe.src = iframeSrc;
|
||||
var iframeHash = normalizeHash(window.location.hash, params.username);
|
||||
iframe.src = iframeHash ? '/' + iframeHash : '/';
|
||||
}
|
||||
|
||||
// 监听iframe内部路由变化,同步到父页面URL
|
||||
@@ -90,19 +184,12 @@
|
||||
// 监听iframe的hashchange事件
|
||||
iframeWindow.addEventListener('hashchange', function() {
|
||||
var iframeHash = iframeWindow.location.hash;
|
||||
if (iframeHash && window.location.hash !== iframeHash) {
|
||||
// 保留原有的search参数
|
||||
var currentSearch = window.location.search;
|
||||
history.replaceState(null, '', currentSearch + iframeHash);
|
||||
}
|
||||
updateParentUrl(iframeHash);
|
||||
});
|
||||
|
||||
// 初始同步
|
||||
var iframeHash = iframeWindow.location.hash;
|
||||
if (iframeHash && window.location.hash !== iframeHash) {
|
||||
var currentSearch = window.location.search;
|
||||
history.replaceState(null, '', currentSearch + iframeHash);
|
||||
}
|
||||
updateParentUrl(iframeHash);
|
||||
} catch (e) {
|
||||
console.log('无法访问iframe内容(可能跨域):', e);
|
||||
}
|
||||
@@ -111,11 +198,12 @@
|
||||
// 监听父页面hash变化,同步到iframe
|
||||
window.addEventListener('hashchange', function() {
|
||||
try {
|
||||
var parentHash = window.location.hash;
|
||||
var params = getUrlParams();
|
||||
var parentHash = normalizeHash(window.location.hash, params.username);
|
||||
var iframeHash = iframe.contentWindow.location.hash;
|
||||
|
||||
if (parentHash !== iframeHash) {
|
||||
iframe.contentWindow.location.hash = parentHash;
|
||||
iframe.contentWindow.location.hash = parentHash || '#/pages/integral/index';
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('无法同步hash到iframe:', e);
|
||||
@@ -130,10 +218,7 @@
|
||||
setInterval(function() {
|
||||
try {
|
||||
var iframeHash = iframe.contentWindow.location.hash;
|
||||
if (iframeHash && window.location.hash !== iframeHash) {
|
||||
var currentSearch = window.location.search;
|
||||
history.replaceState(null, '', currentSearch + iframeHash);
|
||||
}
|
||||
updateParentUrl(iframeHash);
|
||||
} catch (e) {}
|
||||
}, 500);
|
||||
};
|
||||
@@ -143,12 +228,8 @@
|
||||
if (window.innerWidth <= 420) {
|
||||
// 小屏幕直接跳转到应用
|
||||
var params = getUrlParams();
|
||||
var targetUrl = '/';
|
||||
if (params.username) {
|
||||
targetUrl = '/#/pages/integral/index?username=' + encodeURIComponent(params.username);
|
||||
} else if (window.location.hash) {
|
||||
targetUrl = '/' + window.location.hash;
|
||||
}
|
||||
var targetHash = normalizeHash(window.location.hash, params.username);
|
||||
var targetUrl = targetHash ? '/' + targetHash : '/';
|
||||
window.location.href = targetUrl;
|
||||
}
|
||||
};
|
||||
|
||||
BIN
single_uniapp22miao/static/sign_contract_sqszx202.pdf
Normal file
BIN
single_uniapp22miao/static/sign_contract_sqszx202.pdf
Normal file
Binary file not shown.
Reference in New Issue
Block a user