230 Commits

Author SHA1 Message Date
”chenxuelian“
a6310d5db0 tag 双击取消选中状态 2023-05-13 16:16:59 +08:00
”chenxuelian“
c6e63a91a0 分类搜索 tag 参数名 title 2023-05-13 15:39:59 +08:00
”chenxuelian“
bfb3ef2f2b 分类搜索 tag 搜索条件 2023-05-13 14:47:17 +08:00
odjbin
cde4f8d2c7 Merge pull request '修改bug' (#113) from dj into dev
Reviewed-on: http://git.feashow.cn/feashow/pupil/pulls/113
2023-05-07 16:21:03 +00:00
邓洁
85eda860b3 修改bug 2023-05-08 00:20:37 +08:00
odjbin
0ec34f6b2f Merge pull request '修改小程序bug' (#112) from dj into dev
Reviewed-on: http://git.feashow.cn/feashow/pupil/pulls/112
2023-05-07 15:10:05 +00:00
邓洁
210afd8c84 修改小程序bug 2023-05-07 23:09:30 +08:00
1171906056
5d4ffc01c7 Merge pull request 'chenxuelian' (#111) from chenxuelian into dev
Reviewed-on: http://git.feashow.cn/feashow/pupil/pulls/111
2023-05-07 08:56:12 +00:00
”chenxuelian“
7b84933f91 首页,企业需求接口重新对接 2023-05-07 16:51:30 +08:00
”chenxuelian“
e81b87f827 联系方式二选一、商品详情部分样式修改 2023-05-07 16:40:18 +08:00
odjbin
2ed2e2201f Merge pull request '邓洁 : 修改小程序bug' (#110) from dj into dev
Reviewed-on: http://git.feashow.cn/feashow/pupil/pulls/110
2023-05-07 06:31:57 +00:00
邓洁
5f3889217b 邓洁 : 修改小程序bug 2023-05-07 14:31:40 +08:00
1171906056
4b15b475af Merge pull request '取消console' (#109) from chenxuelian into dev
Reviewed-on: http://git.feashow.cn/feashow/pupil/pulls/109
2023-04-20 12:47:34 +00:00
”chenxuelian“
05c44c81a9 取消console 2023-04-20 20:46:18 +08:00
1171906056
88adaf8af7 Merge pull request 'chenxuelian' (#108) from chenxuelian into dev
Reviewed-on: http://git.feashow.cn/feashow/pupil/pulls/108
2023-04-18 13:45:25 +00:00
”chenxuelian“
0b8b80a74b 解决冲突 2023-04-18 21:44:35 +08:00
”chenxuelian“
139ac36ddf 名称修改
需求发布,联系方式二选一
2023-04-18 21:26:17 +08:00
odjbin
b18b17c132 Merge pull request '调整细节' (#106) from dengjie into dev
Reviewed-on: http://git.feashow.cn/feashow/pupil/pulls/106
2023-04-16 13:30:37 +00:00
邓洁
8b9d3f98b2 调整细节 2023-04-16 21:29:34 +08:00
odjbin
6955f5f451 Merge pull request '修改部分细节' (#105) from dengjie into dev
Reviewed-on: http://git.feashow.cn/feashow/pupil/pulls/105
2023-04-16 13:23:34 +00:00
邓洁
1ba6284b78 修改部分细节 2023-04-16 21:22:36 +08:00
odjbin
ed2da4e9b4 Merge pull request 'dengjie' (#104) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/104
2023-03-15 09:53:22 +00:00
邓洁
3095df7065 修改小程序bug 2023-03-15 17:53:07 +08:00
邓洁
050739652d 修改小程序bug 2023-03-15 17:46:39 +08:00
odjbin
9c6357a5f8 Merge pull request '修改小程序bug' (#103) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/103
2023-02-27 16:56:18 +00:00
邓洁
960e8848f9 修改小程序bug 2023-02-28 00:55:26 +08:00
odjbin
96da9701d4 Merge pull request '修改小程序bug' (#102) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/102
2023-02-27 16:03:50 +00:00
邓洁
077801fd6f 修改小程序bug 2023-02-28 00:02:59 +08:00
odjbin
17d399ebd9 Merge pull request '修改bug' (#101) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/101
2023-02-27 03:14:33 +00:00
邓洁
08d66a18d2 修改bug 2023-02-27 11:13:46 +08:00
odjbin
e6ac333189 Merge pull request '修改小程序bug' (#100) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/100
2023-02-27 02:04:01 +00:00
邓洁
6a1e71ce8a 修改小程序bug 2023-02-27 09:54:21 +08:00
odjbin
8da8319619 Merge pull request '删除绑定公司模块' (#99) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/99
2023-02-26 16:51:07 +00:00
邓洁
055381f224 删除绑定公司模块 2023-02-27 00:50:34 +08:00
odjbin
31efd6466e Merge pull request '修改小程序bug' (#98) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/98
2023-02-26 16:46:42 +00:00
邓洁
fd3b8347a4 修改小程序bug 2023-02-27 00:46:01 +08:00
odjbin
f3eb6b98d6 Merge pull request '更换新接口' (#97) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/97
2023-02-26 14:11:19 +00:00
邓洁
b0d3372b7c 更换新接口 2023-02-26 22:10:49 +08:00
odjbin
c4ecf247de Merge pull request '修改小程序bug' (#96) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/96
2023-02-25 08:32:56 +00:00
邓洁
b439c3dd7a 修改小程序bug 2023-02-25 16:32:35 +08:00
odjbin
72a9fa92e3 Merge pull request 'dengjie' (#95) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/95
2023-02-24 10:01:08 +00:00
邓洁
8bdb156ec2 修改bug 2023-02-24 14:13:17 +08:00
邓洁
afccd4c183 修改小程序bug 2023-02-24 12:20:41 +08:00
邓洁
e5c257ed2d 解决数据绑定和升级VIP问题 2023-02-23 23:59:30 +08:00
odjbin
3f3226c302 Merge pull request 'dengjie' (#94) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/94
2023-02-22 06:33:39 +00:00
邓洁
deb66d77fd 修改上传头像url 2023-02-22 14:32:14 +08:00
邓洁
e1551144a9 dengjie : 解决banner跳转问题 2023-02-22 14:22:31 +08:00
odjbin
d08d126f2f Merge pull request '小程序首页第一次打开时图片不显示bug修复' (#93) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/93
2023-02-05 10:01:01 +00:00
邓洁
0e6d4f02a2 小程序首页第一次打开时图片不显示bug修复 2023-02-05 17:59:47 +08:00
odjbin
f6544ea71a Merge pull request '分享功能' (#92) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/92
2023-02-05 09:15:05 +00:00
邓洁
8db95277dd 分享功能 2023-02-05 17:14:49 +08:00
odjbin
e43af048c1 Merge pull request '分享功能' (#91) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/91
2023-02-05 09:11:31 +00:00
邓洁
6dfd04bb87 分享功能 2023-02-05 17:10:53 +08:00
odjbin
81b1e19c4d Merge pull request 'dengjie : 修改发布后跳转到我的发布页面' (#90) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/90
2023-02-05 07:28:53 +00:00
邓洁
5819705f54 dengjie : 修改发布后跳转到我的发布页面 2023-02-05 15:28:30 +08:00
1171906056
5b2b58cdf8 Merge pull request '需求发布 时间戳调整' (#89) from chenxuelian into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/89
2023-02-05 03:48:18 +00:00
”chenxuelian“
c5430c18cb 需求发布 时间戳调整 2023-02-05 11:46:37 +08:00
odjbin
ca12fc3954 Merge pull request '1' (#88) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/88
2023-02-04 16:35:56 +00:00
邓洁
20c6fccb2c 1 2023-02-05 00:33:23 +08:00
odjbin
766a8c188b Merge pull request 'dengjie : 解决单独修改昵称,头像保存问题' (#87) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/87
2023-02-04 16:10:33 +00:00
邓洁
2f29ba9452 dengjie : 解决单独修改昵称,头像保存问题 2023-02-05 00:09:24 +08:00
odjbin
98ca09730a Merge pull request 'dengjie' (#86) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/86
2023-02-04 15:49:42 +00:00
邓洁
d5c4e58ca0 dengjie : 提示登录后才能点赞,收藏 2023-02-04 23:46:17 +08:00
邓洁
0cbb51d933 dengjie : 产品详情权限问题 2023-02-04 23:22:50 +08:00
odjbin
2b6f7e0708 Merge pull request 'dengjie' (#85) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/85
2023-02-04 12:02:23 +00:00
邓洁
4b40658fb5 dengjie ;拨打电话功能 2023-02-04 20:01:53 +08:00
邓洁
08ebc6574d dengjie :解决点赞、收藏、客服电话等问题 2023-02-04 19:03:41 +08:00
odjbin
78f041d674 Merge pull request '行业报告上方三个按钮的列表展示' (#84) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/84
2023-02-03 11:32:16 +00:00
邓洁
4db15d21cf 行业报告上方三个按钮的列表展示 2023-02-03 19:31:50 +08:00
odjbin
7dcc6e0ea3 Merge pull request 'dengjie' (#83) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/83
2023-02-03 10:44:40 +00:00
邓洁
ec3c5b8351 解决行业报告渲染问题 2023-02-03 18:39:32 +08:00
dengjie
be379b2ba9 dengjie commit : 产品详情和厂家详情下方的联系客服样式及跳转 2023-02-03 16:05:41 +08:00
odjbin
cb2dba5323 Merge pull request 'dengjie commit : 修改部分存在问题' (#82) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/82
2023-02-02 17:00:51 +00:00
邓洁
d76675a66a dengjie commit : 修改部分存在问题 2023-02-03 01:00:26 +08:00
1171906056
9b7fccdd53 Merge pull request '需求发布拦截,取消登陆返回到首页' (#81) from chenxuelian into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/81
2023-02-02 12:50:23 +00:00
”chenxuelian“
293f38b232 需求发布拦截,取消登陆返回到首页 2023-02-02 20:49:47 +08:00
1171906056
46506d5a4e Merge pull request 'chenxuelian' (#80) from chenxuelian into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/80
2023-02-02 12:43:22 +00:00
”chenxuelian“
73551a1a3d 删除console, 尝试重新合并 2023-02-02 20:41:59 +08:00
”chenxuelian“
40c8ecf920 Merge branch 'dev' into chenxuelian 2023-02-01 22:02:30 +08:00
”chenxuelian“
070497149d 修复 2023-02-01 22:01:38 +08:00
1171906056
d5e54790f5 Merge pull request '问题修复' (#75) from chenxuelian into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/75
2023-02-01 13:58:15 +00:00
”chenxuelian“
7ee991f6d6 Merge branch 'dev' into chenxuelian 2023-02-01 21:57:39 +08:00
”chenxuelian“
7b7a0126d2 问题修复 2023-02-01 21:56:58 +08:00
odjbin
24e04dd3a3 Merge pull request '修改bug' (#74) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/74
2023-01-31 15:07:48 +00:00
dengjie
567a3692cf 修改bug 2023-01-31 23:07:05 +08:00
odjbin
eba5330122 Merge pull request '产品无权限访问时,跳转到升级VIP' (#73) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/73
2023-01-31 14:50:44 +00:00
dengjie
093181f23e 产品无权限访问时,跳转到升级VIP 2023-01-31 22:48:30 +08:00
1171906056
5dd0c33552 Merge pull request '分类首页样式调整,需求发布接口对接' (#72) from chenxuelian into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/72
2023-01-31 14:35:57 +00:00
”chenxuelian“
22d4ab414a 分类首页样式调整,需求发布接口对接 2023-01-31 22:35:12 +08:00
odjbin
e4faef661c Merge pull request '修复bug' (#71) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/71
2023-01-30 16:24:56 +00:00
dengjie
05236e188c 修复bug 2023-01-31 00:24:28 +08:00
odjbin
4977c34b5f Merge pull request '优化样式' (#70) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/70
2023-01-30 16:15:38 +00:00
dengjie
6445aa4783 优化样式 2023-01-31 00:14:42 +08:00
odjbin
71cf2cd646 Merge pull request 'dengjie' (#69) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/69
2023-01-30 15:15:34 +00:00
dengjie
7502bab1c0 修改头像和昵称 2023-01-30 23:13:55 +08:00
dengjie
95724b4ddc 修改头像和昵称 2023-01-30 23:11:48 +08:00
odjbin
d9ae6c0989 Merge pull request 'dengjie commit : 上传头像和收藏产品' (#68) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/68
2023-01-30 06:42:13 +00:00
dengjie
66e1fdd8a8 dengjie commit : 上传头像和收藏产品 2023-01-30 14:40:45 +08:00
1171906056
78c7cbf3ec Merge pull request '需求信息回显' (#67) from chenxuelian into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/67
2023-01-29 13:26:36 +00:00
”chenxuelian“
efb8a1703e 需求信息回显 2023-01-29 21:25:38 +08:00
odjbin
7765787876 Merge pull request '优化代码' (#66) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/66
2023-01-29 06:17:26 +00:00
dengjie
09bbce1780 优化代码 2023-01-29 14:16:06 +08:00
odjbin
161f23f2c3 Merge pull request '解决体验版弹出登录框' (#65) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/65
2023-01-28 14:36:24 +00:00
dengjie
1f6d21a1a0 解决体验版弹出登录框 2023-01-28 22:34:30 +08:00
1171906056
5678815237 Merge pull request 'chenxuelian' (#62) from chenxuelian into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/62
2023-01-28 13:36:55 +00:00
”chenxuelian“
9959d86a44 需求发布接口顺序调整 2023-01-28 21:35:10 +08:00
”chenxuelian“
5f8cc12b50 Merge branch 'dev' into chenxuelian 2023-01-28 21:03:05 +08:00
”chenxuelian“
6851f94caa Merge branch 'dev' into chenxuelian 2023-01-28 20:40:37 +08:00
”chenxuelian“
0394f22965 创意发布 2023-01-28 20:40:22 +08:00
odjbin
77f406d06d Merge pull request 'DJ' (#58) from DJ into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/58
2023-01-19 08:43:38 +00:00
odjbin
693a6dd2c4 更新 'pages/ideasAndNeeds/ideasAndNeeds.vue' 2023-01-19 08:42:59 +00:00
clay
133a0e77f4 收藏商品及取消收藏 2023-01-19 16:37:14 +08:00
clay
7d0b6274f1 浏览记录移除, 我的发布列表,修改回显及删除 2023-01-18 17:02:16 +08:00
1171906056
c1e2b2e0cd Merge pull request '需求发布接口对接' (#56) from chenxuelian into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/56
2023-01-17 15:37:18 +00:00
”chenxuelian“
e1653cf092 Merge branch 'dev' into chenxuelian 2023-01-17 23:36:28 +08:00
”chenxuelian“
c7983aadb3 需求发布接口对接 2023-01-17 23:35:22 +08:00
odjbin
7efe045548 Merge pull request '浏览记录字段问题及代码优化' (#54) from DJ into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/54
2023-01-17 15:31:21 +00:00
clay
4b10b9486d 浏览记录字段问题及代码优化 2023-01-17 23:19:52 +08:00
odjbin
4f19baab50 Merge pull request '首页产品列表按上架时间或点赞量排列以及上拉加载更多数据' (#53) from DJ into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/53
2023-01-16 13:34:17 +00:00
clay
2d08416f5e 首页产品列表按上架时间或点赞量排列以及上拉加载更多数据 2023-01-16 21:33:14 +08:00
odjbin
29b8a6056e Merge pull request '1' (#52) from DJ into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/52
2023-01-16 08:09:34 +00:00
clay
b6d023d528 1 2023-01-16 15:59:47 +08:00
1171906056
d966269444 Merge pull request '需求发布接口对接' (#51) from chenxuelian into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/51
2023-01-12 14:10:57 +00:00
”chenxuelian“
68cc38f14f Merge branch 'dev' into chenxuelian 2023-01-12 22:08:33 +08:00
”chenxuelian“
7db25b96b9 需求发布接口对接 2023-01-12 22:02:41 +08:00
odjbin
2a7ad3dd9a Merge pull request '商品详情. 新闻详情和厂家详情登录拦截' (#50) from DJ into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/50
2023-01-11 14:12:49 +00:00
clay
201037eeb6 商品详情. 新闻详情和厂家详情登录拦截 2023-01-11 22:08:59 +08:00
1171906056
c834416b98 Merge pull request '需求发布' (#49) from chenxuelian into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/49
2023-01-10 01:27:14 +00:00
”chenxuelian“
7b474b06ef 需求发布 2023-01-10 09:26:31 +08:00
odjbin
780175e3de Merge pull request 'dengjie commit : 代码完善' (#48) from DJ into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/48
2023-01-09 10:07:02 +00:00
clay
c906a7d33a dengjie commit : 代码完善 2023-01-09 18:05:36 +08:00
1171906056
b010cba9fc Merge pull request '登录组件' (#47) from chenxuelian into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/47
2023-01-08 12:08:11 +00:00
”chenxuelian“
e561054b6f 登录组件 2023-01-08 20:07:37 +08:00
1171906056
9c0477da5c Merge pull request '登录组件封装' (#46) from chenxuelian into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/46
2023-01-06 14:20:15 +00:00
”chenxuelian“
d42219873d 登录组件封装 2023-01-06 22:19:31 +08:00
1171906056
7c1373624f Merge pull request 'chenxuelian' (#45) from chenxuelian into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/45
2023-01-06 12:53:20 +00:00
”chenxuelian“
91b8f57154 冲突解决 2023-01-06 20:49:54 +08:00
”chenxuelian“
bc9b2b8e9c 首页与分类页参数传递 2023-01-06 20:44:35 +08:00
1171906056
74c5cbb605 Merge pull request '分类页接口对接' (#44) from chenxuelian into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/44
2023-01-06 12:18:30 +00:00
”chenxuelian“
ce9d241d05 分类页接口对接 2023-01-06 20:17:38 +08:00
odjbin
98081352ea Merge pull request '产品列表, 按上架时间和点赞量排序' (#43) from DJ into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/43
2023-01-06 12:04:28 +00:00
clay
a02de3a20f 产品列表, 按上架时间和点赞量排序 2023-01-06 18:25:12 +08:00
odjbin
5eff8c483c Merge pull request '创意发布&需求发布列表接口初步完成' (#42) from DJ into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/42
2023-01-06 06:29:24 +00:00
clay
7e594aa3cb 创意发布&需求发布列表接口初步完成 2023-01-06 11:29:35 +08:00
odjbin
c60967cd4a Merge pull request 'DJ' (#41) from DJ into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/41
2023-01-06 01:08:33 +00:00
clay
e0fc034998 个人信息接口初次对接完毕 2023-01-06 09:07:30 +08:00
clay
458f5a2562 dengjie commit : 我的页面部分接口 2023-01-05 21:57:51 +08:00
odjbin
0a5054efc1 Merge pull request 'token已存入Storage, 认证厂家详情接口初步完成' (#40) from DJ into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/40
2023-01-04 12:58:40 +00:00
clay
2417d8fe28 token已存入Storage, 认证厂家详情接口初步完成 2023-01-04 20:58:04 +08:00
odjbin
3f96938143 Merge pull request 'DJ' (#39) from DJ into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/39
2023-01-04 08:47:47 +00:00
clay
27787d3300 1 2023-01-04 16:46:46 +08:00
clay
56bf10b47f 当获取首页产品列表时,返回数据length为0时取消发送请求 2022-12-29 09:48:45 +08:00
odjbin
3a08058467 Merge pull request 'dengjie commit : 首页产品列表下拉刷新分页展示产品' (#38) from DJ into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/38
2022-12-28 16:14:22 +00:00
clay
0c3e8de069 dengjie commit : 首页产品列表下拉刷新分页展示产品 2022-12-29 00:13:33 +08:00
odjbin
98d3fdb3c3 Merge pull request '首页图片获取,行业报告中行业新闻及详情页和新品发布及详情页接口对接完毕' (#37) from DJ into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/37
2022-12-28 14:18:33 +00:00
clay
b3b0b620bf 首页图片获取,行业报告中行业新闻及详情页和新品发布及详情页接口对接完毕 2022-12-28 22:15:56 +08:00
1171906056
8c63db07ab Merge pull request '登录' (#36) from chenxuelian into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/36
2022-12-27 11:30:00 +00:00
”chenxuelian“
1a379ca8e9 登录 2022-12-27 19:29:16 +08:00
odjbin
9ab67b2af5 Merge pull request 'dengjie commit : 发布日期格式解决' (#35) from DJ into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/35
2022-12-26 14:20:23 +00:00
clay
ff682aedc3 dengjie commit : 发布日期格式解决 2022-12-26 22:19:45 +08:00
1171906056
4dfac221e1 Merge pull request 'chenxuelian' (#34) from chenxuelian into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/34
2022-12-26 13:28:27 +00:00
”chenxuelian“
aef226d3ab 分类页部分接口对接 2022-12-26 21:27:22 +08:00
”chenxuelian“
3fd749fd2f 解决冲突 2022-12-26 20:27:26 +08:00
”chenxuelian“
4c62c9b1ec 解决冲突 2022-12-26 20:24:29 +08:00
”chenxuelian“
3d04398b7c 分类接口对接 2022-12-26 20:16:44 +08:00
odjbin
3c5e239985 Merge pull request '新增搜索出的产品列表' (#33) from DJ into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/33
2022-12-25 08:50:33 +00:00
clay
d3c83c4c7d 新增搜索出的产品列表 2022-12-25 16:49:38 +08:00
odjbin
ae137c498a Merge pull request '首页初次对接口' (#32) from DJ into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/32
2022-12-25 08:07:12 +00:00
clay
fd6f5b5390 首页初次对接口 2022-12-25 16:06:08 +08:00
odjbin
4050e638f0 Merge pull request '更新 'service/request.js'' (#29) from odjbin-patch-1 into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/29
2022-12-25 07:41:31 +00:00
odjbin
eb72d42eb2 更新 'service/request.js' 2022-12-25 07:41:16 +00:00
odjbin
ddd9cd4d26 Merge pull request '更新 'service/request.js'' (#27) from odjbin-patch-1 into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/27
2022-12-25 07:37:36 +00:00
odjbin
17914f193d 更新 'service/request.js' 2022-12-25 07:37:18 +00:00
1171906056
a9fc2c178a Merge pull request 'chenxuelian' (#25) from chenxuelian into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/25
2022-12-25 06:57:22 +00:00
”chenxuelian“
51d34b2732 创意发布路由跳转 2022-12-25 14:56:35 +08:00
”chenxuelian“
537c23dfaf Merge branch 'dev' into chenxuelian 2022-12-25 14:51:00 +08:00
”chenxuelian“
09855d7da1 搜索页 2022-12-25 14:50:29 +08:00
odjbin
02093641ca Merge pull request 'dengjie commit : 删除二次确认' (#24) from den into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/24
2022-12-24 08:55:45 +00:00
clay
750559bf4c dengjie commit : 删除二次确认 2022-12-24 16:49:42 +08:00
1171906056
c756a60192 Merge pull request 'axios 封装' (#23) from chenxuelian into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/23
2022-12-24 08:45:21 +00:00
”chenxuelian“
801e0e9995 Merge branch 'dev' into chenxuelian 2022-12-24 16:44:22 +08:00
”chenxuelian“
b37ed47032 axios 封装 2022-12-24 16:44:08 +08:00
odjbin
f974b7e2d0 Merge pull request '1' (#22) from den into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/22
2022-12-22 14:16:24 +00:00
clay
50ff30eb62 1 2022-12-22 22:15:49 +08:00
odjbin
597d1a91f1 Merge pull request 'dengjie commit : 完善我的页面和我的发布页面样式初步完成' (#19) from dengjie1 into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/19
2022-12-22 13:52:14 +00:00
clay
02e6961b06 dengjie commit : 完善我的页面和我的发布页面样式初步完成 2022-12-22 21:51:35 +08:00
1171906056
35203f0d42 Merge pull request 'chenxuelian' (#18) from chenxuelian into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/18
2022-12-19 02:48:29 +00:00
”chenxuelian“
eeb0f904d1 分类样样式调整 2022-12-19 10:44:48 +08:00
”chenxuelian“
337fcbcfc1 Merge branch 'dev' into chenxuelian 2022-12-19 10:38:27 +08:00
”chenxuelian“
9ee6977fe5 分类页调整 2022-12-19 10:38:13 +08:00
1171906056
4b2d352c0d Merge pull request '分类页调整' (#17) from chenxuelian into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/17
2022-12-19 02:04:08 +00:00
”chenxuelian“
d865f88d92 分类页调整 2022-12-19 10:01:18 +08:00
odjbin
fcd4671ec4 Merge pull request '1' (#16) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/16
2022-12-18 15:30:38 +00:00
clay
1eacdfe939 1 2022-12-18 23:30:02 +08:00
odjbin
da50bd6dbd Merge pull request '1' (#15) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/15
2022-12-18 15:14:34 +00:00
clay
10ac9e0cd7 1 2022-12-18 23:12:54 +08:00
odjbin
5f18a1eecd Merge pull request '修改图片画质,已上传体验版成功' (#14) from dengjie2 into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/14
2022-12-18 15:07:28 +00:00
clay
e073739ee5 修改图片画质,已上传体验版成功 2022-12-18 23:06:32 +08:00
clay
202da2a061 Merge pull request 'chenxuelian' (#13) from chenxuelian into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/13
2022-12-18 13:45:58 +00:00
”chenxuelian“
49a52425c5 搜索页、行业报告 分包 2022-12-18 21:03:41 +08:00
”chenxuelian“
48393c72ed 删除不需要的文件 2022-12-18 20:20:44 +08:00
”chenxuelian“
4423154a3f Merge branch 'dev' into chenxuelian 2022-12-18 18:37:08 +08:00
”chenxuelian“
8673d67720 创意需求发布 2022-12-18 18:36:23 +08:00
odjbin
dfcb839f0e Merge pull request '图片' (#12) from dengjie1 into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/12
2022-12-18 10:30:19 +00:00
clay
2632ecb1f9 图片 2022-12-18 18:29:20 +08:00
”chenxuelian“
99b39f3eed Merge branch 'dev' of http://git.hchyun.com/feashow/pupil into dev 2022-12-18 13:29:01 +08:00
”chenxuelian“
9d1526a28e 分类页、搜索页 2022-12-18 13:08:32 +08:00
odjbin
204149745e Merge pull request 'dengjie commit : 会员中心及其联系客服页面初步完成' (#11) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/11
2022-12-17 15:12:04 +00:00
clay
6d4a43b417 dengjie commit : 会员中心及其联系客服页面初步完成 2022-12-17 23:10:41 +08:00
odjbin
913ead63d8 Merge pull request 'dengjie commit : 我的页面及其绑定公司,浏览记录,我的收藏页面 的样式初步完成' (#10) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/10
2022-12-16 17:58:23 +00:00
clay
76b6d9e557 dengjie commit : 我的页面及其绑定公司,浏览记录,我的收藏页面 的样式初步完成 2022-12-17 01:57:06 +08:00
odjbin
ef219ed6f8 Merge pull request 'dengjie' (#9) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/9
2022-12-16 14:02:03 +00:00
clay
9c5d40cbb9 上传图片 2022-12-16 22:01:06 +08:00
clay
380dc0f343 dengjie commit: 行业报告及其详情页初步完成 2022-12-16 21:54:51 +08:00
clay
9223a1023e dengjie commit :首页和详情页样式初步完成 2022-12-16 01:07:48 +08:00
odjbin
8057d75a52 Merge pull request 'dengjie commit : tabbar和搜索框样式修改' (#8) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/8
2022-12-07 13:04:32 +00:00
clay
faab99a8ce dengjie commit : tabbar和搜索框样式修改 2022-12-07 21:03:33 +08:00
odjbin
787cb90ff2 Merge pull request '1' (#7) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/7
2022-12-07 09:23:00 +00:00
clay
9db7a4db25 1 2022-12-07 17:21:53 +08:00
odjbin
04d23f3849 Merge pull request '修改tabbar报错' (#6) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/6
2022-12-07 09:09:16 +00:00
clay
8449bb928f 修改tabbar报错 2022-12-07 17:08:29 +08:00
odjbin
006c798a0c Merge pull request 'dengjie commit: tabbar样式修改完成' (#5) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/5
2022-12-07 05:42:10 +00:00
clay
2fc863bb79 dengjie commit: tabbar样式修改完成 2022-12-07 13:41:17 +08:00
odjbin
64c39c2c21 Merge pull request 'dengjie commit : tabbar修改样式' (#4) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/4
2022-12-04 12:56:32 +00:00
clay
f1bd49efb2 dengjie commit : tabbar修改样式 2022-12-04 20:54:39 +08:00
clay
ae43f79e42 Merge pull request 'dengjie commit : tabbar 初始样式' (#3) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/3
2022-12-04 12:00:46 +00:00
clay
424b344645 dengjie commit : tabbar 初始样式 2022-12-04 20:00:18 +08:00
clay
cc9c7ec0ea Merge pull request 'feature/请求二次封装' (#2) from feature/请求二次封装 into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/2
2022-12-04 11:57:32 +00:00
”chenxuelian“
5c1d6bcefd 请求二次封装 2022-12-04 16:49:20 +08:00
”chenxuelian“
1172dc260c 请求二次封装 2022-12-04 16:37:54 +08:00
116 changed files with 27186 additions and 116 deletions

View File

@@ -13,6 +13,11 @@
</script>
<style lang='scss'>
@import "uview-ui/index.scss";
/*每个页面公共css */
@import "@/static/styles/main.css";
@import "uview-ui/index.scss";
page {
background-color: #F8F8F8;
}
</style>

View File

@@ -0,0 +1,56 @@
<template>
<view>
<view class="xw_content" v-for="(item,index) in cjsList" :key="index" @click="clickCj(item)">
<u--image :src="imgUrl+item.cover" width="112rpx" height="112rpx" :lazy-load="true">
</u--image>
<view class="xw_right">
<view class="xw_title">
{{item.name}}
</view>
<view style="display: flex;">
<!-- <text class="cj_tags" v-for="(tagsItem,tagsIndex) in item.tags" :key="tagsIndex">
{{tagsItem.tag}}
</text> -->
<text class="cj_tags">{{item.tag}}</text>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
cjsList: [],
imgUrl: '',
}
},
created() {
this.imgUrl = uni.getStorageSync('img_url')
this.getCertifiedCj()
},
methods: {
// 获取认证厂家列表
getCertifiedCj() {
this.$apiServe.getCertifiedCj({
pageSize: 2,
pageNum: 1
}).then(res => {
// console.log('认证厂家', res.data.data)
this.cjsList = res.data.data
}).finally(_ => {})
},
// 跳转到认证厂家详情页
clickCj(item) {
uni.navigateTo({
url: '../../packageReport/certifiedCjDetail/certifiedCjDetail?id=' + item.id
})
}
}
}
</script>
<style>
</style>

View File

@@ -0,0 +1,143 @@
<template>
<view>
<u-picker :show="show" ref="uPicker" :columns="cityList" @confirm="confirm" @change="changeHandler"
@cancel="cancel"></u-picker>
</view>
</template>
<script>
import { cityData } from '@/utills/city.js'
export default {
name: "cityPicker",
props: {
showPicker: {
type: Boolean,
default: false
}
},
data() {
return {
cityData,
//显示选择器
show: false,
// 打开选择器显示默认城市
cityList: [],
cityLevel1: [],
cityLevel2: [],
cityLevel3: [],
cityLevelCode1: [],
cityLevelCode2: [],
cityLevelCode3: []
};
},
watch: {
showPicker: {
handler(val) {
console.log(val)
this.show = this.showPicker
},
immediate: true
},
show: {
handler(val) {
if(val) {
this.cityList = [],
this.cityLevel1 = [],
this.cityLevel2 = [],
this.cityLevel3 = [],
this.cityLevelCode1 = []
this.cityLevelCode2 = []
this.cityLevelCode3 = []
this.initCityData();
}
},
immediate: true
}
},
onLoad() {
// 城市选择器初始化
this.initCityData();
},
methods: {
initCityData() {
// 遍历城市js
this.cityData.forEach((item1, index1) => {
let temp2 = [];
let code2 = [];
this.cityLevel1.push(item1.provinceName);
this.cityLevelCode1.push(item1.provinceCode);
let temp4 = [];
let temp3 = [];
let code4 = [];
let code3 = [];
// 遍历市
item1.cities.forEach((item2, index2) => {
temp2.push(item2.cityName);
code2.push(item2.cityCode);
// 遍历区
item2.counties.forEach((item3, index3) => {
temp3.push(item3.countyName);
code3.push(item3.countyCode);
})
temp4[index2] = temp3;
temp3 = [];
code4[index2] = code3;
code3 = [];
})
this.cityLevel3[index1] = temp4;
this.cityLevelCode3[index1] = code4;
this.cityLevel2[index1] = temp2;
this.cityLevelCode2[index1] = code2;
})
// 选择器默认城市
this.cityList.push(this.cityLevel1, this.cityLevel2[0], this.cityLevel3[0][0]);
},
// 选中时执行
changeHandler(e) {
console.log(e)
const {
columnIndex,
index,
indexs,
value,
values,
// 微信小程序无法将picker实例传出来只能通过ref操作
picker = this.$refs.uPicker
} = e;
if (columnIndex === 0) { // 选择第一列数据时
// 设置第二列关联数据
picker.setColumnValues(1, this.cityLevel2[index]);
// 设置第三列关联数据
picker.setColumnValues(2, this.cityLevel3[index][columnIndex]);
} else if (columnIndex === 1) { // 选择第二列数据时
// 设置第三列关联数据
picker.setColumnValues(2, this.cityLevel3[indexs[0]][index]);
}
},
// 单击确认按钮时执行
confirm(e) {
// 输出数组 [省, 市, 区]
console.log(e);
console.log(this.cityLevelCode3);
console.log(this.cityLevel3);
const code = this.cityLevelCode3[e.indexs[0]][e.indexs[1]][e.indexs[2]];
console.log(code);
this.$emit('confirm', [e.value, code]);
// 隐藏城市选择器
this.show = false;
},
cancel() {
this.$emit('cancel')
this.show = false
}
}
}
</script>
<style>
</style>

View File

@@ -0,0 +1,111 @@
<template>
<view class="my_avatar">
<view style="border-radius: 50rpx;">
<u-avatar :src="avatar" size="100rpx" shape="circle" @click="changeAvatar()"></u-avatar>
</view>
<view style="margin-top: 10rpx;margin-bottom: 4rpx;">
<u--image v-if="member=='2'||member=='3'" :src="normal" width="84rpx" height="30rpx">
</u--image>
<u--image v-if="member=='4'" :src="VIP" width="84rpx" height="30rpx">
</u--image>
</view>
<view style="display: flex;align-items: center;">
<text @click="changeAvatar()" style="color: #fff;font-size: 26rpx;">{{nickname}}</text>
<u--image v-if="showEdit==true" src="/static/my/wd_icon_bj.png" width="22rpx" height="22rpx"
@click="changeAvatar()">
</u--image>
</view>
<view style="margin:0 20rpx;">
<u-overlay :show="!isLoad">
<login :timoutText="timoutText" @success="reOnLoad()" @fail="failToLoad()"></login>
</u-overlay>
</view>
</view>
</template>
<script>
import login from 'pages/my/login/login'
export default {
name: "myAvatar",
props: {
center: {
type: String,
default: ''
}
},
components: {
login
},
data() {
return {
member: '',
showEdit: true,
avatar: '',
nickname: '用户',
normal: '/static/my/wo_icon_pthy.png',
VIP: '/static/my/wo_icon_vip.png',
isLoad: true,
timoutText: 1
};
},
created() {
if (this.center != false) {
this.showEdit = false
}
this.getUser()
},
options: {
styleIsolation: 'shared', // 解除样式隔离
},
methods: {
//修改头像
changeAvatar() {
uni.navigateTo({
url: '../../packageMy/changeAvatar/changeAvatar'
})
},
//获取头像昵称和普通会员和VIP会员
getUser() {
this.$apiServe.getUser().then(res => {
// if (res.data.msg === "登录超时,请重新登录") {
// this.isLoad = false
// }
if (res.data.code === -1) {
this.isLoad = false
}
var data = res.data.data
console.log('data个人信息', data);
if (data) {
this.avatar = uni.getStorageSync('img_url') + data.avatar
this.nickname = data.nickname
this.member = data.member
uni.setStorageSync('user_id', data.user_id)
uni.setStorageSync('member', data.member)
uni.setStorageSync('agreement', data.agreement)
uni.setStorageSync('com_name', data.com_name)
uni.setStorageSync('com_mobile', data.com_mobile)
}
}).finally(_ => {})
},
reOnLoad() {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.$toast.warn('登录失败请重试')
this.isLoad = false
return
}
this.isLoad = true
this.getUser()
},
failToLoad() {
uni.navigateBack({
url: '/pages/index/index'
})
}
}
}
</script>
<style>
/deep/.u-image {
margin-left: 8rpx;
}
</style>

View File

@@ -0,0 +1,47 @@
<template>
<view>
<u--form labelPosition="left" :model="model">
<u-form-item label="公司名称" prop="userInfo.name" borderBottom>
<u--input v-model="model.userInfo.name" border="none" placeholder="请输入您的名称"
placeholderStyle="color: #CCCCCC;font-size: 24rpx;" :disabled="disabled"></u--input>
</u-form-item>
<u-form-item label="公司电话" prop="userInfo.phone" borderBottom>
<u--input v-model="model.userInfo.phone" border="none" placeholder="请输入您的电话"
placeholderStyle="color: #CCCCCC;font-size: 24rpx;" :disabled="disabled">
</u--input>
</u-form-item>
</u--form>
</view>
</template>
<script>
export default {
name: "myForm",
data() {
return {
disabled: false,
model: {
userInfo: {
name: '',
phone: '',
},
},
};
},
options: {
styleIsolation: 'shared', // 解除样式隔离
},
created() {
// if (uni.getStorageSync('com_mobile') && uni.getStorageSync('com_name')) {
// this.model.userInfo.name = uni.getStorageSync('com_name')
// this.model.userInfo.phone = uni.getStorageSync('com_mobile')
// }
}
}
</script>
<style scoped>
/deep/.u-input__content__field-wrapper__field {
background-color: #fff !important;
}
</style>

64
components/news/news.vue Normal file
View File

@@ -0,0 +1,64 @@
<template>
<view>
<view class="xw_content" v-for="(item,index) in newsList" :key="index" @click="clickNews(item)">
<u--image :src="imgUrl+item.cover" width="192rpx" height="122rpx" :lazy-load="true">
</u--image>
<view class="xw_right">
<view class="xw_title">
{{item.title}}
</view>
<view style="display: flex;">
<text class="xw_time">
{{item.pub_time_str}}
</text>
<text class="xw_time xw_place">
{{item.pub_name}}
</text>
</view>
</view>
</view>
</view>
</template>
<script>
import {
dateFormat
} from '../../utills/date.js'
export default {
data() {
return {
imgUrl: '',
newsList: [],
}
},
created() {
this.imgUrl = uni.getStorageSync('img_url')
this.getNews()
},
methods: {
getNews() {
this.$apiServe.getNews({
pageSize: 3,
pageNum: 1
}).then(res => {
let newsData = res.data.data
console.log('新闻', newsData);
if (newsData) {
for (const item of newsData) {
item.pub_time_str = dateFormat(item.pub_time_str)
}
// newsData = newsData.slice(0, 3)
this.newsList = newsData
}
}).finally(_ => {})
},
// 跳转到新闻详情页
clickNews(item) {
uni.navigateTo({
url: '../../packageReport/newsDetail/newsDetail?id=' + item.id
})
},
}
}
</script>

View File

@@ -0,0 +1,164 @@
<template>
<view>
<view class="products_box">
<u-grid :border="false" col="2">
<u-grid-item v-for="(item,index) in productList" :key="index">
<u-image src="/static/products/sy_bb.png" width="354rpx" height="539rpx" :lazy-load="true">
</u-image>
<view class="bgContent" @click="toDetailPage(item)">
<view>
<u-image :src="imgUrl+item.cover" width="346rpx" height="320rpx" :lazy-load="true"
@click="toDetailPage()">
</u-image>
<view class="img_tag">{{item.cate_name}}</view>
</view>
<view style="padding: 14rpx 24rpx 14rpx 16rpx;">
<view class="title_box">
<text class="title">{{item.name}}</text>
<u-tag :text="item.tags" type="warning" shape="circle"></u-tag>
</view>
<view class="product_desc">
{{item.title}}
</view>
<view class="releaseDate">
<u-image src="/static/products/xp_icon_sjf.png" width="22rpx" height="22rpx"
:lazy-load="true">
</u-image>
<text class="release">发布日期</text>
<text>{{item.create_time}}</text>
</view>
</view>
</view>
<u-button v-if="type==1" type="success" text="取消收藏" color="#0EBB5B" @click="cancelCollect(item)">
</u-button>
<u-button v-if="type==2" type="success" text="移除" color="#0EBB5B" @click="deleteProduct(item)">
</u-button>
</u-grid-item>
</u-grid>
<view style="font-size: 24rpx;color: #A3A3A3;text-align: center;padding: 26rpx 0;"
v-if="type==1&&productList.length==0">
暂无更多收藏记录</view>
<view style="font-size: 24rpx;color: #A3A3A3;text-align: center;padding: 26rpx 0;"
v-if="type==2&&productList.length==0">
暂无更多浏览记录</view>
</view>
</view>
</template>
<script>
import {
dateFormatHistory
} from '../../utills/date.js'
export default {
data() {
return {
productId: '',
imgUrl: '',
tagsArray: [],
productList: [],
content: '您确定移除吗?'
}
},
props: {
type: String
},
options: {
styleIsolation: 'shared', // 解除样式隔离
},
created() {
this.imgUrl = uni.getStorageSync('img_url')
this.getHistoryOrCollection()
},
methods: {
//获取历史记录
getHistoryOrCollection() {
this.$apiServe.getHistoryOrCollection(this.type).then(res => {
let data = res.data.data
console.log('浏览记录或收藏', res.data);
if (data) {
for (const item of data) {
let tag = item.tags
if (tag) {
this.tagsArray = tag.split(',')
item.tags = this.tagsArray[0]
}
item.create_time = dateFormatHistory(item.create_time)
}
this.productList = data
}
}).finally(_ => {
})
},
//移除按钮
deleteProduct(item) {
var that = this
uni.showModal({
title: '提示',
content: '你确定要移除吗',
success: function(res) {
if (res.confirm) {
that.$apiServe.deleteHistoryOrCollection(item.id).then(res => {
if (res.data.code == 1) {
that.$toast.warn('移除成功')
}
that.getHistoryOrCollection()
}).finally(_ => {})
} else if (res.cancel) {
that.$toast.warn('取消移除')
}
}
})
},
//取消收藏按钮
cancelCollect(item) {
var that = this
uni.showModal({
title: '提示',
content: '你确定要取消收藏吗',
success: function(res) {
if (res.confirm) {
that.$apiServe.deleteHistoryOrCollection(item.id).then(res => {
if (res.data.code == 1) {
that.$toast.warn('取消收藏成功')
}
that.getHistoryOrCollection()
}).finally(_ => {})
} else if (res.cancel) {
that.$toast.warn('取消操作')
}
}
})
},
//点击图片跳转到详情页
toDetailPage(item) {
uni.navigateTo({
url: '/pages/detail/productsDetail/productsDetail?id=' + item.product_id
})
}
}
}
</script>
<style lang="less">
.u-modal__content {
padding: 43rpx 104rpx !important;
text-indent: 25rpx;
}
.u-button {
width: 150rpx !important;
height: 50rpx !important;
background: #0EBB5B;
border-radius: 10rpx !important;
margin-top: 22rpx;
margin-bottom: 50rpx;
}
.u-button__text {
font-size: 24rpx !important;
font-weight: 400;
color: #FFFFFF;
line-height: 33px;
}
</style>

View File

@@ -0,0 +1,93 @@
<template>
<view>
<view class="products_box">
<u-grid :border="false" col="2">
<u-grid-item v-for="(item,index) in productList" :key="index" @click="toDetailPage(item)">
<u-image src="/static/products/sy_bb.png" width="354rpx" height="539rpx" :lazy-load="true">
</u-image>
<view class="bgContent">
<view>
<u-image :src="imgUrl+item.cover" width="346rpx" height="320rpx" :lazy-load="true">
</u-image>
<view class="img_tag">{{item.cate_name}}</view>
</view>
<view style="padding: 14rpx 24rpx 14rpx 16rpx;">
<view class="title_box">
<text class="title">{{item.name}}</text>
<u-tag :text="item.tags" type="warning" shape="circle"></u-tag>
</view>
<view class="product_desc">
{{item.title}}
</view>
<view class="releaseDate">
<u-image src="/static/products/xp_icon_sjf.png" width="22rpx" height="22rpx"
:lazy-load="true">
</u-image>
<text class="release">发布日期</text>
<text>{{item.pub_time_str}}</text>
</view>
</view>
</view>
</u-grid-item>
</u-grid>
</view>
</view>
</template>
<script>
export default {
data() {
return {
imgUrl: '',
tagsArray: [],
productList: [],
pageNum: 1, // 当前页
pageSize: 4, // 每页条数
}
},
props: {
reportPageSize: String
},
created() {
// uni.$on("getCurrent", data => {
// if (data == 0) {
// this.sortType = 1
// } else if (data == 1) {
// this.sortType = 2
// }
// })
this.imgUrl = uni.getStorageSync('img_url')
if (this.reportPageSize == 6) {
this.pageSize = this.reportPageSize
}
this.getProductsByThumb()
},
methods: {
//获取按点赞量排列的产品列表
getProductsByThumb() {
this.$apiServe.getProductsByCateId({
cateId: '9',
pageSize: this.pageSize,
pageNum: this.pageNum
}).then(res => {
let tags = res.data.data
console.log('企业需求列表', tags);
for (const item of tags) {
let tag = item.tags
this.tagsArray = tag.split(',')
item.tags = this.tagsArray[0]
}
this.$emit("getThumbLength", tags.length);
// 用于触底刷新 为数据赋值:通过展开运算符的形式,进行新旧数据的拼接
this.productList = [...this.productList, ...res.data.data]
//这用于上架时间和点赞量的数据切换
// this.productList = res.data.data
})
},
}
}
</script>
<style lang="scss">
</style>

View File

@@ -0,0 +1,92 @@
<template>
<view>
<view class="products_box">
<u-grid :border="false" col="2">
<u-grid-item v-for="(item,index) in productList" :key="index" @click="toDetailPage(item)">
<u-image src="/static/products/sy_bb.png" width="354rpx" height="539rpx" :lazy-load="true">
</u-image>
<view class="bgContent">
<view>
<u-image :src="imgUrl+item.cover" width="346rpx" height="320rpx" :lazy-load="true">
</u-image>
<view class="img_tag">{{item.cate_name}}</view>
</view>
<view style="padding: 14rpx 24rpx 14rpx 16rpx;">
<view class="title_box">
<text class="title">{{item.name}}</text>
<u-tag :text="item.tags" type="warning" shape="circle"></u-tag>
</view>
<view class="product_desc">
{{item.title}}
</view>
<view class="releaseDate">
<u-image src="/static/products/xp_icon_sjf.png" width="22rpx" height="22rpx"
:lazy-load="true">
</u-image>
<text class="release">发布日期</text>
<text>{{item.pub_time_str}}</text>
</view>
</view>
</view>
</u-grid-item>
</u-grid>
</view>
</view>
</template>
<script>
export default {
data() {
return {
imgUrl: null,
tagsArray: [],
productList: [],
pageNum: 1, // 当前页
pageSize: 4, // 每页条数
// sortType: ''
}
},
created() {
this.imgUrl = uni.getStorageSync('img_url')
this.getProductsByTime()
},
methods: {
//获取按上架时间排列的产品列表
getProductsByTime() {
this.$apiServe.getProducts({
sortType: 1,
pageSize: this.pageSize,
pageNum: this.pageNum
}).then(res => {
console.log('产品列表1', res.data);
let tags = res.data.data
if (tags) {
for (const item of tags) {
let tag = item.tags
this.tagsArray = tag.split(',')
item.tags = this.tagsArray[0]
}
this.$emit("getTimeLength", tags.length);
// 用于触底刷新 为数据赋值:通过展开运算符的形式,进行新旧数据的拼接
this.productList = [...this.productList, ...res.data.data]
//这用于上架时间和点赞量的数据切换
// this.productList = res.data.data
}
}).finally(_ => {
})
},
//点击图片跳转到详情页
toDetailPage(item) {
uni.navigateTo({
url: '/pages/detail/productsDetail/productsDetail?id=' + item.id
})
}
}
}
</script>
<style lang="scss">
</style>

View File

@@ -0,0 +1,27 @@
<template>
<!--增加audio标签支持-->
<audio
:id="node.attr.id"
:class="node.classStr"
:style="node.styleStr"
:src="node.attr.src"
:loop="node.attr.loop"
:poster="node.attr.poster"
:name="node.attr.name"
:author="node.attr.author"
controls></audio>
</template>
<script>
export default {
name: 'wxParseAudio',
props: {
node: {
type: Object,
default() {
return {};
},
},
},
};
</script>

View File

@@ -0,0 +1,86 @@
<template>
<image
:mode="node.attr.mode"
:lazy-load="node.attr.lazyLoad"
:class="node.classStr"
:style="newStyleStr || node.styleStr"
:data-src="node.attr.src"
:src="node.attr.src"
@tap="wxParseImgTap"
@load="wxParseImgLoad"
/>
</template>
<script>
export default {
name: 'wxParseImg',
data() {
return {
newStyleStr: '',
preview: true,
};
},
props: {
node: {
type: Object,
default() {
return {};
},
},
},
methods: {
wxParseImgTap(e) {
if (!this.preview) return;
const { src } = e.currentTarget.dataset;
if (!src) return;
let parent = this.$parent;
while(!parent.preview || typeof parent.preview !== 'function') {// TODO 遍历获取父节点执行方法
parent = parent.$parent;
}
parent.preview(src, e);
},
// 图片视觉宽高计算函数区
wxParseImgLoad(e) {
const { src } = e.currentTarget.dataset;
if (!src) return;
const { width, height } = e.mp.detail;
const recal = this.wxAutoImageCal(width, height);
const { imageheight, imageWidth } = recal;
const { padding, mode } = this.node.attr;
const { styleStr } = this.node;
const imageHeightStyle = mode === 'widthFix' ? '' : `height: ${imageheight}px;`;
this.newStyleStr = `${styleStr}; ${imageHeightStyle}; width: ${imageWidth}px; padding: 0 ${+padding}px;`;
},
// 计算视觉优先的图片宽高
wxAutoImageCal(originalWidth, originalHeight) {
// 获取图片的原始长宽
const { padding } = this.node.attr;
const windowWidth = this.node.$screen.width - (2 * padding);
const results = {};
if (originalWidth < 60 || originalHeight < 60) {
const { src } = this.node.attr;
let parent = this.$parent;
while(!parent.preview || typeof parent.preview !== 'function') {
parent = parent.$parent;
}
parent.removeImageUrl(src);
this.preview = false;
}
// 判断按照那种方式进行缩放
if (originalWidth > windowWidth) {
// 在图片width大于手机屏幕width时候
results.imageWidth = windowWidth;
results.imageheight = windowWidth * (originalHeight / originalWidth);
} else {
// 否则展示原来的数据
results.imageWidth = originalWidth;
results.imageheight = originalHeight;
}
return results;
},
},
};
</script>

View File

@@ -0,0 +1,107 @@
<template>
<view>
<!--判断是否是标签节点-->
<block v-if="node.node == 'element'">
<block v-if="node.tag == 'button'">
<button type="default" size="mini">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</button>
</block>
<!--li类型-->
<block v-else-if="node.tag == 'li'">
<view :class="node.classStr" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
<!--video类型-->
<block v-else-if="node.tag == 'video'">
<wx-parse-video :node="node" />
</block>
<!--audio类型-->
<block v-else-if="node.tag == 'audio'">
<wx-parse-audio :node="node" />
</block>
<!--img类型-->
<block v-else-if="node.tag == 'img'">
<wx-parse-img :node="node" />
</block>
<!--a类型-->
<block v-else-if="node.tag == 'a'">
<view @click="wxParseATap" :class="node.classStr" :data-href="node.attr.href" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
<!--table类型-->
<block v-else-if="node.tag == 'table'">
<view :class="node.classStr" class="table" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
<!--br类型-->
<block v-else-if="node.tag == 'br'">
<text>\n</text>
</block>
<!--其他标签-->
<block v-else>
<view :class="node.classStr" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
</block>
<!--判断是否是文本节点-->
<block v-else-if="node.node == 'text'">{{node.text}}</block>
</view>
</template>
<script>
import wxParseTemplate from './wxParseTemplate1';
import wxParseImg from './wxParseImg';
import wxParseVideo from './wxParseVideo';
import wxParseAudio from './wxParseAudio';
export default {
name: 'wxParseTemplate0',
props: {
node: {},
},
components: {
wxParseTemplate,
wxParseImg,
wxParseVideo,
wxParseAudio,
},
methods: {
wxParseATap(e) {
const {
href
} = e.currentTarget.dataset;// TODO currentTarget才有dataset
if (!href) return;
let parent = this.$parent;
while(!parent.preview || typeof parent.preview !== 'function') {// TODO 遍历获取父节点执行方法
parent = parent.$parent;
}
parent.navigate(href, e);
},
},
};
</script>

View File

@@ -0,0 +1,99 @@
<template>
<view :class="(node.tag == 'li' ? node.classStr : (node.node==='text'?'text':''))">
<!--判断是否是标签节点-->
<block v-if="node.node == 'element'">
<block v-if="node.tag == 'button'">
<button type="default" size="mini">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</button>
</block>
<!--li类型-->
<block v-else-if="node.tag == 'li'">
<!-- <view :class="node.classStr" :style="node.styleStr"> -->
<view :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
<!--video类型-->
<block v-else-if="node.tag == 'video'">
<wx-parse-video :node="node" />
</block>
<!--audio类型-->
<block v-else-if="node.tag == 'audio'">
<wx-parse-audio :node="node" />
</block>
<!--img类型-->
<block v-else-if="node.tag == 'img'">
<wx-parse-img :node="node" />
</block>
<!--a类型-->
<block v-else-if="node.tag == 'a'">
<view @click="wxParseATap" :class="node.classStr" :data-href="node.attr.href" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
<!--br类型-->
<block v-else-if="node.tag == 'br'">
<text>\n</text>
</block>
<!--其他标签-->
<block v-else>
<view :class="node.classStr" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
</block>
<!--判断是否是文本节点-->
<block v-else-if="node.node == 'text'">{{node.text}}</block>
</view>
</template>
<script>
import wxParseTemplate from './wxParseTemplate2';
import wxParseImg from './wxParseImg';
import wxParseVideo from './wxParseVideo';
import wxParseAudio from './wxParseAudio';
export default {
name: 'wxParseTemplate1',
props: {
node: {},
},
components: {
wxParseTemplate,
wxParseImg,
wxParseVideo,
wxParseAudio,
},
methods: {
wxParseATap(e) {
const {
href
} = e.currentTarget.dataset;
if (!href) return;
let parent = this.$parent;
while(!parent.preview || typeof parent.preview !== 'function') {
parent = parent.$parent;
}
parent.navigate(href, e);
},
},
};
</script>

View File

@@ -0,0 +1,97 @@
<template>
<view>
<!--判断是否是标签节点-->
<block v-if="node.node == 'element'">
<block v-if="node.tag == 'button'">
<button type="default" size="mini">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</button>
</block>
<!--li类型-->
<block v-else-if="node.tag == 'li'">
<view :class="node.classStr" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
<!--video类型-->
<block v-else-if="node.tag == 'video'">
<wx-parse-video :node="node" />
</block>
<!--audio类型-->
<block v-else-if="node.tag == 'audio'">
<wx-parse-audio :node="node" />
</block>
<!--img类型-->
<block v-else-if="node.tag == 'img'">
<wx-parse-img :node="node" />
</block>
<!--a类型-->
<block v-else-if="node.tag == 'a'">
<view @click="wxParseATap" :class="node.classStr" :data-href="node.attr.href" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
<!--br类型-->
<block v-else-if="node.tag == 'br'">
<text>\n</text>
</block>
<!--其他标签-->
<block v-else>
<view :class="node.classStr" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
</block>
<!--判断是否是文本节点-->
<block v-else-if="node.node == 'text'">{{node.text}}</block>
</view>
</template>
<script>
import wxParseTemplate from './wxParseTemplate11';
import wxParseImg from './wxParseImg';
import wxParseVideo from './wxParseVideo';
import wxParseAudio from './wxParseAudio';
export default {
name: 'wxParseTemplate10',
props: {
node: {},
},
components: {
wxParseTemplate,
wxParseImg,
wxParseVideo,
wxParseAudio,
},
methods: {
wxParseATap(e) {
const {
href
} = e.currentTarget.dataset;
if (!href) return;
let parent = this.$parent;
while(!parent.preview || typeof parent.preview !== 'function') {
parent = parent.$parent;
}
parent.navigate(href, e);
},
},
};
</script>

View File

@@ -0,0 +1,87 @@
<template>
<view>
<!--判断是否是标签节点-->
<block v-if="node.node == 'element'">
<!--button类型-->
<block v-if="node.tag == 'button'">
<button type="default" size="mini">
</button>
</block>
<!--li类型-->
<block v-else-if="node.tag == 'li'">
<view :class="node.classStr" :style="node.styleStr">
{{node.text}}
</view>
</block>
<!--video类型-->
<block v-else-if="node.tag == 'video'">
<wx-parse-video :node="node" />
</block>
<!--audio类型-->
<block v-else-if="node.tag == 'audio'">
<wx-parse-audio :node="node" />
</block>
<!--img类型-->
<block v-else-if="node.tag == 'img'">
<wx-parse-img :node="node" />
</block>
<!--a类型-->
<block v-else-if="node.tag == 'a'">
<view @click="wxParseATap" :class="node.classStr" :data-href="node.attr.href" :style="node.styleStr">
{{node.text}}
</view>
</block>
<!--br类型-->
<block v-else-if="node.tag == 'br'">
<text>\n</text>
</block>
<!--其他标签-->
<block v-else>
<view :class="node.classStr" :style="node.styleStr">
{{node.text}}
</view>
</block>
</block>
<!--判断是否是文本节点-->
<block v-else-if="node.node == 'text'">{{node.text}}</block>
</view>
</template>
<script>
import wxParseImg from './wxParseImg';
import wxParseVideo from './wxParseVideo';
import wxParseAudio from './wxParseAudio';
export default {
name: 'wxParseTemplate11',
props: {
node: {},
},
components: {
wxParseImg,
wxParseVideo,
wxParseAudio,
},
methods: {
wxParseATap(e) {
const {
href
} = e.currentTarget.dataset;
if (!href) return;
let parent = this.$parent;
while(!parent.preview || typeof parent.preview !== 'function') {
parent = parent.$parent;
}
parent.navigate(href, e);
},
},
};
</script>

View File

@@ -0,0 +1,98 @@
<template>
<view>
<!--判断是否是标签节点-->
<block v-if="node.node == 'element'">
<block v-if="node.tag == 'button'">
<button type="default" size="mini">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</button>
</block>
<!--li类型-->
<block v-else-if="node.tag == 'li'">
<view :class="node.classStr" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
<!--video类型-->
<block v-else-if="node.tag == 'video'">
<wx-parse-video :node="node" />
</block>
<!--audio类型-->
<block v-else-if="node.tag == 'audio'">
<wx-parse-audio :node="node" />
</block>
<!--img类型-->
<block v-else-if="node.tag == 'img'">
<wx-parse-img :node="node" />
</block>
<!--a类型-->
<block v-else-if="node.tag == 'a'">
<view @click="wxParseATap" :class="node.classStr" :data-href="node.attr.href" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
<!--br类型-->
<block v-else-if="node.tag == 'br'">
<text>\n</text>
</block>
<!--其他标签-->
<block v-else>
<view :class="node.classStr" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
</block>
<!--判断是否是文本节点-->
<block v-else-if="node.node == 'text'">{{node.text}}</block>
</view>
</template>
<script>
import wxParseTemplate from './wxParseTemplate3';
import wxParseImg from './wxParseImg';
import wxParseVideo from './wxParseVideo';
import wxParseAudio from './wxParseAudio';
export default {
name: 'wxParseTemplate2',
props: {
node: {},
},
components: {
wxParseTemplate,
wxParseImg,
wxParseVideo,
wxParseAudio,
},
methods: {
wxParseATap(e) {
const {
href
} = e.currentTarget.dataset;
if (!href) return;
let parent = this.$parent;
while(!parent.preview || typeof parent.preview !== 'function') {
parent = parent.$parent;
}
parent.navigate(href, e);
},
},
};
</script>

View File

@@ -0,0 +1,98 @@
<template>
<view>
<!--判断是否是标签节点-->
<block v-if="node.node == 'element'">
<block v-if="node.tag == 'button'">
<button type="default" size="mini">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</button>
</block>
<!--li类型-->
<block v-else-if="node.tag == 'li'">
<view :class="node.classStr" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
<!--video类型-->
<block v-else-if="node.tag == 'video'">
<wx-parse-video :node="node" />
</block>
<!--audio类型-->
<block v-else-if="node.tag == 'audio'">
<wx-parse-audio :node="node" />
</block>
<!--img类型-->
<block v-else-if="node.tag == 'img'">
<wx-parse-img :node="node" />
</block>
<!--a类型-->
<block v-else-if="node.tag == 'a'">
<view @click="wxParseATap" :class="node.classStr" :data-href="node.attr.href" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
<!--br类型-->
<block v-else-if="node.tag == 'br'">
<text>\n</text>
</block>
<!--其他标签-->
<block v-else>
<view :class="node.classStr" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
</block>
<!--判断是否是文本节点-->
<block v-else-if="node.node == 'text'">{{node.text}}</block>
</view>
</template>
<script>
import wxParseTemplate from './wxParseTemplate4';
import wxParseImg from './wxParseImg';
import wxParseVideo from './wxParseVideo';
import wxParseAudio from './wxParseAudio';
export default {
name: 'wxParseTemplate3',
props: {
node: {},
},
components: {
wxParseTemplate,
wxParseImg,
wxParseVideo,
wxParseAudio,
},
methods: {
wxParseATap(e) {
const {
href
} = e.currentTarget.dataset;
if (!href) return;
let parent = this.$parent;
while(!parent.preview || typeof parent.preview !== 'function') {
parent = parent.$parent;
}
parent.navigate(href, e);
},
},
};
</script>

View File

@@ -0,0 +1,98 @@
<template>
<view>
<!--判断是否是标签节点-->
<block v-if="node.node == 'element'">
<block v-if="node.tag == 'button'">
<button type="default" size="mini">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</button>
</block>
<!--li类型-->
<block v-else-if="node.tag == 'li'">
<view :class="node.classStr" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
<!--video类型-->
<block v-else-if="node.tag == 'video'">
<wx-parse-video :node="node" />
</block>
<!--audio类型-->
<block v-else-if="node.tag == 'audio'">
<wx-parse-audio :node="node" />
</block>
<!--img类型-->
<block v-else-if="node.tag == 'img'">
<wx-parse-img :node="node" />
</block>
<!--a类型-->
<block v-else-if="node.tag == 'a'">
<view @click="wxParseATap" :class="node.classStr" :data-href="node.attr.href" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
<!--br类型-->
<block v-else-if="node.tag == 'br'">
<text>\n</text>
</block>
<!--其他标签-->
<block v-else>
<view :class="node.classStr" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
</block>
<!--判断是否是文本节点-->
<block v-else-if="node.node == 'text'">{{node.text}}</block>
</view>
</template>
<script>
import wxParseTemplate from './wxParseTemplate5';
import wxParseImg from './wxParseImg';
import wxParseVideo from './wxParseVideo';
import wxParseAudio from './wxParseAudio';
export default {
name: 'wxParseTemplate4',
props: {
node: {},
},
components: {
wxParseTemplate,
wxParseImg,
wxParseVideo,
wxParseAudio,
},
methods: {
wxParseATap(e) {
const {
href
} = e.currentTarget.dataset;
if (!href) return;
let parent = this.$parent;
while(!parent.preview || typeof parent.preview !== 'function') {
parent = parent.$parent;
}
parent.navigate(href, e);
},
},
};
</script>

View File

@@ -0,0 +1,98 @@
<template>
<view>
<!--判断是否是标签节点-->
<block v-if="node.node == 'element'">
<block v-if="node.tag == 'button'">
<button type="default" size="mini">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</button>
</block>
<!--li类型-->
<block v-else-if="node.tag == 'li'">
<view :class="node.classStr" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
<!--video类型-->
<block v-else-if="node.tag == 'video'">
<wx-parse-video :node="node" />
</block>
<!--audio类型-->
<block v-else-if="node.tag == 'audio'">
<wx-parse-audio :node="node" />
</block>
<!--img类型-->
<block v-else-if="node.tag == 'img'">
<wx-parse-img :node="node" />
</block>
<!--a类型-->
<block v-else-if="node.tag == 'a'">
<view @click="wxParseATap" :class="node.classStr" :data-href="node.attr.href" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
<!--br类型-->
<block v-else-if="node.tag == 'br'">
<text>\n</text>
</block>
<!--其他标签-->
<block v-else>
<view :class="node.classStr" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
</block>
<!--判断是否是文本节点-->
<block v-else-if="node.node == 'text'">{{node.text}}</block>
</view>
</template>
<script>
import wxParseTemplate from './wxParseTemplate6';
import wxParseImg from './wxParseImg';
import wxParseVideo from './wxParseVideo';
import wxParseAudio from './wxParseAudio';
export default {
name: 'wxParseTemplate5',
props: {
node: {},
},
components: {
wxParseTemplate,
wxParseImg,
wxParseVideo,
wxParseAudio,
},
methods: {
wxParseATap(e) {
const {
href
} = e.currentTarget.dataset;
if (!href) return;
let parent = this.$parent;
while(!parent.preview || typeof parent.preview !== 'function') {
parent = parent.$parent;
}
parent.navigate(href, e);
},
},
};
</script>

View File

@@ -0,0 +1,98 @@
<template>
<view>
<!--判断是否是标签节点-->
<block v-if="node.node == 'element'">
<block v-if="node.tag == 'button'">
<button type="default" size="mini">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</button>
</block>
<!--li类型-->
<block v-else-if="node.tag == 'li'">
<view :class="node.classStr" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
<!--video类型-->
<block v-else-if="node.tag == 'video'">
<wx-parse-video :node="node" />
</block>
<!--audio类型-->
<block v-else-if="node.tag == 'audio'">
<wx-parse-audio :node="node" />
</block>
<!--img类型-->
<block v-else-if="node.tag == 'img'">
<wx-parse-img :node="node" />
</block>
<!--a类型-->
<block v-else-if="node.tag == 'a'">
<view @click="wxParseATap" :class="node.classStr" :data-href="node.attr.href" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
<!--br类型-->
<block v-else-if="node.tag == 'br'">
<text>\n</text>
</block>
<!--其他标签-->
<block v-else>
<view :class="node.classStr" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
</block>
<!--判断是否是文本节点-->
<block v-else-if="node.node == 'text'">{{node.text}}</block>
</view>
</template>
<script>
import wxParseTemplate from './wxParseTemplate7';
import wxParseImg from './wxParseImg';
import wxParseVideo from './wxParseVideo';
import wxParseAudio from './wxParseAudio';
export default {
name: 'wxParseTemplate6',
props: {
node: {},
},
components: {
wxParseTemplate,
wxParseImg,
wxParseVideo,
wxParseAudio,
},
methods: {
wxParseATap(e) {
const {
href
} = e.currentTarget.dataset;
if (!href) return;
let parent = this.$parent;
while(!parent.preview || typeof parent.preview !== 'function') {
parent = parent.$parent;
}
parent.navigate(href, e);
},
},
};
</script>

View File

@@ -0,0 +1,98 @@
<template>
<view>
<!--判断是否是标签节点-->
<block v-if="node.node == 'element'">
<block v-if="node.tag == 'button'">
<button type="default" size="mini">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</button>
</block>
<!--li类型-->
<block v-else-if="node.tag == 'li'">
<view :class="node.classStr" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
<!--video类型-->
<block v-else-if="node.tag == 'video'">
<wx-parse-video :node="node" />
</block>
<!--audio类型-->
<block v-else-if="node.tag == 'audio'">
<wx-parse-audio :node="node" />
</block>
<!--img类型-->
<block v-else-if="node.tag == 'img'">
<wx-parse-img :node="node" />
</block>
<!--a类型-->
<block v-else-if="node.tag == 'a'">
<view @click="wxParseATap" :class="node.classStr" :data-href="node.attr.href" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
<!--br类型-->
<block v-else-if="node.tag == 'br'">
<text>\n</text>
</block>
<!--其他标签-->
<block v-else>
<view :class="node.classStr" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
</block>
<!--判断是否是文本节点-->
<block v-else-if="node.node == 'text'">{{node.text}}</block>
</view>
</template>
<script>
import wxParseTemplate from './wxParseTemplate8';
import wxParseImg from './wxParseImg';
import wxParseVideo from './wxParseVideo';
import wxParseAudio from './wxParseAudio';
export default {
name: 'wxParseTemplate7',
props: {
node: {},
},
components: {
wxParseTemplate,
wxParseImg,
wxParseVideo,
wxParseAudio,
},
methods: {
wxParseATap(e) {
const {
href
} = e.currentTarget.dataset;
if (!href) return;
let parent = this.$parent;
while(!parent.preview || typeof parent.preview !== 'function') {
parent = parent.$parent;
}
parent.navigate(href, e);
},
},
};
</script>

View File

@@ -0,0 +1,98 @@
<template>
<view>
<!--判断是否是标签节点-->
<block v-if="node.node == 'element'">
<block v-if="node.tag == 'button'">
<button type="default" size="mini">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</button>
</block>
<!--li类型-->
<block v-else-if="node.tag == 'li'">
<view :class="node.classStr" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
<!--video类型-->
<block v-else-if="node.tag == 'video'">
<wx-parse-video :node="node" />
</block>
<!--audio类型-->
<block v-else-if="node.tag == 'audio'">
<wx-parse-audio :node="node" />
</block>
<!--img类型-->
<block v-else-if="node.tag == 'img'">
<wx-parse-img :node="node" />
</block>
<!--a类型-->
<block v-else-if="node.tag == 'a'">
<view @click="wxParseATap" :class="node.classStr" :data-href="node.attr.href" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
<!--br类型-->
<block v-else-if="node.tag == 'br'">
<text>\n</text>
</block>
<!--其他标签-->
<block v-else>
<view :class="node.classStr" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
</block>
<!--判断是否是文本节点-->
<block v-else-if="node.node == 'text'">{{node.text}}</block>
</view>
</template>
<script>
import wxParseTemplate from './wxParseTemplate9';
import wxParseImg from './wxParseImg';
import wxParseVideo from './wxParseVideo';
import wxParseAudio from './wxParseAudio';
export default {
name: 'wxParseTemplate8',
props: {
node: {},
},
components: {
wxParseTemplate,
wxParseImg,
wxParseVideo,
wxParseAudio,
},
methods: {
wxParseATap(e) {
const {
href
} = e.currentTarget.dataset;
if (!href) return;
let parent = this.$parent;
while(!parent.preview || typeof parent.preview !== 'function') {
parent = parent.$parent;
}
parent.navigate(href, e);
},
},
};
</script>

View File

@@ -0,0 +1,98 @@
<template>
<view>
<!--判断是否是标签节点-->
<block v-if="node.node == 'element'">
<block v-if="node.tag == 'button'">
<button type="default" size="mini">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</button>
</block>
<!--li类型-->
<block v-else-if="node.tag == 'li'">
<view :class="node.classStr" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
<!--video类型-->
<block v-else-if="node.tag == 'video'">
<wx-parse-video :node="node" />
</block>
<!--audio类型-->
<block v-else-if="node.tag == 'audio'">
<wx-parse-audio :node="node" />
</block>
<!--img类型-->
<block v-else-if="node.tag == 'img'">
<wx-parse-img :node="node" />
</block>
<!--a类型-->
<block v-else-if="node.tag == 'a'">
<view @click="wxParseATap" :class="node.classStr" :data-href="node.attr.href" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
<!--br类型-->
<block v-else-if="node.tag == 'br'">
<text>\n</text>
</block>
<!--其他标签-->
<block v-else>
<view :class="node.classStr" :style="node.styleStr">
<block v-for="(node, index) of node.nodes" :key="index">
<wx-parse-template :node="node" />
</block>
</view>
</block>
</block>
<!--判断是否是文本节点-->
<block v-else-if="node.node == 'text'">{{node.text}}</block>
</view>
</template>
<script>
import wxParseTemplate from './wxParseTemplate10';
import wxParseImg from './wxParseImg';
import wxParseVideo from './wxParseVideo';
import wxParseAudio from './wxParseAudio';
export default {
name: 'wxParseTemplate9',
props: {
node: {},
},
components: {
wxParseTemplate,
wxParseImg,
wxParseVideo,
wxParseAudio,
},
methods: {
wxParseATap(e) {
const {
href
} = e.currentTarget.dataset;
if (!href) return;
let parent = this.$parent;
while(!parent.preview || typeof parent.preview !== 'function') {
parent = parent.$parent;
}
parent.navigate(href, e);
},
},
};
</script>

View File

@@ -0,0 +1,15 @@
<template>
<!--增加video标签支持并循环添加-->
<view :class="node.classStr" :style="node.styleStr">
<video :class="node.classStr" class="video-video" :src="node.attr.src"></video>
</view>
</template>
<script>
export default {
name: 'wxParseVideo',
props: {
node: {},
},
};
</script>

View File

@@ -0,0 +1,261 @@
/**
* html2Json 改造来自: https://github.com/Jxck/html2json
*
*
* author: Di (微信小程序开发工程师)
* organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
* 垂直微信小程序开发交流社区
*
* github地址: https://github.com/icindy/wxParse
*
* for: 微信小程序富文本解析
* detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
*/
import wxDiscode from './wxDiscode';
import HTMLParser from './htmlparser';
function makeMap(str) {
const obj = {};
const items = str.split(',');
for (let i = 0; i < items.length; i += 1) obj[items[i]] = true;
return obj;
}
// Block Elements - HTML 5
const block = makeMap('br,code,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video');
// Inline Elements - HTML 5
const inline = makeMap('a,abbr,acronym,applet,b,basefont,bdo,big,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var');
// Elements that you can, intentionally, leave open
// (and which close themselves)
const closeSelf = makeMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr');
function removeDOCTYPE(html) {
const isDocument = /<body.*>([^]*)<\/body>/.test(html);
return isDocument ? RegExp.$1 : html;
}
function trimHtml(html) {
return html
.replace(/<!--.*?-->/gi, '')
.replace(/\/\*.*?\*\//gi, '')
.replace(/[ ]+</gi, '<')
.replace(/<script[^]*<\/script>/gi, '')
.replace(/<style[^]*<\/style>/gi, '');
}
function getScreenInfo() {
const screen = {};
wx.getSystemInfo({
success: (res) => {
screen.width = res.windowWidth;
screen.height = res.windowHeight;
},
});
return screen;
}
function html2json(html, customHandler, imageProp, host) {
// 处理字符串
html = removeDOCTYPE(html);
html = trimHtml(html);
html = wxDiscode.strDiscode(html);
// 生成node节点
const bufArray = [];
const results = {
nodes: [],
imageUrls: [],
};
const screen = getScreenInfo();
function Node(tag) {
this.node = 'element';
this.tag = tag;
this.$screen = screen;
}
HTMLParser(html, {
start(tag, attrs, unary) {
// node for this element
const node = new Node(tag);
if (bufArray.length !== 0) {
const parent = bufArray[0];
if (parent.nodes === undefined) {
parent.nodes = [];
}
}
if (block[tag]) {
node.tagType = 'block';
} else if (inline[tag]) {
node.tagType = 'inline';
} else if (closeSelf[tag]) {
node.tagType = 'closeSelf';
}
node.attr = attrs.reduce((pre, attr) => {
const { name } = attr;
let { value } = attr;
if (name === 'class') {
node.classStr = value;
}
// has multi attibutes
// make it array of attribute
if (name === 'style') {
node.styleStr = value;
}
if (value.match(/ /)) {
value = value.split(' ');
}
// if attr already exists
// merge it
if (pre[name]) {
if (Array.isArray(pre[name])) {
// already array, push to last
pre[name].push(value);
} else {
// single value, make it array
pre[name] = [pre[name], value];
}
} else {
// not exist, put it
pre[name] = value;
}
return pre;
}, {});
// 优化样式相关属性
if (node.classStr) {
node.classStr += ` ${node.tag}`;
} else {
node.classStr = node.tag;
}
if (node.tagType === 'inline') {
node.classStr += ' inline';
}
// 对img添加额外数据
if (node.tag === 'img') {
let imgUrl = node.attr.src;
imgUrl = wxDiscode.urlToHttpUrl(imgUrl, imageProp.domain);
Object.assign(node.attr, imageProp, {
src: imgUrl || '',
});
if (imgUrl) {
results.imageUrls.push(imgUrl);
}
}
// 处理a标签属性
if (node.tag === 'a') {
node.attr.href = node.attr.href || '';
}
// 处理font标签样式属性
if (node.tag === 'font') {
const fontSize = [
'x-small',
'small',
'medium',
'large',
'x-large',
'xx-large',
'-webkit-xxx-large',
];
const styleAttrs = {
color: 'color',
face: 'font-family',
size: 'font-size',
};
if (!node.styleStr) node.styleStr = '';
Object.keys(styleAttrs).forEach((key) => {
if (node.attr[key]) {
const value = key === 'size' ? fontSize[node.attr[key] - 1] : node.attr[key];
node.styleStr += `${styleAttrs[key]}: ${value};`;
}
});
}
// 临时记录source资源
if (node.tag === 'source') {
results.source = node.attr.src;
}
if (customHandler.start) {
customHandler.start(node, results);
}
if (unary) {
// if this tag doesn't have end tag
// like <img src="hoge.png"/>
// add to parents
const parent = bufArray[0] || results;
if (parent.nodes === undefined) {
parent.nodes = [];
}
parent.nodes.push(node);
} else {
bufArray.unshift(node);
}
},
end(tag) {
// merge into parent tag
const node = bufArray.shift();
if (node.tag !== tag) {
console.error('invalid state: mismatch end tag');
}
// 当有缓存source资源时于于video补上src资源
if (node.tag === 'video' && results.source) {
node.attr.src = results.source;
delete results.source;
}
if (customHandler.end) {
customHandler.end(node, results);
}
if (bufArray.length === 0) {
results.nodes.push(node);
} else {
const parent = bufArray[0];
if (!parent.nodes) {
parent.nodes = [];
}
parent.nodes.push(node);
}
},
chars(text) {
if (!text.trim()) return;
const node = {
node: 'text',
text,
};
if (customHandler.chars) {
customHandler.chars(node, results);
}
if (bufArray.length === 0) {
results.nodes.push(node);
} else {
const parent = bufArray[0];
if (parent.nodes === undefined) {
parent.nodes = [];
}
parent.nodes.push(node);
}
},
});
return results;
}
export default html2json;

View File

@@ -0,0 +1,156 @@
/**
*
* htmlParser改造自: https://github.com/blowsie/Pure-JavaScript-HTML5-Parser
*
* author: Di (微信小程序开发工程师)
* organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
* 垂直微信小程序开发交流社区
*
* github地址: https://github.com/icindy/wxParse
*
* for: 微信小程序富文本解析
* detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
*/
// Regular Expressions for parsing tags and attributes
const startTag = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z0-9_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/;
const endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/;
const attr = /([a-zA-Z0-9_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;
function makeMap(str) {
const obj = {};
const items = str.split(',');
for (let i = 0; i < items.length; i += 1) obj[items[i]] = true;
return obj;
}
// Empty Elements - HTML 5
const empty = makeMap('area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr');
// Block Elements - HTML 5
const block = makeMap('address,code,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video');
// Inline Elements - HTML 5
const inline = makeMap('a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var');
// Elements that you can, intentionally, leave open
// (and which close themselves)
const closeSelf = makeMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr');
// Attributes that have their values filled in disabled="disabled"
const fillAttrs = makeMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected');
function HTMLParser(html, handler) {
let index;
let chars;
let match;
let last = html;
const stack = [];
stack.last = () => stack[stack.length - 1];
function parseEndTag(tag, tagName) {
// If no tag name is provided, clean shop
let pos;
if (!tagName) {
pos = 0;
} else {
// Find the closest opened tag of the same type
tagName = tagName.toLowerCase();
for (pos = stack.length - 1; pos >= 0; pos -= 1) {
if (stack[pos] === tagName) break;
}
}
if (pos >= 0) {
// Close all the open elements, up the stack
for (let i = stack.length - 1; i >= pos; i -= 1) {
if (handler.end) handler.end(stack[i]);
}
// Remove the open elements from the stack
stack.length = pos;
}
}
function parseStartTag(tag, tagName, rest, unary) {
tagName = tagName.toLowerCase();
if (block[tagName]) {
while (stack.last() && inline[stack.last()]) {
parseEndTag('', stack.last());
}
}
if (closeSelf[tagName] && stack.last() === tagName) {
parseEndTag('', tagName);
}
unary = empty[tagName] || !!unary;
if (!unary) stack.push(tagName);
if (handler.start) {
const attrs = [];
rest.replace(attr, function genAttr(matches, name) {
const value = arguments[2] || arguments[3] || arguments[4] || (fillAttrs[name] ? name : '');
attrs.push({
name,
value,
escaped: value.replace(/(^|[^\\])"/g, '$1\\"'), // "
});
});
if (handler.start) {
handler.start(tagName, attrs, unary);
}
}
}
while (html) {
chars = true;
if (html.indexOf('</') === 0) {
match = html.match(endTag);
if (match) {
html = html.substring(match[0].length);
match[0].replace(endTag, parseEndTag);
chars = false;
}
// start tag
} else if (html.indexOf('<') === 0) {
match = html.match(startTag);
if (match) {
html = html.substring(match[0].length);
match[0].replace(startTag, parseStartTag);
chars = false;
}
}
if (chars) {
index = html.indexOf('<');
let text = '';
while (index === 0) {
text += '<';
html = html.substring(1);
index = html.indexOf('<');
}
text += index < 0 ? html : html.substring(0, index);
html = index < 0 ? '' : html.substring(index);
if (handler.chars) handler.chars(text);
}
if (html === last) throw new Error(`Parse Error: ${html}`);
last = html;
}
// Clean up any remaining tags
parseEndTag();
}
export default HTMLParser;

View File

@@ -0,0 +1,195 @@
// HTML 支持的数学符号
function strNumDiscode(str) {
str = str.replace(/&forall;/g, '∀');
str = str.replace(/&part;/g, '∂');
str = str.replace(/&exist;/g, '∃');
str = str.replace(/&empty;/g, '∅');
str = str.replace(/&nabla;/g, '∇');
str = str.replace(/&isin;/g, '∈');
str = str.replace(/&notin;/g, '∉');
str = str.replace(/&ni;/g, '∋');
str = str.replace(/&prod;/g, '∏');
str = str.replace(/&sum;/g, '∑');
str = str.replace(/&minus;/g, '');
str = str.replace(/&lowast;/g, '');
str = str.replace(/&radic;/g, '√');
str = str.replace(/&prop;/g, '∝');
str = str.replace(/&infin;/g, '∞');
str = str.replace(/&ang;/g, '∠');
str = str.replace(/&and;/g, '∧');
str = str.replace(/&or;/g, '');
str = str.replace(/&cap;/g, '∩');
str = str.replace(/&cup;/g, '');
str = str.replace(/&int;/g, '∫');
str = str.replace(/&there4;/g, '∴');
str = str.replace(/&sim;/g, '');
str = str.replace(/&cong;/g, '≅');
str = str.replace(/&asymp;/g, '≈');
str = str.replace(/&ne;/g, '≠');
str = str.replace(/&le;/g, '≤');
str = str.replace(/&ge;/g, '≥');
str = str.replace(/&sub;/g, '⊂');
str = str.replace(/&sup;/g, '⊃');
str = str.replace(/&nsub;/g, '⊄');
str = str.replace(/&sube;/g, '⊆');
str = str.replace(/&supe;/g, '⊇');
str = str.replace(/&oplus;/g, '⊕');
str = str.replace(/&otimes;/g, '⊗');
str = str.replace(/&perp;/g, '⊥');
str = str.replace(/&sdot;/g, '⋅');
return str;
}
// HTML 支持的希腊字母
function strGreeceDiscode(str) {
str = str.replace(/&Alpha;/g, 'Α');
str = str.replace(/&Beta;/g, 'Β');
str = str.replace(/&Gamma;/g, 'Γ');
str = str.replace(/&Delta;/g, 'Δ');
str = str.replace(/&Epsilon;/g, 'Ε');
str = str.replace(/&Zeta;/g, 'Ζ');
str = str.replace(/&Eta;/g, 'Η');
str = str.replace(/&Theta;/g, 'Θ');
str = str.replace(/&Iota;/g, 'Ι');
str = str.replace(/&Kappa;/g, 'Κ');
str = str.replace(/&Lambda;/g, 'Λ');
str = str.replace(/&Mu;/g, 'Μ');
str = str.replace(/&Nu;/g, 'Ν');
str = str.replace(/&Xi;/g, 'Ν');
str = str.replace(/&Omicron;/g, 'Ο');
str = str.replace(/&Pi;/g, 'Π');
str = str.replace(/&Rho;/g, 'Ρ');
str = str.replace(/&Sigma;/g, 'Σ');
str = str.replace(/&Tau;/g, 'Τ');
str = str.replace(/&Upsilon;/g, 'Υ');
str = str.replace(/&Phi;/g, 'Φ');
str = str.replace(/&Chi;/g, 'Χ');
str = str.replace(/&Psi;/g, 'Ψ');
str = str.replace(/&Omega;/g, 'Ω');
str = str.replace(/&alpha;/g, 'α');
str = str.replace(/&beta;/g, 'β');
str = str.replace(/&gamma;/g, 'γ');
str = str.replace(/&delta;/g, 'δ');
str = str.replace(/&epsilon;/g, 'ε');
str = str.replace(/&zeta;/g, 'ζ');
str = str.replace(/&eta;/g, 'η');
str = str.replace(/&theta;/g, 'θ');
str = str.replace(/&iota;/g, 'ι');
str = str.replace(/&kappa;/g, 'κ');
str = str.replace(/&lambda;/g, 'λ');
str = str.replace(/&mu;/g, 'μ');
str = str.replace(/&nu;/g, 'ν');
str = str.replace(/&xi;/g, 'ξ');
str = str.replace(/&omicron;/g, 'ο');
str = str.replace(/&pi;/g, 'π');
str = str.replace(/&rho;/g, 'ρ');
str = str.replace(/&sigmaf;/g, 'ς');
str = str.replace(/&sigma;/g, 'σ');
str = str.replace(/&tau;/g, 'τ');
str = str.replace(/&upsilon;/g, 'υ');
str = str.replace(/&phi;/g, 'φ');
str = str.replace(/&chi;/g, 'χ');
str = str.replace(/&psi;/g, 'ψ');
str = str.replace(/&omega;/g, 'ω');
str = str.replace(/&thetasym;/g, 'ϑ');
str = str.replace(/&upsih;/g, 'ϒ');
str = str.replace(/&piv;/g, 'ϖ');
str = str.replace(/&middot;/g, '·');
return str;
}
function strcharacterDiscode(str) {
// 加入常用解析
str = str.replace(/&nbsp;/g, ' ');
str = str.replace(/&ensp;/g, '');
str = str.replace(/&emsp;/g, ' ');
str = str.replace(/&quot;/g, "'");
str = str.replace(/&amp;/g, '&');
str = str.replace(/&lt;/g, '<');
str = str.replace(/&gt;/g, '>');
str = str.replace(/&#8226;/g, '•');
return str;
}
// HTML 支持的其他实体
function strOtherDiscode(str) {
str = str.replace(/&OElig;/g, 'Œ');
str = str.replace(/&oelig;/g, 'œ');
str = str.replace(/&Scaron;/g, 'Š');
str = str.replace(/&scaron;/g, 'š');
str = str.replace(/&Yuml;/g, 'Ÿ');
str = str.replace(/&fnof;/g, 'ƒ');
str = str.replace(/&circ;/g, 'ˆ');
str = str.replace(/&tilde;/g, '˜');
str = str.replace(/&ensp;/g, '');
str = str.replace(/&emsp;/g, '');
str = str.replace(/&thinsp;/g, '');
str = str.replace(/&zwnj;/g, '');
str = str.replace(/&zwj;/g, '');
str = str.replace(/&lrm;/g, '');
str = str.replace(/&rlm;/g, '');
str = str.replace(/&ndash;/g, '');
str = str.replace(/&mdash;/g, '—');
str = str.replace(/&lsquo;/g, '');
str = str.replace(/&rsquo;/g, '');
str = str.replace(/&sbquo;/g, '');
str = str.replace(/&ldquo;/g, '“');
str = str.replace(/&rdquo;/g, '”');
str = str.replace(/&bdquo;/g, '„');
str = str.replace(/&dagger;/g, '†');
str = str.replace(/&Dagger;/g, '‡');
str = str.replace(/&bull;/g, '•');
str = str.replace(/&hellip;/g, '…');
str = str.replace(/&permil;/g, '‰');
str = str.replace(/&prime;/g, '');
str = str.replace(/&Prime;/g, '″');
str = str.replace(/&lsaquo;/g, '');
str = str.replace(/&rsaquo;/g, '');
str = str.replace(/&oline;/g, '‾');
str = str.replace(/&euro;/g, '€');
str = str.replace(/&trade;/g, '™');
str = str.replace(/&larr;/g, '←');
str = str.replace(/&uarr;/g, '↑');
str = str.replace(/&rarr;/g, '→');
str = str.replace(/&darr;/g, '↓');
str = str.replace(/&harr;/g, '↔');
str = str.replace(/&crarr;/g, '↵');
str = str.replace(/&lceil;/g, '⌈');
str = str.replace(/&rceil;/g, '⌉');
str = str.replace(/&lfloor;/g, '⌊');
str = str.replace(/&rfloor;/g, '⌋');
str = str.replace(/&loz;/g, '◊');
str = str.replace(/&spades;/g, '♠');
str = str.replace(/&clubs;/g, '♣');
str = str.replace(/&hearts;/g, '♥');
str = str.replace(/&diams;/g, '♦');
str = str.replace(/&#39;/g, "'");
return str;
}
function strDiscode(str) {
str = strNumDiscode(str);
str = strGreeceDiscode(str);
str = strcharacterDiscode(str);
str = strOtherDiscode(str);
return str;
}
function urlToHttpUrl(url, domain) {
if (/^\/\//.test(url)) {
return `https:${url}`;
} else if (/^\//.test(url)) {
return `https://${domain}${url}`;
}
return url;
}
export default {
strDiscode,
urlToHttpUrl,
};

View File

@@ -0,0 +1,102 @@
## uParse 适用于 uni-app/mpvue 的富文本解析组件
> 支持 Html、Markdown 解析Fork自: [mpvue-wxParse](https://github.com/F-loat/mpvue-wxParse)
## 属性
| 名称 | 类型 | 默认值 | 描述 |
| -----------------|--------------- | ------------- | ---------------- |
| loading | Boolean | false | 数据加载状态 |
| className | String | — | 自定义 class 名称 |
| content | String | — | 渲染内容 |
| noData | String | 数据不能为空 | 空数据时的渲染展示 |
| startHandler | Function | 见源码 | 自定义 parser 函数 |
| endHandler | Function | null | 自定义 parser 函数 |
| charsHandler | Function | null | 自定义 parser 函数 |
| imageProp | Object | 见下文 | 图片相关参数 |
### 自定义 parser 函数具体介绍
* 传入的参数为当前节点 `node` 对象及解析结果 `results` 对象,例如 `startHandler(node, results)`
* 无需返回值,通过对传入的参数直接操作来完成需要的改动
* 自定义函数会在原解析函数处理之后执行
### imageProp 对象具体属性
| 名称 | 类型 | 默认值 | 描述 |
| -----------------|--------------- | ------------- | ------------------ |
| mode | String | 'aspectFit' | 图片裁剪、缩放的模式 |
| padding | Number | 0 | 图片内边距 |
| lazyLoad | Boolean | false | 图片懒加载 |
| domain | String | '' | 图片服务域名 |
## 事件
| 名称 | 参数 | 描述 |
| -----------------|----------------- | ---------------- |
| preview | 图片地址,原始事件 | 预览图片时触发 |
| navigate | 链接地址,原始事件 | 点击链接时触发 |
## 基本使用方法
``` vue
<template>
<div>
<u-parse :content="article" @preview="preview" @navigate="navigate" />
</div>
</template>
<script>
import uParse from '@/components/u-parse/u-parse.vue'
export default {
components: {
uParse
},
data () {
return {
article: '<div>我是HTML代码</div>'
}
},
methods: {
preview(src, e) {
// do something
},
navigate(href, e) {
// do something
}
}
}
</script>
<style>
@import url("@/components/u-parse/u-parse.css");
</style>
```
## 渲染 Markdown
> 先将 markdown 转换为 html 即可
```
npm install marked
```
``` js
import marked from 'marked'
import uParse from '@/components/u-parse/u-parse.vue'
export default {
components: {
uParse
},
data () {
return {
article: marked(`#hello, markdown!`)
}
}
}
```

View File

@@ -0,0 +1,232 @@
/**
* author: Di (微信小程序开发工程师)
* organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
* 垂直微信小程序开发交流社区
*
* github地址: https://github.com/icindy/wxParse
*
* for: 微信小程序富文本解析
* detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
*/
.wxParse {
width: 100%;
font-family: Helvetica, sans-serif;
font-size: 30upx;
color: #666;
line-height: 1.8;
}
.wxParse view {
word-break: hyphenate;
}
.wxParse .inline {
display: inline;
margin: 0;
padding: 0;
}
.wxParse .div {
margin: 0;
padding: 0;
}
.wxParse .h1 .text {
font-size: 2em;
margin: 0.67em 0;
}
.wxParse .h2 .text {
font-size: 1.5em;
margin: 0.83em 0;
}
.wxParse .h3 .text {
font-size: 1.17em;
margin: 1em 0;
}
.wxParse .h4 .text {
margin: 1.33em 0;
}
.wxParse .h5 .text {
font-size: 0.83em;
margin: 1.67em 0;
}
.wxParse .h6 .text {
font-size: 0.67em;
margin: 2.33em 0;
}
.wxParse .h1 .text,
.wxParse .h2 .text,
.wxParse .h3 .text,
.wxParse .h4 .text,
.wxParse .h5 .text,
.wxParse .h6 .text,
.wxParse .b,
.wxParse .strong {
font-weight: bolder;
}
.wxParse .p {
margin: 1em 0;
}
.wxParse .i,
.wxParse .cite,
.wxParse .em,
.wxParse .var,
.wxParse .address {
font-style: italic;
}
.wxParse .pre,
.wxParse .tt,
.wxParse .code,
.wxParse .kbd,
.wxParse .samp {
font-family: monospace;
}
.wxParse .pre {
overflow: auto;
background: #f5f5f5;
padding: 16upx;
white-space: pre;
margin: 1em 0upx;
}
.wxParse .code {
display: inline;
background: #f5f5f5;
}
.wxParse .big {
font-size: 1.17em;
}
.wxParse .small,
.wxParse .sub,
.wxParse .sup {
font-size: 0.83em;
}
.wxParse .sub {
vertical-align: sub;
}
.wxParse .sup {
vertical-align: super;
}
.wxParse .s,
.wxParse .strike,
.wxParse .del {
text-decoration: line-through;
}
.wxParse .strong,
.wxParse .s {
display: inline;
}
.wxParse .a {
color: deepskyblue;
}
.wxParse .video {
text-align: center;
margin: 22upx 0;
}
.wxParse .video-video {
width: 100%;
}
.wxParse .img {
display: inline-block;
width: 0;
height: 0;
max-width: 100%;
overflow: hidden;
}
.wxParse .blockquote {
margin: 10upx 0;
padding: 22upx 0 22upx 22upx;
font-family: Courier, Calibri, "宋体";
background: #f5f5f5;
border-left: 6upx solid #dbdbdb;
}
.wxParse .blockquote .p {
margin: 0;
}
.wxParse .ul, .wxParse .ol {
display: block;
margin: 1em 0;
padding-left: 33upx;
}
.wxParse .ol {
list-style-type: disc;
}
.wxParse .ol {
list-style-type: decimal;
}
.wxParse .ol>weixin-parse-template,.wxParse .ul>weixin-parse-template {
display: list-item;
align-items: baseline;
text-align: match-parent;
}
.wxParse .ol>.li,.wxParse .ul>.li {
display: list-item;
align-items: baseline;
text-align: match-parent;
}
.wxParse .ul .ul, .wxParse .ol .ul {
list-style-type: circle;
}
.wxParse .ol .ol .ul, .wxParse .ol .ul .ul, .wxParse .ul .ol .ul, .wxParse .ul .ul .ul {
list-style-type: square;
}
.wxParse .u {
text-decoration: underline;
}
.wxParse .hide {
display: none;
}
.wxParse .del {
display: inline;
}
.wxParse .figure {
overflow: hidden;
}
.wxParse .table {
width: 100%;
}
.wxParse .thead, .wxParse .tfoot, .wxParse .tr {
display: flex;
flex-direction: row;
}
.wxParse .tr {
width:100%;
display: flex;
border-right: 2upx solid #e0e0e0;
border-bottom: 2upx solid #e0e0e0;
}
.wxParse .th,
.wxParse .td {
display: flex;
width: 1276upx;
overflow: auto;
flex: 1;
padding: 11upx;
border-left: 2upx solid #e0e0e0;
}
.wxParse .td:last {
border-top: 2upx solid #e0e0e0;
}
.wxParse .th {
background: #f0f0f0;
border-top: 2upx solid #e0e0e0;
}

View File

@@ -0,0 +1,118 @@
<!--**
* forked fromhttps://github.com/F-loat/mpvue-wxParse
*
* github地址: https://github.com/dcloudio/uParse
*
* for: uni-app框架下 富文本解析
*/-->
<template>
<!--基础元素-->
<div class="wxParse" :class="className" v-if="!loading">
<block v-for="(node,index) of nodes" :key="index">
<wxParseTemplate :node="node" />
</block>
</div>
</template>
<script>
import HtmlToJson from './libs/html2json';
import wxParseTemplate from './components/wxParseTemplate0';
export default {
name: 'wxParse',
props: {
loading: {
type: Boolean,
default: false,
},
className: {
type: String,
default: '',
},
content: {
type: String,
default: '',
},
noData: {
type: String,
default: '<div style="color: red;">数据不能为空</div>',
},
startHandler: {
type: Function,
default() {
return (node) => {
node.attr.class = null;
node.attr.style = null;
};
},
},
endHandler: {
type: Function,
default: null,
},
charsHandler: {
type: Function,
default: null,
},
imageProp: {
type: Object,
default() {
return {
mode: 'aspectFit',
padding: 0,
lazyLoad: false,
domain: '',
};
},
},
},
components: {
wxParseTemplate,
},
data() {
return {
imageUrls: [],
};
},
computed: {
nodes() {
const {
content,
noData,
imageProp,
startHandler,
endHandler,
charsHandler,
} = this;
const parseData = content || noData;
const customHandler = {
start: startHandler,
end: endHandler,
chars: charsHandler,
};
const results = HtmlToJson(parseData, customHandler, imageProp, this);
this.imageUrls = results.imageUrls;
console.log(results)
return results.nodes;
},
},
methods: {
navigate(href, $event) {
this.$emit('navigate', href, $event);
},
preview(src, $event) {
if (!this.imageUrls.length) return;
wx.previewImage({
current: src,
urls: this.imageUrls,
});
this.$emit('preview', src, $event);
},
removeImageUrl(src) {
const { imageUrls } = this;
imageUrls.splice(imageUrls.indexOf(src), 1);
},
},
};
</script>

View File

@@ -0,0 +1,121 @@
<template>
<!-- 顶部导航栏 -->
<view class="search-bar-container">
<view class="search-box" :style="{marginTop:searchBarTop + 'px',height:searchBarHeight + 'px'}">
<view class="top-left">
<view class="back-button" hover-class="back-button-active" @click="goBack">
<u-icon name="arrow-left" color="#fff;" />
</view>
<view class="search-input">
<u-input v-if="!readOnly" v-model="queryParamF" :focus="true" placeholder="搜索优质产品"
prefixIcon="search" :border="false" style="background-color: #fff;border: none;"
confirm-type="go" @confirm="goSearch(queryParamF)" />
<view v-else style="width: 360rpx;padding: 10rpx 20rpx;display: flex;align-items: center;"
@click="goSearch">
<u-icon name="search" color="#969696" size="22"></u-icon>
<text
style="margin-left:10rpx;font-size: 30rpx;font-family: PingFangSC-Regular, PingFang SC;font-weight: 400;color: #969696;line-height: 37rpx;">搜索优质商品</text>
</view>
<view class="search-btn" @click="goSearch">搜索</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: "searchBar",
props: {
searchBarTop: {
//搜索栏的外边框高度单位px
type: Number,
default: 30
},
searchBarHeight: {
//搜索栏的高度单位px
type: Number,
default: 30
},
queryParam: {
type: String,
default: null
},
readOnly: {
type: Boolean,
default: false
}
},
data() {
return {
queryParamF: ''
}
},
watch: {
queryParam: {
handler(val) {
this.queryParamF = this.queryParam || ''
},
immediate: true
}
},
methods: {
goSearch(value) {
if (!this.queryParamF && value) {
this.queryParamF = value
}
if (this.readOnly) {
this.$emit('navigate')
return
}
this.$emit('search', this.queryParamF)
},
goBack() {
this.$emit('back')
}
}
}
</script>
<style lang="less">
.search-bar-container {
position: fixed;
top: 0;
left: 0;
// z-index: 999;
width: 100%;
background-color: #12CA64;
.search-box {
margin: 10rpx 10rpx;
display: flex;
align-items: center;
.top-left {
width: calc(100% - 200rpx);
display: flex;
justify-content: space-around;
align-items: center;
height: 100%;
.search-input {
display: flex;
border: 2rpx solid #fff;
background-color: #fff;
border-radius: 50rpx;
height: 100%;
margin-left: 10rpx;
.search-btn {
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #3E3E3E;
line-height: 64rpx;
margin-right: 18rpx;
}
}
}
}
}
</style>

View File

@@ -2,8 +2,12 @@ import App from './App'
//引入uView-ui组件库注意这两行要放在 import Vue 之后)
import uView from 'uview-ui'
import { apiService, toast } from "./service/request.js"
Vue.use(uView)
Vue.prototype.$apiServe = apiService
Vue.prototype.$toast= toast
// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false

View File

@@ -1,28 +1,30 @@
{
"name" : "shitong-app",
"appid" : "",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
"name": "shitong-app",
"appid": "__UNI__807D381",
"description": "",
"versionName": "1.0.0",
"versionCode": "100",
"transformPx": false,
/* 5+App */
"app-plus" : {
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
"app-plus": {
"usingComponents": true,
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
},
/* */
"modules" : {},
"modules": {
"Share": {}
},
/* */
"distribute" : {
"distribute": {
/* android */
"android" : {
"permissions" : [
"android": {
"permissions": [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
@@ -41,33 +43,41 @@
]
},
/* ios */
"ios" : {},
"ios": {},
/* SDK */
"sdkConfigs" : {}
"sdkConfigs": {
"share": {
"weixin": {
"appid": "wx8da30ba464a770ba",
"UniversalLinks": ""
}
}
}
}
},
/* */
"quickapp" : {},
"quickapp": {},
/* */
"mp-weixin" : {
"appid" : "wxcd04cc6e99e18009",
"setting" : {
"urlCheck" : false,
"es6" : false
"mp-weixin": {
"appid": "wx8da30ba464a770ba",
"setting": {
"urlCheck": false,
"es6": false,
"postcss": false
},
"usingComponents" : true
"usingComponents": true
},
"mp-alipay" : {
"usingComponents" : true
"mp-alipay": {
"usingComponents": true
},
"mp-baidu" : {
"usingComponents" : true
"mp-baidu": {
"usingComponents": true
},
"mp-toutiao" : {
"usingComponents" : true
"mp-toutiao": {
"usingComponents": true
},
"uniStatistics" : {
"enable" : false
"uniStatistics": {
"enable": false
},
"vueVersion" : "2"
"vueVersion": "2"
}

24
package-lock.json generated
View File

@@ -1,27 +1,13 @@
{
"name": "shitong-app",
"name": "pupil",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"dependencies": {
"uview-ui": "^2.0.35"
}
},
"node_modules/uview-ui": {
"version": "2.0.35",
"resolved": "https://registry.npmmirror.com/uview-ui/-/uview-ui-2.0.35.tgz",
"integrity": "sha512-OfMttN3XkHvQosXfd8bjz8ASTvypPoGzBWmQZBJ871bYMCA7t2bDFPlzjbxUj/5ykAjKnZ8zMUapSwSisVt99g==",
"engines": {
"HBuilderX": "^3.1.0"
}
}
},
"lockfileVersion": 1,
"dependencies": {
"uview-ui": {
"version": "2.0.35",
"resolved": "https://registry.npmmirror.com/uview-ui/-/uview-ui-2.0.35.tgz",
"integrity": "sha512-OfMttN3XkHvQosXfd8bjz8ASTvypPoGzBWmQZBJ871bYMCA7t2bDFPlzjbxUj/5ykAjKnZ8zMUapSwSisVt99g=="
"version": "2.0.36",
"resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.36.tgz",
"integrity": "sha512-ASSZT6M8w3GTO1eFPbsgEFV0U5UujK+8pTNr+MSUbRNcRMC1u63DDTLJVeArV91kWM0bfAexK3SK9pnTqF9TtA=="
}
}
}

View File

@@ -1,5 +1,5 @@
{
"dependencies": {
"uview-ui": "^2.0.35"
"uview-ui": "^2.0.36"
}
}

View File

@@ -0,0 +1,65 @@
<template>
<view>
<myForm ref="nameAndphone"></myForm>
<view style="height: 168rpx;"></view>
<u-button type="success" text="确定" color="#0EBB5B" @click="handleSureClick()"></u-button>
<u-modal :show="showM" closeOnClickOverlay="false" confirmText="确定" @confirm="confirm">
<rich-text :nodes="content"></rich-text>
</u-modal>
</view>
</template>
<script>
export default {
data() {
return {
name: '',
phone: '',
showM: false,
content: `您的申请已提交<br>
请静待人工审核`
}
},
methods: {
// handleSureClick() {
// let name = this.$refs.nameAndphone.model.userInfo.name
// let phone = this.$refs.nameAndphone.model.userInfo.phone
// if (!/^1[3456789]\d{9}$/.test(phone)) {
// this.$toast.warn('请输入正确的手机号')
// return false
// }
// // this.$apiServe.bindComponyAndUpdate({
// // uid: 1,
// // type: 1,
// // companyName: name,
// // companyPhone: phone
// // }).then(res => {
// // console.log('绑定公司', res.data);
// // if (res.data.code == 20003) {
// // this.showM = true
// // } else if (res.data.code == 20005) {
// // this.$toast.warn('请完善数据')
// // }
// // }).finally(_ => {})
// },
// confirm() {
// uni.reLaunch({
// url: '/pages/my/my'
// })
// }
}
}
</script>
<style lang="scss">
.u-button {
width: 644rpx !important;
height: 86rpx !important;
background: #0EBB5B;
border-radius: 20rpx !important;
}
.u-modal__button-group__wrapper--hover {
background: #0EBB5B !important;
}
</style>

View File

@@ -0,0 +1,16 @@
<template>
<view>
<productsBtn :type="2" ref="browseHistory"></productsBtn>
</view>
</template>
<script>
export default {
data() {
return {
type: ''
}
},
methods: {}
}
</script>

View File

@@ -0,0 +1,116 @@
<template>
<view>
<view class="change_avatar">
<u-avatar :src="avatar" size="140rpx" shape="circle" @click="changeAvatar()"></u-avatar>
</view>
<view>
<u--form labelPosition="left" :model="model">
<u-form-item label="修改昵称" prop="userInfo.name" borderBottom>
<u--input v-model="model.userInfo.name" border="none" placeholder="请输入您的昵称"
placeholderStyle="color: #CCCCCC;font-size: 24rpx;"></u--input>
</u-form-item>
</u--form>
<view style="height: 230rpx;"></view>
<u-button type="success" text="确定" color="#0EBB5B" @click="handleSubmit()"></u-button>
</view>
</view>
</template>
<script>
import {
apiService
} from '../../service/request'
export default {
data() {
return {
avatar: '',
avatarUrl: '',
model: {
userInfo: {
name: ''
},
}
}
},
onLoad() {
this.getUser()
},
methods: {
//获取头像昵称
getUser() {
this.$apiServe.getUser().then(res => {
var data = res.data.data
console.log('头像昵称', res);
if (data) {
this.avatar = uni.getStorageSync('img_url') + data.avatar
this.avatarUrl = '/' + data.avatar
this.model.userInfo.name = data.nickname
}
}).finally(_ => {})
},
updatePromise(filePath) {
return new Promise((resolve, reject) => {
const token = uni.getStorageSync('loginToken')
const a = uni.uploadFile({
url: apiService.uploadImgUrl,
filePath: filePath,
name: 'file',
header: {
"Content-Type": "multipart/form-data",
'Authorization': token
},
success: (res) => {
resolve(JSON.parse(res.data).data.url)
}
});
})
},
//点击头像修改
changeAvatar() {
uni.chooseImage({ // 从本地相册选择图片或使用相机拍照。
count: 1, //默认选择1张图片
sizeType: ['original', 'compressed'], //original 原图compressed 压缩图,默认二者都有
success: (res) => {
// console.log(res.tempFilePaths[0]); //成功则返回图片的本地文件路径列表 tempFilePaths
this.avatar = res.tempFilePaths[0] //更新本地浏览头像图片
if (res.tempFilePaths[0]) {
const result = this.updatePromise(res.tempFilePaths[0]) //上传图片
result.then(value => {
this.avatarUrl = '/' + value
})
}
}
});
},
//提交头像和昵称
handleSubmit() {
this.$apiServe.updateUser({
nickname: this.model.userInfo.name,
avatar: this.avatarUrl
}).then(res => {
console.log('修改头像昵称==', res);
this.$toast.success(res.data.msg)
uni.reLaunch({
url: '/pages/my/my'
})
}).finally(_ => {})
}
}
}
</script>
<style lang="scss">
.change_avatar {
display: flex;
justify-content: center;
align-items: center;
margin: 60rpx 0;
}
.u-button {
width: 644rpx !important;
height: 86rpx !important;
background: #0EBB5B;
border-radius: 20rpx !important;
}
</style>

View File

@@ -0,0 +1,133 @@
<template>
<view>
<u-navbar :autoBack="true" title="会员中心"></u-navbar>
<u--image src="/static/my/wo_icon_hyzxbj.png" width="750rpx" height="349rpx" :lazy-load="true">
</u--image>
<myAvatar ref="myavatar" :center="show"></myAvatar>
<view style="height: 56rpx;"></view>
<myForm ref="nameAndphone"></myForm>
<view class="commitment">
{{commitment}}
</view>
<u-button type="success" :text="btnText" color="#0EBB5B" @click="handleSureClick()" :disabled="btnDisabled">
</u-button>
<u-modal :show="showM" closeOnClickOverlay="false" confirmText="确定" @confirm="confirm">
<rich-text :nodes="content"></rich-text>
</u-modal>
</view>
</template>
<script>
export default {
data() {
return {
name: '',
phone: '',
showM: false,
btnText: '升级VIP',
btnDisabled: false,
//部分产品无权限访问需升级VIP
needAsk: '',
//会员中心的用户名旁边不显示edit图标
show: false,
content: `请保持手机畅通<br>
客服会及时联系您`,
commitment: ''
}
},
onLoad(option) {
if (uni.getStorageSync('member') == 2) {
this.btnText = '升级VIP'
} else if (uni.getStorageSync('member') == 3) {
this.btnText = '升级vip正在审核中'
this.btnDisabled = true
} else if (uni.getStorageSync('member') == 4) {
this.btnText = '升级VIP'
this.btnDisabled = true
}
this.commitment = uni.getStorageSync('agreement')
if (option.ask == 1) {
this.needAsk = option.ask
}
if (uni.getStorageSync('com_name') && uni.getStorageSync('com_mobile')) {
if (uni.getStorageSync('member') == 3 || uni.getStorageSync('member') == 4) {
this.$refs.nameAndphone.model.userInfo.name = uni.getStorageSync('com_name')
this.$refs.nameAndphone.model.userInfo.phone = uni.getStorageSync('com_mobile')
this.$refs.nameAndphone.disabled = true
}
}
},
methods: {
handleSureClick() {
if (this.btnDisabled == false) {
let name = this.$refs.nameAndphone.model.userInfo.name
let phone = this.$refs.nameAndphone.model.userInfo.phone
console.log('name', name);
console.log('phone', phone);
if (!/^1[3456789]\d{9}$/.test(phone)) {
this.$toast.warn('请输入正确的手机号')
return false
}
if (name == '') {
this.$toast.warn('请完善数据')
return false
}
if (name && phone) {
console.log('数据已完善');
this.$apiServe.bindComponyAndUpdate({
uid: uni.getStorageSync('user_id'),
type: 2,
companyName: name,
companyPhone: phone
}).then(res => {
console.log('升级VIP', res.data);
if (res.data.code == 20003) {
this.showM = true
} else if (res.data.code == 20005) {
this.$toast.warn('请完善数据')
}
}).finally(_ => {})
}
}
},
confirm() {
uni.reLaunch({
url: '/pages/my/my'
})
if (this.needAsk == 1) {
uni.reLaunch({
url: '/pages/index/index'
})
}
}
}
}
</script>
<style lang="scss">
.commitment {
font-size: 26rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #C8C8C8;
line-height: 30rpx;
margin: 40rpx 66rpx;
}
.u-button {
width: 644rpx !important;
height: 86rpx !important;
background: #0EBB5B;
border-radius: 20rpx !important;
}
.u-modal__content {
padding: 43rpx 104rpx !important;
text-indent: 14rpx;
}
.u-modal__button-group__wrapper--hover {
background: #0EBB5B !important;
}
</style>

View File

@@ -0,0 +1,17 @@
<template>
<view>
<productsBtn :type="1"></productsBtn>
</view>
</template>
<script>
export default {
data() {
return {
type: '',
isLoad: true,
}
},
methods: {}
}
</script>

View File

@@ -0,0 +1,255 @@
<template>
<view>
<view>
<u-tabs :list="tabsList" :scrollable="false" lineColor="#0A994A" color="#969696"
activeStyle="color:#15CA65;font-weight: bold;" :current="tabCurrent" @change="tabChange"></u-tabs>
</view>
<view v-if="tabCurrent == 0" style="background-color: #fff;">
<view v-for="(item,index) in needsList" :key="index" class="my_line"
style="padding: 24rpx 19rpx;border-bottom: 1px solid #EEEEEE;">
<text class="needs_text">{{item.desc}}</text>
<view class="time_line">
<view class="release_time">
<text v-if="updateIndex==0||updateIndex==1">{{item.update_time}}</text>
<text v-else>{{item.update_time}}</text>
</view>
<view style="display: flex;">
<view class="btn" @click="viewIdeasOrNeeds(item)" v-if="item.status==1">
<u-icon name="eye" color="#15CA65" size="20"></u-icon>
<text class="btn_text">查看</text>
</view>
<view class="btn" @click="editIdeasAndNeeds(item)" v-if="item.status==0">
<u-icon name="edit-pen" color="#15CA65" size="20"></u-icon>
<text class="btn_text">修改</text>
</view>
<view class="btn" @click="deleteIdeasAndNeeds(item)" v-if="item.status==0">
<u-icon name="trash" color="#15CA65" size="20"></u-icon>
<text class="btn_text">删除</text>
</view>
</view>
</view>
</view>
</view>
<view v-if="tabCurrent == 1" style="background-color: #fff;">
<view v-for="(item,index) in ideasList" :key="index" class="my_line"
style="padding: 24rpx 19rpx;border-bottom: 1px solid #EEEEEE;">
<text class="needs_text">{{item.pname}}</text>
<view class="time_line">
<view class="release_time">
<text v-if="updateIndex==0||updateIndex==1">{{item.update_time}}</text>
<text v-else>{{item.update_time}}</text>
</view>
<view style="display: flex;">
<view class="btn" @click="viewIdeasOrNeeds(item)" v-if="item.status==1">
<u-icon name="eye" color="#15CA65" size="20"></u-icon>
<text class="btn_text">查看</text>
</view>
<view class="btn" @click="editIdeasAndNeeds(item)" v-if="item.status==0">
<u-icon name="edit-pen" color="#15CA65" size="20"></u-icon>
<text class="btn_text">修改</text>
</view>
<view class="btn" @click="deleteIdeasAndNeeds(item)" v-if="item.status==0">
<u-icon name="trash" color="#15CA65" size="20"></u-icon>
<text class="btn_text">删除</text>
</view>
</view>
</view>
</view>
</view>
<view style="font-size: 24rpx;color: #A3A3A3;text-align: center;padding: 26rpx 0;"
v-if="needsList.length==0&&tabCurrent == 0">
暂无更多记录</view>
<view style="font-size: 24rpx;color: #A3A3A3;text-align: center;padding: 26rpx 0;"
v-if="ideasList.length==0&&tabCurrent == 1">
暂无更多记录</view>
</view>
</template>
<script>
import {
dateFormatXwDetail
} from '../../utills/date.js'
export default {
data() {
return {
// id: '',
// showM: false,
content: '您确定删除吗?',
tabCurrent: 0,
type: 1,
tabsList: [{
name: '需求发布'
}, {
name: '创意发布'
}],
needsList: [],
ideasList: [],
updateIndex: ''
}
},
onLoad(options) {
if (options && options.index) {
options.index = options.index - 1
this.updateIndex = options.index
this.tabChange(options)
return
}
this.getIdeasAndNeeds()
},
methods: {
//获取创意发布或需求发布
getIdeasAndNeeds() {
this.$apiServe.getIdeasAndNeeds(this.type).then(res => {
let data = res.data.data
console.log('创意需求发布数据', res.data);
for (const item of data) {
item.pub_time = dateFormatXwDetail(item.pub_time)
item.update_time = dateFormatXwDetail(item.update_time)
const imagesList = item.images && item.images.length > 0 ? item.images.split(';') : []
item.images = imagesList.map(item1 => {
item1 = uni.getStorageSync('img_url') + '/' + item1
return item1
})
}
if (this.type == 1) {
this.needsList = data
} else if (this.type == 2) {
this.ideasList = data
}
}).finally(_ => {
})
},
//切换需求发布和创意发布
tabChange(data) {
this.tabCurrent = data.index
if (data.index == 0) {
this.type = 1
} else if (data.index == 1) {
this.type = 2
}
this.getIdeasAndNeeds()
},
//查看需求发布或创意发布
viewIdeasOrNeeds(item) {
const tabCurrent = this.tabCurrent
uni.removeStorage({ //删除Storage
key: 'update_item',
success: () => {
uni.setStorageSync('update_item', item);
uni.reLaunch({
url: '/pages/ideasAndNeeds/ideasAndNeeds?item=update_item' + '&index=' +
tabCurrent + '&view=' + 11
})
}
})
},
//修改我的需求
editIdeasAndNeeds(item) {
const tabCurrent = this.tabCurrent
uni.removeStorage({ //删除Storage
key: 'update_item',
success: () => {
uni.setStorageSync('update_item', item);
uni.reLaunch({
url: '/pages/ideasAndNeeds/ideasAndNeeds?item=update_item' + '&index=' +
tabCurrent
})
}
})
},
//二次确认删除我的需求或创意
deleteIdeasAndNeeds(item) {
var that = this
uni.showModal({
title: '提示',
content: '你确定要删除吗',
success: function(res) {
if (res.confirm) {
that.$apiServe.deleteIdeasAndNeeds(item.id).then(res => {
if (res.data.code == 1) {
that.$toast.warn('删除成功')
}
that.getIdeasAndNeeds()
}).finally(_ => {
})
} else if (res.cancel) {
that.$toast.warn('取消删除')
}
}
})
}
}
}
</script>
<style lang="scss">
.u-modal__content {
padding: 43rpx 104rpx !important;
text-indent: 25rpx;
}
.u-tabs {
margin-bottom: 10rpx;
.u-tabs__wrapper__nav {
background-color: #FFFFFF;
.u-tabs__wrapper__nav__item {
padding: 0 !important;
flex: 1;
}
}
}
.my_line:last-child {
border: none !important;
}
.needs_text {
font-size: 30rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #3E3E3E;
line-height: 42rpx;
-webkit-line-clamp: 2;
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.time_line {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 14rpx;
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
.release_time {
color: #969696;
}
.btn {
display: flex;
align-items: center;
justify-content: center;
margin-left: 40rpx;
.u-icon__icon {
top: 1px !important;
}
.btn_text {
color: #15CA65;
}
}
}
</style>

View File

@@ -0,0 +1,120 @@
<template>
<view>
<view class="xw_content" v-for="(item,index) in cjsList" :key="index" @click="clickCj(item)">
<u--image :src="imgUrl+item.cover" width="112rpx" height="112rpx" :lazy-load="true">
</u--image>
<view class="xw_right">
<view class="xw_title">
{{item.name}}
</view>
<view style="display: flex;">
<!-- <text class="cj_tags" v-for="(tagsItem,tagsIndex) in item.tags" :key="tagsIndex">
{{tagsItem.tag}}
</text> -->
<text class="cj_tags">{{item.tag}}</text>
</view>
</view>
</view>
<view v-if="cjsShow==0" class="no-data">已经到底啦</view>
</view>
</template>
<script>
export default {
data() {
return {
cjsShow: '',
cjsList: [],
imgUrl: '',
pageNum: 1, // 当前页
pageSize: 12, // 每页条数
}
},
onLoad() {
this.imgUrl = uni.getStorageSync('img_url')
this.getCertifiedCj()
},
onReachBottom() {
console.log('触底下拉');
if (this.cjsShow !== 0) {
this.pageNum++
this.getCertifiedCj()
}
},
methods: {
// 获取认证厂家列表
getCertifiedCj() {
this.$apiServe.getCertifiedCj({
pageSize: this.pageSize,
pageNum: this.pageNum
}).then(res => {
console.log('认证厂家', res)
let cjsData = res.data.data
for (const item of cjsData) {
this.cjsShow = item.length
console.log('this.cjsShow', this.cjsShow);
}
this.cjsList = [...this.cjsList, ...res.data.data]
}).finally(_ => {})
},
// 跳转到认证厂家详情页
clickCj(item) {
uni.navigateTo({
url: '../certifiedCjDetail/certifiedCjDetail?id=' + item.id
})
}
}
}
</script>
<style lang="scss">
page {
background: #FFFFFF;
}
.no-data {
text-align: center;
margin-top: 29rpx;
font-size: 20rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #BBBBBB;
line-height: 28rpx;
}
.xw_content {
background: #FFFFFF;
border: 1rpx solid #EEEEEE;
display: flex;
padding: 29rpx 19rpx;
.xw_right {
padding-left: 19rpx;
display: flex;
flex-direction: column;
.xw_title {
font-size: 30rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: bold;
color: #3E3E3E;
line-height: 42rpx;
-webkit-line-clamp: 2;
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.cj_tags {
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #969696;
line-height: 33rpx;
padding-right: 10rpx;
margin-top: 35rpx;
}
}
}
</style>

View File

@@ -0,0 +1,229 @@
<template>
<view>
<u-image :src="imgUrl+detailList.cover" width="750rpx" height="290rpx">
</u-image>
<view class="feature">
<text class="one_title">经营范围及特色</text>
<view class="green_block">
<text class="green_features">{{detailList.desc}}</text>
</view>
</view>
<view class="introduce">
<view class="introduce_title">企业介绍</view>
<text class="business_introduce">{{detailList.content}}</text>
</view>
<view class="show">
<view class="introduce_title">企业展示</view>
<u-grid :border="false" col="4">
<u-grid-item v-for="(listItem,listIndex) in detailList.images" :key="listIndex">
<u--image :src="imgUrl+listItem" width="170rpx" height="170rpx" :lazy-load="true">
</u--image>
</u-grid-item>
</u-grid>
</view>
<view class="footer" @click="showModal()">
<u-icon name="kefu-ermai" color="#fff" size="30rpx"></u-icon>
<text>联系客服</text>
</view>
<u-modal :show="showCall" showCancelButton closeOnClickOverlay="false" confirmText="是" cancelText="否"
@confirm="confirmCall" @cancel="cancelCall">
<view>
<view style="text-indent: 25rpx;">{{mobile}}</view>
<text>是否拨打客服电话</text>
</view>
</u-modal>
<view style="margin:0 20rpx;">
<u-overlay :show="!isLoad">
<login @success="reOnLoad()" @fail="failToLoad()"></login>
</u-overlay>
</view>
</view>
</template>
<script>
import login from 'pages/my/login/login'
export default {
components: {
login
},
data() {
return {
id: '',
detailList: [],
imgUrl: '',
isLoad: true,
showCall: false,
mobile: '',
}
},
onLoad(option) {
this.imgUrl = uni.getStorageSync('img_url')
this.id = option.id
this.getCertifiedCjDetail()
this.getCsTel()
// if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
// this.isLoad = false
// return
// }
// this.isLoad = true
},
methods: {
//获取客服电话
getCsTel() {
this.$apiServe.getCsTel().then(res => {
this.mobile = res.data.data.cs_tel
}).finally(_ => {})
},
//获取认证厂家详情
getCertifiedCjDetail() {
this.$apiServe.getCertifiedCjDetail(this.id).then(res => {
if (res.data.code === -1) {
this.isLoad = false
}
console.log('认证厂家详情页', res.data)
if (res.data.data) {
let data = res.data.data
if (data.images) {
data.images = data.images.split(';')
}
this.detailList = data
} else {
this.$toast.warn('没有更多详情了')
}
}).finally(_ => {})
},
reOnLoad() {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.$toast.warn('登录失败请重试')
this.isLoad = false
return
}
this.isLoad = true
this.getCertifiedCjDetail()
},
failToLoad() {
uni.reLaunch({
url: '/pages/index/index'
})
},
// 联系客服模态框
showModal() {
this.showCall = true
},
confirmCall() {
this.showCall = false
let phone = this.mobile
phone = phone.toString()
uni.makePhoneCall({
phoneNumber: phone,
success: function() {
console.log('拨打电话成功');
},
fail() {
console.log('打电话失败了');
}
})
},
cancelCall() {
this.showCall = false
}
}
}
</script>
<style lang="scss">
.u-modal__content {
padding: 43rpx 104rpx !important;
text-indent: 25rpx;
}
.feature {
padding: 20rpx 16rpx;
background-color: #fff;
margin-bottom: 30rpx;
.one_title {
font-size: 28rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: bold;
color: #3E3E3E;
line-height: 40rpx;
}
.green_block {
background-color: #16CA65;
margin-top: 20rpx;
height: 139rpx;
border-radius: 6rpx;
.green_features {
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
line-height: 33rpx;
margin-left: 20rpx;
margin-top: 14rpx;
}
}
}
.introduce {
padding: 20rpx 16rpx;
background-color: #fff;
margin-bottom: 30rpx;
.introduce_title {
font-size: 28rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: bold;
color: #3E3E3E;
line-height: 40rpx;
margin-bottom: 10rpx;
}
.business_introduce {
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
line-height: 33rpx;
}
}
.show {
padding: 20rpx 16rpx;
background-color: #fff;
margin-bottom: 78rpx;
.u-grid {
padding-top: 22rpx !important;
}
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
height: 100rpx;
background: #0EBB5B;
display: flex;
flex-direction: column;
justify-content: center;
align-content: center;
text-align: center;
.u-icon {
justify-content: center;
}
text {
font-size: 20rpx;
font-family: MicrosoftYaHei-Bold, MicrosoftYaHei;
font-weight: bold;
color: #FFFFFF;
line-height: 26rpx;
}
}
</style>

View File

@@ -0,0 +1,30 @@
<template>
<view>
<productsByThumb ref="productsByThumb" :reportPageSize="6" @getThumbLength="getThumbLength"></productsByThumb>
<view style="font-size: 24rpx;color: #A3A3A3;text-align: center;padding: 26rpx 0;"
v-show="reachBottomLength===0||reachBottomLength<=4">
没有更多数据了</view>
</view>
</template>
<script>
export default {
data() {
return {
reachBottomLength: '',
reportPageSize: ''
}
},
onReachBottom() {
this.$refs.productsByThumb.pageSize = 4
this.$refs.productsByThumb.pageNum++
this.$refs.productsByThumb.getProductsByThumb()
},
methods: {
//获取按上架时间排列的产品列表length
getThumbLength(e) {
this.reachBottomLength = e
}
}
}
</script>

View File

@@ -0,0 +1,97 @@
<template>
<view style="padding: 12rpx 16rpx;">
<view class="xwD_title">
{{detailList.title}}
</view>
<view style="display: flex;">
<text class="xwD_time">
{{detailList.pub_time}}
</text>
<text class="xwD_time xwD_place">
{{detailList.pub_name}}
</text>
</view>
<view class="xwD_content">
<u-parse :content="detailList.content" @preview="preview" @navigate="navigate"></u-parse>
</view>
<!-- <u-modal :show="showM" closeOnClickOverlay="false" confirmText="确定" @confirm="confirm">
<rich-text :nodes="content"></rich-text>
</u-modal> -->
</view>
</template>
<script>
import {
dateFormatXwDetail
} from '../../utills/date.js'
export default {
data() {
return {
id: '',
detailList: [],
// showM: false,
// content: `该新闻已下架!`,
}
},
onLoad(option) {
this.id = option.id
this.getNewsDetail()
},
methods: {
//获取行业新闻详情
getNewsDetail() {
this.$apiServe.getNewsDetail(this.id).then(res => {
console.log('新闻详情', res.data);
if (res.data.code == 0 || res.data.msg == "该新闻已下架!") {
this.$toast.warn('该新闻已下架!')
// this.showM = true
}
if (res.data.data) {
let detail = res.data.data
detail.pub_time = dateFormatXwDetail(detail.pub_time)
this.detailList = res.data.data
}
}).finally(_ => {})
},
// confirm() {
// uni.reLaunch({
// url: '/pages/index/index'
// })
// }
}
}
</script>
<style lang="scss">
page {
background-color: #fff;
}
.xwD_title {
font-size: 38rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: bold;
color: #3E3E3E;
line-height: 53rpx;
letter-spacing: 1rpx;
}
.xwD_time {
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #969696;
line-height: 33rpx;
margin-top: 6rpx;
}
.xwD_place {
padding-left: 20rpx;
}
.xwD_content {
margin-top: 38rpx;
// border: none;
}
</style>

View File

@@ -0,0 +1,89 @@
<template>
<view>
<view class="xw_content" v-for="(item,index) in newsList" :key="index" @click="clickNews(item)">
<u--image :src="imgUrl+item.cover" width="192rpx" height="122rpx" :lazy-load="true">
</u--image>
<view class="xw_right">
<view class="xw_title">
{{item.title}}
</view>
<view style="display: flex;">
<text class="xw_time">
{{item.pub_time_str}}
</text>
<text class="xw_time xw_place">
{{item.pub_name}}
</text>
</view>
</view>
</view>
<view v-if="newsShow==0" class="no-data">已经到底啦</view>
</view>
</template>
<script>
import {
dateFormat
} from '../../utills/date.js'
export default {
data() {
return {
newsShow: '',
imgUrl: '',
newsList: [],
pageNum: 1, // 当前页
pageSize: 12, // 每页条数
}
},
onLoad() {
this.imgUrl = uni.getStorageSync('img_url')
this.getNews()
},
onReachBottom() {
console.log('触底下拉');
if (this.newsShow !== 0) {
this.pageNum++
this.getNews()
}
},
methods: {
getNews() {
this.$apiServe.getNews({
pageSize: this.pageSize,
pageNum: this.pageNum
}).then(res => {
console.log('行业新闻', res.data)
let newsData = res.data.data
for (const item of newsData) {
item.pub_time_str = dateFormat(item.pub_time_str)
this.newsShow = item.length
console.log('this.newsShow', this.newsShow);
}
this.newsList = [...this.newsList, ...newsData]
}).finally(_ => {})
},
// 跳转到新闻详情页
clickNews(item) {
uni.navigateTo({
url: '../newsDetail/newsDetail?id=' + item.id
})
},
}
}
</script>
<style lang="scss">
page {
background: #FFFFFF;
}
.no-data {
text-align: center;
margin-top: 29rpx;
font-size: 20rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #BBBBBB;
line-height: 28rpx;
}
</style>

View File

@@ -0,0 +1,814 @@
<template>
<view :style="{height: windowHeight + 'px', overflow:showMask? 'hidden':'auto'}">
<!-- 顶部导航栏 -->
<view class="top-search">
<customer-searchbar ref="search" :readOnly="true" :search-bar-top="searchBarTop"
:search-bar-height="searchBarHeight" @navigate="navigateToSearch" @back="goBack" />
</view>
<view :style="{marginTop: Number(searchBarTop + searchBarHeight + 2) + 'px',}">
<view>
<view class="category-view">
<view class="left">
<view v-for="(item,index) in categoryList" class="category-item"
@click="changeSelectedCategory(item, index)">
<view>
<view class="icon-box">
<image :src="item.icon" mode="aspectFit" class="icon"
:style="{border: item.active?'2rpx #14CA65 solid':'0',}" />
</view>
<view class="name" :style="{width: item.active?'74px':'126rpx'}">
<u-tag v-if="item.active" :text="item.name" bg-color="#14CA65" color="#fff"
borderColor="#14CA65" shape="circle" />
<text v-else class="no-active">{{item.name}}</text>
</view>
</view>
</view>
</view>
<view class="right" @click="exportView('showMask')">
<tex style="margin-bottom: 10rpx;">全部</tex>
<u-icon size="14" name="/static/category/fl_icon_qb.png"></u-icon>
</view>
</view>
<!-- 类别详情-->
<view id="category-detail" class="category-detail" :style="{height: listDataHeight + 'px'}">
<scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view"
:scroll-top="scrollTop">
<view v-for="(item,index) in tabbar" :key="index" class="u-tab-item"
:class="[menuCurrent==index ? 'u-tab-item-active' : '']" :data-current="index"
@tap.stop="swichMenu(index)">
<text class="title">{{item.name}}</text>
</view>
</scroll-view>
<view class="category-last">
<view class="category-tag-box">
<scroll-view :scroll-x="true" class="left">
<view v-for="(item,index) in tagsList" @click="changeSelectedTag(index)"
class="category-tag">
<view style="padding: 16rpx; border-radius: 10rpx;line-height: 32rpx;"
:style="{color: index === tagCurrent ?'#14CA65':'#666', background: index === tagCurrent ?'#DBFFEB':'#EEEEEE'}">
<text>{{item.name}}</text>
</view>
<!-- <u-tag v-if="index === tagCurrent" :text="item.name" bg-color="#DBFFEB" color="#14CA65" borderColor="#DBFFEB" shape="square" style="width: fit-content;"></u-tag> -->
<!-- <u-tag v-else :text="item.name" bg-color="#EEEEEE" color="#666666" borderColor="#EEEEEE" shape="square" style="width: fit-content;"></u-tag> -->
</view>
</scroll-view>
<view class="right" @click="exportView('featureMask')">
<u-icon size="10" name="/static/category/fl_icon_xl.png"></u-icon>
</view>
</view>
<view class="category-order">
<u-tabs :list="tabsList" :scrollable="false" lineWidth="30" lineColor="#0A994A"
color="#969696"
:activeStyle="{color: '#15CA65', fontWeight: '400', transform: 'scale(1.05)', size:'14px'}"
lineHeight="4" :current="tabCurrent" @change="tabChange"></u-tabs>
</view>
<scroll-view scroll-y class="goods-list" @scrolltolower="reachGoodsBottom">
<block v-for="(item1,index1) in goodsList" :key="index1">
<view class="goods-item" @click="toDetailPage(item1)">
<view class="left">
<view class="image">
<image :src="item1.imageF" mode="scaleToFill"
style="width: 170rpx;height: 100%;"></image>
</view>
<view class="tag">
<view class="tag-content">
<text>{{item1.cate_name}}</text>
</view>
</view>
</view>
<view class="right">
<view class="name">
<text>{{item1.name}}</text>
</view>
<view class="describe">
<text>{{item1.title}}</text>
</view>
<view class="publish-date">
<view class="publish-date-box">
<view
style="width: fit-content; display: inline-block;margin-right:6rpx;">
<u-icon size="14" name="clock" color="#A3A3A3" />
</view>
<text style="margin-right: 6rpx;">发布日期</text>
<text>{{item1.pub_time_str}}</text>
</view>
</view>
<view class="tag">
<template v-if="item1.tagList.length">
<view class="tag-content">
<text>{{ item1.tagList[0] }}</text>
</view>
</template>
<!-- <view v-for="(tagObject, index) in item1.tagList" class="tag-content">
<text>{{ tagObject }}</text>
</view> -->
</view>
</view>
</view>
</block>
</scroll-view>
</view>
</view>
</view>
<view class="bg" bindtap='hideview'
:style="{display: showMask || featureMask ? 'block':'none', marginTop: Number(searchBarTop + searchBarHeight + 4) + 'px', height: Number(windowHeight - searchBarTop - searchBarHeight - 4) + 'px',}"
@click="showMask = false, featureMask = false"></view>
<view class="show" bindtap='hideview'
:style="{display: showMask || featureMask ? 'block':'none', top: Number(searchBarTop + searchBarHeight + 4) + 'px',}">
<view v-if="showMask" class="category-view-all">
<view v-for="(item,index) in categoryList" @click="changeSelectedCategory(item,index)"
style="width: 20%;margin-bottom: 20rpx;">
<view class="category-item">
<view class="icon-box">
<image :src="item.icon" mode="aspectFit" class="icon"
:style="{border: item.active?'2rpx #14CA65 solid':'0',}" />
</view>
<view class="name">
<view v-if="item.active" class="active">
<text>{{item.name}}</text>
</view>
<text v-else class="no-active">{{item.name}}</text>
</view>
</view>
</view>
</view>
<view v-if="featureMask" class="category-view-all" style="align-content: start;">
<view v-for="(item,index) in tagsList" @click="changeSelectedTag(index)" class="category-tag">
<view style="padding: 16rpx; border-radius: 10rpx;line-height: 32rpx;"
:style="{color: index === tagCurrent ?'#14CA65':'#666', background: index === tagCurrent ?'#DBFFEB':'#EEEEEE'}">
<text>{{item.name}}</text>
</view>
<!-- <u-tag v-if="index === tagCurrent" :text="item.name" bg-color="#DBFFEB" color="#14CA65" borderColor="#DBFFEB" shape="square" style="width: fit-content;"></u-tag> -->
<!-- <u-tag v-else :text="item.name" bg-color="#EEEEEE" color="#666666" borderColor="#EEEEEE" shape="square" style="width: fit-content;"></u-tag> -->
</view>
</view>
<view class="arrow-up" @click="showMask = false, featureMask = false">
<text style="margin-right: 4rpx;">点击收起</text>
<u-icon size="15" name="arrow-up-fill"></u-icon>
</view>
</view>
<!-- <uni-popup ref="popup" type="center" :animation="false">中间弹出 Popup</uni-popup> -->
<!-- <u-popup v-model="showMask" mode="top" border-radius="14">
<view style="margin-top: 200rpx;">出淤泥而不染濯清涟而不妖</view>
</u-popup> -->
</view>
</view>
</template>
<script>
export default {
data() {
return {
searchBarTop: 0, //搜索栏的外边框高度单位px
searchBarHeight: 0, //搜索栏的高度单位px
windowHeight: 1,
listDataHeight: 1, // 剩余高度
queryParam: '',
showMask: false,
featureMask: false,
categoryList: [],
selectedCategory: 0,
tabbar: [],
goodsParam: {
sortType: 0,
cateId: 0,
// tagIds: 0,
pageSize: 10,
pageNum: 1
},
goodsList: [],
tabsList: [{
name: '上架时间' // 上架时间(改)
}, {
name: '点赞量' // 点赞量(改)
}],
tagsList: [],
scrollTop: 0, //tab标题的滚动条位置
menuCurrent: 0, // 预设当前项的值
menuHeight: 0, // 左边菜单的高度
menuItemHeight: 0, // 左边菜单item的高度
tabCurrent: 0, //分类详情 上架时间, // 左边菜单item的高度
tagCurrent: null, //分类详情 上架时间
imgUrl: '',
isAllData: false
}
},
onLoad(options) {
console.log(options)
const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
this.searchBarTop = menuButtonInfo.top;
this.searchBarHeight = menuButtonInfo.height;
this.imgUrl = uni.getStorageSync('img_url')
this.goodsList = []
this.isAllData = false
this.getCategoryList(options.categoryId)
},
onReady() {
let that = this;
uni.getSystemInfo({ //调用uni-app接口获取屏幕高度
success(res) { //成功回调函数
// windowHeight
that.windowHeight = res.windowHeight //windoHeight为窗口高度主要使用的是这个
let titleH = uni.createSelectorQuery().select("#category-detail"); //想要获取高度的元素名class/id
titleH.boundingClientRect(data => {
let pH = that.windowHeight;
that.listDataHeight = pH - data.top //计算高度:元素高度=窗口高度-元素距离顶部的距离data.top
console.log(that.listDataHeight)
}).exec()
}
})
},
methods: {
//点击goodsItem跳转到详情页
toDetailPage(item1) {
uni.navigateTo({
url: '/pages/detail/productsDetail/productsDetail?id=' + item1.id
})
},
goSearch(param) {
this.queryParam = param
const index = this.recentRecordList.findIndex(item => {
return item === param
})
if (index > -1) {
this.recentRecordList.splice(index, 1)
}
this.recentRecordList.unshift(param)
},
changeSelectedCategory(item, index) {
this.$set(this.categoryList, this.selectedCategory, {
...this.categoryList[this.selectedCategory],
active: false
});
this.$set(this.categoryList, index, {
...this.categoryList[index],
active: true
});
this.selectedCategory = index
this.tabCurrent = 0
this.tagCurrent = null
this.menuCurrent = 0
this.getSeconedCategoryList()
this.showMask = false
},
changeSelectedTag(index) {
if(this.tagCurrent === index) {
this.tagCurrent = null
} else {
this.tagCurrent = index
}
this.featureMask = false
this.getGoodsList(true)
},
// 点击左边的栏目切换
async swichMenu(index) {
if (index == this.menuCurrent) return;
this.menuCurrent = index;
// 如果为0意味着尚未初始化
if (this.menuHeight == 0 || this.menuItemHeight == 0) {
await this.getElRect('menu-scroll-view', 'menuHeight');
await this.getElRect('u-tab-item', 'menuItemHeight');
}
// 将菜单菜单活动item垂直居中
this.scrollTop = index * this.menuItemHeight + this.menuItemHeight / 2 - this.menuHeight / 2;
this.getTagList()
},
// 获取一个目标元素的高度
getElRect(elClass, dataVal) {
new Promise((resolve, reject) => {
const query = uni.createSelectorQuery().in(this);
query.select('.' + elClass).fields({
size: true
}, res => {
// 如果节点尚未生成res值为null循环调用执行
if (!res) {
setTimeout(() => {
this.getElRect(elClass);
}, 10);
return;
}
this[dataVal] = res.height;
}).exec();
})
},
exportView(str) {
if (str === 'showMask') {
this.showMask = true
} else if (str === 'featureMask') {
this.featureMask = true
}
},
tabChange(selectTab) {
console.log(selectTab)
this.tabCurrent = selectTab.index;
this.getGoodsList(true)
},
navigateToSearch() {
uni.navigateTo({
url: '../search/search'
})
},
getCategoryList(selectedCategoryId) {
this.$apiServe.getCategories().then(res => {
this.categoryList = res.data.data.map((item, index) => {
item.icon = this.imgUrl + item.icon
if (selectedCategoryId && selectedCategoryId === item.id) {
item.active = true
this.selectedCategory = index
} else if (selectedCategoryId === null && this.selectedCategory && this
.selectedCategory === index) {
item.active = true
active = true
} else if (selectedCategoryId === null && !this.selectedCategory && !index) {
item.active = true
} else {
item.active = false
}
return item
})
this.getSeconedCategoryList()
}).finally(_ => {})
},
getSeconedCategoryList() {
const data = {
pid: this.categoryList[this.selectedCategory].id
}
this.$apiServe.getCategories(data).then(res => {
this.tabbar = res.data.data.map((item, index) => {
item.icon = this.imgUrl + item.icon
return item
})
this.getTagList()
}).finally(_ => {})
},
getTagList() {
const data = {
pid: 0// this.tabbar[this.menuCurrent].id
}
this.$apiServe.getTags(data).then(res => {
this.tagsList = res.data.data.map((item, index) => {
return item
})
}).finally(_ => {
this.getGoodsList(true)
})
},
getGoodsList(firstPage) {
this.isAllData = false
const data = {
...this.goodsParam,
sortType: this.tabCurrent + 1,
cateId: this.tabbar.length ? this.tabbar[this.menuCurrent].id : 0,
title: this.tagsList.length && (this.tagCurrent || this.tagCurrent === 0) ? this.tagsList[this.tagCurrent].name : ''
// tagIds: this.tagsList.length ? this.tagsList[this.tagCurrent].id : 0
}
if (firstPage) {
this.goodsList = []
this.goodsParam.pageNum = 1
}
this.$apiServe.getProductList(data).then(res => {
if (res.data.data.length > 0) {
res.data.data.map((item, index) => {
item.tagList = item.tags.split(',')
item.imageF = this.imgUrl + item.images
this.goodsList.push(item)
// return item
})
} else {
this.isAllData = true
this.$toast.warn('暂无数据')
}
}).finally(_ => {})
},
reachGoodsBottom() {
console.log('-----触底')
//触底事件
if (!this.isAllData) {
uni.showLoading({
title: '加载中'
});
this.goodsParam.pageNum++
this.getGoodsList(false)
} else {
this.$toast.warn('暂无数据')
}
setTimeout(() => {
uni.hideLoading()
}, 500)
},
goBack() {
uni.navigateBack()
}
},
}
</script>
<style lang="less" scoped>
.top-search {
position: relative;
}
.category-view {
height: fit-content;
background-color: #F6F6F6;
display: flex;
justify-content: space-around;
.left {
width: calc(100% - 60rpx);
padding: 30rpx;
display: flex;
overflow: auto;
// flex-direction: row;
// flex-wrap: wrap;
// align-items: center;
.category-item {
margin-right: 20rpx;
display: flex;
flex-direction: column;
justify-content: center;
.icon-box {
text-align: center;
.icon {
width: 86rpx;
height: 86rpx;
padding: 4rpx;
border-radius: 50%;
}
}
.name {
// width: 126px;
text-align: center;
.no-active {
font-size: 24rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #616161;
line-height: 28rpx;
}
}
}
}
.right {
width: 60rpx;
padding: 20rpx;
background: #F6F6F6;
border-left: 2rpx #F6F6F6 solid;
box-shadow: -2px 0px 4px 0px rgba(218, 218, 218, 0.5);
font-size: 28rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #343434;
line-height: 34rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
}
}
.category-detail {
display: flex;
background-color: #F5F5F5;
.u-tab-view {
width: 210rpx;
height: 100%;
.u-tab-item {
height: 90rpx;
background: #f6f6f6;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
color: #444;
font-weight: 400;
line-height: 1;
.title {
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #343434;
line-height: 40rpx;
}
}
.u-tab-item-active {
position: relative;
color: #000;
font-size: 30rpx;
font-weight: 600;
background: #fff;
border: 2rpx solid #fff;
border-radius: 25% 0 0 0;
.title {
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #14CA65;
line-height: 40rpx;
}
}
.u-tab-item-active::before {
content: "";
position: absolute;
border: 1rpx solid #14CA65;
background-color: #14CA65;
width: 1rpx;
height: 14rpx;
left: 27rpx;
top: 37srpx;
border-radius: 1rpx;
}
}
.category-last {
width: calc(100% - 206rpx);
height: 100%;
.category-tag-box {
background-color: #fff;
height: 110rpx;
display: flex;
border-bottom: 1rpx solid #EEEEEE;
.left {
width: calc(100% - 60rpx);
padding: 12rpx;
white-space: nowrap;
overflow: auto;
line-height: 90rpx;
.category-tag {
margin-right: 15rpx;
width: fit-content;
display: inline-flex;
}
}
.right {
width: 60rpx;
padding: 20rpx;
background: #F6F6F6;
border-left: 2rpx #F6F6F6 solid;
box-shadow: -2px 0px 4px 0px rgba(218, 218, 218, 0.5);
font-size: 28rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #343434;
line-height: 34rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
}
}
.category-order {
width: 100%;
background-color: #fff;
border-bottom: 1rpx solid #EEEEEE;
}
.goods-list {
background-color: #fff;
height: calc(100% - 210rpx);
.goods-item {
padding: 0;
margin-bottom: 10rpx;
display: flex;
background: #FFFFFF;
box-shadow: 0px 2px 3px 0px rgba(169, 169, 169, 0.2);
border-bottom: 1px solid #EEEEEE;
.left {
width: 190rpx;
position: relative;
.image {
padding: 20rpx;
height: calc(100% - 40rpx)
}
.tag {
position: absolute;
top: 26rpx;
right: 0;
float: right;
.tag-content {
padding: 12rpx;
border-radius: 25rpx 0 0 25rpx;
line-height: 14rpx;
background: linear-gradient(135deg, #0DB658 0%, #16DD6D 100%);
color: #fff;
font-size: 20rpx;
width: fit-content;
}
}
}
.right {
padding: 20rpx;
height: calc(100% - 40rpx);
.name {
font-size: 33rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: bold;
color: #E10707;
line-height: 46rpx;
white-space: nowrap;
}
.describe {
font-size: 30rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #3E3E3E;
line-height: 37rpx;
margin: 5rpx 0 10rpx 0;
word-break: break-all;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
/* 这里是超出几行省略 */
-webkit-line-clamp: 2;
overflow: hidden;
}
.publish-date {
color: #A3A3A3;
font-size: 26rpx;
line-height: 30rpx;
margin: 14rpx 0 8rpx 0;
.publish-date-box {
display: flex;
align-items: center;
font-size: 22rpx;
}
}
.tag {
line-height: 60rpx;
// display: flex;
// text-overflow: clip;
// display: -webkit-box;
// -webkit-box-orient: vertical;
// /* 这里是超出几行省略 */
// -webkit-line-clamp: 1;
overflow: hidden;
.tag-content {
display: inline;
padding: 9rpx 17rpx;
border-radius: 25rpx;
line-height: 13rpx;
background-color: #FDD96A;
color: #fff;
font-size: 22rpx;
width: fit-content;
// margin-right: 6rpx;
}
}
}
}
}
}
}
.bg {
display: none;
position: absolute;
top: 0%;
left: 0%;
width: 100%;
background-color: black;
z-index: 1001;
-moz-opacity: 0.7;
opacity: 0.70;
filter: alpha(opacity=70);
}
.show {
display: none;
text-align: center;
position: absolute;
width: calc(100% - 20rpx);
height: fit-content;
padding: 20rpx 10rpx 0 10rpx;
border: 1rpx solid #fff;
background-color: #fff;
border-radius: 0 0 20rpx 20rpx;
z-index: 1002;
overflow: auto;
transition: all 2.4s;
.category-view-all {
width: calc(100% - 20rpx);
display: flex;
flex-direction: row;
flex-wrap: wrap;
border-bottom: 1px solid #EEEEEE;
height: 360rpx;
overflow: auto;
transition: height 1.3s ease;
.category-item {
// display: flex;
// flex-direction: column;
// justify-content: center;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
.icon-box {
text-align: center;
.icon {
width: 90rpx;
height: 90rpx;
padding: 4rpx;
border-radius: 50%;
}
}
.name {
text-align: center;
.active {
width: fit-content;
font-size: 26rpx;
text-align: center;
padding: 6rpx;
border-radius: 10rpx;
line-height: 32rpx;
color: #fff;
background-color: #14CA65;
}
.no-active {
font-size: 26rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #616161;
line-height: 28rpx;
}
}
}
.category-tag {
margin-right: 17rpx;
margin-bottom: 20rpx;
width: fit-content;
height: fit-content;
display: inline-flex;
}
}
.arrow-up {
display: flex;
justify-content: center;
align-items: center;
font-size: 28rpx;
padding: 24rpx;
line-height: 32rpx;
}
}
/deep/ .u-tag {
flex: none;
width: auto;
}
</style>

View File

@@ -0,0 +1,87 @@
<template>
<view>
<view class="products_box">
<u-grid :border="false" col="2">
<u-grid-item v-for="(item,index) in productList" :key="index" @click="toDetailPage(item)">
<u-image src="/static/products/sy_bb.png" width="354rpx" height="539rpx" :lazy-load="true">
</u-image>
<view class="bgContent">
<view>
<u-image :src="imgUrl+item.cover" width="346rpx" height="320rpx" :lazy-load="true">
</u-image>
<view class="img_tag">{{item.cate_name}}</view>
</view>
<view style="padding: 14rpx 24rpx 14rpx 16rpx;">
<view class="title_box">
<text class="title">{{item.name}}</text>
<u-tag :text="item.tags" type="warning" shape="circle"></u-tag>
</view>
<view class="product_desc">
{{item.title}}
</view>
<view class="releaseDate">
<u-image src="/static/products/xp_icon_sjf.png" width="22rpx" height="22rpx"
:lazy-load="true">
</u-image>
<text class="release">发布日期</text>
<text>{{item.pub_time_str}}</text>
</view>
</view>
</view>
</u-grid-item>
</u-grid>
</view>
</view>
</template>
<script>
export default {
data() {
return {
queryParam: {
pageSize: 10,
pageNum: 1
},
queryTitle: null,
imgUrl: null,
productList: [],
tagsArray: [],
}
},
onLoad(options) {
this.imgUrl = uni.getStorageSync('img_url')
this.queryTitle = options.title
this.goSearch()
},
methods: {
goSearch() {
const data = {
...this.queryParam,
title: this.queryTitle
}
this.$apiServe.getProductList(data).then(res => {
let tags = res.data.data
if (tags) {
for (const item of tags) {
let tag = item.tags
this.tagsArray = tag.split(',')
item.tags = this.tagsArray[0]
}
this.productList = tags
}
}).finally(_ => {})
},
//点击图片跳转到详情页
toDetailPage(item) {
uni.navigateTo({
url: '/pages/detail/productsDetail/productsDetail?id=' + item.id
})
}
}
}
</script>
<style>
</style>

View File

@@ -0,0 +1,177 @@
<template>
<view>
<!-- 顶部导航栏 -->
<view class="top-search">
<customer-searchbar ref="search" :queryParam="queryParam" :search-bar-top="searchBarTop"
:search-bar-height="searchBarHeight" @search="goSearch" @back="goBack" />
</view>
<!-- 最近搜索 -->
<view class="recent-search" :style="{marginTop: Number(searchBarTop + searchBarHeight) + 'px',}">
<view class="title">
<text class="title-text">最近搜索</text>
<u-icon name="trash" color="#666666" size="24" @click="clearRecentSearch" />
</view>
<view class="recent-record">
<view v-if="recentRecordList.length > 0" class="no-empty-record">
<view v-for="(item, index) in recentRecordList" :key="index" class="tag-item">
<u-tag bg-color="#eee" borderColor="#eee" color="#666" :text="item"
@click="recentSearch(item)" />
</view>
</view>
<view v-else>
<view class="empty-record">
<text>暂无搜索记录</text>
</view>
</view>
</view>
</view>
<!-- 搜索发现 -->
<view class="search-found">
<view class="title">
<text class="title-text">搜索发现</text>
</view>
<view class="found-record">
<view v-for="(item, index) in foundList" :key="index" class="tag-item">
<u-tag bg-color="#eee" borderColor="#eee" color="#666" :text="item.name"
@click="recentSearch(item.name)" />
</view>
</view>
</view>
</view>
</template>
<script>
import {
toast
} from 'service/request.js'
export default {
data() {
return {
searchBarTop: 0, //搜索栏的外边框高度单位px
searchBarHeight: 0, //搜索栏的高度单位px
queryParam: '',
recentRecordList: [],
foundList: []
}
},
onLoad() {
this.getDiscover()
const tempList = uni.getStorageSync('storage_search_record')
this.recentRecordList = tempList ? tempList : [];
const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
this.searchBarTop = menuButtonInfo.top;
this.searchBarHeight = menuButtonInfo.height;
},
methods: {
goSearch(param) {
if (!param) {
toast.warn('请输入搜索内容')
return
}
this.queryParam = param
const index = this.recentRecordList.findIndex(item => {
return item === param
})
if (index > -1) {
this.recentRecordList.splice(index, 1)
}
this.recentRecordList.unshift(param)
try {
uni.setStorageSync('storage_search_record', this.recentRecordList);
} catch (e) {
// error
}
uni.navigateTo({
url: '../search-products/search-products?title=' + param
})
},
goBack() {
uni.navigateBack()
},
recentSearch(obj) {
this.queryParam = obj
// console.log(obj)
},
clearRecentSearch() {
this.recentRecordList = []
try {
uni.setStorageSync('storage_search_record', this.recentRecordList);
} catch (e) {
// error
}
},
getDiscover() {
this.$apiServe.getDiscover().then(res => {
this.foundList = res.data.data
}).finally(_ => {})
}
}
}
</script>
<style lang="less">
.top-search {
position: relative;
}
.recent-search {
.title {
padding: 32rpx 10rpx;
display: flex;
justify-content: space-between;
.title-text {
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #3E3E3E;
line-height: 42rpx;
}
}
.recent-record {
.empty-record {
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
line-height: 28rpx;
text-align: center;
}
.no-empty-record {
display: flex;
flex-wrap: wrap;
padding: 0 10rpx;
.tag-item {
margin: 0 20rpx 20rpx 0;
}
}
}
}
.search-found {
.title {
padding: 32rpx 10rpx;
.title-text {
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #3E3E3E;
line-height: 42rpx;
}
}
.found-record {
display: flex;
flex-wrap: wrap;
padding: 0 10rpx;
.tag-item {
margin: 0 20rpx 20rpx 0;
}
}
}
</style>

View File

@@ -1,20 +1,250 @@
{
"easycom": {
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
"autoscan": true, //是否自动扫描组件
"custom": {
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue",
"^ua-(.*)": "@/components/uview-ui/components/u-$1/u-$1.vue",
"^customer-(.*)": "@/components/uni-$1.vue" // 匹配components目录内的vue文件
}
},
"pages": [ //pages数组中第一项表示应用启动页参考https://uniapp.dcloud.io/collocation/pages
{
"pages": [{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "uni-app"
"navigationBarTitleText": "食瞳",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#12CA64",
//导航栏取消
// "navigationStyle": "custom",
//是否开启下拉刷新
"enablePullDownRefresh": true
}
},
{
"path": "pages/report/report",
"style": {
"navigationBarTitleText": "行业&需求",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#12CA64",
"enablePullDownRefresh": false
}
},
{
"path": "pages/ideasAndNeeds/ideasAndNeeds",
"style": {
"navigationBarTitleText": "创需发布",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#12CA64",
"enablePullDownRefresh": false
}
},
{
"path": "pages/my/my",
"style": {
"navigationBarTitleText": "我的",
"navigationBarTextStyle": "white",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},
{
"path": "pages/my/login/login",
"style": {
"navigationBarTitleText": "登录",
"navigationBarTextStyle": "white",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},
{
"path": "pages/detail/productsDetail/productsDetail",
"style": {
"navigationBarTitleText": "商品详情",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#12CA64",
"enablePullDownRefresh": false
}
}
],
"subPackages": [{
"root": "packageMy",
"pages": [{
"path": "bindCompany/bindCompany",
"style": {
"navigationBarTitleText": "绑定公司",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#12CA64",
"enablePullDownRefresh": false
}
}, {
"path": "browseHistory/browseHistory",
"style": {
"navigationBarTitleText": "浏览记录",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#12CA64",
"enablePullDownRefresh": false
}
}, {
"path": "memberCenter/memberCenter",
"style": {
"navigationBarTitleText": "会员中心",
"navigationBarTextStyle": "white",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
}, {
"path": "myRelease/myRelease",
"style": {
"navigationBarTitleText": "我的发布",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
}
}, {
"path": "changeAvatar/changeAvatar",
"style": {
"navigationBarTitleText": "修改头像",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
}
}, {
"path": "myCollection/myCollection",
"style": {
"navigationBarTitleText": "我的收藏",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#12CA64",
"enablePullDownRefresh": false
}
}]
},
{
"root": "packageSearch",
"pages": [{
"path": "search/search",
"style": {
"navigationBarTitleText": "顶部搜索",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#12CA64",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "goods-category-search/category-index",
"style": {
"navigationBarTitleText": "分类详情",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#12CA64",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}, {
"path": "search-products/search-products",
"style": {
"navigationBarTitleText": "产品列表",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#12CA64",
"enablePullDownRefresh": false
}
}
]
},
{
"root": "packageReport",
"pages": [{
"path": "newsList/newsList",
"style": {
"navigationBarTitleText": "行内新闻",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#12CA64",
"enablePullDownRefresh": true
}
}, {
"path": "certifiedCj/certifiedCj",
"style": {
"navigationBarTitleText": "认证厂家",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#12CA64",
"enablePullDownRefresh": true
}
}, {
"path": "newsDetail/newsDetail",
"style": {
"navigationBarTitleText": "行业新闻详情",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#12CA64",
"enablePullDownRefresh": false
}
},
{
"path": "certifiedCjDetail/certifiedCjDetail",
"style": {
"navigationBarTitleText": "厂家信息",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#12CA64",
"enablePullDownRefresh": false
}
}, {
"path": "newProductRelease/newProductRelease",
"style": {
"navigationBarTitleText": "企业需求",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#12CA64",
"enablePullDownRefresh": true
}
}
]
}
],
"tabBar": {
"color": "#CCCCCC",
"selectedColor": "#0EBB5B",
"borderStyle": "white",
"backgroundColor": "#FFFFFF",
"list": [{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "static/tabBar/sy_icon_syh.png",
"selectedIconPath": "static/tabBar/sy_icon_sy(1).png"
},
{
"pagePath": "pages/report/report",
"text": "行业&需求",
"iconPath": "static/tabBar/sy_icon_hyh.png",
"selectedIconPath": "static/tabBar/sy_icon_sy.png"
},
{
"pagePath": "pages/ideasAndNeeds/ideasAndNeeds",
"text": "创需发布",
"iconPath": "static/tabBar/sy_icon_cyh.png",
"selectedIconPath": "static/tabBar/sy_icon_cy.png"
},
{
"pagePath": "pages/my/my",
"text": "我的",
"iconPath": "static/tabBar/sy_icon_wdh.png",
"selectedIconPath": "static/tabBar/sy_icon_wd.png"
}
]
},
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"navigationBarBackgroundColor": "#12CA64",
"backgroundColor": "#F8F8F8"
},
"uniIdRouter": {}
"uniIdRouter": {},
"condition": { //模式配置,仅开发期间生效
"current": 0, //当前激活的模式(list 的索引项)
"list": [{
"name": "", //模式名称
"path": "", //启动页面,必选
"query": "" //启动参数在页面的onLoad函数里面得到
}]
}
}

View File

@@ -0,0 +1,429 @@
<template>
<view>
<view style="position: relative;padding-bottom: 100rpx;">
<u-image :src="imgUrl+detailList.cover" width="750rpx" height="530rpx">
</u-image>
<view class="collect" v-if="detailList.is_fav==0||!detailList.is_fav" @click="starTap">
<view class="star">
<u-image src="/static/detail/xp_icon_wstar.png" width="28rpx" height="28rpx">
</u-image>
</view>
<u-image src="/static/detail/xiangqing_icon_shoucang.png" width="119rpx" height="48rpx">
</u-image>
</view>
<view class="collect" v-if="detailList.is_fav==1" @click="cancelStarTap(detailList.fav_id)">
<view class="star">
<u-image src="/static/detail/xp_icon_star.png" width="28rpx" height="28rpx">
</u-image>
</view>
<u-image src="/static/detail/xiangqing_icon_shoucang.png" width="119rpx" height="48rpx">
</u-image>
</view>
<view class="content">
<view class="title_box">
<text class="title">{{detailList.name}}</text>
<view class="title_tag">{{detailList.cate_bname}}</view>
</view>
<view class="desc">
{{detailList.title}}
</view>
<view class="classify">
{{detailList.cate_name}}
</view>
<view class="tag_view">
<view>
<text class="tagOne" v-for="item in detailList.tags" :key="item.id">{{item}}</text>
</view>
<!-- thumb有值显示数字+ -->
<view v-if="detailList.thumb" class="heart">
<!-- 如果用户对该商品没有点赞显示灰星 -->
<u-image v-if="detailList.is_thumb==0" src="/static/detail/xp_icon_heart.png" width="34rpx"
height="32rpx" @click="heartTap">
</u-image>
<!-- 如果用户对该商品已经点赞显示黄星-->
<u-image v-if="detailList.is_thumb==1" src="/static/detail/xp_icon_ysc.png" width="34rpx"
height="32rpx" @click="cancelHeartTap(detailList.thumb_id)">
</u-image>
<text class="thumb">{{detailList.thumb}} </text>
</view>
<!-- thumb无值显示点赞二字 用户进行一次点赞之后显示1赞-->
<view v-else class="heart">
<view v-if="detailList.is_thumb==0" style="display: flex;">
<u-image src="/static/detail/xp_icon_heart.png" width="34rpx" height="32rpx"
@click="heartTap">
</u-image>
<text class="thumb" @click="heartTap">点赞</text>
</view>
<view v-if="detailList.is_thumb==1" style="display: flex;">
<!-- 用户是否点赞字段 showHeart -->
<u-image src="/static/detail/xp_icon_ysc.png" width="34rpx" height="32rpx"
@click="cancelHeartTap(detailList.thumb_id)">
</u-image>
<text class="thumb">{{detailList.thumb}} </text>
</view>
</view>
</view>
</view>
<view class="releaseDate">
<u-image src="/static/products/xp_icon_sjf.png" width="24rpx" height="24rpx">
</u-image>
<text class="release">发布日期</text>
<text>{{detailList.pub_time}}</text>
</view>
<u-parse :content="detailList.desc" @preview="preview" @navigate="navigate"></u-parse>
<u-modal :show="showCall" closeOnClickOverlay="false" confirmText="确定" @confirm="confirmCopy">
<rich-text :nodes="contentCopy"></rich-text>
</u-modal>
<view style="margin:0 20rpx;">
<u-overlay :show="!isLoad">
<login :timoutText="timoutText" @success="reOnLoad()" @fail="failToLoad()"></login>
</u-overlay>
</view>
<u-modal :show="showUpdate" :content='content' closeOnClickOverlay="false" showCancelButton="true"
confirmText="升级VIP" @confirm="confirm" @cancel="cancel" confirmColor="#0EBB5B">
<rich-text :nodes="updateContent"></rich-text>
</u-modal>
<u-modal :show="showUpdating" closeOnClickOverlay="false" confirmText="确定" @confirm="confirm">
<rich-text :nodes="updatingContent"></rich-text>
</u-modal>
</view>
<view class="footer" @click="showContact()">
<u-icon name="kefu-ermai" color="#fff" size="30rpx"></u-icon>
<text>联系客服</text>
</view>
</view>
</template>
<script>
import {
dateFormatDetail
} from '../../../utills/date.js'
import login from 'pages/my/login/login'
export default {
components: {
login
},
data() {
return {
id: '',
imgUrl: '',
showHeart: false,
detailList: [],
isLoad: true,
showUpdate: false,
showUpdating: false,
showCall: false,
kf_email: '',
updateContent: '您暂无权限访问请升级VIP访问',
updatingContent: '升级VIP正在审核中',
timoutText: 1,
contentCopy: `邮箱已复制,如需联系客服,请发送邮件。`
}
},
onLoad(option) {
this.imgUrl = uni.getStorageSync('img_url')
this.id = option.id
this.getProductDetail()
this.getKfEmail()
},
methods: {
//获取客服电话
getKfEmail() {
this.$apiServe.getKfEmail().then(res => {
this.kf_email = res.data.data.kf_email
}).finally(_ => {})
},
//获取详情信息
getProductDetail() {
this.$apiServe.getProductDetail(this.id).then(res => {
console.log('产品详情', res);
let detail = res.data.data
let dataCode = res.data.code
if (dataCode === -1 || res.statusCode == 500) {
this.isLoad = false
}
//授权登录拦截
if (dataCode == 0 && detail.mytpe == 1) {
this.isLoad = false
}
//跳转到升级VIP页面
if (dataCode == 0 && detail.mytpe == 2) {
this.showUpdate = true
}
//升级VIP正在审核中
if (dataCode == 0 && detail.mytpe == 3) {
this.showUpdating = true
}
if (detail) {
detail.pub_time = dateFormatDetail(detail.pub_time)
if (detail.tags) {
detail.tags = detail.tags.split(',')
}
// if (detail.is_thumb == 1 && parseInt(detail.thumb) == 1 && parseInt(detail
// .thumbcount) == 1) {
// console.log('222');
// detail.thumb = parseInt(detail.thumbcount)
// } else {
detail.thumb = parseInt(detail.thumb) + parseInt(detail.thumbcount)
// }
this.detailList = detail
}
}).finally(_ => {})
},
//点击star收藏
starTap() {
if (!uni.getStorageSync('loginToken')) {
this.$toast.warn('请登录后操作')
} else {
this.$apiServe.collect(this.id).then(res => {
if (res.data.code == 1) {
this.$toast.warn('收藏成功')
this.getProductDetail()
} else {
this.$toast.warn('收藏失败')
}
}).finally(_ => {})
}
},
//点击star取消收藏
cancelStarTap(fav_id) {
this.$apiServe.deleteHistoryOrCollection(fav_id).then(res => {
if (res.data.code == 1) {
this.$toast.warn('取消收藏')
this.getProductDetail()
} else {
this.$toast.warn('取消收藏失败')
}
}).finally(_ => {})
},
//点赞按钮
heartTap() {
if (!uni.getStorageSync('loginToken')) {
this.$toast.warn('请登录后操作')
} else {
this.$apiServe.thumb(this.id).then(res => {
if (res.data.code == 1) {
this.getProductDetail()
this.$toast.warn('点赞成功')
} else {
this.$toast.warn('点赞失败')
}
}).finally(_ => {})
}
},
//取消点赞
cancelHeartTap(thumb_id) {
this.$apiServe.cancelThumb(thumb_id).then(res => {
if (res.data.code == 1) {
this.getProductDetail()
this.$toast.warn('取消点赞')
} else {
this.$toast.warn('取消点赞失败')
}
}).finally(_ => {})
},
reOnLoad() {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.$toast.warn('登录失败请重试')
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return
}
this.isLoad = true
this.getProductDetail()
},
failToLoad() {
uni.reLaunch({
url: '/pages/index/index'
})
},
confirm() {
uni.navigateTo({
url: '../../../packageMy/memberCenter/memberCenter?ask=' + 1
})
},
cancel() {
uni.reLaunch({
url: '/pages/index/index'
})
},
// 联系客服模态框
showContact() {
uni.setClipboardData({
data: this.kf_email, //要被复制的内容
success: () => { //复制成功的回调函数
wx.hideLoading();
wx.hideToast();
this.showCall = true
}
})
},
confirmCopy() {
this.showCall = false
}
},
}
</script>
<style lang="scss">
.u-modal__content {
padding: 43rpx 43rpx !important;
// text-indent: 14rpx;
}
.collect {
display: flex;
position: absolute;
top: 16rpx;
right: 0;
color: #fff;
border-radius: 54rpx 0px 0px 54rpx;
padding: 2px 2px 2px 3px;
.star {
position: absolute !important;
top: 6px !important;
right: 77rpx;
z-index: 99;
}
}
.content {
padding: 20rpx;
background-color: #fff;
.title_box {
position: relative;
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
.title {
font-size: 48rpx;
font-weight: bold;
color: #134b40;
line-height: 60rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.title_tag {
height: 30rpx;
background: #0EBB5B;
border-radius: 7rpx;
font-size: 26rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
line-height: 28rpx;
padding: 1rpx 15rpx;
}
}
.desc {
font-size: 42rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #3E3E3E;
// line-height: 38rpx;
padding: 24rpx 0;
}
.classify {
width: 117rpx;
height: 40rpx;
border-radius: 6rpx;
border: 1rpx solid #EEEEEE;
font-size: 30rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
line-height: 40rpx;
padding: 1rpx 15rpx;
}
.tag_view {
display: flex;
justify-content: space-between;
align-items: center;
padding-top: 24rpx;
font-size: 30rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #CCCCCC;
// line-height: 28rpx;
.tagOne {
padding-right: 20rpx;
}
.heart {
display: flex;
.thumb {
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
line-height: 33rpx;
margin-left: 14rpx;
}
}
}
}
.releaseDate {
font-size: 30rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
line-height: 33rpx;
display: flex;
align-items: center;
padding: 24rpx 20rpx;
margin: 20rpx 0;
background-color: #fff;
.release {
padding: 0 10rpx 0 6rpx;
}
}
.footer {
position: fixed;
bottom: 0;
width: 100%;
height: 100rpx;
background: #0EBB5B;
display: flex;
flex-direction: column;
justify-content: center;
align-content: center;
text-align: center;
.u-icon {
justify-content: center;
}
text {
font-size: 20rpx;
font-family: MicrosoftYaHei-Bold, MicrosoftYaHei;
font-weight: bold;
color: #FFFFFF;
line-height: 26rpx;
}
}
</style>

View File

@@ -0,0 +1,485 @@
<template>
<view class="content">
<view class="top-tab">
<u-tabs :list="tabsList" :scrollable="false" lineWidth="25" lineColor="#0A994A" color="#969696"
:activeStyle="{color: '#15CA65', fontWeight: '400', transform: 'scale(1.05)', size:'20rpx'}"
lineHeight="4" :current="tabCurrent" @change="tabChange"></u-tabs>
</view>
<u--form :model="needsPublishForm" ref="uNeedsForm" :labelStyle="formLabelStyle">
<view style="margin-bottom: 20rpx;">
<u-form-item label="姓名" borderBottom>
<u-input v-model="needsPublishForm.name" :border="false" placeholder="请输入您的名称"
placeholder-style="color:#CCCCCC" :disabled="btnDisabled" disabledColor="#ffffff" />
</u-form-item>
<u-form-item label="城市">
<view class="select-view" @tap="btnDisabled==true?showCityPicker=false:showCityPicker = true">
<text v-if="needsPublishForm.area_name">{{needsPublishForm.area_name}}</text>
<text v-else style="color:#CCCCCC;">请选择所在城市</text>
<u-icon name="arrow-right" color="#969696" size="14"></u-icon>
</view>
<cityPicker :show-picker="showCityPicker" @cancel="showCityPicker = false" @confirm="getCityValue">
</cityPicker>
</u-form-item>
</view>
<view style="margin-bottom: 20rpx;">
<view v-if="tabCurrent === 1">
<u-form-item label="品名" borderBottom>
<u-input v-model="needsPublishForm.pname" :border="false" placeholder="请输入您的产品名称"
placeholder-style="color:#CCCCCC" :disabled="btnDisabled" disabledColor="#ffffff" />
</u-form-item>
<u-form-item label="分类" borderBottom>
<view class="select-view"
@tap="btnDisabled==true?showCategoryPicker=false: showCategoryPicker=true">
<text v-if="needsPublishForm.class">{{needsPublishForm.class}}</text>
<text v-else style="color:#CCCCCC;">请选择分类</text>
<u-icon name="arrow-right" color="#969696" size="14"></u-icon>
</view>
<u-picker :show="showCategoryPicker" :columns="categoryPickerList"
@cancel="showCategoryPicker = false" @confirm="getCategoryValue">
</u-picker>
</u-form-item>
</view>
<u-form-item label="产品" borderBottom>
<view class="select-view"
@tap="btnDisabled==true?showProductPicker=false: showProductPicker = true">
<text v-if="needsPublishForm.product">{{needsPublishForm.product}}</text>
<text v-else style="color:#CCCCCC;">请选择产品类型</text>
<u-icon name="arrow-right" color="#969696" size="14"></u-icon>
</view>
<u-picker :show="showProductPicker" :columns="productPickerColumn"
@cancel="showProductPicker = false" @confirm="getProductValue">
</u-picker>
</u-form-item>
<u-form-item label="定位" borderBottom>
<view class="select-view"
@tap="btnDisabled==true?showPositionPicker=false:showPositionPicker = true">
<text v-if="needsPublishForm.loc">{{needsPublishForm.loc}}</text>
<text v-else style="color:#CCCCCC;">请选择产品定位</text>
<u-icon name="arrow-right" color="#969696" size="14"></u-icon>
</view>
<u-picker :show=showPositionPicker :columns="positionPickerColumn"
@cancel="showPositionPicker = false" @confirm="getPositionValue">
</u-picker>
</u-form-item>
<view style="padding: 20rpx 15rpx;background-color: #fff;">
<u-textarea v-model="needsPublishForm.desc" border="surround" placeholder="请输入具体描述(限120字)"
:maxlength="120" placeholder-style="color:#CCCCCC" :disabled="btnDisabled"
disabledColor="#ffffff"></u-textarea>
</view>
</view>
<view v-if="tabCurrent === 1" style="margin-bottom: 20rpx;">
<u-form-item label="上传图片" labelPosition="top">
<view style="padding-left: 20rpx;margin-top: 20rpx;">
<u-upload :fileList="fileList1" :auto-upload="false" @afterRead="afterRead" @delete="deletePic"
name="1" multiple :maxCount="10" :disabled="btnDisabled"></u-upload>
</view>
</u-form-item>
</view>
<view style="background-color: #fff;">
<u-form-item v-if="false" label="联系方式" borderBottom>
<u-radio-group v-model="needsPublishForm.contactWay" placement="row">
<u-radio :customStyle="{marginRight: '16px'}" label="手机" name="mobile" :disabled="btnDisabled">
</u-radio>
<u-radio label="邮箱" name="email" :disabled="btnDisabled">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item label="手机" borderBottom>
<u--input placeholder="请输入手机号" :border="false" v-model="needsPublishForm.mobile"
placeholder-style="color:#CCCCCC" :disabled="btnDisabled" disabledColor="#ffffff"></u--input>
</u-form-item>
<u-form-item label="邮箱" borderBottom>
<u--input placeholder="请输入邮箱地址" :border="false" v-model="needsPublishForm.email"
:disabled="btnDisabled" placeholder-style="color:#CCCCCC"></u--input>
</u-form-item>
<view style="padding: 6rpx 20rpx 0;text-align: left;background-color: #fff;">
<text
style="font-size: 24rpx;font-family: PingFangSC-Regular, PingFang SC;font-weight: 400;color: #C8C8C8;line-height: 28rpx;">
联系方式将不对外发布如有相关意向平台会以您留下的联系方式通知您
</text>
</view>
<!-- <u-form-item label="验证" borderBottom>
<view style="display: flex;padding-right: 20rpx;align-items: center;">
<u--input placeholder="请输入验证码" :border="false" v-model="needsPublishForm.invalidCode"
placeholder-style="color:#CCCCCC"></u--input>
<u-code ref="uCode" @change="codeChange" keep-running change-text="倒计时XS"
@start="disabled = true" @end="disabled = false"></u-code>
<u-button size="small" type="primary" @tap="getCode" :text="tips" color="#EEEEEE"
:disabled="disabled" customStyle="color:#666666; width:160rpx;"></u-button>
</view>
</u-form-item> -->
<view style="padding: 30rpx;background-color: #fff;">
<u-button color="#0EBB5B" text="确定发布" @tap.stop="submitForm" :disabled="btnDisabled"></u-button>
</view>
<view style="padding: 12rpx 30rpx 20rpx 30rpx;background-color: #fff;">
<text
style="font-size: 24rpx;font-family: PingFangSC-Regular, PingFang SC;font-weight: 400;color: #C8C8C8;line-height: 28rpx;"
v-if="tabCurrent === 0">{{claim_r}}</text>
<text
style="font-size: 24rpx;font-family: PingFangSC-Regular, PingFang SC;font-weight: 400;color: #C8C8C8;line-height: 28rpx;"
v-if="tabCurrent === 1">{{claim_c}}</text>
</view>
</view>
</u--form>
<view style="margin:0 20rpx;">
<u-overlay :show="!isLoad">
<login @success="reOnLoad()" @fail="failToLoad()"></login>
</u-overlay>
</view>
</view>
</template>
<script>
import {
apiService
} from '../../service/request'
import login from '../my/login/login.vue'
export default {
components: {
login
},
data() {
return {
btnDisabled: false,
claim_r: '',
claim_c: '',
tabsList: [{
name: '需求发布'
}, {
name: '创意发布'
}],
tabCurrent: 0,
needsPublishForm: {},
formLabelStyle: {
'font-size': '32rpx !important'
},
showCityPicker: false,
showProductPicker: false,
showPositionPicker: false,
showCategoryPicker: false,
seconds: 10,
disabled: false,
tips: '获取验证码',
productPickerList: [],
productPickerColumn: [
[]
],
positionPickerList: [],
positionPickerColumn: [
[]
],
categoryPickerList: [],
fileList1: [],
isLoad: true,
cateName: null,
tagName: null,
token: null,
imgUrl: null
}
},
onTabItemTap() {
this.imgUrl = uni.getStorageSync('img_url')
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.isLoad = false
return
}
this.isLoad = true
this.token = uni.getStorageSync('loginToken')
this.tabCurrent = 0
this.fileList1 = []
this.needsPublishForm = {}
},
onLoad(options) {
this.imgUrl = uni.getStorageSync('img_url')
//我的发布点击修改回显数据
if (options && options.item && uni.getStorageSync(options.item)) {
try {
let publishFormList = uni.getStorageSync(options.item)
this.fileList1 = publishFormList.images.map(item => {
return {
url: item
}
})
this.needsPublishForm = publishFormList
} catch (error) {
this.$toast.warn(error)
}
}
if (options.index == 0) {
this.tabCurrent = 0
} else if (options.index == 1) {
this.tabCurrent = 1
}
if (options.view == 11) {
this.btnDisabled = true
}
// this.getProductPickerList()
},
onShow() {
this.getFormData()
},
methods: {
tabChange(data) {
this.tabCurrent = data.index
this.needsPublishForm = {}
this.fileList1 = []
this.btnDisabled = this.btnDisabled == true ? false : false;
},
getFormData() {
this.$apiServe.getIdeasAndNeedsFormdata().then(res => {
const formData = res.data.data
this.productPickerColumn[0] = formData.product
this.positionPickerColumn[0] = formData.loc
this.categoryPickerList[0] = formData.class
this.claim_r = formData.claim_r
this.claim_c = formData.claim_c
// this.productPickerList = res.data.data.map((item, index) => {
// temp.push(item.name)
// return item
// })
// this.productPickerColumn[0] = [...temp]
}).finally(_ => {})
},
// getProductPickerList() {
// const data = {}
// const temp = []
// this.$apiServe.getCategories(data).then(res => {
// this.productPickerList = res.data.data.map((item, index) => {
// temp.push(item.name)
// return item
// })
// // this.productPickerColumn[0] = [...temp]
// }).finally(_ => {})
// },
// getPositionPickerList() {
// if (this.needsPublishForm.cate_id) {
// const data = {
// pid: this.needsPublishForm.cate_id
// }
// this.$apiServe.getTags(data).then(res => {
// const temp = []
// this.positionPickerList = res.data.data.map((item, index) => {
// temp.push(item.name)
// return item
// })
// this.positionPickerColumn[0] = temp
// }).finally(_ => {})
// } else {
// that.$toast.warn('请先选择产品类型')
// }
// },
getCityValue(data) {
this.showCityPicker = false
this.needsPublishForm.area_name = data[0].join('-')
this.needsPublishForm.area_code = data[1]
},
getProductValue(data) {
this.showProductPicker = false
this.showCategoryPicker = false
this.needsPublishForm.product = data.value[0]
// const obj = this.productPickerList.find(item => {
// return item.name === data.value[0]
// })
// this.cateName = data.value[0]
// if (obj) {
// this.needsPublishForm.cate_id = obj.id
// }
// this.needsPublishForm.tagids = null
// this.getPositionPickerList()
},
getPositionValue(data) {
this.showPositionPicker = false
this.needsPublishForm.loc = data.value[0]
// const obj = this.positionPickerList.find(item => {
// return item.name === data.value[0]
// })
// this.tagName = data.value[0]
// if (obj) {
// this.needsPublishForm.tagids = obj.id
// }
},
getCategoryValue(data) {
this.showCategoryPicker = false
this.needsPublishForm.class = data.value[0]
},
getCode() {
if (this.$refs.uCode.canGetCode) {
// 模拟向后端请求验证码
uni.showLoading({
title: '正在获取验证码'
})
setTimeout(() => {
uni.hideLoading();
// 这里此提示会被this.start()方法中的提示覆盖
uni.$u.toast('验证码已发送');
// 通知验证码组件内部开始倒计时
this.$refs.uCode.start();
}, 2000);
} else {
uni.$u.toast('倒计时结束后再发送');
}
},
codeChange(text) {
this.tips = text;
},
// 删除图片
deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1)
},
// 新增图片
async afterRead(event) {
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
let lists = [].concat(event.file)
let fileListLen = this[`fileList${event.name}`].length
lists.map((item) => {
this[`fileList${event.name}`].push({
...item,
status: 'uploading',
message: '上传中'
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url)
let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
url: result
}))
fileListLen++
}
},
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: apiService.uploadImgUrl,
filePath: url,
name: 'file',
header: {
"Content-Type": "multipart/form-data",
"token": this.token
},
success: (res) => {
setTimeout(() => {
resolve(JSON.parse(res.data).data.url)
}, 1000)
}
});
})
},
submitForm() {
if (!this.needsPublishForm.mobile && !this.needsPublishForm.email) {
this.$toast.warn('请输入正确的手机号或者正确的邮箱地址')
return false
}
if (this.tabCurrent === 1 && this.fileList1.length < 1) {
this.$toast.warn('请至少上传一张图片')
return false
}
if (this.needsPublishForm.mobile && !/^1[3456789]\d{9}$/.test(this.needsPublishForm.mobile)) {
this.$toast.warn('请输入正确的手机号')
return false
} else if (this.needsPublishForm.email && !/^([0-9a-zA-Z_\.\-\])+\@([0-9a-zA-Z_\.\-\])+\.([a-zA-Z]+)$/
.test(this.needsPublishForm.email)) {
this.$toast.warn('请输入正确的邮箱地址')
return false
}
this.needsPublishForm.type = Number(this.tabCurrent + 1)
this.needsPublishForm.pub_time = this.needsPublishForm.pub_time ? this.needsPublishForm.pub_time :
Math.round(new Date().getTime() / 1000)
const temp = []
if (this.fileList1.length > 0) {
this.fileList1.map(item => {
const url = item.url
temp.push(url.replace(this.imgUrl + '/', ''))
})
}
this.needsPublishForm.images = temp.join(';')
const data = {
type: null,
name: null,
pname: null,
area_code: null,
area_name: null,
images: null,
mobile: null,
email: null,
class: null,
product: null,
loc: null,
desc: null,
pub_time: null,
...this.needsPublishForm
}
apiService.submitIdeasAndNeeds(data).then(res => {
if (res.data.code === 1) {
this.$toast.success('提交成功')
// if (this.needsPublishForm.id) {
uni.navigateTo({
url: '../../packageMy/myRelease/myRelease?index=' + (this.tabCurrent + 1)
})
// }
this.tabCurrent = 0
this.fileList1 = []
this.needsPublishForm = {}
} else {
this.$toast.warn(res.data.msg)
}
// this.$toast.success(res.data.msg)
}).catch(error => {
this.$toast.warn(error)
})
},
failToLoad() {
this.$toast.warn('登录失败请重试')
uni.reLaunch({
url: '/pages/index/index'
})
}
}
}
</script>
<style lang="less" scoped>
/deep/.u-textarea--disabled {
background-color: #ffffff !important;
}
/deep/.u-input {
background-color: #ffffff !important;
}
.content {
background-color: #F8F8F8;
.top-tab {
background-color: #fff;
margin-bottom: 10rpx;
}
.select-view {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14rpx 18rpx;
font-size: 30rpx;
}
/deep/.u-form-item__body__left__content__label {
font-size: 32rpx !important;
}
/deep/.u-form-item__body {
padding: 13rpx 0 !important;
}
/deep/.u-textarea {
border-radius: 20rpx;
border: 1px solid #EEEEEE;
}
}
</style>

View File

@@ -1,39 +1,267 @@
<!-- 首页 -->
<template>
<view class="wrap">
<u-swiper :list="list" keyName="image" showTitle :autoplay="false" circular />
<view>
<!-- 搜索框 -->
<view class="search_box">
<view class="search_box_border">
<u-input placeholder="搜索优质产品" placeholder-style="color: #969696" prefixIcon="search"
prefixIconStyle="font-size: 22px;color: #909399;margin-left:30rpx" readonly @tap="toSearch()">
</u-input>
</view>
</view>
<view class="content">
<!-- 分类模块 -->
<view class="classify">
<u-grid :border="false" col="5">
<u-grid-item v-for="(listItem,listIndex) in classifyList" :key="listIndex"
@click="toClassify(listItem.id)">
<u--image :src="imgUrl+listItem.icon" width="86rpx" height="86rpx" :lazy-load="true">
</u--image>
<!-- <u-icon size="86rpx" :name="listItem.icon"></u-icon> -->
<text class="grid-text">{{listItem.name}}</text>
</u-grid-item>
</u-grid>
</view>
<!-- 分类模块下的轮播图 -->
<view>
<u-swiper :list="swiperList" keyName="img" indicatorMode="line" radius="0" circular
@change="e => currentNum = e.current"
@click="handleSwiperList(currentNum==''?0:currentNum,swiperList)"></u-swiper>
</view>
<!-- 选项卡: 上架时间和点赞量 -->
<view>
<u-tabs :list="tabList" lineColor="#15CA65" scrollable="false"
activeStyle="color:#15CA65;font-weight: bold;" :current="tabCurrent" @change="tabChange">
</u-tabs>
</view>
<!-- 产品 -->
<productsByTime v-if="tabCurrent==0 && initStart" ref="productsByTime" @getTimeLength="getTimeLength">
</productsByTime>
<productsByThumb v-if="tabCurrent==1 && initStart" ref="productsByThumb" @getThumbLength="getThumbLength">
</productsByThumb>
<view style="font-size: 24rpx;color: #A3A3A3;text-align: center;padding: 26rpx 0;"
v-show="reachBottomLength===0">
没有更多数据了</view>
</view>
</view>
</template>
<script>
import {
serverHost
} from '@/service/request.js'
export default {
data() {
return {
list: [{
image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
classifyList: [],
tabCurrent: 0,
tabList: [{
name: '新品发布' // 上架时间(改)
},
{
image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
title: '身无彩凤双飞翼,心有灵犀一点通'
name: '企业需求' // 点赞量(改)
},
{
image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
}
],
imgUrl: '',
initStart: false,
swiperList: [],
reachBottomLength: '',
currentNum: ''
}
},
onLoad() {
onReachBottom() {
if (this.tabCurrent == 0 && this.reachBottomLength !== 0) {
this.$refs.productsByTime.pageNum++
this.$refs.productsByTime.getProductsByTime()
}
if (this.tabCurrent == 1 && this.reachBottomLength !== 0) {
this.$refs.productsByThumb.pageNum++
this.$refs.productsByThumb.getProductsByThumb()
}
},
created() {
this.getImgUrl()
},
methods: {
init() {
this.imgUrl = uni.getStorageSync('img_url')
this.getCategories()
this.getBanner()
wx.showShareMenu({
withShareTicket: true,
//设置下方的Menus菜单才能够让发送给朋友与分享到朋友圈两个按钮可以点击
menus: ["shareAppMessage", "shareTimeline"]
})
},
//分享到微信好友
onShareAppMessage(res) {
return {
title: '食瞳',
type: 0,
path: '/pages/index/index?id=' + distSource,
summary: "",
imageUrl: "https://pupil.hchyun.com/uploads/product/zhanwei02.png"
}
},
//分享到朋友圈
onShareTimeline(res) {
return {
title: '食瞳',
type: 0,
query: 'id=' + distSource,
summary: "",
imageUrl: "https://pupil.hchyun.com/uploads/product/zhanwei02.png"
}
},
//获取按上架时间排列的产品列表length
getTimeLength(e) {
this.reachBottomLength = e
},
//获取按点赞量排列的产品列表length
getThumbLength(e) {
this.reachBottomLength = e
},
//点击上架时间和点赞量切换页面
tabChange(data) {
this.tabCurrent = data.index
if (data.index == 0) {
this.$refs.productsByTime.getProductsByTime()
} else if (data.index == 1) {
this.$refs.productsByThumb.getProductsByThumb()
}
},
//获取一级分类
getCategories() {
this.$apiServe.getCategories().then(res => {
this.classifyList = res.data.data
}).finally(_ => {})
},
//获取首页轮播图
getBanner() {
this.$apiServe.getBanner().then(res => {
let banner = res.data.data
console.log('轮播图', banner);
if (banner) {
for (const item of banner) {
item.img = this.imgUrl + item.img
}
this.swiperList = res.data.data
}
}).finally(_ => {})
},
//点击轮播图
handleSwiperList(currentNum, swiperList) {
swiperList[currentNum].link = swiperList[currentNum].link.replace(/\s*/g, "")
uni.navigateTo({
url: '/' + swiperList[currentNum].link
})
},
//点击搜索框跳转到搜索页面
toSearch() {
uni.navigateTo({
url: '../../packageSearch/search/search'
})
},
//点击一级分类跳转到分类页
toClassify(id) {
uni.navigateTo({
url: '../../packageSearch/goods-category-search/category-index?categoryId=' + id
})
},
//获取图片url
getImgUrl() {
this.$apiServe.getImgUrl().then(res => {
res.data.data.img_url = res.data.data.img_url + '/'
try {
uni.setStorageSync('img_url', res.data.data.img_url);
this.initStart = true
this.init()
} catch (e) {
// error
}
}).finally(_ => {
})
}
}
}
</script>
<style lang="scss">
// 搜索框样式
.search_box {
background: linear-gradient(135deg, #12CA64 0%, #1ACA67 100%);
.search_box_border {
width: 94.6%;
height: 124rpx;
background: linear-gradient(320deg, #36E182 0%, #26DD76 100%, #26DD76 100%);
margin: 0 auto;
box-shadow: 0 -1px 3px 0 #31B96D;
border-radius: 38rpx 38rpx 0 0;
.u-border {
border: none;
padding-top: 16px !important;
.u-input__content {
height: 64rpx;
border-radius: 32rpx;
background-color: #fff;
.u-input__content__field-wrapper__field {
font-size: 26rpx !important;
}
}
}
}
}
.content {
//分类模块
.classify {
height: 350rpx;
background: #FFFFFF;
border-radius: 24rpx;
box-shadow: 0px 2px 4px 0px rgba(206, 206, 206, 0.5);
.u-grid {
padding-top: 30rpx;
.grid-text {
padding-top: 8rpx;
font-size: 24rpx;
}
.u-grid-item {
padding-bottom: 38rpx;
}
}
}
//轮播图
.u-swiper__wrapper__item__wrapper {
margin-top: 20rpx;
height: 290rpx;
}
.u-swiper-indicator__wrapper {
display: none !important;
}
// 选项卡
.u-tabs__wrapper__nav {
background-color: #FFFFFF;
.u-tabs__wrapper__nav__item {
padding: 0 !important;
flex: 1;
}
}
<style lang='scss' scoped>
.wrap {
padding: 40rpx;
}
</style>

127
pages/my/login/login.vue Normal file
View File

@@ -0,0 +1,127 @@
<template>
<view class="login-content">
<view style="text-align: center;margin-bottom:30rpx;">
<text>{{loginText}}</text>
</view>
<view style="padding-left: 30rpx;padding-right: 30rpx;display: flex;">
<u-button type="info" :plain="true" size="nomal" @click="$emit('fail')">取消</u-button>
<u-button open-type="getPhoneNumber" size="nomal" @getphonenumber="getphonenumber" color='#12CA64'>登录
</u-button>
</view>
</view>
</template>
<script>
import {
apiService,
loginSys
} from '@/service/request.js'
export default {
data() {
return {
loginText: '请登录后查看'
}
},
props: {
timoutText: {
type: String,
default: ''
}
},
created() {
if (this.timoutText == 1) {
this.loginText = "登录超时,请重新登录"
}
},
methods: {
getphonenumber(e) {
var that = this
console.log(e)
if (e.detail.errMsg === 'getPhoneNumber:ok') {
//调用接口利用 e.detail.encryptedData, e.detail.iv 信息来解密手机号
uni.login({
"provider": "weixin",
"onlyAuthorize": true, // 微信登录仅请求授权认证
success: function(event) {
const {
code
} = event
that.$apiServe.login({
code: code
}).then(res => {
var data = res.data.data
// console.log('登录code换取的信息', data);
uni.setStorageSync('loginToken', data.token);
that.$toast.success('登录成功')
that.$emit('success')
//登录完成后使用手机code换取手机号,调用/user/getMobileByMnp接口
//接口详细链接 https://docs.apipost.cn/preview/468be606f65cae75/3f2f988ddf82dd8e
const codeData = {
code: e.detail.code
}
apiService.postMobileByMnp(codeData).then(res => {
console.log(res)
})
})
},
fail: function(err) {
// 登录授权失败
// err.code是错误码
that.$emit('fail')
}
})
} else {
// 拒绝授权
that.$emit('fail')
}
}
// getphonenumber(e) {
// const {
// phoneCode
// } = e.detail;
// console.log("手机code : ", phoneCode);
// uni.login({
// "provider": "weixin",
// "onlyAuthorize": true, // 微信登录仅请求授权认证
// success: function(event) {
// const {
// code
// } = event
// console.log("登录code", code);
// //客户端成功获取授权临时票据code,向业务服务器发起登录请求。
// // 调用登录接口 拿到token 传手机code,更新手机号码
// loginSys(code).then(res => {
// console.log(res);
// //登录完成后使用手机code换取手机号,调用/user/getMobileByMnp接口
// //接口详细链接 https://docs.apipost.cn/preview/468be606f65cae75/3f2f988ddf82dd8e
// })
// },
// fail: function(err) {
// // 登录授权失败
// // err.code是错误码
// }
// })
// },
}
}
</script>
<style lang="less" scoped>
/deep/.u-button {
width: 40% !important;
}
.login-content {
width: 100%;
position: absolute;
top: 50%;
left: 50%;
padding: 50rpx 30rpx;
background-color: #fff;
transform: translate(-50%, -50%);
}
</style>

200
pages/my/my.vue Normal file
View File

@@ -0,0 +1,200 @@
<!-- 个人中心 -->
<template>
<view>
<u-navbar :autoBack="false" title="我的"></u-navbar>
<u--image src="/static/my/wo_icon_bj1.png" width="750rpx" height="349rpx">
</u--image>
<myAvatar ref="myavatar"></myAvatar>
<view class="table">
<u-cell-group>
<!-- <u-cell v-if="is_bind" size="large" title="绑定公司" icon="/static/my/wo_icon_bd.png" :isLink="true"
value="已绑定公司">
</u-cell> -->
<!-- <u-cell v-else size="large" title="绑定公司" icon="/static/my/wo_icon_bd.png" :isLink="true" value="未绑定公司"
@click="bindCompany()">
</u-cell> -->
<u-cell size="large" title="会员中心" icon="/static/my/wo_icon_hyzx.png" :isLink="true"
@click="toMemberCenter()"></u-cell>
<u-cell size="large" title="浏览记录" icon="/static/my/wo_icon_lljl.png" :isLink="true"
@click="toBrowseHistory()"></u-cell>
<u-cell size="large" title="我的收藏" icon="/static/my/wo_icon_sc.png" :isLink="true"
@click="toMyCollect()"></u-cell>
<u-cell size="large" title="我的发布" icon="/static/my/wo_icon_wdfb.png" :isLink="true"
@click="toMyRelease()"></u-cell>
<u-cell size="large" title="联系客服" icon="/static/my/wo_icon_lxkf.png" :isLink="true"
@click="showModal()">
</u-cell>
</u-cell-group>
<u-modal :show="showM" showCancelButton closeOnClickOverlay="false" confirmText="是" cancelText="否"
@confirm="confirm" @cancel="cancel">
<view>
<view>{{mobile}}</view>
<text>是否拨打客服电话</text>
</view>
</u-modal>
</view>
<view style="margin:0 20rpx;">
<u-overlay :show="!isLoad">
<login @success="reOnLoad()" @fail="failToLoad()"></login>
</u-overlay>
</view>
</view>
</template>
<script>
import login from 'pages/my/login/login'
export default {
components: {
login
},
data() {
return {
showM: false,
mobile: '',
isLoad: true,
is_bind: false
}
},
onTabItemTap() {
this.$refs.myavatar.getUser()
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.isLoad = false
return
}
this.isLoad = true
},
onLoad() {
if (uni.getStorageSync('com_mobile')) {
this.is_bind = true
}
this.getCsTel()
},
methods: {
//获取客服电话
getCsTel() {
this.$apiServe.getCsTel().then(res => {
if (res.data.data) {
this.mobile = res.data.data.cs_tel
}
}).finally(_ => {})
},
//跳转到绑定公司页面
bindCompany() {
uni.navigateTo({
url: '../../packageMy/bindCompany/bindCompany'
})
},
//跳转到会员中心页面
toMemberCenter() {
uni.navigateTo({
url: '../../packageMy/memberCenter/memberCenter'
})
},
//跳转到浏览记录页面
toBrowseHistory() {
uni.navigateTo({
url: '../../packageMy/browseHistory/browseHistory'
})
},
//跳转到我的收藏页面
toMyCollect() {
uni.navigateTo({
url: '../../packageMy/myCollection/myCollection'
})
},
//跳转到我的发布页面
toMyRelease() {
uni.navigateTo({
url: '../../packageMy/myRelease/myRelease'
})
},
// 联系客服模态框
showModal() {
this.showM = true
},
confirm() {
this.showM = false
let phone = this.mobile
phone = phone.toString()
uni.makePhoneCall({
phoneNumber: phone,
success: function() {
console.log('拨打电话成功');
},
fail() {
console.log('打电话失败了');
}
})
},
cancel() {
this.showM = false
},
reOnLoad() {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.$toast.warn('登录失败请重试')
this.isLoad = false
return
}
this.isLoad = true
if (this.isLoad) {
this.$refs.myavatar.getUser()
}
},
failToLoad() {
uni.reLaunch({
url: '/pages/index/index'
})
}
}
}
</script>
<style lang="scss">
.u-navbar__content__left {
display: none !important;
}
.table {
background-color: #fff;
margin-top: 50rpx;
}
.u-line {
display: none !important;
}
.u-cell--clickable {
background-color: #fff !important;
}
.u-cell {
border-bottom: 1rpx solid #EEEEEE;
}
.u-cell:last-child {
border: none !important;
}
.u-icon__icon--info {
font-size: 28rpx !important;
}
.u-cell__title-text {
margin-left: 20rpx;
font-size: 26rpx !important;
color: #252421;
line-height: 33rpx !important;
}
.u-cell__value {
font-size: 26rpx !important;
color: #CCCCCC !important;
}
.u-modal__content {
padding: 43rpx 104rpx !important;
text-indent: 25rpx;
}
</style>

180
pages/report/report.vue Normal file
View File

@@ -0,0 +1,180 @@
<template>
<view style="padding-bottom: 50rpx;">
<!-- classify -->
<view class="classify">
<u-grid :border="false" col="3">
<u-grid-item v-for="(listItem,listIndex) in classifyList" :key="listIndex" @click="click(listIndex)">
<u--image :src="listItem.src" width="86rpx" height="86rpx" :lazy-load="true">
</u--image>
<text class="grid-text">{{listItem.title}}</text>
</u-grid-item>
</u-grid>
</view>
<!-- 行业新闻 -->
<view>
<view class="subtitle">
<u--image src="/static/report/hy_icon_xwx.png" width="24rpx" height="24rpx" :lazy-load="true">
</u--image>
<text class="xw_text text">行业新闻</text>
</view>
<news></news>
</view>
<!-- 企业需求 -->
<view>
<view class="subtitle">
<u--image src="/static/report/hy_icon_fux.png" width="24rpx" height="24rpx" :lazy-load="true">
</u--image>
<text class="xpfb_text text">企业需求</text>
</view>
<productsByThumb></productsByThumb>
</view>
<!-- 认证厂家 -->
<view v-if="token==true">
<view class="subtitle">
<u--image src="/static/report/hy_icon_cjx.png" width="24rpx" height="24rpx" :lazy-load="true">
</u--image>
<text class="rzcj_text text">认证厂家</text>
</view>
<certifiedCj></certifiedCj>
</view>
<view style="margin:0 20rpx;">
<u-overlay :show="!isLoad">
<login @success="reOnLoad()" @fail="failToLoad()"></login>
</u-overlay>
</view>
</view>
</template>
<script>
import login from 'pages/my/login/login'
export default {
components: {
login
},
data() {
return {
isLoad: true,
token: '',
classifyList: [{
src: '/static/report/hy_icon_xw.png',
title: '行业新闻'
},
{
src: '/static/report/hy_icon_fu.png',
title: '企业需求'
},
{
src: '/static/report/hy_icon_cj.png',
title: '认证厂家'
},
],
}
},
onLoad() {
if (uni.getStorageSync('loginToken')) {
this.token = true
}
},
onShow() {
if (uni.getStorageSync('loginToken')) {
this.token = true
}
},
methods: {
//点击一级分类
click(listIndex) {
//点击行内新闻时
if (listIndex == 0) {
uni.navigateTo({
url: '../../packageReport/newsList/newsList'
})
} else if (listIndex == 1) {
uni.navigateTo({
url: '../../packageReport/newProductRelease/newProductRelease'
})
} else if (listIndex == 2) {
if (uni.getStorageSync('loginToken')) {
uni.navigateTo({
url: '../../packageReport/certifiedCj/certifiedCj'
})
} else {
this.isLoad = false
}
}
},
reOnLoad() {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.$toast.warn('登录失败请重试')
this.isLoad = false
return
}
this.isLoad = true
if (this.isLoad) {
uni.navigateTo({
url: '../../packageReport/certifiedCj/certifiedCj'
})
}
},
failToLoad() {
uni.reLaunch({
url: '/pages/report/report'
})
}
}
}
</script>
<style lang="scss">
//分类模块
.classify {
background: #FFFFFF;
border-radius: 0 0 24rpx 24rpx;
box-shadow: 0px 2px 4px 0px rgba(206, 206, 206, 0.5);
padding-bottom: 30rpx;
margin: 0 16rpx;
.u-grid {
padding-top: 22rpx;
.grid-text {
padding-top: 8rpx;
font-size: 24rpx;
}
}
}
.subtitle {
margin: 24rpx 0 16rpx 16rpx;
display: flex;
align-items: center;
.text {
font-size: 28rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
line-height: 40rpx;
padding-left: 4rpx;
}
}
.xw_text {
color: #5ACCF0;
}
.u-image__error {
position: static !important;
}
.xpfb_text {
color: #FCAC18;
}
.rzcj_text {
color: #78E13A;
}
</style>

461
service/request.js Normal file
View File

@@ -0,0 +1,461 @@
const serverHost = 'https://www.foodtops.cn/api' // https://api-ugo-web.itheima.net'
function isOutTime(res) {
if (res.data.message === '请先登录') {
uni.showToast('登录信息已过期,请重新登录')
setTimeout(() => {
uni.redirectTo({
url: '/pages/login/login'
})
}, 1000)
uni.removeStorageSync('userInfo')
uni.removeStorageSync('token')
} else {
// uni.showToast(res.data.message);
}
}
const service = {
get(url, data) {
const header = {}
// header['Authorization'] = 'Bearer ' + uni.getStorageSync('token')
header['token'] = uni.getStorageSync('loginToken')
header['content-type'] = 'application/json'
return new Promise((resolve, reject) => {
uni.request({
method: 'get',
url: serverHost + url,
data: data,
header: header,
success: res => {
// // 调用接口成功
// if (!res.data.data) {
// isOutTime(res)
// reject(res)
// }
resolve(res)
},
fail: err => {
// 调用接口失败
reject(err)
}
})
})
},
post(url, data, isLogin) {
const header = {}
header['token'] = uni.getStorageSync('loginToken')
header['content-type'] = 'application/json'
return new Promise((resolve, reject) => {
uni.request({
method: 'post',
url: serverHost + url,
data: data,
header: header,
timeout: 30000,
success: res => {
uni.hideLoading()
// if (res.data.exception === 'UnAuthorizedException') {
// let pages = getCurrentPages()
// let page = (pages[pages.length - 1]).route
// if (!page.includes('login')) {
// uni.navigateTo({
// url: `/pages/login/login`
// })
// }
// }
// if (res.data.message) {
// isOutTime(res);
// toast.error(res.data.message)
// reject(res);
// }
// if (isLogin && !res.data.access_token) {
// reject(res);
// } else {
// resolve(res);
// }
resolve(res)
},
fail: err => {
console.log('err', err)
uni.hideLoading()
// 调用接口失败
try {
toast.error(err.data.message)
} catch (errr) {
toast.error('服务器出错')
}
reject(err)
}
})
})
},
put(url, data, isLogin) {
const header = {}
header['token'] = uni.getStorageSync('loginToken')
header['content-type'] = 'application/json'
return new Promise((resolve, reject) => {
uni.request({
method: 'put',
url: serverHost + url,
header: header,
success: res => {
// if (!res.data.flag) {
// isOutTime(res)
// reject(res)
// }
resolve(res)
},
data: data,
fail: err => {
// 调用接口失败
// toast.error(res.data.message)
uni.hideLoading()
reject(err)
}
})
})
},
putWithFormData(url, data, isLogin) {
const header = {}
header['token'] = uni.getStorageSync('loginToken')
header['content-type'] = 'application/x-www-form-urlencoded'
return new Promise((resolve, reject) => {
uni.request({
method: 'put',
url: serverHost + url,
header: header,
success: res => {
// if (!res.data.flag) {
// isOutTime(res)
// reject(res)
// }
resolve(res)
},
data: data,
fail: err => {
// 调用接口失败
// toast.error(res.data.message)
uni.hideLoading()
reject(err)
}
})
})
},
delete(url, data, isLogin) {
const header = {}
header['token'] = uni.getStorageSync('loginToken')
header['content-type'] = 'application/json'
return new Promise((resolve, reject) => {
uni.request({
method: 'delete',
url: serverHost + url,
data: data,
header: header,
success: res => {
resolve(res)
},
fail: err => {
// 调用接口失败
// toast.error(res.data.message)
uni.hideLoading()
reject(err)
}
})
})
}
}
const toastDuration = 1500
const toast = {
// duration: 1500,
success: (text, dur) => {
// $wuxToptips().success({
// hidden: false,
// text: text || '成功',
// duration: dur || toastDuration
// });
uni.showToast({
title: text || '成功',
duration: dur || toastDuration
})
},
warn: text => {
// $wuxToptips().warn({
// hidden: false,
// text: text || '未知警告',
// duration: toastDuration
// });
uni.showToast({
icon: 'none',
title: text || '未知警告',
duration: toastDuration
})
},
error: text => {
// $wuxToptips().error({
// hidden: false,
// text: text || '未知错误',
// duration: toastDuration
// });
uni.showToast({
icon: 'none',
title: text || '未知错误',
duration: toastDuration
})
}
}
const apiService = {
uploadImgUrl: serverHost + `/upload/image/`,
imgUrl: serverHost,
// login: data => {
// data = Object.assign(data || {}, {})
// const url = `/api`
// return new Promise((resolve, reject) => {
// resolve(service.post(url, data, true))
// })
// },
//登录接口
login(data) {
const url = `/login/mnpLogin`
return new Promise((resolve, reject) => {
resolve(service.post(url, data))
})
},
// 获取首页轮播图
getBanner(data) {
const url = `/home/banner`
return new Promise((resolve, reject) => {
resolve(service.get(url, data))
})
},
// 获取产品列表
getProducts(data) {
const url = `/home/product`
return new Promise((resolve, reject) => {
resolve(service.get(url, data))
})
},
// 获取产品详情
getProductDetail(id) {
const url = `/home/pdetail/?productId=${id}`
return new Promise((resolve, reject) => {
resolve(service.get(url, id))
})
},
// 获取行业新闻
getNews(data) {
const url = `/news/nlists`
return new Promise((resolve, reject) => {
resolve(service.get(url, data))
})
},
// 获取行业新闻详情
getNewsDetail(id) {
const url = `/news/ndetail?newsId=${id}`
return new Promise((resolve, reject) => {
resolve(service.get(url, id))
})
},
// 获取认证厂家列表
getCertifiedCj(data) {
const url = `/news/flists`
return new Promise((resolve, reject) => {
resolve(service.get(url, data))
})
},
// 获取认证厂家详情
getCertifiedCjDetail(id) {
const url = `/news/fdetail?fId=${id}`
return new Promise((resolve, reject) => {
resolve(service.get(url, id))
})
},
//绑定公司和升级VIP
bindComponyAndUpdate(data) {
const url = `/center/update`
return new Promise((resolve, reject) => {
resolve(service.post(url, data))
})
},
//获取历史记录或收藏
getHistoryOrCollection(type) {
const url = `/center/favlist/?type=${type}`
return new Promise((resolve, reject) => {
resolve(service.get(url, type))
})
},
//删除历史记录或收藏
deleteHistoryOrCollection(id) {
const url = `/center/delfav/?id=${id}`
return new Promise((resolve, reject) => {
resolve(service.post(url, id))
})
},
//获取创意发布&需求发布
getIdeasAndNeeds(type) {
const url = `/center/rlist?type=${type}`
return new Promise((resolve, reject) => {
resolve(service.get(url, type))
})
},
//删除创意发布&需求发布
deleteIdeasAndNeeds(id) {
const url = `/center/delreq/?id=${id}`
return new Promise((resolve, reject) => {
resolve(service.delete(url, id))
})
},
//收藏按钮
collect(pid) {
const url = `/center/addfav/?pid=${pid}`
return new Promise((resolve, reject) => {
resolve(service.post(url, pid))
})
},
//点赞按钮
thumb(pid) {
const url = `/center/thumb/?pid=${pid}`
return new Promise((resolve, reject) => {
resolve(service.post(url, pid))
})
},
//取消(清除)点赞
cancelThumb(id) {
const url = `/center/thumbcls/?id=${id}`
return new Promise((resolve, reject) => {
resolve(service.post(url, id))
})
},
//获取个人信息
getUser() {
const url = `/center/userinfo`
return new Promise((resolve, reject) => {
resolve(service.get(url))
})
},
//修改个人信息
updateUser(data) {
const url = `/center/userupdate`
return new Promise((resolve, reject) => {
resolve(service.post(url, data))
})
},
// 获取客服电话
getCsTel() {
const url = `/center/cfg?key=cs_tel`
return new Promise((resolve, reject) => {
resolve(service.get(url))
})
},
// 获取客服邮箱
getKfEmail() {
const url = `/center/cfg?key=kf_email`
return new Promise((resolve, reject) => {
resolve(service.get(url))
})
},
// 获取首页分类Tag
getTags(data) {
const url = `/home/tags`
return new Promise((resolve, reject) => {
resolve(service.get(url, data))
})
},
// 获取首页分类
getCategories(data) {
const url = `/home/classlist`
return new Promise((resolve, reject) => {
resolve(service.get(url, data))
})
},
// 获取首页分类
getProductsByCateId(data) {
const url = `/home/plist`
return new Promise((resolve, reject) => {
resolve(service.get(url, data))
})
},
// 搜索发现 热搜
getDiscover() {
const url = `/home/discover`
return new Promise((resolve, reject) => {
resolve(service.get(url))
})
},
// 搜索产品
getProductList(data) {
const url = `/home/product`
return new Promise((resolve, reject) => {
resolve(service.get(url, data))
})
},
// 图片基本地址
getImgUrl() {
const url = `/center/cfg?key=img_url`
return new Promise((resolve, reject) => {
resolve(service.get(url))
})
},
// 新增
addOutboundOrder(data) {
const url = `/api`
return new Promise((resolve, reject) => {
resolve(service.post(url, data))
})
},
// 提交
deliveryOrderConfirm(data) {
const url = `/api`
return new Promise((resolve, reject) => {
resolve(service.post(url, data))
})
},
// 提交
submitIdeasAndNeeds(data) {
let url = `/require/release/`
if (data.id) {
url = `/require/update/`
}
return new Promise((resolve, reject) => {
resolve(service.putWithFormData(url, data))
})
},
getIdeasAndNeedsFormdata(data) {
const url = `/require/formdata/`
return new Promise((resolve, reject) => {
resolve(service.post(url, data))
})
},
postMobileByMnp(data) {
const url = `/user/getMobileByMnp`
return new Promise((resolve, reject) => {
resolve(service.post(url, data))
})
},
postImage(data) {
const url = `/upload/image/`
return new Promise((resolve, reject) => {
resolve(service.post(url, data))
})
},
// 解密
decrypt(data) {
const url = `/api`
return new Promise((resolve, reject) => {
resolve(service.post(url, {
data
}))
})
},
// 国密sm4加密
sm4Encrypt(data) {
const url = `/api`
return new Promise((resolve, reject) => {
resolve(service.sm(url, data))
})
}
}
export {
apiService,
toast
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
static/detail/cj_bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 693 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 594 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

BIN
static/my/sdfb_icon_xg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 773 B

BIN
static/my/wd_icon_bj.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 B

BIN
static/my/wo_icon_bd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
static/my/wo_icon_bj1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

BIN
static/my/wo_icon_hyzx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

BIN
static/my/wo_icon_lljl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
static/my/wo_icon_lxkf.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
static/my/wo_icon_pthy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
static/my/wo_icon_sc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
static/my/wo_icon_vip.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
static/my/wo_icon_wdfb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
static/products/sy_bb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 847 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Some files were not shown because too many files have changed in this diff Show More