24836dd1775b36ac260ec12068d1b303aec40460..4a45efcec76cbe047d069aef04e315082ff0775d
2026-10-12 Jacob
Merge branch 'master' into sit
4a45ef 对比 | 目录
2026-10-12 Jacob
refactor: 消耗明细入口从 yueyangZone 组件迁移至专区页面
df2f69 对比 | 目录
2026-10-12 Jacob
Merge branch 'master' into sit
254f05 对比 | 目录
2026-10-12 Jacob
refactor: 移除跳转小程序注释代码并统一活动页环境配置
02b1ce 对比 | 目录
2026-10-12 Jacob
Merge branch 'master' into sit
0f9368 对比 | 目录
2026-10-12 Jacob
fix: cate
aba815 对比 | 目录
2026-10-12 Jacob
feat: sit首页及专区页面
85aed6 对比 | 目录
2026-10-12 Jacob
fix: --no-open 时不再拼接微信开发者工具 open 命令
504d4d 对比 | 目录
2026-10-12 Jacob
fix: manifest 生成时忽略行尾差异避免无意义重写
bea121 对比 | 目录
2026-10-12 Jacob
refactor: 精简 bat 脚本输出提示
52016c 对比 | 目录
2026-10-12 Jacob
feat: manifest.json 改为由 manifest.json.demo 生成
486450 对比 | 目录
2026-10-12 Jacob
ignore manifest.json
731c4d 对比 | 目录
2026-10-12 Jacob
feat: 发布脚本自动查找 HBuilderX / 微信开发者工具路径
486ac7 对比 | 目录
2026-10-12 Jacob
移除不需要的文件
4a4bc7 对比 | 目录
2026-10-12 Jacob
发布
7a4d39 对比 | 目录
2026-10-12 Jacob
环境切换方案
61274a 对比 | 目录
2026-10-12 Jacob
feat: 统一一下测试环境能上生产的部分
cf6683 对比 | 目录
2026-10-12 Jacob
revert: 调整
a935c1 对比 | 目录
2026-10-12 Jacob
del: .hbuilder
a7e7b3 对比 | 目录
3个文件已删除
11个文件已添加
18个文件已修改
1 文件已重命名
6644 ■■■■■ 已修改文件
.gitignore 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.hbuilderx/launch.json 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BAT使用说明.md 133 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/personalAndShareCoupon/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/personalAndShareCoupon/rule.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/popActivity/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/popCoupon/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/popVideo/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/productWindow/index.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/yueyangZone/index.vue 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/app.js 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/env/index.js 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/env/prod.js 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/env/sit.js 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
libs/routine.js 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manifest.json.demo 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package.json 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/goods_cate/goods_cate.vue 203 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index/index.vue 5310 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/order_pay_status/index.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/user/index.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/users/order_confirm/index.vue 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/users/user_coupon/index.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/zone/index.vue 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
project.config.json 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
publish-prod.bat 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
publish-sit.bat 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
scripts/manifest.js 122 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
scripts/publish.js 312 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
scripts/set-env.js 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
switch-prod.bat 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
switch-sit.bat 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
需要修改的配置文件.txt 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.gitignore
....@@ -2,7 +2,7 @@
22 node_modules
33 /dist
44
5
-# local env files
5
+# 本地环境文件
66 .env.local
77 .env.*.local
88
....@@ -21,4 +21,8 @@
2121 *.sw?
2222 build.sh
2323 .idea
24
-unpackage
24
+unpackage
25
+/.hbuilderx
26
+# 根目录 project.config.json 不参与 mp-weixin 编译(小程序 appid 由 scripts/publish.js 写入产物)
27
+project.config.json
28
+/manifest.json
.hbuilderx/launch.json
deleted file mode 100644
....@@ -1,24 +0,0 @@
1
-{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
2
- // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
3
- "version": "0.0",
4
- "configurations": [{
5
- "app-plus" :
6
- {
7
- "launchtype" : "remote"
8
- },
9
- "default" :
10
- {
11
- "launchtype" : "remote"
12
- },
13
- "h5" :
14
- {
15
- "launchtype" : "remote"
16
- },
17
- "mp-weixin" :
18
- {
19
- "launchtype" : "remote"
20
- },
21
- "type" : "uniCloud"
22
- }
23
- ]
24
-}
BAT使用说明.md
....@@ -0,0 +1,133 @@
1
+# 4 个 bat 使用说明
2
+
3
+项目根目录下 4 个双击即用的批处理,按用途分两类:
4
+
5
+| 我想做的事 | 用哪个 bat |
6
+| --- | --- |
7
+| 出小程序发行版,并自动在微信开发者工具里打开 | `publish-sit.bat`(测试)/ `publish-prod.bat`(生产) |
8
+| 在 HBuilderX 里「运行 → 运行到小程序模拟器」调试 | 先切环境:`switch-sit.bat` / `switch-prod.bat` |
9
+
10
+> 一句话区分:`publish-*` 产出 `unpackage/dist/build/mp-weixin` 发行产物,编译期 appid 由脚本注入,**不改仓库里的任何文件**;`switch-*` 改的是 HBuilderX 的编译输入 `manifest.json`,供 GUI 编译/调试用。
11
+
12
+---
13
+
14
+## 1. 一次性前提
15
+
16
+1. Node.js(命令行 `node -v` 可用)
17
+2. HBuilderX(提供命令行 `cli.exe`)
18
+3. 微信开发者工具,且 **设置 → 安全设置 → 服务端口 = 开启**(不开时 `cli.bat open` 会失败,脚本会降级提示你手动导入)
19
+
20
+**工具路径不需要配置**,脚本按顺序自动查找,命中后把所在目录加入本次进程的 `PATH`(便于按名字直接调用):
21
+
22
+1. 环境变量 `HBUILDERX_CLI` / `WX_DEVTOOLS_CLI`
23
+2. 系统 `PATH`
24
+3. 常见安装目录(`Program Files`、`Program Files (x86)`、用户目录、桌面、下载、各磁盘常见软件目录…)
25
+4. 磁盘浅层扫描(≤2 层,只扫本地固定磁盘,跳过系统目录)
26
+
27
+找不到时直接报错并给出办法:
28
+
29
+```bat
30
+set PATH=%PATH%;<HBuilderX 或 微信开发者工具 的安装目录>
31
+set HBUILDERX_CLI=<HBuilderX cli.exe 完整路径>
32
+set WX_DEVTOOLS_CLI=<微信开发者工具 cli.bat 完整路径>
33
+```
34
+
35
+---
36
+
37
+## 2. publish-sit.bat / publish-prod.bat
38
+
39
+双击 = 发行并自动打开。实际执行 4 步:
40
+
41
+| 步骤 | 做什么 | 具体命令 |
42
+| --- | --- | --- |
43
+| 0 | 生成 `manifest.json`(模板 `manifest.json.demo` + 该环境 appid) | 内置逻辑 |
44
+| 1 | HBuilderX CLI 发行编译 | `cli.exe publish --platform mp-weixin --project <项目根>` |
45
+| 2 | 回写产物 appid(兜底校正) | 写入 `unpackage/dist/build/mp-weixin/project.config.json` |
46
+| 3 | 微信开发者工具 CLI 打开产物 | `cli.bat open --project <产物目录>` |
47
+
48
+- 发行产物:`unpackage/dist/build/mp-weixin`
49
+- 编译日志在 **HBuilderX 控制台**里看
50
+- 任一步失败,窗口会打印 `[FAILED] ...`(退出码非 0)
51
+
52
+### 可加的参数(`%*` 原样传给 `scripts/publish.js`)
53
+
54
+| 参数 | 作用 |
55
+| --- | --- |
56
+| `--dry-run` | 只打印将要执行的命令,不做任何写操作 |
57
+| `--no-open` | 只编译,不打开微信开发者工具(此种情况不要求安装开发者工具) |
58
+| `--no-gen` | 跳过生成 `manifest.json`(要求它已存在;适合你手工维护 manifest 的场景) |
59
+| 其他参数 | 原样透传给 HBuilderX cli |
60
+
61
+用法示例(在命令行窗口里):
62
+
63
+```bat
64
+publish-sit.bat --dry-run
65
+publish-prod.bat --no-open
66
+```
67
+
68
+等价命令:`npm run release:sit` / `npm run release:prod` / `node scripts/publish.js sit`
69
+
70
+---
71
+
72
+## 3. switch-sit.bat / switch-prod.bat
73
+
74
+双击 = 按该环境重新生成 `manifest.json`(`manifest.json.demo` + 该环境 appid)。
75
+
76
+- 等价命令:`npm run env:sit` / `npm run env:prod` / `node scripts/set-env.js sit`
77
+- **切完必须做两件事**:① 在 HBuilderX 里重新编译一次;② 在微信开发者工具里重新打开该项目(appid 变更需重开)
78
+- 幂等:内容已一致时提示「无需重写」,可放心重复双击
79
+- 适用场景:在 HBuilderX GUI 里直接运行/调试(编译期 appid 取自 `manifest.json`),或需要出 App 包(顶层 DCloud appid)
80
+
81
+### 两个环境的取值
82
+
83
+| 环境 | 小程序 appid(`mp-weixin.appid`) | DCloud appid(顶层) | 接口地址 |
84
+| --- | --- | --- | --- |
85
+| sit | `wx7e443c60d08449de` | `__UNI__3D0C5FE` | `https://sit.tohours.com/crmeb/front` |
86
+| prod | `wx15d029cdf2e92a9f` | `__UNI__CE0C605` | `https://acmall.bluedeer.com.cn/crmeb/front` |
87
+
88
+数据源:`config/env/sit.js`、`config/env/prod.js`(唯一数据源,改这两处即可,两个文件键名保持一致)。
89
+
90
+---
91
+
92
+## 4. 为什么跑完 git 是干净的
93
+
94
+`manifest.json` 是**生成物**,`project.config.json` 与 `unpackage/` 已忽略:
95
+
96
+```
97
+manifest.json.demo(入库,模板) ──注入环境 appid──▶ manifest.json(已忽略,不入库)
98
+```
99
+
100
+所以发行、切环境都不会产生 git 改动,`git status` 只会有你自己改的源码。
101
+
102
+两点注意:
103
+
104
+1. 新 clone 的机器**没有 `manifest.json`,HBuilderX 打不开项目** —— 先跑一次 `switch-sit.bat`(或任意 `publish-*.bat`)把它生成出来。
105
+2. 在 HBuilderX GUI 里直接改的 manifest 配置落在**生成物**上,下次生成会被模板内容覆盖(脚本会打印警告)。需要长期保留的改动,请写进 `manifest.json.demo`。
106
+
107
+---
108
+
109
+## 5. 接口地址为什么自动对得上
110
+
111
+`config/env/index.js` 的识别顺序:手动 `OVERRIDE_ENV` > 小程序 appid 自动识别 > H5 域名识别 > 默认 prod,对外导出 `ENV_NAME` / `IS_SIT` / `IS_PROD`。
112
+
113
+也就是「用哪个 appid 编译」就等于「用哪套接口」,不会出现接口与环境错配 —— 你只需要选对 bat。
114
+
115
+---
116
+
117
+## 6. 常见问题
118
+
119
+| 现象 | 处理 |
120
+| --- | --- |
121
+| 窗口报 `'…' is not recognized as an internal or external command` 且带中文乱码 | bat 内混用 UTF-8 中文时,cmd 按代码页解析会错位。现在 4 个 bat **全部是 ASCII**,中文提示由 Node 打印。自己改 bat 时不要加中文,要加就用 Node 输出 |
122
+| `未找到 HBuilderX 命令行 cli.exe` / `未找到微信开发者工具命令行 cli.bat` | 按报错里的两种办法处理:加 `PATH` 或设对应环境变量(见第 1 节) |
123
+| 自动打开失败,提示未开启服务端口 | 开发者工具 → 设置 → 安全设置 → 打开服务端口;或手动「导入项目」选 `unpackage\dist\build\mp-weixin` |
124
+| 开发者工具里 appid 还是旧的 | appid 变更后需要在工具里**重新打开**该项目 |
125
+| `--no-gen 需要 manifest.json 已存在` | 先跑一次 `switch-*.bat`,或去掉 `--no-gen` |
126
+| `cli.exe 退出码 …` | 编译失败,看 HBuilderX 控制台里的具体报错 |
127
+
128
+---
129
+
130
+## 7. 附注
131
+
132
+- 4 个 bat 都会先 `cd /d "%~dp0"`,所以在任意目录双击或命令行调用都不会跑错位置;末尾 `pause` 方便双击后查看输出。
133
+- 微信开发者工具生成的 `project.private.config.json` 目前仍入库(未被忽略)。若想连它一起做到零噪音,可自行加入 `.gitignore` 并执行 `git rm --cached project.private.config.json`。
components/personalAndShareCoupon/index.vue
....@@ -409,7 +409,7 @@
409409 .box {
410410 width: 600rpx;
411411 padding: 90rpx 0 70rpx 0;
412
- background: url("https://ossacmall.bluedeer.com.cn/app/static/images/confirm_bg.png") center 0rpx/100% auto no-repeat;
412
+ background: url("https://ossacmall.bluedeer.com.cn/app/static/images/confirm_bg.png") center 0rpx / 100% auto no-repeat;
413413 background-color: #f5f5f5;
414414 position: absolute;
415415 left: 50%;
components/personalAndShareCoupon/rule.vue
....@@ -55,7 +55,7 @@
5555 .box {
5656 width: 600rpx;
5757 padding: 90rpx 0 70rpx 0;
58
- background: url("https://ossacmall.bluedeer.com.cn/app/static/images/confirm_bg.png") center -50rpx/100% auto no-repeat;
58
+ background: url("https://ossacmall.bluedeer.com.cn/app/static/images/confirm_bg.png") center -50rpx / 100% auto no-repeat;
5959 background-color: #f5f5f5;
6060 position: absolute;
6161 left: 50%;
components/popActivity/index.vue
....@@ -138,7 +138,7 @@
138138 .box {
139139 width: 600rpx;
140140 padding: 90rpx 0 70rpx 0;
141
- background: url("https://ossacmall.bluedeer.com.cn/app/static/images/confirm_bg.png") center 0rpx/100% auto no-repeat;
141
+ background: url("https://ossacmall.bluedeer.com.cn/app/static/images/confirm_bg.png") center 0rpx / 100% auto no-repeat;
142142 background-color: #f5f5f5;
143143 position: absolute;
144144 left: 50%;
components/popCoupon/index.vue
....@@ -322,7 +322,7 @@
322322 .box {
323323 width: 600rpx;
324324 padding: 90rpx 0 70rpx 0;
325
- background: url("https://ossacmall.bluedeer.com.cn/app/static/images/confirm_bg.png") center -120rpx/100% auto no-repeat;
325
+ background: url("https://ossacmall.bluedeer.com.cn/app/static/images/confirm_bg.png") center -120rpx / 100% auto no-repeat;
326326 background-color: #f5f5f5;
327327 position: absolute;
328328 left: 50%;
components/popVideo/index.vue
....@@ -131,7 +131,7 @@
131131
132132 .box {
133133 padding: 90rpx 0 70rpx 0;
134
- background: url("https://ossacmall.bluedeer.com.cn/app/static/images/confirm_bg.png") center 320rpx/100% auto no-repeat;
134
+ background: url("https://ossacmall.bluedeer.com.cn/app/static/images/confirm_bg.png") center 320rpx / 100% auto no-repeat;
135135 background-color: #f5f5f5;
136136 position: relative;
137137 border-radius: 14rpx;
components/productWindow/index.vue
....@@ -186,19 +186,6 @@
186186 path: url,
187187 envVersion: miniProgramInfo.envVersion == 'release' ? 'release' : 'trial',
188188 })
189
-
190
- // let params = {
191
- // custAgentNo: that.$store.getters.belong?.agentNo || '',
192
- // custAgentChnl: that.$store.getters.belong?.channel || '',
193
- // custAgentCoy: that.$store.getters.belong?.companyCode || '',
194
- // custAgentBranch: that.$store.getters.belong?.branchCode || '',
195
- // custAgentOrgNo: that.$store.getters.belong?.subCode || ''
196
- // };
197
- // let webUrl = 'https://ossacmall.bluedeer.com.cn/qr/index.html?isMall=true' + (miniProgramInfo.envVersion == 'release' ? '' : '&isTrial=true') + '&params=' + encodeURIComponent(JSON.stringify(params)) + '&pageUrl=' + encodeURIComponent(url);
198
- // if (HTTP_REQUEST_URL.indexOf('tohours') > 0) {
199
- // webUrl = webUrl.replace('https://ossacmall.bluedeer.com.cn/qr', 'https://sit.tohours.com/crmeb_web/qr/')
200
- // }
201
- // uni.navigateTo({ url: '/pages/users/web_page/index?webUel=' + encodeURIComponent(webUrl) })
202189 }
203190 if (!that.$store.getters.isLogin) {
204191 toLogin(that);
components/yueyangZone/index.vue
....@@ -9,13 +9,10 @@
99 </view>
1010 </view>
1111 <view class="points-right">
12
- <image src="https://ossacmall.bluedeer.com.cn/app/static/images/yueyang_jifen.png" class="lottery-btn" mode="widthFix"
13
- @click="goLottery"></image>
14
- </view>
15
- <view class="detail-btn" @click="goDetail">
16
- <text>消耗明细</text>
17
- </view>
18
- </view>
12
+ <image src="https://ossacmall.bluedeer.com.cn/app/static/images/yueyang_jifen.png" class="lottery-btn" mode="widthFix"
13
+ @click="goLottery"></image>
14
+ </view>
15
+ </view>
1916
2017 <!-- 优惠券兑换区 -->
2118 <view class="coupon-area">
....@@ -133,11 +130,6 @@
133130 },
134131 onShow() {},
135132 methods: {
136
- goDetail() {
137
- uni.navigateTo({
138
- url: '/pages/consumption/index?zoneId=' + this.zoneInfo.id
139
- })
140
- },
141133 goLottery() {
142134 this.$emit('goLottery')
143135 },
....@@ -322,20 +314,7 @@
322314 height: 57rpx;
323315 }
324316
325
- .detail-btn {
326
- border: 2rpx solid #fff;
327
- /* border-radius: 10rpx; */
328
- border-top-left-radius: 20rpx;
329
- border-bottom-left-radius: 20rpx;
330
- padding: 10rpx;
331
- background-color: #daf2b2;
332
- color: #1e984f;
333
- width: 50rpx;
334
- position: fixed;
335
- top: 200rpx;
336
- right: 0rpx;
337
- line-height: 1rem;
338
- }
317
+
339318
340319 .coupon-area {
341320 display: flex;
config/app.js
....@@ -7,31 +7,12 @@
77 // +----------------------------------------------------------------------
88 // | Author: CRMEB Team <admin@crmeb.com>
99 // +----------------------------------------------------------------------
10
-//移动端商城API
11
-let domain = 'https://acmall.bluedeer.com.cn/crmeb/front'
1210
13
-module.exports = {
14
- // 请求域名 格式: https://您的域名
15
- HTTP_REQUEST_URL:domain,
16
-
17
- // #ifdef MP
18
- HTTP_REQUEST_URL: domain,
19
- // #endif
20
- HTTP_REQUEST_URL:'https://acmall.bluedeer.com.cn/crmeb/front',
21
- HTTP_ADMIN_URL:'https://acmall.bluedeer.com.cn/crmeb/admin',
22
- APPID:'wx15d029cdf2e92a9f',
23
- GDP_ACCOUNT_ID:'8672f93377575ace',
24
- GDP_DATASOURCE_ID:'b01182b2d4f73e45',
25
- GDP_SERVER_URL:'https://giocollect.aviva-cofco.com.cn',
26
- GDP_DEBUG:true,
27
- THIRD_APPID:'wxa83daa550324ead8',
28
- // #ifdef H5
29
- //H5接口是浏览器地址
30
- // HTTP_REQUEST_URL: window.location.protocol+"//"+window.location.host,
31
- // http://api.java.crmeb.net:20001
32
- HTTP_REQUEST_URL:domain,
33
- // #endif
34
-
11
+// 环境相关参数(HTTP_REQUEST_URL/HTTP_ADMIN_URL/APPID/THIRD_APPID/GDP_* 等)
12
+// 统一维护在 config/env/ 下,本文件只做合并,对外导出名保持不变
13
+const env = require('./env');
14
+
15
+module.exports = Object.assign({}, env, {
3516 HEADER:{
3617 'content-type': 'application/json'
3718 },
....@@ -44,4 +25,4 @@
4425 EXPIRE:0,
4526 //分页最多显示条数
4627 LIMIT: 10
47
-};
28
+});
config/env/index.js
....@@ -0,0 +1,49 @@
1
+// +----------------------------------------------------------------------
2
+// | 环境选择入口:一套代码跑多环境
3
+// | 识别优先级:手动指定 > 小程序 appid 自动识别 > H5 域名识别 > 默认 prod
4
+// | 说明:小程序 appid 由 manifest.json -> mp-weixin.appid 决定,
5
+// | 所以“用哪个 appid 跑”就等于“用哪套接口”,不会出现接口与环境错配
6
+// +----------------------------------------------------------------------
7
+const envs = {
8
+ prod: require('./prod.js'),
9
+ sit: require('./sit.js')
10
+};
11
+
12
+// 手动强制指定环境:'' = 自动识别(推荐);也可填 'prod' 或 'sit'
13
+const OVERRIDE_ENV = '';
14
+
15
+// appid -> 环境名 映射
16
+const APPID_ENV_MAP = {};
17
+Object.keys(envs).forEach(function(key) {
18
+ APPID_ENV_MAP[envs[key].APPID] = key;
19
+});
20
+
21
+function detectEnv() {
22
+ if (OVERRIDE_ENV && envs[OVERRIDE_ENV]) return OVERRIDE_ENV;
23
+
24
+ // #ifdef MP
25
+ try {
26
+ const info = uni.getAccountInfoSync();
27
+ const appId = info && info.miniProgram && info.miniProgram.appId;
28
+ if (appId && APPID_ENV_MAP[appId]) return APPID_ENV_MAP[appId];
29
+ } catch (e) {}
30
+ // #endif
31
+
32
+ // #ifdef H5
33
+ if (typeof location !== 'undefined' && location.hostname) {
34
+ const host = location.hostname;
35
+ if (/sit|tohours|localhost|127\.0\.0\.1/.test(host)) return 'sit';
36
+ }
37
+ // #endif
38
+
39
+ return 'prod';
40
+}
41
+
42
+const ENV_NAME = detectEnv();
43
+const current = envs[ENV_NAME] || envs.prod;
44
+
45
+module.exports = Object.assign({}, current, {
46
+ ENV_NAME: ENV_NAME,
47
+ IS_PROD: ENV_NAME === 'prod',
48
+ IS_SIT: ENV_NAME === 'sit'
49
+});
config/env/prod.js
....@@ -0,0 +1,23 @@
1
+// +----------------------------------------------------------------------
2
+// | 生产环境(PROD)参数
3
+// | 注意:新增环境参数时,请同步维护 prod.js 与 sit.js,保持键名完全一致
4
+// +----------------------------------------------------------------------
5
+module.exports = {
6
+ ENV_NAME: 'prod',
7
+ // 请求域名
8
+ HTTP_REQUEST_URL: 'https://acmall.bluedeer.com.cn/crmeb/front',
9
+ HTTP_ADMIN_URL: 'https://acmall.bluedeer.com.cn/crmeb/admin',
10
+ // 微信小程序 appid(需与 manifest.json -> mp-weixin.appid 保持一致)
11
+ APPID: 'wx15d029cdf2e92a9f',
12
+ // 跳转关联小程序 appid
13
+ THIRD_APPID: 'wxa83daa550324ead8',
14
+ // GrowingIO 埋点
15
+ GDP_ACCOUNT_ID: '8672f93377575ace',
16
+ GDP_DATASOURCE_ID: 'b01182b2d4f73e45',
17
+ GDP_SERVER_URL: 'https://giocollect.aviva-cofco.com.cn',
18
+ GDP_DEBUG: true,
19
+ // 活动页/内嵌 web 资源地址(替代代码里按域名判断环境)
20
+ WEB_ACTIVITY_BASE: 'https://ossacmall.bluedeer.com.cn',
21
+ // DCloud 应用标识(需与 manifest.json -> appid 保持一致)
22
+ UNI_APPID: '__UNI__CE0C605'
23
+};
config/env/sit.js
....@@ -0,0 +1,23 @@
1
+// +----------------------------------------------------------------------
2
+// | 测试环境(SIT)参数
3
+// | 注意:新增环境参数时,请同步维护 prod.js 与 sit.js,保持键名完全一致
4
+// +----------------------------------------------------------------------
5
+module.exports = {
6
+ ENV_NAME: 'sit',
7
+ // 请求域名
8
+ HTTP_REQUEST_URL: 'https://sit.tohours.com/crmeb/front',
9
+ HTTP_ADMIN_URL: 'https://sit.tohours.com/crmeb/admin',
10
+ // 微信小程序 appid(需与 manifest.json -> mp-weixin.appid 保持一致)
11
+ APPID: 'wx7e443c60d08449de',
12
+ // 跳转关联小程序 appid
13
+ THIRD_APPID: 'wx64d2ecbbeb3eae79',
14
+ // GrowingIO 埋点
15
+ GDP_ACCOUNT_ID: '83b2522b4d9c972a',
16
+ GDP_DATASOURCE_ID: 'a1616a9a748d2c7f',
17
+ GDP_SERVER_URL: 'https://collecttest.aviva-cofco.com.cn',
18
+ GDP_DEBUG: true,
19
+ // 活动页/内嵌 web 资源地址(替代代码里按域名判断环境)
20
+ WEB_ACTIVITY_BASE: 'https://sit.tohours.com/crmeb_web',
21
+ // DCloud 应用标识(需与 manifest.json -> appid 保持一致)
22
+ UNI_APPID: '__UNI__3D0C5FE'
23
+};
libs/routine.js
....@@ -87,6 +87,7 @@
8787 uni.login({
8888 provider: provider,
8989 success(res) {
90
+ console.log(uni.login,res);
9091 if (res.code) Cache.set(STATE_R_KEY, res.code, 10800);
9192 return resolve(res.code);
9293 },
manifest.json
similarity index 98%rename from manifest.jsonrename to manifest.json.demo
....@@ -1,6 +1,6 @@
11 {
22 "name" : "CRMEB Java 商城",
3
- "appid" : "__UNI__CE0C605",
3
+ "appid" : "__UNI__3D0C5FE",
44 "description" : "CRMEB Java 商城",
55 "versionName" : "1.0.0",
66 "versionCode" : 1001,
....@@ -123,7 +123,7 @@
123123 "quickapp" : {},
124124 /* 小程序特有相关 */
125125 "mp-weixin" : {
126
- "appid" : "wx15d029cdf2e92a9f",
126
+ "appid" : null,
127127 "setting" : {
128128 "urlCheck" : true,
129129 "minified" : true,
package.json
....@@ -1,4 +1,10 @@
11 {
2
+ "scripts": {
3
+ "env:prod": "node scripts/set-env.js prod",
4
+ "env:sit": "node scripts/set-env.js sit",
5
+ "release:sit": "node scripts/publish.js sit",
6
+ "release:prod": "node scripts/publish.js prod"
7
+ },
28 "dependencies": {
39 "bignumber.js": "^9.3.1",
410 "vue-inset-loader": "^1.2.6"
pages/goods_cate/goods_cate.vue
....@@ -13,7 +13,7 @@
1313 <scroll-view scroll-y="true" scroll-with-animation='true'
1414 :style="{height: (height-280/750*windowWidth) + 'px'}" :scroll-into-view="'menu_item'+navActive">
1515 <view class='item acea-row row-center-wrapper menu_item' :id="'menu_item'+index"
16
- :class='index==navActive?"on":""' v-for="(item,index) in categoryList" :key="item._key"
16
+ :class='index==navActive?"on":""' v-for="(item,index) in categoryList" :key="index"
1717 @click='tap(index,"b"+index)'>
1818 <image v-if="item.extra" class="img" :src="item.extra" mode="aspectFill"></image>
1919 <view class="text">{{item.name}}</view>
....@@ -25,7 +25,7 @@
2525 <scroll-view :scroll-into-view="'subMenu_item'+subActive" scroll-x="true" scroll-with-animation='true'
2626 style="width: 100%;">
2727 <view class="subMenu_wrapper">
28
- <block v-for="(itemn,indexn) in categoryList[navActive].child" :key="itemn._key"><text
28
+ <block v-for="(itemn,indexn) in categoryList[navActive].child" :key="indexn"><text
2929 class="subMenu_item" :id="'subMenu_item'+indexn" :class='indexn==subActive?"on":""'
3030 @click='tapSub(indexn)'>{{itemn.name}}</text></block>
3131 </view>
....@@ -35,15 +35,15 @@
3535 :style="{top: (categoryList[navActive].show2Category==0?0:118) + 'rpx',height: (height-(categoryList[navActive].show2Category==0?0:(122/750*windowWidth))) + 'px'}">
3636 <scroll-view :scroll-top="scrollTop" class="goodlistScroll" scroll-y="true" style="height:100%;"
3737 :scroll-into-view="scrollIntoView" @scroll="handleScroll" :throttle="false">
38
- <block v-for="(aitem,aindex) in categoryList" :key="aitem._key">
39
- <view class="list" v-if="aitem.child.length>0" v-for="(sitem,sindex) in aitem.child" :key="sitem._key"
38
+ <block v-for="(aitem,aindex) in categoryList" :key="aindex">
39
+ <view class="list" v-if="aitem.child.length>0" v-for="sitem,sindex in aitem.child" :key="sindex"
4040 :style="(aindex==categoryList.length-1&&sindex==aitem.child.length-1)?('min-height:'+(height-370/750*windowWidth)+'px'):''"
4141 :id="'list'+aindex+'_'+sindex">
4242 <view class="list_title">{{sitem.name}}</view>
4343 <view class="list_wrapper cf">
4444 <view class="list_column cfl">
4545 <block style="float:left" v-if="sitem.productArr.length>0"
46
- v-for="(gitem,gindex) in sitem.productArr" :key="gitem._key">
46
+ v-for="(gitem,gindex) in sitem.productArr" :key="gindex">
4747 <GoodBlock v-if="gindex%2==0" :size="'small'" :pageName="'分类'"
4848 :moduleName="'分类商品列表'" :careBeanRate="careBeanRate" :goodsInfo="gitem">
4949 </GoodBlock>
....@@ -51,7 +51,7 @@
5151 </view>
5252 <view class="list_column cfr">
5353 <block style="float:left" v-if="sitem.productArr.length>0"
54
- v-for="(gitem,gindex) in sitem.productArr" :key="gitem._key">
54
+ v-for="(gitem,gindex) in sitem.productArr" :key="gindex">
5555 <GoodBlock v-if="gindex%2==1" :size="'small'" :pageName="'分类'"
5656 :moduleName="'分类商品列表'" :careBeanRate="careBeanRate" :goodsInfo="gitem">
5757 </GoodBlock>
....@@ -66,14 +66,14 @@
6666 <view class="list_wrapper cf">
6767 <view class="list_column cfl">
6868 <block v-if="aitem.productArr.length>0" v-for="(gitem,gindex) in aitem.productArr"
69
- :key="gitem._key">
69
+ :key="gindex">
7070 <GoodBlock v-if="gindex%2==0" :pageName="'分类'" :moduleName="'分类商品列表'"
7171 :careBeanRate="careBeanRate" :goodsInfo="gitem"></GoodBlock>
7272 </block>
7373 </view>
7474 <view class="list_column cfr">
7575 <block v-if="aitem.productArr.length>0" v-for="(gitem,gindex) in aitem.productArr"
76
- :key="gitem._key">
76
+ :key="gindex">
7777 <GoodBlock v-if="gindex%2==1" :pageName="'分类'" :moduleName="'分类商品列表'"
7878 :careBeanRate="careBeanRate" :goodsInfo="gitem"></GoodBlock>
7979 </block>
....@@ -144,7 +144,11 @@
144144 totalGetNum: 0,
145145 // 首屏优化:当前分类的待完成请求数
146146 catePending: [],
147
+ // 标记各分类是否已派发过请求,避免切换分类时重复请求
148
+ cateStarted: [],
147149 firstScreenReady: true,
150
+ // 后台加载标记:首屏渲染并关闭loading后,才开始后台加载其余分类
151
+ bgLoaded: false,
148152 // 渲染优化:非首屏分类数据缓冲队列,批量渲染减少setData次数
149153 deferredLists: [],
150154 deferTimer: null,
....@@ -162,6 +166,8 @@
162166 let that = this;
163167 that.menuTop = uni.getMenuButtonBoundingClientRect().top;
164168 that.menuHeight = uni.getMenuButtonBoundingClientRect().height;
169
+ // 尽早计算页面布局高度,避免首屏数据就绪后因 height 为 0 而白屏
170
+ that.infoScroll();
165171 if (that.$store.getters.careBeanRate) {
166172 that.$nextTick(() => {
167173 that.$set(that, 'careBeanRate', that.$store.getters.careBeanRate)
....@@ -176,6 +182,10 @@
176182 });
177183 },
178184 mounted() {},
185
+ onReady() {
186
+ // 页面渲染完成后复核一次布局尺寸(含滚动区域 scrollHeight)
187
+ this.infoScroll();
188
+ },
179189 onHide() {
180190 let that = this;
181191 if (that.$store.getters.isSystemHide) {
....@@ -339,6 +349,10 @@
339349 that.isClicking = true;
340350 that.navActive = index;
341351 that.subActive = 0;
352
+ // loading期间切到尚未发起请求的分类时,立即补发请求,避免loading卡住
353
+ if (!that.cateStarted[index]) {
354
+ that.loadCateByIndex(index);
355
+ }
342356 // loading期间切换分类,若目标分类已加载完成则立即关闭loading
343357 that.checkFirstScreen(index);
344358 that.$nextTick(() => {
....@@ -352,6 +366,10 @@
352366 let that = this;
353367 that.isClicking = true;
354368 that.subActive = index;
369
+ // 当前分类尚未发起请求时补发,避免loading卡住
370
+ if (!that.cateStarted[that.navActive]) {
371
+ that.loadCateByIndex(that.navActive);
372
+ }
355373 that.checkFirstScreen(that.navActive);
356374 that.$nextTick(() => {
357375 that.scrollIntoView = 'list' + that.navActive + '_' + that.subActive;
....@@ -391,23 +409,28 @@
391409 let that = this;
392410 that.firstScreenReady = false;
393411 that.allRequestsDone = false;
412
+ that.bgLoaded = false;
394413 that.deferredLists = [];
395414 if (that.deferTimer) {
396415 clearTimeout(that.deferTimer);
397416 that.deferTimer = null;
398417 }
418
+ // 暂不考虑传入cid的情况:一律从第一个分类开始加载首屏
419
+ that.navActive = 0;
420
+ that.subActive = 0;
399421 uni.showLoading();
400422 getCategoryList().then(res => {
401
- that.categoryList = res.data;
402
- // [P0-优化] 装配阶段为所有分类节点打 _key,供模板 :key 使用
403
- that.ensureCategoryKey(that.categoryList);
423
+ that.categoryList = res.data || [];
404424 // 重置计数,避免重复进入页面时累积
405425 that.totalGetNum = 0;
406426 that.finishNum = 0;
407427 that.catePending = [];
428
+ that.cateStarted = [];
408429 that.categoryList.forEach((item, index) => {
409
-
410430 if (item.child && item.child.length > 0) {
431
+ item.child.sort((a, b) => {
432
+ return a.sort - b.sort;
433
+ });
411434 that.totalGetNum += item.child.length;
412435 that.catePending[index] = item.child.length;
413436 } else {
....@@ -415,113 +438,50 @@
415438 that.catePending[index] = 1;
416439 }
417440 })
418
-
419
- // 先标记当前选中分类,再发起请求
420
- that.categoryList.forEach((item, index) => {
421
- if (that.optionId && that.optionId == item.id) {
422
- that.navActive = index;
423
- that.subActive = 0;
424
- }
425
- if (item.child && item.child.length > 0) {
426
- item.child.sort((a, b) => {
427
- return a.sort - b.sort;
428
- });
429
- item.child.forEach((item2, index2) => {
430
- if (that.optionId && that.optionId == item2.id) {
431
- that.navActive = index;
432
- that.subActive = index2;
433
- }
434
- })
435
- }
441
+ // 分类为空时直接关闭loading,避免一直停留在loading态
442
+ if (!that.categoryList.length) {
443
+ that.firstScreenReady = true;
444
+ that.isLoading = false;
445
+ uni.hideLoading();
446
+ return;
447
+ }
448
+ // 首屏优化:先只请求第一个分类,保证首屏数据最快返回并直接渲染
449
+ that.loadCateByIndex(that.navActive);
450
+ // 其余分类待首屏渲染、loading关闭后,由 loadRestCategory 后台错峰加载
451
+ })
452
+ },
453
+ // 按索引加载某个分类下的商品数据(同一分类只派发一次)
454
+ loadCateByIndex(index) {
455
+ let that = this;
456
+ let item = that.categoryList[index];
457
+ if (!item) return;
458
+ if (that.cateStarted[index]) return;
459
+ that.cateStarted[index] = true;
460
+ if (item.child && item.child.length > 0) {
461
+ item.child.forEach((item2, index2) => {
462
+ that.getAllProductList('isSub', index, index2);
436463 })
437
-
438
- const loadCate = (index) => {
439
- let item = that.categoryList[index];
440
- if (item.child && item.child.length > 0) {
441
- item.child.forEach((item2, index2) => {
442
- that.getAllProductList('isSub', index, index2);
443
- })
444
- } else {
445
- that.getAllProductList(false, index);
446
- }
447
- };
448
- // [P0-优化] 首屏分类(当前navActive):立即并发发起,不走任何队列,最大限度缩短首屏 loading 时长
449
- loadCate(that.navActive);
450
- // [P0-优化] 其余分类:构建任务列表,走下方并发限流池,避免一次性占满 wx.request queue 拖慢首屏
451
- let otherTasks = [];
452
- that.categoryList.forEach((it, idx) => {
453
- if (idx !== that.navActive) otherTasks.push({ index: idx });
454
- });
455
- that.runCategoryTasksWithLimit(otherTasks, 4);
456
-
457
-
458
- })
459
- },
460
- // [P0-优化] 并发限流工具:除首屏分类外,其余分类的请求经由此处发起
461
- runCategoryTasksWithLimit(tasks, limit) {
462
- let that = this;
463
- if (!tasks || !tasks.length) return Promise.resolve();
464
- const queue = tasks.slice();
465
- const executing = [];
466
- const launch = () => {
467
- while (queue.length && executing.length < limit) {
468
- const task = queue.shift();
469
- const item = that.categoryList[task.index];
470
- if (!item) continue;
471
- let promise;
472
- if (item.child && item.child.length > 0) {
473
- const subPromises = [];
474
- item.child.forEach((sub, subIdx) => {
475
- subPromises.push(that.getAllProductList('isSub', task.index, subIdx));
476
- });
477
- promise = Promise.all(subPromises);
478
- } else {
479
- promise = that.getAllProductList(false, task.index);
480
- }
481
- // 用 .catch 包一层避免单个失败拖垮整池
482
- const tracked = promise.catch(() => {});
483
- tracked.finally(() => {
484
- const idx = executing.indexOf(tracked);
485
- if (idx >= 0) executing.splice(idx, 1);
486
- }).catch(() => {});
487
- executing.push(tracked);
488
- }
489
- };
490
- const next = () => {
491
- launch();
492
- if (executing.length === 0) return Promise.resolve();
493
- return Promise.race(executing).then(next, next);
494
- };
495
- return next();
496
- },
497
- // [P0-优化] 为分类节点打 _key:非 H5 平台的 v-for :key 必须为简单变量,
498
- // 故在数据装配阶段预先在 item 上加 _key,模板用 :key="item._key" 引用
499
- ensureCategoryKey: function(list) {
500
- if (!Array.isArray(list)) return;
501
- list.forEach((item, i) => {
502
- if (!item) return;
503
- if (item.id != null) item._key = 'c-' + item.id;
504
- else if (!item._key) item._key = 'c0-' + i;
505
- if (item.child && item.child.length) {
506
- item.child.forEach((sub, j) => {
507
- if (!sub) return;
508
- if (sub.id != null) sub._key = 's-' + sub.id;
509
- else if (!sub._key) sub._key = 's0-' + i + '-' + j;
510
- });
511
- }
512
- });
513
- },
514
- // [P0-优化] 为商品节点打 _key
515
- ensureProductKey: function(list) {
516
- if (!Array.isArray(list)) return;
517
- list.forEach((g, k) => {
518
- if (!g) return;
519
- if (g.id != null && !g._key) g._key = 'p-' + g.id;
520
- else if (!g._key) g._key = 'pk-' + k;
521
- });
522
- },
523
- // 当前分类数据全部就绪后立即关闭全屏loading,不必等待所有分类
524
- checkFirstScreen(index1) {
464
+ } else {
465
+ that.getAllProductList(false, index);
466
+ }
467
+ },
468
+ // 首屏渲染并关闭loading后,后台错峰加载其余分类,避免与首屏抢请求/抢渲染
469
+ loadRestCategory() {
470
+ let that = this;
471
+ if (that.bgLoaded) return;
472
+ that.bgLoaded = true;
473
+ let delay = 0;
474
+ that.categoryList.forEach((item, index) => {
475
+ if (index == that.navActive) return;
476
+ // 每个分类错开触发,逐步在后台铺开,避免一次性铺满请求队列
477
+ delay += 50;
478
+ setTimeout(() => {
479
+ that.loadCateByIndex(index);
480
+ }, delay);
481
+ })
482
+ },
483
+ // 当前分类数据全部就绪后立即关闭全屏loading,不必等待所有分类
484
+ checkFirstScreen(index1) {
525485 let that = this;
526486 if (that.firstScreenReady || index1 != that.navActive) return;
527487 if ((that.catePending[index1] || 0) <= 0) {
....@@ -531,6 +491,8 @@
531491 that.$nextTick(() => {
532492 setTimeout(() => {
533493 uni.hideLoading();
494
+ // 首屏已渲染且loading已关闭,此时才开始后台加载其余分类
495
+ that.loadRestCategory();
534496 }, 50)
535497 })
536498 }
....@@ -600,7 +562,8 @@
600562 updateDimensions() {
601563 const query = uni.createSelectorQuery().in(this);
602564 query.select('.goodlistScroll').boundingClientRect(data => {
603
- this.scrollHeight = data.height;
565
+ // 首屏渲染前该节点可能还不存在,避免报错
566
+ if (data) this.scrollHeight = data.height;
604567 }).exec();
605568 },
606569 handleScroll(e) {
....@@ -631,8 +594,6 @@
631594 cid: isSub ? that.categoryList[index1].child[index2].id : that.categoryList[index1].id,
632595 }).then(res => {
633596 let list = res.data.list;
634
- // [P0-优化] 装配阶段为商品节点打 _key,供模板 :key 使用
635
- that.ensureProductKey(list);
636597 // 当前浏览分类即时渲染;其余分类进入缓冲队列批量渲染,
637598 // 避免几十次$set各自触发一次全量列表渲染
638599 if (index1 == that.navActive && !that.firstScreenReady) {
pages/index/index.vue
....@@ -7,8 +7,8 @@
77 <view class="logo">
88 <image :src="logoUrl" mode="scaleToFill"></image>
99 </view>
10
- <view @click="goToLink({url:'/pages/goods_search/index','name':'搜索商品'},'search')"
11
- :style="{'width':searchWidth+'px','lineHeight':menuHeight+'px','height':menuHeight+'px','borderRadius':menuHeight/2+'px'}"
10
+ <view @click="goToLink({ url: '/pages/goods_search/index', 'name': '搜索商品' }, 'search')"
11
+ :style="{ 'width': searchWidth + 'px', 'lineHeight': menuHeight + 'px', 'height': menuHeight + 'px', 'borderRadius': menuHeight / 2 + 'px' }"
1212 class="input"><text class="iconfont icon-xiazai5"></text>
1313 <text>搜索商品</text>
1414 </view>
....@@ -16,26 +16,26 @@
1616 </view>
1717 </view>
1818 <view class="mp-bg"></view>
19
- <view :style="{ height: marTop+'px' }"></view>
20
- <view class="user_info" v-if="userInfoReady=='hasUserInfo'">
19
+ <view :style="{ height: marTop + 'px' }"></view>
20
+ <view class="user_info" v-if="userInfoReady == 'hasUserInfo'">
2121 <view class="user_head">
2222 <!-- userInfo.avatar?userInfo.avatar: -->
23
- <image :src="userInfo.avatar?userInfo.avatar:defautHead"></image>
23
+ <image :src="userInfo.avatar ? userInfo.avatar : defautHead"></image>
2424 </view>
25
- <view class="user_name">{{userInfo.nickname?userInfo.nickname:'微信客户'}}</view>
25
+ <view class="user_name">{{ userInfo.nickname ? userInfo.nickname : '微信客户' }}</view>
2626 <view class="user_level" v-if="userInfo.vip">
2727 <image :src="userInfo.vipIcon" mode="aspectFit"></image>
2828 <!-- <text>{{userInfo.vipName}}</text> -->
2929 </view>
3030 <view class="user_careNum" @click="goToThird('/pages/profile/care-coupon-detail')">
31
- <view class="num">{{ careBeanReady?toThousands(myCareBean):'-' }}</view>
31
+ <view class="num">{{ careBeanReady ? toThousands(myCareBean) : '-' }}</view>
3232 <view class="label">悦养豆明细</view>
3333 </view>
3434 <navigator class="btn_vip flex" url='/pages/users/user_vip/index' hover-class='none'
3535 @click="clickTrack('vip')"><text>查看会员权益</text><text class="iconfont icon-xiangyou"></text>
3636 </navigator>
3737 </view>
38
- <view class="user_info" v-if="userInfoReady=='needRegister'">
38
+ <view class="user_info" v-if="userInfoReady == 'needRegister'">
3939 <view class="user_head">
4040 <image src="https://ossacmall.bluedeer.com.cn/app/static/images/userHead_defaultNew.png"></image>
4141 </view>
....@@ -44,7 +44,7 @@
4444 class="iconfont icon-xiangyou"></text></view>
4545 </view>
4646 <view v-if="buyList.length > 0" class="buy_list">
47
- <view class="buy_wrapper" :style="'animation-duration:' + buyList.length*2 + 's'">
47
+ <view class="buy_wrapper" :style="'animation-duration:' + buyList.length * 2 + 's'">
4848 <view class="buy_item" v-for="(buyItem, buyIndex) in buyList" :key="buyItem.uniKey">
4949 {{ buyItem.level ? buyItem.level : '' }}
5050 {{ buyItem.real_name }} 已购买{{ buyItem.product_name }}
....@@ -52,14 +52,13 @@
5252 </view>
5353 </view>
5454 <!-- banner -->
55
- <view class="swiper" v-if="imgUrls&&imgUrls.length">
55
+ <view class="swiper" v-if="imgUrls && imgUrls.length">
5656 <swiper indicator-dots="true" indicator-type="expand" :autoplay="true" :circular="circular"
57
- interval="5000" :duration="duration" indicator-color="#979797"
58
- indicator-active-color="#FFE20E">
57
+ interval="5000" :duration="duration" indicator-color="#979797" indicator-active-color="#FFE20E">
5958 <block v-for="(imgUrlItem, imgUrlIndex) in imgUrls" :key="imgUrlItem.uniKey">
6059 <swiper-item>
6160 <view class='slide-navigator acea-row row-between-wrapper' hover-class='none'
62
- @click="goToLink(imgUrlItem,'banner')">
61
+ @click="goToLink(imgUrlItem, 'banner')">
6362 <image :src="imgUrlItem.pic" class="slide-image" lazy-load></image>
6463 </view>
6564 </swiper-item>
....@@ -67,7 +66,7 @@
6766 </swiper>
6867 </view>
6968 <!-- 新闻简报 -->
70
- <view class='notice acea-row row-middle row-between' v-if="roll&&roll.length">
69
+ <view class='notice acea-row row-middle row-between' v-if="roll && roll.length">
7170 <view class="pic">
7271 <image src="https://ossacmall.bluedeer.com.cn/app/static/images/xinjian.png"></image>
7372 </view>
....@@ -78,7 +77,7 @@
7877 <block v-for="(rollItem, rollIndex) in roll" :key='rollItem.uniKey'>
7978 <swiper-item>
8079 <navigator class='item' :url='rollItem.url' hover-class='none'
81
- @click="clickTrack('news',rollItem)">
80
+ @click="clickTrack('news', rollItem)">
8281 <view class='line1'>{{ rollItem.info }}</view>
8382 </navigator>
8483 </swiper-item>
....@@ -88,10 +87,10 @@
8887 <view class="iconfont icon-xiangyou"></view>
8988 </view>
9089 <!-- menu -->
91
- <view class='nav acea-row' v-if="menus&&menus.length">
90
+ <view class='nav acea-row' v-if="menus && menus.length">
9291 <block v-for="(menuItem, menuIndex) in menus" :key="menuItem.uniKey">
9392 <view class='item' v-if="menuItem.show == '2'" hover-class='none'
94
- @click="goToLink(menuItem,'menu')">
93
+ @click="goToLink(menuItem, 'menu')">
9594 <view class='pictrue'>
9695 <image :src='menuItem.pic' class="image"></image>
9796 </view>
....@@ -99,7 +98,238 @@
9998 </view>
10099 </block>
101100 </view>
102
- <image class="index_info" src="https://ossacmall.bluedeer.com.cn/app/static/images/index_info.png" ></image>
101
+ <view class="serviceSupport"
102
+ v-if="serviceSupport && serviceSupport.items && serviceSupport.items.length > 0">
103
+ <div class="serviceSupport_item" v-for="serviceItem, serviceIndex in serviceSupport.items"
104
+ :key="serviceItem.uniKey">
105
+ <image v-if="serviceItem.image" :src="cleanUrl(serviceItem.image)" class="serviceSupport_itemImg">
106
+ </image>
107
+ <view class="serviceSupport_itemText">{{ serviceItem.name }}</view>
108
+ </div>
109
+ </view>
110
+ <!-- 每日特价 + 新品尝鲜 -->
111
+ <view class="promotion_pair"
112
+ v-if="(dealModule && dealModule.items && dealModule.items.length) || (newProductModule && newProductModule.items && newProductModule.items.length)">
113
+ <view class="pair_deal" v-if="dealModule && dealModule.items && dealModule.items.length">
114
+ <view class="pair_deal_head">
115
+ <view class="pair_deal_badge">{{ dealModule.title }}</view>
116
+ <view class="deal_count" v-if="dealCountdown">
117
+ <text class="deal_count_num">{{ dealCountdown.h }}</text>
118
+ <text class="deal_count_sep">:</text>
119
+ <text class="deal_count_num">{{ dealCountdown.m }}</text>
120
+ <text class="deal_count_sep">:</text>
121
+ <text class="deal_count_num">{{ dealCountdown.s }}</text>
122
+ </view>
123
+ </view>
124
+ <view class="pair_deal_sub" v-if="dealModule.subtitle">{{ dealModule.subtitle }}</view>
125
+ <swiper class="deal_swiper" :autoplay="true" :circular="dealModule.items.length > 1"
126
+ @change="dealSwiperChange">
127
+ <swiper-item v-for="dealItem in dealModule.items" :key="dealItem.uniKey">
128
+ <view class="deal_goods" @click="goModuleItem(dealItem)">
129
+ <view class="deal_goods_pic">
130
+ <image
131
+ :src="cleanUrl((dealItem.data && dealItem.data.image) ? dealItem.data.image : dealItem.image)"
132
+ mode="aspectFill"></image>
133
+ </view>
134
+ <view class="deal_goods_name">{{ dealItem.data && dealItem.data.storeName ?
135
+ dealItem.data.storeName : dealItem.name }}</view>
136
+ <view class="deal_progress">
137
+ <view class="deal_progress_bar">
138
+ <view class="deal_progress_inner"
139
+ :style="{ width: dealSoldPercent(dealItem) + '%' }"></view>
140
+ </view>
141
+ <text class="deal_progress_text">已抢{{ dealSold(dealItem) }}件</text>
142
+ </view>
143
+ <view class="deal_bottom">
144
+ <view class="deal_price">
145
+ <view class="deal_price_now" v-if="modulePrice(dealItem.data) !== ''">
146
+ <block v-if="moduleIsBean(dealItem.data)">{{ modulePrice(dealItem.data)
147
+ }}悦养豆</block>
148
+ <block v-else-if="dealItem.data.payWay == 1"><text
149
+ v-if="moduleCashPrice(dealItem.data)">¥ {{
150
+ moduleCashPrice(dealItem.data) }}</text><text
151
+ v-if="moduleCashPrice(dealItem.data) && moduleBeanNum(dealItem.data)">+</text><text
152
+ v-if="moduleBeanNum(dealItem.data)">{{ moduleBeanNum(dealItem.data)
153
+ }}悦养豆</text></block>
154
+ <block v-else>¥ {{ modulePrice(dealItem.data) }}
155
+ </block>
156
+ </view>
157
+ <view class="deal_price_old" v-if="moduleOldPrice(dealItem.data) !== ''">原价<text
158
+ v-if="moduleIsBean(dealItem.data)">{{ moduleOldPrice(dealItem.data)
159
+ }}悦养豆</text><text v-else>¥{{ moduleOldPrice(dealItem.data) }}</text>
160
+ </view>
161
+ </view>
162
+ <view class="deal_buy"></view>
163
+ </view>
164
+ </view>
165
+ </swiper-item>
166
+ </swiper>
167
+ <view class="deal_dots" v-if="dealModule.items.length > 1">
168
+ <text v-for="(dealDot, dealDotIndex) in dealModule.items" :key="dealDotIndex" class="deal_dot"
169
+ :class="{ on: dealDotIndex == dealCurrent }"></text>
170
+ </view>
171
+ </view>
172
+ <view class="pair_right"
173
+ v-if="(newProductModule && newProductModule.items && newProductModule.items.length) || (healthZoneModule && healthZoneModule.items && healthZoneModule.items.length)">
174
+ <view class="pair_new"
175
+ v-if="newProductModule && newProductModule.items && newProductModule.items.length">
176
+ <view class="pair_new_head">
177
+ <text class="pair_new_title">{{ newProductModule.title }}</text>
178
+ <text class="pair_new_sub" v-if="newProductModule.subtitle">{{ newProductModule.subtitle
179
+ }}</text>
180
+ </view>
181
+ <swiper class="pair_new_list" :autoplay="newProductGroups.length > 1"
182
+ :circular="newProductGroups.length > 1" interval="4000" duration="500"
183
+ @change="newProductSwiperChange">
184
+ <swiper-item class="pair_new_swiper_item" v-for="(group, groupIndex) in newProductGroups"
185
+ :key="groupIndex">
186
+ <view class="pair_new_list_wrapper">
187
+ <view class="pair_new_item" v-for="npItem in group" :key="npItem.uniKey"
188
+ @click="goModuleItem(npItem)">
189
+ <view class="pair_new_pic">
190
+ <image
191
+ :src="cleanUrl((npItem.data && npItem.data.image) ? npItem.data.image : npItem.image)"
192
+ mode="aspectFill"></image>
193
+ </view>
194
+ <view class="pair_new_price" v-if="modulePrice(npItem.data) !== ''">
195
+ <block v-if="moduleIsBean(npItem.data)">{{ modulePrice(npItem.data) }}<text
196
+ class="pair_new_unit">悦养豆</text></block>
197
+ <block v-else-if="npItem.data.payWay == 1"><text
198
+ v-if="moduleCashPrice(npItem.data)">¥ {{
199
+ moduleCashPrice(npItem.data) }}</text><text
200
+ v-if="moduleCashPrice(npItem.data) && moduleBeanNum(npItem.data)">+</text><text
201
+ v-if="moduleBeanNum(npItem.data)">{{ moduleBeanNum(npItem.data)
202
+ }}悦养豆</text></block>
203
+ <block v-else>¥ {{ modulePrice(npItem.data) }}
204
+ </block>
205
+ </view>
206
+ <view class="pair_new_old" v-if="moduleOldPrice(npItem.data) !== ''">
207
+ 原价<text v-if="moduleIsBean(npItem.data)">{{ moduleOldPrice(npItem.data)
208
+ }}悦养豆</text><text v-else>¥{{ moduleOldPrice(npItem.data) }}</text>
209
+ </view>
210
+ </view>
211
+ </view>
212
+ </swiper-item>
213
+ </swiper>
214
+ <view class="pair_new_dots" v-if="newProductGroups.length > 1">
215
+ <text v-for="(dot, dotIndex) in newProductGroups" :key="dotIndex" class="pair_new_dot"
216
+ :class="{ on: dotIndex == newProductCurrent }"></text>
217
+ </view>
218
+ </view>
219
+ <view class="pair_zone"
220
+ v-if="healthZoneModule && healthZoneModule.items && healthZoneModule.items.length">
221
+ <view class="pair_zone_head">
222
+ <view class="pair_zone_badge">{{ healthZoneModule.title }}</view>
223
+ <text class="pair_zone_sub" v-if="healthZoneModule.subtitle">{{ healthZoneModule.subtitle
224
+ }}</text>
225
+ </view>
226
+ <swiper class="pair_zone_swiper" :autoplay="healthZoneModule.items.length > 1"
227
+ :circular="healthZoneModule.items.length > 1" interval="4000" duration="500"
228
+ :next-margin="healthZoneModule.items.length > 1 ? '40rpx' : '0'" @change="zoneSwiperChange">
229
+ <swiper-item class="pair_zone_swiper_item"
230
+ :class="healthZoneModule.items.length > 1 ? 'multi' : 'single'"
231
+ v-for="zoneItem in healthZoneModule.items" :key="zoneItem.uniKey">
232
+ <image class="pair_zone_img" :src="zoneImg(zoneItem)" mode="aspectFill"
233
+ @click="goModuleItem(zoneItem)"></image>
234
+ </swiper-item>
235
+ </swiper>
236
+ <view class="pair_zone_dots" v-if="healthZoneModule.items.length > 1">
237
+ <text v-for="(zoneDot, zoneDotIndex) in healthZoneModule.items" :key="zoneDotIndex"
238
+ class="pair_zone_dot" :class="{ on: zoneDotIndex == zoneCurrent }"></text>
239
+ </view>
240
+ </view>
241
+ </view>
242
+ </view>
243
+ <!-- 活动推荐banner -->
244
+ <view class="module_banner"
245
+ v-if="activityBannerModule && activityBannerModule.items && activityBannerModule.items.length">
246
+ <swiper class="module_banner_swiper" :autoplay="activityBannerModule.items.length > 1"
247
+ :circular="activityBannerModule.items.length > 1" interval="4000" duration="500"
248
+ @change="bannerSwiperChange">
249
+ <swiper-item v-for="bannerItem in activityBannerModule.items" :key="bannerItem.uniKey">
250
+ <image class="module_banner_img" :src="cleanUrl(bannerItem.image)" mode="aspectFill"
251
+ @click="goModuleItem(bannerItem)"></image>
252
+ </swiper-item>
253
+ </swiper>
254
+ <view class="module_banner_dots" v-if="activityBannerModule.items.length > 1">
255
+ <text v-for="(bannerDot, bannerDotIndex) in activityBannerModule.items" :key="bannerDotIndex"
256
+ class="module_banner_dot" :class="{ on: bannerDotIndex == bannerCurrent }"></text>
257
+ </view>
258
+ </view>
259
+ <!-- 热门榜单 -->
260
+ <view class="module_rank" v-if="hotRankModule && hotCategoryList && hotCategoryList.length">
261
+ <view class="module_rank_head">
262
+ <view class="module_rank_badge">{{ hotRankModule.title }}</view>
263
+ <text class="module_rank_sub" v-if="hotRankModule.subtitle">{{ hotRankModule.subtitle }}</text>
264
+ </view>
265
+ <view class="module_rank_body">
266
+ <view class="module_rank_tabs" v-if="hotCategoryList.length > 1">
267
+ <scroll-view class="module_rank_tabsScroll" scroll-x="true">
268
+ <view class="module_rank_tabs_wrapper">
269
+ <text v-for="(catItem, catIndex) in hotCategoryList" :key="catItem.uniKey"
270
+ class="module_rank_tab" :class="{ on: catIndex == hotRankIndex }"
271
+ @click="changeHotRank(catIndex)">{{ catItem.name }}</text>
272
+ </view>
273
+ </scroll-view>
274
+ </view>
275
+ <view class="module_rank_list" v-if="rankProducts.length">
276
+ <view class="module_rank_item" v-for="rankItem, rankIndex in rankProducts" :key="rankItem.id"
277
+ @click="goRankProduct(rankItem)"
278
+ :class="{ mid: (rankProducts.length >= 3 && rankIndex == 1) || (rankProducts.length == 1 && rankIndex == 0) }">
279
+ <!-- @click="goRankProduct(rankItem)" -->
280
+ <view class="rank_badge" :class="'rank' + rankItem.rank" v-if="rankIndex < 3">
281
+ </view>
282
+ <view class="rank_pic">
283
+ <image :src="cleanUrl(rankItem.image)" mode="aspectFill"></image>
284
+ </view>
285
+ <view class="rank_buy">{{ formatBuyCount(rankItem.buyerCount) }}人已购买</view>
286
+ <view class="rank_name">{{ rankItem.storeName }}</view>
287
+ <view class="rank_price">
288
+ <view class="rank_price_now" v-if="modulePrice(rankItem) !== ''">
289
+ <block v-if="moduleIsBean(rankItem)">{{ modulePrice(rankItem) }}悦养豆</block>
290
+ <block v-else-if="rankItem.payWay == 1"><text v-if="moduleCashPrice(rankItem)">¥ {{
291
+ moduleCashPrice(rankItem) }}</text><text
292
+ v-if="moduleCashPrice(rankItem) && moduleBeanNum(rankItem)">+</text><text
293
+ v-if="moduleBeanNum(rankItem)">{{ moduleBeanNum(rankItem) }}悦养豆</text>
294
+ </block>
295
+ <block v-else>¥ {{ modulePrice(rankItem) }}</block>
296
+ </view>
297
+ </view>
298
+ <view class="rank_old" v-if="moduleOldPrice(rankItem) !== ''">原价<text
299
+ v-if="moduleIsBean(rankItem)">{{ moduleOldPrice(rankItem) }}悦养豆</text><text
300
+ v-else>¥{{
301
+ moduleOldPrice(rankItem) }}</text></view>
302
+ <view class="rank_cart "></view>
303
+ </view>
304
+ <image v-if="isLoadingRank"
305
+ style="width: 50rpx; height: 50rpx;position:absolute;left:50%;top:50%;margin-left:-25rpx;margin-top: -25rpx;"
306
+ src="https://ossacmall.bluedeer.com.cn/app/static/images/loading.gif" mode="aspectFill">
307
+ </image>
308
+ </view>
309
+ </view>
310
+ </view>
311
+ <!-- 臻选品牌 -->
312
+ <view class="module_brand" v-if="brandWallModule && brandWallModule.items && brandWallModule.items.length">
313
+ <view class="module_brand_title">{{ brandWallModule.title }}</view>
314
+ <view class="module_brand_sub" v-if="brandWallModule.subtitle">{{ brandWallModule.subtitle }}</view>
315
+ <swiper class="module_brand_swiper" :autoplay="brandGroups.length > 1"
316
+ :circular="brandGroups.length > 1" interval="4000" duration="500" @change="brandSwiperChange">
317
+ <swiper-item class="module_brand_swiper_item" v-for="(group, groupIndex) in brandGroups"
318
+ :key="groupIndex">
319
+ <view class="module_brand_box">
320
+ <view class="module_brand_item" v-for="brandItem in group" :key="brandItem.uniKey"
321
+ @click="goModuleItem(brandItem)">
322
+ <image :src="cleanUrl(brandItem.image)" mode="aspectFit"></image>
323
+ </view>
324
+ </view>
325
+ </swiper-item>
326
+ </swiper>
327
+ <view class="module_brand_dots" v-if="brandGroups.length > 1">
328
+ <text v-for="(brandDot, brandDotIndex) in brandGroups" :key="brandDotIndex" class="module_brand_dot"
329
+ :class="{ on: brandDotIndex == brandCurrent }"></text>
330
+ </view>
331
+ </view>
332
+
103333 <!-- 优惠券 -->
104334 <!-- <view class="couponList" v-if="userInfoReady=='hasUserInfo'&&couponList&&couponList.length > 0">
105335 <img :src="'https://ossacmall.bluedeer.com.cn/app/static/images/h_cImg'+((userInfo.vipName&&extVipLevelAttr.indexOf(userInfo.vipName)>0)?extVipLevelAttr.indexOf(userInfo.vipName):1)+'.png'"
....@@ -167,14 +397,14 @@
167397 </view> -->
168398
169399 <!-- 专区入口 -->
170
- <view v-if="zoneList&&zoneList.length > 0" class="zoneList_title">探索健康好物</view>
171
- <scroll-view v-if="zoneList&&zoneList.length > 0" class="zoneList_box scroll-view_H"
400
+ <view v-if="zoneList && zoneList.length > 0" class="zoneList_title">探索健康好物</view>
401
+ <scroll-view v-if="zoneList && zoneList.length > 0" class="zoneList_box scroll-view_H"
172402 :class="zoneList.length == 1 ? 'isSingle' : ''" scroll-x="true">
173403 <view class="zoneList_wrapper">
174404 <block v-for="(zoneItem, zoneIndex) in zoneList" :key="zoneItem.uniKey">
175405 <view class="zoneList_item">
176
- <view
177
- @click="goToLink({'url':'/pages/zone/index?id=' + zoneItem.id,'name':'专区'},'zone')">
406
+ <view
407
+ @click="goToLink({ 'url': '/pages/zone/index?id=' + zoneItem.id, 'name': '专区' }, 'zone')">
178408 <image :src="zoneItem.homepageImage"></image>
179409 </view>
180410 </view>
....@@ -189,35 +419,37 @@
189419 <a_seckill ref="seckill" :careBeanRate="careBeanRate"></a_seckill>
190420 <b_combination></b_combination>
191421 <c_bargain></c_bargain>
192
- <view class="goods_menuBox" v-if="categoryList&&categoryList.length > 0" :style="'top:'+(marTop)+'px;'">
422
+ <view class="goods_menuBox" v-if="categoryList && categoryList.length > 0"
423
+ :style="'top:' + (marTop) + 'px;'">
193424 <view class="subMenu">
194425 <scroll-view scroll-x="true" scroll-with-animation='true' style="width: 100%;">
195426 <view class="subMenu_wrapper">
196427 <block v-for="(catetem, cateIndex) in categoryList" :key="catetem.uniKey"><text
197428 class="subMenu_item" :class='cateIndex == categoryIndex ? "on" : ""'
198
- @click='changeCategoryTab(cateIndex,true)'><text class="text">{{ catetem.name }}</text></text></block>
429
+ @click='changeCategoryTab(cateIndex, true)'><text class="text">{{ catetem.name
430
+ }}</text></text></block>
199431 </view>
200432 </scroll-view>
201433 </view>
202434 </view>
203
- <view class="goodsSection" v-if="categoryList&&categoryList.length > 0" id="goodsSection"
204
- :style="loadingGood?('height:'+viewHeight+'px;overflow:hidden'):''">
205
- <view class="cf list" v-if="productList&&productList.length > 0">
435
+ <view class="goodsSection" v-if="categoryList && categoryList.length > 0" id="goodsSection"
436
+ :style="loadingGood ? ('height:' + viewHeight + 'px;overflow:hidden') : ''">
437
+ <view class="cf list" v-if="productList && productList.length > 0">
206438 <view class="list_column cfl">
207439 <block v-for="(gitem, gindex) in productList" :key="gindex">
208
- <GoodBlock v-if="gindex%2==0" :pageName="'首页'" :moduleName="'商品推荐'"
440
+ <GoodBlock v-if="gindex % 2 == 0" :pageName="'首页'" :moduleName="'商品推荐'"
209441 :careBeanRate="careBeanRate" :size="'big'" :goodsInfo="gitem"></GoodBlock>
210442 </block>
211443 </view>
212444 <view class="list_column cfr">
213445 <block v-for="(gitem, gindex) in productList" :key="gindex">
214
- <GoodBlock v-if="gindex%2==1" :pageName="'首页'" :moduleName="'商品推荐'"
446
+ <GoodBlock v-if="gindex % 2 == 1" :pageName="'首页'" :moduleName="'商品推荐'"
215447 :careBeanRate="careBeanRate" :size="'big'" :goodsInfo="gitem"></GoodBlock>
216448 </block>
217449 </view>
218450 </view>
219451 <view v-if="loading" class="loadingTips">加载中...</view>
220
- <view v-else-if="productList&&productList.length <= 0" class="loadingTips">暂无数据</view>
452
+ <view v-else-if="productList && productList.length <= 0" class="loadingTips">暂无数据</view>
221453 <view v-else-if="loadend" class="loadingTips">已全部加载</view>
222454 <view v-else class="loadingTips">上拉加载更多</view>
223455 <view class="pauseView" v-if="isPause"></view>
....@@ -232,2091 +464,3183 @@
232464 </template>
233465
234466 <script>
235
- import {
236
- HTTP_REQUEST_URL,
237
- THIRD_APPID
238
- } from '@/config/app';
239
- import Auth from '@/libs/wechat';
240
- import Cache from '../../utils/cache';
241
- var statusBarHeight = uni.getSystemSetting().statusBarHeight + 'px';
242
- let app = getApp();
243
- import {
244
- getUserBean
245
- } from '@/api/user.js';
246
- import {
247
- toLogin
248
- } from '@/libs/login.js';
249
- import {
250
- getIndexData,
251
- getIndexConfig,
252
- setWholeCouponReceive,
253
- setCouponReceive
254
- } from '@/api/api.js';
255
- // #ifdef MP-WEIXIN
256
- import {
257
- getTemlIds
258
- } from '@/api/api.js';
259
- import {
260
- testAc,
261
- dealUserBean,
262
- testAgent,
263
- handsCoupon,
264
- handsList
265
- } from '@/api/user.js';
467
+import {
468
+ HTTP_REQUEST_URL,
469
+ THIRD_APPID
470
+} from '@/config/app';
471
+import Auth from '@/libs/wechat';
472
+import Cache from '../../utils/cache';
473
+var statusBarHeight = uni.getSystemSetting().statusBarHeight + 'px';
474
+let app = getApp();
475
+import {
476
+ getUserBean
477
+} from '@/api/user.js';
478
+import {
479
+ toLogin
480
+} from '@/libs/login.js';
481
+import {
482
+ getIndexModule,
483
+ getIndexData,
484
+ getIndexConfig,
485
+ setWholeCouponReceive,
486
+ setCouponReceive
487
+} from '@/api/api.js';
488
+// #ifdef MP-WEIXIN
489
+import {
490
+ getTemlIds
491
+} from '@/api/api.js';
492
+import {
493
+ testAc,
494
+ dealUserBean,
495
+ testAgent,
496
+ handsCoupon,
497
+ handsList
498
+} from '@/api/user.js';
266499
267
- // import {
268
- // SUBSCRIBE_MESSAGE,
269
- // TIPS_KEY
270
- // } from '@/config/cache';
271
- // #endif
272
- // #ifdef H5
273
- import {
274
- follow
275
- } from '@/api/public.js';
276
- // #endif
277
- import {
278
- getShare
279
- } from '@/api/public.js';
280
- import a_seckill from './components/a_seckill';
281
- import b_combination from './components/b_combination';
282
- import c_bargain from './components/c_bargain';
283
- import goodList from '@/components/goodList';
284
- import ClipboardJS from "@/plugin/clipboard/clipboard.js";
285
- import {
286
- goShopDetail
287
- } from '@/libs/order.js'
288
- import {
289
- mapGetters
290
- } from "vuex";
291
- import countDown from '@/components/countDown';
292
- import {
293
- getCategoryList,
294
- getProductslist,
295
- getStoreZoneAndCouponList,
296
- getLast10Order
297
- } from '@/api/store.js';
298
- import recommend from '@/components/recommend';
299
- import {
300
- silenceBindingSpread
301
- } from '@/utils';
302
- // #ifndef MP
303
- import {
304
- kefuConfig
305
- } from "@/api/public";
306
- import {
307
- getWechatConfig
308
- } from "@/api/public";
309
- // #endif
310
-
311
- import {
312
- getMdayLast
313
- } from '@/api/lottery.js';
314
- import GoodBlock from "@/pages/goods_block/index.vue";
315
- import Loading from '@/components/Loading/index.vue';
316
- import popCoupon from '@/components/popCoupon/index.vue';
317
- import popActivity from '@/components/popActivity/index.vue';
318
- import popNewuser from '@/components/popNewuser/index.vue';
319
- const arrTemp = ["beforePay", "afterPay", "refundApply", "beforeRecharge", "createBargain", "pink"];
320
- export default {
321
- computed: mapGetters(['isLogin', 'uid']),
322
- components: {
323
- goodList,
324
- countDown,
325
- a_seckill,
326
- b_combination,
327
- c_bargain,
328
- recommend,
329
- Loading,
330
- GoodBlock,
331
- popCoupon,
332
- popActivity,
333
- popNewuser
334
- },
335
- data() {
336
- return {
337
- defautHead: 'https://ossacmall.bluedeer.com.cn/app/static/images/userHead_defaultNew.png',
338
- buyList: [],
339
- pageHeight: 0,
340
- loaded: false,
341
- loading: false,
342
- isAuto: false, //没有授权的不会自动授权
343
- isShowAuth: false, //是否隐藏授权
344
- statusBarHeight: statusBarHeight,
345
- navIndex: 0,
346
- navTop: [],
347
- followUrl: "",
348
- followHid: true,
349
- followCode: false,
350
- logoUrl: "",
351
- imgUrls: [],
352
- itemNew: [],
353
- menus: [],
354
- zoneList: [],
355
- bastInfo: '',
356
- fastInfo: '',
357
- fastList: [],
358
- firstInfo: '',
359
- salesInfo: '',
360
- indicatorDots: false,
361
- circular: true,
362
- autoplay: true,
363
- interval: 5000,
364
- duration: 500,
365
- window: false,
366
- iShidden: false,
367
- headerHeight: 0,
368
- newGoodsBananr: '',
369
- couponList: [],
370
- liveList: [],
371
- hotList: [{
372
- pic: 'https://ossacmall.bluedeer.com.cn/app/static/images/hot_001.png'
373
- }, {
374
- pic: 'https://ossacmall.bluedeer.com.cn/app/static/images/hot_002.png'
375
- }, {
376
- pic: 'https://ossacmall.bluedeer.com.cn/app/static/images/hot_003.png'
377
- }],
378
- ProductNavindex: 0,
379
- marTop: 0,
380
- childID: 0,
381
- loadend: false,
382
- loadTitle: '加载更多',
383
- sortProduct: [],
384
- is_switch: true,
385
- hotPage: 1,
386
- hotLimit: 10,
387
- hotScroll: false,
388
- explosiveMoney: [],
389
- prodeuctTop: 0,
390
- searchH: 0,
391
- isFixed: false,
392
- goodScroll: true, //精品推荐开关
393
- params: { //精品推荐分页
394
- page: 1,
395
- limit: 10,
396
- },
397
- tempArr: [], //精品推荐临时数组
398
- roll: [], // 新闻简报
399
- site_name: '', //首页title
400
- iSshowH: false,
401
- configApi: {}, //分享类容配置
402
- spikeList: [], // 秒杀
403
- point: '',
404
- privacyStatus: false, // 隐私政策是否同意过
405
- tabsScrollLeft: 0, // tabs当前偏移量
406
- scrollLeft: 0,
407
- lineColor: 'red',
408
- lineStyle: {}, // 下划线位置--动态甲酸
409
- listActive: 0, // 当前选中项
500
+// import {
501
+// SUBSCRIBE_MESSAGE,
502
+// TIPS_KEY
503
+// } from '@/config/cache';
504
+// #endif
505
+// #ifdef H5
506
+import {
507
+ follow
508
+} from '@/api/public.js';
509
+// #endif
510
+import {
511
+ getShare
512
+} from '@/api/public.js';
513
+import a_seckill from './components/a_seckill';
514
+import b_combination from './components/b_combination';
515
+import c_bargain from './components/c_bargain';
516
+import goodList from '@/components/goodList';
517
+import ClipboardJS from "@/plugin/clipboard/clipboard.js";
518
+import {
519
+ goShopDetail
520
+} from '@/libs/order.js'
521
+import {
522
+ mapGetters
523
+} from "vuex";
524
+import countDown from '@/components/countDown';
525
+import {
526
+ getCategoryList,
527
+ getProductslist,
528
+ getStoreZoneAndCouponList,
529
+ getLast10Order
530
+} from '@/api/store.js';
531
+import recommend from '@/components/recommend';
532
+import {
533
+ silenceBindingSpread
534
+} from '@/utils';
535
+// #ifndef MP
536
+import {
537
+ kefuConfig
538
+} from "@/api/public";
539
+import {
540
+ getWechatConfig
541
+} from "@/api/public";
542
+// #endif
410543
411
- duration: 0.2, // 下划线动画时长
412
- menuTop: 0,
413
- menuHeight: 50,
414
- searchWidth: 0,
415
- windowWidth: 0,
416
- windowHeight: 0,
417
- isConfigReady: false,
418
- hasLoadGroomList: false,
419
- hasLoadCouponList: false,
420
- isGetWholeCoupon: false,
421
- isGetWholeCoupon2: false,
422
- tabArr: [
423
- '',
424
- '更多健康好物'
425
- ],
426
- categoryList: [],
427
- subCategoryList: [],
428
- productList: [],
429
- categoryIndex: 0,
430
- categorySubIndex: 0,
431
- where: {
432
- page: 1,
433
- limit: 10,
434
- cid: 0,
435
- },
436
- userInfo: {
437
-
438
- },
439
- userInfoReady: '',
440
- scrollHeight: 100,
441
- scrollTop: 0,
442
- oldScrollTop: 0,
443
- pageScrollTop: 0,
444
- viewHeight: 0,
445
- loadingGood: false,
446
- careBeanRate: 0,
447
- tabLinkArr: [
448
- 'pages/index/index',
449
- 'pages/goods_cate/goods_cate',
450
- 'pages/user/index'
451
- ],
452
- extVipLevelAttr: [
453
- '非会员',
454
- '普通会员',
455
- '畅享会员',
456
- '悦享会员',
457
- '臻享会员'
458
- ],
459
- isPageShow: false,
460
- loginBackFn: null,
461
- myCareBean: 0,
462
- careBeanReady: false,
463
- newCouponList: [],
464
- isFromReturn: false,
465
- hasListenReturn: false,
466
- statusMap: {
467
- 'usable': '去使用',
468
- 'unusable': '已使用',
469
- 'overdue': '已过期',
470
- 'notStart': '未开始'
471
- },
472
- isClicking:false,
473
- hasLottery:false,
474
- homeBanner:{},
475
- homeActivity:{}
544
+import {
545
+ getMdayLast
546
+} from '@/api/lottery.js';
547
+import GoodBlock from "@/pages/goods_block/index.vue";
548
+import Loading from '@/components/Loading/index.vue';
549
+import popCoupon from '@/components/popCoupon/index.vue';
550
+import popActivity from '@/components/popActivity/index.vue';
551
+import popNewuser from '@/components/popNewuser/index.vue';
552
+const arrTemp = ["beforePay", "afterPay", "refundApply", "beforeRecharge", "createBargain", "pink"];
553
+export default {
554
+ computed: {
555
+ ...mapGetters(['isLogin', 'uid']),
556
+ // 热门榜单当前分类下的商品(按设计稿排序:TOP2、TOP1、TOP3,TOP1居中抬高)
557
+ // rankProducts() {
558
+ // let mod = this.hotRankModule;
559
+ // if (!mod || !mod.items || !mod.items.length) return [];
560
+ // let idx = Math.min(this.hotRankIndex, mod.items.length - 1);
561
+ // let cat = mod.items[idx];
562
+ // let ps = (cat && cat.data && cat.data.products) ? cat.data.products : [];
563
+ // let arr = ps.map((p, i) => {
564
+ // return {
565
+ // p: p,
566
+ // jumpType: cat.jumpType,
567
+ // jumpTarget: cat.jumpTarget,
568
+ // rank: i + 1,
569
+ // mid: false
570
+ // };
571
+ // });
572
+ // if (arr.length >= 3) {
573
+ // let ordered = [arr[1], arr[0], arr[2]];
574
+ // ordered[1].mid = true;
575
+ // return ordered;
576
+ // }
577
+ // if (arr.length == 1) {
578
+ // arr[0].mid = true;
579
+ // }
580
+ // return arr;
581
+ // },
582
+ // 臻选品牌按8个一组分页
583
+ brandGroups() {
584
+ let mod = this.brandWallModule;
585
+ if (!mod || !mod.items || !mod.items.length) return [];
586
+ let size = 8;
587
+ let groups = [];
588
+ for (let i = 0; i < mod.items.length; i += size) {
589
+ groups.push(mod.items.slice(i, i + size));
476590 }
591
+ return groups;
477592 },
478
- watch: {},
479
- mounted() {},
480
- onLoad() {
481
- let that = this;
482
- console.log('pageIndex onLoad');
483
- // 获取系统信息
484
- uni.getSystemInfo({
485
- success(res) {
486
- that.$store.commit("SYSTEM_PLATFORM", res.platform);
487
- that.windowWidth = res.windowWidth;
488
- that.windowHeight = res.windowHeight;
489
- that.pageHeight = (res.windowHeight - res.statusBarHeight) / res.windowWidth * 750;
490
- let menuSize = uni.getMenuButtonBoundingClientRect();
491
- console.log('----------------------menuSize--------------------');
492
- console.log(menuSize);
493
- that.menuTop = menuSize.top;
494
- that.menuHeight = menuSize.height;
495
- that.searchWidth = uni.getMenuButtonBoundingClientRect().left - 210 / 750 * that.windowWidth;
496
- that.$nextTick(() => {
497
- let query = uni.createSelectorQuery().in(that);
498
- let info = query.select(".mp-header");
499
- info.boundingClientRect(function(data) {
500
- if (data) {
501
- that.marTop = data.height;
502
- that.viewHeight = that.windowHeight - data.height - 200 / 750 *
503
- that.windowWidth;
504
- that.poTop = Number(data.height) + 84
505
- }
506
-
507
- }).exec()
508
- })
509
- }
510
- });
511
- this.getTemlIds();
512
- if (!this.hasListenReturn) {
513
- uni.$on('returnEvent', function(data) {
514
- console.log('listen returnEvent');
515
- if (data && (data.name == 'tabBar'||data.name == 'order')) {
516
- that.isFromReturn=false;
517
- //强制刷新
518
- // that.isFromReturn = (new Date()).getTime();
519
- // console.log('listen return ' + that.isFromReturn);
520
- }else if (data && data.name == 'goods_details') {
521
- that.isFromReturn = (new Date()).getTime();
522
- console.log('listen return ' + that.isFromReturn);
523
- }
524
- });
525
- this.hasListenReturn = true;
593
+ // 新品尝鲜按2个一组分页
594
+ newProductGroups() {
595
+ let mod = this.newProductModule;
596
+ if (!mod || !mod.items || !mod.items.length) return [];
597
+ let size = 2;
598
+ let groups = [];
599
+ for (let i = 0; i < mod.items.length; i += size) {
600
+ groups.push(mod.items.slice(i, i + size));
526601 }
527
- },
528
- onHide() {
529
- let that = this;
530
- if(that.$store.getters.isSystemHide){
531
- console.log('系统事件触发了onhide事件');
532
- return false;
533
- }
534
- this.isPageShow = false;
535
- uni.$off('updateCareBeanRate', that.careBeanRateReadyFn);
536
- uni.$off('BELONG_READY', that.belongInfoReadyFn);
537
- uni.$off('loginFlSuccess', that.registerFn);
538
- setTimeout(function () {
539
- that.isFromReturn = (new Date()).getTime();
540
- console.log('listen onUnload ' + that.isFromReturn);
541
- }, 200)
542
- },
543
- onShow() {
544
- let that = this;
545
- if(that.$store.getters.isSystemHide){
546
- console.log('系统事件触发了onshow事件');
547
- return false;
548
- }
549
- uni.$off('updateCareBeanRate', that.careBeanRateReadyFn);
550
- uni.$off('BELONG_READY', that.belongInfoReadyFn);
551
- uni.$off('loginFlSuccess', that.registerFn);
552
- that.isPageShow = true;
553
-
554
- uni.setNavigationBarTitle({
555
- title: that.site_name
556
- });
557
- let pages = getCurrentPages(),
558
- currPage = pages[pages.length - 1];
559
- console.log('------------------page onShow start-----------------');
560
- console.log('route', currPage.route);
561
- console.log('options', currPage.options);
562
- console.log('------------------page onShow end-----------------');
563
- console.log('onshow return ' + this.isFromReturn+','+(new Date()).getTime());
564
- if (that.isFromReturn&&(new Date()).getTime()-that.isFromReturn<5*60*1000&&that.$store.getters.isLogin) {
565
- console.log('首页不刷新')
566
- that.getUserBean();
567
- } else {
568
- if (that.$store.getters.careBeanRate) {
569
- that.careBeanRateReadyFn();
570
- } else {
571
- uni.$once('updateCareBeanRate', that.careBeanRateReadyFn);
572
- }
573
- if (that.$store.getters.isBelong) {
574
- that.belongInfoReadyFn({
575
- isRegister: false
576
- })
577
- } else {
578
- uni.$once('BELONG_READY', that.belongInfoReadyFn);
579
- }
580
- }
581
- that.isFromReturn = false;
582
- },
583
- onReachBottom() {
584
- console.log('onReachBottom');
585
- this.get_product_list();
586
- },
587
- methods: {
588
- goToLottery(){
589
- let that=this;
590
- this.clickTrack('lottery');
591
- function go(){
592
- let miniProgramInfo = uni.getAccountInfoSync().miniProgram;
593
- let url=that.homeBanner.homeBannerUrl;
594
- url=url.replace("{{token}}",that.$store.getters.token).replace("{{unionId}}",that.$store.getters.unionId)
595
- uni.navigateTo({
596
- url: url
597
- })
598
- }
599
- if (!that.$store.getters.isLogin) {
600
- toLogin(that);
601
- that.loginBackFn = function() {
602
- go();
603
- }
604
- }else{
605
- go();
606
- }
602
+ return groups;
603
+ }
604
+ },
605
+ components: {
606
+ goodList,
607
+ countDown,
608
+ a_seckill,
609
+ b_combination,
610
+ c_bargain,
611
+ recommend,
612
+ Loading,
613
+ GoodBlock,
614
+ popCoupon,
615
+ popActivity,
616
+ popNewuser
617
+ },
618
+ data() {
619
+ return {
620
+ isLoadingRank: false,
621
+ rankProducts: [],
622
+ defautHead: 'https://ossacmall.bluedeer.com.cn/app/static/images/userHead_defaultNew.png',
623
+ buyList: [],
624
+ pageHeight: 0,
625
+ loaded: false,
626
+ loading: false,
627
+ isAuto: false, //没有授权的不会自动授权
628
+ isShowAuth: false, //是否隐藏授权
629
+ statusBarHeight: statusBarHeight,
630
+ navIndex: 0,
631
+ navTop: [],
632
+ followUrl: "",
633
+ followHid: true,
634
+ followCode: false,
635
+ logoUrl: "",
636
+ imgUrls: [],
637
+ itemNew: [],
638
+ menus: [],
639
+ zoneList: [],
640
+ bastInfo: '',
641
+ fastInfo: '',
642
+ fastList: [],
643
+ firstInfo: '',
644
+ salesInfo: '',
645
+ indicatorDots: false,
646
+ circular: true,
647
+ autoplay: true,
648
+ interval: 5000,
649
+ duration: 500,
650
+ window: false,
651
+ iShidden: false,
652
+ headerHeight: 0,
653
+ newGoodsBananr: '',
654
+ couponList: [],
655
+ liveList: [],
656
+ hotList: [{
657
+ pic: 'https://ossacmall.bluedeer.com.cn/app/static/images/hot_001.png'
658
+ }, {
659
+ pic: 'https://ossacmall.bluedeer.com.cn/app/static/images/hot_002.png'
660
+ }, {
661
+ pic: 'https://ossacmall.bluedeer.com.cn/app/static/images/hot_003.png'
662
+ }],
663
+ ProductNavindex: 0,
664
+ marTop: 0,
665
+ childID: 0,
666
+ loadend: false,
667
+ loadTitle: '加载更多',
668
+ sortProduct: [],
669
+ is_switch: true,
670
+ hotPage: 1,
671
+ hotLimit: 10,
672
+ hotScroll: false,
673
+ explosiveMoney: [],
674
+ prodeuctTop: 0,
675
+ searchH: 0,
676
+ isFixed: false,
677
+ goodScroll: true, //精品推荐开关
678
+ params: { //精品推荐分页
679
+ page: 1,
680
+ limit: 10,
607681 },
608
- careBeanRateReadyFn() {
609
- let that = this;
682
+ tempArr: [], //精品推荐临时数组
683
+ roll: [], // 新闻简报
684
+ site_name: '', //首页title
685
+ iSshowH: false,
686
+ configApi: {}, //分享类容配置
687
+ spikeList: [], // 秒杀
688
+ point: '',
689
+ privacyStatus: false, // 隐私政策是否同意过
690
+ tabsScrollLeft: 0, // tabs当前偏移量
691
+ scrollLeft: 0,
692
+ lineColor: 'red',
693
+ lineStyle: {}, // 下划线位置--动态甲酸
694
+ listActive: 0, // 当前选中项
695
+
696
+ duration: 0.2, // 下划线动画时长
697
+ menuTop: 0,
698
+ menuHeight: 50,
699
+ searchWidth: 0,
700
+ windowWidth: 0,
701
+ windowHeight: 0,
702
+ isConfigReady: false,
703
+ hasLoadGroomList: false,
704
+ hasLoadCouponList: false,
705
+ isGetWholeCoupon: false,
706
+ isGetWholeCoupon2: false,
707
+ tabArr: [
708
+ '',
709
+ '更多健康好物'
710
+ ],
711
+ hotCategoryList: [],
712
+ categoryList: [],
713
+ subCategoryList: [],
714
+ productList: [],
715
+ categoryIndex: 0,
716
+ categorySubIndex: 0,
717
+ where: {
718
+ page: 1,
719
+ limit: 10,
720
+ cid: 0,
721
+ },
722
+ userInfo: {
723
+
724
+ },
725
+ userInfoReady: '',
726
+ scrollHeight: 100,
727
+ scrollTop: 0,
728
+ oldScrollTop: 0,
729
+ pageScrollTop: 0,
730
+ viewHeight: 0,
731
+ loadingGood: false,
732
+ careBeanRate: 0,
733
+ tabLinkArr: [
734
+ 'pages/index/index',
735
+ 'pages/goods_cate/goods_cate',
736
+ 'pages/user/index'
737
+ ],
738
+ extVipLevelAttr: [
739
+ '非会员',
740
+ '普通会员',
741
+ '畅享会员',
742
+ '悦享会员',
743
+ '臻享会员'
744
+ ],
745
+ isPageShow: false,
746
+ loginBackFn: null,
747
+ myCareBean: 0,
748
+ careBeanReady: false,
749
+ newCouponList: [],
750
+ isFromReturn: false,
751
+ hasListenReturn: false,
752
+ statusMap: {
753
+ 'usable': '去使用',
754
+ 'unusable': '已使用',
755
+ 'overdue': '已过期',
756
+ 'notStart': '未开始'
757
+ },
758
+ isClicking: false,
759
+ hasLottery: false,
760
+ homeBanner: {},
761
+ serviceSupport: {},
762
+ homeActivity: {},
763
+ dealModule: null,
764
+ newProductModule: null,
765
+ healthZoneModule: null,
766
+ activityBannerModule: null,
767
+ hotRankModule: null,
768
+ hotRankIndex: 0,
769
+ zoneCurrent: 0,
770
+ brandCurrent: 0,
771
+ newProductCurrent: 0,
772
+ brandWallModule: null,
773
+ dealCurrent: 0,
774
+ bannerCurrent: 0,
775
+ dealCountdown: null,
776
+ dealEndTs: 0,
777
+ serverTimeOffset: 0
778
+ }
779
+ },
780
+ watch: {},
781
+ mounted() { },
782
+ onLoad() {
783
+ let that = this;
784
+ console.log('pageIndex onLoad');
785
+ // 获取系统信息
786
+ uni.getSystemInfo({
787
+ success(res) {
788
+ that.$store.commit("SYSTEM_PLATFORM", res.platform);
789
+ that.windowWidth = res.windowWidth;
790
+ that.windowHeight = res.windowHeight;
791
+ that.pageHeight = (res.windowHeight - res.statusBarHeight) / res.windowWidth * 750;
792
+ let menuSize = uni.getMenuButtonBoundingClientRect();
793
+ console.log('----------------------menuSize--------------------');
794
+ console.log(menuSize);
795
+ that.menuTop = menuSize.top;
796
+ that.menuHeight = menuSize.height;
797
+ that.searchWidth = uni.getMenuButtonBoundingClientRect().left - 210 / 750 * that.windowWidth;
610798 that.$nextTick(() => {
611
- that.$set(that, 'careBeanRate', that.$store.getters.careBeanRate)
612
- })
613
- },
614
- belongInfoReadyFn(data) {
615
- let that = this;
616
- if (!data.isRegister) {
617
- that.checkLoginFn();
618
- }
619
- },
620
- checkLoginFn() {
621
- let that = this;
622
- let pages = getCurrentPages(),
623
- currPage = pages[pages.length - 1];
624
- that.addTrack('yy_pageView', {
625
- pageTitle_var: '首页',
626
- pagePath_var: currPage.route,
627
- pageType_var: '首页'
628
- });
629
- that.getIndexData();
630
- if (that.$store.getters.isLogin) {
631
- that.onLoadFn();
632
- } else {
633
- that.userInfoReady = 'needRegister';
634
- }
635
- uni.$once('loginFlSuccess', that.registerFn);
636
- },
637
-
638
- registerFn() {
639
- console.log('registerFn');
640
- let that = this;
641
- if (that.loginBackFn) {
642
- that.loginBackFn();
643
- }
644
- that.loginBackFn = null;
645
- },
646
- getUserBean() {
647
- let that = this;
648
- getUserBean().then(res2 => {
649
- that.careBeanReady = true;
650
- that.myCareBean = res2.data.totalCareBeans;
651
- });
652
- },
653
- onLoadFn() {
654
- let that = this;
655
- that.userInfo = that.$store.getters.userInfo;
656
- that.getUserBean();
657
- that.userInfoReady = 'hasUserInfo';
658
- that.getBaseUserInfo();
659
-
660
- },
661
- clickTrack(type, item) {
662
- var data = {
663
- pageTitle_var: '首页',
664
- firstTabName_var: '-'
665
- };
666
- if (type == 'search') {
667
- data['moduleName_var'] = '页面顶部';
668
- data['buttonName_var'] = '搜索商品';
669
- }
670
- if (type == 'third') {
671
- data['moduleName_var'] = '页面顶部';
672
- data['buttonName_var'] = '查看悦养豆';
673
- }
674
- if (type == 'vip') {
675
- data['moduleName_var'] = '页面顶部';
676
- data['buttonName_var'] = '查看会员权益';
677
- } else if (type == 'banner') {
678
- data['moduleName_var'] = '轮播卡片';
679
- data['buttonName_var'] = item.name ? item.name : '-';
680
- } else if (type == 'menu') {
681
- data['moduleName_var'] = '金刚位';
682
- data['buttonName_var'] = item.name ? item.name : '-';
683
- } else if (type == 'zone') {
684
- data['moduleName_var'] = '探索健康好物';
685
- data['buttonName_var'] = item.name ? item.name : '-';
686
- }else if (type == 'lottery') {
687
- data['moduleName_var'] = '抽奖';
688
- data['buttonName_var'] = 'GO';
689
- } else if (type == 'coupon') {
690
- data['moduleName_var'] = '优惠券';
691
- data['buttonName_var'] = item.name ? item.name : '-';
692
- } else if (type == 'cate') {
693
- data['moduleName_var'] = '商品分类';
694
- data['buttonName_var'] = item.name ? item.name : '-';
695
- }
696
- this.addTrack('yy_marketPageClick', data);
697
- },
698
- goToThird(url, appId) {
699
- //第三方小程序
700
- // /pages/home/index?source=INSMART&sourceScene=test&agentNo=90028476&agentChannel=BK&agentCompany=123&agentBranch=123
701
-
702
- if (url.indexOf('?') < 0) {
703
- url += '?';
704
- } else {
705
- url += '&';
706
- }
707
- if (app.globalData.source) {
708
- url += 'source=' + app.globalData.source;
709
- } else {
710
- url += 'source=MALL';
711
- }
712
- url += '&sourceScene=home';
713
- url += '&agentNo=' + ((this.$store.getters.belong && this.$store.getters.belong.agentNo) ? this.$store
714
- .getters.belong.agentNo : '');
715
- url += '&agentChannel=' + ((this.$store.getters.belong && this.$store.getters.belong.channel) ? this.$store
716
- .getters.belong.channel : ''); //归属代理人渠道
717
- url += '&agentCompany=' + ((this.$store.getters.belong && this.$store.getters.belong.companyCode) ? this
718
- .$store.getters.belong.companyCode : ''); //agentCompany
719
-
720
- url += '&agentBranch=' + ((this.$store.getters.belong && this.$store.getters.belong.branchCode) ? this
721
- .$store.getters.belong.branchCode : ''); //归属代理人支公司
722
- url += '&custAgentOrgNo=' + ((this.$store.getters.belong && this.$store.getters.belong.subCode) ? this
723
- .$store.getters.belong.subCode : ''); //归属代理人机构编码
724
-
725
- url += 'unionId=' + this.$store.getters.unionId;
726
- url += '&mobile=' + ((this.$store.getters.belong && this.$store.getters.belong.mobile) ? this.$store
727
- .getters.belong.mobile : this.$store.getters.userInfo.mobile);
728
- console.log(url);
729
-
730
-
731
-
732
- let miniProgramInfo = uni.getAccountInfoSync().miniProgram;
733
- uni.navigateToMiniProgram({
734
- appId: appId ? appId : THIRD_APPID,
735
- path: url,
736
- envVersion: miniProgramInfo.envVersion == 'release' ? 'release' : 'trial',
737
- })
738
-
739
- // let params={};
740
- // params['custAgentNo']=((this.$store.getters.belong && this.$store.getters.belong.agentNo) ? this.$store
741
- // .getters.belong.agentNo : '');
742
- // params['custAgentChnl']=((this.$store.getters.belong && this.$store.getters.belong.channel) ? this.$store
743
- // .getters.belong.channel : '');
744
- // params['custAgentCoy']=((this.$store.getters.belong && this.$store.getters.belong.companyCode) ? this
745
- // .$store.getters.belong.companyCode : '');
746
- // params['custAgentBranch']=((this.$store.getters.belong && this.$store.getters.belong.branchCode) ? this
747
- // .$store.getters.belong.branchCode : '');
748
- // params['custAgentOrgNo']=((this.$store.getters.belong && this.$store.getters.belong.subCode) ? this
749
- // .$store.getters.belong.subCode : '');
750
- // let webUrl='https://ossacmall.bluedeer.com.cn/qr/index.html?isMall=true'+(miniProgramInfo.envVersion == 'release' ? '' : '&isTrial=true')+'&params='+encodeURIComponent(JSON.stringify(params))+'&pageUrl='+encodeURIComponent(url);
751
- // if(HTTP_REQUEST_URL.indexOf('tohours')>0){
752
- // webUrl=webUrl.replace('https://ossacmall.bluedeer.com.cn/qr','https://sit.tohours.com/crmeb_web/qr/')
753
- // }
754
- // uni.navigateTo({
755
- // url: '/pages/users/web_page/index?webUel='+encodeURIComponent(webUrl)
756
- // })
757
-
758
- this.clickTrack('third')
759
- },
760
- goToLink(item, type) {
761
- let that=this;
762
- function go(){
763
- if (item.appid) {
764
- that.goToThird(item.url, item.appid);
765
- } else if (that.isTabLink(item.url)) {
766
- let arr = item.url.split('?');
767
- if (arr.length > 1) {
768
- that.$store.commit('updateSwitchParams', {
769
- switchParams: arr[1]
770
- });
799
+ let query = uni.createSelectorQuery().in(that);
800
+ let info = query.select(".mp-header");
801
+ info.boundingClientRect(function (data) {
802
+ if (data) {
803
+ that.marTop = data.height;
804
+ that.viewHeight = that.windowHeight - data.height - 200 / 750 *
805
+ that.windowWidth;
806
+ that.poTop = Number(data.height) + 84
771807 }
772
- uni.switchTab({
773
- url: arr[0]
774
- });
775
- } else {
776
- uni.navigateTo({
777
- url: item.url.replace("{{token}}",that.$store.getters.token).replace("{{unionId}}",that.$store.getters.unionId)
778
- })
779
- }
780
- that.clickTrack(type, item);
808
+
809
+ }).exec()
810
+ })
811
+ }
812
+ });
813
+ this.getTemlIds();
814
+ if (!this.hasListenReturn) {
815
+ uni.$on('returnEvent', function (data) {
816
+ console.log('listen returnEvent');
817
+ if (data && (data.name == 'tabBar' || data.name == 'order')) {
818
+ that.isFromReturn = false;
819
+ //强制刷新
820
+ // that.isFromReturn = (new Date()).getTime();
821
+ // console.log('listen return ' + that.isFromReturn);
822
+ } else if (data && data.name == 'goods_details') {
823
+ that.isFromReturn = (new Date()).getTime();
824
+ console.log('listen return ' + that.isFromReturn);
781825 }
782
- console.log(item.url);
783
- if (item.url.indexOf('needLogin=true')>0&&!that.$store.getters.isLogin) {
784
- toLogin(that);
785
- that.loginBackFn = function() {
786
- go();
787
- }
788
- }else{
826
+ });
827
+ this.hasListenReturn = true;
828
+ }
829
+ },
830
+ onHide() {
831
+ let that = this;
832
+ if (that.$store.getters.isSystemHide) {
833
+ console.log('系统事件触发了onhide事件');
834
+ return false;
835
+ }
836
+ this.isPageShow = false;
837
+ clearInterval(this.dealTimer);
838
+ uni.$off('updateCareBeanRate', that.careBeanRateReadyFn);
839
+ uni.$off('BELONG_READY', that.belongInfoReadyFn);
840
+ uni.$off('loginFlSuccess', that.registerFn);
841
+ setTimeout(function () {
842
+ that.isFromReturn = (new Date()).getTime();
843
+ console.log('listen onUnload ' + that.isFromReturn);
844
+ }, 200)
845
+ },
846
+ onShow() {
847
+ let that = this;
848
+ if (that.$store.getters.isSystemHide) {
849
+ console.log('系统事件触发了onshow事件');
850
+ return false;
851
+ }
852
+ uni.$off('updateCareBeanRate', that.careBeanRateReadyFn);
853
+ uni.$off('BELONG_READY', that.belongInfoReadyFn);
854
+ uni.$off('loginFlSuccess', that.registerFn);
855
+ that.isPageShow = true;
856
+ if (that.dealEndTs) {
857
+ clearInterval(that.dealTimer);
858
+ that.updateDealCountdown();
859
+ that.dealTimer = setInterval(function () {
860
+ that.updateDealCountdown();
861
+ }, 1000);
862
+ }
863
+
864
+ uni.setNavigationBarTitle({
865
+ title: that.site_name
866
+ });
867
+ let pages = getCurrentPages(),
868
+ currPage = pages[pages.length - 1];
869
+ console.log('------------------page onShow start-----------------');
870
+ console.log('route', currPage.route);
871
+ console.log('options', currPage.options);
872
+ console.log('------------------page onShow end-----------------');
873
+ console.log('onshow return ' + this.isFromReturn + ',' + (new Date()).getTime());
874
+ if (that.isFromReturn && (new Date()).getTime() - that.isFromReturn < 5 * 60 * 1000 && that.$store.getters.isLogin) {
875
+ console.log('首页不刷新')
876
+ that.getUserBean();
877
+ } else {
878
+ if (that.$store.getters.careBeanRate) {
879
+ that.careBeanRateReadyFn();
880
+ } else {
881
+ uni.$once('updateCareBeanRate', that.careBeanRateReadyFn);
882
+ }
883
+ if (that.$store.getters.isBelong) {
884
+ that.belongInfoReadyFn({
885
+ isRegister: false
886
+ })
887
+ } else {
888
+ uni.$once('BELONG_READY', that.belongInfoReadyFn);
889
+ }
890
+ }
891
+ that.isFromReturn = false;
892
+ },
893
+ onReachBottom() {
894
+ console.log('onReachBottom');
895
+ this.get_product_list();
896
+ },
897
+ methods: {
898
+ goToLottery() {
899
+ let that = this;
900
+ this.clickTrack('lottery');
901
+ function go() {
902
+ let miniProgramInfo = uni.getAccountInfoSync().miniProgram;
903
+ let url = that.homeBanner.homeBannerUrl;
904
+ url = url.replace("{{token}}", that.$store.getters.token).replace("{{unionId}}", that.$store.getters.unionId)
905
+ uni.navigateTo({
906
+ url: url
907
+ })
908
+ }
909
+ if (!that.$store.getters.isLogin) {
910
+ toLogin(that);
911
+ that.loginBackFn = function () {
789912 go();
790913 }
791
-
792
-
793
- },
794
- isTabLink(link) {
795
- let isTab = false;
796
- this.tabLinkArr.forEach((item) => {
797
- if (link.indexOf(item) >= 0) {
798
- isTab = true;
799
- }
800
- })
801
- return isTab;
802
- },
803
- handleLoad() {
804
- let that = this;
805
- },
806
- goToLogin() {
807
- let that = this;
808
- toLogin(that);
809
- that.loginBackFn = function() {
810
- that.userInfo = that.$store.getters.userInfo;
811
- that.userInfoReady = 'hasUserInfo';
812
- that.getBaseUserInfo();
813
- that.getIndexData();
814
- that.onLoadFn();
914
+ } else {
915
+ go();
916
+ }
917
+ },
918
+ careBeanRateReadyFn() {
919
+ let that = this;
920
+ that.$nextTick(() => {
921
+ that.$set(that, 'careBeanRate', that.$store.getters.careBeanRate)
922
+ })
923
+ },
924
+ // 清理接口返回图片地址中的多余字符(如反引号)
925
+ cleanUrl(url) {
926
+ if (!url) return '';
927
+ return url.replace(/[`\s]/g, '');
928
+ },
929
+ // 模块商品价格:与秒杀getUserLvPrice同口径,按商品userLv取会员价,无则取默认价
930
+ modulePrice(d) {
931
+ if (!d) return '';
932
+ let price = 0;
933
+ if (d.zoneId) {
934
+ price = d.zhenXiangPrice;
935
+ } else {
936
+ let lv = d.userLv;
937
+ if (lv === undefined || lv === null || lv === '') {
938
+ lv = (this.$store.getters.userInfo && this.$store.getters.userInfo.level) || 0;
815939 }
816
- },
817
- getBaseUserInfo() {
818
- let that = this;
819
- silenceBindingSpread();
820
- },
821
- goToCoupon: function() {
822
- uni.navigateTo({
823
- url: '/pages/users/user_coupon/index'
824
- })
825
- },
826
- getCoupon: function(isWhole, orgItem,index) {
827
- let that = this;
828
- if (!that.$store.getters.isLogin) {
829
- that.goToLogin();
830
- return false;
831
- }
832
- if(that.isClicking){
833
- return false;
834
- }
835
- //领取优惠券
836
- if (isWhole) {
837
- this.clickTrack('coupon', {
838
- 'name': '一键领取'
839
- })
840
- let couponIds = [];
841
- that.couponList.forEach((item1, index1) => {
842
- if (!item1.isUse && item1.type!='import') {
843
- couponIds.push(item1.id);
844
- }
845
- })
846
- if(couponIds.length>0){
847
- var useNum = 0;
848
- uni.showLoading();
849
- that.isClicking=true;
850
- setWholeCouponReceive({
851
- couponIds: couponIds,
852
- }).then(function(res) {
853
- that.$util.Tips({
854
- title: '领取成功'
855
- });
856
- let nameArr = [];
857
- let idArr = [];
858
- let hasCoupon4 = false;
859
- that.couponList.forEach((item1, index1) => {
860
- if (!item1.isUse && item1.type!='import') {
861
- that.couponList[index1].isUse = true;
862
- nameArr.push(item1.name);
863
- idArr.push(item1.id);
864
- }
865
- if (item1.moneyType == 4) {
866
- hasCoupon4 = true;
867
- }
868
- });
869
- that.isGetWholeCoupon = true;
870
- that.addTrack('yy_getCoupon', {
871
- 'couponName_var': nameArr.join(','),
872
- 'couponId_var': idArr.join(',')
873
- });
874
- if (hasCoupon4) {
875
- that.changeCategoryTab(that.categoryIndex);
876
- }
877
- uni.hideLoading();
878
- that.isClicking=false;
879
- }).catch(err => {
880
- uni.hideLoading();
881
- that.isClicking=false;
882
- return that.$util.Tips({
883
- title: (err && err.message) ? err.message : err
884
- });
885
- });
886
- }
940
+ if (lv == 0) {
941
+ price = d.puTongPrice;
942
+ } else if (lv == 1) {
943
+ price = d.changXiangPrice;
944
+ } else if (lv == 2) {
945
+ price = d.yueXiangPrice;
887946 } else {
888
- let item=orgItem||this.couponList[index]
889
- if (item.isUse || (item.type=='import' && item.validStr=='usable')) {
890
-
891
- that.isClicking=true;
892
- var timer=setTimeout(()=>{
893
- that.isClicking=false;
894
- clearTimeout(timer);
895
- },500)
896
- if (item.appId && item.toPath) {
897
- that.goToThird(item.toPath, item.appId);
898
- } else if (item.toPath) {
899
- if (that.isTabLink(item.toPath)) {
900
- uni.switchTab({
901
- url: item.toPath
902
- })
903
- } else {
904
- uni.navigateTo({
905
- url: item.toPath
906
- })
907
- }
908
- } else {
909
- uni.switchTab({
910
- url: '/pages/goods_cate/goods_cate'
911
- })
912
- }
913
- } else if(item.type!=='import') {
914
- uni.showLoading();
915
- that.isClicking=true;
916
- setCouponReceive(item.id).then(function(res) {
917
- that.addTrack('yy_getCoupon', {
918
- 'couponName_var': item.name,
919
- 'couponId_var': item.id
920
- });
921
- that.$set(that.couponList[index], 'isUse', true);
922
- that.$util.Tips({
923
- title: '领取成功'
924
- });
925
- if (item.moneyType == 4) {
926
- that.changeCategoryTab(that.categoryIndex);
927
- }
928
- let finishNum=0;
929
- that.couponList.forEach((item1, index1) => {
930
- if (item1.isUse) {
931
- finishNum++;
932
- }
933
- });
934
- if(finishNum>=that.couponList.length){
935
- that.isGetWholeCoupon=true;
936
- }
937
- uni.hideLoading();
938
- that.isClicking=false;
939
- }).catch(err => {
940
- uni.hideLoading();
941
- that.isClicking=false;
942
- return that.$util.Tips({
943
- title: (err && err.message) ? err.message : err
944
- });
945
- })
946
- }
947
-
947
+ price = d.zhenXiangPrice;
948948 }
949
- },
950
- clickSort(index) {
951
- this.listActive = index
952
- },
953
- // scroll-view滑动事件
954
- scroll(e) {
955
- this.scrollLeft = e.detail.scrollLeft;
956
- },
957
- // 计算下划线位置
958
- setLine() {
959
- let lineWidth = 0,
960
- lineLeft = 0
961
- this.getElementData(`#tab_item`, (data) => {
962
- let el = data[this.listActive]
963
- lineWidth = el.width / 2
964
- // lineLeft = el.width * (this.currentIndex + 0.5) // 此种只能针对每个item长度一致的
965
- lineLeft = el.width / 2 + (-data[0].left) + el.left
966
- this.lineStyle = {
967
- width: `${lineWidth}px`,
968
- transform: `translateX(${lineLeft}px) translateX(-50%)`,
969
- transitionDuration: `${this.duration}s`
970
- };
971
- })
972
- },
973
- getElementData(el, callback) {
974
- uni.createSelectorQuery().in(this).selectAll(el).boundingClientRect().exec((data) => {
975
- callback(data[0]);
949
+ }
950
+ if (price === undefined || price === null || price === '') {
951
+ price = d.price;
952
+ }
953
+ if (price === undefined || price === null) return '';
954
+ // 悦养豆商品与秒杀一致:取整显示
955
+ if (d.payWay == 3) {
956
+ return Math.round(parseFloat(price)) + '';
957
+ }
958
+ return price;
959
+ },
960
+ // 是否悦养豆商品(与秒杀payWay==3一致)
961
+ moduleIsBean(d) {
962
+ return !!(d && d.payWay == 3);
963
+ },
964
+ // 混合支付(payWay==1)悦养豆数量
965
+ moduleBeanNum(d) {
966
+ let n = Math.round(Number(d && d.maxCareBeanNumber) || 0);
967
+ return n > 0 ? n : 0;
968
+ },
969
+ // 混合支付(payWay==1)现金部分:会员价 - 悦养豆抵扣(与商品卡片getSelectPrice一致)
970
+ moduleCashPrice(d) {
971
+ if (!d) return '';
972
+ let price = parseFloat(this.modulePrice(d)) || 0;
973
+ let beans = Number(d.maxCareBeanNumber) || 0;
974
+ if (beans > 0 && Number(this.careBeanRate) > 0) {
975
+ price = price - beans / Number(this.careBeanRate);
976
+ }
977
+ return price > 0 ? price.toFixed(2) : '';
978
+ },
979
+ // 模块商品原价(参考商品卡片goods_block L32-L40:现价与原价一致时不显示)
980
+ moduleOldPrice(d) {
981
+ if (!d) return '';
982
+ // 悦养豆商品:原价取悦养豆基础值careBeanNumber(无则回退price),与会员悦养豆价比对
983
+ if (this.moduleIsBean(d)) {
984
+ let base = (d.careBeanNumber !== undefined && d.careBeanNumber !== null && d.careBeanNumber !==
985
+ '') ? d.careBeanNumber : d.price;
986
+ if (base === undefined || base === null || base === '') return '';
987
+ if (Number(base) == Number(this.modulePrice(d))) return '';
988
+ return base + '';
989
+ }
990
+ // 人民币/混合商品:原价取基础价price
991
+ let base = d.price;
992
+ if (base === undefined || base === null || base === '') return '';
993
+ if (d.payWay == 1) {
994
+ // 混合支付:与商品卡片一致,现金部分(getSelectPrice)与原价一致时不显示
995
+ let cash = parseFloat(this.moduleCashPrice(d)) || 0;
996
+ if (cash == Number(base)) return '';
997
+ } else {
998
+ if (Number(base) == Number(this.modulePrice(d))) return '';
999
+ }
1000
+ return base + '';
1001
+ },
1002
+ dealSold(item) {
1003
+ return item && item.data ? (item.data.salesItemCount || 0) : 0;
1004
+ },
1005
+ dealSoldPercent(item) {
1006
+ if (!item || !item.data) return 0;
1007
+ let sold = Number(item.data.salesItemCount || 0);
1008
+ let stock = Number(item.data.stock || 0);
1009
+ if (sold + stock <= 0) return 0;
1010
+ return Math.min(100, Math.round(sold / (sold + stock) * 100));
1011
+ },
1012
+ // 模块item跳转
1013
+ goModuleItem(item) {
1014
+ let that = this;
1015
+ console.log(item);
1016
+ if (!item || item.jumpType == 'NONE' || !item.jumpTarget) return;
1017
+ this.clickTrack('module', item);
1018
+ let url = item.jumpTarget;
1019
+
1020
+ console.log('goModuleItem', item, url);
1021
+ if (url.indexOf('/') !== 0) {
1022
+ url = '/' + url;
1023
+ }
1024
+ if (that.isTabLink(url)) {
1025
+ uni.switchTab({
1026
+ url: url
9761027 });
977
- },
978
- xieyiApp() {
1028
+ } else {
9791029 uni.navigateTo({
980
- url: '/pages/users/web_page/index?webUel=https://admin.java.crmeb.net/useragreement/xieyi.html&title=协议内容'
981
- })
982
- },
983
- getTemlIds() {
984
- for (var i in arrTemp) {
985
- this.getTem(arrTemp[i]);
986
- }
987
- },
988
- getTem(data) {
989
- getTemlIds({
990
- type: data
991
- }).then(res => {
992
- if (res.data) {
993
- let arr = res.data.map((item) => {
994
- return item.tempId
995
- })
996
- wx.setStorageSync('tempID' + data, arr);
997
- }
998
- })
999
- },
1000
- showActivity(){
1001
- this.$refs.popNewuserRef.show();
1002
- },
1003
- // 首页数据
1004
- getIndexData: function() {
1005
- let that = this;
1006
- that.hasCheckedLogin = true;
1007
- getIndexData().then(res => {
1008
- let homePopupList=[]
1009
- if(res.data.homePopupList){
1010
- homePopupList=res.data.homePopupList.map(item=>{
1011
- return {
1012
- image:item.image,
1013
- linkUrl:item.linkUrl
1014
- }
1015
- })
1016
- }
1017
- that.$set(that, "homeActivity",{
1018
- // homeDate:res.data.homeDate,
1019
- // homeImg:res.data.homeImg,
1020
- // homeUrl:res.data.homeUrl,
1021
- homePopupList:homePopupList
1022
- });
1023
- that.$nextTick(()=>{
1024
- that.$refs.popActivity.show();
1025
- })
1026
- that.isConfigReady = true;
1027
- uni.setNavigationBarTitle({
1028
- title: '首页'
1029
- })
1030
- that.$set(that, "logoUrl", res.data.logoUrl);
1031
- that.$set(that, "site_name", '首页');
1032
- if(res.data.banner){
1033
- res.data.banner.forEach((item, index) => {
1034
- item.uniKey = 'banner' + index;
1035
- })
1036
- }
1037
- that.$set(that, "imgUrls", res.data.banner?res.data.banner:[]);
1038
- if(res.data.menus){
1039
- res.data.menus.forEach((item, index) => {
1040
- item.uniKey = 'menus' + index;
1041
- })
1042
- }
1043
- that.$set(that, "menus", res.data.menus?res.data.menus:[]);
1044
- if (res.data.roll) {
1045
- res.data.roll.forEach((item, index) => {
1046
- item.uniKey = 'roll' + index;
1047
- })
1048
- }
1049
- that.$set(that, "roll", res.data.roll ? res.data.roll : []);
1050
- // #ifdef H5
1051
- that.$store.commit("SET_CHATURL", res.data.yzfUrl);
1052
- Cache.set('chatUrl', res.data.yzfUrl);
1053
- // #endif
1054
- this.shareApi();
1055
- this.getCategoryList();
1056
- this.getLast10Order();
1057
- this.getStoreZoneAndCouponList();
1058
- this.$refs.seckill.getSeckillIndexTime();
1059
- })
1060
- getIndexConfig().then(res => {
1061
- if(res.data){
1062
- that.$set(that, "homeBanner",res.data);
1063
- }
1030
+ url: url
10641031 });
1065
- },
1066
- shareApi: function() {
1067
- getShare().then(res => {
1068
- this.$set(this, 'configApi', res.data);
1069
- // #ifdef H5
1070
- this.setOpenShare(res.data);
1071
- // #endif
1072
- })
1073
- },
1074
- getChatUrL() {
1075
- kefuConfig().then(res => {
1076
- let data = res.data;
1077
- this.$store.commit("SET_CHATURL", data.yzfUrl);
1078
- Cache.set('chatUrl', data.yzfUrl);
1079
- })
1080
- },
1081
- // 微信分享;
1082
- setOpenShare: function(data) {
1083
- let that = this;
1084
- if (that.$wechat.isWeixin()) {
1085
- let configAppMessage = {
1086
- desc: data.synopsis,
1087
- title: data.title,
1088
- link: location.href,
1089
- imgUrl: data.img
1090
- };
1091
- that.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"],
1092
- configAppMessage);
1093
- }
1094
- },
1095
- // 授权关闭
1096
- authColse: function(e) {
1097
- this.isShowAuth = e
1098
- },
1099
- // 产品切换
1100
- changeCategoryTab(index, isClick) {
1101
- let that = this;
1102
- that.categoryIndex = index;
1103
- if (isClick) {
1104
- that.clickTrack('cate', {
1105
- name: that.categoryList[that.categoryIndex].name
1106
- })
1107
- }
1108
- that.loadingGood = true;
1109
- that.where.page = 1;
1110
- that.loadend = false;
1111
- that.where.cid = that.categoryList[that.categoryIndex].id;
1112
- that.get_product_list();
1113
- },
1114
- /**
1115
- * 获取专区列表
1116
- */
1117
- getStoreZoneAndCouponList: function() {
1118
- let that = this;
1119
- // that.$set(that, 'zoneList', []);
1120
- // that.$set(that, 'couponList', []);
1121
- uni.showLoading()
1122
- getStoreZoneAndCouponList({}).then(res => {
1123
- let zoneList = [];
1124
- res.data.storeZoneList.forEach((item, index) => {
1125
- if (item.isShow) {
1126
- item.uniKey = 'storeZoneList' + zoneList.length;
1127
- zoneList.push(item);
1128
- }
1129
- })
1130
- that.$set(that, 'zoneList', zoneList);
1131
-
1132
- let useNum = 0;
1133
- res.data.storeCouponList.forEach((item, index) => {
1134
- item.uniKey = 'storeCouponList' + index;
1135
- if (item.isUse) {
1136
- useNum++;
1137
- }
1138
- })
1139
- if (useNum >= res.data.storeCouponList.length) {
1140
- that.isGetWholeCoupon = true;
1141
- } else {
1142
- that.isGetWholeCoupon = false;
1143
- }
1144
- if(that.$store.getters.isLogin){
1145
- handsList().then(giveRes=>{
1146
- res.data.storeCouponList.push({
1147
- moneyType:4,
1148
- userLvType:this.userInfo.level,
1149
- isUse:true,
1150
- name:''
1151
- })
1152
- that.$set(that, 'couponList', (giveRes.data||[]).concat(res.data.storeCouponList));
1153
- })
1154
- handsCoupon().then(res=>{
1155
- if(res.code==200){
1156
- that.$refs.popCoupon.show();
1157
- }
1158
- });
1159
- //检查用户有可以手动领取导入优惠券记录
1160
- // that.$refs.popCoupon.show();
1161
- }
1162
- that.$nextTick(() => {
1163
- that.$forceUpdate();
1164
- uni.hideLoading()
1165
- })
1166
- }).catch((e) => {
1167
- console.log(10000001, e);
1168
- uni.hideLoading()
1169
- });
1170
- },
1171
- resetCoupon(couponIds){
1172
- console.log('resetCoupon');
1173
- let that=this;
1174
- let hasCoupon4 = false;
1175
- let useNum=0;
1176
- that.couponList.forEach((item, index) => {
1177
- if (couponIds.indexOf(item.id)>=0||couponIds.indexOf(item.id+'')>=0) {
1178
- item.isUse=true;
1179
- that.$set(that.couponList[index],'isUse',true);
1180
- if (item.moneyType == 4) {
1181
- hasCoupon4 = true;
1182
- }
1183
- }
1184
- if(item.isUse){
1185
- useNum++;
1186
- }
1187
- });
1188
- if(useNum>=that.couponList.length){
1189
- that.isGetWholeCoupon = true;
1190
- }
1191
- if (hasCoupon4) {
1192
- that.changeCategoryTab(that.categoryIndex);
1193
- }
1194
- },
1195
- getLast10Order: function() {
1196
- let that = this;
1197
- getLast10Order({}).then(res => {
1198
- let data = res.data.concat(JSON.parse(JSON.stringify(res.data)));
1199
- data.forEach((item, index) => {
1200
- item.uniKey = 'buyList' + index;
1201
- });
1202
- that.$set(that, 'buyList', data);
1203
- });
1204
- },
1205
- getCategoryList: function() {
1206
- let that = this;
1207
- getCategoryList().then(res => {
1208
- res.data.forEach((item, index) => {
1209
- // if (!item.show2Category) {
1210
- // item.child.sort((a, b) => {
1211
- // return a.sort - b.sort;
1212
- // });
1213
- // that.categoryList = that.categoryList.concat(item.child)
1214
- // }
1215
- res.data[index]['uniKey'] = 'categoryList' + index;
1216
- });
1217
- that.categoryList = res.data;
1218
- that.changeCategoryTab(that.categoryIndex);
1219
- })
1220
- },
1221
- get_product_list: function() {
1222
- let that = this;
1223
- if (that.loadend) return;
1224
- if (that.loading) return;
1225
- that.loading = true;
1226
- that.loadTitle = '';
1227
- that.isPause = true;
1228
- getProductslist(that.where).then(res => {
1229
- let list = res.data.list;
1230
-
1231
- that.loading = false;
1232
- if (that.where.page > 1) {
1233
- list = that.productList.concat(list);
1234
- }
1235
- list.forEach((item, index) => {
1236
- item.uniKey = 'productList' + index;
1237
- })
1238
- that.$set(that, 'productList', list);
1239
- if (that.productList.length > 4) {
1240
- that.$set(that, 'scrollHeight', that.pageHeight - 300);
1241
- } else {
1242
- that.$set(that, 'scrollHeight', 484 * Math.round(that.productList.length / 2) + 120);
1243
- }
1244
-
1245
- if (that.where.page == 1) {
1246
- that.scrollTop = that.oldScrollTop;
1247
- that.$nextTick(() => {
1248
- that.scrollTop = 0;
1249
- });
1250
- }
1251
-
1252
- let loadend = list.length < that.where.limit;
1253
- if (that.where.page >= res.data.totalPage) {
1254
- loadend = true;
1255
- that.$set(that.where, 'page', 1);
1256
- } else {
1257
- that.$set(that.where, 'page', that.where.page + 1);
1258
- }
1259
- that.loadend = loadend;
1260
-
1261
- that.isPause = false;
1262
- that.$nextTick(() => {
1263
- that.loadingGood = false;
1264
- })
1265
- }).catch(err => {
1266
- console.log(1000000002, err);
1267
- that.loading = false;
1268
- that.isPause = false;
1269
- that.loadTitle = '加载更多';
1270
- that.$nextTick(() => {
1271
- that.loadingGood = false;
1272
- })
1273
- });
1274
- },
1275
- goodlistScroll: function(e) {
1276
- this.oldScrollTop = e.detail.scrollTop;
1277
- },
1278
- getMdayLast: function() {
1279
- let that = this;
1280
- uni.showLoading();
1281
- getMdayLast({}).then(res => {
1282
- if(res.data.mday){
1283
- that.hasLottery=true;
1284
- }
1285
- });
1286
- },
1287
- },
1288
- mounted() {
1289
- let that = this
1290
- // #ifdef H5
1291
- //that.getChatUrL();
1292
- // 获取H5 搜索框高度
1293
- let appSearchH = uni.createSelectorQuery().select(".serch-wrapper");
1294
- appSearchH.boundingClientRect(function(data) {
1295
- that.searchH = data.height
1296
- }).exec()
1297
- // #endif
1298
- },
1299
- /**
1300
- * 用户点击右上角分享
1301
- */
1302
- // #ifdef MP
1303
- onShareAppMessage: function(options) {
1304
- let shareUrl = '/pages/index/index';
1305
- if (this.$store.getters.belong) {
1306
- shareUrl += '?' + this.$util.setShareBelong(this.$store.getters.belong);
13071032 }
1308
- if(this.$store.getters.uid){
1309
- if(shareUrl.indexOf('?')>0){
1310
- shareUrl+='&spread=' + this.$store.getters.uid;
1311
- }else{
1312
- shareUrl+='?spread=' + this.$store.getters.uid;
1033
+ },
1034
+ // 健康专区图片
1035
+ zoneImg(item) {
1036
+ let img = (item && item.image) ? (item.image) : ((item && item.data && item.data.image) ? item.data.image : (item ? item.homepageImage : ''));
1037
+ return this.cleanUrl(img);
1038
+ },
1039
+ zoneSwiperChange(e) {
1040
+ this.zoneCurrent = e.detail.current;
1041
+ },
1042
+ brandSwiperChange(e) {
1043
+ this.brandCurrent = e.detail.current;
1044
+ },
1045
+ newProductSwiperChange(e) {
1046
+ this.newProductCurrent = e.detail.current;
1047
+ },
1048
+ // 热门榜单切换分类
1049
+ changeHotRank(index) {
1050
+ this.hotRankIndex = index;
1051
+ this.getRankProductList();
1052
+ },
1053
+ getRankProductList() {
1054
+ let that = this;
1055
+ let cid = this.hotCategoryList[this.hotRankIndex].id || '';
1056
+ that.rankProducts = [];
1057
+ that.isLoadingRank = true;
1058
+ getProductslist({
1059
+ cid: cid,
1060
+ page: 1,
1061
+ limit: 3,
1062
+ buyerCountOrder: 'desc',
1063
+ }).then(res => {
1064
+ that.isLoadingRank = false;
1065
+ if (res && res.data && res.data.list) {
1066
+ res.data.list.forEach((item, index) => {
1067
+ item.rank = index + 1;
1068
+ });
1069
+ if (res.data.list.length >= 3) {
1070
+ that.rankProducts = [
1071
+ res.data.list[1],
1072
+ res.data.list[0],
1073
+ res.data.list[2]
1074
+ ];
1075
+ } else {
1076
+ that.rankProducts = res.data.list;
1077
+ }
13131078 }
1314
- }
1315
- let pages = getCurrentPages(),
1316
- currPage = pages[pages.length - 1];
1317
- this.addTrack('yy_contentPageShare', {
1318
- 'sharePosition_var': options.from == 'button' ? '页面分享按钮' : '页面顶部',
1319
- 'shareMethod_var': '微信好友', //保存海报
1320
- 'pageTitle_var': '首页',
1321
- 'pageType_var': '首页',
1322
- 'pagePath_var': currPage.route,
1323
- 'productID_var': '-',
1324
- 'productName_var': '-',
1325
- 'contentId_var': '-',
1326
- 'contentName_var': '-',
1327
- 'contentType_var': '-',
1328
- 'contentLabel_var': '-',
1079
+ }).catch(() => {
1080
+ that.isLoadingRank = false;
13291081 });
1330
- return {
1331
- title: this.configApi.title,
1332
- imageUrl: this.configApi.img,
1333
- desc: this.configApi.synopsis,
1334
- path: shareUrl
1082
+
1083
+ },
1084
+ // 已购人数格式化(过万显示X万+)
1085
+ formatBuyCount(num) {
1086
+ let n = Math.floor(Number(num) || 0);
1087
+ if (n >= 10000) {
1088
+ return Math.floor(n / 1000) / 10 + '万+';
1089
+ }
1090
+ return n + '';
1091
+ },
1092
+ // 榜单商品跳转详情
1093
+ goRankProduct(p) {
1094
+ if (!p || !p.id) return;
1095
+ this.clickTrack('module', {
1096
+ name: p.storeName
1097
+ });
1098
+ uni.navigateTo({
1099
+ url: '/pages/goods_details/index?id=' + p.id
1100
+ });
1101
+ },
1102
+ dealSwiperChange(e) {
1103
+ this.dealCurrent = e.detail.current;
1104
+ },
1105
+ bannerSwiperChange(e) {
1106
+ this.bannerCurrent = e.detail.current;
1107
+ },
1108
+ // 每日特价倒计时(以服务端时间为准,到当天23:59:59)
1109
+ initDealCountdown(serverTime) {
1110
+ let that = this;
1111
+ let now = Number(serverTime) || Date.now();
1112
+ that.serverTimeOffset = now - Date.now();
1113
+ let d = new Date(now);
1114
+ that.dealEndTs = new Date(d.getFullYear(), d.getMonth(), d.getDate(), 23, 59, 59).getTime();
1115
+ clearInterval(that.dealTimer);
1116
+ that.updateDealCountdown();
1117
+ that.dealTimer = setInterval(function () {
1118
+ that.updateDealCountdown();
1119
+ }, 1000);
1120
+ },
1121
+ updateDealCountdown() {
1122
+ let diff = Math.max(0, Math.floor((this.dealEndTs - (Date.now() + this.serverTimeOffset)) / 1000));
1123
+ let h = Math.floor(diff / 3600);
1124
+ let m = Math.floor((diff % 3600) / 60);
1125
+ let s = diff % 60;
1126
+ let pad = function (n) {
1127
+ return n < 10 ? '0' + n : '' + n;
1128
+ }
1129
+ this.dealCountdown = {
1130
+ h: pad(h),
1131
+ m: pad(m),
1132
+ s: pad(s)
13351133 };
13361134 },
1135
+ belongInfoReadyFn(data) {
1136
+ let that = this;
1137
+ if (!data.isRegister) {
1138
+ that.checkLoginFn();
1139
+ }
1140
+ },
1141
+ checkLoginFn() {
1142
+ let that = this;
1143
+ let pages = getCurrentPages(),
1144
+ currPage = pages[pages.length - 1];
1145
+ that.addTrack('yy_pageView', {
1146
+ pageTitle_var: '首页',
1147
+ pagePath_var: currPage.route,
1148
+ pageType_var: '首页'
1149
+ });
1150
+ that.getIndexData();
1151
+ if (that.$store.getters.isLogin) {
1152
+ that.onLoadFn();
1153
+ } else {
1154
+ that.userInfoReady = 'needRegister';
1155
+ }
1156
+ uni.$once('loginFlSuccess', that.registerFn);
1157
+ },
1158
+
1159
+ registerFn() {
1160
+ console.log('registerFn');
1161
+ let that = this;
1162
+ if (that.loginBackFn) {
1163
+ that.loginBackFn();
1164
+ }
1165
+ that.loginBackFn = null;
1166
+ },
1167
+ getUserBean() {
1168
+ let that = this;
1169
+ getUserBean().then(res2 => {
1170
+ that.careBeanReady = true;
1171
+ that.myCareBean = res2.data.totalCareBeans;
1172
+ });
1173
+ },
1174
+ onLoadFn() {
1175
+ let that = this;
1176
+ that.userInfo = that.$store.getters.userInfo;
1177
+ that.getUserBean();
1178
+ that.userInfoReady = 'hasUserInfo';
1179
+ that.getBaseUserInfo();
1180
+
1181
+ },
1182
+ clickTrack(type, item) {
1183
+ var data = {
1184
+ pageTitle_var: '首页',
1185
+ firstTabName_var: '-'
1186
+ };
1187
+ if (type == 'search') {
1188
+ data['moduleName_var'] = '页面顶部';
1189
+ data['buttonName_var'] = '搜索商品';
1190
+ }
1191
+ if (type == 'third') {
1192
+ data['moduleName_var'] = '页面顶部';
1193
+ data['buttonName_var'] = '查看悦养豆';
1194
+ }
1195
+ if (type == 'vip') {
1196
+ data['moduleName_var'] = '页面顶部';
1197
+ data['buttonName_var'] = '查看会员权益';
1198
+ } else if (type == 'banner') {
1199
+ data['moduleName_var'] = '轮播卡片';
1200
+ data['buttonName_var'] = item.name ? item.name : '-';
1201
+ } else if (type == 'menu') {
1202
+ data['moduleName_var'] = '金刚位';
1203
+ data['buttonName_var'] = item.name ? item.name : '-';
1204
+ } else if (type == 'zone') {
1205
+ data['moduleName_var'] = '探索健康好物';
1206
+ data['buttonName_var'] = item.name ? item.name : '-';
1207
+ } else if (type == 'lottery') {
1208
+ data['moduleName_var'] = '抽奖';
1209
+ data['buttonName_var'] = 'GO';
1210
+ } else if (type == 'coupon') {
1211
+ data['moduleName_var'] = '优惠券';
1212
+ data['buttonName_var'] = item.name ? item.name : '-';
1213
+ } else if (type == 'cate') {
1214
+ data['moduleName_var'] = '商品分类';
1215
+ data['buttonName_var'] = item.name ? item.name : '-';
1216
+ } else if (type == 'module') {
1217
+ data['moduleName_var'] = '首页运营模块';
1218
+ data['buttonName_var'] = item.name ? item.name : '-';
1219
+ }
1220
+ this.addTrack('yy_marketPageClick', data);
1221
+ },
1222
+ goToThird(url, appId) {
1223
+ //第三方小程序
1224
+ // /pages/home/index?source=INSMART&sourceScene=test&agentNo=90028476&agentChannel=BK&agentCompany=123&agentBranch=123
1225
+
1226
+ if (url.indexOf('?') < 0) {
1227
+ url += '?';
1228
+ } else {
1229
+ url += '&';
1230
+ }
1231
+ if (app.globalData.source) {
1232
+ url += 'source=' + app.globalData.source;
1233
+ } else {
1234
+ url += 'source=MALL';
1235
+ }
1236
+ url += '&sourceScene=home';
1237
+ url += '&agentNo=' + ((this.$store.getters.belong && this.$store.getters.belong.agentNo) ? this.$store
1238
+ .getters.belong.agentNo : '');
1239
+ url += '&agentChannel=' + ((this.$store.getters.belong && this.$store.getters.belong.channel) ? this.$store
1240
+ .getters.belong.channel : ''); //归属代理人渠道
1241
+ url += '&agentCompany=' + ((this.$store.getters.belong && this.$store.getters.belong.companyCode) ? this
1242
+ .$store.getters.belong.companyCode : ''); //agentCompany
1243
+
1244
+ url += '&agentBranch=' + ((this.$store.getters.belong && this.$store.getters.belong.branchCode) ? this
1245
+ .$store.getters.belong.branchCode : ''); //归属代理人支公司
1246
+ url += '&custAgentOrgNo=' + ((this.$store.getters.belong && this.$store.getters.belong.subCode) ? this
1247
+ .$store.getters.belong.subCode : ''); //归属代理人机构编码
1248
+
1249
+ url += 'unionId=' + this.$store.getters.unionId;
1250
+ url += '&mobile=' + ((this.$store.getters.belong && this.$store.getters.belong.mobile) ? this.$store
1251
+ .getters.belong.mobile : this.$store.getters.userInfo.mobile);
1252
+ console.log(url);
1253
+
1254
+
1255
+
1256
+ let miniProgramInfo = uni.getAccountInfoSync().miniProgram;
1257
+ uni.navigateToMiniProgram({
1258
+ appId: appId ? appId : THIRD_APPID,
1259
+ path: url,
1260
+ envVersion: miniProgramInfo.envVersion == 'release' ? 'release' : 'trial',
1261
+ })
1262
+
1263
+ // let params={};
1264
+ // params['custAgentNo']=((this.$store.getters.belong && this.$store.getters.belong.agentNo) ? this.$store
1265
+ // .getters.belong.agentNo : '');
1266
+ // params['custAgentChnl']=((this.$store.getters.belong && this.$store.getters.belong.channel) ? this.$store
1267
+ // .getters.belong.channel : '');
1268
+ // params['custAgentCoy']=((this.$store.getters.belong && this.$store.getters.belong.companyCode) ? this
1269
+ // .$store.getters.belong.companyCode : '');
1270
+ // params['custAgentBranch']=((this.$store.getters.belong && this.$store.getters.belong.branchCode) ? this
1271
+ // .$store.getters.belong.branchCode : '');
1272
+ // params['custAgentOrgNo']=((this.$store.getters.belong && this.$store.getters.belong.subCode) ? this
1273
+ // .$store.getters.belong.subCode : '');
1274
+ // let webUrl='https://ossacmall.bluedeer.com.cn/qr/index.html?isMall=true'+(miniProgramInfo.envVersion == 'release' ? '' : '&isTrial=true')+'&params='+encodeURIComponent(JSON.stringify(params))+'&pageUrl='+encodeURIComponent(url);
1275
+ // if(HTTP_REQUEST_URL.indexOf('tohours')>0){
1276
+ // webUrl=webUrl.replace('https://ossacmall.bluedeer.com.cn/qr','https://sit.tohours.com/crmeb_web/qr/')
1277
+ // }
1278
+ // uni.navigateTo({
1279
+ // url: '/pages/users/web_page/index?webUel='+encodeURIComponent(webUrl)
1280
+ // })
1281
+
1282
+ this.clickTrack('third')
1283
+ },
1284
+ goToLink(item, type) {
1285
+ let that = this;
1286
+ function go() {
1287
+ if (item.appid) {
1288
+ that.goToThird(item.url, item.appid);
1289
+ } else if (that.isTabLink(item.url)) {
1290
+ let arr = item.url.split('?');
1291
+ if (arr.length > 1) {
1292
+ that.$store.commit('updateSwitchParams', {
1293
+ switchParams: arr[1]
1294
+ });
1295
+ }
1296
+ uni.switchTab({
1297
+ url: arr[0]
1298
+ });
1299
+ } else {
1300
+ uni.navigateTo({
1301
+ url: item.url.replace("{{token}}", that.$store.getters.token).replace("{{unionId}}", that.$store.getters.unionId)
1302
+ })
1303
+ }
1304
+ that.clickTrack(type, item);
1305
+ }
1306
+ console.log(item.url);
1307
+ if (item.url.indexOf('needLogin=true') > 0 && !that.$store.getters.isLogin) {
1308
+ toLogin(that);
1309
+ that.loginBackFn = function () {
1310
+ go();
1311
+ }
1312
+ } else {
1313
+ go();
1314
+ }
1315
+
1316
+
1317
+ },
1318
+ isTabLink(link) {
1319
+ let isTab = false;
1320
+ this.tabLinkArr.forEach((item) => {
1321
+ if (link.indexOf(item) >= 0) {
1322
+ isTab = true;
1323
+ }
1324
+ })
1325
+ return isTab;
1326
+ },
1327
+ handleLoad() {
1328
+ let that = this;
1329
+ },
1330
+ goToLogin() {
1331
+ let that = this;
1332
+ toLogin(that);
1333
+ that.loginBackFn = function () {
1334
+ that.userInfo = that.$store.getters.userInfo;
1335
+ that.userInfoReady = 'hasUserInfo';
1336
+ that.getBaseUserInfo();
1337
+ that.getIndexData();
1338
+ that.onLoadFn();
1339
+ }
1340
+ },
1341
+ getBaseUserInfo() {
1342
+ let that = this;
1343
+ silenceBindingSpread();
1344
+ },
1345
+ goToCoupon: function () {
1346
+ uni.navigateTo({
1347
+ url: '/pages/users/user_coupon/index'
1348
+ })
1349
+ },
1350
+ getCoupon: function (isWhole, orgItem, index) {
1351
+ let that = this;
1352
+ if (!that.$store.getters.isLogin) {
1353
+ that.goToLogin();
1354
+ return false;
1355
+ }
1356
+ if (that.isClicking) {
1357
+ return false;
1358
+ }
1359
+ //领取优惠券
1360
+ if (isWhole) {
1361
+ this.clickTrack('coupon', {
1362
+ 'name': '一键领取'
1363
+ })
1364
+ let couponIds = [];
1365
+ that.couponList.forEach((item1, index1) => {
1366
+ if (!item1.isUse && item1.type != 'import') {
1367
+ couponIds.push(item1.id);
1368
+ }
1369
+ })
1370
+ if (couponIds.length > 0) {
1371
+ var useNum = 0;
1372
+ uni.showLoading();
1373
+ that.isClicking = true;
1374
+ setWholeCouponReceive({
1375
+ couponIds: couponIds,
1376
+ }).then(function (res) {
1377
+ that.$util.Tips({
1378
+ title: '领取成功'
1379
+ });
1380
+ let nameArr = [];
1381
+ let idArr = [];
1382
+ let hasCoupon4 = false;
1383
+ that.couponList.forEach((item1, index1) => {
1384
+ if (!item1.isUse && item1.type != 'import') {
1385
+ that.couponList[index1].isUse = true;
1386
+ nameArr.push(item1.name);
1387
+ idArr.push(item1.id);
1388
+ }
1389
+ if (item1.moneyType == 4) {
1390
+ hasCoupon4 = true;
1391
+ }
1392
+ });
1393
+ that.isGetWholeCoupon = true;
1394
+ that.addTrack('yy_getCoupon', {
1395
+ 'couponName_var': nameArr.join(','),
1396
+ 'couponId_var': idArr.join(',')
1397
+ });
1398
+ if (hasCoupon4) {
1399
+ that.changeCategoryTab(that.categoryIndex);
1400
+ }
1401
+ uni.hideLoading();
1402
+ that.isClicking = false;
1403
+ }).catch(err => {
1404
+ uni.hideLoading();
1405
+ that.isClicking = false;
1406
+ return that.$util.Tips({
1407
+ title: (err && err.message) ? err.message : err
1408
+ });
1409
+ });
1410
+ }
1411
+ } else {
1412
+ let item = orgItem || this.couponList[index]
1413
+ if (item.isUse || (item.type == 'import' && item.validStr == 'usable')) {
1414
+
1415
+ that.isClicking = true;
1416
+ var timer = setTimeout(() => {
1417
+ that.isClicking = false;
1418
+ clearTimeout(timer);
1419
+ }, 500)
1420
+ if (item.appId && item.toPath) {
1421
+ that.goToThird(item.toPath, item.appId);
1422
+ } else if (item.toPath) {
1423
+ if (that.isTabLink(item.toPath)) {
1424
+ uni.switchTab({
1425
+ url: item.toPath
1426
+ })
1427
+ } else {
1428
+ uni.navigateTo({
1429
+ url: item.toPath
1430
+ })
1431
+ }
1432
+ } else {
1433
+ uni.switchTab({
1434
+ url: '/pages/goods_cate/goods_cate'
1435
+ })
1436
+ }
1437
+ } else if (item.type !== 'import') {
1438
+ uni.showLoading();
1439
+ that.isClicking = true;
1440
+ setCouponReceive(item.id).then(function (res) {
1441
+ that.addTrack('yy_getCoupon', {
1442
+ 'couponName_var': item.name,
1443
+ 'couponId_var': item.id
1444
+ });
1445
+ that.$set(that.couponList[index], 'isUse', true);
1446
+ that.$util.Tips({
1447
+ title: '领取成功'
1448
+ });
1449
+ if (item.moneyType == 4) {
1450
+ that.changeCategoryTab(that.categoryIndex);
1451
+ }
1452
+ let finishNum = 0;
1453
+ that.couponList.forEach((item1, index1) => {
1454
+ if (item1.isUse) {
1455
+ finishNum++;
1456
+ }
1457
+ });
1458
+ if (finishNum >= that.couponList.length) {
1459
+ that.isGetWholeCoupon = true;
1460
+ }
1461
+ uni.hideLoading();
1462
+ that.isClicking = false;
1463
+ }).catch(err => {
1464
+ uni.hideLoading();
1465
+ that.isClicking = false;
1466
+ return that.$util.Tips({
1467
+ title: (err && err.message) ? err.message : err
1468
+ });
1469
+ })
1470
+ }
1471
+
1472
+ }
1473
+ },
1474
+ clickSort(index) {
1475
+ this.listActive = index
1476
+ },
1477
+ // scroll-view滑动事件
1478
+ scroll(e) {
1479
+ this.scrollLeft = e.detail.scrollLeft;
1480
+ },
1481
+ // 计算下划线位置
1482
+ setLine() {
1483
+ let lineWidth = 0,
1484
+ lineLeft = 0
1485
+ this.getElementData(`#tab_item`, (data) => {
1486
+ let el = data[this.listActive]
1487
+ lineWidth = el.width / 2
1488
+ // lineLeft = el.width * (this.currentIndex + 0.5) // 此种只能针对每个item长度一致的
1489
+ lineLeft = el.width / 2 + (-data[0].left) + el.left
1490
+ this.lineStyle = {
1491
+ width: `${lineWidth}px`,
1492
+ transform: `translateX(${lineLeft}px) translateX(-50%)`,
1493
+ transitionDuration: `${this.duration}s`
1494
+ };
1495
+ })
1496
+ },
1497
+ getElementData(el, callback) {
1498
+ uni.createSelectorQuery().in(this).selectAll(el).boundingClientRect().exec((data) => {
1499
+ callback(data[0]);
1500
+ });
1501
+ },
1502
+ xieyiApp() {
1503
+ uni.navigateTo({
1504
+ url: '/pages/users/web_page/index?webUel=https://admin.java.crmeb.net/useragreement/xieyi.html&title=协议内容'
1505
+ })
1506
+ },
1507
+ getTemlIds() {
1508
+ for (var i in arrTemp) {
1509
+ this.getTem(arrTemp[i]);
1510
+ }
1511
+ },
1512
+ getTem(data) {
1513
+ getTemlIds({
1514
+ type: data
1515
+ }).then(res => {
1516
+ if (res.data) {
1517
+ let arr = res.data.map((item) => {
1518
+ return item.tempId
1519
+ })
1520
+ wx.setStorageSync('tempID' + data, arr);
1521
+ }
1522
+ })
1523
+ },
1524
+ showActivity() {
1525
+ this.$refs.popNewuserRef.show();
1526
+ },
1527
+ // 首页数据
1528
+ getIndexData: function () {
1529
+ let that = this;
1530
+ that.hasCheckedLogin = true;
1531
+ getIndexData().then(res => {
1532
+ let homePopupList = []
1533
+ if (res.data.homePopupList) {
1534
+ homePopupList = res.data.homePopupList.map(item => {
1535
+ return {
1536
+ image: item.image,
1537
+ linkUrl: item.linkUrl
1538
+ }
1539
+ })
1540
+ }
1541
+ that.$set(that, "homeActivity", {
1542
+ // homeDate:res.data.homeDate,
1543
+ // homeImg:res.data.homeImg,
1544
+ // homeUrl:res.data.homeUrl,
1545
+ homePopupList: homePopupList
1546
+ });
1547
+ that.$nextTick(() => {
1548
+ that.$refs.popActivity.show();
1549
+ })
1550
+ that.isConfigReady = true;
1551
+ uni.setNavigationBarTitle({
1552
+ title: '首页'
1553
+ })
1554
+ that.$set(that, "logoUrl", res.data.logoUrl);
1555
+ that.$set(that, "site_name", '首页');
1556
+ if (res.data.banner) {
1557
+ res.data.banner.forEach((item, index) => {
1558
+ item.uniKey = 'banner' + index;
1559
+ })
1560
+ }
1561
+ that.$set(that, "imgUrls", res.data.banner ? res.data.banner : []);
1562
+ if (res.data.menus) {
1563
+ res.data.menus.forEach((item, index) => {
1564
+ item.uniKey = 'menus' + index;
1565
+ })
1566
+ }
1567
+ that.$set(that, "menus", res.data.menus ? res.data.menus : []);
1568
+ if (res.data.roll) {
1569
+ res.data.roll.forEach((item, index) => {
1570
+ item.uniKey = 'roll' + index;
1571
+ })
1572
+ }
1573
+ that.$set(that, "roll", res.data.roll ? res.data.roll : []);
1574
+ // #ifdef H5
1575
+ that.$store.commit("SET_CHATURL", res.data.yzfUrl);
1576
+ Cache.set('chatUrl', res.data.yzfUrl);
1577
+ // #endif
1578
+ this.shareApi();
1579
+ this.getCategoryList();
1580
+ this.getLast10Order();
1581
+ this.getStoreZoneAndCouponList();
1582
+ this.$refs.seckill.getSeckillIndexTime();
1583
+ this.getIndexModule();
1584
+ })
1585
+ getIndexConfig().then(res => {
1586
+ if (res.data) {
1587
+ that.$set(that, "homeBanner", res.data);
1588
+ }
1589
+ });
1590
+ },
1591
+ getIndexModule: function () {
1592
+ let that = this;
1593
+ getIndexModule().then(res => {
1594
+ if (res.data && res.data.modules) {
1595
+ let modules = res.data.modules || [];
1596
+ if (res.data.serverTime) {
1597
+ that.initDealCountdown(res.data.serverTime);
1598
+ }
1599
+ modules.forEach((item, index) => {
1600
+ if (item.items) {
1601
+ item.items = item.items.slice().sort((a, b) => (a.sort || 0) - (b.sort || 0));
1602
+ item.items.forEach((item1, index1) => {
1603
+ item1.uniKey = 'module' + item.id + '_' + index1;
1604
+ })
1605
+ }
1606
+ if (item.code == 'service_guarantee') {
1607
+ that.$set(that, "serviceSupport", item);
1608
+ } else if (item.code == 'daily_deal') {
1609
+ that.$set(that, "dealModule", item);
1610
+ } else if (item.code == 'new_product') {
1611
+ that.$set(that, "newProductModule", item);
1612
+ } else if (item.code == 'health_zone') {
1613
+ that.$set(that, "healthZoneModule", item);
1614
+ } else if (item.code == 'activity_banner') {
1615
+ that.$set(that, "activityBannerModule", item);
1616
+ } else if (item.code == 'hot_rank') {
1617
+ that.$set(that, "hotRankModule", item);
1618
+ that.hotRankIndex = 0;
1619
+ that.getRankProductList();
1620
+ } else if (item.code == 'brand_wall') {
1621
+ that.$set(that, "brandWallModule", item);
1622
+ }
1623
+ })
1624
+ }
1625
+ });
1626
+ },
1627
+ shareApi: function () {
1628
+ getShare().then(res => {
1629
+ this.$set(this, 'configApi', res.data);
1630
+ // #ifdef H5
1631
+ this.setOpenShare(res.data);
1632
+ // #endif
1633
+ })
1634
+ },
1635
+ getChatUrL() {
1636
+ kefuConfig().then(res => {
1637
+ let data = res.data;
1638
+ this.$store.commit("SET_CHATURL", data.yzfUrl);
1639
+ Cache.set('chatUrl', data.yzfUrl);
1640
+ })
1641
+ },
1642
+ // 微信分享;
1643
+ setOpenShare: function (data) {
1644
+ let that = this;
1645
+ if (that.$wechat.isWeixin()) {
1646
+ let configAppMessage = {
1647
+ desc: data.synopsis,
1648
+ title: data.title,
1649
+ link: location.href,
1650
+ imgUrl: data.img
1651
+ };
1652
+ that.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"],
1653
+ configAppMessage);
1654
+ }
1655
+ },
1656
+ // 授权关闭
1657
+ authColse: function (e) {
1658
+ this.isShowAuth = e
1659
+ },
1660
+ // 产品切换
1661
+ changeCategoryTab(index, isClick) {
1662
+ let that = this;
1663
+ that.categoryIndex = index;
1664
+ if (isClick) {
1665
+ that.clickTrack('cate', {
1666
+ name: that.categoryList[that.categoryIndex].name
1667
+ })
1668
+ }
1669
+ that.loadingGood = true;
1670
+ that.where.page = 1;
1671
+ that.loadend = false;
1672
+ that.where.cid = that.categoryList[that.categoryIndex].id;
1673
+ that.get_product_list();
1674
+ },
1675
+ /**
1676
+ * 获取专区列表
1677
+ */
1678
+ getStoreZoneAndCouponList: function () {
1679
+ let that = this;
1680
+ // that.$set(that, 'zoneList', []);
1681
+ // that.$set(that, 'couponList', []);
1682
+ uni.showLoading()
1683
+ getStoreZoneAndCouponList({}).then(res => {
1684
+ let zoneList = [];
1685
+ res.data.storeZoneList.forEach((item, index) => {
1686
+ if (item.isShow) {
1687
+ item.uniKey = 'storeZoneList' + zoneList.length;
1688
+ zoneList.push(item);
1689
+ }
1690
+ })
1691
+ that.$set(that, 'zoneList', zoneList);
1692
+
1693
+ let useNum = 0;
1694
+ res.data.storeCouponList.forEach((item, index) => {
1695
+ item.uniKey = 'storeCouponList' + index;
1696
+ if (item.isUse) {
1697
+ useNum++;
1698
+ }
1699
+ })
1700
+ if (useNum >= res.data.storeCouponList.length) {
1701
+ that.isGetWholeCoupon = true;
1702
+ } else {
1703
+ that.isGetWholeCoupon = false;
1704
+ }
1705
+ if (that.$store.getters.isLogin) {
1706
+ handsList().then(giveRes => {
1707
+ res.data.storeCouponList.push({
1708
+ moneyType: 4,
1709
+ userLvType: this.userInfo.level,
1710
+ isUse: true,
1711
+ name: ''
1712
+ })
1713
+ that.$set(that, 'couponList', (giveRes.data || []).concat(res.data.storeCouponList));
1714
+ })
1715
+ handsCoupon().then(res => {
1716
+ if (res.code == 200) {
1717
+ that.$refs.popCoupon.show();
1718
+ }
1719
+ });
1720
+ //检查用户有可以手动领取导入优惠券记录
1721
+ // that.$refs.popCoupon.show();
1722
+ }
1723
+ that.$nextTick(() => {
1724
+ that.$forceUpdate();
1725
+ uni.hideLoading()
1726
+ })
1727
+ }).catch((e) => {
1728
+ console.log(10000001, e);
1729
+ uni.hideLoading()
1730
+ });
1731
+ },
1732
+ resetCoupon(couponIds) {
1733
+ console.log('resetCoupon');
1734
+ let that = this;
1735
+ let hasCoupon4 = false;
1736
+ let useNum = 0;
1737
+ that.couponList.forEach((item, index) => {
1738
+ if (couponIds.indexOf(item.id) >= 0 || couponIds.indexOf(item.id + '') >= 0) {
1739
+ item.isUse = true;
1740
+ that.$set(that.couponList[index], 'isUse', true);
1741
+ if (item.moneyType == 4) {
1742
+ hasCoupon4 = true;
1743
+ }
1744
+ }
1745
+ if (item.isUse) {
1746
+ useNum++;
1747
+ }
1748
+ });
1749
+ if (useNum >= that.couponList.length) {
1750
+ that.isGetWholeCoupon = true;
1751
+ }
1752
+ if (hasCoupon4) {
1753
+ that.changeCategoryTab(that.categoryIndex);
1754
+ }
1755
+ },
1756
+ getLast10Order: function () {
1757
+ let that = this;
1758
+ getLast10Order({}).then(res => {
1759
+ let data = res.data.concat(JSON.parse(JSON.stringify(res.data)));
1760
+ data.forEach((item, index) => {
1761
+ item.uniKey = 'buyList' + index;
1762
+ });
1763
+ that.$set(that, 'buyList', data);
1764
+ });
1765
+ },
1766
+ getCategoryList: function () {
1767
+ let that = this;
1768
+ getCategoryList().then(res => {
1769
+ res.data.forEach((item, index) => {
1770
+ // if (!item.show2Category) {
1771
+ // item.child.sort((a, b) => {
1772
+ // return a.sort - b.sort;
1773
+ // });
1774
+ // that.categoryList = that.categoryList.concat(item.child)
1775
+ // }
1776
+ res.data[index]['uniKey'] = 'categoryList' + index;
1777
+ });
1778
+ that.categoryList = res.data;
1779
+ that.hotCategoryList = [];
1780
+ that.hotCategoryList.unshift({
1781
+ id: 0,
1782
+ name: '全部'
1783
+ });
1784
+ res.data.forEach((item, index) => {
1785
+ if (item.name !== '为您推荐') {
1786
+ that.hotCategoryList.push(item);
1787
+ }
1788
+ });
1789
+ that.changeCategoryTab(that.categoryIndex);
1790
+ })
1791
+ },
1792
+ get_product_list: function () {
1793
+ let that = this;
1794
+ if (that.loadend) return;
1795
+ if (that.loading) return;
1796
+ that.loading = true;
1797
+ that.loadTitle = '';
1798
+ that.isPause = true;
1799
+ getProductslist(that.where).then(res => {
1800
+ let list = res.data.list;
1801
+
1802
+ that.loading = false;
1803
+ if (that.where.page > 1) {
1804
+ list = that.productList.concat(list);
1805
+ }
1806
+ list.forEach((item, index) => {
1807
+ item.uniKey = 'productList' + index;
1808
+ })
1809
+ that.$set(that, 'productList', list);
1810
+ if (that.productList.length > 4) {
1811
+ that.$set(that, 'scrollHeight', that.pageHeight - 300);
1812
+ } else {
1813
+ that.$set(that, 'scrollHeight', 484 * Math.round(that.productList.length / 2) + 120);
1814
+ }
1815
+
1816
+ if (that.where.page == 1) {
1817
+ that.scrollTop = that.oldScrollTop;
1818
+ that.$nextTick(() => {
1819
+ that.scrollTop = 0;
1820
+ });
1821
+ }
1822
+
1823
+ let loadend = list.length < that.where.limit;
1824
+ if (that.where.page >= res.data.totalPage) {
1825
+ loadend = true;
1826
+ that.$set(that.where, 'page', 1);
1827
+ } else {
1828
+ that.$set(that.where, 'page', that.where.page + 1);
1829
+ }
1830
+ that.loadend = loadend;
1831
+
1832
+ that.isPause = false;
1833
+ that.$nextTick(() => {
1834
+ that.loadingGood = false;
1835
+ })
1836
+ }).catch(err => {
1837
+ console.log(1000000002, err);
1838
+ that.loading = false;
1839
+ that.isPause = false;
1840
+ that.loadTitle = '加载更多';
1841
+ that.$nextTick(() => {
1842
+ that.loadingGood = false;
1843
+ })
1844
+ });
1845
+ },
1846
+ goodlistScroll: function (e) {
1847
+ this.oldScrollTop = e.detail.scrollTop;
1848
+ },
1849
+ getMdayLast: function () {
1850
+ let that = this;
1851
+ uni.showLoading();
1852
+ getMdayLast({}).then(res => {
1853
+ if (res.data.mday) {
1854
+ that.hasLottery = true;
1855
+ }
1856
+ });
1857
+ },
1858
+ },
1859
+ mounted() {
1860
+ let that = this
1861
+ // #ifdef H5
1862
+ //that.getChatUrL();
1863
+ // 获取H5 搜索框高度
1864
+ let appSearchH = uni.createSelectorQuery().select(".serch-wrapper");
1865
+ appSearchH.boundingClientRect(function (data) {
1866
+ that.searchH = data.height
1867
+ }).exec()
13371868 // #endif
1338
- }
1869
+ },
1870
+ /**
1871
+ * 用户点击右上角分享
1872
+ */
1873
+ // #ifdef MP
1874
+ onShareAppMessage: function (options) {
1875
+ let shareUrl = '/pages/index/index';
1876
+ if (this.$store.getters.belong) {
1877
+ shareUrl += '?' + this.$util.setShareBelong(this.$store.getters.belong);
1878
+ }
1879
+ if (this.$store.getters.uid) {
1880
+ if (shareUrl.indexOf('?') > 0) {
1881
+ shareUrl += '&spread=' + this.$store.getters.uid;
1882
+ } else {
1883
+ shareUrl += '?spread=' + this.$store.getters.uid;
1884
+ }
1885
+ }
1886
+ let pages = getCurrentPages(),
1887
+ currPage = pages[pages.length - 1];
1888
+ this.addTrack('yy_contentPageShare', {
1889
+ 'sharePosition_var': options.from == 'button' ? '页面分享按钮' : '页面顶部',
1890
+ 'shareMethod_var': '微信好友', //保存海报
1891
+ 'pageTitle_var': '首页',
1892
+ 'pageType_var': '首页',
1893
+ 'pagePath_var': currPage.route,
1894
+ 'productID_var': '-',
1895
+ 'productName_var': '-',
1896
+ 'contentId_var': '-',
1897
+ 'contentName_var': '-',
1898
+ 'contentType_var': '-',
1899
+ 'contentLabel_var': '-',
1900
+ });
1901
+ return {
1902
+ title: this.configApi.title,
1903
+ imageUrl: this.configApi.img,
1904
+ desc: this.configApi.synopsis,
1905
+ path: shareUrl
1906
+ };
1907
+ },
1908
+ // #endif
1909
+}
13391910 </script>
13401911 <style>
1341
- page {
1342
- display: flex;
1343
- flex-direction: column;
1344
- height: 100%;
1345
- /* #ifdef H5 */
1346
- background-color: #fff;
1347
- /* #endif */
1912
+page {
1913
+ display: flex;
1914
+ flex-direction: column;
1915
+ height: 100%;
1916
+ /* #ifdef H5 */
1917
+ background-color: #fff;
1918
+ /* #endif */
13481919
1349
- }
1920
+}
1921
+
1922
+@font-face {
1923
+ font-family: 'gotham';
1924
+ src: url('gotham.ttf') format('truetype');
1925
+}
13501926 </style>
13511927 <style lang="scss">
1352
- .index_info{
1353
- width: 690rpx;
1354
- height: 70rpx;
1355
- display: block;
1356
- margin: 0 auto;
1357
- margin-bottom: 20rpx;
1358
- }
1359
- .notice {
1360
- width: 100%;
1361
- height: 70rpx;
1362
- border-radius: 10rpx;
1363
- background-color: #fff;
1364
- margin-bottom: 25rpx;
1365
- line-height: 70rpx;
1366
- padding: 0 14rpx;
1928
+.serviceSupport {
1929
+ width: 690rpx;
1930
+ display: flex;
1931
+ margin: 0 auto;
1932
+ margin-bottom: 20rpx;
1933
+ border-radius: 15rpx;
1934
+ background: linear-gradient(to right, #68ecd9, #a8f696, #cdf3ea);
1935
+ justify-content: space-evenly;
1936
+ align-items: center;
13671937
1368
- .line {
1369
- color: #CCCCCC;
1938
+ .serviceSupport_item {
1939
+ display: flex;
1940
+ align-items: center;
1941
+ justify-content: center;
1942
+ height: 68rpx;
1943
+
1944
+ .serviceSupport_itemImg {
1945
+ width: 33rpx;
1946
+ height: 33rpx;
1947
+ margin-right: 12rpx;
13701948 }
13711949
1372
- .pic {
1373
- width: 130rpx;
1374
- height: 36rpx;
1950
+ .serviceSupport_itemText {
1951
+ font-size: 22rpx;
1952
+ color: #096f50;
1953
+ line-height: 68rpx;
1954
+ }
1955
+ }
1956
+}
13751957
1376
- image {
1377
- width: 100%;
1378
- height: 100%;
1379
- display: block !important;
1958
+/* 首页运营模块 */
1959
+.promotion_pair {
1960
+ width: 690rpx;
1961
+ margin: 0 auto 20rpx;
1962
+ display: flex;
1963
+ justify-content: space-between;
1964
+ align-items: flex-start;
1965
+
1966
+ .pair_deal {
1967
+ width: 335rpx;
1968
+ height: 628rpx;
1969
+ background: url("https://ossacmall.bluedeer.com.cn/app/static/images/index_moduleDeal.png") center center/contain no-repeat;
1970
+ box-sizing: border-box;
1971
+ border-radius: 24rpx;
1972
+ overflow: hidden;
1973
+ position: relative;
1974
+
1975
+ .pair_deal_head {
1976
+ display: flex;
1977
+ align-items: center;
1978
+ padding-top: 7rpx;
1979
+
1980
+ .pair_deal_badge {
1981
+ width: 166rpx;
1982
+ height: 54rpx;
1983
+ line-height: 54rpx;
1984
+ padding: 0 18rpx;
1985
+ color: #fff;
1986
+ font-size: 28rpx;
1987
+ text-align: center;
1988
+ font-weight: bold;
1989
+ white-space: nowrap;
1990
+ }
1991
+
1992
+ .deal_count {
1993
+ display: flex;
1994
+ align-items: center;
1995
+ padding-left: 6rpx;
1996
+
1997
+ .deal_count_num {
1998
+ width: 40rpx;
1999
+ white-space: nowrap;
2000
+ height: 40rpx;
2001
+ line-height: 40rpx;
2002
+ box-sizing: border-box;
2003
+ text-align: center;
2004
+ background: linear-gradient(180deg, #ffe95c 0%, #ffc93c 100%);
2005
+ border-radius: 10rpx;
2006
+ color: #000000;
2007
+ font-size: 26rpx;
2008
+ font-weight: bold;
2009
+ }
2010
+
2011
+ .deal_count_sep {
2012
+ margin: 0 5rpx;
2013
+ color: #000000;
2014
+ font-weight: bold;
2015
+ }
13802016 }
13812017 }
13822018
1383
- .swipers {
1384
- height: 100%;
1385
- width: 444rpx;
2019
+ .pair_deal_sub {
2020
+ margin-top: 6rpx;
2021
+ text-align: center;
2022
+ font-size: 24rpx;
2023
+ line-height: 48rpx;
2024
+ color: #35bc62;
2025
+ }
2026
+
2027
+ .deal_swiper {
2028
+ height: 514rpx;
2029
+
2030
+ .deal_goods {
2031
+ .deal_goods_pic {
2032
+ width: 306rpx;
2033
+ height: 306rpx;
2034
+ margin: 0 auto;
2035
+ background: #fff;
2036
+ border-radius: 16rpx;
2037
+ overflow: hidden;
2038
+
2039
+ image {
2040
+ width: 306rpx;
2041
+ height: 306rpx;
2042
+ display: block;
2043
+ }
2044
+ }
2045
+
2046
+ .deal_goods_name {
2047
+ padding-left: 18rpx;
2048
+ padding-right: 18rpx;
2049
+ margin-top: 16rpx;
2050
+ font-size: 28rpx;
2051
+ font-weight: bold;
2052
+ color: #222222;
2053
+ white-space: nowrap;
2054
+ overflow: hidden;
2055
+ text-overflow: ellipsis;
2056
+ }
2057
+
2058
+ .deal_progress {
2059
+ padding-left: 18rpx;
2060
+ padding-right: 18rpx;
2061
+ display: flex;
2062
+ align-items: center;
2063
+ margin-top: 14rpx;
2064
+
2065
+ .deal_progress_bar {
2066
+ flex: 1;
2067
+ height: 12rpx;
2068
+ border-radius: 6rpx;
2069
+ background: rgba(255, 255, 255, .6);
2070
+ overflow: hidden;
2071
+
2072
+ .deal_progress_inner {
2073
+ height: 100%;
2074
+ border-radius: 6rpx;
2075
+ background: linear-gradient(90deg, #ffd53e 0%, #ffb800 100%);
2076
+ }
2077
+ }
2078
+
2079
+ .deal_progress_text {
2080
+ margin-left: 14rpx;
2081
+ font-size: 22rpx;
2082
+ color: #ffffff;
2083
+ }
2084
+ }
2085
+
2086
+ .deal_bottom {
2087
+ padding-left: 18rpx;
2088
+ padding-right: 18rpx;
2089
+ display: flex;
2090
+ align-items: center;
2091
+ justify-content: space-between;
2092
+ margin-top: 18rpx;
2093
+
2094
+ .deal_price_now {
2095
+ color: #ff0000;
2096
+ font-size: 34rpx;
2097
+ line-height: 48rpx;
2098
+ font-family: 'gotham';
2099
+ white-space: nowrap;
2100
+ }
2101
+
2102
+ .deal_price_old {
2103
+ margin-top: 2rpx;
2104
+ font-size: 18rpx;
2105
+ font-size: 20rpx;
2106
+ line-height: 1;
2107
+ color: #ffffff;
2108
+ text-decoration: line-through;
2109
+ }
2110
+
2111
+ .deal_buy {
2112
+ width: 114rpx;
2113
+ height: 62rpx;
2114
+ background: url("https://ossacmall.bluedeer.com.cn/app/static/images/index_moduleDeal_btn.png") center center/contain no-repeat;
2115
+ }
2116
+ }
2117
+ }
2118
+ }
2119
+
2120
+ .deal_dots {
2121
+ width: 100%;
2122
+ position: absolute;
2123
+ bottom: 14rpx;
2124
+ left: 0;
2125
+ display: flex;
2126
+ justify-content: center;
2127
+ margin-top: 12rpx;
2128
+
2129
+ .deal_dot {
2130
+ width: 8rpx;
2131
+ height: 8rpx;
2132
+ border-radius: 4rpx;
2133
+ background: rgba(255, 255, 255, .7);
2134
+ margin: 0 5rpx;
2135
+
2136
+ &.on {
2137
+ width: 34rpx;
2138
+ background: #ffd53e;
2139
+ }
2140
+ }
2141
+ }
2142
+ }
2143
+
2144
+ .pair_right {
2145
+ width: 335rpx;
2146
+ display: flex;
2147
+ flex-direction: column;
2148
+ }
2149
+
2150
+ .pair_new {
2151
+ width: 335rpx;
2152
+ height: 335rpx;
2153
+ background: url("https://ossacmall.bluedeer.com.cn/app/static/images/index_moduleNew.png") center center/contain no-repeat;
2154
+ box-sizing: border-box;
2155
+ border-radius: 24rpx;
2156
+ overflow: hidden;
2157
+ position: relative;
2158
+
2159
+ .pair_new_head {
2160
+ display: flex;
2161
+ align-items: baseline;
2162
+ justify-content: space-between;
2163
+ padding-top: 7rpx;
2164
+
2165
+ .pair_new_title {
2166
+ width: 162rpx;
2167
+ text-align: center;
2168
+ font-size: 27rpx;
2169
+ line-height: 54rpx;
2170
+ font-weight: bold;
2171
+ color: #ffffff;
2172
+ }
2173
+
2174
+ .pair_new_sub {
2175
+ width: 172rpx;
2176
+ text-align: center;
2177
+ font-size: 27rpx;
2178
+ line-height: 54rpx;
2179
+ font-weight: bold;
2180
+ color: #fe4f70;
2181
+ }
2182
+ }
2183
+
2184
+ .pair_new_list {
2185
+ width: 100%;
2186
+ margin-top: 15rpx;
2187
+ height: 257rpx;
2188
+ position: relative;
2189
+
2190
+ .pair_new_swiper_item {
2191
+ height: 220rpx;
2192
+ }
2193
+
2194
+ .pair_new_list_wrapper {
2195
+ display: flex;
2196
+ align-items: flex-start;
2197
+ justify-content: space-around;
2198
+ }
2199
+
2200
+ .pair_new_item {
2201
+ width: 155rpx;
2202
+ flex-shrink: 0;
2203
+
2204
+ .pair_new_pic {
2205
+ border-radius: 12rpx;
2206
+ overflow: hidden;
2207
+ background: #f7f7f7;
2208
+
2209
+ image {
2210
+ width: 142rpx;
2211
+ height: 142rpx;
2212
+ display: block;
2213
+ }
2214
+ }
2215
+
2216
+ .pair_new_price {
2217
+ width: 123rpx;
2218
+ margin: 0 auto;
2219
+ text-align: center;
2220
+ background: #fff0d9;
2221
+ border-radius: 20rpx;
2222
+ margin-top: 16rpx;
2223
+ color: #ff5c2b;
2224
+ font-size: 24rpx;
2225
+ // font-weight: bold;
2226
+ font-family: 'gotham';
2227
+ white-space: nowrap;
2228
+ line-height: 39rpx;
2229
+ }
2230
+
2231
+ .pair_new_old {
2232
+ font-size: 18rpx;
2233
+ line-height: 24rpx;
2234
+ margin-top: 10rpx;
2235
+ color: #9e9e9e;
2236
+ text-decoration: line-through;
2237
+ text-align: center;
2238
+ }
2239
+
2240
+ }
2241
+ }
2242
+
2243
+ .pair_new_dots {
2244
+ width: 100%;
2245
+ position: absolute;
2246
+ bottom: 14rpx;
2247
+ left: 0;
2248
+ display: flex;
2249
+ justify-content: center;
2250
+ margin-top: 12rpx;
2251
+
2252
+ .pair_new_dot {
2253
+ width: 8rpx;
2254
+ height: 8rpx;
2255
+ border-radius: 4rpx;
2256
+ background: rgba(255, 255, 255, 0.5);
2257
+ margin: 0 5rpx;
2258
+
2259
+ &.on {
2260
+ width: 34rpx;
2261
+ background: #ffd53e;
2262
+ }
2263
+ }
2264
+ }
2265
+ }
2266
+
2267
+ .pair_zone {
2268
+ width: 335rpx;
2269
+ height: 283rpx;
2270
+ background: url("https://ossacmall.bluedeer.com.cn/app/static/images/index_moduleZone.png") center center/contain no-repeat;
2271
+ box-sizing: border-box;
2272
+ border-radius: 24rpx;
2273
+ margin-top: 10rpx;
2274
+ position: relative;
2275
+
2276
+ .pair_zone_head {
2277
+ display: flex;
2278
+ align-items: center;
2279
+ justify-content: space-between;
2280
+ padding-top: 7rpx;
2281
+
2282
+ .pair_zone_badge {
2283
+ width: 162rpx;
2284
+ text-align: center;
2285
+ font-size: 27rpx;
2286
+ line-height: 54rpx;
2287
+ font-weight: bold;
2288
+ white-space: nowrap;
2289
+ color: #ffffff;
2290
+ }
2291
+
2292
+ .pair_zone_sub {
2293
+ width: 172rpx;
2294
+ text-align: center;
2295
+ font-size: 27rpx;
2296
+ line-height: 54rpx;
2297
+ font-weight: bold;
2298
+ color: #36c8d5;
2299
+ }
2300
+ }
2301
+
2302
+ .pair_zone_swiper {
2303
+ height: 200rpx;
2304
+ margin-top: 26rpx;
2305
+ border-radius: 16rpx;
13862306 overflow: hidden;
13872307
1388
- swiper {
1389
- height: 100%;
2308
+ .pair_zone_swiper_item {
13902309 width: 100%;
1391
- overflow: hidden;
1392
- font-size: 22rpx;
1393
- color: #333333;
2310
+ height: 138rpx;
2311
+
2312
+ .pair_zone_img {
2313
+ width: 300rpx;
2314
+ height: 138rpx;
2315
+ margin: 0 auto;
2316
+ margin-top: 10rpx;
2317
+ display: block;
2318
+ border-radius: 16rpx;
2319
+ }
2320
+
2321
+ &.multi .pair_zone_img {
2322
+ margin-left: 15rpx;
2323
+ width: 280rpx;
2324
+ height: 128rpx;
2325
+ }
2326
+
2327
+ }
2328
+
2329
+
2330
+ }
2331
+
2332
+ .pair_zone_dots {
2333
+ width: 100%;
2334
+ position: absolute;
2335
+ bottom: 24rpx;
2336
+ left: 0;
2337
+ display: flex;
2338
+ justify-content: center;
2339
+ margin-top: 12rpx;
2340
+
2341
+ .pair_zone_dot {
2342
+ width: 8rpx;
2343
+ height: 8rpx;
2344
+ border-radius: 4rpx;
2345
+ background: #e0e0e0;
2346
+ margin: 0 5rpx;
2347
+
2348
+ &.on {
2349
+ width: 34rpx;
2350
+ background: #ffd53e;
2351
+ }
2352
+ }
2353
+ }
2354
+ }
2355
+}
2356
+
2357
+.module_rank {
2358
+ width: 690rpx;
2359
+ height: 580rpx;
2360
+ margin: 0 auto 20rpx;
2361
+ box-sizing: border-box;
2362
+ border-radius: 24rpx;
2363
+ padding: 0 20rpx;
2364
+ background: url("https://ossacmall.bluedeer.com.cn/app/static/images/index_moduleRank.png") center center/contain no-repeat;
2365
+
2366
+
2367
+ .module_rank_head {
2368
+ display: flex;
2369
+ align-items: center;
2370
+ justify-content: space-between;
2371
+ padding-top: 7rpx;
2372
+
2373
+ .module_rank_badge {
2374
+ height: 47rpx;
2375
+ line-height: 47rpx;
2376
+ padding-left: 15rpx;
2377
+ color: #fff;
2378
+ font-size: 28rpx;
2379
+ font-weight: bold;
2380
+ }
2381
+
2382
+ .module_rank_sub {
2383
+ padding-right: 15rpx;
2384
+ text-align: right;
2385
+ font-size: 20rpx;
2386
+ line-height: 32rpx;
2387
+ padding-top: 15rpx;
2388
+ color: #d5bb00;
2389
+ }
2390
+ }
2391
+
2392
+ .module_rank_body {
2393
+ margin-top: 16rpx;
2394
+ border-radius: 20rpx;
2395
+
2396
+ .module_rank_tabs {
2397
+ width: 640rpx;
2398
+ margin: 0 auto;
2399
+ background: rgba(244, 255, 196, .7);
2400
+ border-radius: 28rpx;
2401
+
2402
+ .module_rank_tabsScroll {
2403
+ width: 100%;
2404
+ white-space: nowrap;
2405
+ }
2406
+
2407
+ .module_rank_tabs_wrapper {
2408
+ width: max-content;
2409
+ white-space: nowrap;
2410
+ }
2411
+
2412
+ .module_rank_tab {
2413
+ display: inline-block;
2414
+ position: relative;
2415
+ font-size: 28rpx;
2416
+ color: #000000;
2417
+ line-height: 56rpx;
2418
+ padding: 0 22rpx;
2419
+
2420
+ &.on {
2421
+ font-weight: bold;
2422
+
2423
+ &::after {
2424
+ content: '';
2425
+ position: absolute;
2426
+ left: 50%;
2427
+ bottom: 10rpx;
2428
+ transform: translateX(-50%);
2429
+ width: 48rpx;
2430
+ height: 6rpx;
2431
+ border-radius: 3rpx;
2432
+ background: linear-gradient(90deg, #ffd53e 0%, #ff9c00 100%);
2433
+ }
2434
+ }
13942435 }
13952436 }
13962437
1397
- .iconfont {
1398
- color: #999999;
1399
- font-size: 20rpx;
2438
+ .module_rank_list {
2439
+ display: flex;
2440
+ justify-content: space-between;
2441
+ align-items: flex-start;
2442
+ margin-top: 30rpx;
2443
+ position: relative;
2444
+
2445
+ .module_rank_item {
2446
+ position: relative;
2447
+ width: 32%;
2448
+ box-sizing: border-box;
2449
+ border-radius: 16rpx;
2450
+ padding: 14rpx 12rpx 16rpx;
2451
+ background: linear-gradient(180deg, #ffffff 0%, #eafbe0 100%);
2452
+ margin-top: 44rpx;
2453
+
2454
+ &.mid {
2455
+ margin-top: 0;
2456
+ }
2457
+
2458
+ .rank_badge {
2459
+ position: absolute;
2460
+ left: -8rpx;
2461
+ top: -10rpx;
2462
+ width: 60rpx;
2463
+ height: 68rpx;
2464
+
2465
+ &.rank1 {
2466
+ background: url("https://ossacmall.bluedeer.com.cn/app/static/images/index_moduleRank_num1.png") center center/contain no-repeat;
2467
+ }
2468
+
2469
+ &.rank2 {
2470
+ background: url("https://ossacmall.bluedeer.com.cn/app/static/images/index_moduleRank_num2.png") center center/contain no-repeat;
2471
+ }
2472
+
2473
+ &.rank3 {
2474
+ background: url("https://ossacmall.bluedeer.com.cn/app/static/images/index_moduleRank_num3.png") center center/contain no-repeat;
2475
+ }
2476
+ }
2477
+
2478
+ .rank_pic {
2479
+ border-radius: 12rpx;
2480
+ overflow: hidden;
2481
+ background: #f7f7f7;
2482
+
2483
+ image {
2484
+ width: 100%;
2485
+ height: 150rpx;
2486
+ display: block;
2487
+ }
2488
+ }
2489
+
2490
+ .rank_buy {
2491
+ font-size: 16rpx;
2492
+ line-height: 24rpx;
2493
+ margin-top: 15rpx;
2494
+ color: #ff3000;
2495
+ padding-left: 20rpx;
2496
+ background: url("https://ossacmall.bluedeer.com.cn/app/static/images/index_moduleRank_hot.png") left 2rpx / auto 16rpx no-repeat;
2497
+ }
2498
+
2499
+ .rank_name {
2500
+ margin-top: 4rpx;
2501
+ font-size: 24rpx;
2502
+ line-height: 32rpx;
2503
+ height: 64rpx;
2504
+ color: #222222;
2505
+ display: -webkit-box;
2506
+ -webkit-box-orient: vertical;
2507
+ -webkit-line-clamp: 2;
2508
+ overflow: hidden;
2509
+ }
2510
+
2511
+ .rank_price {
2512
+ display: flex;
2513
+ align-items: center;
2514
+ justify-content: space-between;
2515
+ margin-top: 10rpx;
2516
+
2517
+ .rank_price_now {
2518
+ color: #ff0000;
2519
+ font-size: 24rpx;
2520
+ font-family: 'gotham';
2521
+ white-space: nowrap;
2522
+ overflow: hidden;
2523
+ max-width: 150rpx;
2524
+ overflow: hidden;
2525
+ }
2526
+ }
2527
+
2528
+ .rank_old {
2529
+ margin-top: 4rpx;
2530
+ font-size: 20rpx;
2531
+ white-space: nowrap;
2532
+ overflow: hidden;
2533
+ max-width: 150rpx;
2534
+ overflow: hidden;
2535
+ color: #999999;
2536
+ text-decoration: line-through;
2537
+ }
2538
+
2539
+ .rank_cart {
2540
+ position: absolute;
2541
+ right: 12rpx;
2542
+ bottom: 20rpx;
2543
+ width: 34rpx;
2544
+ height: 34rpx;
2545
+ background: url("https://ossacmall.bluedeer.com.cn/app/static/images/index_moduleRank_buy.png") center center/contain no-repeat;
2546
+ }
2547
+ }
2548
+ }
2549
+ }
2550
+}
2551
+
2552
+.module_banner {
2553
+ width: 690rpx;
2554
+ margin: 0 auto 20rpx;
2555
+ position: relative;
2556
+
2557
+ .module_banner_swiper {
2558
+ height: 150rpx;
2559
+ border-radius: 20rpx;
2560
+ overflow: hidden;
2561
+
2562
+ .module_banner_img {
2563
+ width: 100%;
2564
+ height: 150rpx;
2565
+ display: block;
2566
+ border-radius: 20rpx;
14002567 }
14012568 }
14022569
1403
- .sticky-box {
1404
- /* #ifndef APP-PLUS-NVUE */
2570
+ .module_banner_dots {
2571
+ position: absolute;
2572
+ left: 0;
2573
+ right: 0;
2574
+ bottom: 12rpx;
14052575 display: flex;
1406
- position: -webkit-sticky;
1407
- /* #endif */
1408
- position: sticky;
1409
- /* #ifdef H5*/
1410
- top: var(--window-top);
1411
- /* #endif */
2576
+ justify-content: center;
14122577
1413
- z-index: 99;
1414
- flex-direction: row;
1415
- margin: 0px;
1416
- background: #f5f5f5;
1417
- padding: 30rpx 0;
2578
+ .module_banner_dot {
2579
+ width: 8rpx;
2580
+ height: 8rpx;
2581
+ border-radius: 4rpx;
2582
+ background: #e0e0e0;
2583
+ margin: 0 5rpx;
2584
+
2585
+ &.on {
2586
+ width: 34rpx;
2587
+ background: #ffd53e;
2588
+ }
2589
+ }
2590
+ }
2591
+}
2592
+
2593
+.module_brand {
2594
+ width: 684rpx;
2595
+ height: 335rpx;
2596
+ position: relative;
2597
+ margin: 0 auto 20rpx;
2598
+ box-sizing: border-box;
2599
+ border-radius: 24rpx;
2600
+ background: url("https://ossacmall.bluedeer.com.cn/app/static/images/index_moduleBrand.png") center center/contain no-repeat;
2601
+
2602
+ .module_brand_title {
2603
+ text-align: center;
2604
+ font-size: 34rpx;
2605
+ font-weight: bold;
2606
+ color: #0a9b4c;
14182607 }
14192608
1420
- .listAll {
1421
- width: 20%;
1422
- text-indent: 62rpx;
1423
- font-size: 30rpx;
1424
- border-left: 1px #eee solid;
1425
- margin: 1% 0;
1426
- padding: 5rpx;
1427
- position: relative;
2609
+ .module_brand_sub {
2610
+ text-align: center;
2611
+ font-size: 24rpx;
2612
+ line-height: 60rpx;
2613
+ color: #35bc62;
2614
+ }
2615
+
2616
+ .module_brand_swiper {
2617
+ width: 645rpx;
2618
+ height: 200rpx;
2619
+ margin: 0 auto;
2620
+ background: #fff;
2621
+ border-radius: 20rpx;
2622
+
2623
+ .module_brand_swiper_item {
2624
+ width: 100%;
2625
+ }
2626
+ }
2627
+
2628
+ .module_brand_box {
2629
+ width: 645rpx;
2630
+ height: 200rpx;
2631
+ margin: 0 auto;
2632
+ padding: 14rpx;
2633
+ display: flex;
2634
+ flex-wrap: wrap;
2635
+
2636
+ .module_brand_item {
2637
+ width: 21%;
2638
+ height: 65rpx;
2639
+ margin: 2%;
2640
+ box-sizing: border-box;
2641
+ border: 1rpx solid #eeeeee;
2642
+ border-radius: 12rpx;
2643
+ display: flex;
2644
+ align-items: center;
2645
+ justify-content: center;
2646
+
2647
+ image {
2648
+ width: 90%;
2649
+ height: 80rpx;
2650
+ }
2651
+ }
2652
+ }
2653
+
2654
+ .module_brand_dots {
2655
+ width: 100%;
2656
+ left: 0;
2657
+ bottom: 9rpx;
2658
+ position: absolute;
2659
+ margin-top: 16rpx;
2660
+ display: flex;
2661
+ justify-content: center;
2662
+
2663
+ .module_brand_dot {
2664
+ width: 8rpx;
2665
+ height: 8rpx;
2666
+ border-radius: 4rpx;
2667
+ background: #e0e0e0;
2668
+ margin: 0 6rpx;
2669
+
2670
+ &.on {
2671
+ width: 34rpx;
2672
+ background: #ffd53e;
2673
+ }
2674
+ }
2675
+ }
2676
+}
2677
+
2678
+.notice {
2679
+ width: 100%;
2680
+ height: 70rpx;
2681
+ border-radius: 10rpx;
2682
+ background-color: #fff;
2683
+ margin-bottom: 25rpx;
2684
+ line-height: 70rpx;
2685
+ padding: 0 14rpx;
2686
+
2687
+ .line {
2688
+ color: #CCCCCC;
2689
+ }
2690
+
2691
+ .pic {
2692
+ width: 130rpx;
2693
+ height: 36rpx;
14282694
14292695 image {
1430
- position: absolute;
1431
- left: 20rpx;
1432
- top: 8rpx;
2696
+ width: 100%;
2697
+ height: 100%;
2698
+ display: block !important;
14332699 }
14342700 }
14352701
1436
- .tab {
1437
- position: relative;
1438
- display: flex;
1439
- font-size: 28rpx;
1440
- white-space: nowrap;
2702
+ .swipers {
2703
+ height: 100%;
2704
+ width: 444rpx;
2705
+ overflow: hidden;
14412706
1442
- &__item {
1443
- flex: 1;
1444
- padding: 0 20rpx;
2707
+ swiper {
2708
+ height: 100%;
2709
+ width: 100%;
2710
+ overflow: hidden;
2711
+ font-size: 22rpx;
2712
+ color: #333333;
2713
+ }
2714
+ }
2715
+
2716
+ .iconfont {
2717
+ color: #999999;
2718
+ font-size: 20rpx;
2719
+ }
2720
+}
2721
+
2722
+.sticky-box {
2723
+ /* #ifndef APP-PLUS-NVUE */
2724
+ display: flex;
2725
+ position: -webkit-sticky;
2726
+ /* #endif */
2727
+ position: sticky;
2728
+ /* #ifdef H5*/
2729
+ top: var(--window-top);
2730
+ /* #endif */
2731
+
2732
+ z-index: 99;
2733
+ flex-direction: row;
2734
+ margin: 0px;
2735
+ background: #f5f5f5;
2736
+ padding: 30rpx 0;
2737
+}
2738
+
2739
+.listAll {
2740
+ width: 20%;
2741
+ text-indent: 62rpx;
2742
+ font-size: 30rpx;
2743
+ border-left: 1px #eee solid;
2744
+ margin: 1% 0;
2745
+ padding: 5rpx;
2746
+ position: relative;
2747
+
2748
+ image {
2749
+ position: absolute;
2750
+ left: 20rpx;
2751
+ top: 8rpx;
2752
+ }
2753
+}
2754
+
2755
+.tab {
2756
+ position: relative;
2757
+ display: flex;
2758
+ font-size: 28rpx;
2759
+ white-space: nowrap;
2760
+
2761
+ &__item {
2762
+ flex: 1;
2763
+ padding: 0 20rpx;
2764
+ text-align: center;
2765
+ height: 60rpx;
2766
+ line-height: 60rpx;
2767
+ color: #666;
2768
+
2769
+ &.active {
2770
+ color: #09C2C9;
2771
+ }
2772
+ }
2773
+}
2774
+
2775
+.tab__line {
2776
+ display: block;
2777
+ height: 6rpx;
2778
+ position: absolute;
2779
+ bottom: 0;
2780
+ left: 0;
2781
+ z-index: 1;
2782
+ border-radius: 3rpx;
2783
+ position: relative;
2784
+ background: #2FC6CD;
2785
+}
2786
+
2787
+.scroll-view_H {
2788
+ /* 文本不会换行,文本会在在同一行上继续,直到遇到 <br> 标签为止。 */
2789
+ white-space: nowrap;
2790
+ width: 100%;
2791
+}
2792
+
2793
+
2794
+.privacy-wrapper {
2795
+ z-index: 999;
2796
+ position: fixed;
2797
+ left: 0;
2798
+ top: 0;
2799
+ width: 100%;
2800
+ height: 100%;
2801
+ background: #7F7F7F;
2802
+
2803
+ .privacy-box {
2804
+ position: absolute;
2805
+ left: 50%;
2806
+ top: 50%;
2807
+ transform: translate(-50%, -50%);
2808
+ width: 560rpx;
2809
+ padding: 50rpx 45rpx 0;
2810
+ background: #fff;
2811
+ border-radius: 20rpx;
2812
+
2813
+ .title {
14452814 text-align: center;
1446
- height: 60rpx;
1447
- line-height: 60rpx;
1448
- color: #666;
2815
+ font-size: 32rpx;
2816
+ text-align: center;
2817
+ color: #333;
2818
+ font-weight: 700;
2819
+ }
14492820
1450
- &.active {
1451
- color: #09C2C9;
2821
+ .content {
2822
+ margin-top: 20rpx;
2823
+ line-height: 1.5;
2824
+ font-size: 26rpx;
2825
+ color: #666;
2826
+ text-indent: 54rpx;
2827
+
2828
+ i {
2829
+ font-style: normal;
2830
+ color: $theme-color;
2831
+ }
2832
+ }
2833
+
2834
+ .btn-box {
2835
+ margin-top: 40rpx;
2836
+ text-align: center;
2837
+ font-size: 30rpx;
2838
+
2839
+ .btn-item {
2840
+ height: 82rpx;
2841
+ line-height: 82rpx;
2842
+ background: linear-gradient(90deg, #F67A38 0%, #F11B09 100%);
2843
+ color: #fff;
2844
+ border-radius: 41rpx;
2845
+ }
2846
+
2847
+ .btn {
2848
+ padding: 30rpx 0;
14522849 }
14532850 }
14542851 }
2852
+}
14552853
1456
- .tab__line {
1457
- display: block;
1458
- height: 6rpx;
1459
- position: absolute;
1460
- bottom: 0;
1461
- left: 0;
1462
- z-index: 1;
1463
- border-radius: 3rpx;
1464
- position: relative;
1465
- background: #2FC6CD;
1466
- }
2854
+.page-index {
2855
+ background-color: #f5f5f5;
14672856
1468
- .scroll-view_H {
1469
- /* 文本不会换行,文本会在在同一行上继续,直到遇到 <br> 标签为止。 */
1470
- white-space: nowrap;
1471
- width: 100%;
1472
- }
1473
-
1474
-
1475
- .privacy-wrapper {
2857
+ .mp-header {
14762858 z-index: 999;
14772859 position: fixed;
14782860 left: 0;
14792861 top: 0;
14802862 width: 100%;
1481
- height: 100%;
1482
- background: #7F7F7F;
1483
-
1484
- .privacy-box {
1485
- position: absolute;
1486
- left: 50%;
1487
- top: 50%;
1488
- transform: translate(-50%, -50%);
1489
- width: 560rpx;
1490
- padding: 50rpx 45rpx 0;
1491
- background: #fff;
1492
- border-radius: 20rpx;
1493
-
1494
- .title {
1495
- text-align: center;
1496
- font-size: 32rpx;
1497
- text-align: center;
1498
- color: #333;
1499
- font-weight: 700;
1500
- }
1501
-
1502
- .content {
1503
- margin-top: 20rpx;
1504
- line-height: 1.5;
1505
- font-size: 26rpx;
1506
- color: #666;
1507
- text-indent: 54rpx;
1508
-
1509
- i {
1510
- font-style: normal;
1511
- color: $theme-color;
1512
- }
1513
- }
1514
-
1515
- .btn-box {
1516
- margin-top: 40rpx;
1517
- text-align: center;
1518
- font-size: 30rpx;
1519
-
1520
- .btn-item {
1521
- height: 82rpx;
1522
- line-height: 82rpx;
1523
- background: linear-gradient(90deg, #F67A38 0%, #F11B09 100%);
1524
- color: #fff;
1525
- border-radius: 41rpx;
1526
- }
1527
-
1528
- .btn {
1529
- padding: 30rpx 0;
1530
- }
1531
- }
1532
- }
1533
- }
1534
-
1535
- .page-index {
1536
- background-color: #f5f5f5;
1537
-
1538
- .mp-header {
1539
- z-index: 999;
1540
- position: fixed;
1541
- left: 0;
1542
- top: 0;
1543
- width: 100%;
1544
-
1545
- background: url("https://ossacmall.bluedeer.com.cn/app/static/images/page_commonBg.png") center top/100% auto no-repeat;
1546
- .header {
1547
- padding: 28rpx 30rpx;
1548
- padding-top: 88rpx;
1549
- }
1550
-
1551
- .serch-wrapper {
1552
- width: 750rpx;
1553
- margin: 0 auto;
1554
- height: 100%;
1555
- align-items: center;
1556
- padding: 0 50rpx 0 160rpx;
1557
- box-sizing: border-box;
1558
- position: relative;
1559
-
1560
- .logo {
1561
- width: 130rpx;
1562
- height: 130rpx;
1563
- border-radius: 50%;
1564
- position: absolute;
1565
- left: 0;
1566
- top: 50%;
1567
- margin-top: -65rpx;
1568
- }
1569
-
1570
- image {
1571
- display: block;
1572
- width: 130rpx !important;
1573
- height: 130rpx !important;
1574
- box-sizing: border-box;
1575
- }
1576
-
1577
- .input {
1578
- display: flex;
1579
- align-items: center;
1580
- width: 300rpx;
1581
- padding: 0 0 0 30rpx;
1582
- background: #ffffff;
1583
- // box-shadow:inset 0 0 0 1rpx #dcd8c5;
1584
- border-radius: 25rpx;
1585
- color: #cccccc;
1586
- font-size: 28rpx;
1587
- line-height: 30rpx;
1588
- height: 30rpx;
1589
- flex-wrap: nowrap;
1590
-
1591
- .iconfont {
1592
- margin-right: 20rpx;
1593
- font-size: 26rpx;
1594
- color: #cccccc;
1595
- }
1596
- }
1597
- }
1598
- }
1599
-
1600
-
1601
- .swiper {
1602
- position: relative;
1603
- width: 690rpx;
1604
- height: 410rpx;
1605
- margin: 0 auto;
1606
- border-radius: 10rpx;
1607
- overflow: hidden;
1608
- margin-bottom: 25rpx;
1609
- /* #ifdef MP */
1610
- z-index: 10;
1611
- margin-top: 40rpx;
1612
-
1613
- /* #endif */
1614
- swiper,
1615
- .swiper-item {
1616
- width: 100%;
1617
- height: 410rpx;
1618
- }
1619
-
1620
- image {
1621
- width: 100%;
1622
- height: 387rpx;
1623
- border-radius: 10rpx;
1624
- }
1625
-
1626
- .wx-swiper-dots {
1627
- bottom: 0rpx;
1628
- }
1629
-
1630
- .wx-swiper-dots .wx-swiper-dot {
1631
- width: 8rpx;
1632
- height: 8rpx;
1633
- border-radius: 4rpx;
1634
- }
1635
-
1636
- .wx-swiper-dots .wx-swiper-dot-active {
1637
- width: 20rpx;
1638
- }
1639
-
1640
- .wx-swiper-dots .wx-swiper-dot:nth-of-type(n+2) {
1641
- margin-left: 15rpx;
1642
- }
1643
- }
1644
-
1645
- .nav {
1646
- opacity: 1;
1647
- border-radius: 14rpx;
1648
- width: 690rpx;
1649
- margin: 0 auto;
1650
- margin-bottom: 30rpx;
1651
-
1652
- .item {
1653
- display: flex;
1654
- flex-direction: column;
1655
- align-items: center;
1656
- justify-content: center;
1657
- width: 20%;
1658
- margin-top: 15rpx;
1659
-
1660
- :nth-child(1),
1661
- :nth-child(2),
1662
- :nth-child(3),
1663
- :nth-child(4),
1664
- :nth-child(5) {
1665
- margin-top: 0;
1666
- }
1667
-
1668
- .image {
1669
- width: 136rpx;
1670
- height: 136rpx;
1671
- display: block;
1672
- margin-left: 15rpx !important;
1673
- display: block;
1674
- }
1675
-
1676
- .menu-txt {
1677
- font-size: 24rpx;
1678
- color: #000000;
1679
- }
1680
- }
1681
- }
1682
-
1683
-
1684
- .nav-bd {
1685
- display: flex;
1686
- align-items: center;
1687
- justify-content: space-between;
1688
-
1689
- .item {
1690
- display: flex;
1691
- flex-direction: column;
1692
- align-items: center;
1693
- justify-content: center;
1694
-
1695
- .txt {
1696
- font-size: 32rpx;
1697
- color: #000000;
1698
- }
1699
-
1700
- .label {
1701
- display: flex;
1702
- align-items: center;
1703
- justify-content: center;
1704
- width: 124rpx;
1705
- height: 32rpx;
1706
- margin-top: 5rpx;
1707
- font-size: 24rpx;
1708
- color: #999;
1709
- }
1710
-
1711
- &.active {
1712
- color: $theme-color;
1713
-
1714
- .txt {
1715
- color: $theme-color;
1716
- }
1717
-
1718
- .label {
1719
- background: linear-gradient(90deg, $bg-star 0%, $bg-end 100%);
1720
- border-radius: 16rpx;
1721
- color: #fff;
1722
- }
1723
- }
1724
- }
1725
- }
1726
-
1727
- .index-product-wrapper {
1728
- margin-bottom: 110rpx;
1729
-
1730
- &.on {
1731
- min-height: 1500rpx;
1732
- }
1733
-
1734
- .list-box {
1735
- display: flex;
1736
- flex-wrap: wrap;
1737
- justify-content: space-between;
1738
-
1739
- .item {
1740
- width: 335rpx;
1741
- margin-bottom: 20rpx;
1742
- background-color: #fff;
1743
- border-radius: 10rpx;
1744
- overflow: hidden;
1745
-
1746
- image {
1747
- width: 100%;
1748
- height: 330rpx;
1749
- }
1750
-
1751
- .text-info {
1752
- padding: 10rpx 20rpx 15rpx;
1753
-
1754
- .title {
1755
- color: #222222;
1756
- }
1757
-
1758
- .old-price {
1759
- margin-top: 8rpx;
1760
- font-size: 26rpx;
1761
- color: #AAAAAA;
1762
- text-decoration: line-through;
1763
-
1764
- text {
1765
- margin-right: 2px;
1766
- font-size: 20rpx;
1767
- }
1768
- }
1769
-
1770
- .price {
1771
- display: flex;
1772
- align-items: flex-end;
1773
- color: $theme-color;
1774
- font-size: 34rpx;
1775
- font-weight: 800;
1776
-
1777
- text {
1778
- padding-bottom: 4rpx;
1779
- font-size: 24rpx;
1780
- font-weight: 800;
1781
- }
1782
-
1783
- .txt {
1784
- display: flex;
1785
- align-items: center;
1786
- justify-content: center;
1787
- width: 28rpx;
1788
- height: 28rpx;
1789
- margin-left: 15rpx;
1790
- margin-bottom: 10rpx;
1791
- border: 1px solid $theme-color;
1792
- border-radius: 4rpx;
1793
- font-size: 22rpx;
1794
- font-weight: normal;
1795
- }
1796
- }
1797
- }
1798
- }
1799
-
1800
- &.on {
1801
- display: flex;
1802
- }
1803
- }
1804
- }
1805
- }
1806
-
1807
- .zoneList_title {
1808
- font-size: 34rpx;
1809
- line-height: 48rpx;
1810
- width: 690rpx;
1811
- margin: 0 auto;
1812
- margin-bottom: 15rpx;
1813
- font-weight: bold;
1814
- color: #000000;
1815
- }
1816
-
1817
- .zoneList_box {
1818
- width: 100%;
1819
- height: 305rpx;
1820
-
1821
- .zoneList_wrapper {
1822
- width: max-content;
1823
- white-space: nowrap;
1824
- height: 305rpx;
1825
- }
1826
-
1827
- .zoneList_item {
1828
- display: inline-block;
1829
- width: 540rpx;
1830
- height: 305rpx;
1831
- margin-left: 30rpx;
1832
-
1833
- :last-child {
1834
- margin-right: 30rpx;
1835
- }
1836
-
1837
- image {
1838
- width: 540rpx;
1839
- height: 305rpx;
1840
- border-radius: 16rpx;
1841
- }
1842
- }
1843
-
1844
- &.isSingle {
1845
- height: 390rpx;
1846
-
1847
- .zoneList_item {
1848
- width: 690rpx;
1849
- height: 390rpx;
1850
- margin-right: 0;
1851
-
1852
- image {
1853
- width: 690rpx;
1854
- height: 390rpx;
1855
- }
1856
- }
1857
- }
1858
- }
1859
-
1860
- .pictrue {
1861
- position: relative;
1862
- }
1863
-
1864
- .fixed {
1865
- z-index: 100;
1866
- position: fixed;
1867
- left: 0;
1868
- top: 0;
1869
- background: linear-gradient(90deg, red 50%, #ff5400 100%);
1870
-
1871
- }
1872
-
1873
- .mores-txt {
1874
- width: 100%;
1875
- align-items: center;
1876
- justify-content: center;
1877
- height: 70rpx;
1878
- color: #999;
1879
- font-size: 24rpx;
1880
-
1881
- .iconfont {
1882
- margin-top: 2rpx;
1883
- font-size: 20rpx;
1884
- }
1885
- }
1886
-
1887
-
18882863
1889
- .mp-bg {
1890
- width: 100%;
1891
- height: 900rpx;
1892
- background-color: #f5f5f5;
1893
- position: absolute;
1894
- left: 0;
1895
- top: 0;
18962864 background: url("https://ossacmall.bluedeer.com.cn/app/static/images/page_commonBg.png") center top/100% auto no-repeat;
1897
- // border-radius: 0 0 30rpx 30rpx;
2865
+
2866
+ .header {
2867
+ padding: 28rpx 30rpx;
2868
+ padding-top: 88rpx;
2869
+ }
2870
+
2871
+ .serch-wrapper {
2872
+ width: 750rpx;
2873
+ margin: 0 auto;
2874
+ height: 100%;
2875
+ align-items: center;
2876
+ padding: 0 50rpx 0 160rpx;
2877
+ box-sizing: border-box;
2878
+ position: relative;
2879
+
2880
+ .logo {
2881
+ width: 130rpx;
2882
+ height: 130rpx;
2883
+ border-radius: 50%;
2884
+ position: absolute;
2885
+ left: 0;
2886
+ top: 50%;
2887
+ margin-top: -65rpx;
2888
+ }
2889
+
2890
+ image {
2891
+ display: block;
2892
+ width: 130rpx !important;
2893
+ height: 130rpx !important;
2894
+ box-sizing: border-box;
2895
+ }
2896
+
2897
+ .input {
2898
+ display: flex;
2899
+ align-items: center;
2900
+ width: 300rpx;
2901
+ padding: 0 0 0 30rpx;
2902
+ background: #ffffff;
2903
+ // box-shadow:inset 0 0 0 1rpx #dcd8c5;
2904
+ border-radius: 25rpx;
2905
+ color: #cccccc;
2906
+ font-size: 28rpx;
2907
+ line-height: 30rpx;
2908
+ height: 30rpx;
2909
+ flex-wrap: nowrap;
2910
+
2911
+ .iconfont {
2912
+ margin-right: 20rpx;
2913
+ font-size: 26rpx;
2914
+ color: #cccccc;
2915
+ }
2916
+ }
2917
+ }
18982918 }
18992919
1900
- .user_info {
1901
- width: 690rpx;
1902
- height: 107rpx;
1903
- margin: 0 auto;
1904
- margin-top: 15rpx;
2920
+
2921
+ .swiper {
19052922 position: relative;
2923
+ width: 690rpx;
2924
+ height: 410rpx;
2925
+ margin: 0 auto;
2926
+ border-radius: 10rpx;
2927
+ overflow: hidden;
2928
+ margin-bottom: 25rpx;
2929
+ /* #ifdef MP */
2930
+ z-index: 10;
2931
+ margin-top: 40rpx;
19062932
1907
- .user_head {
1908
- width: 84rpx;
1909
- height: 84rpx;
1910
- box-sizing: border-box;
1911
- border: 2rpx solid #FFE20E;
1912
- background-color: #f5f5f5;
1913
- border-radius: 50%;
1914
- overflow: hidden;
2933
+ /* #endif */
2934
+ swiper,
2935
+ .swiper-item {
2936
+ width: 100%;
2937
+ height: 410rpx;
2938
+ }
19152939
1916
- image {
1917
- width: 84rpx;
1918
- height: 84rpx;
2940
+ image {
2941
+ width: 100%;
2942
+ height: 387rpx;
2943
+ border-radius: 10rpx;
2944
+ }
2945
+
2946
+ .wx-swiper-dots {
2947
+ bottom: 0rpx;
2948
+ }
2949
+
2950
+ .wx-swiper-dots .wx-swiper-dot {
2951
+ width: 8rpx;
2952
+ height: 8rpx;
2953
+ border-radius: 4rpx;
2954
+ }
2955
+
2956
+ .wx-swiper-dots .wx-swiper-dot-active {
2957
+ width: 20rpx;
2958
+ }
2959
+
2960
+ .wx-swiper-dots .wx-swiper-dot:nth-of-type(n+2) {
2961
+ margin-left: 15rpx;
2962
+ }
2963
+ }
2964
+
2965
+ .nav {
2966
+ opacity: 1;
2967
+ border-radius: 14rpx;
2968
+ width: 690rpx;
2969
+ margin: 0 auto;
2970
+ margin-bottom: 30rpx;
2971
+
2972
+ .item {
2973
+ display: flex;
2974
+ flex-direction: column;
2975
+ align-items: center;
2976
+ justify-content: center;
2977
+ width: 20%;
2978
+ margin-top: 15rpx;
2979
+
2980
+ :nth-child(1),
2981
+ :nth-child(2),
2982
+ :nth-child(3),
2983
+ :nth-child(4),
2984
+ :nth-child(5) {
2985
+ margin-top: 0;
2986
+ }
2987
+
2988
+ .image {
2989
+ width: 136rpx;
2990
+ height: 136rpx;
2991
+ display: block;
2992
+ }
2993
+
2994
+ .menu-txt {
2995
+ font-size: 24rpx;
2996
+ color: #000000;
19192997 }
19202998 }
2999
+ }
19213000
1922
- .user_level {
1923
- width: 110rpx;
1924
- height: 45rpx;
1925
- position: absolute;
1926
- left: 106rpx;
1927
- top: 45rpx;
19283001
1929
- image {
1930
- width: 110rpx;
1931
- height: 45rpx;
1932
- }
1933
- }
3002
+ .nav-bd {
3003
+ display: flex;
3004
+ align-items: center;
3005
+ justify-content: space-between;
19343006
1935
- .user_name,
1936
- .user_loginTips {
1937
- font-size: 31rpx;
1938
- line-height: 46rpx;
1939
- color: #000000;
1940
- font-weight: bold;
1941
- position: absolute;
1942
- left: 106rpx;
1943
- top: 0;
1944
- background: none;
1945
- }
3007
+ .item {
3008
+ display: flex;
3009
+ flex-direction: column;
3010
+ align-items: center;
3011
+ justify-content: center;
19463012
1947
- .user_careNum {
1948
- color: #333333;
1949
- position: absolute;
1950
- right: 0;
1951
- top: 0;
1952
- text-align: right;
1953
- font-size: 31rpx;
1954
- line-height: 46rpx;
1955
-
1956
- .num {
1957
- font-size: 40rpx;
1958
- font-weight: bold;
3013
+ .txt {
3014
+ font-size: 32rpx;
3015
+ color: #000000;
19593016 }
19603017
19613018 .label {
1962
- width: max-content;
1963
- font-size: 21rpx;
1964
- line-height: 42rpx;
1965
- position: absolute;
1966
- right: 0;
1967
- top: 46rpx;
1968
- padding-right: 30rpx;
1969
- background: url("https://ossacmall.bluedeer.com.cn/app/static/images/i_info.png") right center/20rpx auto no-repeat;
3019
+ display: flex;
3020
+ align-items: center;
3021
+ justify-content: center;
3022
+ width: 124rpx;
3023
+ height: 32rpx;
3024
+ margin-top: 5rpx;
3025
+ font-size: 24rpx;
3026
+ color: #999;
19703027 }
1971
- }
19723028
1973
- .btn_vip {
1974
- width: max-content;
1975
- position: absolute;
1976
- right: 0;
1977
- font-size: 21rpx;
1978
- line-height: 42rpx;
1979
- left: 226rpx;
1980
- top: 46rpx;
1981
- color: #333333;
3029
+ &.active {
3030
+ color: $theme-color;
19823031
1983
- .iconfont {
1984
- font-size: 21rpx !important;
1985
- }
1986
- }
3032
+ .txt {
3033
+ color: $theme-color;
3034
+ }
19873035
1988
- .btn_toLogin {
1989
- position: absolute;
1990
- left: 106rpx;
1991
- top: 30rpx;
1992
- font-size: 21rpx;
1993
- line-height: 82rpx;
1994
- color: #333333;
1995
-
1996
- .iconfont {
1997
- font-size: 21rpx !important;
3036
+ .label {
3037
+ background: linear-gradient(90deg, $bg-star 0%, $bg-end 100%);
3038
+ border-radius: 16rpx;
3039
+ color: #fff;
3040
+ }
19983041 }
19993042 }
20003043 }
20013044
2002
- .buy_list {
2003
- width: 100%;
2004
- height: 48rpx;
3045
+ .index-product-wrapper {
3046
+ margin-bottom: 110rpx;
3047
+
3048
+ &.on {
3049
+ min-height: 1500rpx;
3050
+ }
3051
+
3052
+ .list-box {
3053
+ display: flex;
3054
+ flex-wrap: wrap;
3055
+ justify-content: space-between;
3056
+
3057
+ .item {
3058
+ width: 335rpx;
3059
+ margin-bottom: 20rpx;
3060
+ background-color: #fff;
3061
+ border-radius: 10rpx;
3062
+ overflow: hidden;
3063
+
3064
+ image {
3065
+ width: 100%;
3066
+ height: 330rpx;
3067
+ }
3068
+
3069
+ .text-info {
3070
+ padding: 10rpx 20rpx 15rpx;
3071
+
3072
+ .title {
3073
+ color: #222222;
3074
+ }
3075
+
3076
+ .old-price {
3077
+ margin-top: 8rpx;
3078
+ font-size: 26rpx;
3079
+ color: #AAAAAA;
3080
+ text-decoration: line-through;
3081
+
3082
+ text {
3083
+ margin-right: 2px;
3084
+ font-size: 20rpx;
3085
+ }
3086
+ }
3087
+
3088
+ .price {
3089
+ display: flex;
3090
+ align-items: flex-end;
3091
+ color: $theme-color;
3092
+ font-size: 34rpx;
3093
+ font-weight: 800;
3094
+
3095
+ text {
3096
+ padding-bottom: 4rpx;
3097
+ font-size: 24rpx;
3098
+ font-weight: 800;
3099
+ }
3100
+
3101
+ .txt {
3102
+ display: flex;
3103
+ align-items: center;
3104
+ justify-content: center;
3105
+ width: 28rpx;
3106
+ height: 28rpx;
3107
+ margin-left: 15rpx;
3108
+ margin-bottom: 10rpx;
3109
+ border: 1px solid $theme-color;
3110
+ border-radius: 4rpx;
3111
+ font-size: 22rpx;
3112
+ font-weight: normal;
3113
+ }
3114
+ }
3115
+ }
3116
+ }
3117
+
3118
+ &.on {
3119
+ display: flex;
3120
+ }
3121
+ }
3122
+ }
3123
+}
3124
+
3125
+.zoneList_title {
3126
+ font-size: 34rpx;
3127
+ line-height: 48rpx;
3128
+ width: 690rpx;
3129
+ margin: 0 auto;
3130
+ margin-bottom: 15rpx;
3131
+ font-weight: bold;
3132
+ color: #000000;
3133
+}
3134
+
3135
+.zoneList_box {
3136
+ width: 100%;
3137
+ height: 305rpx;
3138
+
3139
+ .zoneList_wrapper {
3140
+ width: max-content;
3141
+ white-space: nowrap;
3142
+ height: 305rpx;
3143
+ }
3144
+
3145
+ .zoneList_item {
3146
+ display: inline-block;
3147
+ width: 540rpx;
3148
+ height: 305rpx;
3149
+ margin-left: 30rpx;
3150
+
3151
+ :last-child {
3152
+ margin-right: 30rpx;
3153
+ }
3154
+
3155
+ image {
3156
+ width: 540rpx;
3157
+ height: 305rpx;
3158
+ border-radius: 16rpx;
3159
+ }
3160
+ }
3161
+
3162
+ &.isSingle {
3163
+ height: 390rpx;
3164
+
3165
+ .zoneList_item {
3166
+ width: 690rpx;
3167
+ height: 390rpx;
3168
+ margin-right: 0;
3169
+
3170
+ image {
3171
+ width: 690rpx;
3172
+ height: 390rpx;
3173
+ }
3174
+ }
3175
+ }
3176
+}
3177
+
3178
+.pictrue {
3179
+ position: relative;
3180
+}
3181
+
3182
+.fixed {
3183
+ z-index: 100;
3184
+ position: fixed;
3185
+ left: 0;
3186
+ top: 0;
3187
+ background: linear-gradient(90deg, red 50%, #ff5400 100%);
3188
+
3189
+}
3190
+
3191
+.mores-txt {
3192
+ width: 100%;
3193
+ align-items: center;
3194
+ justify-content: center;
3195
+ height: 70rpx;
3196
+ color: #999;
3197
+ font-size: 24rpx;
3198
+
3199
+ .iconfont {
3200
+ margin-top: 2rpx;
3201
+ font-size: 20rpx;
3202
+ }
3203
+}
3204
+
3205
+
3206
+
3207
+.mp-bg {
3208
+ width: 100%;
3209
+ height: 900rpx;
3210
+ background-color: #f5f5f5;
3211
+ position: absolute;
3212
+ left: 0;
3213
+ top: 0;
3214
+ background: url("https://ossacmall.bluedeer.com.cn/app/static/images/page_commonBg.png") center top/100% auto no-repeat;
3215
+ // border-radius: 0 0 30rpx 30rpx;
3216
+}
3217
+
3218
+.user_info {
3219
+ width: 690rpx;
3220
+ height: 107rpx;
3221
+ margin: 0 auto;
3222
+ margin-top: 15rpx;
3223
+ position: relative;
3224
+
3225
+ .user_head {
3226
+ width: 84rpx;
3227
+ height: 84rpx;
3228
+ box-sizing: border-box;
3229
+ border: 2rpx solid #FFE20E;
3230
+ background-color: #f5f5f5;
3231
+ border-radius: 50%;
20053232 overflow: hidden;
2006
- position: relative;
2007
- margin-top: 10rpx;
20083233
2009
- @keyframes moveAni {
2010
- 0% {
2011
- transform: none;
2012
- }
2013
-
2014
- 100% {
2015
- transform: translate(-50%, 0)
2016
- }
2017
- }
2018
-
2019
- .buy_wrapper {
2020
- width: max-content;
2021
- white-space: nowrap;
2022
- animation: moveAni 1s linear both infinite;
2023
- }
2024
-
2025
- .buy_item {
2026
- display: inline-block;
2027
- margin: 0 5rpx;
2028
- width: max-content;
2029
- font-size: 19rpx;
2030
- line-height: 48rpx;
2031
- background-color: rgba(255, 255, 255, .8);
2032
- color: #333333;
2033
- padding-left: 1em;
2034
- padding-right: 1em;
2035
- border-radius: 24rpx;
3234
+ image {
3235
+ width: 84rpx;
3236
+ height: 84rpx;
20363237 }
20373238 }
20383239
2039
- .stats {
3240
+ .user_level {
3241
+ width: 110rpx;
3242
+ height: 45rpx;
20403243 position: absolute;
2041
- left: 0px;
2042
- top: 0px;
2043
- z-index: 2000000;
2044
- width: 750rpx;
2045
- height: var(--status-bar-height);
2046
- background: #ffffff;
3244
+ left: 106rpx;
3245
+ top: 45rpx;
3246
+
3247
+ image {
3248
+ width: 110rpx;
3249
+ height: 45rpx;
3250
+ }
20473251 }
20483252
2049
- .couponList {
2050
- width: 690rpx;
2051
- height: 523rpx;
2052
- margin: 0 auto;
2053
- margin-bottom: 30rpx;
2054
- position: relative;
3253
+ .user_name,
3254
+ .user_loginTips {
3255
+ font-size: 31rpx;
3256
+ line-height: 46rpx;
3257
+ color: #000000;
3258
+ font-weight: bold;
3259
+ position: absolute;
3260
+ left: 106rpx;
3261
+ top: 0;
3262
+ background: none;
3263
+ }
20553264
2056
- .couponList_title {
2057
- position: absolute;
2058
- left: 30rpx;
2059
- top: 60rpx;
2060
- color: #ffffff;
3265
+ .user_careNum {
3266
+ color: #333333;
3267
+ position: absolute;
3268
+ right: 0;
3269
+ top: 0;
3270
+ text-align: right;
3271
+ font-size: 31rpx;
3272
+ line-height: 46rpx;
3273
+
3274
+ .num {
20613275 font-size: 40rpx;
20623276 font-weight: bold;
20633277 }
20643278
2065
- image {
2066
- width: 690rpx;
2067
- height: 523rpx;
2068
- }
2069
-
2070
- .couponList_btn {
2071
- font-size: 24rpx;
2072
- line-height: 48rpx;
2073
- color: #000000;
2074
- text-align: right;
2075
- position: absolute;
2076
- right: 34rpx;
2077
- top: 138rpx;
2078
- padding-right: 42rpx;
2079
- text-decoration: underline;
2080
- background: url("https://ossacmall.bluedeer.com.cn/app/static/images/h_hand.gif") right center/contain no-repeat;
2081
- }
2082
-
2083
- .couponList_box {
2084
- width: 630rpx;
2085
- height: 260rpx;
2086
- position: absolute;
2087
- left: 30rpx;
2088
- top: 200rpx;
2089
- overflow: hidden;
2090
-
2091
- .couponList_wrapper {
2092
- white-space: nowrap;
2093
- }
2094
-
2095
- .couponList_item {
2096
- width: 231rpx;
2097
- height: 260rpx;
2098
- display: inline-block;
2099
- position: relative;
2100
- background: url("https://ossacmall.bluedeer.com.cn/app/static/images/coupon_itemBg.png") center center/100% 100% no-repeat;
2101
- margin-right: 25rpx;
2102
-
2103
- :last-child {
2104
- margin-right: 0;
2105
- }
2106
-
2107
- .give {
2108
- font-weight: bold;
2109
- font-size: 19rpx;
2110
- color: #FFFFFF;
2111
- text-align: center;
2112
- font-style: normal;
2113
- text-transform: none;
2114
- background-color: #016DCC;
2115
- border-radius: 14rpx 14rpx 14rpx 0;
2116
- width: 49rpx;
2117
- height: 28rpx;
2118
- line-height: 28rpx;
2119
- position: absolute;
2120
- left: 8rpx;
2121
- top: 0;
2122
- z-index: 2;
2123
- }
2124
-
2125
- .amount {
2126
- font-size: 53rpx;
2127
- line-height: 95rpx;
2128
- width: max-content;
2129
- position: absolute;
2130
- left: 50%;
2131
- transform: translate(-50%, 0);
2132
- top: 34rpx;
2133
- color: #000000;
2134
- font-weight: bold;
2135
- text-align: center;
2136
-
2137
- .unit {
2138
- font-size: 0.5em;
2139
- }
2140
- }
2141
-
2142
- .amountSmall {
2143
- font-size: 32rpx;
2144
- line-height: 56rpx;
2145
- top: 32rpx;
2146
-
2147
- .text2 {
2148
- display: block;
2149
- margin: 0 auto;
2150
- font-size: 28rpx;
2151
- line-height: 36rpx;
2152
- width: max-content;
2153
- padding: 0 21rpx;
2154
- border: 1rpx solid #303030;
2155
- }
2156
- }
2157
-
2158
- .label {
2159
- font-size: 24rpx;
2160
- lineh-height: 30rpx;
2161
- color: #000000;
2162
- text-align: center;
2163
- position: absolute;
2164
- width: 100%;
2165
- left: 0;
2166
- top: -50rpx;
2167
- }
2168
-
2169
- .name {
2170
- width: 90%;
2171
- left: 5%;
2172
- line-height: 23rpx;
2173
- font-size: 22rpx;
2174
- color: #000000;
2175
- text-align: center;
2176
- position: absolute;
2177
- top: 135rpx;
2178
- transform: translate(0, -50%);
2179
- white-space: normal;
2180
- word-break: break-all;
2181
- }
2182
-
2183
- .btn {
2184
- position: absolute;
2185
- width: 130rpx;
2186
- font-size: 23rpx;
2187
- line-height: 45rpx;
2188
- text-align: center;
2189
- background: #FFE20E;
2190
- border-radius: 8rpx 8rpx 8rpx 8rpx;
2191
- left: 50%;
2192
- margin-left: -65rpx;
2193
- bottom: 27rpx;
2194
-
2195
- &used {
2196
- background: #efefef;
2197
- }
2198
- }
2199
- }
2200
- }
2201
- }
2202
-
2203
- .goods_menuBox {
2204
- width: 100%;
2205
- box-sizing: border-box;
2206
- // background: linear-gradient(180deg, #f5f5f5 0%, #ffffff 100%);
2207
- background-color: #f5f5f5;
2208
- position: -webkit-sticky;
2209
- position: sticky;
2210
- /* #ifdef H5*/
2211
- top: var(--window-top);
2212
- /* #endif */
2213
- z-index: 99;
2214
-
2215
- .subMenu {
2216
- width: 100%;
2217
- }
2218
-
2219
- .subMenu_wrapper {
3279
+ .label {
22203280 width: max-content;
2221
- white-space: nowrap;
2222
- padding-left: 30rpx;
3281
+ font-size: 21rpx;
3282
+ line-height: 42rpx;
3283
+ position: absolute;
3284
+ right: 0;
3285
+ top: 46rpx;
3286
+ padding-right: 30rpx;
3287
+ background: url("https://ossacmall.bluedeer.com.cn/app/static/images/i_info.png") right center/20rpx auto no-repeat;
22233288 }
2224
-
2225
- .subMenu_item {
2226
- // display: inline-block;
2227
- // min-width: 3em;
2228
- text-align: center;
2229
- font-size: 27rpx;
2230
- color: #979797;
2231
- height: 100rpx;
2232
- box-sizing: border-box;
2233
- margin-right: 10rpx;
2234
- .text{
2235
- width: max-content;
2236
- display: inline-block;
2237
- position: relative;
2238
- line-height: 40rpx;
2239
- padding-left: 14rpx;
2240
- padding-right: 14rpx;
2241
- margin-top:30rpx;
2242
- margin-bottom: 30rpx;
2243
- }
2244
- }
2245
-
2246
- .subMenu_item:last-child {
2247
- margin-right: 30rpx;
2248
- }
2249
-
2250
- .subMenu_item.on {
2251
- color: #ffffff;
2252
- font-weight: bold;
2253
- position: relative;
2254
- .text {
2255
- background: linear-gradient(to right,#ffdc37,#fd9b2b);
2256
- border-radius: 20rpx;
2257
- font-weight: bold;
2258
- }
2259
- }
2260
-
22613289 }
22623290
2263
- .goodsSection {
3291
+ .btn_vip {
3292
+ width: max-content;
3293
+ position: absolute;
3294
+ right: 0;
3295
+ font-size: 21rpx;
3296
+ line-height: 42rpx;
3297
+ left: 226rpx;
3298
+ top: 46rpx;
3299
+ color: #333333;
3300
+
3301
+ .iconfont {
3302
+ font-size: 21rpx !important;
3303
+ }
3304
+ }
3305
+
3306
+ .btn_toLogin {
3307
+ position: absolute;
3308
+ left: 106rpx;
3309
+ top: 30rpx;
3310
+ font-size: 21rpx;
3311
+ line-height: 82rpx;
3312
+ color: #333333;
3313
+
3314
+ .iconfont {
3315
+ font-size: 21rpx !important;
3316
+ }
3317
+ }
3318
+}
3319
+
3320
+.buy_list {
3321
+ width: 100%;
3322
+ height: 48rpx;
3323
+ overflow: hidden;
3324
+ position: relative;
3325
+ margin-top: 10rpx;
3326
+
3327
+ @keyframes moveAni {
3328
+ 0% {
3329
+ transform: none;
3330
+ }
3331
+
3332
+ 100% {
3333
+ transform: translate(-50%, 0)
3334
+ }
3335
+ }
3336
+
3337
+ .buy_wrapper {
3338
+ width: max-content;
3339
+ white-space: nowrap;
3340
+ animation: moveAni 1s linear both infinite;
3341
+ }
3342
+
3343
+ .buy_item {
3344
+ display: inline-block;
3345
+ margin: 0 5rpx;
3346
+ width: max-content;
3347
+ font-size: 19rpx;
3348
+ line-height: 48rpx;
3349
+ background-color: rgba(255, 255, 255, .8);
3350
+ color: #333333;
3351
+ padding-left: 1em;
3352
+ padding-right: 1em;
3353
+ border-radius: 24rpx;
3354
+ }
3355
+}
3356
+
3357
+.stats {
3358
+ position: absolute;
3359
+ left: 0px;
3360
+ top: 0px;
3361
+ z-index: 2000000;
3362
+ width: 750rpx;
3363
+ height: var(--status-bar-height);
3364
+ background: #ffffff;
3365
+}
3366
+
3367
+.couponList {
3368
+ width: 690rpx;
3369
+ height: 523rpx;
3370
+ margin: 0 auto;
3371
+ margin-bottom: 30rpx;
3372
+ position: relative;
3373
+
3374
+ .couponList_title {
3375
+ position: absolute;
3376
+ left: 30rpx;
3377
+ top: 60rpx;
3378
+ color: #ffffff;
3379
+ font-size: 40rpx;
3380
+ font-weight: bold;
3381
+ }
3382
+
3383
+ image {
22643384 width: 690rpx;
2265
- position: relative;
2266
- margin: 0 auto;
3385
+ height: 523rpx;
3386
+ }
22673387
3388
+ .couponList_btn {
3389
+ font-size: 24rpx;
3390
+ line-height: 48rpx;
3391
+ color: #000000;
3392
+ text-align: right;
3393
+ position: absolute;
3394
+ right: 34rpx;
3395
+ top: 138rpx;
3396
+ padding-right: 42rpx;
3397
+ text-decoration: underline;
3398
+ background: url("https://ossacmall.bluedeer.com.cn/app/static/images/h_hand.gif") right center/contain no-repeat;
3399
+ }
22683400
2269
- .goodsList {
2270
- height: 100rpx;
2271
- overflow: hidden;
3401
+ .couponList_box {
3402
+ width: 630rpx;
3403
+ height: 260rpx;
3404
+ position: absolute;
3405
+ left: 30rpx;
3406
+ top: 200rpx;
3407
+ overflow: hidden;
3408
+
3409
+ .couponList_wrapper {
3410
+ white-space: nowrap;
22723411 }
22733412
2274
- .list {
2275
- .list_column{
3413
+ .couponList_item {
3414
+ width: 231rpx;
3415
+ height: 260rpx;
3416
+ display: inline-block;
3417
+ position: relative;
3418
+ background: url("https://ossacmall.bluedeer.com.cn/app/static/images/coupon_itemBg.png") center center/100% 100% no-repeat;
3419
+ margin-right: 25rpx;
3420
+
3421
+ :last-child {
3422
+ margin-right: 0;
3423
+ }
3424
+
3425
+ .give {
3426
+ font-weight: bold;
3427
+ font-size: 19rpx;
3428
+ color: #FFFFFF;
3429
+ text-align: center;
3430
+ font-style: normal;
3431
+ text-transform: none;
3432
+ background-color: #016DCC;
3433
+ border-radius: 14rpx 14rpx 14rpx 0;
3434
+ width: 49rpx;
3435
+ height: 28rpx;
3436
+ line-height: 28rpx;
3437
+ position: absolute;
3438
+ left: 8rpx;
3439
+ top: 0;
3440
+ z-index: 2;
3441
+ }
3442
+
3443
+ .amount {
3444
+ font-size: 53rpx;
3445
+ line-height: 95rpx;
3446
+ width: max-content;
3447
+ position: absolute;
3448
+ left: 50%;
3449
+ transform: translate(-50%, 0);
3450
+ top: 34rpx;
3451
+ color: #000000;
3452
+ font-weight: bold;
3453
+ text-align: center;
3454
+
3455
+ .unit {
3456
+ font-size: 0.5em;
3457
+ }
3458
+ }
3459
+
3460
+ .amountSmall {
3461
+ font-size: 32rpx;
3462
+ line-height: 56rpx;
3463
+ top: 32rpx;
3464
+
3465
+ .text2 {
3466
+ display: block;
3467
+ margin: 0 auto;
3468
+ font-size: 28rpx;
3469
+ line-height: 36rpx;
3470
+ width: max-content;
3471
+ padding: 0 21rpx;
3472
+ border: 1rpx solid #303030;
3473
+ }
3474
+ }
3475
+
3476
+ .label {
3477
+ font-size: 24rpx;
3478
+ lineh-height: 30rpx;
3479
+ color: #000000;
3480
+ text-align: center;
3481
+ position: absolute;
3482
+ width: 100%;
3483
+ left: 0;
3484
+ top: -50rpx;
3485
+ }
3486
+
3487
+ .name {
3488
+ width: 90%;
3489
+ left: 5%;
3490
+ line-height: 23rpx;
3491
+ font-size: 22rpx;
3492
+ color: #000000;
3493
+ text-align: center;
3494
+ position: absolute;
3495
+ top: 135rpx;
3496
+ transform: translate(0, -50%);
3497
+ white-space: normal;
3498
+ word-break: break-all;
3499
+ }
3500
+
3501
+ .btn {
3502
+ position: absolute;
3503
+ width: 130rpx;
3504
+ font-size: 23rpx;
3505
+ line-height: 45rpx;
3506
+ text-align: center;
3507
+ background: #FFE20E;
3508
+ border-radius: 8rpx 8rpx 8rpx 8rpx;
3509
+ left: 50%;
3510
+ margin-left: -65rpx;
3511
+ bottom: 27rpx;
3512
+
3513
+ &used {
3514
+ background: #efefef;
3515
+ }
22763516 }
22773517 }
3518
+ }
3519
+}
22783520
2279
- .loadingTips {
3521
+.goods_menuBox {
3522
+ width: 100%;
3523
+ box-sizing: border-box;
3524
+ // background: linear-gradient(180deg, #f5f5f5 0%, #ffffff 100%);
3525
+ background-color: #f5f5f5;
3526
+ position: -webkit-sticky;
3527
+ position: sticky;
3528
+ /* #ifdef H5*/
3529
+ top: var(--window-top);
3530
+ /* #endif */
3531
+ z-index: 99;
3532
+
3533
+ .subMenu {
3534
+ width: 100%;
3535
+ }
3536
+
3537
+ .subMenu_wrapper {
3538
+ width: max-content;
3539
+ white-space: nowrap;
3540
+ padding-left: 30rpx;
3541
+ }
3542
+
3543
+ .subMenu_item {
3544
+ // display: inline-block;
3545
+ // min-width: 3em;
3546
+ text-align: center;
3547
+ font-size: 27rpx;
3548
+ color: #979797;
3549
+ height: 100rpx;
3550
+ box-sizing: border-box;
3551
+ margin-right: 10rpx;
3552
+
3553
+ .text {
22803554 width: max-content;
2281
- padding-left: 60rpx;
2282
- font-size: 27rpx;
2283
- line-height: 60rpx;
2284
- margin: 0 auto;
2285
- color: #DDDDDD;
2286
- background: url('https://ossacmall.bluedeer.com.cn/app/static/images/h_loading.png') left center/41rpx auto no-repeat;
3555
+ display: inline-block;
3556
+ position: relative;
3557
+ line-height: 40rpx;
3558
+ padding-left: 14rpx;
3559
+ padding-right: 14rpx;
3560
+ margin-top: 30rpx;
3561
+ margin-bottom: 30rpx;
22873562 }
3563
+ }
22883564
2289
- .pauseView {
2290
- width: 100%;
2291
- height: 100%;
2292
- position: absolute;
2293
- left: 0;
2294
- top: 0;
2295
- z-index: 2;
3565
+ .subMenu_item:last-child {
3566
+ margin-right: 30rpx;
3567
+ }
3568
+
3569
+ .subMenu_item.on {
3570
+ color: #ffffff;
3571
+ font-weight: bold;
3572
+ position: relative;
3573
+
3574
+ .text {
3575
+ background: linear-gradient(to right, #ffdc37, #fd9b2b);
3576
+ border-radius: 20rpx;
3577
+ font-weight: bold;
22963578 }
22973579 }
2298
- .specialZone_box{
2299
- padding: 30vw 0 0 0;
2300
- background-color: red;
2301
- .specialZone_item{
2302
- width: 33%;
2303
- margin-bottom: 10vw;
2304
- float: left;
2305
- .specialGoodItem_image{
2306
- display: block;
2307
- width: 20vw;
2308
- height: 20vw;
2309
- margin: 0 auto;
2310
- }
2311
- }
3580
+
3581
+}
3582
+
3583
+.goodsSection {
3584
+ width: 690rpx;
3585
+ position: relative;
3586
+ margin: 0 auto;
3587
+
3588
+
3589
+ .goodsList {
3590
+ height: 100rpx;
3591
+ overflow: hidden;
23123592 }
2313
- .index_lottery{
2314
- width: 687rpx;
2315
- margin: 45rpx auto 0 auto;
2316
- .index_lottery_img{
3593
+
3594
+ .list {
3595
+ .list_column {}
3596
+ }
3597
+
3598
+ .loadingTips {
3599
+ width: max-content;
3600
+ padding-left: 60rpx;
3601
+ font-size: 27rpx;
3602
+ line-height: 60rpx;
3603
+ margin: 0 auto;
3604
+ color: #DDDDDD;
3605
+ background: url('https://ossacmall.bluedeer.com.cn/app/static/images/h_loading.png') left center/41rpx auto no-repeat;
3606
+ }
3607
+
3608
+ .pauseView {
3609
+ width: 100%;
3610
+ height: 100%;
3611
+ position: absolute;
3612
+ left: 0;
3613
+ top: 0;
3614
+ z-index: 2;
3615
+ }
3616
+}
3617
+
3618
+.specialZone_box {
3619
+ padding: 30vw 0 0 0;
3620
+ background-color: red;
3621
+
3622
+ .specialZone_item {
3623
+ width: 33%;
3624
+ margin-bottom: 10vw;
3625
+ float: left;
3626
+
3627
+ .specialGoodItem_image {
23173628 display: block;
2318
- width: 100%;
2319
- height: auto;
3629
+ width: 20vw;
3630
+ height: 20vw;
3631
+ margin: 0 auto;
23203632 }
23213633 }
3634
+}
3635
+
3636
+.index_lottery {
3637
+ width: 687rpx;
3638
+ margin: 45rpx auto 0 auto;
3639
+
3640
+ .index_lottery_img {
3641
+ display: block;
3642
+ width: 100%;
3643
+ height: auto;
3644
+ }
3645
+}
23223646 </style>
pages/order_pay_status/index.vue
....@@ -231,28 +231,6 @@
231231 path: url,
232232 envVersion: miniProgramInfo.envVersion == 'release' ? 'release' : 'trial',
233233 })
234
-
235
- // let params = {};
236
- // params['custAgentNo'] = ((this.$store.getters.belong && this.$store.getters.belong.agentNo) ? this.$store
237
- // .getters.belong.agentNo : '');
238
- // params['custAgentChnl'] = ((this.$store.getters.belong && this.$store.getters.belong.channel) ? this.$store
239
- // .getters.belong.channel : '');
240
- // params['custAgentCoy'] = ((this.$store.getters.belong && this.$store.getters.belong.companyCode) ? this
241
- // .$store.getters.belong.companyCode : '');
242
- // params['custAgentBranch'] = ((this.$store.getters.belong && this.$store.getters.belong.branchCode) ? this
243
- // .$store.getters.belong.branchCode : '');
244
- // params['custAgentOrgNo'] = ((this.$store.getters.belong && this.$store.getters.belong.subCode) ? this
245
- // .$store.getters.belong.subCode : '');
246
- // let webUrl = 'https://ossacmall.bluedeer.com.cn/qr/index.html?isMall=true' + (miniProgramInfo.envVersion ==
247
- // 'release' ? '' : '&isTrial=true') + '&params=' + encodeURIComponent(JSON.stringify(params)) +
248
- // '&pageUrl=' + encodeURIComponent(url);
249
- // if (HTTP_REQUEST_URL.indexOf('tohours') > 0) {
250
- // webUrl = webUrl.replace('https://ossacmall.bluedeer.com.cn/qr',
251
- // 'https://sit.tohours.com/crmeb_web/qr/')
252
- // }
253
- // uni.navigateTo({
254
- // url: '/pages/users/web_page/index?webUel=' + encodeURIComponent(webUrl)
255
- // })
256234 },
257235 goToLink(item, type) {
258236 let that = this;
pages/user/index.vue
....@@ -508,14 +508,6 @@
508508 path: url,
509509 envVersion: envVersion != 'release' ? 'trial' : 'release'
510510 })
511
-
512
- // let webUrl='https://ossacmall.bluedeer.com.cn/qr/index.html?isMall=true'+(envVersion == 'release' ? '' : '&isTrial=true')+'&params='+encodeURIComponent(JSON.stringify(params))+'&pageUrl='+encodeURIComponent(url);
513
- // if(HTTP_REQUEST_URL.indexOf('tohours')>0){
514
- // webUrl=webUrl.replace('https://ossacmall.bluedeer.com.cn/qr','https://sit.tohours.com/crmeb_web/qr/')
515
- // }
516
- // uni.navigateTo({
517
- // url: '/pages/users/web_page/index?webUel='+encodeURIComponent(webUrl)
518
- // })
519511 }
520512 if (!that.$store.getters.isLogin) {
521513 toLogin(that);
pages/users/order_confirm/index.vue
....@@ -579,31 +579,6 @@
579579 path: url,
580580 envVersion: miniProgramInfo.envVersion == 'release' ? 'release' : 'trial',
581581 })
582
-
583
- // let params = {};
584
- // params['custAgentNo'] = ((that.$store.getters.belong && that.$store.getters.belong.agentNo) ? that
585
- // .$store
586
- // .getters.belong.agentNo : '');
587
- // params['custAgentChnl'] = ((that.$store.getters.belong && that.$store.getters.belong.channel) ? that
588
- // .$store
589
- // .getters.belong.channel : '');
590
- // params['custAgentCoy'] = ((that.$store.getters.belong && that.$store.getters.belong.companyCode) ? that
591
- // .$store.getters.belong.companyCode : '');
592
- // params['custAgentBranch'] = ((that.$store.getters.belong && that.$store.getters.belong.branchCode) ?
593
- // that
594
- // .$store.getters.belong.branchCode : '');
595
- // params['custAgentOrgNo'] = ((that.$store.getters.belong && that.$store.getters.belong.subCode) ? that
596
- // .$store.getters.belong.subCode : '');
597
- // let webUrl = 'https://ossacmall.bluedeer.com.cn/qr/index.html?isMall=true' + (miniProgramInfo.envVersion == 'release' ?
598
- // '' : '&isTrial=true') + '&params=' + encodeURIComponent(JSON.stringify(params)) + '&pageUrl=' +
599
- // encodeURIComponent(url);
600
- // if (HTTP_REQUEST_URL.indexOf('tohours') > 0) {
601
- // webUrl = webUrl.replace('https://ossacmall.bluedeer.com.cn/qr',
602
- // 'https://sit.tohours.com/crmeb_web/qr/')
603
- // }
604
- // uni.navigateTo({
605
- // url: '/pages/users/web_page/index?webUel=' + encodeURIComponent(webUrl)
606
- // })
607582 }
608583 if (!that.$store.getters.isLogin) {
609584 toLogin(that);
....@@ -1730,7 +1705,7 @@
17301705 box-sizing: border-box;
17311706 padding: 25rpx 25rpx 25rpx 55rpx;
17321707 border-radius: 14rpx;
1733
- background: url("https://ossacmall.bluedeer.com.cn/app/static/images/icon_expressTips.png") 15rpx 25rpx/32rpx auto no-repeat;
1708
+ background: url("https://ossacmall.bluedeer.com.cn/app/static/images/icon_expressTips.png") 15rpx 25rpx / 32rpx auto no-repeat;
17341709 background-color: #fef7ee;
17351710 color: #8e3b1f;
17361711 font-size: 27rpx;
pages/users/user_coupon/index.vue
....@@ -289,28 +289,6 @@
289289 path: url,
290290 envVersion: miniProgramInfo.envVersion == 'release' ? 'release' : 'trial',
291291 })
292
-
293
- // let params = {};
294
- // params['custAgentNo'] = ((this.$store.getters.belong && this.$store.getters.belong.agentNo) ? this.$store
295
- // .getters.belong.agentNo : '');
296
- // params['custAgentChnl'] = ((this.$store.getters.belong && this.$store.getters.belong.channel) ? this.$store
297
- // .getters.belong.channel : '');
298
- // params['custAgentCoy'] = ((this.$store.getters.belong && this.$store.getters.belong.companyCode) ? this
299
- // .$store.getters.belong.companyCode : '');
300
- // params['custAgentBranch'] = ((this.$store.getters.belong && this.$store.getters.belong.branchCode) ? this
301
- // .$store.getters.belong.branchCode : '');
302
- // params['custAgentOrgNo'] = ((this.$store.getters.belong && this.$store.getters.belong.subCode) ? this
303
- // .$store.getters.belong.subCode : '');
304
- // let webUrl = 'https://ossacmall.bluedeer.com.cn/qr/index.html?isMall=true' + (miniProgramInfo.envVersion ==
305
- // 'release' ? '' : '&isTrial=true') + '&params=' + encodeURIComponent(JSON.stringify(params)) +
306
- // '&pageUrl=' + encodeURIComponent(url);
307
- // if (HTTP_REQUEST_URL.indexOf('tohours') > 0) {
308
- // webUrl = webUrl.replace('https://ossacmall.bluedeer.com.cn/qr',
309
- // 'https://sit.tohours.com/crmeb_web/qr/')
310
- // }
311
- // uni.navigateTo({
312
- // url: '/pages/users/web_page/index?webUel=' + encodeURIComponent(webUrl)
313
- // })
314292 },
315293 isTabLink(link) {
316294 let isTab = false;
pages/zone/index.vue
....@@ -14,6 +14,9 @@
1414 <view :style="{ height: marTop + 'px' }"></view>
1515 <yueyangZone ref=yueyangZoneRef v-if="isYueyangZone" :zoneInfo="info" :careBeanRate="careBeanRate"
1616 style="position: relative;z-index: 2;" @goLottery="goLottery" :relationKey="relationKey"></yueyangZone>
17
+ <view v-if="isYueyangZone" class="detail-btn" @click="goDetail">
18
+ <text>消耗明细</text>
19
+ </view>
1720 <view v-else>
1821 <view class="expireTime" v-if="expireTime && expireTime.length">
1922 <text>专区将在</text>
....@@ -24,6 +27,24 @@
2427 </view>
2528 <view class="head_img">
2629 <image :src="info.image"></image>
30
+ </view>
31
+ <view v-if="info.zoneType == 8 && info.info" class="rich-content">
32
+ <rich-text :nodes="info.info"></rich-text>
33
+ </view>
34
+ <view v-if="info.zoneType == 8 && info.uploadVideo" class="video-wrap">
35
+ <view v-show="!videoControls" style="width:100%;height:750rpx">
36
+ <video id="zoneVideo" :src='info.uploadVideo' objectFit="contain" controls
37
+ style="width:100%;height:100%" show-center-play-btn="true" show-mute-btn="true" muted="true"
38
+ show-fullscreen-btn="true" auto-pause-if-navigate :custom-cache="false"
39
+ :enable-progress-gesture="true" show-progress="false"
40
+ :poster="info.uploadVideoImg || info.image" @pause="zoneVideoPause"></video>
41
+ </view>
42
+ <view class="video-poster" v-show="videoControls">
43
+ <image class="image" :src="info.uploadVideoImg || info.image"></image>
44
+ </view>
45
+ <view class="video-stop" v-show="videoControls" @tap="bindZoneVideoPlay">
46
+ <image class="image" src="https://ossacmall.bluedeer.com.cn/app/static/images/stop.png"></image>
47
+ </view>
2748 </view>
2849 <view class="tag-wrap-container" :style="'top:' + (marTop) + 'px;'" v-if="info.zoneType == 7">
2950 <view class="tag-wrap">
....@@ -495,7 +516,7 @@
495516
496517 <script>
497518 import {
498
- HTTP_REQUEST_URL
519
+ WEB_ACTIVITY_BASE
499520 } from '@/config/app';
500521 import {
501522 mapGetters
....@@ -596,6 +617,8 @@
596617 isYueyangZone: false,
597618 isOpen: false, // 默认收起,false收起/true展开
598619 currentIndex: -1, // 默认选中第一个【全部】
620
+ videoControls: true, // 专区活动视频是否显示海报+播放按钮
621
+ zoneVideoContext: '', // 活动视频播放上下文
599622 partitionList: [],
600623 partitionProject: {},
601624 tagList: [],
....@@ -835,6 +858,17 @@
835858 }
836859 },
837860 methods: {
861
+ /**
862
+ * 专区活动视频:点击海报播放按钮后播放
863
+ */
864
+ bindZoneVideoPlay() {
865
+ if (!this.zoneVideoContext) {
866
+ this.zoneVideoContext = uni.createVideoContext('zoneVideo', this);
867
+ }
868
+ this.$set(this, 'videoControls', false);
869
+ this.zoneVideoContext.play();
870
+ },
871
+ zoneVideoPause() { },
838872 handleCouponRule() {
839873 this.$refs.personalAndShareCouponRuleRef.show(this.info.ruleContentText)
840874 },
....@@ -1195,6 +1229,11 @@
11951229 // that.myCareBean = res2.data.totalCareBeans;
11961230 });
11971231 },
1232
+ goDetail() {
1233
+ uni.navigateTo({
1234
+ url: '/pages/consumption/index?zoneId=' + this.info.id
1235
+ })
1236
+ },
11981237 goLottery() {
11991238 let that = this;
12001239 var data = {
....@@ -1206,11 +1245,7 @@
12061245 this.addTrack('yy_marketPageClick', data);
12071246
12081247 function go() {
1209
- let webUrl = 'https://ossacmall.bluedeer.com.cn/acmall_lottery/index.html'
1210
- if (HTTP_REQUEST_URL.indexOf('tohours') > 0) {
1211
- webUrl = webUrl.replace('https://ossacmall.bluedeer.com.cn',
1212
- 'https://sit.tohours.com/crmeb_web')
1213
- }
1248
+ let webUrl = `${WEB_ACTIVITY_BASE}/acmall_lottery/index.html`
12141249 webUrl += '?token=' +
12151250 that.$store.getters.token + '&unionId=' + that.$store.getters.unionId + '&mdayId=' + that.info
12161251 .mdayId
....@@ -1449,6 +1484,7 @@
14491484 console.log('专区详情入参::', params)
14501485 getZoneDetail(that.id, params).then(res => {
14511486 that.info = res.data;
1487
+ //that.info.zoneType=8;
14521488 that.updateZoneShareMenu();
14531489 if (res.data.zoneType == 6) {
14541490 that.setYueyangZone()
....@@ -1840,6 +1876,21 @@
18401876 transform: translate(0, -50%);
18411877 }
18421878
1879
+.detail-btn {
1880
+ border: 2rpx solid #fff;
1881
+ border-top-left-radius: 20rpx;
1882
+ border-bottom-left-radius: 20rpx;
1883
+ padding: 10rpx;
1884
+ background-color: #daf2b2;
1885
+ color: #1e984f;
1886
+ width: 50rpx;
1887
+ position: fixed;
1888
+ top: 200rpx;
1889
+ right: 0rpx;
1890
+ line-height: 1rem;
1891
+ z-index: 99;
1892
+}
1893
+
18431894 .head_img {
18441895 width: 750rpx;
18451896 height: 422rpx;
....@@ -1850,6 +1901,48 @@
18501901 }
18511902 }
18521903
1904
+.rich-content {
1905
+ padding: 24rpx 30rpx;
1906
+ background-color: #fff;
1907
+}
1908
+
1909
+.video-wrap {
1910
+ position: relative;
1911
+ width: 100%;
1912
+ height: 750rpx;
1913
+ background-color: #000;
1914
+}
1915
+
1916
+.video-wrap .video-poster {
1917
+ position: absolute;
1918
+ top: 0;
1919
+ left: 0;
1920
+ width: 100%;
1921
+ height: 750rpx;
1922
+ z-index: 9;
1923
+}
1924
+
1925
+.video-wrap .video-poster .image {
1926
+ width: 100%;
1927
+ height: 100%;
1928
+}
1929
+
1930
+.video-wrap .video-stop {
1931
+ position: absolute;
1932
+ top: 50%;
1933
+ left: 50%;
1934
+ width: 136rpx;
1935
+ height: 136rpx;
1936
+ margin-top: -68rpx;
1937
+ margin-left: -68rpx;
1938
+ z-index: 9;
1939
+}
1940
+
1941
+.video-wrap .video-stop .image {
1942
+ width: 100%;
1943
+ height: 100%;
1944
+}
1945
+
18531946 .toolbarList {
18541947 width: 750rpx;
18551948 position: -webkit-sticky;
project.config.json
deleted file mode 100644
....@@ -1,29 +0,0 @@
1
-{
2
- "appid": "wx15d029cdf2e92a9f",
3
- "compileType": "miniprogram",
4
- "libVersion": "3.1.4",
5
- "packOptions": {
6
- "ignore": [],
7
- "include": []
8
- },
9
- "setting": {
10
- "coverView": true,
11
- "es6": true,
12
- "postcss": true,
13
- "minified": true,
14
- "enhance": true,
15
- "showShadowRootInWxmlPanel": true,
16
- "packNpmRelationList": [],
17
- "babelSetting": {
18
- "ignore": [],
19
- "disablePlugins": [],
20
- "outputPath": ""
21
- },
22
- "condition": false
23
- },
24
- "condition": {},
25
- "editorSetting": {
26
- "tabIndent": "insertSpaces",
27
- "tabSize": 2
28
- }
29
-}
publish-prod.bat
....@@ -0,0 +1,12 @@
1
+@echo off
2
+chcp 65001 >nul
3
+cd /d "%~dp0"
4
+node "scripts\publish.js" prod %*
5
+if errorlevel 1 (
6
+ echo.
7
+ echo [FAILED] publish PROD failed - see output above
8
+) else (
9
+ echo.
10
+ echo [OK] PROD finished - see output above. Release dir: unpackage\dist\build\mp-weixin
11
+)
12
+pause
publish-sit.bat
....@@ -0,0 +1,12 @@
1
+@echo off
2
+chcp 65001 >nul
3
+cd /d "%~dp0"
4
+node "scripts\publish.js" sit %*
5
+if errorlevel 1 (
6
+ echo.
7
+ echo [FAILED] publish SIT failed - see output above
8
+) else (
9
+ echo.
10
+ echo [OK] SIT finished - see output above. Release dir: unpackage\dist\build\mp-weixin
11
+)
12
+pause
scripts/manifest.js
....@@ -0,0 +1,122 @@
1
+/**
2
+ * manifest.json 生成器
3
+ *
4
+ * manifest.json 是 HBuilderX 的编译输入,但内含环境相关 appid,不适合直接提交;
5
+ * 因此模板入库、生成物忽略:
6
+ *
7
+ * manifest.json.demo(入库,模板) ──注入环境 appid──▶ manifest.json(.gitignore)
8
+ *
9
+ * appid 数据源唯一:config/env/<env>.js 的 UNI_APPID(DCloud 标识)、APPID(微信小程序 appid)
10
+ * 说明:模板里 mp-weixin 的 appid 允许写成 null 或不存在,生成时会自动写入/补齐。
11
+ */
12
+const fs = require('fs');
13
+const path = require('path');
14
+
15
+const ROOT = path.resolve(__dirname, '..');
16
+const TEMPLATE = path.join(ROOT, 'manifest.json.demo');
17
+const TARGET = path.join(ROOT, 'manifest.json');
18
+
19
+function fail(msg) {
20
+ console.error('[manifest] ' + msg);
21
+ process.exit(1);
22
+}
23
+
24
+/** 只替换第一处 "appid" : <字符串或 null>,保留原有的空格/缩进风格 */
25
+function replaceAppId(text, value) {
26
+ let done = false;
27
+ const result = text.replace(/"appid"(\s*:\s*)(?:"[^"]*"|null)/, function(match, sep) {
28
+ done = true;
29
+ return '"appid"' + sep + '"' + value + '"';
30
+ });
31
+ return { text: result, done: done };
32
+}
33
+
34
+/** 注入两个 appid:顶层(DCloud 标识)+ mp-weixin 块内(微信小程序 appid) */
35
+function injectAppIds(text, env) {
36
+ // 1) 顶层 appid(第一处出现即为顶层)
37
+ const top = replaceAppId(text, env.UNI_APPID);
38
+ if (!top.done) fail('模板中未找到顶层 "appid" 字段:' + path.relative(ROOT, TEMPLATE));
39
+ text = top.text;
40
+
41
+ // 2) mp-weixin 下的 appid,只在该区块内替换第一处
42
+ const idx = text.indexOf('"mp-weixin"');
43
+ if (idx < 0) fail('模板中未找到 "mp-weixin" 配置块:' + path.relative(ROOT, TEMPLATE));
44
+ const head = text.slice(0, idx);
45
+ const body = text.slice(idx);
46
+ const scoped = replaceAppId(body, env.APPID);
47
+ if (scoped.done) return head + scoped.text;
48
+
49
+ // 3) 字段被删掉时,按同级子项缩进补一行
50
+ const m = body.match(/^("mp-weixin"\s*:\s*\{)(\r?\n)([ \t]*)/);
51
+ if (!m) fail('模板的 "mp-weixin" 块格式异常,无法写入 appid');
52
+ const nl = m[2];
53
+ const indent = m[3];
54
+ return head + m[1] + nl + indent + '"appid" : "' + env.APPID + '",' + nl + indent + body.slice(m[0].length);
55
+}
56
+
57
+/** 统计「除 appid 行以外」的差异(按行内容比较,不受行号位移影响) */
58
+function otherDiff(a, b) {
59
+ function count(text) {
60
+ const m = new Map();
61
+ text.split(/\r?\n/).forEach(function(line) {
62
+ const l = line.replace(/\s+$/, '');
63
+ if (/^\s*"appid"\s*:/.test(l.trim())) return;
64
+ m.set(l, (m.get(l) || 0) + 1);
65
+ });
66
+ return m;
67
+ }
68
+ const ma = count(a);
69
+ const mb = count(b);
70
+ const keys = new Set(Array.from(ma.keys()).concat(Array.from(mb.keys())));
71
+ let diff = 0;
72
+ const sample = [];
73
+ keys.forEach(function(k) {
74
+ const d = Math.abs((ma.get(k) || 0) - (mb.get(k) || 0));
75
+ if (!d) return;
76
+ diff += d;
77
+ if (sample.length < 3 && k.trim()) sample.push(k.trim().slice(0, 40));
78
+ });
79
+ return { count: diff, sample: sample };
80
+}
81
+
82
+/**
83
+ * 按环境生成 manifest.json
84
+ * @param {object} env config/env/<env>.js 导出的配置
85
+ * @returns {{ file: string, changed: boolean }}
86
+ */
87
+function generate(env) {
88
+ if (!fs.existsSync(TEMPLATE)) {
89
+ fail('未找到模板 ' + path.relative(ROOT, TEMPLATE) +
90
+ '\n 请把 manifest.json 的模板保存为 manifest.json.demo(需入库)后再生成');
91
+ }
92
+
93
+ const rendered = injectAppIds(fs.readFileSync(TEMPLATE, 'utf8'), env);
94
+ const exists = fs.existsSync(TARGET);
95
+
96
+ if (exists) {
97
+ const prev = fs.readFileSync(TARGET, 'utf8');
98
+ // 行尾差异(CRLF/LF)不算变化,避免无意义重写
99
+ if (prev.replace(/\r\n/g, '\n') === rendered.replace(/\r\n/g, '\n')) {
100
+ console.log('[manifest] manifest.json 已是目标内容,无需重写');
101
+ return { file: TARGET, changed: false };
102
+ }
103
+ const diffs = otherDiff(prev, rendered);
104
+ if (diffs.count) {
105
+ console.log('[manifest] 注意:现有 manifest.json 有 ' + diffs.count + ' 行内容与模板不同,本次会被模板覆盖' +
106
+ (diffs.sample.length ? '(如 ' + diffs.sample.join(' | ') + ')' : ''));
107
+ console.log('[manifest] 需要长期保留的改动请写进 manifest.json.demo');
108
+ }
109
+ }
110
+
111
+ fs.writeFileSync(TARGET, rendered, 'utf8');
112
+ console.log('[manifest] 已由 manifest.json.demo 生成 manifest.json' +
113
+ '(DCloud ' + env.UNI_APPID + ' / 小程序 ' + env.APPID + ')');
114
+ return { file: TARGET, changed: true };
115
+}
116
+
117
+module.exports = {
118
+ TEMPLATE: TEMPLATE,
119
+ TARGET: TARGET,
120
+ generate: generate,
121
+ injectAppIds: injectAppIds
122
+};
scripts/publish.js
....@@ -0,0 +1,312 @@
1
+/**
2
+ * 命令行发行(不上传)+ 自动用微信开发者工具打开产物
3
+ *
4
+ * 用法:
5
+ * node scripts/publish.js sit # 发行 SIT 版本并打开微信开发者工具
6
+ * node scripts/publish.js prod # 发行 PROD 版本并打开微信开发者工具
7
+ * node scripts/publish.js sit --no-gen # 不改 manifest.json(要求它已存在)
8
+ * node scripts/publish.js sit --no-open # 只编译,不打开微信开发者工具
9
+ * node scripts/publish.js sit --dry-run # 只打印将要执行的命令
10
+ *
11
+ * 流程:从 manifest.json.demo 生成 manifest.json(按目标环境注入 appid)→ 发行编译 →
12
+ * 校正产物 appid → 用微信开发者工具打开产物
13
+ *
14
+ * 环境值统一取自 config/env/<env>.js(唯一数据源),接口地址等运行时参数由包内按 appid 自动识别;
15
+ * manifest.json 是生成物(已 .gitignore),因此 git 永远没有环境噪音。
16
+ * 微信开发者工具打开的产物 appid = unpackage/dist/build/mp-weixin/project.config.json 的 appid
17
+ * (构建时由 manifest 生成,这里再兜底校正一次)。
18
+ *
19
+ * 外部工具(HBuilderX cli.exe、微信开发者工具 cli.bat)不写死绝对路径,按顺序自动查找:
20
+ * 1) 环境变量 HBUILDERX_CLI / WX_DEVTOOLS_CLI
21
+ * 2) 系统 PATH
22
+ * 3) 常见安装目录(Program Files、用户目录、各磁盘常见软件目录)
23
+ * 4) 磁盘根目录浅层扫描(≤2 层)
24
+ * 找到后会把其所在目录加入本次进程 PATH(便于按名字直接调用),找不到则报错并给出解决办法。
25
+ */
26
+const { spawnSync } = require('child_process');
27
+const fs = require('fs');
28
+const path = require('path');
29
+const manifest = require('./manifest');
30
+
31
+const ROOT = path.resolve(__dirname, '..');
32
+const ENV_DIR = path.join(ROOT, 'config', 'env');
33
+const DIST_DIR = path.join(ROOT, 'unpackage', 'dist', 'build', 'mp-weixin');
34
+const DIST_CONFIG = path.join(DIST_DIR, 'project.config.json');
35
+
36
+/* ------------------------- 外部工具定位 ------------------------- */
37
+
38
+// 扫描时要跳过的系统/无关目录
39
+const SKIP_DIRS = /^(\$recycle\.bin|system volume information|windows|winsxs|node_modules|\.git|\.cache|programdata)$/i;
40
+
41
+const HX_TOOL = {
42
+ envKey: 'HBUILDERX_CLI',
43
+ label: 'HBuilderX 命令行 cli.exe',
44
+ names: ['cli.exe'],
45
+ subDirs: ['HBuilderX', 'HBuilderX\\HBuilderX'],
46
+ dirPattern: /^hbuilderx/i,
47
+ ok: function(file) { return /hbuilderx/i.test(file); },
48
+ hint: 'HBuilderX 安装/解压目录下的 cli.exe(如 X:\\HBuilderX\\cli.exe)',
49
+ extra: ''
50
+};
51
+
52
+const WX_TOOL = {
53
+ envKey: 'WX_DEVTOOLS_CLI',
54
+ label: '微信开发者工具命令行 cli.bat',
55
+ names: ['cli.bat'],
56
+ subDirs: ['微信web开发者工具', '微信开发者工具', 'Tencent\\微信web开发者工具', 'Tencent\\微信开发者工具'],
57
+ dirPattern: /微信(web)?开发者工具/,
58
+ hint: '微信开发者工具安装目录下的 cli.bat(如 X:\\Program Files (x86)\\Tencent\\微信web开发者工具\\cli.bat)',
59
+ extra: ' 3) 或加 --no-open,只编译不自动打开产物\n'
60
+};
61
+
62
+function fail(msg) {
63
+ console.error('[release] ' + msg);
64
+ process.exit(1);
65
+}
66
+
67
+function uniq(list) {
68
+ return list.filter(function(v, i) { return v && list.indexOf(v) === i; });
69
+}
70
+
71
+function isFile(p) {
72
+ try { return fs.statSync(p).isFile(); } catch (e) { return false; }
73
+}
74
+
75
+function isDir(p) {
76
+ try { return fs.statSync(p).isDirectory(); } catch (e) { return false; }
77
+}
78
+
79
+/** 本地固定磁盘(C:、D: …);拿不到时退回环境变量里的盘符(结果缓存,只探测一次) */
80
+let DRIVES = null;
81
+function fixedDrives() {
82
+ if (DRIVES) return DRIVES;
83
+ const ps = spawnSync('powershell', ['-NoProfile', '-NonInteractive', '-Command',
84
+ "[System.IO.DriveInfo]::GetDrives() | Where-Object { $_.DriveType -eq 'Fixed' } | ForEach-Object { $_.Name }"
85
+ ], { encoding: 'utf8', windowsHide: true });
86
+ const fromPs = (ps.stdout || '').split(/\r?\n/)
87
+ .map(function(s) { return s.trim().replace(/\\$/, ''); })
88
+ .filter(function(s) { return /^[A-Za-z]:$/.test(s); });
89
+ const fromEnv = [process.env.SystemDrive, process.env.HOMEDRIVE];
90
+ DRIVES = uniq(fromPs.concat(fromEnv).map(function(d) { return (d || '').replace(/\\$/, ''); }));
91
+ return DRIVES;
92
+}
93
+
94
+/** 在系统 PATH 中按文件名查找,ok() 用于排除同名无关程序 */
95
+function findOnPath(names, ok) {
96
+ const dirs = (process.env.PATH || '').split(path.delimiter);
97
+ for (let i = 0; i < dirs.length; i++) {
98
+ const dir = dirs[i].replace(/^"|"$/g, '');
99
+ if (!dir) continue;
100
+ for (let j = 0; j < names.length; j++) {
101
+ const file = path.join(dir, names[j]);
102
+ if (isFile(file) && (!ok || ok(file))) return file;
103
+ }
104
+ }
105
+ return '';
106
+}
107
+
108
+/** 常见安装根目录:Program Files、用户目录、各磁盘根与常见软件目录 */
109
+function baseDirs() {
110
+ const bases = [
111
+ process.env.ProgramFiles,
112
+ process.env['ProgramFiles(x86)'],
113
+ process.env.LOCALAPPDATA,
114
+ process.env.APPDATA,
115
+ process.env.USERPROFILE,
116
+ process.env.LOCALAPPDATA && path.join(process.env.LOCALAPPDATA, 'Programs'),
117
+ process.env.USERPROFILE && path.join(process.env.USERPROFILE, 'Desktop'),
118
+ process.env.USERPROFILE && path.join(process.env.USERPROFILE, 'Downloads')
119
+ ];
120
+ fixedDrives().forEach(function(d) {
121
+ bases.push(d + '\\', d + '\\Program Files', d + '\\Program Files (x86)',
122
+ d + '\\soft', d + '\\software', d + '\\Programs', d + '\\develop');
123
+ });
124
+ return uniq(bases).filter(isDir);
125
+}
126
+
127
+/** 磁盘浅层扫描:找名字符合特征的目录(兜底手段) */
128
+function scanPlausibleDirs(pattern) {
129
+ const found = [];
130
+ fixedDrives().forEach(function(root) {
131
+ let level1 = [];
132
+ try { level1 = fs.readdirSync(root + '\\', { withFileTypes: true }); } catch (e) { return; }
133
+ level1.forEach(function(e1) {
134
+ if (!e1.isDirectory() || SKIP_DIRS.test(e1.name)) return;
135
+ const p1 = path.join(root + '\\', e1.name);
136
+ if (pattern.test(e1.name)) { found.push(p1); return; }
137
+ let level2 = [];
138
+ try { level2 = fs.readdirSync(p1, { withFileTypes: true }); } catch (e) { return; }
139
+ level2.forEach(function(e2) {
140
+ if (e2.isDirectory() && pattern.test(e2.name)) found.push(path.join(p1, e2.name));
141
+ });
142
+ });
143
+ });
144
+ return found;
145
+}
146
+
147
+/** 定位工具:返回 { file, source },找不到返回 null */
148
+function resolveTool(cfg) {
149
+ // 1) 环境变量显式指定
150
+ const fromEnv = (process.env[cfg.envKey] || '').trim();
151
+ if (fromEnv) {
152
+ if (isFile(fromEnv)) return { file: fromEnv, source: '环境变量 ' + cfg.envKey };
153
+ fail('环境变量 ' + cfg.envKey + ' 指向的文件不存在:' + fromEnv);
154
+ }
155
+
156
+ // 2) 系统 PATH
157
+ const onPath = findOnPath(cfg.names, cfg.ok);
158
+ if (onPath) return { file: onPath, source: '系统 PATH' };
159
+
160
+ // 3) 常见安装目录 + 磁盘浅层扫描
161
+ const dirs = baseDirs().concat(scanPlausibleDirs(cfg.dirPattern));
162
+ for (let i = 0; i < dirs.length; i++) {
163
+ for (let j = 0; j < cfg.subDirs.length; j++) {
164
+ for (let k = 0; k < cfg.names.length; k++) {
165
+ const file = path.join(dirs[i], cfg.subDirs[j], cfg.names[k]);
166
+ if (isFile(file)) return { file: file, source: '常见安装目录' };
167
+ }
168
+ }
169
+ }
170
+ return null;
171
+}
172
+
173
+/** 找不到工具时的报错提示 */
174
+function toolFail(cfg) {
175
+ fail('未找到 ' + cfg.label + '\n' +
176
+ ' 已查找:环境变量 ' + cfg.envKey + ' → 系统 PATH → 常见安装目录 → 磁盘浅层扫描\n' +
177
+ ' 典型位置:' + cfg.hint + '\n' +
178
+ ' 解决办法(任选其一):\n' +
179
+ ' 1) 把安装目录加入 PATH:set PATH=%PATH%;<安装目录>\n' +
180
+ ' 2) 用环境变量指定:set ' + cfg.envKey + '=<cli 完整路径>\n' +
181
+ cfg.extra);
182
+}
183
+
184
+/** 把工具所在目录加入本次进程 PATH,便于按名字直接调用 */
185
+function putOnPath(file) {
186
+ const dir = path.dirname(file);
187
+ const cur = process.env.PATH || '';
188
+ if (cur.split(path.delimiter).indexOf(dir) < 0) process.env.PATH = dir + path.delimiter + cur;
189
+}
190
+
191
+/* ------------------------- 参数解析 ------------------------- */
192
+
193
+const argv = process.argv.slice(2);
194
+const envName = (argv.find(function(a) { return a.charAt(0) !== '-'; }) || '').trim();
195
+const noGen = argv.indexOf('--no-gen') > -1;
196
+const noOpen = argv.indexOf('--no-open') > -1;
197
+const dryRun = argv.indexOf('--dry-run') > -1;
198
+
199
+const OWN_ARGS = ['--no-gen', '--no-open', '--dry-run'];
200
+// 透传给 HBuilderX cli 的额外参数(保留 "参数 值" 成对关系)
201
+const passthrough = [];
202
+let envNameSkipped = false;
203
+argv.forEach(function(a) {
204
+ if (OWN_ARGS.indexOf(a) > -1) return;
205
+ if (!envNameSkipped && a === envName) {
206
+ envNameSkipped = true;
207
+ return;
208
+ }
209
+ passthrough.push(a);
210
+});
211
+
212
+function readAppId(file) {
213
+ try {
214
+ return JSON.parse(fs.readFileSync(file, 'utf8')).appid || '';
215
+ } catch (e) {
216
+ return '';
217
+ }
218
+}
219
+
220
+/** 回写 appid(正则替换,保留原格式) */
221
+function writeAppId(file, appid) {
222
+ const prev = fs.readFileSync(file, 'utf8');
223
+ const next = prev.replace(/"appid"(\s*:\s*)"[^"]*"/, function(m, sep) {
224
+ return '"appid"' + sep + '"' + appid + '"';
225
+ });
226
+ if (next !== prev) fs.writeFileSync(file, next, 'utf8');
227
+ return readAppId(file);
228
+}
229
+
230
+function main() {
231
+ const available = fs.existsSync(ENV_DIR)
232
+ ? fs.readdirSync(ENV_DIR).filter(f => f.endsWith('.js') && f !== 'index.js').map(f => f.replace(/\.js$/, ''))
233
+ : [];
234
+
235
+ if (!envName) fail('请指定环境名,可选:' + available.join(' / ') + '\n 例:node scripts/publish.js sit');
236
+ if (available.indexOf(envName) < 0) fail('未找到 config/env/' + envName + '.js,可选:' + available.join(' / '));
237
+
238
+ const env = require(path.join(ENV_DIR, envName + '.js'));
239
+
240
+ // 定位外部工具(不写死路径)
241
+ console.log('[release] 查找 HBuilderX / 微信开发者工具…');
242
+ const hx = resolveTool(HX_TOOL);
243
+ if (!hx) toolFail(HX_TOOL);
244
+ const wx = noOpen ? null : resolveTool(WX_TOOL);
245
+ if (!noOpen && !wx) toolFail(WX_TOOL);
246
+ putOnPath(hx.file);
247
+ if (wx) putOnPath(wx.file);
248
+
249
+ // 目标编译产物由 manifest.json 决定,而 manifest.json 是生成物
250
+ if (noGen && !fs.existsSync(manifest.TARGET)) {
251
+ fail('--no-gen 需要 manifest.json 已存在,请先运行:node scripts/set-env.js ' + envName);
252
+ }
253
+
254
+ console.log('[release] 环境 : ' + envName + '(' + env.ENV_NAME + ')');
255
+ console.log('[release] 小程序appid : ' + env.APPID);
256
+ console.log('[release] 接口地址 : ' + env.HTTP_REQUEST_URL);
257
+ console.log('[release] 产物目录 : ' + DIST_DIR);
258
+ console.log('[release] HBuilderX : ' + hx.file + '(' + hx.source + ')');
259
+ if (wx) console.log('[release] 开发者工具 : ' + wx.file + '(' + wx.source + ')');
260
+ console.log('[release] manifest.json: ' + (noGen
261
+ ? '不改动(--no-gen)'
262
+ : '由 manifest.json.demo 生成(appid ' + env.APPID + ',生成物不入库)'));
263
+
264
+ const cliArgs = ['publish', '--platform', 'mp-weixin', '--project', ROOT].concat(passthrough);
265
+ // 路径含空格/中文,交给 cmd 解析更稳(--no-open 时没有微信开发者工具,不拼这条命令)
266
+ const openCmd = wx ? '"' + wx.file + '" open --project "' + DIST_DIR + '"' : '';
267
+
268
+ if (dryRun) {
269
+ console.log('[release] 0) 生成: manifest.json ← manifest.json.demo' + (noGen ? '(已指定 --no-gen,跳过)' : ''));
270
+ console.log('[release] 1) 编译: "' + hx.file + '" ' + cliArgs.join(' '));
271
+ console.log('[release] 2) 产物 appid 回写为 ' + env.APPID + ' → ' + DIST_CONFIG);
272
+ if (!noOpen) console.log('[release] 3) 打开: ' + openCmd);
273
+ console.log('[release] --dry-run,未执行');
274
+ return;
275
+ }
276
+
277
+ // 1) 生成 manifest.json(HBuilderX 的编译输入,模板:manifest.json.demo)
278
+ if (noGen) {
279
+ console.log('[release] 跳过 manifest.json 生成(--no-gen)');
280
+ } else {
281
+ manifest.generate(env);
282
+ }
283
+
284
+ // 2) 发行编译(产物:unpackage/dist/build/mp-weixin)
285
+ console.log('[release] 开始发行编译,日志见 HBuilderX 控制台…');
286
+ const build = spawnSync(hx.file, cliArgs, { cwd: ROOT, stdio: 'inherit' });
287
+ if (build.error) fail('调用 cli.exe 失败:' + build.error.message);
288
+ if (build.status !== 0) fail('cli.exe 退出码 ' + build.status + ',请查看 HBuilderX 控制台输出');
289
+
290
+ // 3) 校正产物 appid(正常应与 manifest 一致,这里兜底保证)
291
+ if (!fs.existsSync(DIST_CONFIG)) {
292
+ fail('发行产物缺少 project.config.json:' + DIST_CONFIG + '\n 请确认 HBuilderX 编译是否成功');
293
+ }
294
+ const before = readAppId(DIST_CONFIG);
295
+ const after = writeAppId(DIST_CONFIG, env.APPID);
296
+ if (!after) fail('回写产物 appid 失败:' + DIST_CONFIG);
297
+ console.log('[release] 产物 appid : ' + before + (before === after ? '(无需调整)' : ' → ' + after));
298
+
299
+ // 4) 用微信开发者工具打开产物(首次需在「设置-安全设置」中开启服务端口)
300
+ if (!noOpen) {
301
+ console.log('[release] 打开微信开发者工具…');
302
+ const open = spawnSync(openCmd, { cwd: ROOT, stdio: 'inherit', shell: true });
303
+ if (open.error || open.status !== 0) {
304
+ console.log('[release] 自动打开失败(常见原因:未开启服务端口、微信开发者工具版本较旧)');
305
+ console.log('[release] 请手动打开微信开发者工具 → 导入项目 → 选择目录:' + DIST_DIR);
306
+ }
307
+ }
308
+
309
+ console.log('[release] 完成。微信开发者工具中的项目 appid = ' + after + ',包内会自动使用 ' + env.HTTP_REQUEST_URL);
310
+}
311
+
312
+main();
scripts/set-env.js
....@@ -0,0 +1,61 @@
1
+/**
2
+ * 环境切换:按 config/env/<env>.js 从模板生成 manifest.json
3
+ *
4
+ * 用法:
5
+ * npm run env:sit 等价于 node scripts/set-env.js sit
6
+ * npm run env:prod 等价于 node scripts/set-env.js prod
7
+ *
8
+ * 说明:
9
+ * manifest.json 是 HBuilderX 的编译输入(appid 属于编译期值,无法像接口地址那样运行时切换),
10
+ * 但它含环境相关 appid,不适合直接提交,所以:
11
+ * manifest.json.demo(入库模板) --生成--> manifest.json(已 .gitignore)
12
+ * 生成后必须重新编译一次,并在微信开发者工具中重新打开项目(appid 变更需重开)。
13
+ *
14
+ * 如需在 HBuilderX 里直接编译/运行调试,先跑一次本脚本;
15
+ * 走命令行发行则直接用 scripts/publish.js(内部会自动生成)。
16
+ *
17
+ * appid 数据源唯一:config/env/<env>.js 中的 UNI_APPID(DCloud 标识)、APPID(小程序 appid)
18
+ */
19
+const fs = require('fs');
20
+const path = require('path');
21
+const manifest = require('./manifest');
22
+
23
+const ROOT = path.resolve(__dirname, '..');
24
+const ENV_DIR = path.join(ROOT, 'config', 'env');
25
+
26
+function fail(msg) {
27
+ console.error('[set-env] ' + msg);
28
+ process.exit(1);
29
+}
30
+
31
+function main() {
32
+ const envName = (process.argv[2] || '').trim();
33
+ const available = fs.existsSync(ENV_DIR)
34
+ ? fs.readdirSync(ENV_DIR).filter(f => f.endsWith('.js') && f !== 'index.js').map(f => f.replace(/\.js$/, ''))
35
+ : [];
36
+
37
+ if (!envName) {
38
+ fail('请指定环境名,可选:' + available.join(' / ') + '\n 例:npm run env:sit');
39
+ }
40
+ if (available.indexOf(envName) < 0) {
41
+ fail('未找到 config/env/' + envName + '.js,可选:' + available.join(' / '));
42
+ }
43
+
44
+ const env = require(path.join(ENV_DIR, envName + '.js'));
45
+ if (!env.UNI_APPID || !env.APPID) {
46
+ fail('config/env/' + envName + '.js 缺少 UNI_APPID 或 APPID');
47
+ }
48
+
49
+ console.log('[set-env] 切换到 ' + envName + '(' + env.ENV_NAME + ')');
50
+ console.log(' DCloud appid : ' + env.UNI_APPID);
51
+ console.log(' 小程序 appid : ' + env.APPID);
52
+ console.log(' 接口地址 : ' + env.HTTP_REQUEST_URL);
53
+
54
+ const res = manifest.generate(env);
55
+
56
+ console.log(res.changed
57
+ ? '[set-env] 完成,请在 HBuilderX 中重新编译一次,并在微信开发者工具中重新打开项目'
58
+ : '[set-env] 无需改动,当前 manifest.json 已是 ' + envName + ' 环境');
59
+}
60
+
61
+main();
switch-prod.bat
....@@ -0,0 +1,12 @@
1
+@echo off
2
+chcp 65001 >nul
3
+cd /d "%~dp0"
4
+node "scripts\set-env.js" prod
5
+if errorlevel 1 (
6
+ echo.
7
+ echo [FAILED] switch to PROD failed - see output above
8
+) else (
9
+ echo.
10
+ echo [OK] PROD manifest generated. Recompile in HBuilderX, then reopen the project in WeChat DevTools.
11
+)
12
+pause
switch-sit.bat
....@@ -0,0 +1,12 @@
1
+@echo off
2
+chcp 65001 >nul
3
+cd /d "%~dp0"
4
+node "scripts\set-env.js" sit
5
+if errorlevel 1 (
6
+ echo.
7
+ echo [FAILED] switch to SIT failed - see output above
8
+) else (
9
+ echo.
10
+ echo [OK] SIT manifest generated. Recompile in HBuilderX, then reopen the project in WeChat DevTools.
11
+)
12
+pause
需要修改的配置文件.txt
deleted file mode 100644
....@@ -1,19 +0,0 @@
1
-/***
2
-需要修改的配置文件
3
-***/
4
-
5
------app/manifest.json--------
6
- appid: wx15d029cdf2e92a9f
7
-
8
-
9
------app/config/app.js-------
10
-
11
- HTTP_REQUEST_URL:'https://acmall.bluedeer.com.cn/crmeb/front',
12
- HTTP_ADMIN_URL:'https://acmall.bluedeer.com.cn/crmeb/admin',
13
- APPID:'wx15d029cdf2e92a9f',
14
- GDP_ACCOUNT_ID:'8672f93377575ace',
15
- GDP_DATASOURCE_ID:'b01182b2d4f73e45',
16
- GDP_SERVER_URL:'https://giocollect.aviva-cofco.com.cn',
17
- GDP_DEBUG:true,
18
- THIRD_APPID:'wxa83daa550324ead8',
19
-